cloudcommerce 2.6.2 → 2.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/test-apps.yml +1 -1
- package/CHANGELOG.md +21 -0
- package/README.md +2 -0
- package/ecomplus-stores/barradoce/functions/many/package.json +3 -3
- package/ecomplus-stores/barradoce/functions/ssr/content/reviews.json +71 -0
- package/ecomplus-stores/barradoce/functions/ssr/content/types.d.ts +5 -0
- package/ecomplus-stores/barradoce/functions/ssr/package.json +6 -6
- package/ecomplus-stores/barradoce/functions/ssr/src/components/ProductDetails.vue +2 -1
- package/ecomplus-stores/barradoce/functions/ssr/src/env.d.ts +1 -0
- package/ecomplus-stores/barradoce/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/barradoce/package.json +2 -2
- package/package.json +7 -7
- package/packages/api/package.json +1 -1
- package/packages/apps/affiliate-program/package.json +1 -1
- package/packages/apps/correios/package.json +1 -1
- package/packages/apps/custom-payment/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +1 -1
- package/packages/apps/datafrete/package.json +1 -1
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/emails/package.json +1 -1
- package/packages/apps/fb-conversions/package.json +1 -1
- package/packages/apps/flash-courier/package.json +1 -1
- package/packages/apps/frenet/package.json +1 -1
- package/packages/apps/galaxpay/package.json +1 -1
- package/packages/apps/google-analytics/package.json +1 -1
- package/packages/apps/jadlog/package.json +1 -1
- package/packages/apps/loyalty-points/package.json +1 -1
- package/packages/apps/mandae/package.json +1 -1
- package/packages/apps/melhor-envio/package.json +1 -1
- package/packages/apps/mercadopago/package.json +1 -1
- package/packages/apps/pagarme/package.json +2 -2
- package/packages/apps/pagarme-v5/package.json +1 -1
- package/packages/apps/paghiper/package.json +1 -1
- package/packages/apps/pix/package.json +1 -1
- package/packages/apps/tiny-erp/package.json +1 -1
- package/packages/apps/webhooks/package.json +1 -1
- package/packages/cli/package.json +2 -2
- package/packages/config/package.json +1 -1
- package/packages/emails/package.json +2 -2
- package/packages/eslint/package.json +6 -6
- package/packages/events/package.json +1 -1
- package/packages/feeds/package.json +1 -1
- package/packages/firebase/package.json +2 -2
- package/packages/i18n/package.json +1 -1
- package/packages/modules/package.json +1 -1
- package/packages/passport/package.json +1 -1
- package/packages/ssr/lib/lib/cron-ssr-save-views.js +71 -66
- package/packages/ssr/lib/lib/cron-ssr-save-views.js.map +1 -1
- package/packages/ssr/package.json +6 -6
- package/packages/ssr/src/lib/cron-ssr-save-views.ts +84 -77
- package/packages/storefront/dist/client/_astro/AccountPage.B4WZaOzX.js +1 -0
- package/packages/storefront/dist/client/_astro/CartSidebar.DAGdpIcU.js +1 -0
- package/packages/storefront/dist/client/_astro/HeroSlider.Dq_9kcdU.js +1 -0
- package/packages/storefront/dist/client/_astro/PitchBar.BwLlIs6F.js +1 -0
- package/packages/storefront/dist/client/_astro/Prices.BgHTq5id.js +1 -0
- package/packages/storefront/dist/client/_astro/ProductDetails.CnYNdPl5.js +7 -0
- package/packages/storefront/dist/client/_astro/ProductShelf.kfADQTUO.js +1 -0
- package/packages/storefront/dist/client/_astro/SearchModal.DcmvABes.js +1 -0
- package/packages/storefront/dist/client/_astro/SearchShowcase.C9GWwOnF.js +1 -0
- package/packages/storefront/dist/client/_astro/ShippingCalculator.DE01D7dt.js +1 -0
- package/packages/storefront/dist/client/_astro/ShopHeader.Cf4t6O6z.js +7 -0
- package/packages/storefront/dist/client/_astro/_commonjsHelpers.Cpj98o6Y.js +1 -0
- package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.CBemkWnU.js +5 -0
- package/packages/storefront/dist/client/_astro/{_slug_.4W7qhV-L.css → _slug_.DX_OkMX7.css} +1 -1
- package/packages/storefront/dist/client/_astro/{afetch.OifQZgwR.js → afetch.DPLba2tr.js} +1 -1
- package/packages/storefront/dist/client/_astro/client.CdXC84C5.js +1 -0
- package/packages/storefront/dist/client/_astro/customer-session.CNe1heRH.js +7 -0
- package/packages/storefront/dist/client/_astro/{firebase-app.iLdzDVjL.js → firebase-app.CBckq0Sj.js} +1 -1
- package/packages/storefront/dist/client/_astro/{format-money.1_HtF5S2.js → format-money.DINpWB0x.js} +1 -1
- package/packages/storefront/dist/client/_astro/grid-title.D4m7-g3h.js +1 -0
- package/packages/storefront/dist/client/_astro/hoisted.B2rH1xwX.js +8 -0
- package/packages/storefront/dist/client/_astro/hoisted.DBPXHTEb.js +1 -0
- package/packages/storefront/dist/client/_astro/hoisted.EBqhuD5o.js +1 -0
- package/packages/storefront/dist/client/_astro/{hoisted.GaT7bmE3.js → hoisted.ut_nNM_H.js} +1 -1
- package/packages/storefront/dist/client/_astro/i18n.B3skIOFg.js +1 -0
- package/packages/storefront/dist/client/_astro/img-sizes.rFK7so02.js +1 -0
- package/packages/storefront/dist/client/_astro/img.D5a6GzeE.js +1 -0
- package/packages/storefront/dist/client/_astro/index.CFw6O-Kt.js +1 -0
- package/packages/storefront/dist/client/_astro/index.DBfgCyd-.js +1 -0
- package/packages/storefront/dist/client/_astro/{modules-info.HP6478mG.js → modules-info.BHKiT6oA.js} +1 -1
- package/packages/storefront/dist/client/_astro/name.BZA9xqh-.js +1 -0
- package/packages/storefront/dist/client/_astro/photoswipe.esm.C0FT-EY-.js +4 -0
- package/packages/storefront/dist/client/_astro/price.CHiL6Z1J.js +1 -0
- package/packages/storefront/dist/client/_astro/sf-utils.Cigv01cN.js +13 -0
- package/packages/storefront/dist/client/_astro/shopping-cart.D-w8Z-4p.js +1 -0
- package/packages/storefront/dist/client/_astro/use-analytics.CQDdNgwF.js +1 -0
- package/packages/storefront/dist/client/_astro/use-cms-preview.4Hq7LCmA.js +1 -0
- package/packages/storefront/dist/client/_astro/use-product-card.CQRlRsNX.js +1 -0
- package/packages/storefront/dist/client/_astro/use-text-value.UjCYLWjm.js +4 -0
- package/packages/storefront/dist/client/img/uploads/logo.png +0 -0
- package/packages/storefront/dist/server/chunks/{CartSidebar_3_1aFp67.mjs → CartSidebar_BmwcZuxv.mjs} +36 -4
- package/packages/storefront/dist/server/chunks/{SearchModal_2azP1u7P.mjs → SearchModal_BvEnUvAx.mjs} +4 -3
- package/packages/storefront/dist/server/chunks/_.._DORZHe_Z.mjs +5 -0
- package/packages/storefront/dist/server/chunks/{_page__qqIVxbal.mjs → _page__DU3kNewy.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/{account_vK6pmJlz.mjs → account_CaTloREf.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/astro/{assets-service_631fRtTy.mjs → assets-service_B77Hm2ue.mjs} +2 -2
- package/packages/storefront/dist/server/chunks/{astro_u-oSb215.mjs → astro_ISB6VLqs.mjs} +178 -59
- package/packages/storefront/dist/server/chunks/index_BTDpenpc.mjs +5 -0
- package/packages/storefront/dist/server/chunks/index_D0q4ab_n.mjs +5 -0
- package/packages/storefront/dist/server/chunks/{node_zqXXqc-u.mjs → node_C7sdLKL4.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/pages/{__ZucPYaOo.mjs → __B4CsSrck.mjs} +1751 -344
- package/packages/storefront/dist/server/chunks/pages/{_page__0sN9U0SD.mjs → _page__sb5Idhgp.mjs} +2 -3
- package/packages/storefront/dist/server/chunks/pages/{account_OQr_6KN1.mjs → account_iWjHfkwu.mjs} +2 -3
- package/packages/storefront/dist/server/chunks/pages/{index_3IjgOEIq.mjs → index_BZlpKBRL.mjs} +41 -4
- package/packages/storefront/dist/server/chunks/pages/node_GFu-CQ19.mjs +852 -0
- package/packages/storefront/dist/server/chunks/pages/{~fallback_133FK-CP.mjs → ~fallback_C07rzeay.mjs} +2 -3
- package/packages/storefront/dist/server/chunks/{index__05fnqFh.mjs → ~fallback_YpJa9BIL.mjs} +1 -1
- package/packages/storefront/dist/server/entry.mjs +751 -912
- package/packages/storefront/dist/server/manifest_KFjAaJaC.mjs +201 -0
- package/packages/storefront/dist/server/renderers.mjs +1 -1
- package/packages/storefront/package.json +8 -8
- package/packages/storefront/src/lib/composables/use-breadcrumbs.ts +2 -1
- package/packages/storefront/src/lib/composables/use-search-showcase.ts +2 -1
- package/packages/storefront/src/lib/content.d.ts +4 -1
- package/packages/storefront/src/lib/custom-content.d.ts +9 -0
- package/packages/storefront/src/lib/ssr-context.ts +6 -4
- package/packages/test-base/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/storefront/dist/client/_astro/AccountPage.0M6_FdU6.js +0 -1
- package/packages/storefront/dist/client/_astro/CartSidebar.L0Vbhsdt.js +0 -1
- package/packages/storefront/dist/client/_astro/HeroSlider.ju9TsLrJ.js +0 -1
- package/packages/storefront/dist/client/_astro/PitchBar.yqD9ycx5.js +0 -1
- package/packages/storefront/dist/client/_astro/Prices.xI1rdM1e.js +0 -1
- package/packages/storefront/dist/client/_astro/ProductDetails.FQtM5kpd.js +0 -7
- package/packages/storefront/dist/client/_astro/ProductShelf.-4fsYkPB.js +0 -1
- package/packages/storefront/dist/client/_astro/ProductShelf.GAAhKdTN.js +0 -1
- package/packages/storefront/dist/client/_astro/QuantitySelector.v7L8EYOR.js +0 -1
- package/packages/storefront/dist/client/_astro/SearchModal.rasg5jV6.js +0 -1
- package/packages/storefront/dist/client/_astro/SearchShowcase.kA6jICYo.js +0 -1
- package/packages/storefront/dist/client/_astro/ShopHeader.v_L96Y90.js +0 -7
- package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.xATGHWd9.js +0 -5
- package/packages/storefront/dist/client/_astro/client.YJ00ta5M.js +0 -1
- package/packages/storefront/dist/client/_astro/customer-session.ZD6tLDQJ.js +0 -7
- package/packages/storefront/dist/client/_astro/grid-title.pK2Nn3i-.js +0 -1
- package/packages/storefront/dist/client/_astro/hoisted.ICXGWNEA.js +0 -1
- package/packages/storefront/dist/client/_astro/hoisted.XOXTrHqn.js +0 -1
- package/packages/storefront/dist/client/_astro/i18n.zhlBzJt8.js +0 -1
- package/packages/storefront/dist/client/_astro/img-sizes.gxAI9JNh.js +0 -1
- package/packages/storefront/dist/client/_astro/img.AnjeGdy_.js +0 -1
- package/packages/storefront/dist/client/_astro/index.KfrHdfOH.js +0 -1
- package/packages/storefront/dist/client/_astro/index.ShNlAyu1.js +0 -1
- package/packages/storefront/dist/client/_astro/name.VA3MEpe0.js +0 -1
- package/packages/storefront/dist/client/_astro/photoswipe.esm.Ylh9TGkz.js +0 -4
- package/packages/storefront/dist/client/_astro/price.Easct8WC.js +0 -1
- package/packages/storefront/dist/client/_astro/sf-utils.c42cbZ9W.js +0 -13
- package/packages/storefront/dist/client/_astro/shopping-cart.nSNNOrp9.js +0 -1
- package/packages/storefront/dist/client/_astro/use-analytics.wTmoP8B1.js +0 -1
- package/packages/storefront/dist/client/_astro/use-product-card.UFr8SCuD.js +0 -1
- package/packages/storefront/dist/client/_astro/use-text-value.lKqoIagH.js +0 -4
- package/packages/storefront/dist/server/chunks/_.._19fCuQdO.mjs +0 -5
- package/packages/storefront/dist/server/chunks/pages/node_OmjWRf8D.mjs +0 -112
- package/packages/storefront/dist/server/chunks/~fallback_Wahcp9Wk.mjs +0 -5
- package/packages/storefront/dist/server/manifest_9FASPYUE.mjs +0 -202
- /package/packages/storefront/dist/client/_astro/{index-bea2a320.eWykogwr.js → index-bea2a320.CHELEM8n.js} +0 -0
- /package/packages/storefront/dist/client/_astro/{photoswipe-lightbox.esm.dZBqKD9u.js → photoswipe-lightbox.esm.BbYxSZIB.js} +0 -0
- /package/packages/storefront/dist/client/_astro/{photoswipe.0V7m2jWu.js → photoswipe.CNpEZKfy.js} +0 -0
- /package/packages/storefront/dist/client/_astro/{server-data.4C60Esyt.js → server-data.CUHTES8a.js} +0 -0
- /package/packages/storefront/dist/server/chunks/{photoswipe_IcWDJiwc.mjs → photoswipe_wusPJBJF.mjs} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as L,c as _,d as z,a8 as he,I as ae,w as A,m as re,Y as U,ae as ge,af as xe,a6 as _e,ag as D,F as N,M as ye,ah as Oe,aa as Pe,N as se,O as P,P as S,S as g,V as E,W as C,U as q,Z as Q,Q as w,T as j,$ as ke,a0 as G,X as ne,R as I,a1 as Se}from"./sf-utils.c42cbZ9W.js";import{_ as Y,w as te,b as oe,v as we}from"./_plugin-vue_export-helper.xATGHWd9.js";import{u as Le}from"./index.ShNlAyu1.js";import{i as Fe}from"./server-data.4C60Esyt.js";import{i as Re,a as Ce,b as ie,c as $e,d as Ee,e as Me,f as Te,g as Ae,h as Be,j as De,k as Ie,P as je}from"./ProductShelf.-4fsYkPB.js";import{S as Ue}from"./use-analytics.wTmoP8B1.js";import{u as ue,g as Ve}from"./index.KfrHdfOH.js";import{g as ze}from"./grid-title.pK2Nn3i-.js";import{f as W}from"./format-money.1_HtF5S2.js";import{u as V,f as Ne,c as M,w as Ke,a as We,h as qe,o as T,t as Qe,i as X,b as He,E as Ge,s as Xe,A as Z,T as Ye,I as le,d as Ze,l as Je,N as ce,p as et,e as tt,O as at,g as R,D as st}from"./use-text-value.lKqoIagH.js";import"./customer-session.ZD6tLDQJ.js";import"./use-product-card.UFr8SCuD.js";import"./price.Easct8WC.js";import"./name.VA3MEpe0.js";import"./i18n.zhlBzJt8.js";import"./img.AnjeGdy_.js";import"./shopping-cart.nSNNOrp9.js";import"./Prices.xI1rdM1e.js";import"./modules-info.HP6478mG.js";import"./afetch.OifQZgwR.js";function nt(e,s,r){let a=L(r?.value),d=_(()=>e.value!==void 0);return[_(()=>d.value?e.value:a.value),function(l){return d.value||(a.value=l),s?.(l)}]}function de(e={},s=null,r=[]){for(let[a,d]of Object.entries(e))fe(r,pe(s,a),d);return r}function pe(e,s){return e?e+"["+s+"]":s}function fe(e,s,r){if(Array.isArray(r))for(let[a,d]of r.entries())fe(e,pe(s,a.toString()),d);else r instanceof Date?e.push([s,r.toISOString()]):typeof r=="boolean"?e.push([s,r?"1":"0"]):typeof r=="string"?e.push([s,r]):typeof r=="number"?e.push([s,`${r}`]):r==null?e.push([s,""]):de(r,s,e)}function lt(e,s){return e===s}var rt=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(rt||{}),ot=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(ot||{}),it=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(it||{});function ut(e){requestAnimationFrame(()=>requestAnimationFrame(e))}let ve=Symbol("ListboxContext");function J(e){let s=_e(ve,null);if(s===null){let r=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,J),r}return s}let ct=z({name:"Listbox",emits:{"update:modelValue":e=>!0},props:{as:{type:[Object,String],default:"template"},disabled:{type:[Boolean],default:!1},by:{type:[String,Function],default:()=>lt},horizontal:{type:[Boolean],default:!1},modelValue:{type:[Object,String,Number,Boolean],default:void 0},defaultValue:{type:[Object,String,Number,Boolean],default:void 0},form:{type:String,optional:!0},name:{type:String,optional:!0},multiple:{type:[Boolean],default:!1}},inheritAttrs:!1,setup(e,{slots:s,attrs:r,emit:a}){let d=L(1),l=L(null),t=L(null),u=L(null),p=L([]),m=L(""),v=L(null),c=L(1);function i(f=n=>n){let n=v.value!==null?p.value[v.value]:null,o=at(f(p.value.slice()),y=>T(y.dataRef.domRef)),b=n?o.indexOf(n):null;return b===-1&&(b=null),{options:o,activeOptionIndex:b}}let O=_(()=>e.multiple?1:0),[x,h]=nt(_(()=>e.modelValue),f=>a("update:modelValue",f),_(()=>e.defaultValue)),k=_(()=>x.value===void 0?V(O.value,{1:[],0:void 0}):x.value),F={listboxState:d,value:k,mode:O,compare(f,n){if(typeof e.by=="string"){let o=e.by;return f?.[o]===n?.[o]}return e.by(f,n)},orientation:_(()=>e.horizontal?"horizontal":"vertical"),labelRef:l,buttonRef:t,optionsRef:u,disabled:_(()=>e.disabled),options:p,searchQuery:m,activeOptionIndex:v,activationTrigger:c,closeListbox(){e.disabled||d.value!==1&&(d.value=1,v.value=null)},openListbox(){e.disabled||d.value!==0&&(d.value=0)},goToOption(f,n,o){if(e.disabled||d.value===1)return;let b=i(),y=Ne(f===M.Specific?{focus:M.Specific,id:n}:{focus:f},{resolveItems:()=>b.options,resolveActiveIndex:()=>b.activeOptionIndex,resolveId:$=>$.id,resolveDisabled:$=>$.dataRef.disabled});m.value="",v.value=y,c.value=o??1,p.value=b.options},search(f){if(e.disabled||d.value===1)return;let n=m.value!==""?0:1;m.value+=f.toLowerCase();let o=(v.value!==null?p.value.slice(v.value+n).concat(p.value.slice(0,v.value+n)):p.value).find(y=>y.dataRef.textValue.startsWith(m.value)&&!y.dataRef.disabled),b=o?p.value.indexOf(o):-1;b===-1||b===v.value||(v.value=b,c.value=1)},clearSearch(){e.disabled||d.value!==1&&m.value!==""&&(m.value="")},registerOption(f,n){let o=i(b=>[...b,{id:f,dataRef:n}]);p.value=o.options,v.value=o.activeOptionIndex},unregisterOption(f){let n=i(o=>{let b=o.findIndex(y=>y.id===f);return b!==-1&&o.splice(b,1),o});p.value=n.options,v.value=n.activeOptionIndex,c.value=1},theirOnChange(f){e.disabled||h(f)},select(f){e.disabled||h(V(O.value,{0:()=>f,1:()=>{let n=D(F.value.value).slice(),o=D(f),b=n.findIndex(y=>F.compare(o,D(y)));return b===-1?n.push(o):n.splice(b,1),n}}))}};Ke([t,u],(f,n)=>{var o;F.closeListbox(),We(n,qe.Loose)||(f.preventDefault(),(o=T(t))==null||o.focus())},_(()=>d.value===0)),he(ve,F),Qe(_(()=>V(d.value,{0:X.Open,1:X.Closed})));let B=_(()=>{var f;return(f=T(t))==null?void 0:f.closest("form")});return ae(()=>{A([B],()=>{if(!B.value||e.defaultValue===void 0)return;function f(){F.theirOnChange(e.defaultValue)}return B.value.addEventListener("reset",f),()=>{var n;(n=B.value)==null||n.removeEventListener("reset",f)}},{immediate:!0})}),()=>{let{name:f,modelValue:n,disabled:o,form:b,...y}=e,$={open:d.value===0,disabled:o,value:k.value};return re(U,[...f!=null&&k.value!=null?de({[f]:k.value}).map(([K,ee])=>re(He,Ge({features:Xe.Hidden,key:K,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:b,name:K,value:ee}))):[],Z({ourProps:{},theirProps:{...r,...Ye(y,["defaultValue","onUpdate:modelValue","horizontal","multiple","by"])},slot:$,slots:s,attrs:r,name:"Listbox"})])}}}),dt=z({name:"ListboxButton",props:{as:{type:[Object,String],default:"button"},id:{type:String,default:null}},setup(e,{attrs:s,slots:r,expose:a}){var d;let l=(d=e.id)!=null?d:`headlessui-listbox-button-${le()}`,t=J("ListboxButton");a({el:t.buttonRef,$el:t.buttonRef});function u(c){switch(c.key){case R.Space:case R.Enter:case R.ArrowDown:c.preventDefault(),t.openListbox(),N(()=>{var i;(i=T(t.optionsRef))==null||i.focus({preventScroll:!0}),t.value.value||t.goToOption(M.First)});break;case R.ArrowUp:c.preventDefault(),t.openListbox(),N(()=>{var i;(i=T(t.optionsRef))==null||i.focus({preventScroll:!0}),t.value.value||t.goToOption(M.Last)});break}}function p(c){switch(c.key){case R.Space:c.preventDefault();break}}function m(c){t.disabled.value||(t.listboxState.value===0?(t.closeListbox(),N(()=>{var i;return(i=T(t.buttonRef))==null?void 0:i.focus({preventScroll:!0})})):(c.preventDefault(),t.openListbox(),ut(()=>{var i;return(i=T(t.optionsRef))==null?void 0:i.focus({preventScroll:!0})})))}let v=Ze(_(()=>({as:e.as,type:s.type})),t.buttonRef);return()=>{var c,i;let O={open:t.listboxState.value===0,disabled:t.disabled.value,value:t.value.value},{...x}=e,h={ref:t.buttonRef,id:l,type:v.value,"aria-haspopup":"listbox","aria-controls":(c=T(t.optionsRef))==null?void 0:c.id,"aria-expanded":t.listboxState.value===0,"aria-labelledby":t.labelRef.value?[(i=T(t.labelRef))==null?void 0:i.id,l].join(" "):void 0,disabled:t.disabled.value===!0?!0:void 0,onKeydown:u,onKeyup:p,onClick:m};return Z({ourProps:h,theirProps:x,slot:O,attrs:s,slots:r,name:"ListboxButton"})}}}),pt=z({name:"ListboxOptions",props:{as:{type:[Object,String],default:"ul"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},id:{type:String,default:null}},setup(e,{attrs:s,slots:r,expose:a}){var d;let l=(d=e.id)!=null?d:`headlessui-listbox-options-${le()}`,t=J("ListboxOptions"),u=L(null);a({el:t.optionsRef,$el:t.optionsRef});function p(c){switch(u.value&&clearTimeout(u.value),c.key){case R.Space:if(t.searchQuery.value!=="")return c.preventDefault(),c.stopPropagation(),t.search(c.key);case R.Enter:if(c.preventDefault(),c.stopPropagation(),t.activeOptionIndex.value!==null){let i=t.options.value[t.activeOptionIndex.value];t.select(i.dataRef.value)}t.mode.value===0&&(t.closeListbox(),N(()=>{var i;return(i=T(t.buttonRef))==null?void 0:i.focus({preventScroll:!0})}));break;case V(t.orientation.value,{vertical:R.ArrowDown,horizontal:R.ArrowRight}):return c.preventDefault(),c.stopPropagation(),t.goToOption(M.Next);case V(t.orientation.value,{vertical:R.ArrowUp,horizontal:R.ArrowLeft}):return c.preventDefault(),c.stopPropagation(),t.goToOption(M.Previous);case R.Home:case R.PageUp:return c.preventDefault(),c.stopPropagation(),t.goToOption(M.First);case R.End:case R.PageDown:return c.preventDefault(),c.stopPropagation(),t.goToOption(M.Last);case R.Escape:c.preventDefault(),c.stopPropagation(),t.closeListbox(),N(()=>{var i;return(i=T(t.buttonRef))==null?void 0:i.focus({preventScroll:!0})});break;case R.Tab:c.preventDefault(),c.stopPropagation();break;default:c.key.length===1&&(t.search(c.key),u.value=setTimeout(()=>t.clearSearch(),350));break}}let m=Je(),v=_(()=>m!==null?(m.value&X.Open)===X.Open:t.listboxState.value===0);return()=>{var c,i;let O={open:t.listboxState.value===0},{...x}=e,h={"aria-activedescendant":t.activeOptionIndex.value===null||(c=t.options.value[t.activeOptionIndex.value])==null?void 0:c.id,"aria-multiselectable":t.mode.value===1?!0:void 0,"aria-labelledby":(i=T(t.buttonRef))==null?void 0:i.id,"aria-orientation":t.orientation.value,id:l,onKeydown:p,role:"listbox",tabIndex:0,ref:t.optionsRef};return Z({ourProps:h,theirProps:x,slot:O,attrs:s,slots:r,features:ce.RenderStrategy|ce.Static,visible:v.value,name:"ListboxOptions"})}}}),ft=z({name:"ListboxOption",props:{as:{type:[Object,String],default:"li"},value:{type:[Object,String,Number,Boolean]},disabled:{type:Boolean,default:!1},id:{type:String,default:null}},setup(e,{slots:s,attrs:r,expose:a}){var d;let l=(d=e.id)!=null?d:`headlessui-listbox-option-${le()}`,t=J("ListboxOption"),u=L(null);a({el:u,$el:u});let p=_(()=>t.activeOptionIndex.value!==null?t.options.value[t.activeOptionIndex.value].id===l:!1),m=_(()=>V(t.mode.value,{0:()=>t.compare(D(t.value.value),D(e.value)),1:()=>D(t.value.value).some(f=>t.compare(D(f),D(e.value)))})),v=_(()=>V(t.mode.value,{1:()=>{var f;let n=D(t.value.value);return((f=t.options.value.find(o=>n.some(b=>t.compare(D(b),D(o.dataRef.value)))))==null?void 0:f.id)===l},0:()=>m.value})),c=et(u),i=_(()=>({disabled:e.disabled,value:e.value,get textValue(){return c()},domRef:u}));ae(()=>t.registerOption(l,i)),ge(()=>t.unregisterOption(l)),ae(()=>{A([t.listboxState,m],()=>{t.listboxState.value===0&&m.value&&V(t.mode.value,{1:()=>{v.value&&t.goToOption(M.Specific,l)},0:()=>{t.goToOption(M.Specific,l)}})},{immediate:!0})}),xe(()=>{t.listboxState.value===0&&p.value&&t.activationTrigger.value!==0&&N(()=>{var f,n;return(n=(f=T(u))==null?void 0:f.scrollIntoView)==null?void 0:n.call(f,{block:"nearest"})})});function O(f){if(e.disabled)return f.preventDefault();t.select(e.value),t.mode.value===0&&(t.closeListbox(),N(()=>{var n;return(n=T(t.buttonRef))==null?void 0:n.focus({preventScroll:!0})}))}function x(){if(e.disabled)return t.goToOption(M.Nothing);t.goToOption(M.Specific,l)}let h=tt();function k(f){h.update(f)}function F(f){h.wasMoved(f)&&(e.disabled||p.value||t.goToOption(M.Specific,l,0))}function B(f){h.wasMoved(f)&&(e.disabled||p.value&&t.goToOption(M.Nothing))}return()=>{let{disabled:f}=e,n={active:p.value,selected:m.value,disabled:f},{value:o,disabled:b,...y}=e,$={id:l,ref:u,role:"option",tabIndex:f===!0?void 0:-1,"aria-disabled":f===!0?!0:void 0,"aria-selected":m.value,disabled:void 0,onClick:O,onFocus:x,onPointerenter:k,onMouseenter:k,onPointermove:F,onMousemove:F,onPointerleave:B,onMouseleave:B};return Z({ourProps:$,theirProps:y,slot:n,attrs:r,slots:s,name:"ListboxOption"})}}});const me=({searchEngine:e,fixedParams:s})=>{const r=_(()=>{const d={};return Object.keys(e.params).forEach(l=>{if(s?.[l])return;const t=e.params[l];if(t!==void 0){switch(l){case"sort":case"term":case"limit":case"offset":case"count":case"buckets":case"fields":return}d[l]=t}}),d}),a=_(()=>{const d=Object.keys(r.value),l=[];return d.forEach(t=>{const u=t.replace(/[^\w.]/g,"");if(u==="specs"&&Array.isArray(r.value[t])){r.value[t].forEach(p=>{const[m]=p.split(":"),v=`specs.${m}`;l.includes(v)||l.push(v)});return}l.includes(u)||l.push(u)}),l.length});return{activeFilters:r,filtersCount:a}},vt=e=>{const{searchEngine:s,fixedParams:r}=e,a=_(()=>s.meta),d=_(()=>s.meta.buckets),{activeFilters:l,filtersCount:t}=me(e);A(s.params,()=>{s.fetch()});let u=null;const p=()=>{Object.keys(s.params).forEach(n=>{r?.[n]||delete s.params[n]}),u=null},m=({min:n,max:o})=>`${n||null}/${o||null}`,v=_(()=>{const{params:n}=s;return{min:Number(n["price>"]),max:Number(n["price<"])}}),c=L([]),i=ue(()=>{c.value.splice(0),d.value?.prices?.forEach(n=>{n.min&&(n.min=Math.round(n.min*100)/100),n.max&&(n.max=Math.round(n.max*100)/100),c.value.push({range:n,key:m(n)})}),Number.isNaN(v.value.min)||c.value.find(({range:o})=>o.min===v.value.min&&o.max===v.value.max)||c.value.unshift({range:{...v.value,count:a.value.count||0,avg:null},key:m(v.value)})},50);i();const O=L(m(v.value));A(O,()=>{u="price";const n=c.value.find(({range:o})=>m(o)===O.value);if(n){const{min:o,max:b}=n.range;o?s.params["price>"]=o:delete s.params["price>"],b?s.params["price<"]=b:delete s.params["price<"];return}delete s.params["price>"],delete s.params["price<"]});const x=({min:n,max:o})=>n&&o?o===n?W(o):`${W(n)} ${ie.toLowerCase()} ${W(o)}`:!n&&o?`${ie} ${W(o)}`:`${$e} ${W(n||0)}`,h=L([]),k=ue(()=>{for(let o=0;o<h.value.length;o++){const{field:b}=h.value[o];b!==u&&(h.value.splice(o,1),o-=1)}const n=d.value;if(n&&([["brands",Re],["categories",Ce]].forEach(([o,b])=>{const y=`${o}.name`;n[y]&&u!==y&&h.value.push({title:b,options:n[y],field:y})}),n.specs)){const{grids:o}=globalThis.$storefront.data;Object.keys(n.specs).forEach(b=>{const[y,$]=b.split(":");if($){const K=`specs.${y}`;if(u===K)return;const ee=ze(y,o||[]);let H=h.value.find(be=>be.field===K);H||(H={title:ee,options:{},field:K},h.value.push(H)),H.options[$]=n.specs[b]}})}},50);k();const F=(n,o)=>{const[,b]=n.split(".");return["specs,",`${b}:${o}`]},B=(n,o)=>{n.startsWith("specs.")&&([n,o]=F(n,o));const b=l.value[n];return!!(b===o||Array.isArray(b)&&b.includes(o))},f=(n,o)=>{u=n,console.log({_lastParamChanged:u}),n.startsWith("specs.")&&([n,o]=F(n,o));const b=!B(n,o);let y=s.params[n];if(Array.isArray(y)||(y=[],s.params[n]=y),b)y.push(o);else for(let $=0;$<y.length;$++)if(y[$]===o){y.splice($,1);break}};return A(d,()=>{u!=="price"&&i(),k()}),{resultMeta:a,resultBuckets:d,activeFilters:l,filtersCount:t,clearFilters:p,getPriceRangeKey:m,priceRanges:c,priceRangeKey:O,getPriceRangeLabel:x,filterOptions:h,checkFilterOption:B,toggleFilterOption:f}},mt=e=>{let{term:s}=e;const a=e.canUseUrlParams!==!1?Le("history"):null;e.ssrError&&(console.error(new Error(`SSR search error: ${e.ssrError}`)),window.location.pathname.startsWith("/s/")&&(window.location.href=`/s?q=${encodeURIComponent(s||"")}`));const d=ye(e.products||[]),l=new Ue({debounce:50});s===void 0&&(s=new URLSearchParams(window.location.search).get("q")||null),s!==void 0&&(l.term.value=s),e.pageSize&&(l.pageSize.value=e.pageSize),Object.assign(l.params,e.fixedParams);let t=!1;a&&Object.keys(a).forEach(x=>{if(a[x]){if(x.startsWith("f\\")){const h=x.substring(2);l.params[h]=a[x],e.fixedParams?.[h]!==a[x]&&(t=!0);return}if(x==="sort"){if(l.params.sort=a.sort,typeof a.sort=="string"&&e.resultMeta?.sort?.length===1){const{field:h,order:k}=e.resultMeta.sort[0];if((k?h:`-${h}`)===a.sort)return}t=!0;return}if(x==="p"){const h=parseInt(String(a.p),10);if(h>=1){if(l.pageNumber.value=h,e.resultMeta?.limit){const{offset:k,limit:F}=e.resultMeta;if((k?Math.ceil(k/F):1)===h)return}t=!0}}}}),l.wasFetched.value||((e.products||e.resultMeta)&&!t&&l.setResult({result:e.products,meta:e.resultMeta}),(!e.products||t)&&l.fetch().catch(console.error)),l.isWithCount.value=!0,l.isWithBuckets.value=!0;const u=L({count:0,...e.resultMeta||l.meta});A(l.products,()=>{d.splice(0),l.products.forEach(x=>d.push(x)),u.value={count:0,...l.meta}});const p=_(()=>{const{count:x}=l.meta;return!x||d.length<2?1:Math.ceil(x/l.pageSize.value)});A(l.pageNumber,x=>{a&&(a.p=`${x}`),l.fetch()});const m=()=>{A(l.isFetching,x=>{const h=e.showcase?.value;!x&&h&&setTimeout(()=>{Oe(h,Fe?-25:0)},50)})};l.wasFetched.value?m():Ve(l.wasFetched,m);const{activeFilters:v,filtersCount:c}=me({searchEngine:l,fixedParams:e.fixedParams});a&&A(v,x=>{a&&Object.keys(a).forEach(h=>{h.startsWith("f\\")&&delete a[h]}),Object.keys(x).forEach(h=>{const k=x[h];if(typeof k=="string"||typeof k=="number"){a[`f\\${h}`]=`${k}`;return}Array.isArray(k)&&typeof k[0]=="string"&&(a[`f\\${h}`]=k)})});const i=[{value:null,label:Ee},{value:"-sales",label:Me},{value:"price",label:Te},{value:"-price",label:Ae},{value:"-price_discount",label:Be},{value:"-created_at",label:De},{value:"name",label:Ie}],O=L(null);return A(O,()=>{l.params.sort=O.value||void 0,l.fetch()}),a&&(typeof a.sort=="string"&&a.sort&&(O.value=a.sort),A(l.params,x=>{delete a.sort,x.sort&&(a.sort=String(x.sort))})),{searchEngine:l,fetching:l.fetching.value,isFetching:l.isFetching,products:d,resultMeta:u,totalPages:p,activeFilters:v,filtersCount:c,sortOptions:i,sortOption:O}},bt=e=>{const s=_(()=>e.totalPages?e.totalPages:e.totalItems&&e.pageSize?Math.ceil(e.totalItems/e.pageSize):1),r=_(()=>{const i=e.page||1;return i<1?1:i>s.value?s.value:i}),a=_(()=>e.maxPages||10),d=_(()=>{if(s.value<=a.value)return 1;const i=Math.floor(a.value/2),O=Math.ceil(a.value/2)-1;return r.value<=i?1:r.value+O>=s.value?s.value-a.value+1:r.value-i}),l=_(()=>{if(s.value<=a.value)return s.value;const i=Math.floor(a.value/2),O=Math.ceil(a.value/2)-1;return r.value<=i?a.value:r.value+O>=s.value?s.value:r.value+O}),t=_(()=>Array.from(Array(l.value+1-d.value).keys()).map(i=>d.value+i)),u=L("");A(Pe(e,"isUrlPath"),()=>{const{url:i}=globalThis.$storefront;e.isUrlPath&&!i.pathname.endsWith("/")?i.pathname+="/":i.searchParams.delete("p"),u.value=`${i.pathname}${i.search}`},{immediate:!0});const p=i=>e.isUrlPath?`../${i}`:`?p=${i}`,m=_(()=>t.value.map(i=>u.value+p(i))),v=_(()=>r.value<=1?null:u.value+p(r.value-1)),c=_(()=>r.value>=s.value?null:u.value+p(r.value+1));return{totalPages:s,startPage:d,endPage:l,pages:t,pageLinks:m,prevPageLink:v,nextPageLink:c}},ht=z({__name:"Pagination",props:{totalItems:{},totalPages:{},page:{default:1},pageSize:{},maxPages:{default:7},isUrlPath:{type:Boolean,default:!1}},emits:["update:page"],setup(e,{expose:s,emit:r}){s();const a=e,d=r,{pages:l,pageLinks:t,prevPageLink:u,nextPageLink:p}=bt(a),m={props:a,emit:d,pages:l,pageLinks:t,prevPageLink:u,nextPageLink:p};return Object.defineProperty(m,"__isScriptSetup",{enumerable:!1,value:!0}),m}}),gt={class:"text-base-900 flex justify-center gap-1.5 text-center text-sm font-medium leading-9"},xt=g("i",{class:"i-arrow-right rotate-180"},null,-1),_t=g("span",{class:"ml-1.5 hidden md:inline"},w("Anterior"),-1),yt=g("span",{class:"mr-1.5 hidden md:inline"},w("Próximo"),-1),Ot=g("i",{class:"i-arrow-right"},null,-1);function Pt(e,s,r,a,d,l){const t=se("ALink");return P(),S("ol",gt,[g("li",null,[E(t,{href:a.prevPageLink,onClick:s[0]||(s[0]=te(u=>a.prevPageLink&&a.emit("update:page",r.page-1),["prevent"])),class:q(["mr-1 block min-w-9 rounded border px-3",a.prevPageLink?"border-base-100 hover:bg-base-100":"border-transparent text-base-500"])},{default:C(()=>[xt,_t]),_:1},8,["href","class"])]),(P(!0),S(U,null,Q(a.pages,(u,p)=>(P(),S("li",{key:u},[E(t,{href:u!==r.page?a.pageLinks[p]:null,onClick:te(m=>a.emit("update:page",u),["prevent"]),class:q(["block w-9 rounded border ring-black/10",u===r.page?"bg-base-50 border-base-100 ring text-base-700":"border-transparent hover:bg-base-100"])},{default:C(()=>[j(w(u),1)]),_:2},1032,["href","onClick","class"])]))),128)),g("li",null,[E(t,{href:a.nextPageLink,onClick:s[1]||(s[1]=te(u=>a.nextPageLink&&a.emit("update:page",r.page+1),["prevent"])),class:q(["ml-1 block min-w-9 rounded border px-3",a.nextPageLink?"border-base-100 hover:bg-base-100":"border-transparent text-base-500"])},{default:C(()=>[yt,Ot]),_:1},8,["href","class"])])])}const kt=Y(ht,[["render",Pt]]),St=z({__name:"Collapse",props:{title:{}},setup(e,{expose:s}){s();const r={};return Object.defineProperty(r,"__isScriptSetup",{enumerable:!1,value:!0}),r}}),wt={class:"group my-4 md:my-5 [&_i]:open:-rotate-90"},Lt={role:"button",class:"text-base-700 hover:text-base-800 [&>i]:hover:text-primary list-none text-2xl font-medium lowercase group-open:mb-3"},Ft=g("i",{class:"i-chevron-right mr-1 rotate-90"},null,-1);function Rt(e,s,r,a,d,l){return P(),S("details",wt,[g("summary",Lt,[Ft,g("span",null,w(r.title),1)]),ke(e.$slots,"default")])}const Ct=Y(St,[["render",Rt]]),$t=z({__name:"SearchFilters",props:{searchEngine:{},fixedParams:{}},setup(e,{expose:s}){s();const r=e,{resultBuckets:a,activeFilters:d,filtersCount:l,clearFilters:t,priceRanges:u,priceRangeKey:p,getPriceRangeLabel:m,filterOptions:v,checkFilterOption:c,toggleFilterOption:i}=vt(r),O={props:r,resultBuckets:a,activeFilters:d,filtersCount:l,clearFilters:t,priceRanges:u,priceRangeKey:p,getPriceRangeLabel:m,filterOptions:v,checkFilterOption:c,toggleFilterOption:i,Collapse:Ct};return Object.defineProperty(O,"__isScriptSetup",{enumerable:!1,value:!0}),O}}),Et={class:"bg-base-50/40 h-screen overflow-y-auto"},Mt={class:"px-6 pb-3 pt-5 text-center"},Tt=g("i",{class:"i-trash ml-0.5"},null,-1),At={key:1,class:"text-base-500 border border-transparent pb-1 text-base font-semibold"},Bt={key:0,class:"px-6 pb-3"},Dt={class:"space-y-1.5"},It=["id","value"],jt=["for"],Ut={class:"text-base-500 font-medium"},Vt={key:0,class:"flex items-center"},zt=g("label",{for:"priceRange-null",class:"cursor-pointer px-3 text-sm"},w("Qualquer preço"),-1),Nt={class:"space-y-1.5"},Kt=["id","value","checked","onChange"],Wt=["for"],qt={class:"text-base-500 font-medium"};function Qt(e,s,r,a,d,l){return P(),S("aside",Et,[g("header",Mt,[a.filtersCount?(P(),S("button",{key:0,class:"ui-btn-sm ui-btn-danger py-1",onClick:s[0]||(s[0]=(...t)=>a.clearFilters&&a.clearFilters(...t))},[j(w("Limpar filtros")+" "),Tt])):(P(),S("p",At,w("Filtrar resultados")))]),a.resultBuckets?(P(),S("article",Bt,[a.priceRanges?(P(),G(a.Collapse,{key:0,title:"Preço",class:"[&>summary]:text-xl",open:""},{default:C(()=>[g("div",Dt,[(P(!0),S(U,null,Q(a.priceRanges,({range:t,key:u})=>(P(),S("div",{key:`prices-${u}`,class:"flex items-center"},[ne(g("input",{type:"radio",id:`priceRange-${u}`,name:"priceRange",value:u,"onUpdate:modelValue":s[1]||(s[1]=p=>a.priceRangeKey=p)},null,8,It),[[oe,a.priceRangeKey]]),g("label",{for:`priceRange-${u}`,class:"cursor-pointer px-3 text-sm"},[j(w(a.getPriceRangeLabel(t))+" ",1),g("small",Ut," ("+w(t.count)+") ",1)],8,jt)]))),128)),a.activeFilters["price<"]||a.activeFilters["price>"]?(P(),S("div",Vt,[ne(g("input",{type:"radio",id:"priceRange-null",name:"priceRange",value:null,"onUpdate:modelValue":s[2]||(s[2]=t=>a.priceRangeKey=t)},null,512),[[oe,a.priceRangeKey]]),zt])):I("",!0)])]),_:1})):I("",!0),(P(!0),S(U,null,Q(a.filterOptions,({title:t,options:u,field:p})=>(P(),G(a.Collapse,{key:p,title:t,class:"[&>summary]:text-xl",open:!!a.activeFilters[p]},{default:C(()=>[g("div",Nt,[(P(!0),S(U,null,Q(u,(m,v,c)=>(P(),S("div",{key:`${p}-${c}`,class:"flex items-center"},[g("input",{type:"checkbox",id:`${p}-${v}`,value:v,checked:a.checkFilterOption(p,v),onChange:i=>a.toggleFilterOption(p,v)},null,40,Kt),g("label",{for:`${p}-${v}`,class:"cursor-pointer px-3 text-sm"},[j(w(v)+" ",1),g("small",qt," ("+w(m)+") ",1)],8,Wt)]))),128))])]),_:2},1032,["title","open"]))),128))])):I("",!0)])}const Ht=Y($t,[["render",Qt]]),Gt=z({__name:"SearchShowcase",props:{term:{},pageSize:{},fixedParams:{},products:{},resultMeta:{},ssrError:{},canUseUrlParams:{type:Boolean,default:!0},showcase:{}},async setup(e,{expose:s}){s();const r=e,a=L(null),{searchEngine:d,fetching:l,isFetching:t,products:u,resultMeta:p,totalPages:m,filtersCount:v,sortOptions:c,sortOption:i}=mt({...r,showcase:a}),O=_(()=>d.wasFetched.value),x=_(()=>d.term.value),h=_(()=>O&&!!(p.value.count>4||v.value)),k=L(!1),F={props:r,showcase:a,searchEngine:d,fetching:l,isFetching:t,products:u,resultMeta:p,totalPages:m,filtersCount:v,sortOptions:c,sortOption:i,wasFetched:O,searchTerm:x,hasFiltersBar:h,isFiltersOpen:k,get Listbox(){return ct},get ListboxButton(){return dt},get ListboxOptions(){return pt},get ListboxOption(){return ft},Drawer:st,Pagination:kt,ProductShelf:je,SearchFilters:Ht};return Object.defineProperty(F,"__isScriptSetup",{enumerable:!1,value:!0}),F}}),Xt={class:"text-base-800 inline font-bold italic"},Yt={key:1,class:"ui-section relative min-h-[300px]"},Zt={ref:"showcase",class:"relative"},Jt={key:0,class:"to-base-100 ui-section-slim sticky-header:translate-y-16 lg:sticky-header:translate-y-14 sticky top-0 z-[12] flex items-center justify-between rounded-b bg-white/80 px-6 py-4 shadow-sm backdrop-blur-sm transition-transform"},ea={class:"text-base-700 font-medium lowercase"},ta=g("span",{class:"hidden lg:inline"},w("Itens encontrados"),-1),aa=g("span",{class:"lg:hidden"},w("Produtos"),-1),sa={class:"flex items-center gap-4"},na=g("span",{class:"hidden text-xl leading-none md:block"},[g("i",{class:"text-base-600 i-adjustments-horizontal m-0"})],-1),la=g("span",{class:"hidden md:inline"},w("Filtrar produtos"),-1),ra=g("span",{class:"md:hidden"},[g("i",{class:"i-adjustments-horizontal mr-1"}),j(" "+w("Filtrar"))],-1),oa={key:0,class:"outline-3 outline-secondary/80 ui-badge-pill-sm absolute -right-1.5 -top-1 outline"},ia={class:"w-5"},ua={class:"i-check"},ca={key:0,class:"mt-3 lg:mt-4"},da={key:0,class:"absolute left-0 top-0 z-[14] size-full bg-white/40"};function pa(e,s,r,a,d,l){const t=se("Skeleton"),u=se("Fade");return P(),S(U,null,[a.searchTerm?(P(),S("section",{key:0,class:q(["text-base-700 ui-section-slim px-6 text-center text-xl lowercase",a.hasFiltersBar?"relative z-[14] -mb-4":"mb-0"])},[j(w("Buscando por")+" "),g("h1",Xt,w(a.searchTerm),1)],2)):I("",!0),a.isFetching&&!a.products.length?(P(),S("div",Yt,[E(t,{class:"absolute top-0 w-full px-5","is-bold":"","is-large":""})])):I("",!0),g("article",Zt,[E(u,null,{default:C(()=>[a.hasFiltersBar?(P(),S("section",Jt,[g("strong",ea,[a.resultMeta.count>1?(P(),S(U,{key:0},[j(w(a.resultMeta.count)+" ",1),ta,aa],64)):I("",!0)]),g("div",sa,[na,g("button",{onClick:s[0]||(s[0]=p=>a.isFiltersOpen=!a.isFiltersOpen),class:"ui-btn-sm ui-btn-secondary relative"},[la,ra,a.filtersCount?(P(),S("span",oa,w(a.filtersCount),1)):I("",!0)]),E(a.Listbox,{modelValue:a.sortOption,"onUpdate:modelValue":s[1]||(s[1]=p=>a.sortOption=p),as:"div",class:"text-base-800 relative text-sm"},{default:C(()=>[E(a.ListboxButton,{id:e.$useId("ss"),class:"ui-btn-sm ui-btn-secondary"},{default:C(()=>[j(w("Ordenar"))]),_:1},8,["id"]),E(u,null,{default:C(()=>[E(a.ListboxOptions,{class:"divide-base-100 absolute right-0 mt-2 divide-y rounded bg-white shadow ring-1 ring-black/5 focus:outline-none"},{default:C(()=>[(P(!0),S(U,null,Q(a.sortOptions,({label:p,value:m})=>(P(),G(a.ListboxOption,{key:m||"sort",value:m,as:"template"},{default:C(({selected:v,active:c})=>[g("li",null,[(P(),G(Se(v?"div":"button"),{class:q(["flex w-full py-2 pl-3 pr-6",!v&&c&&"bg-secondary-100 text-secondary"])},{default:C(()=>[g("div",ia,[ne(g("i",ua,null,512),[[we,v]])]),j(" "+w(p),1)]),_:2},1032,["class"]))])]),_:2},1032,["value"]))),128))]),_:1})]),_:1})]),_:1},8,["modelValue"])])])):I("",!0)]),_:1}),E(a.ProductShelf,{products:a.products,"is-grid":""},{append:C(()=>[E(u,{slide:"down"},{default:C(()=>[!a.isFetching&&a.totalPages>1?(P(),S("nav",ca,[E(a.Pagination,{page:a.searchEngine.pageNumber.value,"onUpdate:page":s[2]||(s[2]=p=>a.searchEngine.pageNumber.value=p),"total-pages":a.totalPages},null,8,["page","total-pages"])])):I("",!0)]),_:1})]),_:1},8,["products"]),E(u,null,{default:C(()=>[a.isFetching?(P(),S("div",da)):I("",!0)]),_:1})],512),E(a.Drawer,{modelValue:a.isFiltersOpen,"onUpdate:modelValue":s[3]||(s[3]=p=>a.isFiltersOpen=p),placement:"end","backdrop-target":null,"can-lock-scroll":!1,class:"!z-[80] bg-white shadow [&_[data-drawer-close]]:bg-white/80"},{default:C(()=>[E(a.SearchFilters,{"search-engine":a.searchEngine},null,8,["search-engine"])]),_:1},8,["modelValue"])],64)}const Ma=Y(Gt,[["render",pa]]);export{Ma as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{a as k,c as I,w as oe,I as le,ab as Ze,d as D,F as te,O as b,P as O,$ as re,a0 as F,U as N,a1 as Je,N as Y,W as T,V as L,S as p,R as H,Q as R,Y as V,Z as W,T as X,af as se,m as G,a6 as ce,a8 as me,ae as be,a4 as Ee,a3 as Le,ac as ke,a2 as we,ad as et,ak as tt,X as Pe,aj as Me,al as Te}from"./sf-utils.c42cbZ9W.js";import{e as Ae,a as Re,d as Ne,l as Fe,_ as Ie}from"./customer-session.ZD6tLDQJ.js";import{_ as Q,w as _e,v as nt,a as at}from"./_plugin-vue_export-helper.xATGHWd9.js";import{a as ue,b as ot,s as ye}from"./server-data.4C60Esyt.js";import{t as rt}from"./shopping-cart.nSNNOrp9.js";import{a as lt,o as st}from"./index.ShNlAyu1.js";import{j as it,h as ut,p as ct,u as dt,g as Oe}from"./index.KfrHdfOH.js";import{j as de,k as pt,m as vt,s as pe,b as ve,o as f,w as $e,a as De,h as Be,t as He,u as ne,i as J,A as ae,I as Z,d as Ue,l as je,N as fe,p as ft,e as mt,f as gt,c as j,g as A,v as ht,n as q,_ as Ve,O as bt,q as Se,P as ee,r as he,D as _t}from"./use-text-value.lKqoIagH.js";import"./price.Easct8WC.js";const yt=n=>{const{header:a,canSetStyles:o,canCreateHeightDiv:t,isShownOnScrollDown:u,isShownOnMobile:i}={canSetStyles:!0,canCreateHeightDiv:!0,...n},{ready:e,start:r}=it(100,{controls:!0,immediate:!1}),l=k(0),m=k(0);let d;const g=i||!ue&&!ot,{y:s}=g?lt(document):{y:k(0)},v=k(0);ut(s,h=>{v.value=h},{debounce:ue?100:20,maxWait:ue?800:400});const _=I(()=>e.value&&v.value>m.value*1.2),y=k("none");oe(_,async h=>{o&&a.value&&(a.value.style.position=h?"fixed":"",a.value.style.width=h?"100vw":""),d&&(d.style.height=h?`${l.value}px`:""),h?(await ct(300),y.value="opacity var(--transition-slow), transform var(--transition)"):(r(),y.value="none")});const C=k(!1);return oe(v,(h,M)=>{C.value=h>0&&h<M}),le(()=>{if(!a.value)throw new Error("<header> (props.header) not set");const h=()=>{const S=a.value;l.value=S.offsetHeight,m.value=l.value+window.scrollY+S.getBoundingClientRect().top,r()},M=a.value.getElementsByTagName("IMG");let P=!0;for(let S=0;S<M.length;S++){const c=M[S];(!c.complete||c.naturalHeight===0)&&(P=!1,c.onload=h)}P&&h(),window.addEventListener("resize",dt(h,300)),o&&(a.value.style.willChange="transform",oe([_,C],([S,c])=>{let x="",w="";S&&(!c||u)&&(x="0",w="translateY(-100%)");const E=a.value;E.style.opacity=x,E.style.transform=w;const U=S&&!x?"add":"remove";document.body.classList[U]("StickyHeader")}),oe(y,S=>{a.value.style.transition=S})),t&&(d=document.createElement("div"),a.value.parentElement?.insertBefore(d,a.value))}),{staticHeight:l,staticY:m,isSticky:_,isScrollUp:C,transition:y}},St=(n,a)=>{const o=n.filter(({name:t,slug:u,parent:i})=>t&&u&&!i);return a?.length&&o.sort((t,u)=>{const i=a.indexOf(t.slug),e=a.indexOf(u.slug);return i>-1?e===-1||i<e?-1:1:e>-1?1:0}),o},xt=(n,a,o=!1)=>{const t=n.filter(({name:u,slug:i,parent:e})=>u&&i&&e?e._id&&e._id===a._id||e.slug&&e.slug===a.slug:!1);return o&&t.sort((u,i)=>u.name<i.name?-1:1),t},kt=n=>{const{header:a,searchInput:o,categories:t=globalThis.$storefront.data.categories||[],menuCategorySlugs:u,menuRandomCategories:i=7,isAlphabeticalSortSubmenu:e}=n,{isSticky:r,staticHeight:l,staticY:m}=yt({header:a}),d=I(()=>r.value?a.value?.offsetHeight:m.value),g=St(t,u),s=$=>xt(t,$,!!e),v=$=>({...$,subcategories:s($).map(B=>v(B))}),_=g.map(v);let y=0;const C=_.filter(({slug:$})=>u?.includes($)?!0:y<i?(y+=1,!0):!1),h=k(!1),M=k(!1);Oe(h,()=>{M.value=!0});const P=k(""),S=/^\/s\/?/.test(window.location.pathname);let c;if(S){const{pathname:$,search:B}=window.location;c=new URLSearchParams(B).get("q"),!c&&$.startsWith("/s/")&&(c=decodeURIComponent($.split("/")[2]))}typeof c=="string"&&(P.value=c);const x=I(()=>P.value&&P.value.length>=2&&P.value!==c?P.value:""),w=$=>{if($.preventDefault(),h.value&&P.value){window.location.href=Ze(P.value);return}h.value=!h.value,h.value&&o&&setTimeout(()=>{if(!o.value)return;const{length:B}=P.value;o.value.setSelectionRange(B,B),o.value.focus()},50)},E=k(!1),U=k(!1);Oe(E,()=>{U.value=!0});const z=k(0);return{isSticky:r,staticHeight:l,staticY:m,positionY:d,mainCategories:g,getSubcategories:s,getCategoryTree:v,categoryTrees:_,inlineMenuTrees:C,isSearchOpen:h,isSearchOpenOnce:M,searchTerm:P,quickSearchTerm:x,toggleSearch:w,isCartOpen:E,isCartOpenOnce:U,cartTotalItems:z,handleOnMounted:()=>{oe(rt,($,B)=>{typeof B=="number"&&(B<$?E.value=!0:B&&!$&&(E.value=!1)),z.value=$},{immediate:!0})}}},wt=D({__name:"AccountLink",props:{to:{},accountUrl:{default:globalThis.$storefront?.settings.accountUrl||"/app/account"},returnUrl:{},isSignUp:{type:Boolean}},setup(n,{expose:a}){a();const o=n,t=k("");globalThis.location?.href&&te(()=>{t.value=globalThis.location.href});const u=I(()=>{let e=o.accountUrl;const r=o.returnUrl||t.value;if(!o.to)return o.isSignUp?e+="?sign_up&":e+="?",r?`${e}return_url=${r}`:e;const{settings:l}=globalThis.$storefront;return o.to==="orders"&&l.ordersUrl?l.ordersUrl:o.to==="favorites"&&l.favoritesUrl?l.favoritesUrl:`${e}/${o.to}`}),i={props:o,locationUrl:t,href:u};return Object.defineProperty(i,"__isScriptSetup",{enumerable:!1,value:!0}),i}}),Pt=["href"];function Mt(n,a,o,t,u,i){return b(),O("a",{href:t.href},[re(n.$slots,"default")],8,Pt)}const ze=Q(wt,[["render",Mt]]),Tt=D({__name:"SocialNetworkIcon",props:{as:{default:"i"},network:{}},setup(n,{expose:a}){a();const o=n,t=I(()=>{switch(o.network){case"facebook":return"i-facebook";case"instagram":return"i-instagram";case"whatsapp":return"i-whatsapp";case"youtube":return"i-youtube";case"pinterest":return"i-pinterest";case"tiktok":return"i-tiktok";case"twitter":return"i-twitter";case"threads":return"i-threads";default:return""}}),u={props:o,iconClassName:t};return Object.defineProperty(u,"__isScriptSetup",{enumerable:!1,value:!0}),u}});function It(n,a,o,t,u,i){return b(),F(Je(o.as),{class:N(t.iconClassName)},null,8,["class"])}const Ot=Q(Tt,[["render",It]]),Ct=D({__name:"SocialNetworkLink",props:{network:{},href:{},message:{}},setup(n,{expose:a}){a();const o=n,t=I(()=>{let i=o.href||ye[o.network]||"";if(o.network==="whatsapp"){const e=i.replace(/[^+\d]/g,"");i=`https://${ue?"api":"web"}.whatsapp.com/send?phone=`+encodeURIComponent(e.charAt(0)==="+"?e:`+55${e}`),o.message&&(i+=`&text=${encodeURIComponent(o.message)}`)}return i}),u={props:o,fixedHref:t,SocialNetworkIcon:Ot};return Object.defineProperty(u,"__isScriptSetup",{enumerable:!1,value:!0}),u}});function Et(n,a,o,t,u,i){const e=Y("ALink");return b(),F(e,{href:t.fixedHref},{default:T(()=>[re(n.$slots,"default",{},()=>[L(t.SocialNetworkIcon,{network:o.network},null,8,["network"]),re(n.$slots,"append")])]),_:3},8,["href"])}const qe=Q(Ct,[["render",Et]]),Lt=D({__name:"ShopSidenavCategory",props:{categoryTree:{}},setup(n,{expose:a}){a();const o=k(!1),t=k(!0);oe(o,i=>{i?setTimeout(()=>{t.value=!1},25):t.value=!0});const u={isOpen:o,isFaded:t};return Object.defineProperty(u,"__isScriptSetup",{enumerable:!1,value:!0}),u}}),At={class:"text-base-800 text-lg"},Rt=["href"],Nt=["href"],Ft={class:"inline"};function $t(n,a,o,t,u,i){const e=Y("AImg"),r=Y("ShopSidenavCategory",!0);return b(),O("li",At,[o.categoryTree.subcategories.length?(b(),O("details",{key:0,class:"z-10 overflow-y-auto overflow-x-hidden bg-white open:absolute open:left-0 open:top-0 open:size-full",onToggle:a[0]||(a[0]=l=>t.isOpen=!t.isOpen)},[p("summary",{class:N(["active:bg-base-100 cursor-pointer list-none px-6 py-3 transition-colors",t.isOpen?"bg-base-100":null])},[p("i",{class:N(t.isOpen?"i-arrow-right rotate-180 text-lg":"i-arrow-right float-right mb-0 mt-1 text-xl text-base-500")},null,2),!t.isOpen&&o.categoryTree.icon?(b(),F(e,{key:0,picture:o.categoryTree.icon,alt:o.categoryTree.name,class:"mr-3 inline h-5 w-auto"},null,8,["picture","alt"])):H("",!0),p("h3",{class:N(["inline",t.isOpen?"ml-4 text-base":null])},R(o.categoryTree.name),3)],2),p("ul",{class:N(["mt-2 transition-opacity",t.isFaded?"opacity-20":"opacity-100"]),tabindex:"-1"},[(b(!0),O(V,null,W(o.categoryTree.subcategories,(l,m)=>(b(),F(r,{key:m,"category-tree":l},null,8,["category-tree"]))),128)),p("li",null,[p("a",{href:`/${o.categoryTree.slug}`,class:"active:bg-base-200 block px-6 py-3 text-base underline"},R("Ver toda a categoria $1".replace("$1",o.categoryTree.name)),9,Rt)])],2)],32)):(b(),O("a",{key:1,href:`/${o.categoryTree.slug}`,class:"active:bg-base-200 block px-6 py-3"},[!t.isOpen&&o.categoryTree.icon?(b(),F(e,{key:0,picture:o.categoryTree.icon,alt:o.categoryTree.name,class:"mr-3 inline h-5 w-auto"},null,8,["picture","alt"])):H("",!0),p("h3",Ft,R(o.categoryTree.name),1)],8,Nt))])}const Dt=Q(Lt,[["render",$t]]),Bt=D({__name:"ShopSidenav",props:{categoryTrees:{}},setup(n,{expose:a}){a(),le(()=>Ae());const o={get customerName(){return Re},get isLogged(){return Ne},get logout(){return Fe},get socialNetworks(){return ye},AccountLink:ze,SocialNetworkLink:qe,ShopSidenavCategory:Dt};return Object.defineProperty(o,"__isScriptSetup",{enumerable:!1,value:!0}),o}}),Ht={class:"flex h-full flex-col bg-white"},Ut={class:"grow py-4"},jt={class:"relative h-full"},Vt={class:"text-base"},zt={class:"bg-base-100 flex items-center px-2 py-4"},qt=p("i",{class:"text-base-500 i-user-circle m-0 text-4xl"},null,-1),Kt={class:"leading-tight"},Wt=p("small",{class:"text-primary block font-semibold lowercase"},R("Meus pedidos")+", "+R("Minha conta"),-1),Gt=p("span",{class:"text-base-600"},R("Sair"),-1),Yt=p("i",{class:"i-arrow-right-on-rectangle ml-1 text-lg"},null,-1),Qt=[Gt,Yt],Xt={class:"bg-base-200 text-base-700 flex gap-3 p-4 text-xl"};function Zt(n,a,o,t,u,i){return b(),O("aside",Ht,[p("nav",Ut,[p("ul",jt,[(b(!0),O(V,null,W(o.categoryTrees,(e,r)=>(b(),F(t.ShopSidenavCategory,{key:r,"category-tree":e},null,8,["category-tree"]))),128))])]),p("footer",Vt,[p("div",zt,[L(t.AccountLink,{class:"flex grow items-center gap-3 p-2"},{default:T(()=>[qt,p("span",Kt,[X(R(`Olá ${t.customerName||"Visitante"}`)+" ",1),Wt])]),_:1}),t.isLogged?(b(),O("button",{key:0,onClick:a[0]||(a[0]=(...e)=>t.logout&&t.logout(...e)),class:"text-base-800 p-2 text-right"},Qt)):H("",!0)]),p("ul",Xt,[(b(!0),O(V,null,W(t.socialNetworks,(e,r)=>(b(),O("li",{key:r},[L(t.SocialNetworkLink,{network:r,class:"active:text-primary p-1"},null,8,["network"])]))),128))])])])}const Jt=Q(Bt,[["render",Zt]]);function en({container:n,accept:a,walk:o,enabled:t}){se(()=>{let u=n.value;if(!u||t!==void 0&&!t.value)return;let i=de(n);if(!i)return;let e=Object.assign(l=>a(l),{acceptNode:a}),r=i.createTreeWalker(u,NodeFilter.SHOW_ELEMENT,e,!1);for(;r.nextNode();)o(r.currentNode)})}function tn(n,a,o,t){pt.isServer||se(u=>{n=n??window,n.addEventListener(a,o,t),u(()=>n.removeEventListener(a,o,t))})}var K=(n=>(n[n.Forwards=0]="Forwards",n[n.Backwards=1]="Backwards",n))(K||{});function Ke(){let n=k(0);return vt("keydown",a=>{a.key==="Tab"&&(n.value=a.shiftKey?1:0)}),n}function nn({defaultContainers:n=[],portals:a,mainTreeNodeRef:o}={}){let t=k(null),u=de(t);function i(){var e,r,l;let m=[];for(let d of n)d!==null&&(d instanceof HTMLElement?m.push(d):"value"in d&&d.value instanceof HTMLElement&&m.push(d.value));if(a!=null&&a.value)for(let d of a.value)m.push(d);for(let d of(e=u?.querySelectorAll("html > *, body > *"))!=null?e:[])d!==document.body&&d!==document.head&&d instanceof HTMLElement&&d.id!=="headlessui-portal-root"&&(d.contains(f(t))||d.contains((l=(r=f(t))==null?void 0:r.getRootNode())==null?void 0:l.host)||m.some(g=>d.contains(g))||m.push(d));return m}return{resolveContainers:i,contains(e){return i().some(r=>r.contains(e))},mainTreeNodeRef:t,MainTreeNode(){return o!=null?null:G(ve,{features:pe.Hidden,ref:t})}}}let Ce=Symbol("PortalParentContext");function an(){let n=ce(Ce,null),a=k([]);function o(i){return a.value.push(i),n&&n.register(i),()=>t(i)}function t(i){let e=a.value.indexOf(i);e!==-1&&a.value.splice(e,1),n&&n.unregister(i)}let u={register:o,unregister:t,portals:a};return[a,D({name:"PortalWrapper",setup(i,{slots:e}){return me(Ce,u),()=>{var r;return(r=e.default)==null?void 0:r.call(e)}}})]}var on=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(on||{}),rn=(n=>(n[n.Pointer=0]="Pointer",n[n.Other=1]="Other",n))(rn||{});function ln(n){requestAnimationFrame(()=>requestAnimationFrame(n))}let We=Symbol("MenuContext");function ge(n){let a=ce(We,null);if(a===null){let o=new Error(`<${n} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(o,ge),o}return a}let sn=D({name:"Menu",props:{as:{type:[Object,String],default:"template"}},setup(n,{slots:a,attrs:o}){let t=k(1),u=k(null),i=k(null),e=k([]),r=k(""),l=k(null),m=k(1);function d(s=v=>v){let v=l.value!==null?e.value[l.value]:null,_=bt(s(e.value.slice()),C=>f(C.dataRef.domRef)),y=v?_.indexOf(v):null;return y===-1&&(y=null),{items:_,activeItemIndex:y}}let g={menuState:t,buttonRef:u,itemsRef:i,items:e,searchQuery:r,activeItemIndex:l,activationTrigger:m,closeMenu:()=>{t.value=1,l.value=null},openMenu:()=>t.value=0,goToItem(s,v,_){let y=d(),C=gt(s===j.Specific?{focus:j.Specific,id:v}:{focus:s},{resolveItems:()=>y.items,resolveActiveIndex:()=>y.activeItemIndex,resolveId:h=>h.id,resolveDisabled:h=>h.dataRef.disabled});r.value="",l.value=C,m.value=_??1,e.value=y.items},search(s){let v=r.value!==""?0:1;r.value+=s.toLowerCase();let _=(l.value!==null?e.value.slice(l.value+v).concat(e.value.slice(0,l.value+v)):e.value).find(C=>C.dataRef.textValue.startsWith(r.value)&&!C.dataRef.disabled),y=_?e.value.indexOf(_):-1;y===-1||y===l.value||(l.value=y,m.value=1)},clearSearch(){r.value=""},registerItem(s,v){let _=d(y=>[...y,{id:s,dataRef:v}]);e.value=_.items,l.value=_.activeItemIndex,m.value=1},unregisterItem(s){let v=d(_=>{let y=_.findIndex(C=>C.id===s);return y!==-1&&_.splice(y,1),_});e.value=v.items,l.value=v.activeItemIndex,m.value=1}};return $e([u,i],(s,v)=>{var _;g.closeMenu(),De(v,Be.Loose)||(s.preventDefault(),(_=f(u))==null||_.focus())},I(()=>t.value===0)),me(We,g),He(I(()=>ne(t.value,{0:J.Open,1:J.Closed}))),()=>{let s={open:t.value===0,close:g.closeMenu};return ae({ourProps:{},theirProps:n,slot:s,slots:a,attrs:o,name:"Menu"})}}}),un=D({name:"MenuButton",props:{disabled:{type:Boolean,default:!1},as:{type:[Object,String],default:"button"},id:{type:String,default:null}},setup(n,{attrs:a,slots:o,expose:t}){var u;let i=(u=n.id)!=null?u:`headlessui-menu-button-${Z()}`,e=ge("MenuButton");t({el:e.buttonRef,$el:e.buttonRef});function r(g){switch(g.key){case A.Space:case A.Enter:case A.ArrowDown:g.preventDefault(),g.stopPropagation(),e.openMenu(),te(()=>{var s;(s=f(e.itemsRef))==null||s.focus({preventScroll:!0}),e.goToItem(j.First)});break;case A.ArrowUp:g.preventDefault(),g.stopPropagation(),e.openMenu(),te(()=>{var s;(s=f(e.itemsRef))==null||s.focus({preventScroll:!0}),e.goToItem(j.Last)});break}}function l(g){switch(g.key){case A.Space:g.preventDefault();break}}function m(g){n.disabled||(e.menuState.value===0?(e.closeMenu(),te(()=>{var s;return(s=f(e.buttonRef))==null?void 0:s.focus({preventScroll:!0})})):(g.preventDefault(),e.openMenu(),ln(()=>{var s;return(s=f(e.itemsRef))==null?void 0:s.focus({preventScroll:!0})})))}let d=Ue(I(()=>({as:n.as,type:a.type})),e.buttonRef);return()=>{var g;let s={open:e.menuState.value===0},{...v}=n,_={ref:e.buttonRef,id:i,type:d.value,"aria-haspopup":"menu","aria-controls":(g=f(e.itemsRef))==null?void 0:g.id,"aria-expanded":e.menuState.value===0,onKeydown:r,onKeyup:l,onClick:m};return ae({ourProps:_,theirProps:v,slot:s,attrs:a,slots:o,name:"MenuButton"})}}}),cn=D({name:"MenuItems",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},id:{type:String,default:null}},setup(n,{attrs:a,slots:o,expose:t}){var u;let i=(u=n.id)!=null?u:`headlessui-menu-items-${Z()}`,e=ge("MenuItems"),r=k(null);t({el:e.itemsRef,$el:e.itemsRef}),en({container:I(()=>f(e.itemsRef)),enabled:I(()=>e.menuState.value===0),accept(s){return s.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:s.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(s){s.setAttribute("role","none")}});function l(s){var v;switch(r.value&&clearTimeout(r.value),s.key){case A.Space:if(e.searchQuery.value!=="")return s.preventDefault(),s.stopPropagation(),e.search(s.key);case A.Enter:if(s.preventDefault(),s.stopPropagation(),e.activeItemIndex.value!==null){let _=e.items.value[e.activeItemIndex.value];(v=f(_.dataRef.domRef))==null||v.click()}e.closeMenu(),Ve(f(e.buttonRef));break;case A.ArrowDown:return s.preventDefault(),s.stopPropagation(),e.goToItem(j.Next);case A.ArrowUp:return s.preventDefault(),s.stopPropagation(),e.goToItem(j.Previous);case A.Home:case A.PageUp:return s.preventDefault(),s.stopPropagation(),e.goToItem(j.First);case A.End:case A.PageDown:return s.preventDefault(),s.stopPropagation(),e.goToItem(j.Last);case A.Escape:s.preventDefault(),s.stopPropagation(),e.closeMenu(),te(()=>{var _;return(_=f(e.buttonRef))==null?void 0:_.focus({preventScroll:!0})});break;case A.Tab:s.preventDefault(),s.stopPropagation(),e.closeMenu(),te(()=>ht(f(e.buttonRef),s.shiftKey?q.Previous:q.Next));break;default:s.key.length===1&&(e.search(s.key),r.value=setTimeout(()=>e.clearSearch(),350));break}}function m(s){switch(s.key){case A.Space:s.preventDefault();break}}let d=je(),g=I(()=>d!==null?(d.value&J.Open)===J.Open:e.menuState.value===0);return()=>{var s,v;let _={open:e.menuState.value===0},{...y}=n,C={"aria-activedescendant":e.activeItemIndex.value===null||(s=e.items.value[e.activeItemIndex.value])==null?void 0:s.id,"aria-labelledby":(v=f(e.buttonRef))==null?void 0:v.id,id:i,onKeydown:l,onKeyup:m,role:"menu",tabIndex:0,ref:e.itemsRef};return ae({ourProps:C,theirProps:y,slot:_,attrs:a,slots:o,features:fe.RenderStrategy|fe.Static,visible:g.value,name:"MenuItems"})}}}),dn=D({name:"MenuItem",inheritAttrs:!1,props:{as:{type:[Object,String],default:"template"},disabled:{type:Boolean,default:!1},id:{type:String,default:null}},setup(n,{slots:a,attrs:o,expose:t}){var u;let i=(u=n.id)!=null?u:`headlessui-menu-item-${Z()}`,e=ge("MenuItem"),r=k(null);t({el:r,$el:r});let l=I(()=>e.activeItemIndex.value!==null?e.items.value[e.activeItemIndex.value].id===i:!1),m=ft(r),d=I(()=>({disabled:n.disabled,get textValue(){return m()},domRef:r}));le(()=>e.registerItem(i,d)),be(()=>e.unregisterItem(i)),se(()=>{e.menuState.value===0&&l.value&&e.activationTrigger.value!==0&&te(()=>{var h,M;return(M=(h=f(r))==null?void 0:h.scrollIntoView)==null?void 0:M.call(h,{block:"nearest"})})});function g(h){if(n.disabled)return h.preventDefault();e.closeMenu(),Ve(f(e.buttonRef))}function s(){if(n.disabled)return e.goToItem(j.Nothing);e.goToItem(j.Specific,i)}let v=mt();function _(h){v.update(h)}function y(h){v.wasMoved(h)&&(n.disabled||l.value||e.goToItem(j.Specific,i,0))}function C(h){v.wasMoved(h)&&(n.disabled||l.value&&e.goToItem(j.Nothing))}return()=>{let{disabled:h}=n,M={active:l.value,disabled:h,close:e.closeMenu},{...P}=n;return ae({ourProps:{id:i,ref:r,role:"menuitem",tabIndex:h===!0?void 0:-1,"aria-disabled":h===!0?!0:void 0,disabled:void 0,onClick:g,onFocus:s,onPointerenter:_,onMouseenter:_,onPointermove:y,onMousemove:y,onPointerleave:C,onMouseleave:C},theirProps:{...o,...P},slot:M,attrs:o,slots:a,name:"MenuItem"})}}});var pn=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(pn||{});let Ge=Symbol("PopoverContext");function xe(n){let a=ce(Ge,null);if(a===null){let o=new Error(`<${n} /> is missing a parent <${Xe.name} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(o,xe),o}return a}let vn=Symbol("PopoverGroupContext");function Ye(){return ce(vn,null)}let Qe=Symbol("PopoverPanelContext");function fn(){return ce(Qe,null)}let Xe=D({name:"Popover",inheritAttrs:!1,props:{as:{type:[Object,String],default:"div"}},setup(n,{slots:a,attrs:o,expose:t}){var u;let i=k(null);t({el:i,$el:i});let e=k(1),r=k(null),l=k(null),m=k(null),d=k(null),g=I(()=>de(i)),s=I(()=>{var c,x;if(!f(r)||!f(d))return!1;for(let B of document.querySelectorAll("body > *"))if(Number(B?.contains(f(r)))^Number(B?.contains(f(d))))return!0;let w=Se(),E=w.indexOf(f(r)),U=(E+w.length-1)%w.length,z=(E+1)%w.length,ie=w[U],$=w[z];return!((c=f(d))!=null&&c.contains(ie))&&!((x=f(d))!=null&&x.contains($))}),v={popoverState:e,buttonId:k(null),panelId:k(null),panel:d,button:r,isPortalled:s,beforePanelSentinel:l,afterPanelSentinel:m,togglePopover(){e.value=ne(e.value,{0:1,1:0})},closePopover(){e.value!==1&&(e.value=1)},close(c){v.closePopover();let x=c?c instanceof HTMLElement?c:c.value instanceof HTMLElement?f(c):f(v.button):f(v.button);x?.focus()}};me(Ge,v),He(I(()=>ne(e.value,{0:J.Open,1:J.Closed})));let _={buttonId:v.buttonId,panelId:v.panelId,close(){v.closePopover()}},y=Ye(),C=y?.registerPopover,[h,M]=an(),P=nn({mainTreeNodeRef:y?.mainTreeNodeRef,portals:h,defaultContainers:[r,d]});function S(){var c,x,w,E;return(E=y?.isFocusWithinPopoverGroup())!=null?E:((c=g.value)==null?void 0:c.activeElement)&&(((x=f(r))==null?void 0:x.contains(g.value.activeElement))||((w=f(d))==null?void 0:w.contains(g.value.activeElement)))}return se(()=>C?.(_)),tn((u=g.value)==null?void 0:u.defaultView,"focus",c=>{var x,w;c.target!==window&&c.target instanceof HTMLElement&&e.value===0&&(S()||r&&d&&(P.contains(c.target)||(x=f(v.beforePanelSentinel))!=null&&x.contains(c.target)||(w=f(v.afterPanelSentinel))!=null&&w.contains(c.target)||v.closePopover()))},!0),$e(P.resolveContainers,(c,x)=>{var w;v.closePopover(),De(x,Be.Loose)||(c.preventDefault(),(w=f(r))==null||w.focus())},I(()=>e.value===0)),()=>{let c={open:e.value===0,close:v.close};return G(V,[G(M,{},()=>ae({theirProps:{...n,...o},ourProps:{ref:i},slot:c,slots:a,attrs:o,name:"Popover"})),G(P.MainTreeNode)])}}}),mn=D({name:"PopoverButton",props:{as:{type:[Object,String],default:"button"},disabled:{type:[Boolean],default:!1},id:{type:String,default:null}},inheritAttrs:!1,setup(n,{attrs:a,slots:o,expose:t}){var u;let i=(u=n.id)!=null?u:`headlessui-popover-button-${Z()}`,e=xe("PopoverButton"),r=I(()=>de(e.button));t({el:e.button,$el:e.button}),le(()=>{e.buttonId.value=i}),be(()=>{e.buttonId.value=null});let l=Ye(),m=l?.closeOthers,d=fn(),g=I(()=>d===null?!1:d.value===e.panelId.value),s=k(null),v=`headlessui-focus-sentinel-${Z()}`;g.value||se(()=>{e.button.value=f(s)});let _=Ue(I(()=>({as:n.as,type:a.type})),s);function y(c){var x,w,E,U,z;if(g.value){if(e.popoverState.value===1)return;switch(c.key){case A.Space:case A.Enter:c.preventDefault(),(w=(x=c.target).click)==null||w.call(x),e.closePopover(),(E=f(e.button))==null||E.focus();break}}else switch(c.key){case A.Space:case A.Enter:c.preventDefault(),c.stopPropagation(),e.popoverState.value===1&&m?.(e.buttonId.value),e.togglePopover();break;case A.Escape:if(e.popoverState.value!==0)return m?.(e.buttonId.value);if(!f(e.button)||(U=r.value)!=null&&U.activeElement&&!((z=f(e.button))!=null&&z.contains(r.value.activeElement)))return;c.preventDefault(),c.stopPropagation(),e.closePopover();break}}function C(c){g.value||c.key===A.Space&&c.preventDefault()}function h(c){var x,w;n.disabled||(g.value?(e.closePopover(),(x=f(e.button))==null||x.focus()):(c.preventDefault(),c.stopPropagation(),e.popoverState.value===1&&m?.(e.buttonId.value),e.togglePopover(),(w=f(e.button))==null||w.focus()))}function M(c){c.preventDefault(),c.stopPropagation()}let P=Ke();function S(){let c=f(e.panel);if(!c)return;function x(){ne(P.value,{[K.Forwards]:()=>ee(c,q.First),[K.Backwards]:()=>ee(c,q.Last)})===he.Error&&ee(Se().filter(w=>w.dataset.headlessuiFocusGuard!=="true"),ne(P.value,{[K.Forwards]:q.Next,[K.Backwards]:q.Previous}),{relativeTo:f(e.button)})}x()}return()=>{let c=e.popoverState.value===0,x={open:c},{...w}=n,E=g.value?{ref:s,type:_.value,onKeydown:y,onClick:h}:{ref:s,id:i,type:_.value,"aria-expanded":e.popoverState.value===0,"aria-controls":f(e.panel)?e.panelId.value:void 0,disabled:n.disabled?!0:void 0,onKeydown:y,onKeyup:C,onClick:h,onMousedown:M};return G(V,[ae({ourProps:E,theirProps:{...a,...w},slot:x,attrs:a,slots:o,name:"PopoverButton"}),c&&!g.value&&e.isPortalled.value&&G(ve,{id:v,features:pe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:S})])}}}),gn=D({name:"PopoverPanel",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},focus:{type:Boolean,default:!1},id:{type:String,default:null}},inheritAttrs:!1,setup(n,{attrs:a,slots:o,expose:t}){var u;let i=(u=n.id)!=null?u:`headlessui-popover-panel-${Z()}`,{focus:e}=n,r=xe("PopoverPanel"),l=I(()=>de(r.panel)),m=`headlessui-focus-sentinel-before-${Z()}`,d=`headlessui-focus-sentinel-after-${Z()}`;t({el:r.panel,$el:r.panel}),le(()=>{r.panelId.value=i}),be(()=>{r.panelId.value=null}),me(Qe,r.panelId),se(()=>{var M,P;if(!e||r.popoverState.value!==0||!r.panel)return;let S=(M=l.value)==null?void 0:M.activeElement;(P=f(r.panel))!=null&&P.contains(S)||ee(f(r.panel),q.First)});let g=je(),s=I(()=>g!==null?(g.value&J.Open)===J.Open:r.popoverState.value===0);function v(M){var P,S;switch(M.key){case A.Escape:if(r.popoverState.value!==0||!f(r.panel)||l.value&&!((P=f(r.panel))!=null&&P.contains(l.value.activeElement)))return;M.preventDefault(),M.stopPropagation(),r.closePopover(),(S=f(r.button))==null||S.focus();break}}function _(M){var P,S,c,x,w;let E=M.relatedTarget;E&&f(r.panel)&&((P=f(r.panel))!=null&&P.contains(E)||(r.closePopover(),((c=(S=f(r.beforePanelSentinel))==null?void 0:S.contains)!=null&&c.call(S,E)||(w=(x=f(r.afterPanelSentinel))==null?void 0:x.contains)!=null&&w.call(x,E))&&E.focus({preventScroll:!0})))}let y=Ke();function C(){let M=f(r.panel);if(!M)return;function P(){ne(y.value,{[K.Forwards]:()=>{var S;ee(M,q.First)===he.Error&&((S=f(r.afterPanelSentinel))==null||S.focus())},[K.Backwards]:()=>{var S;(S=f(r.button))==null||S.focus({preventScroll:!0})}})}P()}function h(){let M=f(r.panel);if(!M)return;function P(){ne(y.value,{[K.Forwards]:()=>{let S=f(r.button),c=f(r.panel);if(!S)return;let x=Se(),w=x.indexOf(S),E=x.slice(0,w+1),U=[...x.slice(w+1),...E];for(let z of U.slice())if(z.dataset.headlessuiFocusGuard==="true"||c!=null&&c.contains(z)){let ie=U.indexOf(z);ie!==-1&&U.splice(ie,1)}ee(U,q.First,{sorted:!1})},[K.Backwards]:()=>{var S;ee(M,q.Previous)===he.Error&&((S=f(r.button))==null||S.focus())}})}P()}return()=>{let M={open:r.popoverState.value===0,close:r.close},{focus:P,...S}=n,c={ref:r.panel,id:i,onKeydown:v,onFocusout:e&&r.popoverState.value===0?_:void 0,tabIndex:-1};return ae({ourProps:c,theirProps:{...a,...S},attrs:a,slot:M,slots:{...o,default:(...x)=>{var w;return[G(V,[s.value&&r.isPortalled.value&&G(ve,{id:m,ref:r.beforePanelSentinel,features:pe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:C}),(w=o.default)==null?void 0:w.call(o,...x),s.value&&r.isPortalled.value&&G(ve,{id:d,ref:r.afterPanelSentinel,features:pe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:h})])]}},features:fe.RenderStrategy|fe.Static,visible:s.value,name:"PopoverPanel"})}}});const hn=n=>{const a=I(()=>{const l=n.categoryTree.pictures?.[0];if(l&&!l.alt)return{alt:n.categoryTree.name,...l}}),o=I(()=>n.categoryTree.subcategories.filter(({subcategories:l})=>l.length)),t=I(()=>{let l=o.value.length;return a.value&&(l+=1),o.value.length<n.categoryTree.subcategories.length&&(l+=1),l}),u=I(()=>(n.megaMenuMaxCols||7)>=t.value),i=I(()=>u.value?n.categoryTree.subcategories.filter(({subcategories:l})=>!l.length):n.categoryTree.subcategories),e=I(()=>u.value?n.categoryTree.subcategories.filter(({subcategories:l})=>l.length):n.categoryTree.subcategories),r=I(()=>u.value?t.value:a.value?2:1);return{categoryPicture:a,isMegaMenu:u,subcategoryLinks:i,subcategoryCols:e,countMenuCols:r}},bn=D({__name:"ShopHeaderSubmenu",props:{categoryTree:{},megaMenuMaxCols:{}},setup(n,{expose:a}){a();const o=n,{categoryPicture:t,subcategoryLinks:u,subcategoryCols:i,countMenuCols:e}=hn(o),r=k(null),l=k(null);st(r,()=>l.value?.click());const m={props:o,categoryPicture:t,subcategoryLinks:u,subcategoryCols:i,countMenuCols:e,panel:r,close:l,get Popover(){return Xe},get PopoverButton(){return mn},get PopoverPanel(){return gn}};return Object.defineProperty(m,"__isScriptSetup",{enumerable:!1,value:!0}),m}}),_n=["href"],yn={class:"relative",ref:"panel"},Sn={class:"flex w-full gap-6"},xn={key:0,class:"flex-1"},kn=["href"],wn=["href"],Pn={class:"text-base-600 mb-1.5 mt-1 text-sm"},Mn=["href"],Tn=["href"],In=["onClick"];function On(n,a,o,t,u,i){const e=Y("AImg"),r=Y("Fade");return b(),F(t.Popover,null,{default:T(({open:l})=>[p("a",{href:`/${o.categoryTree.slug}`,role:"button"},[L(t.PopoverButton,{id:`PopB${o.categoryTree._id||n.$useId("c")}`,class:"outline-none"},{default:T(()=>[re(n.$slots,"button",Le(Ee({open:l})))]),_:2},1032,["id"])],8,_n),p("div",yn,[L(r,null,{default:T(()=>[L(t.PopoverPanel,{class:N(["text-base-700 absolute left-1/2 top-3 z-50 -translate-x-1/2 !transform rounded bg-white px-6 py-4 text-base shadow",t.countMenuCols===1?"w-60":t.countMenuCols===2?`w-screen ${t.categoryPicture?"max-w-lg":"max-w-sm"}`:t.countMenuCols===3?`w-screen ${t.categoryPicture?"max-w-xl":"max-w-md"}`:t.countMenuCols<6?"w-screen max-w-3xl":"w-screen max-w-5xl"])},{default:T(({close:m})=>[p("div",Sn,[t.subcategoryLinks.length?(b(),O("ul",xn,[(b(!0),O(V,null,W(t.subcategoryLinks,(d,g)=>(b(),O("li",{key:`link-${g}`,class:N(t.subcategoryLinks.length>10?"text-sm mb-1":"mb-2")},[p("a",{href:`/${d.slug}`,class:"hover:text-primary"},[p("h3",null,R(d.name),1)],8,kn)],2))),128))])):H("",!0),(b(!0),O(V,null,W(t.subcategoryCols,(d,g)=>(b(),O("div",{key:g,class:"flex-1"},[p("a",{href:`/${d.slug}`,class:"hover:text-primary"},[p("h3",null,R(d.name),1)],8,wn),p("ul",Pn,[(b(!0),O(V,null,W(d.subcategories,(s,v)=>(b(),O("li",{key:`${g}-${v}`,class:"mb-0.5"},[p("a",{href:`/${s.slug}`,class:"hover:text-primary hover:underline"},[p("h3",null,R(s.name),1)],8,Mn)]))),128))])]))),128)),t.categoryPicture?(b(),O("div",{key:1,class:N(t.countMenuCols===2?"basis-1/2":t.countMenuCols<5?"basis-2/5":"basis-1/3")},[L(e,{picture:t.categoryPicture,class:"ml-auto rounded"},null,8,["picture"])],2)):H("",!0)]),p("a",{href:`/${o.categoryTree.slug}`,class:"text-base-600 mt-1 block text-xs leading-snug underline"},R("Ver toda a categoria $1".replace("$1",o.categoryTree.name)),9,Tn),p("button",{ref:"close",onClick:_e(m,["stop"]),class:"hidden"},null,8,In)]),_:1},8,["class"])]),_:1})],512)]),_:3})}const Cn=Q(bn,[["render",On]]),En=D({__name:"ShopHeaderMenu",props:{inlineMenuTrees:{}},setup(n,{expose:a}){a();const o=n,t=I(()=>!!o.inlineMenuTrees.find(({subcategories:i})=>!i.length)),u={props:o,hasOneLevelSubcategories:t,ShopHeaderSubmenu:Cn};return Object.defineProperty(u,"__isScriptSetup",{enumerable:!1,value:!0}),u}}),Ln={class:"hover:text-primary group"},An=["href"],Rn={class:"inline"};function Nn(n,a,o,t,u,i){return b(),O("nav",null,[p("ul",{class:N(["text-base-700 flex gap-4 xl:gap-5",o.inlineMenuTrees.length<7?"text-base":"text-sm"])},[(b(!0),O(V,null,W(o.inlineMenuTrees,(e,r)=>(b(),O("li",{key:r},[e.subcategories.length?(b(),F(t.ShopHeaderSubmenu,{key:0,"category-tree":e},{button:T(({open:l})=>[p("span",Ln,[p("h3",{class:N(["inline group-hover:underline",[o.inlineMenuTrees.length<7?"decoration-2":null,l?"underline":null]])},R(e.name),3),t.hasOneLevelSubcategories?(b(),O("i",{key:0,class:N(["text-base-400 i-chevron-right group-hover:text-primary-subtle ml-1 transition-transform",l?"-rotate-90":"rotate-90"])},null,2)):H("",!0)])]),_:2},1032,["category-tree"])):(b(),O("a",{key:1,href:`/${e.slug}`,class:N(["hover:text-primary hover:underline",o.inlineMenuTrees.length<7?"decoration-2":null])},[p("h3",Rn,R(e.name),1)],10,An))]))),128))],2)])}const Fn=Q(En,[["render",Nn]]),$n=D({__name:"AccountMenu",setup(n,{expose:a}){a();const o={get Menu(){return sn},get MenuButton(){return un},get MenuItems(){return cn},get MenuItem(){return dn},get socialNetworks(){return ye},get customerName(){return Re},get initializeFirebaseAuth(){return Ae},get isLogged(){return Ne},get logout(){return Fe},AccountLink:ze,SocialNetworkLink:qe};return Object.defineProperty(o,"__isScriptSetup",{enumerable:!1,value:!0}),o}}),Dn={key:0},Bn={class:"text-base-600 p-3"},Hn={class:"list-none"},Un=p("i",{class:"i-heart mr-1"},null,-1),jn={class:"text-base-500 flex justify-center gap-2 p-2 text-base"},Vn=p("span",{class:"text-base-600"},R("Sair"),-1),zn=p("i",{class:"i-arrow-right-on-rectangle ml-1 text-lg"},null,-1),qn=[Vn,zn];function Kn(n,a,o,t,u,i){const e=Y("ALink"),r=Y("Fade");return b(),F(t.Menu,{as:"div",class:"text-base-800 relative text-center text-sm"},{default:T(({open:l})=>[l?(b(),O("div",Dn,[a[0]||(ke(-1),a[0]=p("span",null,[X(R(t.initializeFirebaseAuth()),1)]),ke(1),a[0])])):H("",!0),L(t.AccountLink,{role:"button",onClick:a[1]||(a[1]=_e(()=>{},["prevent"]))},{default:T(()=>[L(t.MenuButton,{id:"AccountBtn",class:"outline-none","aria-label":"Minha conta"},{default:T(()=>[re(n.$slots,"button",Le(Ee({open:l})))]),_:2},1024)]),_:2},1024),L(r,null,{default:T(()=>[L(t.MenuItems,{class:"divide-base-100 absolute -right-8 mt-2 w-56 divide-y rounded bg-white shadow ring-1 ring-black/5 focus:outline-none"},{default:T(()=>[p("div",Bn,[X(R(`Olá ${t.customerName||"Visitante"}`)+" ",1),L(t.AccountLink,{role:"button",class:"ui-btn-sm ui-btn-primary my-1 block"},{default:T(()=>[X(R("Acessar minha conta"))]),_:1}),t.isLogged?H("",!0):(b(),F(t.AccountLink,{key:0,"is-sign-up":"",class:"ui-link block"},{default:T(()=>[X(R("Criar uma conta"))]),_:1}))]),p("ul",Hn,[L(t.MenuItem,{as:"li"},{default:T(({active:m})=>[L(t.AccountLink,{to:"orders",class:N(["block p-2",m?"bg-primary-100 text-primary":null])},{default:T(()=>[X(R("Meus pedidos"))]),_:2},1032,["class"])]),_:1}),L(t.MenuItem,{as:"li"},{default:T(({active:m})=>[L(t.AccountLink,{to:"favorites",class:N(["block p-2",m?"bg-primary-100 text-primary":null])},{default:T(()=>[Un,X(" "+R("Meus favoritos"))]),_:2},1032,["class"])]),_:1}),(b(!0),O(V,null,W(n.$settings.serviceLinks,({title:m,href:d},g)=>(b(),F(t.MenuItem,{key:`s-${g}`,as:"li"},{default:T(({active:s})=>[L(e,{href:d,class:N(["block p-2",s?"bg-primary-100 text-primary":null])},{default:T(()=>[X(R(m),1)]),_:2},1032,["href","class"])]),_:2},1024))),128)),L(t.MenuItem,{as:"li"},{default:T(()=>[p("div",jn,[(b(!0),O(V,null,W(t.socialNetworks,(m,d)=>(b(),O("span",{key:d},[L(t.SocialNetworkLink,{network:d,class:"hover:text-primary p-1"},null,8,["network"])]))),128))])]),_:1}),t.isLogged?(b(),F(t.MenuItem,{key:0,as:"li"},{default:T(()=>[p("button",{onClick:a[2]||(a[2]=(...m)=>t.logout&&t.logout(...m)),class:"text-base-800 p-2 text-right"},qn)]),_:1})):H("",!0)])]),_:1})]),_:1})]),_:3})}const Wn=Q($n,[["render",Kn]]),Gn=D({__name:"ShopHeader",props:{searchInput:{},categories:{},menuCategorySlugs:{},menuRandomCategories:{},isAlphabeticalSortSubmenu:{type:Boolean}},setup(n,{expose:a}){a();const o=Te(()=>Ie(()=>import("./SearchModal.rasg5jV6.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]))),t=Te(()=>Ie(()=>import("./CartSidebar.L0Vbhsdt.js"),__vite__mapDeps([19,1,2,17,9,3,18,8,7,5,6,20,16,10,11,15]))),u=n,i=k(null),e=k(null),{isSticky:r,positionY:l,categoryTrees:m,inlineMenuTrees:d,isSearchOpen:g,isSearchOpenOnce:s,searchTerm:v,quickSearchTerm:_,toggleSearch:y,isCartOpen:C,isCartOpenOnce:h,cartTotalItems:M,handleOnMounted:P}=kt({...u,header:i,searchInput:e}),S=k(!1),c=k(!1);le(()=>{c.value=!0,P()});const x={SearchModal:o,CartSidebar:t,props:u,header:i,searchInput:e,isSticky:r,positionY:l,categoryTrees:m,inlineMenuTrees:d,isSearchOpen:g,isSearchOpenOnce:s,searchTerm:v,quickSearchTerm:_,toggleSearch:y,isCartOpen:C,isCartOpenOnce:h,cartTotalItems:M,handleOnMounted:P,isSidenavOpen:S,isMounted:c,get isMobile(){return ue},Drawer:_t,ShopSidenav:Jt,ShopHeaderMenu:Fn,AccountMenu:Wn};return Object.defineProperty(x,"__isScriptSetup",{enumerable:!1,value:!0}),x}}),Yn={class:"mx-auto flex w-screen grid-flow-col grid-cols-3 items-center justify-between px-1 sm:pl-2 sm:pr-2.5 md:grid lg:w-[calc(100vw-1rem)] lg:auto-cols-max lg:grid-cols-none lg:px-1 xl:max-w-[82rem] 2xl:max-w-[85rem]"},Qn={class:"basis-1/4 lg:hidden"},Xn={class:"text-base-800 flex basis-1/4 items-center justify-end gap-3 px-2 lg:gap-4"},Zn={action:"/s",method:"get",class:"relative"},Jn=p("label",{for:"HeaderSearch",class:"sr-only"},R("Buscar produtos"),-1),ea={class:"absolute -right-0.5 -top-2.5 flex items-stretch"},ta=p("div",{class:"hidden w-12 bg-gradient-to-r from-transparent to-white sm:block"},null,-1),na=["placeholder"],aa=["href"],oa=p("i",{class:"i-shopping-bag group-hover:text-primary size-7 group-hover:scale-110 group-active:scale-125"},null,-1),ra={key:0,class:"ui-badge-pill-sm absolute -right-1.5 -top-1"},la={class:"container mx-auto"},sa={class:"h-full bg-white"};function ia(n,a,o,t,u,i){const e=Y("Fade"),r=Y("Skeleton");return b(),O("header",{ref:"header",class:N(["relative top-0 z-50 transition-colors",[t.isSticky&&!t.isSidenavOpen?"bg-white/80":"bg-white",t.isSticky?"py-2 shadow backdrop-blur-md md:py-3":"py-3 sm:py-4 md:py-5"]])},[p("div",Yn,[p("div",Qn,[p("button",{class:"my-1 px-2","aria-label":"Abrir/fechar menu",onClick:a[0]||(a[0]=l=>t.isSidenavOpen=!t.isSidenavOpen)},[p("i",{class:N(["text-3xl transition-colors",[t.isSidenavOpen?"i-close":"i-bars-3-bottom-left",t.isMounted?"text-base-500":"text-base-400 animate-pulse"]])},null,2)])]),re(n.$slots,"logo"),t.isMobile?H("",!0):(b(),F(t.ShopHeaderMenu,we({key:0},{inlineMenuTrees:t.inlineMenuTrees},{class:"hidden lg:block"}),null,16)),p("div",Xn,[p("form",Zn,[Jn,L(e,null,{default:T(()=>[Pe(p("div",ea,[ta,Pe(p("input",{ref:"searchInput",type:"search",id:"HeaderSearch",name:"q","onUpdate:modelValue":a[1]||(a[1]=l=>t.searchTerm=l),class:"border-1 border-primary/20 to-primary-50 w-72 max-w-md bg-gradient-to-r from-white py-3 pl-5 pr-12 text-base ring-0 md:w-screen",placeholder:"Buscar produtos ..."},null,8,na),[[at,t.searchTerm,void 0,{trim:!0}]])],512),[[nt,t.isSearchOpen]])]),_:1}),p("button",{type:"submit","aria-label":"Buscar produtos",onClick:a[2]||(a[2]=(...l)=>t.toggleSearch&&t.toggleSearch(...l))},[p("i",{class:N(["i-magnifying-glass hover:text-primary size-7 hover:scale-110 active:scale-125",t.isSearchOpen&&"text-primary-600 -translate-x-2"])},null,2)])]),t.isMobile?H("",!0):(b(),F(t.AccountMenu,{key:0,class:"hidden sm:block"},{button:T(({open:l})=>[p("i",{class:N(["i-user-circle hover:text-primary size-7 hover:scale-110 active:scale-125",l?"text-black scale-110":null])},null,2)]),_:1})),p("a",{href:n.$settings.cartUrl||"/app/","aria-label":"Abrir carrinho",onClick:a[3]||(a[3]=_e(l=>t.isCartOpen=!t.isCartOpen,["prevent"])),class:"group relative",role:"button"},[oa,t.cartTotalItems?(b(),O("span",ra,R(t.cartTotalItems),1)):H("",!0)],8,aa)])]),L(t.Drawer,{modelValue:t.isSidenavOpen,"onUpdate:modelValue":a[4]||(a[4]=l=>t.isSidenavOpen=l),"has-close-button":!1,position:"absolute",class:N(t.isSticky?"mt-2 md:mt-3":"mt-3 sm:mt-4 md:mt-5"),style:et({height:`calc(100vh - ${t.positionY}px + .5rem)`,maxHeight:`calc(100dvh - ${t.positionY}px + .5rem)`})},{default:T(()=>[L(t.ShopSidenav,we({class:"pt-6"},{categoryTrees:t.categoryTrees}),null,16)]),_:1},8,["modelValue","class","style"]),L(t.Drawer,{modelValue:t.isSearchOpen,"onUpdate:modelValue":a[5]||(a[5]=l=>t.isSearchOpen=l),"is-hidden":!t.quickSearchTerm,"has-close-button":!1,"anchor-el":t.searchInput?.parentElement,position:"absolute",placement:"top",animation:"scale","max-width":"55rem",class:N(["bg-transparent lg:mt-12",t.isSticky?"mt-2 md:mt-3":"mt-3 sm:mt-4 md:mt-5"])},{default:T(()=>[(b(),F(Me,null,{fallback:T(()=>[p("div",la,[L(r,{class:"p-6","is-large":"","is-bold":""})])]),default:T(()=>[t.isSearchOpenOnce?(b(),F(t.SearchModal,{key:0,term:t.quickSearchTerm},null,8,["term"])):H("",!0)]),_:1}))]),_:1},8,["modelValue","is-hidden","anchor-el","class"]),t.isMounted?(b(),F(tt,{key:0,to:"#teleported-overlap"},[L(t.Drawer,{modelValue:t.isCartOpen,"onUpdate:modelValue":a[7]||(a[7]=l=>t.isCartOpen=l),placement:"end","backdrop-target":"#teleported-overlap",class:"shadow"},{default:T(()=>[(b(),F(Me,null,{fallback:T(()=>[p("div",sa,[L(r,{class:"px-6 pt-16","is-bold":""})])]),default:T(()=>[t.isCartOpenOnce?(b(),F(t.CartSidebar,{key:0,onClose:a[6]||(a[6]=l=>t.isCartOpen=!1)})):H("",!0)]),_:1}))]),_:1},8,["modelValue"])])):H("",!0)],2)}const ba=Q(Gn,[["render",ia]]);export{ba as default};
|
|
2
|
-
function __vite__mapDeps(indexes) {
|
|
3
|
-
if (!__vite__mapDeps.viteFileDeps) {
|
|
4
|
-
__vite__mapDeps.viteFileDeps = ["_astro/SearchModal.rasg5jV6.js","_astro/_plugin-vue_export-helper.xATGHWd9.js","_astro/sf-utils.c42cbZ9W.js","_astro/server-data.4C60Esyt.js","_astro/use-analytics.wTmoP8B1.js","_astro/customer-session.ZD6tLDQJ.js","_astro/index.KfrHdfOH.js","_astro/shopping-cart.nSNNOrp9.js","_astro/price.Easct8WC.js","_astro/afetch.OifQZgwR.js","_astro/name.VA3MEpe0.js","_astro/i18n.zhlBzJt8.js","_astro/ProductShelf.-4fsYkPB.js","_astro/index.ShNlAyu1.js","_astro/use-product-card.UFr8SCuD.js","_astro/img.AnjeGdy_.js","_astro/Prices.xI1rdM1e.js","_astro/modules-info.HP6478mG.js","_astro/format-money.1_HtF5S2.js","_astro/CartSidebar.L0Vbhsdt.js","_astro/QuantitySelector.v7L8EYOR.js"]
|
|
5
|
-
}
|
|
6
|
-
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
|
|
7
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{i as ft,e as D,l as W,f as Tt,g as Mt,h as y,j as Nt,k as X,m as _t,B as wt,n as B,o as Lt,p as yt,t as Dt,q as It,u as Ot,v as ut,x as Pt,y as Rt,z as $t,A as lt,C as xt}from"./sf-utils.c42cbZ9W.js";/**
|
|
2
|
-
* @vue/runtime-dom v3.4.15
|
|
3
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
-
* @license MIT
|
|
5
|
-
**/const Bt="http://www.w3.org/2000/svg",Ht="http://www.w3.org/1998/Math/MathML",v=typeof document<"u"?document:null,J=v&&v.createElement("template"),Ft={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,o)=>{const s=e==="svg"?v.createElementNS(Bt,t):e==="mathml"?v.createElementNS(Ht,t):v.createElement(t,n?{is:n}:void 0);return t==="select"&&o&&o.multiple!=null&&s.setAttribute("multiple",o.multiple),s},createText:t=>v.createTextNode(t),createComment:t=>v.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>v.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,o,s,a){const r=n?n.previousSibling:e.lastChild;if(s&&(s===a||s.nextSibling))for(;e.insertBefore(s.cloneNode(!0),n),!(s===a||!(s=s.nextSibling)););else{J.innerHTML=o==="svg"?`<svg>${t}</svg>`:o==="mathml"?`<math>${t}</math>`:t;const c=J.content;if(o==="svg"||o==="mathml"){const u=c.firstChild;for(;u.firstChild;)c.appendChild(u.firstChild);c.removeChild(u)}e.insertBefore(c,n)}return[r?r.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},g="transition",N="animation",L=Symbol("_vtc"),pt=(t,{slots:e})=>_t(wt,Kt(t),e);pt.displayName="Transition";const mt={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String};pt.props=B({},Lt,mt);const C=(t,e=[])=>{y(t)?t.forEach(n=>n(...e)):t&&t(...e)},Q=t=>t?y(t)?t.some(e=>e.length>1):t.length>1:!1;function Kt(t){const e={};for(const i in t)i in mt||(e[i]=t[i]);if(t.css===!1)return e;const{name:n="v",type:o,duration:s,enterFromClass:a=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:c=`${n}-enter-to`,appearFromClass:u=a,appearActiveClass:f=r,appearToClass:l=c,leaveFromClass:m=`${n}-leave-from`,leaveActiveClass:d=`${n}-leave-active`,leaveToClass:E=`${n}-leave-to`}=t,T=Vt(s),vt=T&&T[0],St=T&&T[1],{onBeforeEnter:F,onEnter:K,onEnterCancelled:V,onLeave:q,onLeaveCancelled:Ct,onBeforeAppear:bt=F,onAppear:At=K,onAppearCancelled:Et=V}=e,O=(i,p,S)=>{b(i,p?l:c),b(i,p?f:r),S&&S()},z=(i,p)=>{i._isLeaving=!1,b(i,m),b(i,E),b(i,d),p&&p()},U=i=>(p,S)=>{const j=i?At:K,G=()=>O(p,i,S);C(j,[p,G]),Y(()=>{b(p,i?u:a),h(p,i?l:c),Q(j)||Z(p,o,vt,G)})};return B(e,{onBeforeEnter(i){C(F,[i]),h(i,a),h(i,r)},onBeforeAppear(i){C(bt,[i]),h(i,u),h(i,f)},onEnter:U(!1),onAppear:U(!0),onLeave(i,p){i._isLeaving=!0;const S=()=>z(i,p);h(i,m),Ut(),h(i,d),Y(()=>{i._isLeaving&&(b(i,m),h(i,E),Q(q)||Z(i,o,St,S))}),C(q,[i,S])},onEnterCancelled(i){O(i,!1),C(V,[i])},onAppearCancelled(i){O(i,!0),C(Et,[i])},onLeaveCancelled(i){z(i),C(Ct,[i])}})}function Vt(t){if(t==null)return null;if(yt(t))return[P(t.enter),P(t.leave)];{const e=P(t);return[e,e]}}function P(t){return Dt(t)}function h(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.add(n)),(t[L]||(t[L]=new Set)).add(e)}function b(t,e){e.split(/\s+/).forEach(o=>o&&t.classList.remove(o));const n=t[L];n&&(n.delete(e),n.size||(t[L]=void 0))}function Y(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let qt=0;function Z(t,e,n,o){const s=t._endId=++qt,a=()=>{s===t._endId&&o()};if(n)return setTimeout(a,n);const{type:r,timeout:c,propCount:u}=zt(t,e);if(!r)return o();const f=r+"end";let l=0;const m=()=>{t.removeEventListener(f,d),a()},d=E=>{E.target===t&&++l>=u&&m()};setTimeout(()=>{l<u&&m()},c+1),t.addEventListener(f,d)}function zt(t,e){const n=window.getComputedStyle(t),o=T=>(n[T]||"").split(", "),s=o(`${g}Delay`),a=o(`${g}Duration`),r=k(s,a),c=o(`${N}Delay`),u=o(`${N}Duration`),f=k(c,u);let l=null,m=0,d=0;e===g?r>0&&(l=g,m=r,d=a.length):e===N?f>0&&(l=N,m=f,d=u.length):(m=Math.max(r,f),l=m>0?r>f?g:N:null,d=l?l===g?a.length:u.length:0);const E=l===g&&/\b(transform|all)(,|$)/.test(o(`${g}Property`).toString());return{type:l,timeout:m,propCount:d,hasTransform:E}}function k(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max(...e.map((n,o)=>tt(n)+tt(t[o])))}function tt(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function Ut(){return document.body.offsetHeight}function jt(t,e,n){const o=t[L];o&&(e=(e?[e,...o]:[...o]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const H=Symbol("_vod"),me={beforeMount(t,{value:e},{transition:n}){t[H]=t.style.display==="none"?"":t.style.display,n&&e?n.beforeEnter(t):_(t,e)},mounted(t,{value:e},{transition:n}){n&&e&&n.enter(t)},updated(t,{value:e,oldValue:n},{transition:o}){!e!=!n&&(o?e?(o.beforeEnter(t),_(t,!0),o.enter(t)):o.leave(t,()=>{_(t,!1)}):_(t,e))},beforeUnmount(t,{value:e}){_(t,e)}};function _(t,e){t.style.display=e?t[H]:"none"}const Gt=Symbol("");function Wt(t,e,n){const o=t.style,s=o.display,a=D(n);if(n&&!a){if(e&&!D(e))for(const r in e)n[r]==null&&x(o,r,"");for(const r in n)x(o,r,n[r])}else if(a){if(e!==n){const r=o[Gt];r&&(n+=";"+r),o.cssText=n}}else e&&t.removeAttribute("style");H in t&&(o.display=s)}const et=/\s*!important$/;function x(t,e,n){if(y(n))n.forEach(o=>x(t,e,o));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const o=Xt(t,e);et.test(n)?t.setProperty(ut(o),n.replace(et,""),"important"):t[o]=n}}const nt=["Webkit","Moz","ms"],R={};function Xt(t,e){const n=R[e];if(n)return n;let o=Pt(e);if(o!=="filter"&&o in t)return R[e]=o;o=Rt(o);for(let s=0;s<nt.length;s++){const a=nt[s]+o;if(a in t)return R[e]=a}return e}const ot="http://www.w3.org/1999/xlink";function Jt(t,e,n,o,s){if(o&&e.startsWith("xlink:"))n==null?t.removeAttributeNS(ot,e.slice(6,e.length)):t.setAttributeNS(ot,e,n);else{const a=$t(e);n==null||a&&!lt(n)?t.removeAttribute(e):t.setAttribute(e,a?"":n)}}function Qt(t,e,n,o,s,a,r){if(e==="innerHTML"||e==="textContent"){o&&r(o,s,a),t[e]=n??"";return}const c=t.tagName;if(e==="value"&&c!=="PROGRESS"&&!c.includes("-")){t._value=n;const f=c==="OPTION"?t.getAttribute("value"):t.value,l=n??"";f!==l&&(t.value=l),n==null&&t.removeAttribute(e);return}let u=!1;if(n===""||n==null){const f=typeof t[e];f==="boolean"?n=lt(n):n==null&&f==="string"?(n="",u=!0):f==="number"&&(n=0,u=!0)}try{t[e]=n}catch{}u&&t.removeAttribute(e)}function A(t,e,n,o){t.addEventListener(e,n,o)}function Yt(t,e,n,o){t.removeEventListener(e,n,o)}const st=Symbol("_vei");function Zt(t,e,n,o,s=null){const a=t[st]||(t[st]={}),r=a[e];if(o&&r)r.value=o;else{const[c,u]=kt(e);if(o){const f=a[e]=ne(o,s);A(t,c,f,u)}else r&&(Yt(t,c,r,u),a[e]=void 0)}}const rt=/(?:Once|Passive|Capture)$/;function kt(t){let e;if(rt.test(t)){e={};let o;for(;o=t.match(rt);)t=t.slice(0,t.length-o[0].length),e[o[0].toLowerCase()]=!0}return[t[2]===":"?t.slice(3):ut(t.slice(2)),e]}let $=0;const te=Promise.resolve(),ee=()=>$||(te.then(()=>$=0),$=Date.now());function ne(t,e){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;xt(oe(o,n.value),e,5,[o])};return n.value=t,n.attached=ee(),n}function oe(t,e){if(y(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(o=>s=>!s._stopped&&o&&o(s))}else return e}const it=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,se=(t,e,n,o,s,a,r,c,u)=>{const f=s==="svg";e==="class"?jt(t,o,f):e==="style"?Wt(t,n,o):It(e)?Ot(e)||Zt(t,e,n,o,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):re(t,e,o,f))?Qt(t,e,o,a,r,c,u):(e==="true-value"?t._trueValue=o:e==="false-value"&&(t._falseValue=o),Jt(t,e,o,f))};function re(t,e,n,o){if(o)return!!(e==="innerHTML"||e==="textContent"||e in t&&it(e)&&ft(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const s=t.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return it(e)&&D(n)?!1:e in t}const I=t=>{const e=t.props["onUpdate:modelValue"]||!1;return y(e)?n=>Nt(e,n):e};function ie(t){t.target.composing=!0}function at(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const M=Symbol("_assign"),de={created(t,{modifiers:{lazy:e,trim:n,number:o}},s){t[M]=I(s);const a=o||s.props&&s.props.type==="number";A(t,e?"change":"input",r=>{if(r.target.composing)return;let c=t.value;n&&(c=c.trim()),a&&(c=W(c)),t[M](c)}),n&&A(t,"change",()=>{t.value=t.value.trim()}),e||(A(t,"compositionstart",ie),A(t,"compositionend",at),A(t,"change",at))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,modifiers:{lazy:n,trim:o,number:s}},a){if(t[M]=I(a),t.composing)return;const r=s||t.type==="number"?W(t.value):t.value,c=e??"";r!==c&&(document.activeElement===t&&t.type!=="range"&&(n||o&&t.value.trim()===c)||(t.value=c))}},ge={created(t,{value:e},n){t.checked=X(e,n.props.value),t[M]=I(n),A(t,"change",()=>{t[M](ae(t))})},beforeUpdate(t,{value:e,oldValue:n},o){t[M]=I(o),e!==n&&(t.checked=X(e,o.props.value))}};function ae(t){return"_value"in t?t._value:t.value}const ce=["ctrl","shift","alt","meta"],fe={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>ce.some(n=>t[`${n}Key`]&&!e.includes(n))},he=(t,e)=>{const n=t._withMods||(t._withMods={}),o=e.join(".");return n[o]||(n[o]=(s,...a)=>{for(let r=0;r<e.length;r++){const c=fe[e[r]];if(c&&c(s,e))return}return t(s,...a)})},dt=B({patchProp:se},Ft);let w,ct=!1;function ue(){return w||(w=Tt(dt))}function le(){return w=ct?w:Mt(dt),ct=!0,w}const ve=(...t)=>{const e=ue().createApp(...t),{mount:n}=e;return e.mount=o=>{const s=ht(o);if(!s)return;const a=e._component;!ft(a)&&!a.render&&!a.template&&(a.template=s.innerHTML),s.innerHTML="";const r=n(s,!1,gt(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),r},e},Se=(...t)=>{const e=le().createApp(...t),{mount:n}=e;return e.mount=o=>{const s=ht(o);if(s)return n(s,!0,gt(s))},e};function gt(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function ht(t){return D(t)?document.querySelector(t):t}const Ce=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n};export{pt as T,Ce as _,de as a,ge as b,Se as c,ve as d,me as v,he as w};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as F,T as ne,w as ae,c as oe,d as se}from"./_plugin-vue_export-helper.xATGHWd9.js";import{d as C,c,O as y,a0 as A,W as k,$ as b,a1 as Q,P as R,a3 as Z,a4 as ee,S,U as v,a7 as ie,a6 as le,a as E,w as z,aa as V,I as ue,F as ce,ai as de,a8 as fe,R as J,m as $,aj as me}from"./sf-utils.c42cbZ9W.js";import{g as ve}from"./img.AnjeGdy_.js";import{u as pe}from"./index.KfrHdfOH.js";import{g as ge}from"./img-sizes.gxAI9JNh.js";import{i as he}from"./i18n.zhlBzJt8.js";import{f as ye}from"./format-money.1_HtF5S2.js";import{a as _e,b as we}from"./index.ShNlAyu1.js";import"./price.Easct8WC.js";const Se=C({__name:"Fade",props:{speed:{default:"default"},slide:{},isFloating:{type:Boolean,default:!1},isLeaveTo:{type:Boolean,default:!0},isEnterFrom:{type:Boolean,default:!0}},setup(r,{expose:a}){a();const e=r,t=c(()=>e.speed==="default"?"var(--transition, .2s linear)":`var(--transition-${e.speed}, .4s linear)`),i=c(()=>{switch(e.slide){case"down":return"translate3d(0, -100%, 0)";case"left":return"translate3d(-100%, 0, 0)";case"right":return"translate3d(100%, 0, 0)";case"up":return"translate3d(0, 100%, 0)";default:return"none"}}),o=c(()=>i.value!=="none"?.1:0),l=c(()=>e.isEnterFrom?o.value:1),g=c(()=>e.isLeaveTo?o.value:1),P=c(()=>e.isEnterFrom?i.value:"none"),f=c(()=>e.isLeaveTo?i.value:"none"),u=c(()=>e.slide==="down"||e.slide==="up"),_=c(()=>e.isFloating?null:u.value?0:"auto"),T=c(()=>e.isFloating?null:e.slide&&!u.value?0:"auto"),m=c(()=>e.isEnterFrom?_.value:"auto"),x=c(()=>e.isEnterFrom?T.value:"auto"),w=c(()=>{let n="opacity";return i.value!=="none"&&(n+=", transform"),_.value===0&&(n+=", height"),T.value===0&&(n+=", width"),n}),p={props:e,duration:t,transform:i,opacity:o,enterFromOpacity:l,leaveToOpacity:g,enterFromTransform:P,leaveToTransform:f,isSlideY:u,height:_,width:T,enterFromHeight:m,enterFromWidth:x,willChange:w,setInitialStyles:n=>{n.style.setProperty("--fade-will-change",w.value),n.style.setProperty("--fade-duration",t.value),n.style.setProperty("--fade-enter-opacity",String(l.value)),n.style.setProperty("--fade-enter-transform",String(P.value)),n.style.setProperty("--fade-enter-height",String(m.value)),n.style.setProperty("--fade-enter-width",String(x.value)),n.style.setProperty("--fade-leave-opacity",String(g.value)),n.style.setProperty("--fade-leave-transform",String(f.value))},onEnter:n=>{if(e.slide&&!e.isFloating&&e.isEnterFrom){u.value?(n.style.width=getComputedStyle(n).width,n.style.height="auto"):(n.style.width="auto",n.style.height=getComputedStyle(n).height),n.style.position="absolute",n.style.visibility="hidden";const{width:h,height:N}=getComputedStyle(n);n.style.width=u.value?"":"0",n.style.height=u.value?"0":"",n.style.position="",n.style.visibility="",getComputedStyle(n)[u.value?"height":"width"],requestAnimationFrame(()=>{u.value?n.style.height=N:n.style.width=h})}},onAfterEnter:n=>{e.slide&&!e.isFloating&&e.isEnterFrom&&(n.style[u.value?"height":"width"]="")},onLeave:n=>{if(e.slide&&!e.isFloating&&e.isLeaveTo){u.value?n.style.height=getComputedStyle(n).height:n.style.width=getComputedStyle(n).width;const h=u.value?"height":"width";getComputedStyle(n)[h],requestAnimationFrame(()=>{n.style[h]="0"})}}};return Object.defineProperty(p,"__isScriptSetup",{enumerable:!1,value:!0}),p}});function xe(r,a,e,t,i,o){return y(),A(ne,{name:"sf-fade",onBeforeEnter:t.setInitialStyles,onEnter:t.onEnter,onBeforeLeave:t.setInitialStyles,onAfterEnter:t.onAfterEnter,onLeave:t.onLeave},{default:k(()=>[b(r.$slots,"default")]),_:3},8,["onBeforeEnter","onEnter","onBeforeLeave","onAfterEnter","onLeave"])}const be=F(Se,[["render",xe]]),Ce=C({__name:"ALink",props:{href:{},target:{}},setup(r,{expose:a}){a();const e=r,t=c(()=>{if(e.href){if(e.target)return e.target;if(e.href.startsWith("http")){const o=globalThis.$storefront.settings.domain||window.location.host;return e.href.startsWith(`https://${o}`)?void 0:"_blank"}}}),i={props:e,linkTarget:t};return Object.defineProperty(i,"__isScriptSetup",{enumerable:!1,value:!0}),i}});function Pe(r,a,e,t,i,o){return y(),A(Q(e.href?"a":"span"),{href:e.href,target:t.linkTarget,rel:t.linkTarget==="_blank"?"noopener":void 0},{default:k(()=>[b(r.$slots,"default")]),_:3},8,["href","target","rel"])}const Te=F(Ce,[["render",Pe]]),Le=C({__name:"AImg",props:{picture:{},loading:{default:"lazy"},decoding:{},alt:{},preferredSize:{}},setup(r,{expose:a}){a();const e=r,t=c(()=>e.picture.url?e.picture:ve(e.picture,void 0,e.preferredSize)||{}),i=c(()=>ge(t.value)),o=c(()=>({src:t.value.url,alt:t.value.alt||e.alt,width:i.value.width||void 0,height:i.value.height||void 0,loading:e.loading,decoding:e.decoding||(i.value.height?"async":void 0)})),l={props:e,image:t,dimensions:i,attrs:o};return Object.defineProperty(l,"__isScriptSetup",{enumerable:!1,value:!0}),l}});function Ee(r,a,e,t,i,o){return y(),R("img",Z(ee(t.attrs)),null,16)}const Fe=F(Le,[["render",Ee]]),q="bg-gray-200 rounded-md dark:bg-gray-700",Be=C({__name:"Skeleton",props:{isBold:{type:Boolean},isLarge:{type:Boolean}},setup(r,{expose:a}){a();const e=r,t=c(()=>`${q} ${e.isBold?"h-8 mb-6":"h-2.5 mb-4"}`),i=c(()=>`${q} ${e.isBold?"h-5 mb-4":"h-2 mb-2.5"}`),o={props:e,rowClassName:q,firstRowClassName:t,nextRowsClassName:i};return Object.defineProperty(o,"__isScriptSetup",{enumerable:!1,value:!0}),o}}),ze=S("span",{class:"sr-only"},"Loading...",-1);function Ae(r,a,e,t,i,o){return y(),R("div",{role:"status",class:v(["animate-pulse",e.isLarge?"max-w-4xl":"max-w-sm"])},[S("div",{class:v([t.firstRowClassName,e.isLarge?"w-96":"w-48"])},null,2),S("div",{class:v([t.nextRowsClassName,e.isLarge?"max-w-[680px]":"max-w-[340px]"])},null,2),S("div",{class:v(t.nextRowsClassName)},null,2),S("div",{class:v([t.nextRowsClassName,e.isLarge?"max-w-[660px]":"max-w-[330px]"])},null,2),S("div",{class:v([t.nextRowsClassName,e.isLarge?"max-w-[600px]":"max-w-[300px]"])},null,2),S("div",{class:v([t.nextRowsClassName,e.isLarge?"max-w-[720px]":"max-w-[360px]"])},null,2),ze],2)}const ke=F(Be,[["render",Ae]]),Ie=(r,a=1)=>Number.isInteger(r)?`${r}%`:`${r.toFixed(a)}%`,Ne=r=>{r.use({install:(a,e)=>{a.config.globalProperties.$t=(o,l)=>he(o,l||e?.lang),a.config.globalProperties.$money=ye,a.config.globalProperties.$percentage=Ie;const{settings:t,apiContext:i}=globalThis.$storefront||{};a.config.globalProperties.$settings=t,a.config.globalProperties.$apiContext=i,a.config.globalProperties.$useId=ie}}),r.component("Fade",be),r.component("ALink",Te),r.component("AImg",Fe),r.component("Skeleton",ke)},Oe=C({__name:"CarouselControl",props:{isPrev:{type:Boolean,default:!1}},setup(r,{expose:a}){a();const{axis:e,changeSlide:t}=le(D),o={axis:e,changeSlide:t,isX:e==="x"};return Object.defineProperty(o,"__isScriptSetup",{enumerable:!1,value:!0}),o}}),$e=["aria-label","data-carousel-control"];function Re(r,a,e,t,i,o){return y(),R("button",{type:"button","aria-label":e.isPrev?"Anterior":"Próximo",onClick:a[0]||(a[0]=ae(l=>t.changeSlide(e.isPrev?-1:1),["stop","prevent"])),class:v(["group absolute z-[11]",t.isX?`${e.isPrev?"left-0":"right-0"} top-0`:`${e.isPrev?"top-0":"bottom-0"} left-0`]),"data-carousel-control":e.isPrev?"previous":"next"},[b(r.$slots,"default",{},()=>[S("i",{class:v(["m-0 i-chevron-right",{"group-active:translate-x-1":t.isX&&!e.isPrev,"rotate-180 group-active:-translate-x-1":t.isX&&e.isPrev,"rotate-90 group-active:translate-y-1":!t.isX&&!e.isPrev,"-rotate-90 group-active:-translate-y-1":!t.isX&&e.isPrev}])},null,2)])],10,$e)}const te=F(Oe,[["render",Re]]),D=Symbol("carousel"),je=C({__name:"Carousel",props:{as:{default:"ul"},index:{default:0},autoplay:{},axis:{default:"x"},hasControls:{type:Boolean},wrapperKey:{}},emits:["update:index"],setup(r,{expose:a,emit:e}){a();const t=r,i=e,o=E(0);z(V(t,"index"),s=>{if(s!==o.value){const d=s-o.value;h(d,!1)}},{immediate:!0}),z(o,(s,d)=>{s!==d&&i("update:index",s)});const l=E(null),{[t.axis]:g,isScrolling:P,arrivedState:f}=_e(l),u=t.axis==="x",_=c(()=>u?f.left:f.top),T=c(()=>u?f.right:f.bottom),m=E([]),x=E(0),w=E(0),j=()=>{l.value&&(u?(x.value=l.value.scrollWidth,w.value=l.value.offsetWidth):(x.value=l.value.scrollHeight,w.value=l.value.offsetHeight))},H=()=>{if(!l.value)return;let s=[...l.value.children];s.length===1&&s[0].tagName.endsWith("SLOT")&&(s=[...s[0].children]),m.value=s.map(d=>({offset:u?d.offsetLeft:d.offsetTop,size:u?d.offsetWidth:d.offsetHeight}))},X=s=>{let d=o.value+s;if(d>=m.value.length)return 0;d<0&&(d=m.value.length+d);const{offset:B,size:L}=m.value[d]||{};return L?B:0},I=()=>{const s=m.value.findIndex(d=>Math.abs(d.offset-g.value)<=5);s>-1&&(o.value=s||0)};let p;const n=()=>{t.autoplay&&(clearTimeout(p),p=setTimeout(()=>{h(1)},t.autoplay))},h=(s,d=!0)=>{if(m.value.length<2)return;let B=-1;if(g.value+w.value>=x.value)B=0;else{if(d&&(s===1||s===-1)){let L=0,G=0;for(let M=o.value;M<m.value.length;M++){const{size:K}=m.value[M]||{};if(K&&(L+=1,G+=K,G+K*.75>=w.value))break}L&&(s=s>0?L:-L)}B=X(s)}l.value?.scrollTo({[u?"left":"top"]:B,behavior:"smooth"}),n()};z(P,s=>{s?clearTimeout(p):(I(),n())});const N=E(null),U=we(N);z(U,s=>{s?clearTimeout(p):n()});const O=()=>{l.value&&(j(),H(),I())},W=pe(()=>{l.value&&(u?l.value.scrollLeft=0:l.value.scrollTop=0,O())},400);ue(()=>{O(),ce(()=>{l.value&&[...l.value.children].forEach(s=>{s.setAttribute("tabindex","0")})}),n(),window.addEventListener("resize",W)}),z(V(t,"wrapperKey"),O),de(()=>{window.removeEventListener("resize",W),clearTimeout(p)}),fe(D,{autoplay:V(t,"autoplay"),axis:t.axis,changeSlide:h,isBoundStart:_,isBoundEnd:T});const Y={carouselKey:D,props:t,emit:i,activeIndex:o,wrapper:l,currentPos:g,isScrolling:P,arrivedState:f,isX:u,isBoundStart:_,isBoundEnd:T,slideSizes:m,wrapperScrollSize:x,wrapperVisibleSize:w,calcWrapperSize:j,calcSlidesSize:H,calcNextOffset:X,calcCurrentIndex:I,get autoplayTimer(){return p},set autoplayTimer(s){p=s},restartAutoplay:n,changeSlide:h,carousel:N,isHovered:U,calcOnInit:O,onResize:W,CarouselControl:te};return Object.defineProperty(Y,"__isScriptSetup",{enumerable:!1,value:!0}),Y}});function He(r,a,e,t,i,o){return y(),R("div",{ref:"carousel",class:v(`relative ${t.isX?"":"overflow-hidden"}`),"data-carousel":""},[(y(),A(Q(e.as),{ref:"wrapper",class:v(["m-0 flex snap-mandatory list-none scroll-smooth p-0 [&>*]:snap-start [&>*]:outline-none",t.isX?"snap-x overflow-y-hidden overflow-x-scroll":"h-full flex-col snap-y overflow-x-hidden overflow-y-scroll"]),style:{"scrollbar-width":"none","-webkit-overflow-scrolling":"touch","-ms-overflow-style":"none"},"data-carousel-wrapper":""},{default:k(()=>[b(r.$slots,"default")]),_:3},8,["class"])),b(r.$slots,"controls",Z(ee({changeSlide:t.changeSlide,isBoundStart:t.isBoundStart,isBoundEnd:t.isBoundEnd,activeIndex:t.activeIndex})),()=>[t.slideSizes.length>1||e.hasControls?(y(),A(t.CarouselControl,{key:0,"is-prev":""},{default:k(()=>[b(r.$slots,"previous")]),_:3})):J("",!0),t.slideSizes.length>1||e.hasControls?(y(),A(t.CarouselControl,{key:1},{default:k(()=>[b(r.$slots,"next")]),_:3})):J("",!0)])],2)}const Xe=F(je,[["render",He]]),re=r=>{Ne(r),r.component("Carousel",Xe),r.component("CarouselControl",te)},We=Object.freeze(Object.defineProperty({__proto__:null,default:re},Symbol.toStringTag,{value:"Module"})),Me=async r=>{"default"in We&&await re(r)},Ke=C({props:{value:String,name:String,hydrate:{type:Boolean,default:!0}},setup({name:r,value:a,hydrate:e}){if(!a)return()=>null;let t=e?"astro-slot":"astro-static-slot";return()=>$(t,{name:r,innerHTML:a})}}),tt=r=>async(a,e,t,{client:i})=>{if(!r.hasAttribute("ssr"))return;const o=a.name?`${a.name} Host`:void 0,l={};for(const[u,_]of Object.entries(t))l[u]=()=>$(Ke,{value:_,name:u==="default"?void 0:u});const g=i!=="only",f=(g?oe:se)({name:o,render(){let u=$(a,e,l);return Ve(a.setup)&&(u=$(me,null,u)),u}});await Me(f),f.mount(r,g),r.addEventListener("astro:unmount",()=>f.unmount(),{once:!0})};function Ve(r){const a=r?.constructor;return a&&a.name==="AsyncFunction"}export{tt as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import"./server-data.4C60Esyt.js";import{r as C,c as y,b as U}from"./sf-utils.c42cbZ9W.js";import{h as x}from"./index.KfrHdfOH.js";const K=e=>{if(e){if(e.display_name)return e.display_name;if(e.name&&e.name.given_name)return e.name.given_name}return""},z=K,G="modulepreload",J=function(e){return"/"+e},I={},V=function(a,t,i){let r=Promise.resolve();if(t&&t.length>0){const n=document.getElementsByTagName("link");r=Promise.all(t.map(s=>{if(s=J(s),s in I)return;I[s]=!0;const o=s.endsWith(".css"),c=o?'[rel="stylesheet"]':"";if(!!i)for(let p=n.length-1;p>=0;p--){const g=n[p];if(g.href===s&&(!o||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${c}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":G,o||(u.as="script",u.crossOrigin=""),u.href=s,document.head.appendChild(u),o)return new Promise((p,g)=>{u.addEventListener("load",p),u.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${s}`)))})}))}return r.then(()=>a()).catch(n=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=n,window.dispatchEvent(s),!s.defaultPrevented)throw n})},F=(e,a,t=globalThis.localStorage,i=!0)=>{if(!t)return C(a);const r=()=>{const c=t.getItem(e);if(c)try{return JSON.parse(c)}catch{return t.removeItem(e),null}},n=r(),s=C(n||a);let o;return i&&globalThis.BroadcastChannel&&(o=new BroadcastChannel(e),o.onmessage=c=>{c.data==="set"&&Object.assign(s,r())}),x(s,()=>{t.setItem(e,JSON.stringify(s)),o&&o.postMessage("set")},{debounce:50}),s};globalThis.__apiCache||(globalThis.__apiCache={});const b=typeof process=="object"&&process?.env||globalThis;class S extends Error{constructor(a,t,i,r=!1){t?(super(t.statusText),this.data=t.data,this.statusCode=t.status):super(i||"Request error"),this.config=a,this.response=t,this.isTimeout=r}}const H={middleware(e){const a={...e.headers};if(!e.isNoAuth)if(e.accessToken)a.Authorization=`Bearer ${e.accessToken}`;else{const n=e.authenticationId||b.ECOM_AUTHENTICATION_ID,s=e.apiKey||b.ECOM_API_KEY;if(n&&s){const o=`${n}:${s}`,c=typeof Buffer=="function"?Buffer.from(o).toString("base64"):btoa(o);a.Authorization=`Basic ${c}`}}let t=e.baseUrl||b.API_BASE_URL||"https://ecomplus.io/v2";const{endpoint:i,params:r}=e;if(i!=="login"&&i!=="authenticate"&&i!=="ask-auth-callback"&&i!=="check-username"){const n=e.storeId||b.ECOM_STORE_ID;if(!n)throw new Error("`storeId` must be set in config or `ECOM_STORE_ID` env var");t+=`/:${n}`;const s=e.lang||b.ECOM_LANG;s&&(t+=`,lang:${s}`)}if(t+=`/${i}`,typeof r=="string")t+=`?${r}`;else{const n=r||{};if(["fields","sort"].forEach(s=>{const o=e[s];o&&!n[s]&&(n[s]=o.join(","))}),["limit","offset","count","buckets","concise","verbose"].forEach(s=>{const o=e[s];o&&!n[s]&&(n[s]=o)}),Object.keys(n).length){const s=new URLSearchParams;Object.keys(n).forEach(o=>{const c=n[o];Array.isArray(c)?c.forEach(_=>{s.append(o,_)}):c!==void 0&&s.append(o,c)}),t+=`?${s.toString()}`}}return{url:t,headers:a}}},l=async(e,a=0)=>{const t=globalThis.$apiMergeConfig?{...globalThis.$apiMergeConfig,...e}:e,{url:i,headers:r}=H.middleware(t),n=t.method?.toUpperCase()||"GET",{timeout:s=2e4,maxRetries:o=3,cacheMaxAge:c=Number(b.API_CACHE_MAX_AGE)||12e4}=t,_=n==="GET"&&t.canCache;let u;if(_){u=`${i}${JSON.stringify(r)}`;const f=globalThis.__apiCache[u];if(f&&Date.now()-f.timestamp<=c)return{...f.res,config:t}}const p=t.body||t.data;let g;p&&(g=JSON.stringify(p),r["Content-Type"]="application/json");const T=new AbortController;let A=!1;const M=setTimeout(()=>{T.abort(),A=!0},s);let h;try{h=await(t.fetch||fetch)(i,{method:n,headers:r,body:g,signal:T.signal})}catch(f){let d=f.message;throw f.cause&&(d+=` - ${f.cause}`),new S(t,h,d,A)}if(clearTimeout(M),h){if(h.ok){const d=h;return d.data=h.status!==204?await h.json():null,_&&u&&(globalThis.__apiCache[u]={timestamp:Date.now(),res:d}),d.config=t,d}const{status:f}=h;if(o<a&&(f===429||f>=500)){const d=h.headers.get("retry-after");return new Promise((D,L)=>{setTimeout(()=>{l(e,a+1).then(D).catch(L)},d&&parseInt(d,10)*1e3||5e3)})}}try{h.data=await h?.json()}catch{}throw new S(t,h)},Y=(e,a)=>l({...a,endpoint:e}),q=(e,a,t)=>l({...t,method:"post",endpoint:e,body:a}),X=(e,a,t)=>l({...t,method:"put",endpoint:e,body:a}),Q=(e,a,t)=>l({...t,method:"patch",endpoint:e,body:a}),N=(e,a)=>l({...a,method:"delete",endpoint:e});l.get=Y;l.post=q;l.put=X;l.patch=Q;l.del=N;l.delete=N;const W="emailForSignIn",P="ecomSession",E={customer:{display_name:"",main_email:""},auth:null},m=F(P,E),v=y(()=>{const{auth:e}=m;return e&&new Date(e.expires).getTime()-Date.now()>1e3*10}),R=y(()=>m.customer),O=y(()=>z(R.value)),$=y({get(){return R.value.main_email},set(e){m.customer.main_email=e}});let w;const ne=y(()=>v.value||!!w?.currentUser?.emailVerified),Z=()=>{m.auth=E.auth,m.customer=E.customer,localStorage.removeItem(P),w.signOut()},j=(e="Not authenticated")=>{const a=new Error(e);throw a.isNoAuth=!0,a},B=async()=>{const e=await w.currentUser?.getIdToken();if(!e){j("Can't get Firebase user ID token");return}const{domain:a}=globalThis.$storefront.settings;try{const t=await fetch(`https://${a}/_api/passport/token`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}});m.auth=await t.json()}catch(t){console.error(t)}},ee=async()=>(v.value||await B(),m.auth?m.auth.access_token:j()),te=async()=>{const e=await ee(),a=m.auth,{data:t}=await l.get(`customers/${a.customer_id}`,{accessToken:e});return m.customer=t,t};let k=!1;const re=e=>{if(k)return;e===void 0&&(e=!window.location.pathname.startsWith("/app/")),k=!0;const a=()=>V(()=>import("./firebase-app.iLdzDVjL.js"),__vite__mapDeps([0,1])).then(({getAuth:t,onAuthStateChanged:i,isSignInWithEmailLink:r,signInWithEmailLink:n})=>{if(w=t(),i(w,async s=>{if(s){if(s.displayName&&!O.value&&(m.customer.display_name=s.displayName),s.email&&(!$.value||s.emailVerified)&&(m.customer.main_email=s.email),s.emailVerified){const o=s.email!==$.value;(o||!v.value)&&(await B(),(o||!O.value)&&await te())}}else Z()}),r(w,window.location.href)){const o=new URLSearchParams(window.location.search).get("email");o&&n(w,o,window.location.href).then(()=>window.localStorage.removeItem(W)).catch(console.error)}}).catch(console.error);e?U(a):a()};export{W as E,V as _,O as a,l as b,R as c,ne as d,re as e,$ as f,v as i,Z as l,m as s,F as u};
|
|
2
|
-
function __vite__mapDeps(indexes) {
|
|
3
|
-
if (!__vite__mapDeps.viteFileDeps) {
|
|
4
|
-
__vite__mapDeps.viteFileDeps = ["_astro/firebase-app.iLdzDVjL.js","_astro/index-bea2a320.eWykogwr.js"]
|
|
5
|
-
}
|
|
6
|
-
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as g}from"./sf-utils.c42cbZ9W.js";import{g as a}from"./name.VA3MEpe0.js";const s=(t,e,i=g.get("lang"))=>{let r;return Array.isArray(e)?r=e.find(o=>o.grid_id===t):console.error("`grids` must be array to get grid title"),r?a(r,i):t},m=s;export{m as g};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as E,s as b,c as p,a as N}from"./customer-session.ZD6tLDQJ.js";import{s as w}from"./shopping-cart.nSNNOrp9.js";import{g as v,e as I}from"./use-analytics.wTmoP8B1.js";import{u as O}from"./afetch.OifQZgwR.js";import"./index.KfrHdfOH.js";import{w as T}from"./sf-utils.c42cbZ9W.js";import"./hoisted.GaT7bmE3.js";import"./server-data.4C60Esyt.js";import"./price.Easct8WC.js";import"./name.VA3MEpe0.js";import"./i18n.zhlBzJt8.js";const R=o=>{let a="";if(typeof o=="object"&&o!==null){let i=Array.isArray(o.phones)?o.phones[0]:o;i&&i.number&&(i.country_code&&(a=`+${i.country_code} `),a+=i.number)}return a},k=R,M=()=>{const o=window.storefrontApp?.router;if(o){const a=()=>sessionStorage.getItem("st_discount_coupon")||void 0,i=s=>Math.round(s*100)/100,h=[],r=(s,t)=>{h.includes(s)||(h.push(s),t||(t={value:i(w.subtotal||0),items:w.items.map(v)}),s!=="view_cart"&&(t.coupon=a(),h.includes("begin_checkout")||r("begin_checkout")),I(s,t))};let g=!1;const m=(s,t)=>{if(!g){if(localStorage.getItem("gtag.orderIdSent")!==s){let _;if(t)try{_=JSON.parse(t)}catch{}const{amount:l}=_||window.storefrontApp,S={transaction_id:s,value:i(l?.total||w.subtotal||0),items:w.items.map(v),coupon:_?_.extra_discount?.discount_coupon:a()};l&&(l.freight!==void 0&&(S.shipping=i(l.freight)),l.tax!==void 0&&(S.tax=i(l.tax)));let A=1;const{dataLayer:y,__sendGTMExtraPurchaseData:P}=window;if(y&&P){const n={};let e;if(p){n.customerDisplayName=N.value;let c=p.value.name;if(!c?.given_name)try{const f=sessionStorage.getItem("ecomCustomerAccount");if(f){const C=JSON.parse(f);typeof C=="object"&&C&&(c=C.name)}}catch{}c&&(n.customerGivenName=c.given_name,n.customerFamilyName=c.family_name),n.customerEmail=p.value.main_email,n.customerPhone=k(p.value),e=p.value.addresses?.[0]}try{const c=sessionStorage.getItem("ecomCustomerAddress");if(c){const f=JSON.parse(c);typeof e=="object"&&e?Object.assign(e,f):e=f}}catch{}e&&e.zip&&(n.shippingAddrZip=e.zip,n.shippingAddrStreet=e.street,n.shippingAddrNumber=e.number,e.street&&e.number&&(n.shippingAddrStreet+=`, ${e.number}`),n.shippingAddrCity=e.city,n.shippingAddrProvinceCode=e.province_code),y.push({event:"purchaseExtraData",...n}),A=100}setTimeout(()=>I("purchase",S),A),localStorage.setItem("gtag.orderIdSent",s)}g=!0}};let u;const d=({name:s,params:t})=>{switch(s){case"cart":r("view_cart");break;case"checkout":t.step?Number(t.step)===1?r("add_shipping_info"):Number(t.step)===2&&r("add_payment_info"):r("begin_checkout");break;case"confirmation":clearTimeout(u),t.json?m(t.id,decodeURIComponent(t.json)):u=setTimeout(()=>{m(t.id)},1500);break}};o.currentRoute&&d(o.currentRoute),o.afterEach(d)}};{Object.keys(O).length&&sessionStorage.setItem("ecomUtm",JSON.stringify(O));let o=window.location.search;!o&&window.location.hash&&(o="?"+window.location.hash.split("?")[1]);const a=new URLSearchParams(o);a.get("product_id")&&a.get("quantity")==="1"&&(localStorage.setItem("ecomShoppingCart__tmp",JSON.stringify({items:[{product_id:a.get("product_id"),variation_id:a.get("variation_id")||void 0,quantity:1}]})),window.ECOM_CART_STORAGE_KEY="ecomShoppingCart__tmp");const{hostname:i}=window.location,{domain:h}=globalThis.$storefront.settings,r=`https://ecomplus.io/v2/:${window.ECOM_STORE_ID}/`;window.ECOMCLIENT_API_STORE=r,window.ECOMCLIENT_API_STORE_CACHE=r,window.ECOMCLIENT_API_PASSPORT=r,window.ECOMCLIENT_API_SEARCH=`${r}/search/_els/`,window.ECOMCLIENT_API_MODULES=["localhost","127.0.0.1"].includes(i)?`https://${h}/_api/modules/`:"/_api/modules/";const g=()=>{const{ecomPassport:u}=window;T(E,async()=>{E.value?u.setSession({auth:{...b.auth,id:b.auth?.customer_id,level:3},customer:p.value}):u.checkLogin()&&u.logout()},{immediate:!0}),T(p,d=>{(d.display_name||d.main_email)&&u.setCustomer(d)},{immediate:!0}),setTimeout(M,400)},m=document.createElement("script");m.src="https://cdn.jsdelivr.net/npm/@ecomplus/storefront-app@2.0.0-beta.190/dist/lib/js/app.js",m.onload=g,document.body.appendChild(m)}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./hoisted.GaT7bmE3.js";import"./afetch.OifQZgwR.js";import"./use-analytics.wTmoP8B1.js";import"./customer-session.ZD6tLDQJ.js";import"./server-data.4C60Esyt.js";import"./sf-utils.c42cbZ9W.js";import"./index.KfrHdfOH.js";import"./shopping-cart.nSNNOrp9.js";import"./price.Easct8WC.js";import"./name.VA3MEpe0.js";import"./i18n.zhlBzJt8.js";const t=window.location.search.includes("status=404")?"404Msg":"5xxMsg";document.getElementById(t).style.display="block";document.getElementById("loadingMsg").style.display="none";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as n,_ as o}from"./sf-utils.c42cbZ9W.js";const t=(e,f=o.get("lang"))=>{if(typeof e=="object"&&e!==null){const p=Object.keys(e)[0];if(/^[a-z]{2}(_[a-z]{2})?$/.test(p))return e[f]||e[n]||e[p];{const r=Array.isArray(e)?[]:{};for(const s in e)e[s]!==void 0&&(r[s]=t(e[s],f));return r}}return e},u=t;export{u as i};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const h=t=>{let s={width:0,height:0},e;return typeof t=="object"&&t!==null?e=t.size:e=t,typeof e=="string"&&e.split("x").forEach((i,o)=>{i=parseFloat(i),isNaN(i)||(s[o===0?"width":"height"]=i)}),s},r=h;export{r as g};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as n}from"./sf-utils.c42cbZ9W.js";const m=(l,f,o)=>{if(o||(o=n.get("default_img_size")||"normal"),l){let{pictures:a,picture:e}=l;e||a||(Array.isArray(l)?a=l:e=l),Array.isArray(a)&&(e=f&&a.filter(r=>r._id===f)[0]||a[0]);let s;if(typeof e=="object"&&e!==null){if(s=e[o],s&&s.url)return s;let r;switch(o){case"small":r=["normal","big"];break;case"normal":r=["big","zoom","small"];break;case"big":r=["zoom","normal"];break;case"zoom":r=["big"];break;default:r=["big","zoom","normal","small"]}for(let i=0;i<r.length;i++){const t=r[i];if(e[t]&&e[t].url)return e[t]}for(const i in e)if(e[i]&&e[i].url)return e[i]}}},b=m;export{b as g};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{E as D,_ as C,w as b,F as T,G as A,a as y,H as F,c as W,I as _,J as I,K as k,L as M}from"./sf-utils.c42cbZ9W.js";D.$ecomConfig||C;function E(e){return k()?(M(e),!0):!1}function $(e,t){if(typeof Symbol<"u"){const n={...e};return Object.defineProperty(n,Symbol.iterator,{enumerable:!1,value(){let o=0;return{next:()=>({value:t[o++],done:o>t.length})}}}),n}else return Object.assign([...t],e)}function m(e){return typeof e=="function"?e():A(e)}const O=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const G=Object.prototype.toString,q=e=>G.call(e)==="[object Object]",l=()=>{},B=L();function L(){var e,t;return O&&((e=window?.navigator)==null?void 0:e.userAgent)&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||((t=window?.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function v(e,t){function n(...o){return new Promise((i,r)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(i).catch(r)})}return n}const P=e=>e();function x(e,t={}){let n,o,i=l;const r=s=>{clearTimeout(s),i(),i=l};return s=>{const u=m(e),c=m(t.maxWait);return n&&r(n),u<=0||c!==void 0&&c<=0?(o&&(r(o),o=null),Promise.resolve(s())):new Promise((f,p)=>{i=t.rejectOnCancel?p:f,c&&!o&&(o=setTimeout(()=>{n&&r(n),o=null,f(s())},c)),n=setTimeout(()=>{o&&r(o),o=null,f(s())},u)})}}function R(e,t=!0,n=!0,o=!1){let i=0,r,a=!0,s=l,u;const c=()=>{r&&(clearTimeout(r),r=void 0,s(),s=l)};return p=>{const d=m(e),h=Date.now()-i,w=()=>u=p();return c(),d<=0?(i=Date.now(),w()):(h>d&&(n||!a)?(i=Date.now(),w()):t&&(u=new Promise((g,j)=>{s=o?j:g,r=setTimeout(()=>{i=Date.now(),a=!0,g(w()),c()},Math.max(0,d-h))})),!n&&!r&&(r=setTimeout(()=>a=!0,d)),a=!1,u)}}function z(e=P){const t=y(!0);function n(){t.value=!1}function o(){t.value=!0}const i=(...r)=>{t.value&&e(...r)};return{isActive:F(t),pause:n,resume:o,eventFilter:i}}function V(e){const t=Object.create(null);return n=>t[n]||(t[n]=e(n))}const H=/-(\w)/g,N=V(e=>e.replace(H,(t,n)=>n?n.toUpperCase():""));function Q(e,t=!1,n="Timeout"){return new Promise((o,i)=>{setTimeout(t?()=>i(n):o,e)})}function J(e){return e||I()}function X(e,t=200,n={}){return v(x(t,n),e)}function Y(e,t=200,n=!1,o=!0,i=!1){return v(R(t,n,o,i),e)}function S(e,t,n={}){const{eventFilter:o=P,...i}=n;return b(e,v(o,t),i)}function Z(e,t,n={}){const{eventFilter:o,...i}=n,{eventFilter:r,pause:a,resume:s,isActive:u}=z(o);return{stop:S(e,t,{...i,eventFilter:r}),pause:a,resume:s,isActive:u}}function ee(e,t=!0,n){J()?_(e,n):t?e():T(e)}function K(e,t,n={}){const{immediate:o=!0}=n,i=y(!1);let r=null;function a(){r&&(clearTimeout(r),r=null)}function s(){i.value=!1,a()}function u(...c){a(),i.value=!0,r=setTimeout(()=>{i.value=!1,r=null,e(...c)},m(t))}return o&&(i.value=!0,O&&u()),E(s),{isPending:F(i),start:u,stop:s}}function te(e=1e3,t={}){const{controls:n=!1,callback:o}=t,i=K(o??l,e,t),r=W(()=>!i.isPending.value);return n?{ready:r,...i}:r}function ne(e,t,n={}){const{debounce:o=0,maxWait:i=void 0,...r}=n;return S(e,t,{...r,eventFilter:x(o,{maxWait:i})})}function oe(e,t,n){const o=b(e,(...i)=>(T(()=>o()),t(...i)),n);return o}export{q as a,Y as b,N as c,ee as d,B as e,E as f,oe as g,ne as h,O as i,te as j,$ as m,l as n,Q as p,m as t,X as u,Z as w};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{m as N,w as X,i as q,n as $,a as z,t as _,c as B,u as Q,b as Y,d as G,e as J,f as Z}from"./index.KfrHdfOH.js";import{s as ee,r as D,w as te,d as W,a as C,c as j}from"./sf-utils.c42cbZ9W.js";function re(t={}){const{inheritAttrs:u=!0}=t,o=ee(),r=W({setup(p,{slots:e}){return()=>{o.value=e.default}}}),b=W({inheritAttrs:u,setup(p,{attrs:e,slots:i}){return()=>{var v;o.value;const f=(v=o.value)==null?void 0:v.call(o,{...oe(e),$slots:i});return u&&f?.length===1?f[0]:f}}});return N({define:r,reuse:b},[r,b])}function oe(t){const u={};for(const o in t)u[B(o)]=t[o];return u}function k(t){var u;const o=_(t);return(u=o?.$el)!=null?u:o}const R=q?window:void 0;function A(...t){let u,o,r,b;if(typeof t[0]=="string"||Array.isArray(t[0])?([o,r,b]=t,u=R):[u,o,r,b]=t,!u)return $;Array.isArray(o)||(o=[o]),Array.isArray(r)||(r=[r]);const p=[],e=()=>{p.forEach(h=>h()),p.length=0},i=(h,y,n,c)=>(h.addEventListener(y,n,c),()=>h.removeEventListener(y,n,c)),v=te(()=>[k(u),_(b)],([h,y])=>{if(e(),!h)return;const n=z(y)?{...y}:y;p.push(...o.flatMap(c=>r.map(m=>i(h,c,m,n))))},{immediate:!0,flush:"post"}),f=()=>{v(),e()};return Z(f),f}let U=!1;function le(t,u,o={}){const{window:r=R,ignore:b=[],capture:p=!0,detectIframe:e=!1}=o;if(!r)return $;J&&!U&&(U=!0,Array.from(r.document.body.children).forEach(n=>n.addEventListener("click",$)),r.document.documentElement.addEventListener("click",$));let i=!0;const v=n=>b.some(c=>{if(typeof c=="string")return Array.from(r.document.querySelectorAll(c)).some(m=>m===n.target||n.composedPath().includes(m));{const m=k(c);return m&&(n.target===m||n.composedPath().includes(m))}}),h=[A(r,"click",n=>{const c=k(t);if(!(!c||c===n.target||n.composedPath().includes(c))){if(n.detail===0&&(i=!v(n)),!i){i=!0;return}u(n)}},{passive:!0,capture:p}),A(r,"pointerdown",n=>{const c=k(t);i=!v(n)&&!!(c&&!n.composedPath().includes(c))},{passive:!0}),e&&A(r,"blur",n=>{setTimeout(()=>{var c;const m=k(t);((c=r.document.activeElement)==null?void 0:c.tagName)==="IFRAME"&&!m?.contains(r.document.activeElement)&&u(n)},0)})].filter(Boolean);return()=>h.forEach(n=>n())}function ae(t,u={}){const{delayEnter:o=0,delayLeave:r=0,window:b=R}=u,p=C(!1);let e;const i=v=>{const f=v?o:r;e&&(clearTimeout(e),e=void 0),f?e=setTimeout(()=>p.value=v,f):p.value=v};return b&&(A(t,"mouseenter",()=>i(!0),{passive:!0}),A(t,"mouseleave",()=>i(!1),{passive:!0})),p}const K=1;function ie(t,u={}){const{throttle:o=0,idle:r=200,onStop:b=$,onScroll:p=$,offset:e={left:0,right:0,top:0,bottom:0},eventListenerOptions:i={capture:!1,passive:!0},behavior:v="auto",window:f=R}=u,h=C(0),y=C(0),n=j({get(){return h.value},set(a){m(a,void 0)}}),c=j({get(){return y.value},set(a){m(void 0,a)}});function m(a,L){var E,x,P;if(!f)return;const S=_(t);S&&((P=S instanceof Document?f.document.body:S)==null||P.scrollTo({top:(E=_(L))!=null?E:c.value,left:(x=_(a))!=null?x:n.value,behavior:_(v)}))}const T=C(!1),w=D({left:!0,right:!1,top:!0,bottom:!1}),s=D({left:!1,right:!1,top:!1,bottom:!1}),l=a=>{T.value&&(T.value=!1,s.left=!1,s.right=!1,s.top=!1,s.bottom=!1,b(a))},d=Q(l,o+r),g=a=>{var L;if(!f)return;const E=a.document?a.document.documentElement:(L=a.documentElement)!=null?L:a,{display:x,flexDirection:P}=getComputedStyle(E),S=E.scrollLeft;s.left=S<h.value,s.right=S>h.value;const M=Math.abs(S)<=0+(e.left||0),F=Math.abs(S)+E.clientWidth>=E.scrollWidth-(e.right||0)-K;x==="flex"&&P==="row-reverse"?(w.left=F,w.right=M):(w.left=M,w.right=F),h.value=S;let O=E.scrollTop;a===f.document&&!O&&(O=f.document.body.scrollTop),s.top=O<y.value,s.bottom=O>y.value;const I=Math.abs(O)<=0+(e.top||0),V=Math.abs(O)+E.clientHeight>=E.scrollHeight-(e.bottom||0)-K;x==="flex"&&P==="column-reverse"?(w.top=V,w.bottom=I):(w.top=I,w.bottom=V),y.value=O},H=a=>{var L;if(!f)return;const E=(L=a.target.documentElement)!=null?L:a.target;g(E),T.value=!0,d(a),p(a)};return A(t,"scroll",o?Y(H,o,!0,!1):H,i),G(()=>{const a=_(t);a&&g(a)}),A(t,"scrollend",l,i),{x:n,y:c,isScrolling:T,arrivedState:w,directions:s,measure(){const a=_(t);f&&a&&g(a)}}}function ce(t="history",u={}){const{initialValue:o={},removeNullishValues:r=!0,removeFalsyValues:b=!1,write:p=!0,window:e=R}=u;if(!e)return D(o);const i=D({});function v(){if(t==="history")return e.location.search||"";if(t==="hash"){const s=e.location.hash||"",l=s.indexOf("?");return l>0?s.slice(l):""}else return(e.location.hash||"").replace(/^#/,"")}function f(s){const l=s.toString();if(t==="history")return`${l?`?${l}`:""}${e.location.hash||""}`;if(t==="hash-params")return`${e.location.search||""}${l?`#${l}`:""}`;const d=e.location.hash||"#",g=d.indexOf("?");return g>0?`${d.slice(0,g)}${l?`?${l}`:""}`:`${d}${l?`?${l}`:""}`}function h(){return new URLSearchParams(v())}function y(s){const l=new Set(Object.keys(i));for(const d of s.keys()){const g=s.getAll(d);i[d]=g.length>1?g:s.get(d)||"",l.delete(d)}Array.from(l).forEach(d=>delete i[d])}const{pause:n,resume:c}=X(i,()=>{const s=new URLSearchParams("");Object.keys(i).forEach(l=>{const d=i[l];Array.isArray(d)?d.forEach(g=>s.append(l,g)):r&&d==null||b&&!d?s.delete(l):s.set(l,d)}),m(s)},{deep:!0});function m(s,l){n(),l&&y(s),e.history.replaceState(e.history.state,e.document.title,e.location.pathname+f(s)),c()}function T(){p&&m(h(),!0)}A(e,"popstate",T,!1),t!=="history"&&A(e,"hashchange",T,!1);const w=h();return w.keys().next().value?y(w):Object.assign(i,o),i}export{ie as a,ae as b,re as c,le as o,ce as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as t}from"./sf-utils.c42cbZ9W.js";import{i as n}from"./i18n.zhlBzJt8.js";const r=(e,i=t.get("lang"))=>i&&e.i18n&&e.i18n[i]?e.i18n[i]:e.name||e.title||n(e.i18n,i)||"",a=r;export{a as g};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* PhotoSwipe 5.4.3 - https://photoswipe.com
|
|
3
|
-
* (c) 2023 Dmytro Semenov
|
|
4
|
-
*/function f(r,t,i){const e=document.createElement(t);return r&&(e.className=r),i&&i.appendChild(e),e}function p(r,t){return r.x=t.x,r.y=t.y,t.id!==void 0&&(r.id=t.id),r}function M(r){r.x=Math.round(r.x),r.y=Math.round(r.y)}function A(r,t){const i=Math.abs(r.x-t.x),e=Math.abs(r.y-t.y);return Math.sqrt(i*i+e*e)}function x(r,t){return r.x===t.x&&r.y===t.y}function I(r,t,i){return Math.min(Math.max(r,t),i)}function b(r,t,i){let e=`translate3d(${r}px,${t||0}px,0)`;return i!==void 0&&(e+=` scale3d(${i},${i},1)`),e}function y(r,t,i,e){r.style.transform=b(t,i,e)}const $="cubic-bezier(.4,0,.22,1)";function R(r,t,i,e){r.style.transition=t?`${t} ${i}ms ${e||$}`:"none"}function L(r,t,i){r.style.width=typeof t=="number"?`${t}px`:t,r.style.height=typeof i=="number"?`${i}px`:i}function U(r){R(r)}function q(r){return"decode"in r?r.decode().catch(()=>{}):r.complete?Promise.resolve(r):new Promise((t,i)=>{r.onload=()=>t(r),r.onerror=i})}const _={IDLE:"idle",LOADING:"loading",LOADED:"loaded",ERROR:"error"};function G(r){return"button"in r&&r.button===1||r.ctrlKey||r.metaKey||r.altKey||r.shiftKey}function K(r,t,i=document){let e=[];if(r instanceof Element)e=[r];else if(r instanceof NodeList||Array.isArray(r))e=Array.from(r);else{const s=typeof r=="string"?r:t;s&&(e=Array.from(i.querySelectorAll(s)))}return e}function C(){return!!(navigator.vendor&&navigator.vendor.match(/apple/i))}let F=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>{F=!0}}))}catch{}class X{constructor(){this._pool=[]}add(t,i,e,s){this._toggleListener(t,i,e,s)}remove(t,i,e,s){this._toggleListener(t,i,e,s,!0)}removeAll(){this._pool.forEach(t=>{this._toggleListener(t.target,t.type,t.listener,t.passive,!0,!0)}),this._pool=[]}_toggleListener(t,i,e,s,n,o){if(!t)return;const a=n?"removeEventListener":"addEventListener";i.split(" ").forEach(l=>{if(l){o||(n?this._pool=this._pool.filter(d=>d.type!==l||d.listener!==e||d.target!==t):this._pool.push({target:t,type:l,listener:e,passive:s}));const c=F?{passive:s||!1}:!1;t[a](l,e,c)}})}}function B(r,t){if(r.getViewportSizeFn){const i=r.getViewportSizeFn(r,t);if(i)return i}return{x:document.documentElement.clientWidth,y:window.innerHeight}}function S(r,t,i,e,s){let n=0;if(t.paddingFn)n=t.paddingFn(i,e,s)[r];else if(t.padding)n=t.padding[r];else{const o="padding"+r[0].toUpperCase()+r.slice(1);t[o]&&(n=t[o])}return Number(n)||0}function N(r,t,i,e){return{x:t.x-S("left",r,t,i,e)-S("right",r,t,i,e),y:t.y-S("top",r,t,i,e)-S("bottom",r,t,i,e)}}class Y{constructor(t){this.slide=t,this.currZoomLevel=1,this.center={x:0,y:0},this.max={x:0,y:0},this.min={x:0,y:0}}update(t){this.currZoomLevel=t,this.slide.width?(this._updateAxis("x"),this._updateAxis("y"),this.slide.pswp.dispatch("calcBounds",{slide:this.slide})):this.reset()}_updateAxis(t){const{pswp:i}=this.slide,e=this.slide[t==="x"?"width":"height"]*this.currZoomLevel,n=S(t==="x"?"left":"top",i.options,i.viewportSize,this.slide.data,this.slide.index),o=this.slide.panAreaSize[t];this.center[t]=Math.round((o-e)/2)+n,this.max[t]=e>o?Math.round(o-e)+n:this.center[t],this.min[t]=e>o?n:this.center[t]}reset(){this.center.x=0,this.center.y=0,this.max.x=0,this.max.y=0,this.min.x=0,this.min.y=0}correctPan(t,i){return I(i,this.max[t],this.min[t])}}const T=4e3;class k{constructor(t,i,e,s){this.pswp=s,this.options=t,this.itemData=i,this.index=e,this.panAreaSize=null,this.elementSize=null,this.fit=1,this.fill=1,this.vFill=1,this.initial=1,this.secondary=1,this.max=1,this.min=1}update(t,i,e){const s={x:t,y:i};this.elementSize=s,this.panAreaSize=e;const n=e.x/s.x,o=e.y/s.y;this.fit=Math.min(1,n<o?n:o),this.fill=Math.min(1,n>o?n:o),this.vFill=Math.min(1,o),this.initial=this._getInitial(),this.secondary=this._getSecondary(),this.max=Math.max(this.initial,this.secondary,this._getMax()),this.min=Math.min(this.fit,this.initial,this.secondary),this.pswp&&this.pswp.dispatch("zoomLevelsUpdate",{zoomLevels:this,slideData:this.itemData})}_parseZoomLevelOption(t){const i=t+"ZoomLevel",e=this.options[i];if(e)return typeof e=="function"?e(this):e==="fill"?this.fill:e==="fit"?this.fit:Number(e)}_getSecondary(){let t=this._parseZoomLevelOption("secondary");return t||(t=Math.min(1,this.fit*3),this.elementSize&&t*this.elementSize.x>T&&(t=T/this.elementSize.x),t)}_getInitial(){return this._parseZoomLevelOption("initial")||this.fit}_getMax(){return this._parseZoomLevelOption("max")||Math.max(1,this.fit*4)}}class j{constructor(t,i,e){this.data=t,this.index=i,this.pswp=e,this.isActive=i===e.currIndex,this.currentResolution=0,this.panAreaSize={x:0,y:0},this.pan={x:0,y:0},this.isFirstSlide=this.isActive&&!e.opener.isOpen,this.zoomLevels=new k(e.options,t,i,e),this.pswp.dispatch("gettingData",{slide:this,data:this.data,index:i}),this.content=this.pswp.contentLoader.getContentBySlide(this),this.container=f("pswp__zoom-wrap","div"),this.holderElement=null,this.currZoomLevel=1,this.width=this.content.width,this.height=this.content.height,this.heavyAppended=!1,this.bounds=new Y(this),this.prevDisplayedWidth=-1,this.prevDisplayedHeight=-1,this.pswp.dispatch("slideInit",{slide:this})}setIsActive(t){t&&!this.isActive?this.activate():!t&&this.isActive&&this.deactivate()}append(t){this.holderElement=t,this.container.style.transformOrigin="0 0",this.data&&(this.calculateSize(),this.load(),this.updateContentSize(),this.appendHeavy(),this.holderElement.appendChild(this.container),this.zoomAndPanToInitial(),this.pswp.dispatch("firstZoomPan",{slide:this}),this.applyCurrentZoomPan(),this.pswp.dispatch("afterSetContent",{slide:this}),this.isActive&&this.activate())}load(){this.content.load(!1),this.pswp.dispatch("slideLoad",{slide:this})}appendHeavy(){const{pswp:t}=this,i=!0;this.heavyAppended||!t.opener.isOpen||t.mainScroll.isShifted()||!this.isActive&&!i||this.pswp.dispatch("appendHeavy",{slide:this}).defaultPrevented||(this.heavyAppended=!0,this.content.append(),this.pswp.dispatch("appendHeavyContent",{slide:this}))}activate(){this.isActive=!0,this.appendHeavy(),this.content.activate(),this.pswp.dispatch("slideActivate",{slide:this})}deactivate(){this.isActive=!1,this.content.deactivate(),this.currZoomLevel!==this.zoomLevels.initial&&this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize(),this.pswp.dispatch("slideDeactivate",{slide:this})}destroy(){this.content.hasSlide=!1,this.content.remove(),this.container.remove(),this.pswp.dispatch("slideDestroy",{slide:this})}resize(){this.currZoomLevel===this.zoomLevels.initial||!this.isActive?(this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize()):(this.calculateSize(),this.bounds.update(this.currZoomLevel),this.panTo(this.pan.x,this.pan.y))}updateContentSize(t){const i=this.currentResolution||this.zoomLevels.initial;if(!i)return;const e=Math.round(this.width*i)||this.pswp.viewportSize.x,s=Math.round(this.height*i)||this.pswp.viewportSize.y;!this.sizeChanged(e,s)&&!t||this.content.setDisplayedSize(e,s)}sizeChanged(t,i){return t!==this.prevDisplayedWidth||i!==this.prevDisplayedHeight?(this.prevDisplayedWidth=t,this.prevDisplayedHeight=i,!0):!1}getPlaceholderElement(){var t;return(t=this.content.placeholder)===null||t===void 0?void 0:t.element}zoomTo(t,i,e,s){const{pswp:n}=this;if(!this.isZoomable()||n.mainScroll.isShifted())return;n.dispatch("beforeZoomTo",{destZoomLevel:t,centerPoint:i,transitionDuration:e}),n.animations.stopAllPan();const o=this.currZoomLevel;s||(t=I(t,this.zoomLevels.min,this.zoomLevels.max)),this.setZoomLevel(t),this.pan.x=this.calculateZoomToPanOffset("x",i,o),this.pan.y=this.calculateZoomToPanOffset("y",i,o),M(this.pan);const a=()=>{this._setResolution(t),this.applyCurrentZoomPan()};e?n.animations.startTransition({isPan:!0,name:"zoomTo",target:this.container,transform:this.getCurrentTransform(),onComplete:a,duration:e,easing:n.options.easing}):a()}toggleZoom(t){this.zoomTo(this.currZoomLevel===this.zoomLevels.initial?this.zoomLevels.secondary:this.zoomLevels.initial,t,this.pswp.options.zoomAnimationDuration)}setZoomLevel(t){this.currZoomLevel=t,this.bounds.update(this.currZoomLevel)}calculateZoomToPanOffset(t,i,e){if(this.bounds.max[t]-this.bounds.min[t]===0)return this.bounds.center[t];i||(i=this.pswp.getViewportCenterPoint()),e||(e=this.zoomLevels.initial);const n=this.currZoomLevel/e;return this.bounds.correctPan(t,(this.pan[t]-i[t])*n+i[t])}panTo(t,i){this.pan.x=this.bounds.correctPan("x",t),this.pan.y=this.bounds.correctPan("y",i),this.applyCurrentZoomPan()}isPannable(){return!!this.width&&this.currZoomLevel>this.zoomLevels.fit}isZoomable(){return!!this.width&&this.content.isZoomable()}applyCurrentZoomPan(){this._applyZoomTransform(this.pan.x,this.pan.y,this.currZoomLevel),this===this.pswp.currSlide&&this.pswp.dispatch("zoomPanUpdate",{slide:this})}zoomAndPanToInitial(){this.currZoomLevel=this.zoomLevels.initial,this.bounds.update(this.currZoomLevel),p(this.pan,this.bounds.center),this.pswp.dispatch("initialZoomPan",{slide:this})}_applyZoomTransform(t,i,e){e/=this.currentResolution||this.zoomLevels.initial,y(this.container,t,i,e)}calculateSize(){const{pswp:t}=this;p(this.panAreaSize,N(t.options,t.viewportSize,this.data,this.index)),this.zoomLevels.update(this.width,this.height,this.panAreaSize),t.dispatch("calcSlideSize",{slide:this})}getCurrentTransform(){const t=this.currZoomLevel/(this.currentResolution||this.zoomLevels.initial);return b(this.pan.x,this.pan.y,t)}_setResolution(t){t!==this.currentResolution&&(this.currentResolution=t,this.updateContentSize(),this.pswp.dispatch("resolutionChanged"))}}const Q=.35,J=.6,z=.4,E=.5;function tt(r,t){return r*t/(1-t)}class it{constructor(t){this.gestures=t,this.pswp=t.pswp,this.startPan={x:0,y:0}}start(){this.pswp.currSlide&&p(this.startPan,this.pswp.currSlide.pan),this.pswp.animations.stopAll()}change(){const{p1:t,prevP1:i,dragAxis:e}=this.gestures,{currSlide:s}=this.pswp;if(e==="y"&&this.pswp.options.closeOnVerticalDrag&&s&&s.currZoomLevel<=s.zoomLevels.fit&&!this.gestures.isMultitouch){const n=s.pan.y+(t.y-i.y);if(!this.pswp.dispatch("verticalDrag",{panY:n}).defaultPrevented){this._setPanWithFriction("y",n,J);const o=1-Math.abs(this._getVerticalDragRatio(s.pan.y));this.pswp.applyBgOpacity(o),s.applyCurrentZoomPan()}}else this._panOrMoveMainScroll("x")||(this._panOrMoveMainScroll("y"),s&&(M(s.pan),s.applyCurrentZoomPan()))}end(){const{velocity:t}=this.gestures,{mainScroll:i,currSlide:e}=this.pswp;let s=0;if(this.pswp.animations.stopAll(),i.isShifted()){const o=(i.x-i.getCurrSlideX())/this.pswp.viewportSize.x;t.x<-E&&o<0||t.x<.1&&o<-.5?(s=1,t.x=Math.min(t.x,0)):(t.x>E&&o>0||t.x>-.1&&o>.5)&&(s=-1,t.x=Math.max(t.x,0)),i.moveIndexBy(s,!0,t.x)}e&&e.currZoomLevel>e.zoomLevels.max||this.gestures.isMultitouch?this.gestures.zoomLevels.correctZoomPan(!0):(this._finishPanGestureForAxis("x"),this._finishPanGestureForAxis("y"))}_finishPanGestureForAxis(t){const{velocity:i}=this.gestures,{currSlide:e}=this.pswp;if(!e)return;const{pan:s,bounds:n}=e,o=s[t],a=this.pswp.bgOpacity<1&&t==="y",h=.995,l=o+tt(i[t],h);if(a){const v=this._getVerticalDragRatio(o),w=this._getVerticalDragRatio(l);if(v<0&&w<-z||v>0&&w>z){this.pswp.close();return}}const c=n.correctPan(t,l);if(o===c)return;const d=c===l?1:.82,u=this.pswp.bgOpacity,m=c-o;this.pswp.animations.startSpring({name:"panGesture"+t,isPan:!0,start:o,end:c,velocity:i[t],dampingRatio:d,onUpdate:v=>{if(a&&this.pswp.bgOpacity<1){const w=1-(c-v)/m;this.pswp.applyBgOpacity(I(u+(1-u)*w,0,1))}s[t]=Math.floor(v),e.applyCurrentZoomPan()}})}_panOrMoveMainScroll(t){const{p1:i,dragAxis:e,prevP1:s,isMultitouch:n}=this.gestures,{currSlide:o,mainScroll:a}=this.pswp,h=i[t]-s[t],l=a.x+h;if(!h||!o)return!1;if(t==="x"&&!o.isPannable()&&!n)return a.moveTo(l,!0),!0;const{bounds:c}=o,d=o.pan[t]+h;if(this.pswp.options.allowPanToNext&&e==="x"&&t==="x"&&!n){const u=a.getCurrSlideX(),m=a.x-u,v=h>0,w=!v;if(d>c.min[t]&&v){if(c.min[t]<=this.startPan[t])return a.moveTo(l,!0),!0;this._setPanWithFriction(t,d)}else if(d<c.max[t]&&w){if(this.startPan[t]<=c.max[t])return a.moveTo(l,!0),!0;this._setPanWithFriction(t,d)}else if(m!==0){if(m>0)return a.moveTo(Math.max(l,u),!0),!0;if(m<0)return a.moveTo(Math.min(l,u),!0),!0}else this._setPanWithFriction(t,d)}else t==="y"?!a.isShifted()&&c.min.y!==c.max.y&&this._setPanWithFriction(t,d):this._setPanWithFriction(t,d);return!1}_getVerticalDragRatio(t){var i,e;return(t-((i=(e=this.pswp.currSlide)===null||e===void 0?void 0:e.bounds.center.y)!==null&&i!==void 0?i:0))/(this.pswp.viewportSize.y/3)}_setPanWithFriction(t,i,e){const{currSlide:s}=this.pswp;if(!s)return;const{pan:n,bounds:o}=s;if(o.correctPan(t,i)!==i||e){const h=Math.round(i-n[t]);n[t]+=h*(e||Q)}else n[t]=i}}const et=.05,st=.15;function O(r,t,i){return r.x=(t.x+i.x)/2,r.y=(t.y+i.y)/2,r}class nt{constructor(t){this.gestures=t,this._startPan={x:0,y:0},this._startZoomPoint={x:0,y:0},this._zoomPoint={x:0,y:0},this._wasOverFitZoomLevel=!1,this._startZoomLevel=1}start(){const{currSlide:t}=this.gestures.pswp;t&&(this._startZoomLevel=t.currZoomLevel,p(this._startPan,t.pan)),this.gestures.pswp.animations.stopAllPan(),this._wasOverFitZoomLevel=!1}change(){const{p1:t,startP1:i,p2:e,startP2:s,pswp:n}=this.gestures,{currSlide:o}=n;if(!o)return;const a=o.zoomLevels.min,h=o.zoomLevels.max;if(!o.isZoomable()||n.mainScroll.isShifted())return;O(this._startZoomPoint,i,s),O(this._zoomPoint,t,e);let l=1/A(i,s)*A(t,e)*this._startZoomLevel;if(l>o.zoomLevels.initial+o.zoomLevels.initial/15&&(this._wasOverFitZoomLevel=!0),l<a)if(n.options.pinchToClose&&!this._wasOverFitZoomLevel&&this._startZoomLevel<=o.zoomLevels.initial){const c=1-(a-l)/(a/1.2);n.dispatch("pinchClose",{bgOpacity:c}).defaultPrevented||n.applyBgOpacity(c)}else l=a-(a-l)*st;else l>h&&(l=h+(l-h)*et);o.pan.x=this._calculatePanForZoomLevel("x",l),o.pan.y=this._calculatePanForZoomLevel("y",l),o.setZoomLevel(l),o.applyCurrentZoomPan()}end(){const{pswp:t}=this.gestures,{currSlide:i}=t;(!i||i.currZoomLevel<i.zoomLevels.initial)&&!this._wasOverFitZoomLevel&&t.options.pinchToClose?t.close():this.correctZoomPan()}_calculatePanForZoomLevel(t,i){const e=i/this._startZoomLevel;return this._zoomPoint[t]-(this._startZoomPoint[t]-this._startPan[t])*e}correctZoomPan(t){const{pswp:i}=this.gestures,{currSlide:e}=i;if(!(e!=null&&e.isZoomable()))return;this._zoomPoint.x===0&&(t=!0);const s=e.currZoomLevel;let n,o=!0;s<e.zoomLevels.initial?n=e.zoomLevels.initial:s>e.zoomLevels.max?n=e.zoomLevels.max:(o=!1,n=s);const a=i.bgOpacity,h=i.bgOpacity<1,l=p({x:0,y:0},e.pan);let c=p({x:0,y:0},l);t&&(this._zoomPoint.x=0,this._zoomPoint.y=0,this._startZoomPoint.x=0,this._startZoomPoint.y=0,this._startZoomLevel=s,p(this._startPan,l)),o&&(c={x:this._calculatePanForZoomLevel("x",n),y:this._calculatePanForZoomLevel("y",n)}),e.setZoomLevel(n),c={x:e.bounds.correctPan("x",c.x),y:e.bounds.correctPan("y",c.y)},e.setZoomLevel(s);const d=!x(c,l);if(!d&&!o&&!h){e._setResolution(n),e.applyCurrentZoomPan();return}i.animations.stopAllPan(),i.animations.startSpring({isPan:!0,start:0,end:1e3,velocity:0,dampingRatio:1,naturalFrequency:40,onUpdate:u=>{if(u/=1e3,d||o){if(d&&(e.pan.x=l.x+(c.x-l.x)*u,e.pan.y=l.y+(c.y-l.y)*u),o){const m=s+(n-s)*u;e.setZoomLevel(m)}e.applyCurrentZoomPan()}h&&i.bgOpacity<1&&i.applyBgOpacity(I(a+(1-a)*u,0,1))},onComplete:()=>{e._setResolution(n),e.applyCurrentZoomPan()}})}}function Z(r){return!!r.target.closest(".pswp__container")}class ot{constructor(t){this.gestures=t}click(t,i){const e=i.target.classList,s=e.contains("pswp__img"),n=e.contains("pswp__item")||e.contains("pswp__zoom-wrap");s?this._doClickOrTapAction("imageClick",t,i):n&&this._doClickOrTapAction("bgClick",t,i)}tap(t,i){Z(i)&&this._doClickOrTapAction("tap",t,i)}doubleTap(t,i){Z(i)&&this._doClickOrTapAction("doubleTap",t,i)}_doClickOrTapAction(t,i,e){var s;const{pswp:n}=this.gestures,{currSlide:o}=n,a=t+"Action",h=n.options[a];if(!n.dispatch(a,{point:i,originalEvent:e}).defaultPrevented){if(typeof h=="function"){h.call(n,i,e);return}switch(h){case"close":case"next":n[h]();break;case"zoom":o?.toggleZoom(i);break;case"zoom-or-close":o!=null&&o.isZoomable()&&o.zoomLevels.secondary!==o.zoomLevels.initial?o.toggleZoom(i):n.options.clickToCloseNonZoomable&&n.close();break;case"toggle-controls":(s=this.gestures.pswp.element)===null||s===void 0||s.classList.toggle("pswp--ui-visible");break}}}}const rt=10,at=300,ht=25;class lt{constructor(t){this.pswp=t,this.dragAxis=null,this.p1={x:0,y:0},this.p2={x:0,y:0},this.prevP1={x:0,y:0},this.prevP2={x:0,y:0},this.startP1={x:0,y:0},this.startP2={x:0,y:0},this.velocity={x:0,y:0},this._lastStartP1={x:0,y:0},this._intervalP1={x:0,y:0},this._numActivePoints=0,this._ongoingPointers=[],this._touchEventEnabled="ontouchstart"in window,this._pointerEventEnabled=!!window.PointerEvent,this.supportsTouch=this._touchEventEnabled||this._pointerEventEnabled&&navigator.maxTouchPoints>1,this._numActivePoints=0,this._intervalTime=0,this._velocityCalculated=!1,this.isMultitouch=!1,this.isDragging=!1,this.isZooming=!1,this.raf=null,this._tapTimer=null,this.supportsTouch||(t.options.allowPanToNext=!1),this.drag=new it(this),this.zoomLevels=new nt(this),this.tapHandler=new ot(this),t.on("bindEvents",()=>{t.events.add(t.scrollWrap,"click",this._onClick.bind(this)),this._pointerEventEnabled?this._bindEvents("pointer","down","up","cancel"):this._touchEventEnabled?(this._bindEvents("touch","start","end","cancel"),t.scrollWrap&&(t.scrollWrap.ontouchmove=()=>{},t.scrollWrap.ontouchend=()=>{})):this._bindEvents("mouse","down","up")})}_bindEvents(t,i,e,s){const{pswp:n}=this,{events:o}=n,a=s?t+s:"";o.add(n.scrollWrap,t+i,this.onPointerDown.bind(this)),o.add(window,t+"move",this.onPointerMove.bind(this)),o.add(window,t+e,this.onPointerUp.bind(this)),a&&o.add(n.scrollWrap,a,this.onPointerUp.bind(this))}onPointerDown(t){const i=t.type==="mousedown"||t.pointerType==="mouse";if(i&&t.button>0)return;const{pswp:e}=this;if(!e.opener.isOpen){t.preventDefault();return}e.dispatch("pointerDown",{originalEvent:t}).defaultPrevented||(i&&(e.mouseDetected(),this._preventPointerEventBehaviour(t,"down")),e.animations.stopAll(),this._updatePoints(t,"down"),this._numActivePoints===1&&(this.dragAxis=null,p(this.startP1,this.p1)),this._numActivePoints>1?(this._clearTapTimer(),this.isMultitouch=!0):this.isMultitouch=!1)}onPointerMove(t){this._preventPointerEventBehaviour(t,"move"),this._numActivePoints&&(this._updatePoints(t,"move"),!this.pswp.dispatch("pointerMove",{originalEvent:t}).defaultPrevented&&(this._numActivePoints===1&&!this.isDragging?(this.dragAxis||this._calculateDragDirection(),this.dragAxis&&!this.isDragging&&(this.isZooming&&(this.isZooming=!1,this.zoomLevels.end()),this.isDragging=!0,this._clearTapTimer(),this._updateStartPoints(),this._intervalTime=Date.now(),this._velocityCalculated=!1,p(this._intervalP1,this.p1),this.velocity.x=0,this.velocity.y=0,this.drag.start(),this._rafStopLoop(),this._rafRenderLoop())):this._numActivePoints>1&&!this.isZooming&&(this._finishDrag(),this.isZooming=!0,this._updateStartPoints(),this.zoomLevels.start(),this._rafStopLoop(),this._rafRenderLoop())))}_finishDrag(){this.isDragging&&(this.isDragging=!1,this._velocityCalculated||this._updateVelocity(!0),this.drag.end(),this.dragAxis=null)}onPointerUp(t){this._numActivePoints&&(this._updatePoints(t,"up"),!this.pswp.dispatch("pointerUp",{originalEvent:t}).defaultPrevented&&(this._numActivePoints===0&&(this._rafStopLoop(),this.isDragging?this._finishDrag():!this.isZooming&&!this.isMultitouch&&this._finishTap(t)),this._numActivePoints<2&&this.isZooming&&(this.isZooming=!1,this.zoomLevels.end(),this._numActivePoints===1&&(this.dragAxis=null,this._updateStartPoints()))))}_rafRenderLoop(){(this.isDragging||this.isZooming)&&(this._updateVelocity(),this.isDragging?x(this.p1,this.prevP1)||this.drag.change():(!x(this.p1,this.prevP1)||!x(this.p2,this.prevP2))&&this.zoomLevels.change(),this._updatePrevPoints(),this.raf=requestAnimationFrame(this._rafRenderLoop.bind(this)))}_updateVelocity(t){const i=Date.now(),e=i-this._intervalTime;e<50&&!t||(this.velocity.x=this._getVelocity("x",e),this.velocity.y=this._getVelocity("y",e),this._intervalTime=i,p(this._intervalP1,this.p1),this._velocityCalculated=!0)}_finishTap(t){const{mainScroll:i}=this.pswp;if(i.isShifted()){i.moveIndexBy(0,!0);return}if(t.type.indexOf("cancel")>0)return;if(t.type==="mouseup"||t.pointerType==="mouse"){this.tapHandler.click(this.startP1,t);return}const e=this.pswp.options.doubleTapAction?at:0;this._tapTimer?(this._clearTapTimer(),A(this._lastStartP1,this.startP1)<ht&&this.tapHandler.doubleTap(this.startP1,t)):(p(this._lastStartP1,this.startP1),this._tapTimer=setTimeout(()=>{this.tapHandler.tap(this.startP1,t),this._clearTapTimer()},e))}_clearTapTimer(){this._tapTimer&&(clearTimeout(this._tapTimer),this._tapTimer=null)}_getVelocity(t,i){const e=this.p1[t]-this._intervalP1[t];return Math.abs(e)>1&&i>5?e/i:0}_rafStopLoop(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null)}_preventPointerEventBehaviour(t,i){this.pswp.applyFilters("preventPointerEvent",!0,t,i)&&t.preventDefault()}_updatePoints(t,i){if(this._pointerEventEnabled){const e=t,s=this._ongoingPointers.findIndex(n=>n.id===e.pointerId);i==="up"&&s>-1?this._ongoingPointers.splice(s,1):i==="down"&&s===-1?this._ongoingPointers.push(this._convertEventPosToPoint(e,{x:0,y:0})):s>-1&&this._convertEventPosToPoint(e,this._ongoingPointers[s]),this._numActivePoints=this._ongoingPointers.length,this._numActivePoints>0&&p(this.p1,this._ongoingPointers[0]),this._numActivePoints>1&&p(this.p2,this._ongoingPointers[1])}else{const e=t;this._numActivePoints=0,e.type.indexOf("touch")>-1?e.touches&&e.touches.length>0&&(this._convertEventPosToPoint(e.touches[0],this.p1),this._numActivePoints++,e.touches.length>1&&(this._convertEventPosToPoint(e.touches[1],this.p2),this._numActivePoints++)):(this._convertEventPosToPoint(t,this.p1),i==="up"?this._numActivePoints=0:this._numActivePoints++)}}_updatePrevPoints(){p(this.prevP1,this.p1),p(this.prevP2,this.p2)}_updateStartPoints(){p(this.startP1,this.p1),p(this.startP2,this.p2),this._updatePrevPoints()}_calculateDragDirection(){if(this.pswp.mainScroll.isShifted())this.dragAxis="x";else{const t=Math.abs(this.p1.x-this.startP1.x)-Math.abs(this.p1.y-this.startP1.y);if(t!==0){const i=t>0?"x":"y";Math.abs(this.p1[i]-this.startP1[i])>=rt&&(this.dragAxis=i)}}}_convertEventPosToPoint(t,i){return i.x=t.pageX-this.pswp.offset.x,i.y=t.pageY-this.pswp.offset.y,"pointerId"in t?i.id=t.pointerId:t.identifier!==void 0&&(i.id=t.identifier),i}_onClick(t){this.pswp.mainScroll.isShifted()&&(t.preventDefault(),t.stopPropagation())}}const ct=.35;class dt{constructor(t){this.pswp=t,this.x=0,this.slideWidth=0,this._currPositionIndex=0,this._prevPositionIndex=0,this._containerShiftIndex=-1,this.itemHolders=[]}resize(t){const{pswp:i}=this,e=Math.round(i.viewportSize.x+i.viewportSize.x*i.options.spacing),s=e!==this.slideWidth;s&&(this.slideWidth=e,this.moveTo(this.getCurrSlideX())),this.itemHolders.forEach((n,o)=>{s&&y(n.el,(o+this._containerShiftIndex)*this.slideWidth),t&&n.slide&&n.slide.resize()})}resetPosition(){this._currPositionIndex=0,this._prevPositionIndex=0,this.slideWidth=0,this._containerShiftIndex=-1}appendHolders(){this.itemHolders=[];for(let t=0;t<3;t++){const i=f("pswp__item","div",this.pswp.container);i.setAttribute("role","group"),i.setAttribute("aria-roledescription","slide"),i.setAttribute("aria-hidden","true"),i.style.display=t===1?"block":"none",this.itemHolders.push({el:i})}}canBeSwiped(){return this.pswp.getNumItems()>1}moveIndexBy(t,i,e){const{pswp:s}=this;let n=s.potentialIndex+t;const o=s.getNumItems();if(s.canLoop()){n=s.getLoopedIndex(n);const h=(t+o)%o;h<=o/2?t=h:t=h-o}else n<0?n=0:n>=o&&(n=o-1),t=n-s.potentialIndex;s.potentialIndex=n,this._currPositionIndex-=t,s.animations.stopMainScroll();const a=this.getCurrSlideX();if(!i)this.moveTo(a),this.updateCurrItem();else{s.animations.startSpring({isMainScroll:!0,start:this.x,end:a,velocity:e||0,naturalFrequency:30,dampingRatio:1,onUpdate:l=>{this.moveTo(l)},onComplete:()=>{this.updateCurrItem(),s.appendHeavy()}});let h=s.potentialIndex-s.currIndex;if(s.canLoop()){const l=(h+o)%o;l<=o/2?h=l:h=l-o}Math.abs(h)>1&&this.updateCurrItem()}return!!t}getCurrSlideX(){return this.slideWidth*this._currPositionIndex}isShifted(){return this.x!==this.getCurrSlideX()}updateCurrItem(){var t;const{pswp:i}=this,e=this._prevPositionIndex-this._currPositionIndex;if(!e)return;this._prevPositionIndex=this._currPositionIndex,i.currIndex=i.potentialIndex;let s=Math.abs(e),n;s>=3&&(this._containerShiftIndex+=e+(e>0?-3:3),s=3);for(let o=0;o<s;o++)e>0?(n=this.itemHolders.shift(),n&&(this.itemHolders[2]=n,this._containerShiftIndex++,y(n.el,(this._containerShiftIndex+2)*this.slideWidth),i.setContent(n,i.currIndex-s+o+2))):(n=this.itemHolders.pop(),n&&(this.itemHolders.unshift(n),this._containerShiftIndex--,y(n.el,this._containerShiftIndex*this.slideWidth),i.setContent(n,i.currIndex+s-o-2)));Math.abs(this._containerShiftIndex)>50&&!this.isShifted()&&(this.resetPosition(),this.resize()),i.animations.stopAllPan(),this.itemHolders.forEach((o,a)=>{o.slide&&o.slide.setIsActive(a===1)}),i.currSlide=(t=this.itemHolders[1])===null||t===void 0?void 0:t.slide,i.contentLoader.updateLazy(e),i.currSlide&&i.currSlide.applyCurrentZoomPan(),i.dispatch("change")}moveTo(t,i){if(!this.pswp.canLoop()&&i){let e=(this.slideWidth*this._currPositionIndex-t)/this.slideWidth;e+=this.pswp.currIndex;const s=Math.round(t-this.x);(e<0&&s>0||e>=this.pswp.getNumItems()-1&&s<0)&&(t=this.x+s*ct)}this.x=t,this.pswp.container&&y(this.pswp.container,t),this.pswp.dispatch("moveMainScroll",{x:t,dragging:i??!1})}}const pt={Escape:27,z:90,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Tab:9},g=(r,t)=>t?r:pt[r];class ut{constructor(t){this.pswp=t,this._wasFocused=!1,t.on("bindEvents",()=>{t.options.trapFocus&&(t.options.initialPointerPos||this._focusRoot(),t.events.add(document,"focusin",this._onFocusIn.bind(this))),t.events.add(document,"keydown",this._onKeyDown.bind(this))});const i=document.activeElement;t.on("destroy",()=>{t.options.returnFocus&&i&&this._wasFocused&&i.focus()})}_focusRoot(){!this._wasFocused&&this.pswp.element&&(this.pswp.element.focus(),this._wasFocused=!0)}_onKeyDown(t){const{pswp:i}=this;if(i.dispatch("keydown",{originalEvent:t}).defaultPrevented||G(t))return;let e,s,n=!1;const o="key"in t;switch(o?t.key:t.keyCode){case g("Escape",o):i.options.escKey&&(e="close");break;case g("z",o):e="toggleZoom";break;case g("ArrowLeft",o):s="x";break;case g("ArrowUp",o):s="y";break;case g("ArrowRight",o):s="x",n=!0;break;case g("ArrowDown",o):n=!0,s="y";break;case g("Tab",o):this._focusRoot();break}if(s){t.preventDefault();const{currSlide:a}=i;i.options.arrowKeys&&s==="x"&&i.getNumItems()>1?e=n?"next":"prev":a&&a.currZoomLevel>a.zoomLevels.fit&&(a.pan[s]+=n?-80:80,a.panTo(a.pan.x,a.pan.y))}e&&(t.preventDefault(),i[e]())}_onFocusIn(t){const{template:i}=this.pswp;i&&document!==t.target&&i!==t.target&&!i.contains(t.target)&&i.focus()}}const mt="cubic-bezier(.4,0,.22,1)";class ft{constructor(t){var i;this.props=t;const{target:e,onComplete:s,transform:n,onFinish:o=()=>{},duration:a=333,easing:h=mt}=t;this.onFinish=o;const l=n?"transform":"opacity",c=(i=t[l])!==null&&i!==void 0?i:"";this._target=e,this._onComplete=s,this._finished=!1,this._onTransitionEnd=this._onTransitionEnd.bind(this),this._helperTimeout=setTimeout(()=>{R(e,l,a,h),this._helperTimeout=setTimeout(()=>{e.addEventListener("transitionend",this._onTransitionEnd,!1),e.addEventListener("transitioncancel",this._onTransitionEnd,!1),this._helperTimeout=setTimeout(()=>{this._finalizeAnimation()},a+500),e.style[l]=c},30)},0)}_onTransitionEnd(t){t.target===this._target&&this._finalizeAnimation()}_finalizeAnimation(){this._finished||(this._finished=!0,this.onFinish(),this._onComplete&&this._onComplete())}destroy(){this._helperTimeout&&clearTimeout(this._helperTimeout),U(this._target),this._target.removeEventListener("transitionend",this._onTransitionEnd,!1),this._target.removeEventListener("transitioncancel",this._onTransitionEnd,!1),this._finished||this._finalizeAnimation()}}const _t=12,vt=.75;class gt{constructor(t,i,e){this.velocity=t*1e3,this._dampingRatio=i||vt,this._naturalFrequency=e||_t,this._dampedFrequency=this._naturalFrequency,this._dampingRatio<1&&(this._dampedFrequency*=Math.sqrt(1-this._dampingRatio*this._dampingRatio))}easeFrame(t,i){let e=0,s;i/=1e3;const n=Math.E**(-this._dampingRatio*this._naturalFrequency*i);if(this._dampingRatio===1)s=this.velocity+this._naturalFrequency*t,e=(t+s*i)*n,this.velocity=e*-this._naturalFrequency+s*n;else if(this._dampingRatio<1){s=1/this._dampedFrequency*(this._dampingRatio*this._naturalFrequency*t+this.velocity);const o=Math.cos(this._dampedFrequency*i),a=Math.sin(this._dampedFrequency*i);e=n*(t*o+s*a),this.velocity=e*-this._naturalFrequency*this._dampingRatio+n*(-this._dampedFrequency*t*a+this._dampedFrequency*s*o)}return e}}class yt{constructor(t){this.props=t,this._raf=0;const{start:i,end:e,velocity:s,onUpdate:n,onComplete:o,onFinish:a=()=>{},dampingRatio:h,naturalFrequency:l}=t;this.onFinish=a;const c=new gt(s,h,l);let d=Date.now(),u=i-e;const m=()=>{this._raf&&(u=c.easeFrame(u,Date.now()-d),Math.abs(u)<1&&Math.abs(c.velocity)<50?(n(e),o&&o(),this.onFinish()):(d=Date.now(),n(u+e),this._raf=requestAnimationFrame(m)))};this._raf=requestAnimationFrame(m)}destroy(){this._raf>=0&&cancelAnimationFrame(this._raf),this._raf=0}}class wt{constructor(){this.activeAnimations=[]}startSpring(t){this._start(t,!0)}startTransition(t){this._start(t)}_start(t,i){const e=i?new yt(t):new ft(t);return this.activeAnimations.push(e),e.onFinish=()=>this.stop(e),e}stop(t){t.destroy();const i=this.activeAnimations.indexOf(t);i>-1&&this.activeAnimations.splice(i,1)}stopAll(){this.activeAnimations.forEach(t=>{t.destroy()}),this.activeAnimations=[]}stopAllPan(){this.activeAnimations=this.activeAnimations.filter(t=>t.props.isPan?(t.destroy(),!1):!0)}stopMainScroll(){this.activeAnimations=this.activeAnimations.filter(t=>t.props.isMainScroll?(t.destroy(),!1):!0)}isPanRunning(){return this.activeAnimations.some(t=>t.props.isPan)}}class Pt{constructor(t){this.pswp=t,t.events.add(t.element,"wheel",this._onWheel.bind(this))}_onWheel(t){t.preventDefault();const{currSlide:i}=this.pswp;let{deltaX:e,deltaY:s}=t;if(i&&!this.pswp.dispatch("wheel",{originalEvent:t}).defaultPrevented)if(t.ctrlKey||this.pswp.options.wheelToZoom){if(i.isZoomable()){let n=-s;t.deltaMode===1?n*=.05:n*=t.deltaMode?1:.002,n=2**n;const o=i.currZoomLevel*n;i.zoomTo(o,{x:t.clientX,y:t.clientY})}}else i.isPannable()&&(t.deltaMode===1&&(e*=18,s*=18),i.panTo(i.pan.x-e,i.pan.y-s))}}function St(r){if(typeof r=="string")return r;if(!r||!r.isCustomSVG)return"";const t=r;let i='<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 %d %d" width="%d" height="%d">';return i=i.split("%d").join(t.size||32),t.outlineID&&(i+='<use class="pswp__icn-shadow" xlink:href="#'+t.outlineID+'"/>'),i+=t.inner,i+="</svg>",i}class xt{constructor(t,i){var e;const s=i.name||i.className;let n=i.html;if(t.options[s]===!1)return;typeof t.options[s+"SVG"]=="string"&&(n=t.options[s+"SVG"]),t.dispatch("uiElementCreate",{data:i});let o="";i.isButton?(o+="pswp__button ",o+=i.className||`pswp__button--${i.name}`):o+=i.className||`pswp__${i.name}`;let a=i.isButton?i.tagName||"button":i.tagName||"div";a=a.toLowerCase();const h=f(o,a);if(i.isButton){a==="button"&&(h.type="button");let{title:d}=i;const{ariaLabel:u}=i;typeof t.options[s+"Title"]=="string"&&(d=t.options[s+"Title"]),d&&(h.title=d);const m=u||d;m&&h.setAttribute("aria-label",m)}h.innerHTML=St(n),i.onInit&&i.onInit(h,t),i.onClick&&(h.onclick=d=>{typeof i.onClick=="string"?t[i.onClick]():typeof i.onClick=="function"&&i.onClick(d,h,t)});const l=i.appendTo||"bar";let c=t.element;l==="bar"?(t.topBar||(t.topBar=f("pswp__top-bar pswp__hide-on-close","div",t.scrollWrap)),c=t.topBar):(h.classList.add("pswp__hide-on-close"),l==="wrapper"&&(c=t.scrollWrap)),(e=c)===null||e===void 0||e.appendChild(t.applyFilters("uiElement",h,i))}}function H(r,t,i){r.classList.add("pswp__button--arrow"),r.setAttribute("aria-controls","pswp__items"),t.on("change",()=>{t.options.loop||(i?r.disabled=!(t.currIndex<t.getNumItems()-1):r.disabled=!(t.currIndex>0))})}const bt={name:"arrowPrev",className:"pswp__button--arrow--prev",title:"Previous",order:10,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<path d="M29 43l-3 3-16-16 16-16 3 3-13 13 13 13z" id="pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"prev",onInit:H},It={name:"arrowNext",className:"pswp__button--arrow--next",title:"Next",order:11,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<use xlink:href="#pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"next",onInit:(r,t)=>{H(r,t,!0)}},At={name:"close",title:"Close",order:20,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M24 10l-2-2-6 6-6-6-2 2 6 6-6 6 2 2 6-6 6 6 2-2-6-6z" id="pswp__icn-close"/>',outlineID:"pswp__icn-close"},onClick:"close"},Lt={name:"zoom",title:"Zoom",order:10,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M17.426 19.926a6 6 0 1 1 1.5-1.5L23 22.5 21.5 24l-4.074-4.074z" id="pswp__icn-zoom"/><path fill="currentColor" class="pswp__zoom-icn-bar-h" d="M11 16v-2h6v2z"/><path fill="currentColor" class="pswp__zoom-icn-bar-v" d="M13 12h2v6h-2z"/>',outlineID:"pswp__icn-zoom"},onClick:"toggleZoom"},Ct={name:"preloader",appendTo:"bar",order:7,html:{isCustomSVG:!0,inner:'<path fill-rule="evenodd" clip-rule="evenodd" d="M21.2 16a5.2 5.2 0 1 1-5.2-5.2V8a8 8 0 1 0 8 8h-2.8Z" id="pswp__icn-loading"/>',outlineID:"pswp__icn-loading"},onInit:(r,t)=>{let i,e=null;const s=(a,h)=>{r.classList.toggle("pswp__preloader--"+a,h)},n=a=>{i!==a&&(i=a,s("active",a))},o=()=>{var a;if(!((a=t.currSlide)!==null&&a!==void 0&&a.content.isLoading())){n(!1),e&&(clearTimeout(e),e=null);return}e||(e=setTimeout(()=>{var h;n(!!(!((h=t.currSlide)===null||h===void 0)&&h.content.isLoading())),e=null},t.options.preloaderDelay))};t.on("change",o),t.on("loadComplete",a=>{t.currSlide===a.slide&&o()}),t.ui&&(t.ui.updatePreloaderVisibility=o)}},Tt={name:"counter",order:5,onInit:(r,t)=>{t.on("change",()=>{r.innerText=t.currIndex+1+t.options.indexIndicatorSep+t.getNumItems()})}};function D(r,t){r.classList.toggle("pswp--zoomed-in",t)}class zt{constructor(t){this.pswp=t,this.isRegistered=!1,this.uiElementsData=[],this.items=[],this.updatePreloaderVisibility=()=>{},this._lastUpdatedZoomLevel=void 0}init(){const{pswp:t}=this;this.isRegistered=!1,this.uiElementsData=[At,bt,It,Lt,Ct,Tt],t.dispatch("uiRegister"),this.uiElementsData.sort((i,e)=>(i.order||0)-(e.order||0)),this.items=[],this.isRegistered=!0,this.uiElementsData.forEach(i=>{this.registerElement(i)}),t.on("change",()=>{var i;(i=t.element)===null||i===void 0||i.classList.toggle("pswp--one-slide",t.getNumItems()===1)}),t.on("zoomPanUpdate",()=>this._onZoomPanUpdate())}registerElement(t){this.isRegistered?this.items.push(new xt(this.pswp,t)):this.uiElementsData.push(t)}_onZoomPanUpdate(){const{template:t,currSlide:i,options:e}=this.pswp;if(this.pswp.opener.isClosing||!t||!i)return;let{currZoomLevel:s}=i;if(this.pswp.opener.isOpen||(s=i.zoomLevels.initial),s===this._lastUpdatedZoomLevel)return;this._lastUpdatedZoomLevel=s;const n=i.zoomLevels.initial-i.zoomLevels.secondary;if(Math.abs(n)<.01||!i.isZoomable()){D(t,!1),t.classList.remove("pswp--zoom-allowed");return}t.classList.add("pswp--zoom-allowed");const o=s===i.zoomLevels.initial?i.zoomLevels.secondary:i.zoomLevels.initial;D(t,o<=s),(e.imageClickAction==="zoom"||e.imageClickAction==="zoom-or-close")&&t.classList.add("pswp--click-to-zoom")}}function Et(r){const t=r.getBoundingClientRect();return{x:t.left,y:t.top,w:t.width}}function Ot(r,t,i){const e=r.getBoundingClientRect(),s=e.width/t,n=e.height/i,o=s>n?s:n,a=(e.width-t*o)/2,h=(e.height-i*o)/2,l={x:e.left+a,y:e.top+h,w:t*o};return l.innerRect={w:e.width,h:e.height,x:a,y:h},l}function Zt(r,t,i){const e=i.dispatch("thumbBounds",{index:r,itemData:t,instance:i});if(e.thumbBounds)return e.thumbBounds;const{element:s}=t;let n,o;if(s&&i.options.thumbSelector!==!1){const a=i.options.thumbSelector||"img";o=s.matches(a)?s:s.querySelector(a)}return o=i.applyFilters("thumbEl",o,t,r),o&&(t.thumbCropped?n=Ot(o,t.width||t.w||0,t.height||t.h||0):n=Et(o)),i.applyFilters("thumbBounds",n,t,r)}class Dt{constructor(t,i){this.type=t,this.defaultPrevented=!1,i&&Object.assign(this,i)}preventDefault(){this.defaultPrevented=!0}}class Mt{constructor(){this._listeners={},this._filters={},this.pswp=void 0,this.options=void 0}addFilter(t,i,e=100){var s,n,o;this._filters[t]||(this._filters[t]=[]),(s=this._filters[t])===null||s===void 0||s.push({fn:i,priority:e}),(n=this._filters[t])===null||n===void 0||n.sort((a,h)=>a.priority-h.priority),(o=this.pswp)===null||o===void 0||o.addFilter(t,i,e)}removeFilter(t,i){this._filters[t]&&(this._filters[t]=this._filters[t].filter(e=>e.fn!==i)),this.pswp&&this.pswp.removeFilter(t,i)}applyFilters(t,...i){var e;return(e=this._filters[t])===null||e===void 0||e.forEach(s=>{i[0]=s.fn.apply(this,i)}),i[0]}on(t,i){var e,s;this._listeners[t]||(this._listeners[t]=[]),(e=this._listeners[t])===null||e===void 0||e.push(i),(s=this.pswp)===null||s===void 0||s.on(t,i)}off(t,i){var e;this._listeners[t]&&(this._listeners[t]=this._listeners[t].filter(s=>i!==s)),(e=this.pswp)===null||e===void 0||e.off(t,i)}dispatch(t,i){var e;if(this.pswp)return this.pswp.dispatch(t,i);const s=new Dt(t,i);return(e=this._listeners[t])===null||e===void 0||e.forEach(n=>{n.call(this,s)}),s}}class Rt{constructor(t,i){if(this.element=f("pswp__img pswp__img--placeholder",t?"img":"div",i),t){const e=this.element;e.decoding="async",e.alt="",e.src=t,e.setAttribute("role","presentation")}this.element.setAttribute("aria-hidden","true")}setDisplayedSize(t,i){this.element&&(this.element.tagName==="IMG"?(L(this.element,250,"auto"),this.element.style.transformOrigin="0 0",this.element.style.transform=b(0,0,t/250)):L(this.element,t,i))}destroy(){var t;(t=this.element)!==null&&t!==void 0&&t.parentNode&&this.element.remove(),this.element=null}}class Ft{constructor(t,i,e){this.instance=i,this.data=t,this.index=e,this.element=void 0,this.placeholder=void 0,this.slide=void 0,this.displayedImageWidth=0,this.displayedImageHeight=0,this.width=Number(this.data.w)||Number(this.data.width)||0,this.height=Number(this.data.h)||Number(this.data.height)||0,this.isAttached=!1,this.hasSlide=!1,this.isDecoding=!1,this.state=_.IDLE,this.data.type?this.type=this.data.type:this.data.src?this.type="image":this.type="html",this.instance.dispatch("contentInit",{content:this})}removePlaceholder(){this.placeholder&&!this.keepPlaceholder()&&setTimeout(()=>{this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0)},1e3)}load(t,i){if(this.slide&&this.usePlaceholder())if(this.placeholder){const e=this.placeholder.element;e&&!e.parentElement&&this.slide.container.prepend(e)}else{const e=this.instance.applyFilters("placeholderSrc",this.data.msrc&&this.slide.isFirstSlide?this.data.msrc:!1,this);this.placeholder=new Rt(e,this.slide.container)}this.element&&!i||this.instance.dispatch("contentLoad",{content:this,isLazy:t}).defaultPrevented||(this.isImageContent()?(this.element=f("pswp__img","img"),this.displayedImageWidth&&this.loadImage(t)):(this.element=f("pswp__content","div"),this.element.innerHTML=this.data.html||""),i&&this.slide&&this.slide.updateContentSize(!0))}loadImage(t){var i,e;if(!this.isImageContent()||!this.element||this.instance.dispatch("contentLoadImage",{content:this,isLazy:t}).defaultPrevented)return;const s=this.element;this.updateSrcsetSizes(),this.data.srcset&&(s.srcset=this.data.srcset),s.src=(i=this.data.src)!==null&&i!==void 0?i:"",s.alt=(e=this.data.alt)!==null&&e!==void 0?e:"",this.state=_.LOADING,s.complete?this.onLoaded():(s.onload=()=>{this.onLoaded()},s.onerror=()=>{this.onError()})}setSlide(t){this.slide=t,this.hasSlide=!0,this.instance=t.pswp}onLoaded(){this.state=_.LOADED,this.slide&&this.element&&(this.instance.dispatch("loadComplete",{slide:this.slide,content:this}),this.slide.isActive&&this.slide.heavyAppended&&!this.element.parentNode&&(this.append(),this.slide.updateContentSize(!0)),(this.state===_.LOADED||this.state===_.ERROR)&&this.removePlaceholder())}onError(){this.state=_.ERROR,this.slide&&(this.displayError(),this.instance.dispatch("loadComplete",{slide:this.slide,isError:!0,content:this}),this.instance.dispatch("loadError",{slide:this.slide,content:this}))}isLoading(){return this.instance.applyFilters("isContentLoading",this.state===_.LOADING,this)}isError(){return this.state===_.ERROR}isImageContent(){return this.type==="image"}setDisplayedSize(t,i){if(this.element&&(this.placeholder&&this.placeholder.setDisplayedSize(t,i),!this.instance.dispatch("contentResize",{content:this,width:t,height:i}).defaultPrevented&&(L(this.element,t,i),this.isImageContent()&&!this.isError()))){const e=!this.displayedImageWidth&&t;this.displayedImageWidth=t,this.displayedImageHeight=i,e?this.loadImage(!1):this.updateSrcsetSizes(),this.slide&&this.instance.dispatch("imageSizeChange",{slide:this.slide,width:t,height:i,content:this})}}isZoomable(){return this.instance.applyFilters("isContentZoomable",this.isImageContent()&&this.state!==_.ERROR,this)}updateSrcsetSizes(){if(!this.isImageContent()||!this.element||!this.data.srcset)return;const t=this.element,i=this.instance.applyFilters("srcsetSizesWidth",this.displayedImageWidth,this);(!t.dataset.largestUsedSize||i>parseInt(t.dataset.largestUsedSize,10))&&(t.sizes=i+"px",t.dataset.largestUsedSize=String(i))}usePlaceholder(){return this.instance.applyFilters("useContentPlaceholder",this.isImageContent(),this)}lazyLoad(){this.instance.dispatch("contentLazyLoad",{content:this}).defaultPrevented||this.load(!0)}keepPlaceholder(){return this.instance.applyFilters("isKeepingPlaceholder",this.isLoading(),this)}destroy(){this.hasSlide=!1,this.slide=void 0,!this.instance.dispatch("contentDestroy",{content:this}).defaultPrevented&&(this.remove(),this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0),this.isImageContent()&&this.element&&(this.element.onload=null,this.element.onerror=null,this.element=void 0))}displayError(){if(this.slide){var t,i;let e=f("pswp__error-msg","div");e.innerText=(t=(i=this.instance.options)===null||i===void 0?void 0:i.errorMsg)!==null&&t!==void 0?t:"",e=this.instance.applyFilters("contentErrorElement",e,this),this.element=f("pswp__content pswp__error-msg-container","div"),this.element.appendChild(e),this.slide.container.innerText="",this.slide.container.appendChild(this.element),this.slide.updateContentSize(!0),this.removePlaceholder()}}append(){if(this.isAttached||!this.element)return;if(this.isAttached=!0,this.state===_.ERROR){this.displayError();return}if(this.instance.dispatch("contentAppend",{content:this}).defaultPrevented)return;const t="decode"in this.element;this.isImageContent()?t&&this.slide&&(!this.slide.isActive||C())?(this.isDecoding=!0,this.element.decode().catch(()=>{}).finally(()=>{this.isDecoding=!1,this.appendImage()})):this.appendImage():this.slide&&!this.element.parentNode&&this.slide.container.appendChild(this.element)}activate(){this.instance.dispatch("contentActivate",{content:this}).defaultPrevented||!this.slide||(this.isImageContent()&&this.isDecoding&&!C()?this.appendImage():this.isError()&&this.load(!1,!0),this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","false"))}deactivate(){this.instance.dispatch("contentDeactivate",{content:this}),this.slide&&this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","true")}remove(){this.isAttached=!1,!this.instance.dispatch("contentRemove",{content:this}).defaultPrevented&&(this.element&&this.element.parentNode&&this.element.remove(),this.placeholder&&this.placeholder.element&&this.placeholder.element.remove())}appendImage(){this.isAttached&&(this.instance.dispatch("contentAppendImage",{content:this}).defaultPrevented||(this.slide&&this.element&&!this.element.parentNode&&this.slide.container.appendChild(this.element),(this.state===_.LOADED||this.state===_.ERROR)&&this.removePlaceholder()))}}const Bt=5;function W(r,t,i){const e=t.createContentFromData(r,i);let s;const{options:n}=t;if(n){s=new k(n,r,-1);let o;t.pswp?o=t.pswp.viewportSize:o=B(n,t);const a=N(n,o,r,i);s.update(e.width,e.height,a)}return e.lazyLoad(),s&&e.setDisplayedSize(Math.ceil(e.width*s.initial),Math.ceil(e.height*s.initial)),e}function Nt(r,t){const i=t.getItemData(r);if(!t.dispatch("lazyLoadSlide",{index:r,itemData:i}).defaultPrevented)return W(i,t,r)}class kt{constructor(t){this.pswp=t,this.limit=Math.max(t.options.preload[0]+t.options.preload[1]+1,Bt),this._cachedItems=[]}updateLazy(t){const{pswp:i}=this;if(i.dispatch("lazyLoad").defaultPrevented)return;const{preload:e}=i.options,s=t===void 0?!0:t>=0;let n;for(n=0;n<=e[1];n++)this.loadSlideByIndex(i.currIndex+(s?n:-n));for(n=1;n<=e[0];n++)this.loadSlideByIndex(i.currIndex+(s?-n:n))}loadSlideByIndex(t){const i=this.pswp.getLoopedIndex(t);let e=this.getContentByIndex(i);e||(e=Nt(i,this.pswp),e&&this.addToCache(e))}getContentBySlide(t){let i=this.getContentByIndex(t.index);return i||(i=this.pswp.createContentFromData(t.data,t.index),this.addToCache(i)),i.setSlide(t),i}addToCache(t){if(this.removeByIndex(t.index),this._cachedItems.push(t),this._cachedItems.length>this.limit){const i=this._cachedItems.findIndex(e=>!e.isAttached&&!e.hasSlide);i!==-1&&this._cachedItems.splice(i,1)[0].destroy()}}removeByIndex(t){const i=this._cachedItems.findIndex(e=>e.index===t);i!==-1&&this._cachedItems.splice(i,1)}getContentByIndex(t){return this._cachedItems.find(i=>i.index===t)}destroy(){this._cachedItems.forEach(t=>t.destroy()),this._cachedItems=[]}}class Ht extends Mt{getNumItems(){var t;let i=0;const e=(t=this.options)===null||t===void 0?void 0:t.dataSource;e&&"length"in e?i=e.length:e&&"gallery"in e&&(e.items||(e.items=this._getGalleryDOMElements(e.gallery)),e.items&&(i=e.items.length));const s=this.dispatch("numItems",{dataSource:e,numItems:i});return this.applyFilters("numItems",s.numItems,e)}createContentFromData(t,i){return new Ft(t,this,i)}getItemData(t){var i;const e=(i=this.options)===null||i===void 0?void 0:i.dataSource;let s={};Array.isArray(e)?s=e[t]:e&&"gallery"in e&&(e.items||(e.items=this._getGalleryDOMElements(e.gallery)),s=e.items[t]);let n=s;n instanceof Element&&(n=this._domElementToItemData(n));const o=this.dispatch("itemData",{itemData:n||{},index:t});return this.applyFilters("itemData",o.itemData,t)}_getGalleryDOMElements(t){var i,e;return(i=this.options)!==null&&i!==void 0&&i.children||(e=this.options)!==null&&e!==void 0&&e.childSelector?K(this.options.children,this.options.childSelector,t)||[]:[t]}_domElementToItemData(t){const i={element:t},e=t.tagName==="A"?t:t.querySelector("a");if(e){i.src=e.dataset.pswpSrc||e.href,e.dataset.pswpSrcset&&(i.srcset=e.dataset.pswpSrcset),i.width=e.dataset.pswpWidth?parseInt(e.dataset.pswpWidth,10):0,i.height=e.dataset.pswpHeight?parseInt(e.dataset.pswpHeight,10):0,i.w=i.width,i.h=i.height,e.dataset.pswpType&&(i.type=e.dataset.pswpType);const n=t.querySelector("img");if(n){var s;i.msrc=n.currentSrc||n.src,i.alt=(s=n.getAttribute("alt"))!==null&&s!==void 0?s:""}(e.dataset.pswpCropped||e.dataset.cropped)&&(i.thumbCropped=!0)}return this.applyFilters("domItemData",i,t,e)}lazyLoadData(t,i){return W(t,this,i)}}const P=.003;class Wt{constructor(t){this.pswp=t,this.isClosed=!0,this.isOpen=!1,this.isClosing=!1,this.isOpening=!1,this._duration=void 0,this._useAnimation=!1,this._croppedZoom=!1,this._animateRootOpacity=!1,this._animateBgOpacity=!1,this._placeholder=void 0,this._opacityElement=void 0,this._cropContainer1=void 0,this._cropContainer2=void 0,this._thumbBounds=void 0,this._prepareOpen=this._prepareOpen.bind(this),t.on("firstZoomPan",this._prepareOpen)}open(){this._prepareOpen(),this._start()}close(){if(this.isClosed||this.isClosing||this.isOpening)return;const t=this.pswp.currSlide;this.isOpen=!1,this.isOpening=!1,this.isClosing=!0,this._duration=this.pswp.options.hideAnimationDuration,t&&t.currZoomLevel*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps(),setTimeout(()=>{this._start()},this._croppedZoom?30:0)}_prepareOpen(){if(this.pswp.off("firstZoomPan",this._prepareOpen),!this.isOpening){const t=this.pswp.currSlide;this.isOpening=!0,this.isClosing=!1,this._duration=this.pswp.options.showAnimationDuration,t&&t.zoomLevels.initial*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps()}}_applyStartProps(){const{pswp:t}=this,i=this.pswp.currSlide,{options:e}=t;if(e.showHideAnimationType==="fade"?(e.showHideOpacity=!0,this._thumbBounds=void 0):e.showHideAnimationType==="none"?(e.showHideOpacity=!1,this._duration=0,this._thumbBounds=void 0):this.isOpening&&t._initialThumbBounds?this._thumbBounds=t._initialThumbBounds:this._thumbBounds=this.pswp.getThumbBounds(),this._placeholder=i?.getPlaceholderElement(),t.animations.stopAll(),this._useAnimation=!!(this._duration&&this._duration>50),this._animateZoom=!!this._thumbBounds&&i?.content.usePlaceholder()&&(!this.isClosing||!t.mainScroll.isShifted()),!this._animateZoom)this._animateRootOpacity=!0,this.isOpening&&i&&(i.zoomAndPanToInitial(),i.applyCurrentZoomPan());else{var s;this._animateRootOpacity=(s=e.showHideOpacity)!==null&&s!==void 0?s:!1}if(this._animateBgOpacity=!this._animateRootOpacity&&this.pswp.options.bgOpacity>P,this._opacityElement=this._animateRootOpacity?t.element:t.bg,!this._useAnimation){this._duration=0,this._animateZoom=!1,this._animateBgOpacity=!1,this._animateRootOpacity=!0,this.isOpening&&(t.element&&(t.element.style.opacity=String(P)),t.applyBgOpacity(1));return}if(this._animateZoom&&this._thumbBounds&&this._thumbBounds.innerRect){var n;this._croppedZoom=!0,this._cropContainer1=this.pswp.container,this._cropContainer2=(n=this.pswp.currSlide)===null||n===void 0?void 0:n.holderElement,t.container&&(t.container.style.overflow="hidden",t.container.style.width=t.viewportSize.x+"px")}else this._croppedZoom=!1;this.isOpening?(this._animateRootOpacity?(t.element&&(t.element.style.opacity=String(P)),t.applyBgOpacity(1)):(this._animateBgOpacity&&t.bg&&(t.bg.style.opacity=String(P)),t.element&&(t.element.style.opacity="1")),this._animateZoom&&(this._setClosedStateZoomPan(),this._placeholder&&(this._placeholder.style.willChange="transform",this._placeholder.style.opacity=String(P)))):this.isClosing&&(t.mainScroll.itemHolders[0]&&(t.mainScroll.itemHolders[0].el.style.display="none"),t.mainScroll.itemHolders[2]&&(t.mainScroll.itemHolders[2].el.style.display="none"),this._croppedZoom&&t.mainScroll.x!==0&&(t.mainScroll.resetPosition(),t.mainScroll.resize()))}_start(){this.isOpening&&this._useAnimation&&this._placeholder&&this._placeholder.tagName==="IMG"?new Promise(t=>{let i=!1,e=!0;q(this._placeholder).finally(()=>{i=!0,e||t(!0)}),setTimeout(()=>{e=!1,i&&t(!0)},50),setTimeout(t,250)}).finally(()=>this._initiate()):this._initiate()}_initiate(){var t,i;(t=this.pswp.element)===null||t===void 0||t.style.setProperty("--pswp-transition-duration",this._duration+"ms"),this.pswp.dispatch(this.isOpening?"openingAnimationStart":"closingAnimationStart"),this.pswp.dispatch("initialZoom"+(this.isOpening?"In":"Out")),(i=this.pswp.element)===null||i===void 0||i.classList.toggle("pswp--ui-visible",this.isOpening),this.isOpening?(this._placeholder&&(this._placeholder.style.opacity="1"),this._animateToOpenState()):this.isClosing&&this._animateToClosedState(),this._useAnimation||this._onAnimationComplete()}_onAnimationComplete(){const{pswp:t}=this;if(this.isOpen=this.isOpening,this.isClosed=this.isClosing,this.isOpening=!1,this.isClosing=!1,t.dispatch(this.isOpen?"openingAnimationEnd":"closingAnimationEnd"),t.dispatch("initialZoom"+(this.isOpen?"InEnd":"OutEnd")),this.isClosed)t.destroy();else if(this.isOpen){var i;this._animateZoom&&t.container&&(t.container.style.overflow="visible",t.container.style.width="100%"),(i=t.currSlide)===null||i===void 0||i.applyCurrentZoomPan()}}_animateToOpenState(){const{pswp:t}=this;this._animateZoom&&(this._croppedZoom&&this._cropContainer1&&this._cropContainer2&&(this._animateTo(this._cropContainer1,"transform","translate3d(0,0,0)"),this._animateTo(this._cropContainer2,"transform","none")),t.currSlide&&(t.currSlide.zoomAndPanToInitial(),this._animateTo(t.currSlide.container,"transform",t.currSlide.getCurrentTransform()))),this._animateBgOpacity&&t.bg&&this._animateTo(t.bg,"opacity",String(t.options.bgOpacity)),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","1")}_animateToClosedState(){const{pswp:t}=this;this._animateZoom&&this._setClosedStateZoomPan(!0),this._animateBgOpacity&&t.bgOpacity>.01&&t.bg&&this._animateTo(t.bg,"opacity","0"),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","0")}_setClosedStateZoomPan(t){if(!this._thumbBounds)return;const{pswp:i}=this,{innerRect:e}=this._thumbBounds,{currSlide:s,viewportSize:n}=i;if(this._croppedZoom&&e&&this._cropContainer1&&this._cropContainer2){const o=-n.x+(this._thumbBounds.x-e.x)+e.w,a=-n.y+(this._thumbBounds.y-e.y)+e.h,h=n.x-e.w,l=n.y-e.h;t?(this._animateTo(this._cropContainer1,"transform",b(o,a)),this._animateTo(this._cropContainer2,"transform",b(h,l))):(y(this._cropContainer1,o,a),y(this._cropContainer2,h,l))}s&&(p(s.pan,e||this._thumbBounds),s.currZoomLevel=this._thumbBounds.w/s.width,t?this._animateTo(s.container,"transform",s.getCurrentTransform()):s.applyCurrentZoomPan())}_animateTo(t,i,e){if(!this._duration){t.style[i]=e;return}const{animations:s}=this.pswp,n={duration:this._duration,easing:this.pswp.options.easing,onComplete:()=>{s.activeAnimations.length||this._onAnimationComplete()},target:t};n[i]=e,s.startTransition(n)}}const Vt={allowPanToNext:!0,spacing:.1,loop:!0,pinchToClose:!0,closeOnVerticalDrag:!0,hideAnimationDuration:333,showAnimationDuration:333,zoomAnimationDuration:333,escKey:!0,arrowKeys:!0,trapFocus:!0,returnFocus:!0,maxWidthToAnimate:4e3,clickToCloseNonZoomable:!0,imageClickAction:"zoom-or-close",bgClickAction:"close",tapAction:"toggle-controls",doubleTapAction:"zoom",indexIndicatorSep:" / ",preloaderDelay:2e3,bgOpacity:.8,index:0,errorMsg:"The image cannot be loaded",preload:[1,2],easing:"cubic-bezier(.4,0,.22,1)"};class $t extends Ht{constructor(t){super(),this.options=this._prepareOptions(t||{}),this.offset={x:0,y:0},this._prevViewportSize={x:0,y:0},this.viewportSize={x:0,y:0},this.bgOpacity=1,this.currIndex=0,this.potentialIndex=0,this.isOpen=!1,this.isDestroying=!1,this.hasMouse=!1,this._initialItemData={},this._initialThumbBounds=void 0,this.topBar=void 0,this.element=void 0,this.template=void 0,this.container=void 0,this.scrollWrap=void 0,this.currSlide=void 0,this.events=new X,this.animations=new wt,this.mainScroll=new dt(this),this.gestures=new lt(this),this.opener=new Wt(this),this.keyboard=new ut(this),this.contentLoader=new kt(this)}init(){if(this.isOpen||this.isDestroying)return!1;this.isOpen=!0,this.dispatch("init"),this.dispatch("beforeOpen"),this._createMainStructure();let t="pswp--open";return this.gestures.supportsTouch&&(t+=" pswp--touch"),this.options.mainClass&&(t+=" "+this.options.mainClass),this.element&&(this.element.className+=" "+t),this.currIndex=this.options.index||0,this.potentialIndex=this.currIndex,this.dispatch("firstUpdate"),this.scrollWheel=new Pt(this),(Number.isNaN(this.currIndex)||this.currIndex<0||this.currIndex>=this.getNumItems())&&(this.currIndex=0),this.gestures.supportsTouch||this.mouseDetected(),this.updateSize(),this.offset.y=window.pageYOffset,this._initialItemData=this.getItemData(this.currIndex),this.dispatch("gettingData",{index:this.currIndex,data:this._initialItemData,slide:void 0}),this._initialThumbBounds=this.getThumbBounds(),this.dispatch("initialLayout"),this.on("openingAnimationEnd",()=>{const{itemHolders:i}=this.mainScroll;i[0]&&(i[0].el.style.display="block",this.setContent(i[0],this.currIndex-1)),i[2]&&(i[2].el.style.display="block",this.setContent(i[2],this.currIndex+1)),this.appendHeavy(),this.contentLoader.updateLazy(),this.events.add(window,"resize",this._handlePageResize.bind(this)),this.events.add(window,"scroll",this._updatePageScrollOffset.bind(this)),this.dispatch("bindEvents")}),this.mainScroll.itemHolders[1]&&this.setContent(this.mainScroll.itemHolders[1],this.currIndex),this.dispatch("change"),this.opener.open(),this.dispatch("afterInit"),!0}getLoopedIndex(t){const i=this.getNumItems();return this.options.loop&&(t>i-1&&(t-=i),t<0&&(t+=i)),I(t,0,i-1)}appendHeavy(){this.mainScroll.itemHolders.forEach(t=>{var i;(i=t.slide)===null||i===void 0||i.appendHeavy()})}goTo(t){this.mainScroll.moveIndexBy(this.getLoopedIndex(t)-this.potentialIndex)}next(){this.goTo(this.potentialIndex+1)}prev(){this.goTo(this.potentialIndex-1)}zoomTo(...t){var i;(i=this.currSlide)===null||i===void 0||i.zoomTo(...t)}toggleZoom(){var t;(t=this.currSlide)===null||t===void 0||t.toggleZoom()}close(){!this.opener.isOpen||this.isDestroying||(this.isDestroying=!0,this.dispatch("close"),this.events.removeAll(),this.opener.close())}destroy(){var t;if(!this.isDestroying){this.options.showHideAnimationType="none",this.close();return}this.dispatch("destroy"),this._listeners={},this.scrollWrap&&(this.scrollWrap.ontouchmove=null,this.scrollWrap.ontouchend=null),(t=this.element)===null||t===void 0||t.remove(),this.mainScroll.itemHolders.forEach(i=>{var e;(e=i.slide)===null||e===void 0||e.destroy()}),this.contentLoader.destroy(),this.events.removeAll()}refreshSlideContent(t){this.contentLoader.removeByIndex(t),this.mainScroll.itemHolders.forEach((i,e)=>{var s,n;let o=((s=(n=this.currSlide)===null||n===void 0?void 0:n.index)!==null&&s!==void 0?s:0)-1+e;if(this.canLoop()&&(o=this.getLoopedIndex(o)),o===t&&(this.setContent(i,t,!0),e===1)){var a;this.currSlide=i.slide,(a=i.slide)===null||a===void 0||a.setIsActive(!0)}}),this.dispatch("change")}setContent(t,i,e){if(this.canLoop()&&(i=this.getLoopedIndex(i)),t.slide){if(t.slide.index===i&&!e)return;t.slide.destroy(),t.slide=void 0}if(!this.canLoop()&&(i<0||i>=this.getNumItems()))return;const s=this.getItemData(i);t.slide=new j(s,i,this),i===this.currIndex&&(this.currSlide=t.slide),t.slide.append(t.el)}getViewportCenterPoint(){return{x:this.viewportSize.x/2,y:this.viewportSize.y/2}}updateSize(t){if(this.isDestroying)return;const i=B(this.options,this);!t&&x(i,this._prevViewportSize)||(p(this._prevViewportSize,i),this.dispatch("beforeResize"),p(this.viewportSize,this._prevViewportSize),this._updatePageScrollOffset(),this.dispatch("viewportSize"),this.mainScroll.resize(this.opener.isOpen),!this.hasMouse&&window.matchMedia("(any-hover: hover)").matches&&this.mouseDetected(),this.dispatch("resize"))}applyBgOpacity(t){this.bgOpacity=Math.max(t,0),this.bg&&(this.bg.style.opacity=String(this.bgOpacity*this.options.bgOpacity))}mouseDetected(){if(!this.hasMouse){var t;this.hasMouse=!0,(t=this.element)===null||t===void 0||t.classList.add("pswp--has_mouse")}}_handlePageResize(){this.updateSize(),/iPhone|iPad|iPod/i.test(window.navigator.userAgent)&&setTimeout(()=>{this.updateSize()},500)}_updatePageScrollOffset(){this.setScrollOffset(0,window.pageYOffset)}setScrollOffset(t,i){this.offset.x=t,this.offset.y=i,this.dispatch("updateScrollOffset")}_createMainStructure(){this.element=f("pswp","div"),this.element.setAttribute("tabindex","-1"),this.element.setAttribute("role","dialog"),this.template=this.element,this.bg=f("pswp__bg","div",this.element),this.scrollWrap=f("pswp__scroll-wrap","section",this.element),this.container=f("pswp__container","div",this.scrollWrap),this.scrollWrap.setAttribute("aria-roledescription","carousel"),this.container.setAttribute("aria-live","off"),this.container.setAttribute("id","pswp__items"),this.mainScroll.appendHolders(),this.ui=new zt(this),this.ui.init(),(this.options.appendToEl||document.body).appendChild(this.element)}getThumbBounds(){return Zt(this.currIndex,this.currSlide?this.currSlide.data:this._initialItemData,this)}canLoop(){return this.options.loop&&this.getNumItems()>2}_prepareOptions(t){return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches&&(t.showHideAnimationType="none",t.zoomAnimationDuration=0),{...Vt,...t}}}export{$t as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const i=e=>{if(typeof e!="object"||e===null)return console.error(new Error("`product` must be an object")),!1;let n=e.price_effective_date;if(n){let r=new Date;if(n.start&&new Date(n.start)>r||n.end&&new Date(n.end)<r)return!1}return e.base_price>e.price},t=i,a=e=>t(e)?e.price:e?typeof e.final_price=="number"?e.final_price:Math.max(e.base_price||0,e.price||0):0,s=a;export{t as c,s as g};
|