PageSourceSearch

https://www.benandfrank.com/_next/static/chunks/pages/shop/cart-2a405ca206fffca3.js

js benandfrank.com collected 2026-09-25 19:06:14 UTC 67,382 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3672],{60066:function(t,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/shop/cart",function(){return n(6562)}])},6562:function(t,e,n){"use strict";n.r(e),n.d(e,{__N_SSP:function(){return tU},default:function(){return CartPage}});var i,r=n(50851),a=n(24246),o=n(27378),l=n(80059),s=n(21573),u=n(51223),c=n(30207),d=n(38944),m=n(46882),p=n(31655),v=n(73868),f=n(86677),g=n(45690),h=n(97663),y=n.n(h),C=n(90909),b=n(92410),_=n(93133),S=n(75275),x=n(71897),k=n(5943),w=n.n(k),EmptyCart_EmptyCart=t=>{let{collectionUrl:e,className:n,promotionalCard:i}=t;return(0,a.jsxs)("div",{className:(0,d.Z)(w().root,n),children:[(0,a.jsx)(S.default,{size:"sm",tag:"p",children:"Tu carrito est\xe1 vac\xedo :("}),(0,a.jsx)(S.default,{size:"sm",tag:"p",children:"Sigue gastando, digo comprando..."}),(0,a.jsx)(x.default,{id:"empty-cart-button",size:"md",className:w().button,href:e,children:"Ver productos"}),i&&(0,a.jsx)("div",{className:w().cardProductCont,children:i})]})},N=n(84028),P=n(38579),I=n.n(P),j=n(69438),L=n(1078),A=n(44851);let T=/\bsin\s+graduaci[oó]n\b|\bwithout\s+graduation\b|\bsin\s+aumento\b|\bcon\s+graduaci[oó]n\b|\bmonofocal\b|\bprogresivo\b|\bbifocal\b|\bmultifocal\b|^graduaci[oó]n\s*:|^f[oó]rmula\s*:|^high\s+index\b/i,D=/^polarizado\s*:|^mica\s+solar\s*:|^lente\s+solar\s*:/i,R=/fotoentint|fotoint/i,O=/fotocrom/i,Z=/^antirreflejante\b/i,z=/^tratamiento\s+adicional\s*:|^additional\s+treatment\s*:|^material\s*:|\bestuche\b/i,E=["lensTreatment","photochromic","photoentinted","graduation","antireflective","additional","generic"];var B=n(92290);let F=[/^tratamiento adicional:\s*/i,/^additional treatment:\s*/i,/^graduación:\s*/i,/^graduation:\s*/i,/^fórmula:\s*/i,/^formula:\s*/i,/^tratamiento:\s*/i,/^treatment:\s*/i,/^material:\s*/i];function stripEmbeddedListLabels(t){let e=t.trim();for(let t=0;t<4;t++){let t=!1;for(let n of F){let i=e.replace(n,"").trim();if(i!==e){e=i,t=!0;break}}if(!t)break}return e}function isPresent(t){return null!=t&&""!==t&&"undefined"!==t}let M=new Set(["size","color","polarized"]);function makeRow(t,e,n){return{label:t,value:e,slot:n,group:M.has(n)?"pdp":"treatments"}}function formatPregraduationDiopter(t){let e=t.trim();return/^[+-]/.test(e)?e:/^\d+\.\d+$/.test(e)?"+".concat(e):e}let q={size:0,color:0,polarized:0,graduation:0,additional:1,antireflective:1,photochromic:2,photoentinted:2,generic:3};function treatmentColumnRank(t){var e;return"graduation"===t.slot&&(e=t.value,/^high\s+index\b/i.test(e.trim()))?3:q[t.slot]}function treatmentTypeLine(t,e,n){let i=n.test(e)?e.replace(n,"").trim():e;return"".concat(t," ").concat(i.toLowerCase())}var U=n(66763),V=n.n(U);let AttributesList=t=>{let{productAttributes:e,variantDescription:n,size:i,color:r,pregraduation:l,graduation:s,treatment:u,additionalTreatment:c,productType:m,productCategory:p,isConfirmation:v,className:f,section:g="all"}=t,{t:h}=(0,C.$)("organisms",{keyPrefix:"attributesList"}),y=(0,o.useMemo)(()=>(function(t,e){if("all"===e)return t;let n=t.filter(t=>t.group===e);return"treatments"!==e?n:[...n].sort((t,e)=>treatmentColumnRank(t)-treatmentColumnRank(e))})(function(t,e){var n,i;let r=[],a=!!e.omitColor,o=t("attributeColor"),l=[],s=null!==(n=e.variantDescription)&&void 0!==n?n:[],u=function(t){if(!t)return!1;let e=Array.isArray(t)?t:[t];return e.some(t=>"pregraduated"===String(t).toLowerCase().replace(/_/g,"-"))}(e.productCategory);if(s.length>0){let n=s.length,r=null!==(i=s.find(isPresent))&&void 0!==i?i:null;
1s.forEach((i,o)=>{var s,c;if(!isPresent(i))return;let d=(s=e.productType,c=e.productCategory,(0,B.R)(n,s,c,r)?0===o?"color":"generic":0===o?"size":1===o?"color":2===o?"graduation":"generic");if(a&&"color"===d)return;let m=stripEmbeddedListLabels(i);l.push(makeRow("color"===d?t("attributeColor"):"size"===d?t("attributeSize"):"graduation"===d?t("attributeGraduation"):"",u&&2===o?formatPregraduationDiopter(m):m,d))})}if(l.length>0)r.push(...l);else{let n=isPresent(e.size)?e.size.trim():null,i=isPresent(e.color)?e.color.trim():null,l=isPresent(e.pregraduation)?e.pregraduation.trim():null;if(u&&n&&i)r.push(makeRow(t("attributeSize"),stripEmbeddedListLabels(n),"size")),a||r.push(makeRow(o,stripEmbeddedListLabels(i),"color")),l&&r.push(makeRow(t("attributeGraduation"),formatPregraduationDiopter(l),"graduation"));else if(n&&i)r.push(makeRow(t("attributeSize"),stripEmbeddedListLabels(n),"size")),a||r.push(makeRow(o,stripEmbeddedListLabels(i),"color"));else if(i){let n=(0,B.R)(1,e.productType,e.productCategory,i);a&&n||r.push(makeRow(n?o:t("attributeSize"),stripEmbeddedListLabels(i),n?"color":"size"))}else if(n){let i=(0,B.R)(1,e.productType,e.productCategory,n);a&&i||r.push(makeRow(i?o:t("attributeSize"),stripEmbeddedListLabels(n),i?"color":"size"))}}return!function(t,e,n){let i=function(t){var e;let n=null!==(e=t.productAttributes)&&void 0!==e?e:[];return n.length>0?n.filter(isPresent).map(t=>t.trim()):[t.graduation,t.treatment,t.additionalTreatment].filter(isPresent).map(t=>t.trim())}(n);if(0===i.length)return;let r=i.map(t=>({kind:function(t,e){let n=t.trim();return n&&"undefined"!==n?Z.test(n)?"antireflective":z.test(n)?"additional":R.test(n)?"photoentinted":O.test(n)?"photochromic":D.test(n)?"lensTreatment":T.test(n)?"graduation":function(t,e){let n=(null!=t?t:"").toLowerCase().replace(/_/g,"-");return"sunglasses"===n||(function(t){if(!t)return[];let e=Array.isArray(t)?t:[t];return e.map(t=>String(t).toLowerCase().replace(/_/g,"-"))})(e).includes("sunglasses")}(null==e?void 0:e.productType,null==e?void 0:e.productCategory)&&n.length<48&&!(0,A.O)(n)?"lensTreatment":"generic":"generic"}(t,{productType:n.productType,productCategory:n.productCategory}),value:stripEmbeddedListLabels(t)}));for(let i of E)for(let{kind:l,value:s}of r)if(l===i){var a,o;t.push(makeRow((a=n.productType,o=n.productCategory,"graduation"===l?!function(t){let e=t.trim().toLowerCase();return!!(/\bsin\s+graduaci[oó]n\b/.test(e)||/\bwithout\s+graduation\b/.test(e)||/\bprogresivo\b/.test(e)||/\bprogressive\b/.test(e)||/^high\s+index\b/.test(e)||/^micas\s+fotocrom/.test(e)||/^micas\s+fotoentint/.test(e)||/^micas\s+fotoint/.test(e)||/^cristales\s+fotocrom/.test(e)||/^cristales\s+fotoentint/.test(e)||/^cristales\s+fotoint/.test(e)||/^sin\s+aumento\b/.test(e))}(s)?e("attributeGraduation"):"":"lensTreatment"===l||"photochromic"===l||"photoentinted"===l?!function(t){let e=t.trim().toLowerCase();return/^polarizado\s*:/.test(e)||/^mica\s+solar\s*:/.test(e)||/^micas\s+fotocrom/.test(e)||/^micas\s+fotoentint/.test(e)||/^cristales\s+fotocrom/.test(e)||/^cristales\s+fotoentint/.test(e)||/^lentes\s+fotocrom/.test(e)||/^fotocrom[aá]tico\s*:/.test(e)||/^lente\s+solar\s*:/.test(e)||/^sin\s+aumento\b/.test(e)}(s)?"lensTreatment"===l&&function(t,e){let n=(null!=t?t:"").toLowerCase().replace(/_/g,"-");if("sunglasses"===n)return!0;let i=Array.isArray(e)?e:e?[e]:[];return i.some(t=>"sunglasses"===String(t).toLowerCase().replace(/_/g,"-"))}(a,o)&&e("attributePolarized")||e("attributeTreatment"):"":"antireflective"===l?e("attributeTreatment"):"additional"===l?e("attributeAdditionalTreatment"):""),s,"lensTreatment"===l?"polarized":"graduation"===l?"graduation":"photochromic"===l?"photochromic":"photoentinted"===l?"photoentinted":"antireflective"===l?"antireflective":"additional"===l?"additional":"generic"))}}(r,t,e),r}(h,{variantDescription:n,productAttributes:e,size:i,color:r,pregraduation:l,graduation:s,treatment:u,additionalTreatment:c,productType:m,productCategory:p}),g),[h,n,e,i,r,l,s,u,c,m,p,g]);if(0===y.length)return null;let b=!v&&"pdp"===g,_=b?y.filter(t=>"color"===t.slot):[],S=b?y.filter(t=>"color"!==t.slot):y;return(0,a.jsxs)("div",{className:(0,d.Z)(V().pdpAttributeStack,f),children:[_.map((t,e)=>(0,a.jsx)(AttributeLine,{row:t,isConfirmation:!1,section:g,className:(0,d.Z)(V().c
1olorRow,!r&&"hidden"),t:h},"color-".concat(t.value,"-").concat(e))),S.length>0&&(0,a.jsx)("ul",{className:(0,d.Z)(V().productAttributes,{[V().centeredAttributes]:!v,[V().leftAlignedAttributes]:v}),children:S.map((t,e)=>(0,a.jsx)("li",{children:(0,a.jsx)(AttributeLine,{row:t,isConfirmation:!!v,section:g,t:h})},"".concat(t.label,"-").concat(t.value,"-").concat(e)))})]})};function AttributeLine(t){let{row:e,isConfirmation:n,section:i,className:r,t:o}=t;return(0,a.jsxs)(S.default,{tag:"p",weight:"normal",size:n?void 0:"base",className:(0,d.Z)(V().variantDescriptionItem,r),children:[n?"• ":"","treatments"===i?function(t,e){let n=function(t){let e=t.trim(),n=e.indexOf(":");return -1===n?e:e.slice(n+1).replace(/^\s*color\s+/i,"").trim()}(e.value);return"photochromic"===e.slot?treatmentTypeLine(t("treatmentPhotochromic"),n,/^fotocrom[aá]tico\b/i):"photoentinted"===e.slot?treatmentTypeLine(t("treatmentPhotoentinted"),n,/^fotoentintado\b/i):"antireflective"===e.slot?treatmentTypeLine(t("treatmentAntireflective"),n,/^antirreflejante\b/i):n}(o,e):(0,a.jsx)(AttributeText,{label:e.label,value:e.value})]})}function AttributeText(t){let{label:e,value:n}=t,i="".concat(e?"".concat(e," "):"").concat(n),r=i.indexOf(":");return -1===r?(0,a.jsx)(a.Fragment,{children:i}):(0,a.jsxs)(a.Fragment,{children:[i.slice(0,r+1),(0,a.jsx)("span",{className:V().attributeValue,children:i.slice(r+1)})]})}function hasAttr(t){return null!=t&&""!==t&&"undefined"!==t}let Q=["stuff","giftcard","gift-card"];function normalize(t){var e;return null!==(e=null==t?void 0:t.replace(/_/g,"-").toLowerCase())&&void 0!==e?e:""}var CartItemDetails_CartItemDetails=t=>{var e,n;let{className:i,productName:r,productImageUrl:o,productVariant:l,productAttributes:s,productUrl:u="#",productPrice:c,discountPrice:m,variantDescription:p,size:v,color:f,pregraduation:g,graduation:h,treatment:y,additionalTreatment:C,productType:b,productCategory:_,crossedOut:x=!1,isConfirmation:k=!1,attributeSection:w}=t,N={coupon:{width:60,height:40},product:{width:200,height:100}}[r.includes("descuento")?"coupon":"product"],P=null!==(e=null==p?void 0:p.some(hasAttr))&&void 0!==e&&e||null!==(n=null==s?void 0:s.some(hasAttr))&&void 0!==n&&n||hasAttr(v)||hasAttr(f)||hasAttr(g)||hasAttr(h)||hasAttr(y)||hasAttr(C),A=function(t,e){let n=[t,...Array.isArray(e)?e:[e]].map(normalize);return n.some(t=>Q.some(e=>t.includes(e)))}(b,_),T=!A&&hasAttr(f)?f:!A&&hasAttr(l)?l:null;return(0,a.jsxs)("div",{className:(0,d.Z)(V().root,i),children:[o&&(0,a.jsx)(j.Z,{href:u,children:(0,a.jsx)("div",{className:V().imageContainer,style:{width:N.width,height:N.height},children:(0,a.jsx)(I(),{src:o,alt:r,fill:!0,style:{objectFit:"contain"}})})}),(0,a.jsx)(j.Z,{href:u,className:(0,d.Z)(V().productNameLink,{[V().selfLeftAligned]:k}),children:k?(0,a.jsxs)(S.default,{tag:"p",size:"base",weight:"bold",children:[r," ",l&&"- ".concat(l)]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.default,{tag:"p",size:"base",className:V().desktopProductName,children:T?"".concat(r," / ").concat(T):r}),(0,a.jsx)(S.default,{tag:"p",size:"base",className:V().mobileProductName,children:r})]})}),c&&k&&(0,a.jsx)(L.Z,{price:c,discountPrice:m,className:(0,d.Z)(V().productPriceItem,V().confirmationPrice),crossedOut:x}),P&&(0,a.jsx)(AttributesList,{productAttributes:null!=s?s:[],variantDescription:p,size:v,color:A?null:f,pregraduation:g,graduation:h,treatment:y,additionalTreatment:C,productType:b,productCategory:_,isConfirmation:k,section:null!=w?w:k?"all":"pdp",className:(0,d.Z)({[V().selfLeftAligned]:k})}),c&&!k&&(0,a.jsx)(L.Z,{price:c,discountPrice:m,className:V().productPriceItem,crossedOut:x})]})},K=n(66839),$=n(69776),X=n.n($),QuantityCart_QuantityCart=t=>{let{quantity:e,callbackOnChange:n,className:i,productId:r,maxQuantityLimit:l=99,disabledControls:s=!1}=t,[u,c]=(0,o.useState)(e),m=u<=1,p=u===l,v=(0,o.useCallback)(()=>{if(u<1)return;let t=u-1;c(t),n(r,t)},[n,u,r]),f=(0,o.useCallback)(()=>{if(u>=l)return;let t=u+1;c(t),n(r,t)},[n,u,l,r]);return(0,o.useEffect)(()=>{c(e)},[e]),(0,a.jsx)("div",{className:(0,d.Z)(X().root,i),children:(0,a.jsxs)("div",{className:X().content,children:[!s&&(0,a.jsx)(K.Z,{onClick:v,id:"quantityCart-cta-decrement",icon:"circle-minus",filled:m,iconSize:"lg",className:X().quantityModifier}),(0,a.jsx)(S.default,{tag:"p",size:"base",className:X().quantity,children:u}),!s&&(0,a.jsx)(K.Z,{onClick:f,id:"quantityCart-cta-increment",disabled:p,icon:"circle-plus",iconSize:"lg",className:X().quantityModifier})]})})},J=n(88359),G=n.n(J),CartItem_CartItem=t=>{let{className:e,productPrice:n,quantity:i=0,uuid:r,crossedOut:l,productImageUrl:s,altImage:u,productName:c,productVariant:m,productAttributes:p,discountPrice:v,onDeleteItem:f,changeQuantity:g,canChangeQuantity:h=!0,maxQuantityLimit:y=99,productUrl:C="/",variantDescription:b,size:_,color:S,pregraduation:x,graduation:k,treatment:w,additionalTreatment:P,productType:A,productCategory:T,disabledControls:D}=t,R=(0,o.useCallback)(()=>{f(r)},[f,r]);return(0,a.jsxs)("div",{className:(0,d.Z)(G().root,e),children:[(0,a.jsxs)("div",{className:G().articleSummary,children:[(0,a.jsx)("div",{className:G().imageContainer,children:(0,a.jsx)(j.Z,{href:C,children:(0,a.jsx)(I(),{src:s,alt:u,width:288,height:160,className:G().productImage})})}),(0,a.jsx)(N.Z,{className:G().pipeSeparatorItemDetails}),(0,a.jsxs)("div",{className:G().articleDetails,children:[(0,a.jsx)(CartItemDetails_CartItemDetails,{variantDescription:b,size:_,color:S,pregraduation:x,graduation:k,treatment:w,additionalTreatment:P,productName:c,productVariant:m,className:G().cartItemsDetail,productAttributes:p,productUrl:C,productType:A,productCategory:T,attributeSection:"pdp"}),(0,a.jsx)("div",{className:G().midColumn,children:h?(0,a.jsx)(QuantityCart_QuantityCart,{disabledControls:D,quantity:i,callbackOnChange:g,productId:r,maxQuantityLimit:y}):(0,a.jsx)(AttributesList,{productAttributes:null!=p?p:[],variantDescription:b,size:_,color:S,pregraduation:x,graduation:k,treatment:w,additionalTreatment:P,productType:A,productCategory:T,section:"treatments"})}),(0,a.jsx)(L.Z,{price:n,crossedOut:l,discountPrice:v,className:G().productPriceItem}),(0,a.jsx)(K.Z,{onClick:R,className:G().removeItemButton,icon:"trash",iconSize:"lg",id:"cartItem-cta-remove"})]})]}),(0,a.jsx)(N.Z,{className:G().articlesSeparator})]})},H=n(90601),W=n.n(H),CartList_CartList=t=>{let{items:e,className:n,changeQuantity:i,maxQuantityLimit:r=99,onDeleteItem:o,productSkuDisabledControls:l}=t,s=(0,d.Z)(W().root,n);return(0,a.jsx)("div",{className:s,children:(0,a.jsxs)("div",{className:W().itemsContainer,children:[e&&e.length>0&&(0,a.jsx)(N.Z,{className:W().listStartSeparator}),e&&e.length>0&&e.map(t=>{var e,n;let s=function(t){var e,n,i,r,a,o,l,s,u;
1let c=null!==(i=t.displayName)&&void 0!==i?i:"",d=null!==(r=null===(e=t.image)||void 0===e?void 0:e.url)&&void 0!==r?r:"#",m=null!==(a=null===(n=t.image)||void 0===n?void 0:n.alt)&&void 0!==a?a:c,p=null!==(o=t.basePriceFormatted)&&void 0!==o?o:"",v=t.discountLineFormatted,f=null!==(l=t.crossedOut)&&void 0!==l&&l,g=null===(s=t.canChangeQuantity)||void 0===s||s,h=null!==(u=t.productUrl)&&void 0!==u?u:"/shop/cart";return{title:c,imageUrl:d,altImage:m,basePriceFormatted:p,discountLineFormatted:v,crossedOut:f,canChangeQuantity:g,baseUrl:h,productPrice:null!=v?v:p,discountPrice:v?p:""}}(t),u=t.sku?"".concat(s.baseUrl,"?variant=").concat(t.sku):s.baseUrl;return(0,a.jsx)(CartItem_CartItem,{disabledControls:t.sku===l,productImageUrl:s.imageUrl,altImage:s.altImage,productPrice:s.productPrice,productName:s.title,discountPrice:s.discountPrice,crossedOut:s.crossedOut,productAttributes:[],size:t.size,color:t.color,pregraduation:t.pregraduation,variantDescription:t.variantDescription,graduation:t.graduation,treatment:t.treatment,additionalTreatment:t.additionalTreatment,productType:null===(e=t.attributes)||void 0===e?void 0:e.productType,productCategory:null===(n=t.attributes)||void 0===n?void 0:n.category,onDeleteItem:o,uuid:t.id,changeQuantity:i,maxQuantityLimit:r,quantity:t.quantity,canChangeQuantity:s.canChangeQuantity,productUrl:u},t.id)})]})})},Y=n(15147),tt=n(58342),te=n.n(tt),CartOrderSummary_CartOrderSummary=t=>{let{cost:e,total:n,deliveryTime:i="10",privacyUrl:r,policyUrl:l,collectionUrl:s,orderSummaryCallback:u,isLoading:c=!1,className:m,isActivePaymentMethodsSection:p=!1,isLoadingAddProduct:v=!1,paymentMethodsComponent:f,isSubmitDisabled:g=!1}=t,h=(0,d.Z)(te().root,m),{t:y}=(0,C.$)("molecules",{keyPrefix:"cartOrderSummary"}),b=y("free"),_=(0,o.useRef)(null),k=(0,o.useRef)(null),[w,P]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{let t=null==_?void 0:_.current,e=null==k?void 0:k.current,handleScroll=()=>{if(t&&e){let n=t.getBoundingClientRect(),i=e.getBoundingClientRect().top+n.height;P(!(window.innerHeight-i>0))}};return window.addEventListener("scroll",handleScroll),()=>{window.removeEventListener("scroll",handleScroll)}},[]),(0,a.jsxs)("div",{className:h,children:[(0,a.jsxs)("div",{className:te().content,children:[(0,a.jsx)(S.default,{tag:"h6",size:"base",children:y("orderTotal")}),(0,a.jsx)(N.Z,{className:te().stroke}),(0,a.jsxs)("div",{className:te().stackedRow,children:[(0,a.jsxs)(S.default,{tag:"p",size:"base",children:[y("shippingCost"),":"]}),(0,a.jsx)(S.default,{tag:"p",size:"base",weight:"medium",children:e||b})]}),(0,a.jsxs)("div",{className:te().stackedRow,children:[(0,a.jsxs)(S.default,{tag:"p",size:"base",children:[y("total"),":"]}),(0,a.jsx)(S.default,{tag:"p",size:"4xl",weight:"medium",className:te().totalAmount,children:n})]}),(0,a.jsx)(N.Z,{className:te().stroke}),(0,a.jsxs)("div",{className:te().stackedRow,children:[(0,a.jsxs)(S.default,{tag:"p",size:"base",children:[y("deliveryTime"),":"]}),(0,a.jsxs)(S.default,{tag:"p",size:"base",weight:"medium",children:[y("maximum")," ",i," ",y("availableDays")]})]}),p&&f&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.Z,{className:te().stroke}),(0,a.jsx)("div",{className:te().paymentMethodsContainer,children:f})]})]}),(0,a.jsxs)("div",{className:te().containerTextAndButton,children:[(0,a.jsxs)(S.default,{tag:"p",size:"xs",className:te().textInformation,children:[y("textInformationCartOrder")," ",(0,a.jsx)(j.Z,{id:"cartOrderSummary-termsAndCondition",variant:"highlighted",href:l,target:"_blank",children:y("termsAndCondition")})," ",y("andThe"),(0,a.jsx)(j.Z,{id:"cartOrderSummary-privacyNotice",variant:"highlighted",href:r,target:"_blank",children:y("privacyNotice")})," ",y("ofWebsite")]}),(0,a.jsx)("div",{ref:k}),(0,a.jsxs)("div",{className:(0,d.Z)(te().containerButton,{[te().floatingButton]:w}),ref:_,children:[(0,a.jsx)(x.default,{id:"cartOrderSummary-cta-continueShopping",className:te().buttonSecondary,variant:"secondary",size:"md",href:s,loading:c,disabled:c||v,fullWidth:!0,children:y("continueShopping")}),(0,a.jsx)(x.default,{id:"cartOrderSummary-cta-continue",onClick:u,className:te().buttonPrimary,size:"md",loading:c,disabled:c||v||g,fullWidth:!0,children:y(c?"loading":"continue")})]})]})]})},tn=n(34573),ti=n(13395),tr=n.n(ti),CartComments_CartComments=t=>{let{onCommentsChange:e,cartComments:n="",className:i,policyUrl:r,privacyUrl:l}=t,s=(0,o.useRef)(null),u=(0,o.useRef)(!0),c=(0,o.useCallback)(t=>{let n=t.target.value;e(n)},[e]);(0,o.useEffect)(()=>
1{if(u.current){u.current=!1;return}s.current&&s.current.focus()},[n]);let{t:m}=(0,C.$)("molecules",{keyPrefix:"cartComments"});return(0,a.jsxs)("div",{className:(0,d.Z)(tr().root,i),children:[(0,a.jsx)(tn.Z,{id:"cartComments-textarea",placeholder:m("placeholder"),label:m("question"),onChange:c,defaultValue:n,rows:2,textareaRef:s,className:tr().textarea}),(0,a.jsxs)(S.default,{className:tr().textInformation,tag:"p",size:"xs",children:[m("textInformationCartOrder")," ",(0,a.jsx)(j.Z,{id:"cartOrderSummary-termsAndCondition",variant:"highlighted",href:r,children:m("termsAndCondition")})," ",m("andThe"),(0,a.jsx)(j.Z,{id:"cartOrderSummary-privacyNotice",variant:"highlighted",href:l,children:m("privacyNotice")})," ",m("ofWebsite")]})]})},ta=n(55911),to=n(96728),tl=n.n(to),Cart_Cart=t=>{let{emptyCartProps:e,items:n,onCommentsChange:i,cartComments:r="",shopUrl:l,privacyUrl:s,policyUrl:u,shippingCost:c,updateQuantityCallback:m,removeItemCallback:p,maxQuantityLimit:v=99,handleSubmit:f,total:g,isLoading:h=!1,isActivePaymentMethodsSection:y,extraProducts:b,addExtraProduct:_,isLoadingAddProduct:x,currencyCode:k,locale:w,paymentMethodsComponent:N,whatsappUrl:P,contactEmail:I,maxQuantityPerProduct:j=5,msiPaypalBanner:L,promotionalCard:A}=t,{t:T}=(0,C.$)("organisms",{keyPrefix:"cart"}),[D,R]=(0,o.useState)([]),[O,Z]=(0,o.useState)(!0),{validateProductsLimits:z}=(0,ta.V)({maxQuantityPerProduct:j}),E=(0,o.useMemo)(()=>z(D),[z,D]),B=(0,o.useCallback)(t=>{p(t)},[p]),F=(0,o.useCallback)((t,e)=>{if(0===e){B(t);return}m(t,e)},[m,B]);(0,o.useEffect)(()=>{if(n){let t=n.filter(t=>"PRO3"!==t.sku);R(t)}Z(0===n.length)},[n]);let M=(0,o.useCallback)(t=>{if(!E){t.preventDefault();return}f(t)},[f,E]),q=(0,d.Z)(tl().root,{[tl().isLoading]:h}),U=(0,o.useCallback)(async t=>{_&&await _(t)},[_]);return O?(0,a.jsx)(EmptyCart_EmptyCart,{...e,collectionUrl:e.collectionUrl,promotionalCard:A}):(0,a.jsxs)("div",{className:q,children:[(0,a.jsxs)("div",{className:tl().cartListRoot,children:[P&&I&&!E&&(0,a.jsxs)("div",{className:tl().attentionRoot,children:[(0,a.jsx)(S.default,{weight:"medium",children:T("attention")}),(0,a.jsx)(S.default,{size:"sm",html:T("attentionDescription",{whatsappUrl:P,contactEmail:I})})]}),L&&(0,a.jsx)("div",{className:tl().paymentMethodsContainer,children:L}),(0,a.jsx)(CartList_CartList,{productSkuDisabledControls:"ESTCHVJ-BF",items:D,changeQuantity:F,onDeleteItem:B,maxQuantityLimit:v}),A,b&&(0,a.jsx)(Y.Z,{locale:w,currencyCode:k,isLoadingAddProduct:x,variants:b,onSelectVariant:U})]}),(0,a.jsx)("div",{className:tl().cartSummaryRoot,children:(0,a.jsx)(CartOrderSummary_CartOrderSummary,{isLoadingAddProduct:x,isActivePaymentMethodsSection:y,total:g,privacyUrl:s,policyUrl:u,orderSummaryCallback:M,collectionUrl:l,cost:c,isLoading:h,paymentMethodsComponent:N,isSubmitDisabled:!E})}),(0,a.jsx)("div",{className:tl().cartCommentsRoot,children:(0,a.jsx)(CartComments_CartComments,{cartComments:r,onCommentsChange:i,policyUrl:u,privacyUrl:s})})]})},ts=n(64871),tu=n(11749),tc=n(90583),td=n(29070),tm=n(9411),tp=n(89204),tv=n(15909),tf=n(42185),tg=n(26973),th=n(63410),ty=n(78141);function pickDescriptionPart(t,e){let n=null==t?void 0:t[e];return null==n||"undefined"===n?null:n}var tC=n(70900),tb=n(34158);let t_=["frame","giftcard"];var tS=n(84379),tx=n(9193),tk=n(46327),tw=n.n(tk),tN=n(27061);function _templateObject(){let t=(0,r._)(["\n  ","\n"]);return _templateObject=function(){return t},t}function _templateObject1(){let t=(0,r._)(["\n  ","\n"]);return _templateObject1=function(){return t},t}let tP=(0,l.Ps)(_templateObject(),tC.t),tI=(0,l.Ps)(_templateObject1(),tb.z),tj=["brisafresca","tacodepiel","tiritasbenfrankxsomeonesomewhere","tiritasedicionlimitadabenfrankxsomeonesomewhere"],tL="Ben & Frank",tA=td.ve[0].href,tT="/aviso-de-privacidad",tD="/terminos-y-condiciones-de-uso",tR=m.features.products.tags.newProductsExpirationDays,tO=m.features.shipping.threshold,tZ=m.features.shipping.cost,tz="es-MX",tE=m.features.whatsapp.phoneNumber,tB=m.features.maxQuantityPerProduct,tF="https://wa.me/".concat(tE),tM=m.siteInfo.mail,tq="".concat(null==tN?void 0:null===(i=tN.env)||void 0===i?void 0:"https://www.benandfrank.com","/shop/cart?recoveryId=");var tU=!0;function CartPage(t){var e;let{cartResponse:n,keyStore:i,productSelection:r,category:l,channels:h,promotionalStickers:x}
1=t,{cart:k,handleSetItemsCount:w,handleSetCart:N,handleSetCartVersion:P,handleSetCartComments:I,cartVersion:j}=(0,tm.iQ)(),{state:{cart:L,isLoading:T},actions:{addItems:D,createCart:R,syncCartFromLegacy:O,updateCartComments:Z,updateItemQuantity:z}}=(0,tS.j)(),E=(0,tx.e)(),{data:B}=(0,v.useSession)(),[F,M]=(0,o.useState)(""),[q,U]=(0,o.useState)(),[V,Q]=(0,o.useState)([]),[K,$]=(0,o.useState)(""),[X,J]=(0,o.useState)(!1),[G,H]=(0,o.useState)(!1),[W,Y]=(0,o.useState)(!1),[tt,te]=(0,o.useState)(),[tn,ti]=(0,o.useState)(!1),[tr,ta]=(0,o.useState)(),[to,tl]=(0,o.useState)(!1),[tc,tC]=(0,o.useState)([]),tb=(0,tp.Z)({price:tZ,currency:"MXN",fractionDigits:2,locale:tz}),[tk,tN]=(0,o.useState)([]),[tE,tU]=(0,o.useState)([]),[tV,tQ]=(0,o.useState)(!1),[tK,t$]=(0,o.useState)([]),[tX,tJ]=(0,o.useState)(!1),{executeRecaptcha:tG}=(0,g.xX)(),tH=(0,f.useRouter)(),tW=(0,o.useCallback)(t=>{let e=(0,tv.Z)({items:t,locale:tz,currencyCode:"MXN",fractionDigits:2});return e},[]),tY=(0,o.useCallback)(t=>{let e=null==t?void 0:t.reduce((t,e)=>t+e.quantity,0);w(e)},[w]),t0=(0,o.useCallback)(t=>{var e;let n;let i=null!==(e=null==t?void 0:t.centAmount)&&void 0!==e?e:0,r="number"==typeof(null==t?void 0:t.fractionDigits)?t.fractionDigits:2,a=(0,tp.Z)({price:i,currency:"MXN",fractionDigits:r,locale:tz,useGrouping:!0}),o=(0,tp.Z)({price:i+tZ,currency:"MXN",fractionDigits:r,locale:tz,useGrouping:!0}),l=a;i<tO&&(l=o,n=tb),M(l),U(n)},[tb]),t1=(0,o.useCallback)(()=>{p.Z.remove(c.G5),p.Z.remove("optical_flow_email")},[]);(0,o.useEffect)(()=>{I(K)},[K,I]);let t9=(0,o.useCallback)(async t=>{var e,n,i,r,a;let o=null==t?void 0:null===(i=t.custom)||void 0===i?void 0:null===(n=i.customFieldsRaw)||void 0===n?void 0:null===(e=n.find(t=>"cart-comments"===t.name))||void 0===e?void 0:e.value;P(null==t?void 0:t.version),N(t),$(null!=o?o:""),t0(null==t?void 0:t.totalPrice);let l=null!==(a=null==t?void 0:t.customLineItems)&&void 0!==a?a:[];tY(l);let s=tW(l).map(t=>(function(t,e){var n,i,r;let a=t.productData,o=null!==(i=a.variantDescription)&&void 0!==i?i:[],l=null==(n=a.productAttributes)?void 0:n.filter(t=>!t.toLowerCase().includes("tama\xf1o")),{size:s,color:u,pregraduation:c}=(0,A.y)(o,a.productType,a.productCategory);return{id:t.uuid,sku:t.productSku,quantity:t.quantity,image:a.productImageUrl?{url:a.productImageUrl,alt:a.altImage}:void 0,pricing:{currencyCode:"MXN",total:0},attributes:(()=>{let t=null!=a.productCategory&&""!==a.productCategory,e=null!=a.productType&&""!==a.productType;if(t||e)return{...t?{category:a.productCategory}:{},...e?{productType:a.productType}:{}}})(),size:s,color:null!=u?u:t.productData.productVariant,pregraduation:c,variantDescription:o.length>0?o:void 0,graduation:pickDescriptionPart(l,0),treatment:pickDescriptionPart(l,1),additionalTreatment:pickDescriptionPart(l,2),displayName:a.productName,crossedOut:a.crossedOut,basePriceFormatted:t.productPrice,discountLineFormatted:a.discountPrice,productUrl:null!==(r=a.productUrl)&&void 0!==r?r:"/shop/cart",canChangeQuantity:t.canChangeQuantity}})(t,0));Q(s),(null===(r=t.customLineItems)||void 0===r?void 0:r.length)===0&&t1()},[P,N,$,t0,tY,tW,t1]),t2=(0,o.useCallback)(async t=>{let e=await fetch("/api/cart/get-cart",{method:"POST",body:JSON.stringify({cartId:t})});if(!e.ok)return;let n=await e.json();(null==n?void 0:n.id)&&await t9(n)},[t9]),t8=(0,o.useCallback)(t=>{var e,n,i;let r=function(t,e){var n,i;if(!(null==t?void 0:null===(n=t.products)||void 0===n?void 0:n.length))return[];let r=null!==(i=t.pricing.fractionDigits)&&void 0!==i?i:e.fractionDigits,a={...e,fractionDigits:r};return t.products.map(t=>(function(t,e){var n,i,r,a,o;let l=t.attributes,s=e.fractionDigits,u=!1!==e.useGrouping,c=null===(n=t.image)||void 0===n?void 0:n.url,d=null!==(a=null!==(r=t.displayName)&&void 0!==r?r:null===(i=t.image)||void 0===i?void 0:i.alt)&&void 0!==a?a:"",m=null==l?void 0:l.productType,p=null==l?void 0:l.category,v=null==l?void 0:l.productKey,f=null==l?void 0:l.discountedPriceRawCents,g=null!==(o=null==l?void 0:l.showDiscountedUnitPrice)&&void 0!==o&&o,h=(0,tp.Z)({price:null!=f?f:0,currency:e.currencyCode,fractionDigits:s,locale:e.locale,useGrouping:u}),y=t.pricing.listTotal,C=g&&1===t.quantity&&null!=y?(0,tp.Z)({price:M
1ath.round(y*Math.pow(10,s)),currency:e.currencyCode,fractionDigits:s,locale:e.locale,useGrouping:u}):void 0,b=g&&1===t.quantity&&null!=C?C:h,_=void 0!==f&&f>0||g,S=(0,tp.Z)({price:Math.round(t.pricing.total*Math.pow(10,s)),currency:e.currencyCode,fractionDigits:s,locale:e.locale,useGrouping:u}),x=void 0===m||void 0!==m&&!t_.includes(m),k="/shop/cart/";if(v&&p){let t=Array.isArray(p)?p[0]:p,e="giftcard"===m?"stuff":String(t);k="/shop/product/".concat(e,"/").concat(v)}return{...t,image:c&&"#"!==c?{url:c,alt:d}:t.image,crossedOut:_,basePriceFormatted:S,discountLineFormatted:_?b:void 0,productUrl:k,canChangeQuantity:x}})(t,a))}(t,{locale:tz,currencyCode:"MXN",fractionDigits:2,useGrouping:!0});Q(r);let a=null!==(e=t.pricing.fractionDigits)&&void 0!==e?e:2;t0({centAmount:Math.round(t.pricing.total*Math.pow(10,a)),currencyCode:t.pricing.currencyCode,fractionDigits:a});let o=t.products.reduce((t,e)=>t+e.quantity,0);w(o),$(null!==(n=t.metadata.notes)&&void 0!==n?n:""),P(null!==(i=t.version)&&void 0!==i?i:0)},[t0,w,P]);(0,o.useEffect)(()=>{E&&L&&t8(L)},[E,L,t8]);let t3=(0,o.useCallback)(async function(t,e,n){var i,r,a,o,l;let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(ei(t,e,k),E){let l=null!==(i=null==L?void 0:L.id)&&void 0!==i?i:null==k?void 0:k.id,u=null!==(r=null!=n?n:null==L?void 0:L.version)&&void 0!==r?r:j;if(!l)return;try{let n=await z({itemId:t,cartId:l,version:null!=u?u:0,quantity:e});return await t2(l),null==n?void 0:null===(a=n.cart)||void 0===a?void 0:a.version}catch(r){if(s)return u;let n=await R(),i=null==n?void 0:null===(o=n.cart)||void 0===o?void 0:o.version;return await t3(t,e,i,!0),i}}let u=null!==(l=null!=n?n:null==k?void 0:k.version)&&void 0!==l?l:j,c=null==k?void 0:k.id;if(!c)return;let{updateCart:d}=await fetch("/api/cart/update-item-quantity",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({itemId:t,quantity:e,cartId:c,version:u})}).then(async t=>await t.json());if(d)return await t9(d),d.version},[E,null==L?void 0:L.id,null==L?void 0:L.version,k,j,t2,t9,R,z]),t7=(0,o.useCallback)(async t=>{var e,n;let i=null==k?void 0:null===(e=k.customLineItems)||void 0===e?void 0:e.find(e=>e.id===t);er([i],null==i?void 0:null===(n=i.totalPrice)||void 0===n?void 0:n.centAmount,"remove_from_cart"),t3(t,0)},[null==k?void 0:k.customLineItems,t3]),t5=(0,o.useCallback)(async()=>{let t="".concat(K||""),e=await fetch("/api/cart/create-cart",{method:"POST",headers:{"Content-Type":"application/json"}}).then(async t=>await t.json()),n={cartId:null==k?void 0:k.id,version:null==e?void 0:e.version,newComments:JSON.stringify(t)},{updateCart:i}=await fetch("/api/cart/update-cart-comments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(async t=>await t.json());t9(i)},[K,null==k?void 0:k.id,t9]),t4=(0,o.useCallback)(async()=>{let t=j;for await(let e of tc){let n=await t3(e.uuid,0,t);t=null!=n?n:t}Y(!1)},[j,tc,t3]),t6=(0,o.useCallback)(async t=>{var e;let n=tc[0],i={email:t.email,sku:null!==(e=null==n?void 0:n.productSku)&&void 0!==e?e:"",companyId:Number("1"),productUid:Number(null==n?void 0:n.productErpId),gToken:""};if(tG){let t=await tG("restockNotification");i.gToken=t}ta("loading");let{addNotification:r}=await fetch("/api/restock/add-restock-notification",{method:"POST",body:JSON.stringify(i)}).then(async t=>await t.json());ta(r?"valid":"error")},[tG,tc]),et=(0,o.useCallback)(async()=>{var t,e;let n=tW(null!==(e=null==k?void 0:k.customLineItems)&&void 0!==e?e:[]),i={skus:null==n?void 0:n.map(t=>t.productSku)},r=await fetch("/api/cart/validate-items-stock",{method:"POST",body:JSON.stringify(i)}).then(async t=>await t.json()),a=!1,o=null==r?void 0:null===(t=r.filter(t=>!t.includes("GIFTCARD")))||void 0===t?void 0:t.map(t=>null==n?void 0:n.find(e=>e.productSku===t));if(1===o.length){let{productName:t,productVariant:e,canBeRestocked:n}=o[0].productData;te("".concat(t," ").concat(e)),a=n}return ti(a),o},[null==k?void 0:k.customLineItems,tW]),ee=(0,o.useCallback)(async t=>{var e,n,i;t.preventDefault(),H(!0);let r=await et(),a=null!==(n=null==k?void 0:k.origin)&&void 0!==n?n:"";if("Customer"===a&&r.length>0){tC(r),Y(r.length>0),H(!1);return}if(E){try{await Z({comments:K},{willNavigate:!0});let t=!!(null==L?void 0:null===(i=L.products)||void 0===i?void 0:i.some(t=>{var e;return(null===(e=t.attributes)||void 0===e?void 0:e.needsPrescription)===!0})),e="/shop/prescription";(!t||X)&&(e="/shop/checkout"),await tH.push(e)}catch(t){console.error(t)}return}t5();let o=!!(null==k?void 0:null===(e=k.customLineItems)||void 0===e?void 0:e.some(t=>{var e,n,i;return(null==t?void 0:null===(i=t.custom)||void 0===i?void 0:null===(n=i.customFieldsRaw)||void 0===n?void 0:null===(e=n.filter(t=>"product-needs-prescription"===t.name)[0])||void 0===e?void 0:e.value)===!0})),l="/shop/prescription";(!o||X)&&(l="/shop/checkout"),tH.push(l)},[E,K,null==L?void 0:L.products,null==k?void 0:k.customLineItems,null==k?void 0:k.origin,tH,X,t5,Z,et]),en=(0,o.useCallback)(t=>{$(t)},[]),ei=(0,o.useCallback)((t,e,n)=>{var i,r,a,o,l,s,u;if(!window.exponea)return;let c=(null==n?void 0:null===(i=n.totalPrice)||void 0===i?void 0:i.centAmount)/100,d=null==n?void 0:null===(r=n.customLineItems)||void 0===r?void 0:r.find(e=>e.id===t),m=null!==(a=null==d?void 0:d.quantity)&&void 0!==a?a:0,p=e>m?"add":"remove";0===e&&(null==n?void 0:n.customLineItems.length)===1&&(p="empty");let v=tW([d]),{productErpId:f,productPrice:g}=v[0],{productCategory:h,variantDescription:y,productName:C}=v[0].productData,b=null!==(o=y[1])&&void 0!==o?o:"",_=b.replace(/ /g,"-").toLowerCase(),S=td.ve.find(t=>t.key===h),x="".concat(f,"_").concat(_,"_").concat(null!==(l=null==S?void 0:S.key)&&void 0!==l?l:h).toLowerCase();window.exponea.track("cart_update",{action:p,product_id:f,item_id:x,title:C,category_level_1:null!==(s=null==S?void 0:S.key)&&void 0!==s?s:h,category_level_2:null!==(u=null==S?void 0:S.option)&&void 0!==u?u:h,price:Number(g.replace("$","")),local_currency:"MXN",product_list:"Cart",quantity:e,value:c,cart_url:"".concat(tq).concat(null==n?void 0:n.id)})},[tW]),er=(0,o.useCallback)((t,e,n)=>{let i=tW(t),r={event:n,ecommerce:{currencyCode:"MXN",value:e/100,items:i.map(t=>{var e,n;let{productCategory:i,variantDescription:r,productName:a}=t.productData,o=null!==(e=r[1])&&void 0!==e?e:"",l=o.replace(/ /g,"-").toLowerCase(),s=td.ve.find(t=>t.key===i),u="".concat(null==t?void 0:t.productErpId,"_").concat(l,"_").concat(null!==(n=null==s?void 0:s.key)&&void 0!==n?n:i).toLowerCase();return{item_name:a,item_id:u,item_brand:tL,price:Number(null==t?void 0:t.productPrice.replace("$","")),item_category:i,item_variant:l,quantity:null==t?void 0:t.quantity}})}};y().dataLayer({dataLayer:r})},[tW]);(0,o.useEffect)(()=>{var t,e,i;if(!n)return;p.Z.set(c.G5,n.id,{expires:c.Ne}),E&&O(n),t9(n);let r=new URLSearchParams(window.location.search),a=r.get("skipPrescription");J("true"===a),r.delete("skipPrescription"),window.history.replaceState({},"","".concat(location.pathname)),er(null!==(e=null==n?void 0:n.customLineItems)&&void 0!==e?e:[],null!==(i=null==n?void 0:null===(t=n.totalPrice)||void 0===t?void 0:t.centAmount)&&void 0!==i?i:0,"view_cart")},[n,t9]);let{t:ea}=(0,C.$)("common"),[eo]=(0,s.t)(tP,{variables:{where:r,storeKey:i,currency:"MXN",channels:h,channelId:h[0],inventory:(0,tf.Z)(tR,null!==(e=h[0])&&void 0!==e?e:"")},fetchPolicy:"no-cache",context:{clientName:"commerceToolsAPI"}}),getProductsAndFilters=async()=>{var t;let{data:e,error:n}=await eo();if(n)return;let r=null!==(t=null==e?void 0:e.inStore.productSelectionAssignments.results.map(t=>{var e,n;let i=null===(e=t.variantSelection)||void 0===e?void 0:e.skus;return(null===(n=t.variantSelection)||void 0===n?void 0:n.type)==="includeOnly"&&(i=t.product.masterData.current.allVariants.filter(e=>{var n,i;return!(null===(i=t.variantSelection)||void 0===i?void 0:null===(n=i.skus)||void 0===n?void 0:n.includes(e.sku))}).map(t=>t.sku)),{...t.product,custom:t.productSelection,excludedVariantsSku:i}}))&&void 0!==t?t:[],a=(0,tg.Z)(r,i),o=(0,th.Z)({title:"Porquer\xedas cuatroojos",products:a,categorySlug:td.ve[4].slug,brand:tL,fallbackImageUrl:"https://s3.benandfrank.com/onix_fbabcc1ee005996e95c6323b1ae2050b3e2cd3ee",pathPrefix:"https://s3.benandfrank.com/",translations:{optical:ea("products.optical"),sunglasses:ea("products.sunglasses"),bluelight:ea("products.bluelight")},menus:td.ve,keyStore:"bf-mx",promotionalStickers:x}),l=tj.map(t=>o.find(e=>e.productKey===t));tN(l)};(0,o.useEffect)(()=>{(async()=>{await getProductsAndFilters()})()},[l.id]);let el=(0,o.useCallback)(t=>{if(!t)return;let e=ty.xB.find(e=>e.value===t);return null==e?void 0:e.variantLabel},[]),es=(0,o.useCallback)((t,e)=>{let{uuid:n,variantName:i,name:r}=e,a=i.replace(/ /g,"-").toLowerCase(),o="".concat(n,"_").concat(a,"_stuff").toLowerCase(),l=parseInt(e.price,10),s=l/100;y().dataLayer({dataLayer:{event:t,ecommerce:{currencyCode:"MXN",value:s,items:[{item_list_name:"stuff_from_extras_in_cart",item_name:r,item_id:o,item_brand:tL,price:s,item_category:"stuff",item_variant:i,quantity:1}]}}})},[]),eu=(0,o.useCallback)(async t=>{tJ(!0),tl(!0);try{var e,n,i,r,a,o,l,s,u,d,m,v,f,g,h,y,C,b,_,S,x,w,N,P,I;let A,T;let O=null===(n=t.attributesRaw)||void 0===n?void 0:null===(e=n.filter(t=>"erp-id"===t.name)[0])||void 0===e?void 0:e.value,Z=null==t?void 0:null===(r=t.attributesRaw)||void 0===r?void 0:null===(i=r.filter(t=>"frame-size"===t.name)[0])||void 0===i?void 0:i.value,z=null==t?void 0:null===(o=t.attributesRaw)||void 0===o?void 0:null===(a=o.filter(t=>"variant-name"===t.name)[0])||void 0===a?void 0:a.value,B={collectionKey:"stuff",productCanBeRestocked:!1,productCategory:"stuff",productDescription:[],productDisplayName:[String(null!==(m=t.productName)&&void 0!==m?m:"Product")],productKey:null==t?void 0:t.productKey,productErpId:String(O),productFullTreatments:[""],productImageUrl:(null==t?void 0:t.imageSrc)||"#",productNeedsPrescription:!1,productSku:null==t?void 0:t.sku,productType:"STUFF",treatments:[],variantDescription:["".concat(null!==(v=el(Z))&&void 0!==v?v:void 0),"".concat(null!=z?z:void 0)]};if(E){if(A=null==L?void 0:L.id,T=null!==(g=null==L?void 0:L.version)&&void 0!==g?g:0,!A){let t=await R();A=null===(h=t.cart)||void 0===h?void 0:h.id,T=null!==(C=null===(y=t.cart)||void 0===y?void 0:y.version)&&void 0!==C?C:0,A&&p.Z.set(c.G5,A,{expires:c.Ne})}if(!A)return;let e={productType:"stuff",productData:{productKey:null!==(b=t.productKey)&&void 0!==b?b:"",name:null!==(_="string"==typeof t.productName?t.productName:t.name)&&void 0!==_?_:"",defaultTreatments:[]},selectedVariant:{images:[{lensColor:"none",images:[{url:null!==(S=t.imageSrc)&&void 0!==S?S:"",alt:t.name,title:t.name}]}],name:t.name,sku:t.sku,canBeRestocked:null!==(x=t.canBeRestocked)&&void 0!==x&&x,erpId:null!==(w=null===(f=t.erpID)||void 0===f?void 0:f.toString())&&void 0!==w?w:"",size:null},userSelection:{selectedComplement:[],selectedPolarized:void 0,selectedPregraduation:void 0,selectedTreatment:void 0},treatments:[],polarizeds:[],complements:[]};await D({items:e})}else{if(A=null==k?void 0:k.id,T=null!==(P=null!==(N=null==k?void 0:k.version)&&void 0!==N?N:j)&&void 0!==P?P:0,!A){let t=await fetch("/api/cart/create-cart",{method:"POST",headers:{"Content-Type":"application/json"}}).then(async t=>t.ok?t.json():null);if(!(null==t?void 0:t.id))return;await t9(t),p.Z.set(c.G5,t.id,{expires:c.Ne}
1),A=t.id,T=null!==(I=t.version)&&void 0!==I?I:0}if(!A)return;let t=await fetch("/api/cart/add-to-cart",{method:"POST",body:JSON.stringify({cartId:A,version:T,storeKey:"bf-mx",productsConf:[B]})}),e=await t.json();if(!t.ok||e.errors)return}await t2(A);let F=Number(null===(l=t.priceStandAlone)||void 0===l?void 0:l.centAmount)/Math.pow(10,null===(s=t.priceStandAlone)||void 0===s?void 0:s.fractionDigits);es("add_to_cart",{name:t.productName,price:String(F),uuid:t.sku,variantName:null===(d=t.attributesRaw)||void 0===d?void 0:null===(u=d.filter(t=>"variant-name"===t.name)[0])||void 0===u?void 0:u.value})}finally{tJ(!1),tl(!1)}},[E,null==L?void 0:L.id,null==L?void 0:L.version,null==k?void 0:k.id,null==k?void 0:k.version,j,el,es,t2,t9,D,R]),[ec,{data:ed}]=(0,s.t)(tI,{variables:{accessToken:null==B?void 0:B.accessToken,where:'channel(id="'.concat(null==h?void 0:h[0],'") and (').concat(null==tE?void 0:tE.map(t=>'sku="'.concat(t.sku,'"')).join(" or "),")")},context:{clientName:"commerceToolsAPI"}});return(0,o.useEffect)(()=>{if(tk&&tk.length>0){let t=tk.map(t=>{var e;let n=null==t?void 0:null===(e=t.variants)||void 0===e?void 0:e.map(e=>({...e,name:e.sku.includes("TRTS")?"Tiritas / ".concat(e.name):e.name,productName:t.name,productKey:t.productKey,groupedImages:e.groupedImages,images:e.images})),i=null==n?void 0:n.filter(t=>null==t?void 0:t.isOnStock);return i});t.forEach(t=>null==t?void 0:t.map(t=>{tU(e=>[...e,t])}))}},[tk]),(0,o.useEffect)(()=>{0!==tE.length&&ec()},[ec,tE]),(0,o.useEffect)(()=>{var t;if(!ed||!(null==ed?void 0:null===(t=ed.standalonePrices)||void 0===t?void 0:t.results))return;let e=null==ed?void 0:ed.standalonePrices.results,n=tE.map(t=>{let n=null==e?void 0:e.find(e=>e.sku===t.sku);return{...t,priceStandAlone:null==n?void 0:n.value}});t$(n)},[tE,ed,k]),(0,o.useEffect)(()=>{if(k){let t=V.find(t=>"PRO3"===t.sku);t&&t7(null==t?void 0:t.id)}},[t7,V,k]),(0,o.useEffect)(()=>{let t=function(t){var e,n,i,r;let a=null==t?void 0:t.customLineItems,o=null==a?void 0:a.filter(t=>{var e;let n=null==t?void 0:null===(e=t.custom.customFieldsRaw.find(t=>"product-category"===t.name))||void 0===e?void 0:e.value;return null==n?void 0:n.includes("optical")}),l=null==a?void 0:a.filter(t=>{var e;let n=null==t?void 0:null===(e=t.custom.customFieldsRaw.find(t=>"product-category"===t.name))||void 0===e?void 0:e.value;return null==n?void 0:n.includes("pregraduated")}),s=null==a?void 0:a.filter(t=>{var e;let n=null==t?void 0:null===(e=t.custom.customFieldsRaw.find(t=>"product-type"===t.name))||void 0===e?void 0:e.value;return n.includes("frame")||n.includes("pregraduated")}),u=null==a?void 0:a.filter(t=>{var e;let n=null==t?void 0:null===(e=t.custom.customFieldsRaw.find(t=>"product-needs-prescription"===t.name))||void 0===e?void 0:e.value;return!0===n});return{productNeedPrescriptionLength:null!==(e=null==u?void 0:u.length)&&void 0!==e?e:0,productsWithCategoryIsOpticalLength:null!==(n=null==o?void 0:o.length)&&void 0!==n?n:0,productWithProductTypeIsFrameLength:null!==(i=null==s?void 0:s.length)&&void 0!==i?i:0,productsWithCategoryIsPregraduatedLength:null!==(r=null==l?void 0:l.length)&&void 0!==r?r:0}}(k),e=!!((t.productNeedPrescriptionLength>=1||t.productsWithCategoryIsPregraduatedLength>=1)&&t.productWithProductTypeIsFrameLength>=2);tQ(e)},[k]),(0,a.jsxs)(b.Z,{children:[(0,a.jsx)(_.Z,{crumbList:[{href:"/shop/cart",crumb:"Tu carrito"}]}),(0,a.jsx)(Cart_Cart,{currencyCode:"MXN",locale:tz,items:V,emptyCartProps:{collectionUrl:tA},onCommentsChange:en,cartComments:K,removeItemCallback:t7,updateQuantityCallback:t3,handleSubmit:ee,privacyUrl:tT,policyUrl:tD,shopUrl:tA,shippingCost:q,total:F,isLoading:G||E&&T,maxQuantityLimit:99,isActivePaymentMethodsSection:m.features.cartPaymentMethods.paymentMethodsActive,extraProducts:tK,isLoadingAddProduct:tX,addExtraProduct:eu,whatsappUrl:tF,contactEmail:tM,maxQuantityPerProduct:tB,paymentMethodsComponent:(0,a.jsx)(u.i9,{component:"CartPaymentMethods"}),msiPaypalBanner:(0,a.jsx)(u.i9,{component:"CartMsiPaypalBanner",componentProps:{cartTotal:Number(F.replace(/[^\d.]/g,""))}}
1),promotionalCard:(0,a.jsx)(u.i9,{component:"CartBanner",componentProps:{isLoadingAddProduct:tX,promotionalApplied:tV,cartIsEmpty:0===V.length}})}),(0,a.jsx)(ts.Z,{isOpen:W,onClose:t4,onSubmitForm:t6,submittedFormState:tr,productName:tt,availabilityNotification:tn,productsOutOfStock:!tn,privacyUrl:tT,policyUrl:tD}),to&&(0,a.jsx)(tu.Z,{active:to,className:(0,d.Z)(tw().overlay,{[tw().active]:to}),children:(0,a.jsx)(S.default,{size:"4xl",weight:"semibold",className:tw().loadText,children:ea("cart.waitForCartUpdate")})})]})}CartPage.Layout=tc.Z},93133:function(t,e,n){"use strict";var i=n(24246),r=n(27378),a=n(38944),o=n(86677),l=n(90909),s=n(69438),u=n(75275),c=n(982),d=n(18928),m=n.n(d);let p="lastVisited";e.Z=t=>{let{crumbList:e,className:n}=t,{t:d}=(0,l.$)("molecules",{keyPrefix:"breadcrumb"}),v=(0,o.useRouter)(),[f,g]=(0,r.useState)([]),getSessionStorage=t=>{{let e=sessionStorage.getItem(null!=t?t:p);return e?JSON.parse(e):[]}},setSessionStorage=t=>{{let{key:e=p,value:n}=t;sessionStorage.setItem(e,JSON.stringify(n))}};(0,r.useEffect)(()=>{let t=getSessionStorage(),n=v.asPath,i=e.length,r=t.length;i===r&&0!==i&&0!==r?t[r-1]=n:i===r+1?t.push(n):i<r&&t.pop();let handleBeforeHistoryChange=()=>{setSessionStorage({value:t})};return v.events.on("beforeHistoryChange",handleBeforeHistoryChange),()=>{v.events.off("beforeHistoryChange",handleBeforeHistoryChange)}},[v.asPath,v.events,e.length]),(0,r.useEffect)(()=>{let t=getSessionStorage(),n=e.map((e,n)=>{var i;let r=null===(i=t[n])||void 0===i?void 0:i.split("?")[0];return{crumb:e.crumb,href:r===e.href?t[n]:e.href}});g(n)},[e]);let h=(0,r.useCallback)(()=>null==f?void 0:f.map((t,e)=>{let n=e===f.length-1;return(0,i.jsxs)(r.Fragment,{children:[(0,i.jsx)("span",{className:m().span,children:"/"}),n?(0,i.jsx)(u.default,{className:m().lastItem,id:"crumb-".concat((0,c.Z)(t.crumb)),children:t.crumb}):(0,i.jsx)(s.Z,{variant:"line",href:t.href,id:"crumb-".concat((0,c.Z)(t.crumb)),children:t.crumb})]},"crumb-".concat(t.href))}),[f]),y=(0,a.Z)(m().root,n);return(0,i.jsxs)("div",{className:y,children:[(0,i.jsx)(s.Z,{variant:"line",href:"/",id:"crumb-home",children:d("home")}),h()]})}},15147:function(t,e,n){"use strict";var i=n(24246),r=n(27378),a=n(38944),o=n(72182),l=n(38579),s=n.n(l),u=n(90909),c=n(92410),d=n(75275),m=n(71897),p=n(66839),v=n(89204),f=n(982),g=n(57130),h=n(87918),y=n.n(h);let C={drag:!0,initial:0,slides:{perView:2,origin:"center",spacing:10},breakpoints:{"(min-width: 640px)":{slides:{perView:2,spacing:10}},"(min-width: 830px)":{slides:{perView:3,spacing:10}},"(min-width: 1230px)":{slides:{perView:4.5,spacing:10}}},loop:!0};e.Z=t=>{let{variants:e,onSelectVariant:n,isLoadingAddProduct:l,currencyCode:h,locale:b,title:_,textAlign:S="center",className:x}=t,[k,w]=(0,o.E)(C,[t=>(0,g.y)(t,C)]),{t:N}=(0,u.$)("molecules",{keyPrefix:"cartProductSlider"}),P=(0,r.useCallback)(t=>{n(t)},[n]),I=(0,r.useCallback)(()=>{var t;w&&(null==w||null===(t=w.current)||void 0===t||t.next())},[w]),j=(0,r.useCallback)(()=>{var t;w&&(null==w||null===(t=w.current)||void 0===t||t.prev())},[w]),L=(0,r.useCallback)(t=>()=>{P(t)},[P]);return(0,i.jsx)("section",{className:(0,a.Z)(y().root,x),children:(0,i.jsxs)(c.Z,{className:y().sliderContainer,children:[(0,i.jsx)("div",{className:(0,a.Z)(y().titleContainer,{[y().alignCenter]:"center"===S,[y().alignLeft]:"left"===S,[y().alignRight]:"right"===S}),children:(0,i.jsx)(d.default,{tag:"h5",weight:"bold",size:"xl",children:null!=_?_:N("title")})}),(0,i.jsx)("div",{ref:k,className:"keen-slider",children:null==e?void 0:e.map(t=>{var e,n,r,o,u,c,p;return(0,i.jsxs)("div",{className:(0,a.Z)(y().sliderBox,"keen-slider__slide"),children:[(0,i.jsx)(s(),{src:null==t?void 0:t.imageSrc,alt:"".concat(null==t?void 0:t.name,"-image"),width:1e3,height:134,priority:!0,quality:100,className:y().image}),(0,i.jsxs)("div",{className:y().slideContent,children:[(0,i.jsx)(d.default,{className:y().textPrice,tag:"p",weight:"bold",size:"sm",children:t.name}),(0,i.jsx)(d.default,{className:y().textPrice,tag:"p",size:"sm",children:(0,v.Z)({price:null!==(o=null===(e=t.priceStandAlone)||void 0===e?void 0:e.centAmount)&&void 0!==o?o:0,currency:null!==(c=null!==(u=null===(n=t.priceStandAlone)||void 0===n?void 0:n.currencyCode)&&void 0!==u?u:h)&&void 0!==c?c:"",fractionDigits:null!==(p=null===(r=t.priceStandAlone)||void 0===r?void 0:r.fractionDigits)&&void 0!==p?p:0,locale:b})}),(0,i.jsx)(m.default,{className:y().addToCartButton,disabled:l,variant:"secondary",size:"base",onClick:L(t),children:N("addToCart")})]})]},"product-card-".concat((0,f.Z)(null==t?void 0:t.name)))})}),(0,i.jsxs)("div",{className:y().controls,children:[(0,i.jsx)(p.Z,{icon:"chevron-left",id:"slider-btn-previous",className:y().control,onClick:j}),(0,i.jsx)(p.Z,{icon:"chevron-right",id:"slider-btn-next",className:y().control,onClick:I})]})]})})}},15909:function(t,e,n){"use strict";var i=n(89204);let getAllCustomFields=t=>{var e,n,i,r,a,o,l,s,u,c,d,m,p,v,f,g,h,y;let C=null!==(v=null==t?void 0:null===(e=t.custom)||void 0===e?void 0:e.customFieldsRaw)&&void 0!==v?v:[],b=null!==(f=null===(n=C.find(t=>"product-image-url"===t.name))||void 0===n?void 0:n.value)&&void 0!==f?f:"#",_=null===(i=C.find(t=>"product-display-name"===t.name))||void 0===i?void 0:i.value,S=_.length>1?_[_.length-1]:"",x=null!==(g=null===(r=null===(a=C.find(t=>"product-description"===t.name))||void 0===a?void 0:a.value)||void 0===r?void 0:r.filter(t=>t))&&void 0!==g?g:[],k=null===(o=C.find(t=>"product-type"===t.name))||void 0===o?void 0:o.value,w=null===(l=C.find(t=>"product-sku"===t.name))||void 0===l?void 0:l.value,N=null===(s=C.find(t=>"product-erpid"===t.name))||void 0===s?void 0:s.value,P=null===(u=C.find(t=>"product-can-be-restocked"===t.name))||void 0===u?void 0:u.value,I=null!==(h=null===(c=C.find(t=>"product-category"===t.name))||void 0===c?void 0:c.value)&&void 0!==h?h:"",j=null===(d=C.find(t=>"product-key"===t.name))||void 0===d?void 0:d.value,L=null===(m=C.find(t=>"product-discounted-price"===t.name))||void 0===m?void 0:m.value,A=null!==(y=null===(p=C.find(t=>"variant-description"===t.name))||void 0===p?void 0:p.value)&&void 0!==y?y:[];return{productImageUrl:b,displayName:_,productVariant:S,itemAttributes:x,productType:k,productSku:w,productErpId:N,canBeRestocked:P,productCategory:I,productKey:j,discountedPriceRaw:L,nonChangeableTypes:["frame","giftcard"],variantDescription:A}};e.Z=t=>{let{items:e,fractionDigits:n,currencyCode:r,useGrouping:a=!1,locale:o}=t,l=e.map(t=>{var e,l,s,u,c;let{productImageUrl:d,displayName:m,productVariant:p,itemAttributes:v,productType:f,productSku:g,productErpId:h,canBeRestocked:y,productCategory:C,productKey:b,discountedPriceRaw:_,nonChangeableTypes:S,variantDescription:x}=getAllCustomFields(t),getIsShowDiscountedPrice=t=>{if(t.discountedPricePerQuantity&&t.discountedPricePerQuantity.length>0&&1===t.quantity){let e=t.discountedPricePerQuantity.some(e=>e.discountedPrice.value.centAmount<t.money.centAmount);return e}return!1},k=(0,i.Z)({price:_,currency:null!=r?r:null==t?void 0:null===(e=t.money)||void 0===e?void 0:e.currencyCode,fractionDigits:null!=n?n:null==t?void 0:null===(l=t.money)||void 0===l?void 0:l.fractionDigits,locale:o,useGrouping:a}),w=(0,i.Z)({price:t.money.centAmount,currency:null==t?void 0:null===(s=t.money)||void 0===s?void 0:s.currencyCode,fractionDigits:null==t?void 0:null===(u=t.money)||void 0===u?void 0:u.fractionDigits,locale:o,useGrouping:a}),N=getIsShowDiscountedPrice(t)?w:k,P=void 0===f||void 0!==f&&!S.includes(f),I=m.length>1?m.slice(0,-1).join(" "):null!==(c=m[0])&&void 0!==c?c:"",j="/shop/cart/";if(b&&C){let t="giftcard"===f?"stuff":C;j="/shop/product/".concat(t,"/").concat(b)}let L={productName:I,altImage:I,productImageUrl:d,productVariant:p,productAttributes:v,crossedOut:_>0||getIsShowDiscountedPrice(t),discountPrice:_>0||getIsShowDiscountedPrice(t)?N:void 0,canBeRestocked:null!=y&&y,productCategory:C,productKey:b,productUrl:j,variantDescription:x,productType:f},A=getIsShowDiscountedPrice(t)?t.totalPrice:t.money,T=(0,i.Z)({price:null==A?void 0:A.centAmount,currency:null!=r?r:null==A?void 0:A.currencyCode,fractionDigits:null!=n?n:null==A?void 0:A.fractionDigits,locale:o,useGrouping:a}),D=null==t?void 0:t.quantity,R=null==t?void 0:t.id;return{uuid:R,productData:L,productPrice:T,quantity:D,canChangeQuantity:P,productSku:g,productErpId:h}});return l}},92290:function(t,e,n){"use strict";n.d(e,{R:function(){return singleVariantLineShouldUseColorLabel}}
1);var i=n(44851);function singleVariantLineShouldUseColorLabel(t,e,n,r){if(1!==t)return!1;let a=(null!=e?e:"").toLowerCase().replace(/_/g,"-"),o=function(t){if(!t)return[];let e=Array.isArray(t)?t:[t];return e.map(t=>String(t).toLowerCase().replace(/_/g,"-"))}(n);return!!(o.includes("clip-on")||o.includes("stuff")||"stuff"===a||"st"===a)||"giftcard"===a||"clip-on"===a||null!=r&&""!==r&&"undefined"!==r&&!(0,i.O)(r)}},26973:function(t,e,n){"use strict";var i=n(85115);e.Z=(t,e)=>{var n,r;let a=[...t],o=null!==(r=null==e?void 0:null===(n=e.split("-"))||void 0===n?void 0:n[1])&&void 0!==r?r:void 0,getAttributeByKey=t=>{let{variants:e,key:n,country:i,localizedKey:r}=t,a=i?"es-".concat(i.toUpperCase()):"";return e.map(t=>{var e,o;let l=t.attributesRaw.find(t=>t.name===n);if(!i)return null!==(e=null==l?void 0:l.value)&&void 0!==e?e:0;let s=t.attributesRaw.find(t=>t.name===r),u=null==s?void 0:s.value;return s&&(null==u?void 0:u[a])?Number(null==u?void 0:u[a]):null!==(o=null==l?void 0:l.value)&&void 0!==o?o:0})[0]},l=a.map(t=>{var e;return null===(e=t.custom.custom)||void 0===e?void 0:e.customFieldsRaw}).filter(t=>t).flat(),s=(0,i.T1)("priority-products",l),u=Array.isArray(s)?s:[],c=a.slice(0).sort((t,e)=>{var n,i,r,a;let l=t.masterData.current,s=null!==(r=null===(n=t.masterData.current.nameAllLocales.find(t=>"es"===t.locale&&t.value||"en"===t.locale&&t.value))||void 0===n?void 0:n.value)&&void 0!==r?r:"",c=null!==(a=null===(i=t.masterData.current.nameAllLocales.find(t=>"es"===t.locale&&t.value||"en"===t.locale&&t.value))||void 0===i?void 0:i.value)&&void 0!==a?a:"",d=getAttributeByKey({variants:l.allVariants,key:"sequence",localizedKey:"sequence-localized",country:o}),m=getAttributeByKey({variants:l.allVariants,key:"erp-id"}),p=e.masterData.current,v=getAttributeByKey({variants:p.allVariants,key:"sequence",localizedKey:"sequence-localized",country:o}),f=getAttributeByKey({variants:p.allVariants,key:"erp-id"}),g=u.some(e=>e.id===t.id),h=u.some(t=>t.id===e.id);return g&&!h?-1:!g&&h||Number(v)>Number(d)?1:Number(v)<Number(d)?-1:Number(f)>Number(m)?1:Number(f)<Number(m)?-1:s.localeCompare(c)});return c}},42185:function(t,e){"use strict";e.Z=(t,e)=>{let n=new Date,i=e.length<=0?"typeId=".concat(JSON.stringify(1)):"id=".concat(JSON.stringify(e)),r=new Date(n.getTime()-864e5*t),a=r.toISOString().split("T")[0];return"createdAt >= ".concat(JSON.stringify(a)," and supplyChannel(").concat(i,")")}},46327:function(t){t.exports={overlay:"CartPage_overlay__vQCbI",active:"CartPage_active__gwPci",loadText:"CartPage_loadText__XcOLK"}},18928:function(t){t.exports={root:"Breadcrumb_root__nhSX5",span:"Breadcrumb_span__nct7n",lastItem:"Breadcrumb_lastItem__S6uhm"}},13395:function(t){t.exports={root:"CartComments_root__EaD1R",title:"CartComments_title__ekaOp",textInformation:"CartComments_textInformation__v8t37",textarea:"CartComments_textarea__F8VRt"}},88359:function(t){t.exports={root:"CartItem_root__sulSV",articleSummary:"CartItem_articleSummary__4NMQZ",pipeSeparatorItemDetails:"CartItem_pipeSeparatorItemDetails__7PneE",articleDetails:"CartItem_articleDetails__PXamK",midColumn:"CartItem_midColumn__adaaF",cartItemsDetail:"CartItem_cartItemsDetail__tRer5",productPriceItem:"CartItem_productPriceItem__mB__X",removeItemButton:"CartItem_removeItemButton__xgtda",articlesSeparator:"CartItem_articlesSeparator__Jhig7",imageContainer:"CartItem_imageContainer__TWYmE",productImage:"CartItem_productImage__QMkyn"}},66763:function(t){t.exports={root:"CartItemDetails_root__IF9_r",productAttributes:"CartItemDetails_productAttributes__SCloC",pdpAttributeStack:"CartItemDetails_pdpAttributeStack__BQXYz",centeredAttributes:"CartItemDetails_centeredAttributes__yk7ZF",leftAlignedAttributes:"CartItemDetails_leftAlignedAttributes__euKi1",selfLeftAligned:"CartItemDetails_selfLeftAligned__X5BSK",confirmationPrice:"CartItemDetails_confirmationPrice__tTMJv",attributeItem:"CartItemDetails_attributeItem__P1Wfy",productPriceItem:"CartItemDetails_productPriceItem__rBpOq",variantDescriptionItem:"CartItemDetails_variantDescriptionItem__K2yHd",attributeValue:"CartItemDetails_attributeValue__OATBw",de
1sktopProductName:"CartItemDetails_desktopProductName__8Dfqb",mobileProductName:"CartItemDetails_mobileProductName__FeV8t",productNameLink:"CartItemDetails_productNameLink__ruJRe",colorRow:"CartItemDetails_colorRow__PDe2g",imageContainer:"CartItemDetails_imageContainer__aqbLm"}},58342:function(t){t.exports={root:"CartOrderSummary_root__E7UZm",content:"CartOrderSummary_content__im8rZ",stackedRow:"CartOrderSummary_stackedRow__yTvki",totalAmount:"CartOrderSummary_totalAmount__TCfvM",containerTextAndButton:"CartOrderSummary_containerTextAndButton__QyJxa",textInformation:"CartOrderSummary_textInformation__bfCfd",containerButton:"CartOrderSummary_containerButton__0apOJ",floatingButton:"CartOrderSummary_floatingButton__oT5k4",buttonPrimary:"CartOrderSummary_buttonPrimary__n1bfI",buttonSecondary:"CartOrderSummary_buttonSecondary__rm5AD",stroke:"CartOrderSummary_stroke__JEVOB",paymentMethodsContainer:"CartOrderSummary_paymentMethodsContainer__0taPI"}},87918:function(t){t.exports={root:"CartProductSlider_root__kBJHR",titleContainer:"CartProductSlider_titleContainer__FYHnC",sliderContainer:"CartProductSlider_sliderContainer__iLLiX",controls:"CartProductSlider_controls__n_8xc",productCard:"CartProductSlider_productCard__R_zZT",image:"CartProductSlider_image__K4J6G",textPrice:"CartProductSlider_textPrice__OuG3k",addToCartButton:"CartProductSlider_addToCartButton__g_IBL",sliderBox:"CartProductSlider_sliderBox__Wkhx4",slideContent:"CartProductSlider_slideContent__sO9aW",alignCenter:"CartProductSlider_alignCenter__PRELQ",alignLeft:"CartProductSlider_alignLeft__zIT81",alignRight:"CartProductSlider_alignRight__IcXR4"}},5943:function(t){t.exports={root:"EmptyCart_root__K8Hi0",button:"EmptyCart_button__w8n2a",cardProductContainer:"EmptyCart_cardProductContainer__Lh3OX"}},69776:function(t){t.exports={root:"QuantityCart_root__5q6Uh",content:"QuantityCart_content__uOqQK",quantity:"QuantityCart_quantity__rjXNk",quantityModifier:"QuantityCart_quantityModifier__8so_H"}},96728:function(t){t.exports={root:"Cart_root__Kkx2G",isLoading:"Cart_isLoading__Q_Wwz",cartListRoot:"Cart_cartListRoot__ZyfvD",cartSummaryRoot:"Cart_cartSummaryRoot__iwHj7",cartCommentsRoot:"Cart_cartCommentsRoot__uflTq",attentionRoot:"Cart_attentionRoot__iAdks"}},90601:function(t){t.exports={root:"CartList_root__RaZrn",itemsContainer:"CartList_itemsContainer__LYIZu",listStartSeparator:"CartList_listStartSeparator__rMYb4"}},54598:function(t,e,n){"use strict";n.d(e,{ht:function(){return tabbable}});var i='input,select,textarea,a[href],button,[tabindex]:not(slot),audio[controls],video[controls],[contenteditable]:not([contenteditable="false"]),details>summary:first-of-type,details',r="undefined"==typeof Element,a=r?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,o=!r&&Element.prototype.getRootNode?function(t){return t.getRootNode()}:function(t){return t.ownerDocument},getCandidates=function(t,e,n){var r=Array.prototype.slice.apply(t.querySelectorAll(i));return e&&a.call(t,i)&&r.unshift(t),r=r.filter(n)},getCandidatesIteratively=function getCandidatesIteratively(t,e,n){for(var r=[],o=Array.from(t);o.length;){var l=o.shift();if("SLOT"===l.tagName){var s=l.assignedElements(),u=getCandidatesIteratively(s.length?s:l.children,!0,n);
1n.flatten?r.push.apply(r,u):r.push({scope:l,candidates:u})}else{a.call(l,i)&&n.filter(l)&&(e||!t.includes(l))&&r.push(l);var c=l.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(l),d=!n.shadowRootFilter||n.shadowRootFilter(l);if(c&&d){var m=getCandidatesIteratively(!0===c?l.children:c.children,!0,n);n.flatten?r.push.apply(r,m):r.push({scope:l,candidates:m})}else o.unshift.apply(o,l.children)}}return r},getTabindex=function(t,e){return t.tabIndex<0&&(e||/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||t.isContentEditable)&&isNaN(parseInt(t.getAttribute("tabindex"),10))?0:t.tabIndex},sortOrderedTabbables=function(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex},isInput=function(t){return"INPUT"===t.tagName},getCheckedRadio=function(t,e){for(var n=0;n<t.length;n++)if(t[n].checked&&t[n].form===e)return t[n]},isTabbableRadio=function(t){if(!t.name)return!0;var e,n=t.form||o(t),queryRadios=function(t){return n.querySelectorAll('input[type="radio"][name="'+t+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)e=queryRadios(window.CSS.escape(t.name));else try{e=queryRadios(t.name)}catch(t){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",t.message),!1}var i=getCheckedRadio(e,t.form);return!i||i===t},isZeroArea=function(t){var e=t.getBoundingClientRect(),n=e.width,i=e.height;return 0===n&&0===i},isHidden=function(t,e){var n=e.displayCheck,i=e.getShadowRoot;if("hidden"===getComputedStyle(t).visibility)return!0;var r=a.call(t,"details>summary:first-of-type")?t.parentElement:t;if(a.call(r,"details:not([open]) *"))return!0;var l=o(t).host,s=(null==l?void 0:l.ownerDocument.contains(l))||t.ownerDocument.contains(t);if(n&&"full"!==n){if("non-zero-area"===n)return isZeroArea(t)}else{if("function"==typeof i){for(var u=t;t;){var c=t.parentElement,d=o(t);if(c&&!c.shadowRoot&&!0===i(c))return isZeroArea(t);t=t.assignedSlot?t.assignedSlot:c||d===t.ownerDocument?c:d.host}t=u}if(s)return!t.getClientRects().length}return!1},isDisabledFromFieldset=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var e=t.parentElement;e;){if("FIELDSET"===e.tagName&&e.disabled){for(var n=0;n<e.children.length;n++){var i=e.children.item(n);if("LEGEND"===i.tagName)return!!a.call(e,"fieldset[disabled] *")||!i.contains(t)}return!0}e=e.parentElement}return!1},isNodeMatchingSelectorTabbable=function(t,e){var n,i,r;return!(isInput(n=e)&&"radio"===n.type&&!isTabbableRadio(n)||0>getTabindex(e))&&(i=t,!((r=e).disabled||isInput(r)&&"hidden"===r.type||isHidden(r,i)||"DETAILS"===r.tagName&&Array.prototype.slice.apply(r.children).some(function(t){return"SUMMARY"===t.tagName})||isDisabledFromFieldset(r)))},isValidShadowRootTabbable=function(t){var e=parseInt(t.getAttribute("tabindex"),10);return!!isNaN(e)||e>=0},sortByOrder=function sortByOrder(t){var e=[],n=[];return t.forEach(function(t,i){var r=!!t.scope,a=r?t.scope:t,o=getTabindex(a,r),l=r?sortByOrder(t.candidates):a;0===o?r?e.push.apply(e,l):e.push(a):n.push({documentOrder:i,tabIndex:o,item:t,isScope:r,content:l})}),n.sort(sortOrderedTabbables).reduce(function(t,e){return e.isScope?t.push.apply(t,e.content):t.push(e.content),t},[]).concat(e)},tabbable=function(t,e){return sortByOrder((e=e||{}).getShadowRoot?getCandidatesIteratively([t],e.includeContainer,{filter:isNodeMatchingSelectorTabbable.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:isValidShadowRootTabbable}):getCandidates(t,e.includeContainer,isNodeMatchingSelectorTabbable.bind(null,e)))}},44851:function(t,e,n){"use strict";function variantLineLooksLikeFrameCaliber(t){let e=t.trim();return!!(/^\d{1,2}$/.test(e)||/^\d{1,2}\s*[□xX]\s*\d{1,2}$/.test(e)||/^\d{1,2}-\d{1,2}$/.test(e))}function pickVariantPart(t,e){let n=t[e];return null==n||"undefined"===n?null:n}function normalizedCategoryTokens(t){if(!t)return[];let e=Array.isArray(t)?t:[t];return e.map(t=>String(t).toLowerCase().replace(/_/g,"-"))}function mapVariantDescriptionToSizeColor(t,e,n){let i=t.filter(t=>null!=t&&""!==t&&"undefined"!==t),r=i.length,a=pickVariantPart(t,0),o=pickVariantPart(t,1),l=pickVariantPart(t,2),s=function(t,e){let n=(null!=t?t:"").toLowerCase().replace(/_/g,"-");return"pregraduated"===n||normalizedCategoryTokens(e).includes("pregraduated")}(e,n)&&l?l:null;return 0===r?{size:null,color:null,pregraduation:s}:1===r&&a&&(function(t,e){let n=(null!=t?t:"").toLowerCase().replace(/_/g,"-");return"clip-on"===n||normalizedCategoryTokens(e).includes("clip-on")}(e,n)||function(t,e,n){if(1!==t)return!1;let i=(null!=e?e:"").toLowerCase(),r=normalizedCategoryTokens(n);return!!r.includes("stuff")||"stuff"===i||"st"===i||"giftcard"===i}(r,e,n)||!variantLineLooksLikeFrameCaliber(a))?{size:null,color:a,pregraduation:s}
1:{size:a,color:o,pregraduation:s}}n.d(e,{O:function(){return variantLineLooksLikeFrameCaliber},y:function(){return mapVariantDescriptionToSizeColor}})},70900:function(t,e,n){"use strict";n.d(e,{t:function(){return i}});let i='\n  query getProducts(\n    $where: String!\n    $storeKey: KeyReferenceInput!\n    $channels: [String!]\n    $currency: Currency!\n    $channelId: String!\n    $inventory: String!\n  ) {\n    inStore(key: $storeKey) {\n      productSelectionAssignments(where: $where, limit: 250) {\n        results {\n          variantSelection {\n            type\n            skus\n          }\n          productSelection {\n            name(locale: "es")\n            custom {\n              customFieldsRaw {\n                name\n                value\n              }\n            }\n          }\n          product {\n            id\n            key\n            createdAt\n            masterData {\n              published\n              current {\n                nameAllLocales {\n                  value\n                  locale\n                }\n                description(locale: "es")\n                slug(locale: "es")\n                allVariants {\n                  id\n                  sku\n                  images {\n                    url\n                    label\n                  }\n                  assets {\n                    id\n                    name(locale: "en")\n                    sources {\n                      uri\n                    }\n                  }\n                  attributesRaw {\n                    name\n                    value\n                  }\n                  availability {\n                    channels(includeChannelIds: $channels) {\n                      results {\n                        channel {\n                          id\n                          name(locale: "es")\n                        }\n                        availability {\n                          isOnStock\n                          availableQuantity\n                        }\n                      }\n                    }\n                  }\n                  price(currency: $currency, channelId: $channelId) {\n                    value {\n                      currencyCode\n                      centAmount\n                      fractionDigits\n                    }\n                    discounted {\n                      value {\n                        currencyCode\n                        centAmount\n                        fractionDigits\n                      }\n                    }\n                  }\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n    inventoryEntries(where: $inventory, limit: 500) {\n      results {\n        id\n        key\n        sku\n        lastModifiedAt\n      }\n    }\n  }\n'},34158:function(t,e,n){"use strict";n.d(e,{z:function(){return i}});let i="\n  query getProductPriceQuery($where: String!) {\n    standalonePrices(where: $where, limit: 500) {\n      results {\n        key\n        sku\n        value {\n          currencyCode\n          centAmount\n          fractionDigits\n        }\n        channel {\n          id\n        }\n        discounted {\n          value {\n            currencyCode\n            centAmount\n            fractionDigits\n          }\n        }\n        custom {\n          type {\n            id\n          }\n          typeRef {\n            typeId\n            id\n          }\n          customFieldsRaw {\n            name\n            value\n          }\n        }\n      }\n    }\n  }\n"}},function(t){t.O(0,[8727,1573,583,8670,6739,9774,2888,179],function(){return t(t.s=60066)}),_N_E=t.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.