"use strict";(self.webpackChunklibreriasiglo_theme=self.webpackChunklibreriasiglo_theme||[]).push([[6797],{5570:(t,e,n)=>{n.d(e,{Z:()=>l});var s=n(1660),i=n(7941),r=n(548),o=n(7667),a=n(7272),u=n(1157),d=Object.defineProperty,h=(t,e,n)=>(((t,e,n)=>{e in t?d(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,"symbol"!=typeof e?e+"":e,n),n);const c=class t extends a.wy{constructor(t){super(t),h(this,"header"),h(this,"body"),h(this,"mouseMoveListener",null),h(this,"clientX",0),h(this,"clientY",0),h(this,"deleting",!1),this.header=new p(t+" .header"),this.body=new p(t+" .body"),"checkout"!==document.body.id&&(this.header.initEvents(),this.body.initEvents(),this.header.onHoverIn((()=>{this.cartItems>0&&this.body.show()})),this.header.onHoverOut((()=>setTimeout((()=>{this.body.isHovering||this.header.isHovering||this.hide()}),200))),this.body.onHoverOut((()=>setTimeout((()=>{this.body.isHovering||this.header.isHovering||this.deleting||this.hide()}),200))),this.on("click",'[data-link-action="delete-from-cart"]',(t=>{t.preventDefault(),this.startDeleting();const e=t.getCurrentTarget();(0,i.R1)(e.href,e.dataset,e.dataset.linkAction).then((()=>r.Z.emit(s.Z.deletedProductFromCart,{event:t,reason:e.dataset}))).finally((()=>this.stopDeleting()))})))}static instance(e=".blockcart.cart-preview"){return t._instance||(t._instance=new t(e)),t._instance}get cartItems(){return parseInt(this.dataset.cartitems||"0")}get refreshUrl(){return this.dataset.refreshUrl}reset(){return super.reset(),this.header.reset(),this.body.reset(),this.body.isVisible()||this.setHovering(!1),this}setHovering(t){this.header.setHovering(t),this.body.setHovering(t)}hide(){this.body.hide()}startDeleting(){this.mouseMoveListener||(this.mouseMoveListener=t=>{this.clientX=t.clientX,this.clientY=t.clientY},document.addEventListener("mousemove",this.mouseMoveListener)),this.deleting=!0,u.Z.show()}stopDeleting(){if(this.deleting=!1,u.Z.hide(),this.mouseMoveListener){const t=this.getElementFromPoint();t&&!o.Z.elementIsInsideOf(t,this.header.element,this.body.element)&&this.hide(),document.removeEventListener("mousemove",this.mouseMoveListener),this.mouseMoveListener=null,this.clientX=this.clientY=0}}getElementFromPoint(){return document.elementFromPoint(this.clientX,this.clientY)}};h(c,"_instance");let l=c;class p extends a.wy{constructor(){super(...arguments),h(this,"hovering",!1)}initEvents(){this.on("mouseenter",(t=>this.mouseenterHandler(t))),this.on("mouseleave",(t=>this.mouseleaveHandler(t)))}get isHovering(){return this.hovering}onHoverIn(t){this.listeners.add("hoverIn",{eventHandler:t})}onHoverOut(t){this.listeners.add("hoverOut",{eventHandler:t})}mouseenterHandler(t){this.setHovering(!0),this.listeners.get("hoverIn").forEach((e=>e.eventHandler(t)))}mouseleaveHandler(t){this.setHovering(!1),this.listeners.get("hoverOut").forEach((e=>e.eventHandler(t)))}setHovering(t){this.hovering=t}show(){this.element().style.display="block"}hide(){this.element().style.display="none"}}},5864:(t,e,n)=>{n.d(e,{K:()=>u,Z:()=>a});var s=n(548),i=n(1660),r=n(7655);const o=new(n(1251).Z)("blockcart-modal");function a(t){r.ZP.addContext(o)}o.dialog.setClasses("modal-lg"),o.on("hidden.bs.modal",(t=>{const e=t.currentTarget;"undefined"!==e.innerText&&s.Z.emit(i.Z.updateProduct,{reason:e.dataset,event:t})}));const u=t=>r.ZP.context(o.name).append(t).show()},7655:(t,e,n)=>{n.d(e,{Vd:()=>c,ZP:()=>p,c_:()=>m});var s=n(548),i=n(7887),r=n(1760),o=n(3322),a=n(1251),u=n(7022),d=Object.defineProperty,h=(t,e,n)=>(((t,e,n)=>{e in t?d(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,"symbol"!=typeof e?e+"":e,n),n);class c extends o.Z{constructor(t,e){super(e),h(this,"_header",null),h(this,"_content",null),h(this,"_body",null),h(this,"_footer",null),h(this,"_loading",null),h(this,"_contextEvents",[]),h(this,"_contexts",{}),h(this,"_context",null),this.identifier=t}get header(){return this._assignHeader()}get body(){return this._assignBody()}get footer(){return this._assignFooter()}get loading(){return this._assignLoading()}get content(){return this._content||(this._assignHeader(),this._assignBody(),this._assignFooter(),this._assignLoading(),this._content=new i.ZP(".modal-content.real",this.element)),this._content}hide(){super.hide(),this.loading.hide()}append(t){return this.content.empty().append(t),this}empty(){return this.content.empty(),this}addContext(t){this._contexts[t.name]=t;for(const e in t._events)this._contextEvents.includes(e)||(this._contextEvents.push(e),this.on(e,(t=>{var n;return null==(n=this._context)?void 0:n.callEvent(e,this.element,t)})))}context(t){for(const t in this._contexts)this.classList.remove(...this._contexts[t].classes),this.dialog.classList.remove(...this._contexts[t].dialog.classes);let e=this._contexts[t];return e||(e=new a.Z(t),this.addContext(e)),this.classList.add(...e.classes),this.dialog.classList.add(...e.dialog.classes),e.header.title&&this.header.setTitle(e.header.title),e.body.text&&this.body.setText(e.body.text),this._context=e,this}getContext(t){return void 0!==this._contexts[t]?this._contexts[t]:null}_instanceBootstrapModal(){const t=super._instanceBootstrapModal();return r.ZP.setModal(this,t),t}_assignHeader(){return this._header?this._header:this._header=new u.xB(this)}_assignBody(){return this._body?this._body:this._body=new u.fe(this)}_assignFooter(){return this._footer?this._footer:this._footer=new u.mz(this)}_assignLoading(){if(!this._loading){const t=this.querySelector(".modal-content.loader-container");this._loading=new r.gb(new r.YM(".page-loader",t),new r.$j(".spinner",t))}return this._loading}}const l=new c("main","#modal-main"),p=l;function m(t="Debes iniciar sesión.",e=null){e||(e=l),e.empty().context("must-login").header.setTitle("Iniciar sesión").body.setText(t).footer.showCancel().footer.showAccept("Iniciar sesión",s.Z.urls.pages.authentication).show()}},1660:(t,e,n)=>{n.d(e,{Z:()=>s,u:()=>i});const s={updatedAddressForm:"updatedAddressForm",quickviewOpened:"quickviewOpened",clickQuickView:"clickQuickView",handleError:"handleError",responsiveUpdate:"responsiveUpdate",updateCart:"updateCart",updatedCart:"updatedCart",updateProductList:"updateProductList",updateProduct:"updateProduct",updatedProduct:"updatedProduct",updateFacets:"updateFacets",requestFacetList:"requestFacetList",updateFacetList:"updateFacetList",updatedDeliveryForm:"updatedDeliveryForm",orderConfirmationErrors:"orderConfirmationErrors",showErrorNextToAddtoCartButton:"showErrorNextToAddtoCartButton",deletedProductFromCart:"deletedProductFromCart",wishlistEventBusInit:"wishlistEventBusInit"},i={updateAddressForm:"updateAddressForm",addProductToCart:"addProductToCart",updateProductInCart:"updateProductInCart",updateProductQuantityInCart:"updateProductQuantityInCart",updatedProductCombination:"updatedProductCombination"}},7941:(t,e,n)=>{n.d(e,{R1:()=>u});var s=n(1660),i=n(548),r=n(3177),o=n(8954);class a extends Error{constructor(t,e=!0,n=null){super(t instanceof Array?t.join(" "):t),this.errors=t instanceof Array?t:[t],this.hasError=e,this.response=n}}function u(t,e,n){return new Promise(((u,d)=>{r.Z.abortPreviousRequest().post(t,{ajax:"1",action:"update"}).then((t=>{u(function(t,e){return function(t=null,e=null){const n={resp:t||{}};n.resp.cart||(n.resp.cart=null),e&&(n.dataset=e),i.Z.emit(s.Z.updateCart,n)}(t,e),t}(t,e))})).catch((t=>{d(function(t,e,n=null){const r={resp:t,eventType:e};n&&(r.cartAction=o.Z.camelize(n)),i.Z.emit(s.Z.handleError,r);let u="Error";return void 0!==t.status?u=`${t.statusText}: ${t.url}`:void 0!==t.message?u=t.message:("string"==typeof t||t instanceof String)&&t&&(u=t),new a(u,!0,t)}(t,s.u.updateProductInCart,n))}))}))}},5251:(t,e,n)=>{n.d(e,{Kd:()=>p,d9:()=>l}),n(1660),n(3032);var s=n(5570),i=n(7655),r=n(5864),o=Object.defineProperty,a=(t,e,n)=>(((t,e,n)=>{e in t?o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,"symbol"!=typeof e?e+"":e,n),n);class u{constructor(t){a(this,"reason"),a(this,"propagation"),a(this,"resp"),t=t||{},this.reason=t.reason||{},this.resp=t.resp||{},this.propagation=!0}get idProduct(){return this.reason.idProduct}get idProductAttribute(){return this.reason.idProductAttribute}get idCustomization(){return this.reason.idCustomization}get linkAction(){return this.reason.linkAction}hasError(){return!!this.resp.hasError}isCartUpdatedWithQuantityError(){return this.hasError()&&!!this.resp.cartUpdatedWithQuantityError}isContext(t){return!!this.resp.context&&(void 0===t||this.resp.context===t)}updateReason(t){return Object.assign(this.reason,t),this}deleteHasError(){return delete this.resp.hasError,this}stopPropagation(){this.propagation=!1}isStopped(){return!this.propagation}}var d=n(548),h=(n(14),n(3177));const c=[];function l(t){return e=this,null,n=function*(){const e=new u(t);for(const t of c){const n=t(e);if(n instanceof Promise&&(yield n),e.isStopped())break}e.isStopped()||function(t){const e=s.Z.instance(),n=e.refreshUrl;let o={};t.hasError()?d.Z.emit("showErrorNextToAddtoCartButton",{errorMessage:t.resp.errors.join("
")}):o={id_product:t.idProduct,id_product_attribute:t.idProductAttribute,id_customization:t.idCustomization,action:t.linkAction},h.Z.post(n,o).then((t=>{e.replaceWith(t.preview),t.modal&&(i.ZP.loading.hide(),i.ZP.hideOnlyModal((()=>(0,r.K)(t.modal))))})).catch((t=>d.Z.emit("handleError",{eventType:"updateShoppingCart",resp:t})))}(e)},new Promise(((t,s)=>{var i=t=>{try{o(n.next(t))}catch(t){s(t)}},r=t=>{try{o(n.throw(t))}catch(t){s(t)}},o=e=>e.done?t(e.value):Promise.resolve(e.value).then(i,r);o((n=n.apply(e,null)).next())}));var e,n}const p=t=>c.push(t)},14:(t,e,n)=>{n(3032)},8473:(t,e,n)=>{n(5511),n(6331),n(7326),Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable},570:(t,e,n)=>{n.d(e,{ZP:()=>a});var s=n(6331);n(8473);const i="Escape";class r{constructor(t,e,n){this.input=t,this.incrementButton=new o(this,e,1),this.decrementButton=new o(this,n,-1),this.input.addEventListener("keydown",(t=>{"ArrowUp"===t.key?this.changeQuantity(1):"ArrowDown"===t.key?this.changeQuantity(-1):t.key===i&&this.blur()})),void 0!==this.updateUrl&&this.input.addEventListener("keyup",(t=>{this.input.value!==this.baseValue?this.showConfirmationButtons():this.showSpinButtons(),"Enter"===t.key?this.sendUpdateQuantityEvent(1):t.key===i&&this.showSpinButtons()}))}get alertId(){return this.input.dataset.alertId}get baseValue(){const t=this.input.getAttribute("value");return null===t?"":t}get classList(){return this.input.classList}get currentValue(){return Number(this.input.value)}get dataset(){return this.input.dataset}get mode(){return"confirmation"===this.input.dataset.mode?"confirmation":"spin"}get updateUrl(){return this.input.dataset.updateUrl}changeQuantity(t){const e=Number(this.baseValue),n=this.currentValue,s=Number(this.input.getAttribute("min")),i=Math.max(n+t,s),r=this.isValidCurrentValue(i);this.input.value=String(r?i:e)}isValidCurrentValue(t){return t=void 0!==t?t:this.currentValue,!Number.isNaN(t)&&Number.isInteger(t)&&!!t}toggleSpinner(t){return(t>0?this.incrementButton:this.decrementButton).toggleSpinner(),this}setValue(t){this.input.value=t,this.input.setAttribute("value",t)}resetValue(){this.input.value=this.baseValue}showSpinButtons(){if("confirmation"===this.mode){this.toggleButtonsIcons().setMode("spin");const t=this.baseValue;t&&(this.input.value=t)}return this}blur(){this.input.blur(),this.incrementButton.blur(),this.decrementButton.blur()}setAvailable(t){const e=this.input.parentNode;e&&(t?e.classList.remove("unavailable"):e.classList.add("unavailable"))}showConfirmationButtons(){"confirmation"!==this.mode&&this.toggleButtonsIcons().setMode("confirmation")}toggleButtonsIcons(){return this.incrementButton.toggleIcons(),this.decrementButton.toggleIcons(),this}setMode(t){return this.input.dataset.mode=t,this}sendUpdateQuantityEvent(t,e){const n=Number(this.baseValue),s=this.currentValue-n;if(this.isValidCurrentValue()&&0!==s){this.toggleSpinner(t);const n=new CustomEvent("quantityInputUpdateQuantity",{bubbles:!0,detail:{quantityInput:this,quantity:s,change:t}});(e||this.input).dispatchEvent(n)}}}class o{constructor(t,e,n){this.quantityInput=t,this.button=e,this.change=n,e.addEventListener("click",(()=>{"confirmation"===this.quantityInput.mode&&this.change<0?this.quantityInput.showSpinButtons():("confirmation"!==this.quantityInput.mode&&t.changeQuantity(this.change),void 0!==t.updateUrl&&this.quantityInput.sendUpdateQuantityEvent(this.change,this.button)),this.blur()})),this.currentIcon=this.button.querySelector("i:not(.d-none)")}toggleSpinner(){var t,e;this.button.toggleAttribute("disabled"),null==(t=this.currentIcon)||t.classList.toggle("d-none"),null==(e=this.button.querySelector(s.zS.spinner))||e.classList.toggle("d-none")}toggleIcons(){this.button.querySelectorAll("i").forEach((t=>t.classList.toggle("d-none"))),this.currentIcon=this.button.querySelector("i:not(.d-none)")}blur(){this.button.blur()}}function a(t=s.zS.default){const e="string"==typeof t?document.querySelector(t):t;if(e){const t=e.querySelector("input");if(t){const n=e.querySelector(s.zS.increment),i=e.querySelector(s.zS.decrement);if(n&&i)return new r(t,n,i)}}return null}},7326:(t,e,n)=>{},6331:(t,e,n)=>{n.d(e,{zS:()=>s});const s={default:".js-qty-input",modal:".modal-dialog .js-quantity-button",increment:".js-increment-button",decrement:".js-decrement-button",confirm:".confirmation",icon:".material-icons",spinner:".spinner-border",alert:t=>`#js-product-line-alert--${t}`}}}]);