cloudcommerce 2.6.3 → 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 +12 -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/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 +2 -1
- package/packages/ssr/lib/lib/cron-ssr-save-views.js.map +1 -1
- package/packages/ssr/package.json +4 -4
- package/packages/ssr/src/lib/cron-ssr-save-views.ts +2 -1
- 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 +6 -6
- 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 +1 @@
|
|
|
1
|
-
const p=e=>Object.values(e).filter(t=>t).length,g=(e=globalThis.$storefront.settings.modules)=>{const t={};if(e){const o=e.list_payments;if(o){const s=o.discount_option;s&&p(s)&&(t.list_payments={discount_option:s});const i=o.installments_option;i?.max_number&&(t.list_payments||(t.list_payments={}),t.list_payments.installments_option=i);const n=o.loyalty_points_programs||{};if(!Object.keys(n).length){const a={...o.loyalty_points_program};if(a?.id&&a.ratio){const{id:c}=a;delete a.id,n[c]=a}}Object.keys(n).length&&(t.list_payments||(t.list_payments={}),t.list_payments.loyalty_points_programs=n)}const r=e.calculate_shipping?.free_shipping_from_value;typeof r=="number"&&(t.calculate_shipping={free_shipping_from_value:r})}return t},y=new Promise(e=>{window.$storefront.modulesInfoPreset=g(),e(window.$storefront.modulesInfoPreset)});let f={};{const e="ecomUtm",t=localStorage.getItem(e),o=Date.now();try{const s=t&&JSON.parse(t)||{};new Date(s.at+1e3*60*60*24*7).getTime()>=o&&(f=s.utm||{})}catch{f={}}let l=!1;const r=new URLSearchParams(window.location.search);["source","medium","campaign","term","content"].forEach(s=>{const i=r.get(`utm_${s}`);i&&(f[s]=i,l=!0)}),l&&localStorage.setItem(e,JSON.stringify({at:o,utm:f}))}const u=f,_=(e,t,o=1e4)=>{let l,r;o&&(l=new AbortController,r=setTimeout(()=>{l.abort()},o));let s;if(t?.body&&(typeof t.body=="object"?(s=JSON.stringify(t.body),t.headers={...t.headers,"Content-Type":"application/json","Content-Length":s.length.toString()}):s=t.body),t?.params&&typeof e=="string"){let n="";Object.keys(t.params).forEach(a=>{const c=t.params[a];if(Array.isArray(c)){c.forEach(m=>{n+=`&${a}=${m}`});return}n+=`&${a}=${c}`}),n&&(e.includes("?")?e+=n:e+=`?${n.slice(1)}`)}const i=fetch(e,{...t,body:s,signal:l?.signal});return i.finally(()=>{r&&clearTimeout(r)}),i};export{_ as a,y as l,u};
|
|
1
|
+
const p=e=>Object.values(e).filter(t=>t).length,g=(e=globalThis.$storefront.settings.modules)=>{const t={};if(e){const o=e.list_payments;if(o){const s=o.discount_option;s&&p(s)&&(t.list_payments={discount_option:s});const i=o.installments_option;i?.max_number&&(t.list_payments||(t.list_payments={}),t.list_payments.installments_option=i);const n=o.loyalty_points_programs||{};if(!Object.keys(n).length){const a={...o.loyalty_points_program};if(a?.id&&a.ratio){const{id:c}=a;delete a.id,n[c]=a}}Object.keys(n).length&&(t.list_payments||(t.list_payments={}),t.list_payments.loyalty_points_programs=n)}const r=e.calculate_shipping?.free_shipping_from_value;typeof r=="number"&&(t.calculate_shipping={free_shipping_from_value:r})}return t},y=new Promise(e=>{window.$storefront.modulesInfoPreset=g(),e(window.$storefront.modulesInfoPreset)});let f={};{const e="ecomUtm",t=localStorage.getItem(e),o=Date.now();try{const s=t&&JSON.parse(t)||{};new Date(s.at+1e3*60*60*24*7).getTime()>=o&&(f=s.utm||{})}catch{f={}}let l=!1;const r=new URLSearchParams(window.location.search);["source","medium","campaign","term","content"].forEach(s=>{const i=r.get(`utm_${s}`);i&&(f[s]=i,l=!0)}),l&&localStorage.setItem(e,JSON.stringify({at:o,utm:f}))}const u=f,_=(e,t,o=1e4)=>{let l,r;o&&(l=new AbortController,r=setTimeout(()=>{l.abort()},o));let s;if(t?.body&&(typeof t.body=="object"?(s=JSON.stringify(t.body),t.headers={...t.headers,"Content-Type":"application/json","Content-Length":s.length.toString()}):s=t.body),t?.params&&typeof e=="string"){let n="";Object.keys(t.params).forEach(a=>{const c=t.params[a];if(c!==void 0){if(Array.isArray(c)){c.forEach(m=>{n+=`&${a}=${m}`});return}n+=`&${a}=${c}`}}),n&&(e.includes("?")?e+=n:e+=`?${n.slice(1)}`)}const i=fetch(e,{...t,body:s,signal:l?.signal});return i.finally(()=>{r&&clearTimeout(r)}),i};export{_ as a,y as l,u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as k,T as ne,w as ae,c as oe,d as se}from"./_plugin-vue_export-helper.CBemkWnU.js";import{d as C,c,o as f,$ as A,h as R,Z as b,a2 as G,e as g,a4 as J,a5 as ee,f as Q,n as p,l as F,F as ie,k as le,ab as ue,ag as ce,a as E,w as z,a8 as V,T as de,Q as fe,al as me,ad as ve,z as $,am as pe}from"./sf-utils.Cigv01cN.js";import{i as he}from"./img.D5a6GzeE.js";import{e as ge}from"./index.CFw6O-Kt.js";import{i as ye}from"./img-sizes.rFK7so02.js";import{i as _e}from"./i18n.B3skIOFg.js";import{f as we}from"./format-money.DINpWB0x.js";import{a as xe,b as Se}from"./index.DBfgCyd-.js";import"./price.CHiL6Z1J.js";const be=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)`),l=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(()=>l.value!=="none"?.1:0),s=c(()=>e.isEnterFrom?o.value:1),y=c(()=>e.isLeaveTo?o.value:1),P=c(()=>e.isEnterFrom?l.value:"none"),m=c(()=>e.isLeaveTo?l.value:"none"),u=c(()=>e.slide==="down"||e.slide==="up"),w=c(()=>e.isFloating?null:u.value?0:"auto"),T=c(()=>e.isFloating?null:e.slide&&!u.value?0:"auto"),v=c(()=>e.isEnterFrom?w.value:"auto"),S=c(()=>e.isEnterFrom?T.value:"auto"),x=c(()=>{let n="opacity";return l.value!=="none"&&(n+=", transform"),w.value===0&&(n+=", height"),T.value===0&&(n+=", width"),n}),h={props:e,duration:t,transform:l,opacity:o,enterFromOpacity:s,leaveToOpacity:y,enterFromTransform:P,leaveToTransform:m,isSlideY:u,height:w,width:T,enterFromHeight:v,enterFromWidth:S,willChange:x,setInitialStyles:n=>{n.style.setProperty("--fade-will-change",x.value),n.style.setProperty("--fade-duration",t.value),n.style.setProperty("--fade-enter-opacity",String(s.value)),n.style.setProperty("--fade-enter-transform",String(P.value)),n.style.setProperty("--fade-enter-height",String(v.value)),n.style.setProperty("--fade-enter-width",String(S.value)),n.style.setProperty("--fade-leave-opacity",String(y.value)),n.style.setProperty("--fade-leave-transform",String(m.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:_,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=_})}},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 _=u.value?"height":"width";getComputedStyle(n)[_],requestAnimationFrame(()=>{n.style[_]="0"})}}};return Object.defineProperty(h,"__isScriptSetup",{enumerable:!1,value:!0}),h}});function Ce(r,a,e,t,l,o){return f(),A(ne,{name:"sf-fade",onBeforeEnter:t.setInitialStyles,onEnter:t.onEnter,onBeforeLeave:t.setInitialStyles,onAfterEnter:t.onAfterEnter,onLeave:t.onLeave},{default:R(()=>[b(r.$slots,"default")]),_:3},8,["onBeforeEnter","onEnter","onBeforeLeave","onAfterEnter","onLeave"])}const Pe=k(be,[["render",Ce]]),Te=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"}}}),l={props:e,linkTarget:t};return Object.defineProperty(l,"__isScriptSetup",{enumerable:!1,value:!0}),l}});function Le(r,a,e,t,l,o){return f(),A(G(e.href?"a":"span"),{href:e.href,target:t.linkTarget,rel:t.linkTarget==="_blank"?"noopener":void 0},{default:R(()=>[b(r.$slots,"default")]),_:3},8,["href","target","rel"])}const Ee=k(Te,[["render",Le]]),Fe=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:he(e.picture,void 0,e.preferredSize)||{}),l=c(()=>ye(t.value)),o=c(()=>({src:t.value.url,alt:t.value.alt||e.alt,width:l.value.width||void 0,height:l.value.height||void 0,loading:e.loading,decoding:e.decoding||(l.value.height?"async":void 0)})),s={props:e,image:t,dimensions:l,attrs:o};return Object.defineProperty(s,"__isScriptSetup",{enumerable:!1,value:!0}),s}});function ke(r,a,e,t,l,o){return f(),g("img",J(ee(t.attrs)),null,16)}const Be=k(Fe,[["render",ke]]),q="bg-base-200 rounded-md",ze=C({__name:"Skeleton",props:{isBold:{type:Boolean},isLarge:{type:Boolean},numRows:{default:6}},setup(r,{expose:a}){a();const e=r,t=c(()=>`${q} ${e.isBold?"h-8 mb-6":"h-2.5 mb-4"}`),l=c(()=>`${q} ${e.isBold?"h-5 mb-4":"h-2 mb-2.5"}`),o={props:e,rowClassName:q,firstRowClassName:t,nextRowsClassName:l};return Object.defineProperty(o,"__isScriptSetup",{enumerable:!1,value:!0}),o}}),Ae=Q("span",{class:"sr-only"},"Loading...",-1);function Re(r,a,e,t,l,o){return f(),g("div",{role:"status",class:p(["animate-pulse",e.isLarge?"max-w-4xl":"max-w-sm"])},[Q("div",{class:p([t.firstRowClassName,e.isLarge?"w-96":"w-48"])},null,2),e.numRows>1?(f(),g("div",{key:0,class:p([t.nextRowsClassName,e.isLarge?"max-w-[680px]":"max-w-[340px]"])},null,2)):F("",!0),e.numRows>2?(f(),g("div",{key:1,class:p(t.nextRowsClassName)},null,2)):F("",!0),e.numRows>3?(f(),g("div",{key:2,class:p([t.nextRowsClassName,e.isLarge?"max-w-[660px]":"max-w-[330px]"])},null,2)):F("",!0),e.numRows>4?(f(),g("div",{key:3,class:p([t.nextRowsClassName,e.isLarge?"max-w-[600px]":"max-w-[300px]"])},null,2)):F("",!0),(f(!0),g(ie,null,le(e.numRows-5,s=>(f(),g("div",{key:s,class:p([t.nextRowsClassName,e.isLarge?"max-w-[720px]":"max-w-[360px]"])},null,2))),128)),Ae],2)}const Ie=k(ze,[["render",Re]]),Ne=(r,a=1)=>Number.isInteger(r)?`${r}%`:`${r.toFixed(a)}%`,Oe=r=>{r.use({install:(a,e)=>{a.config.globalProperties.$t=(o,s)=>_e(o,s||e?.lang),a.config.globalProperties.$money=we,a.config.globalProperties.$percentage=Ne;const{settings:t,apiContext:l}=globalThis.$storefront||{};a.config.globalProperties.$settings=t,a.config.globalProperties.$apiContext=l,a.config.globalProperties.$useId=ue}}),r.component("Fade",Pe),r.component("ALink",Ee),r.component("AImg",Be),r.component("Skeleton",Ie)},$e=C({__name:"CarouselControl",props:{isPrev:{type:Boolean,default:!1}},setup(r,{expose:a}){a();const{axis:e,changeSlide:t}=ce(D),o={axis:e,changeSlide:t,isX:e==="x"};return Object.defineProperty(o,"__isScriptSetup",{enumerable:!1,value:!0}),o}}),je=["aria-label","data-carousel-control"];function He(r,a,e,t,l,o){return f(),g("button",{type:"button","aria-label":e.isPrev?"Anterior":"Próximo",onClick:a[0]||(a[0]=ae(s=>t.changeSlide(e.isPrev?-1:1),["stop","prevent"])),class:p(["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",{},()=>[Q("i",{class:p(["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,je)}const te=k($e,[["render",He]]),D=Symbol("carousel"),Xe=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,l=e,o=E(0);z(V(t,"index"),i=>{if(i!==o.value){const d=i-o.value;_(d,!1)}},{immediate:!0}),z(o,(i,d)=>{i!==d&&l("update:index",i)});const s=E(null),{[t.axis]:y,isScrolling:P,arrivedState:m}=xe(s),u=t.axis==="x",w=c(()=>u?m.left:m.top),T=c(()=>u?m.right:m.bottom),v=E([]),S=E(0),x=E(0),j=()=>{s.value&&(u?(S.value=s.value.scrollWidth,x.value=s.value.offsetWidth):(S.value=s.value.scrollHeight,x.value=s.value.offsetHeight))},H=()=>{if(!s.value)return;let i=[...s.value.children];i.length===1&&i[0].tagName.endsWith("SLOT")&&(i=[...i[0].children]),v.value=i.map(d=>({offset:u?d.offsetLeft:d.offsetTop,size:u?d.offsetWidth:d.offsetHeight}))},X=i=>{let d=o.value+i;if(d>=v.value.length)return 0;d<0&&(d=v.value.length+d);const{offset:B,size:L}=v.value[d]||{};return L?B:0},I=()=>{const i=v.value.findIndex(d=>Math.abs(d.offset-y.value)<=5);i>-1&&(o.value=i||0)};let h;const n=()=>{t.autoplay&&(clearTimeout(h),h=setTimeout(()=>{_(1)},t.autoplay))},_=(i,d=!0)=>{if(v.value.length<2)return;let B=-1;if(y.value+x.value>=S.value)B=0;else{if(d&&(i===1||i===-1)){let L=0,Z=0;for(let M=o.value;M<v.value.length;M++){const{size:K}=v.value[M]||{};if(K&&(L+=1,Z+=K,Z+K*.75>=x.value))break}L&&(i=i>0?L:-L)}B=X(i)}s.value?.scrollTo({[u?"left":"top"]:B,behavior:"smooth"}),n()};z(P,i=>{i?clearTimeout(h):(I(),n())});const N=E(null),U=Se(N);z(U,i=>{i?clearTimeout(h):n()});const O=()=>{s.value&&(j(),H(),I())},W=ge(()=>{s.value&&(u?s.value.scrollLeft=0:s.value.scrollTop=0,O())},400);de(()=>{O(),fe(()=>{s.value&&[...s.value.children].forEach(i=>{i.setAttribute("tabindex","0")})}),n(),window.addEventListener("resize",W)}),z(V(t,"wrapperKey"),O),me(()=>{window.removeEventListener("resize",W),clearTimeout(h)}),ve(D,{autoplay:V(t,"autoplay"),axis:t.axis,changeSlide:_,isBoundStart:w,isBoundEnd:T});const Y={carouselKey:D,props:t,emit:l,activeIndex:o,wrapper:s,currentPos:y,isScrolling:P,arrivedState:m,isX:u,isBoundStart:w,isBoundEnd:T,slideSizes:v,wrapperScrollSize:S,wrapperVisibleSize:x,calcWrapperSize:j,calcSlidesSize:H,calcNextOffset:X,calcCurrentIndex:I,get autoplayTimer(){return h},set autoplayTimer(i){h=i},restartAutoplay:n,changeSlide:_,carousel:N,isHovered:U,calcOnInit:O,onResize:W,CarouselControl:te};return Object.defineProperty(Y,"__isScriptSetup",{enumerable:!1,value:!0}),Y}});function We(r,a,e,t,l,o){return f(),g("div",{ref:"carousel",class:p(`relative ${t.isX?"":"overflow-hidden"}`),"data-carousel":""},[(f(),A(G(e.as),{ref:"wrapper",class:p(["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:R(()=>[b(r.$slots,"default")]),_:3},8,["class"])),b(r.$slots,"controls",J(ee({changeSlide:t.changeSlide,isBoundStart:t.isBoundStart,isBoundEnd:t.isBoundEnd,activeIndex:t.activeIndex})),()=>[t.slideSizes.length>1||e.hasControls?(f(),A(t.CarouselControl,{key:0,"is-prev":""},{default:R(()=>[b(r.$slots,"previous")]),_:3})):F("",!0),t.slideSizes.length>1||e.hasControls?(f(),A(t.CarouselControl,{key:1},{default:R(()=>[b(r.$slots,"next")]),_:3})):F("",!0)])],2)}const Me=k(Xe,[["render",We]]),re=r=>{Oe(r),r.component("Carousel",Me),r.component("CarouselControl",te)},Ke=Object.freeze(Object.defineProperty({__proto__:null,default:re},Symbol.toStringTag,{value:"Module"})),Ve=async r=>{"default"in Ke&&await re(r)},qe=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})}}),nt=r=>async(a,e,t,{client:l})=>{if(!r.hasAttribute("ssr"))return;const o=a.name?`${a.name} Host`:void 0,s={};for(const[u,w]of Object.entries(t))s[u]=()=>$(qe,{value:w,name:u==="default"?void 0:u});const y=l!=="only",m=(y?oe:se)({name:o,render(){let u=$(a,e,s);return De(a.setup)&&(u=$(pe,null,u)),u}});await Ve(m),m.mount(r,y),r.addEventListener("astro:unmount",()=>m.unmount(),{once:!0})};function De(r){const a=r?.constructor;return a&&a.name==="AsyncFunction"}export{nt as default};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import"./server-data.CUHTES8a.js";import{r as C,c as y,b as U}from"./sf-utils.Cigv01cN.js";import{h as x}from"./index.CFw6O-Kt.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="modulepreload",G=function(e){return"/"+e},I={},J=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=G(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":z,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})},V=(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 F={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}=F.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)},H=(e,a)=>l({...a,endpoint:e}),Y=(e,a,t)=>l({...t,method:"post",endpoint:e,body:a}),q=(e,a,t)=>l({...t,method:"put",endpoint:e,body:a}),X=(e,a,t)=>l({...t,method:"patch",endpoint:e,body:a}),N=(e,a)=>l({...a,method:"delete",endpoint:e});l.get=H;l.post=Y;l.put=q;l.patch=X;l.del=N;l.delete=N;const Q="emailForSignIn",P="ecomSession",E={customer:{display_name:"",main_email:""},auth:null},m=V(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(()=>K(R.value)),$=y({get(){return R.value.main_email},set(e){m.customer.main_email=e}});let w;const oe=y(()=>v.value||!!w?.currentUser?.emailVerified),W=()=>{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)}},Z=async()=>(v.value||await B(),m.auth?m.auth.access_token:j()),ee=async()=>{const e=await Z(),a=m.auth,{data:t}=await l.get(`customers/${a.customer_id}`,{accessToken:e});return m.customer=t,t};let k=!1;const ne=e=>{if(k)return;e===void 0&&(e=!window.location.pathname.startsWith("/app/")),k=!0;const a=()=>J(()=>import("./firebase-app.CBckq0Sj.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 ee())}}else W()}),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(Q)).catch(console.error)}}).catch(console.error);e?U(a):a()};export{Q as E,J as _,O as a,l as b,R as c,oe as d,ne as e,$ as f,v as i,W as l,m as s,V as u};
|
|
2
|
+
function __vite__mapDeps(indexes) {
|
|
3
|
+
if (!__vite__mapDeps.viteFileDeps) {
|
|
4
|
+
__vite__mapDeps.viteFileDeps = ["_astro/firebase-app.CBckq0Sj.js","_astro/index-bea2a320.CHELEM8n.js"]
|
|
5
|
+
}
|
|
6
|
+
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
|
|
7
|
+
}
|
package/packages/storefront/dist/client/_astro/{firebase-app.iLdzDVjL.js → firebase-app.CBckq0Sj.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as i,i as a}from"./index-bea2a320.
|
|
1
|
+
import{r as i,i as a}from"./index-bea2a320.CHELEM8n.js";import{g as p,a as f,o as g,s as m}from"./index-bea2a320.CHELEM8n.js";var e="firebase",s="10.8.0";/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2020 Google LLC
|
|
4
4
|
*
|
package/packages/storefront/dist/client/_astro/{format-money.1_HtF5S2.js → format-money.DINpWB0x.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t}from"./sf-utils.
|
|
1
|
+
import{_ as t}from"./sf-utils.Cigv01cN.js";import{p as c}from"./price.CHiL6Z1J.js";const s=(r,o=t.get("currency"),e=t.get("lang"))=>{if(typeof r=="object"?r!==null&&(r=c(r)):typeof r=="string"&&(r=parseFloat(r)),o)try{return r.toLocaleString(e.replace("_","-"),{style:"currency",currency:o})}catch(f){console.error(f)}const n=(o||t.get("currency_symbol"))+" ";return typeof r=="number"?n+r:""},y=s;export{y as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as a}from"./sf-utils.Cigv01cN.js";import{n as g}from"./name.BZA9xqh-.js";const l=(e,t,i=a.get("lang"))=>{let r;return Array.isArray(t)?r=t.find(o=>o.grid_id===e):console.error("`grids` must be array to get grid title"),r?g(r,i):e};export{l as g};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{g as L}from"./_commonjsHelpers.Cpj98o6Y.js";import{a as R}from"./afetch.DPLba2tr.js";import{i as $}from"./i18n.B3skIOFg.js";import{a as D,s as T,w as P}from"./sf-utils.Cigv01cN.js";import{e as U}from"./index.CFw6O-Kt.js";import"./hoisted.ut_nNM_H.js";import"./use-analytics.CQDdNgwF.js";import"./customer-session.CNe1heRH.js";import"./server-data.CUHTES8a.js";import"./shopping-cart.D-w8Z-4p.js";import"./price.CHiL6Z1J.js";import"./name.BZA9xqh-.js";var I={exports:{}};const q=Object.getPrototypeOf({});function E(t){function d(e){return e!=="constructor"&&e!=="prototype"&&e!=="__proto__"}function a(e){let n=0;const s=e.length,i=new Array(s);for(n=0;n<s;++n)i[n]=h(e[n]);return i}function o(e){const n={};if(b&&Object.getPrototypeOf(e)!==q)return b(e);const s=m(e);let i,c,u;for(i=0,c=s.length;i<c;++i)d(u=s[i])&&(n[u]=h(e[u]));return n}function r(e,n){const s=e.length,i=n.length;let c=0;const u=new Array(s+i);for(c=0;c<s;++c)u[c]=h(e[c]);for(c=0;c<i;++c)u[c+s]=h(n[c]);return u}const l=Object.prototype.propertyIsEnumerable;function g(e){const n=Object.keys(e),s=Object.getOwnPropertySymbols(e);for(let i=0,c=s.length;i<c;++i)l.call(e,s[i])&&n.push(s[i]);return n}const m=t&&t.symbols?g:Object.keys,b=typeof t?.cloneProtoObject=="function"?t.cloneProtoObject:void 0;function w(e){return typeof e=="object"&&e!==null&&!(e instanceof RegExp)&&!(e instanceof Date)}function p(e){return typeof e!="object"||e===null}const _=typeof Buffer<"u"?e=>typeof e!="object"||e===null||e instanceof RegExp||e instanceof Date||e instanceof Buffer:e=>typeof e!="object"||e===null||e instanceof RegExp||e instanceof Date,C=t&&typeof t.mergeArray=="function"?t.mergeArray({clone:h,deepmerge:S,getKeys:m,isMergeableObject:w}):r;function h(e){return w(e)?Array.isArray(e)?a(e):o(e):e}function A(e,n){const s={},i=m(e),c=m(n);let u,O,k;for(u=0,O=i.length;u<O;++u)d(k=i[u])&&c.indexOf(k)===-1&&(s[k]=h(e[k]));for(u=0,O=c.length;u<O;++u)d(k=c[u])&&(k in e&&(i.indexOf(k)!==-1&&(s[k]=S(e[k],n[k])),!0)||(s[k]=h(n[k])));return s}function S(e,n){const s=Array.isArray(n),i=Array.isArray(e);return p(n)?n:_(e)?h(n):s&&i?C(e,n):s!==i?h(n):A(e,n)}function y(){switch(arguments.length){case 0:return{};case 1:return h(arguments[0]);case 2:return S(arguments[0],arguments[1])}let e;for(let n=0,s=arguments.length;n<s;++n)e=S(e,arguments[n]);return e}return t&&t.all?y:S}I.exports=E;I.exports.default=E;I.exports.deepmerge=E;var N=I.exports;const x=L(N),W=()=>{const{CMS_REPO_BASE_DIR:t,CMS_LANG:d,CMS_MAX_FILE_SIZE:a,CMS:o}=window;if(!o)throw Error("Missing global CMS");const{domain:r}=window.$storefront?.settings||{},l=t||"functions/ssr/",g=d||"pt",m=_=>$(_,g),b=x();o.registerLocale(g,b(o.getLocale(g),{editor:{editorControl:{field:{optional:"?"}},editorWidgets:{image:{chooseDifferent:m({en:"Change image",pt:"Mudar imagem"}),remove:m({en:"Remove",pt:"Remover"})}}}}));const w=Math.max(a||0,1e6);return{locale:g,load_config_file:!1,publish_mode:"editorial_workflow",media_folder:`${l}public/img/uploads`,public_folder:"/img/uploads",site_url:`https://${r}/~preview`,display_url:`https://${r}`,logo_url:"https://ecom.nyc3.digitaloceanspaces.com/storefront/cms.png",show_preview_links:!0,search:!1,slug:{encoding:"ascii",clean_accents:!0,sanitize_replacement:"-"},collections:m([{name:"config",label:{en:"Settings",pt:"Configurações"},description:{en:"General settings for site identity and metadata",pt:"Configurações gerais para identidade e metadados do site"},delete:!1,editor:{preview:!1},files:[{name:"settings",label:{en:"General config",pt:"Configurações gerais"},file:`${l}content/settings.json`,editor:{preview:!0},fields:[{label:"e-com.plus Store ID",name:"storeId",widget:"hidden"},{label:"Repository",name:"repository",widget:"hidden"},{label:{en:"Domain name",pt:"Domínio"},name:"domain",widget:"string"},{label:{en:"Store name",pt:"Nome da loja"},name:"name",widget:"string"},{label:{en:"Short description",pt:"Descrição curta"},name:"description",widget:"text"},{label:{en:"Logo",pt:"Logomarca"},name:"logo",widget:"image",media_library:{config:{max_file_size:w}}},{label:{en:"Icon",pt:"Ícone"},name:"icon",widget:"image",media_library:{config:{max_file_size:w}}},{label:{en:"Primary color",pt:"Cor primária"},name:"primaryColor",widget:"color"},{label:{en:"Secondary color",pt:"Cor secundária"},name:"secondaryColor",widget:"color",required:!1},{label:{en:"Contact email",pt:"E-mail de contato"},name:"email",widget:"string",required:!1},{label:{en:"Service telephone",pt:"Telefone de atendimento"},name:"phone",widget:"string",required:!1},{label:{en:"Store address",pt:"Endereço da loja"},name:"address",widget:"string",required:!1},{label:{en:"Corporate name",pt:"Razão social da empresa"},name:"corporateName",widget:"string"},{label:{en:"Store document number",pt:"CNPJ"},name:"docNumber",widget:"string"},{label:{en:"Service links",pt:"Links de atendimento"},name:"serviceLinks",widget:"list",summary:"{{fields.title}}",fields:[{label:{en:"Title",pt:"Título"},name:"title",widget:"string"},{label:"Link",name:"href",widget:"string"}]},{label:{en:"Payment methods",pt:"Formas de pagamento"},name:"paymentMethods",widget:"select",multiple:!0,options:["pix","visa","mastercard","elo","amex","hipercard","boleto","diners","discover"]},{label:"WhatsApp",name:"whatsapp",widget:"string",required:!1},{label:"Instagram",name:"instagram",widget:"string",required:!1},{label:"Facebook",name:"facebook",widget:"string",required:!1},{label:"X / Twitter",name:"twitter",widget:"string",required:!1},{label:"YouTube",name:"youtube",widget:"string",required:!1},{label:"TikTok",name:"tiktok",widget:"string",required:!1},{label:"Pinterest",name:"pinterest",widget:"string",required:!1},{label:"Threads",name:"threads",widget:"string",required:!1},{label:{en:"Default locale",pt:"Língua padrão"},name:"lang",widget:"select",options:[{label:"Português",value:"pt_br"},{label:"Inglês",value:"en_us"}],default:"pt_br"},{label:{en:"Currency code",pt:"Código da moeda"},name:"currency",widget:"hidden",default:"BRL"},{label:{en:"Currency symbol",pt:"Símbolo da moeda"},name:"currencySymbol",widget:"hidden",default:"R$"},{label:{en:"Country code",pt:"Código do país"},name:"countryCode",widget:"hidden",default:"BR"},{name:"modules",widget:"hidden"},{name:"cartUrl",widget:"hidden"},{name:"checkoutUrl",widget:"hidden"},{name:"accountUrl",widget:"hidden"},{name:"ordersUrl",widget:"hidden"},{name:"favoritesUrl",widget:"hidden"},{name:"metafields",widget:"hidden"}]}]}])}},v=(t,d,a,o)=>{const r=o?t[a]?.[o]:t[a],l=o?d[a]?.[o]:d[a];if(typeof r!=typeof l)return!1;if(typeof r=="object"&&r&&l){const g=Object.keys(r);return g.length!==Object.keys(l).length?!1:g.every(m=>v(r,l,m))}return r===l},B=(t,d)=>{const a=[];return Object.keys(t).forEach(o=>{if(typeof t[o]=="object"&&t[o]){Object.keys(t[o]).forEach(r=>{Array.isArray(t[o])&&(r=Number(r)),v(t,d,o,r)||a.push([o,r])});return}v(t,d,o)||a.push([o])}),a},F=({createClass:t,h:d})=>{const{host:a}=window.location,o=a.includes("localhost")||a.includes("127.0.0.1"),r=D(null),l=T({}),g=U((b,w)=>{r.value=new URL(`http${o?"":"s"}://${a}/~preview/${b}`),w.forEach(({filename:p,data:_})=>{r.value.searchParams.append(`content:${p}`,JSON.stringify(_))})},100),m="pagePreview";return t({render(){const b=this.props.entry;l.value=b.toJS().data;const w=`
|
|
2
|
+
<iframe
|
|
3
|
+
id="${m}"
|
|
4
|
+
border="0"
|
|
5
|
+
width="100%"
|
|
6
|
+
height="100%"
|
|
7
|
+
style="border: 1px solid #EEE; height: calc(100dvh - 12px)"
|
|
8
|
+
></iframe>`;return d("div",{dangerouslySetInnerHTML:{__html:w}})},componentDidMount(){const b=window.location.hash.split("/entries/").pop()||"",w="",_=document.getElementById("preview-pane").contentWindow,C=_.document.getElementById(m),h=C.contentWindow,A=[];_.addEventListener("message",y=>{y.data.type==="open"&&y.data.filename===b&&(y.data.field&&A.push([y.data.field,y.data.subfield]),h?.postMessage({id:y.data.id,data:l.value}))});const S=()=>g(w,[{filename:b,data:l.value}]);P(l,(y,e)=>{r.value&&e&&B(y,e).every(i=>A.some(([c,u])=>c===i[0]&&u===i[1]))||S()},{immediate:!0}),P(r,y=>{y&&(C.src=y.toString())},{immediate:!0})}})};let f={};const j=()=>{const{createClass:t,h:d,CMS:a}=window;if(a.init({config:f}),t&&d){const o=F({createClass:t,h:d,cmsConfig:f});f.collections.forEach(({name:r,files:l})=>{const g=r.charAt(0);if(!(g==="_"||g===".")){if(l){l.forEach(m=>{a.registerPreviewTemplate(m.name,o)});return}a.registerPreviewTemplate(r,o)}})}},M=async()=>{const{location:t,sessionStorage:d,ECOM_STORE_ID:a,GIT_REPO:o,CMS_CUSTOM_CONFIG:r,CMS_SSO_URL:l="https://app.e-com.plus/pages/login?api_version=2"}=window;f=W(),r&&(f=x()(f,r));const g="__cms_token";let m=d.getItem(g);const b=new URLSearchParams(t.search),w=b.get("sso_token")||b.get("access_token");if(!f.backend?.base_url){if(!m&&!w&&l){const p=new URL(l);p.searchParams.set("sso_store_id",`${a}`),p.searchParams.set("sso_redirect",t.href),t.href=p.toString();return}if(f.backend={repo:o||"_owner/_name",api_root:`https://ecomplus.app/api/${a}/git/github/`,name:"github",base_url:`https://${t.hostname}`,auth_endpoint:t.pathname,branch:"main",commit_messages:{create:"Create {{collection}} “{{slug}}”",update:"Update {{collection}} “{{slug}}”",delete:"Delete {{collection}} “{{slug}}”",uploadMedia:"Upload “{{path}}”",deleteMedia:"[skip ci] Delete “{{path}}”",openAuthoring:"{{message}}",...f.backend?.commit_messages},...f.backend},f.backend.api_root?.startsWith("https://ecomplus.app/")){const p=await R("https://ecomplus.app/api/github-installations",{headers:{"X-Store-ID":`${a}`,Authorization:`Bearer ${w}`}});if(p.ok){const{installations:_}=await p.json();if(Array.isArray(_)){const{repo:C}=f.backend,h=C!=="_owner/_name"?_.find(({repository:A})=>A===C):_[0];h?.gh_token&&h.gh_token.charAt(0)!=="*"&&(m=h.gh_token,delete f.backend.api_root,f.backend.repo=h.repository,f.backend.name="github")}}}}if(m){d.removeItem(g),window.opener||j();const p=window.opener||window;setTimeout(()=>{p.postMessage("authorizing:github","*"),p.postMessage(`authorization:github:success:${JSON.stringify({token:m,provider:f.backend.name})}`,f.backend.base_url)},100);return}if(w){window.history?.pushState("hide-token",document.title,`${t.pathname}${t.search}${t.hash}`);const p=f.backend.name;p&&p!=="git-gateway"&&d.setItem(g,w)}j()};if(window.CMS_MANUAL_INIT=!0,window.CMS)M();else{const t=document.createElement("script");t.src="https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js",t.onload=M,document.body.appendChild(t)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./hoisted.ut_nNM_H.js";import"./afetch.DPLba2tr.js";import"./use-analytics.CQDdNgwF.js";import"./customer-session.CNe1heRH.js";import"./server-data.CUHTES8a.js";import"./sf-utils.Cigv01cN.js";import"./index.CFw6O-Kt.js";import"./shopping-cart.D-w8Z-4p.js";import"./price.CHiL6Z1J.js";import"./name.BZA9xqh-.js";import"./i18n.B3skIOFg.js";const t=window.location.search.includes("status=404")?"404Msg":"5xxMsg";document.getElementById(t).style.display="block";document.getElementById("loadingMsg").style.display="none";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as E,s as b,c as p,a as N}from"./customer-session.CNe1heRH.js";import{s as w}from"./shopping-cart.D-w8Z-4p.js";import{g as v,e as I}from"./use-analytics.CQDdNgwF.js";import{u as O}from"./afetch.DPLba2tr.js";import"./index.CFw6O-Kt.js";import{w as T}from"./sf-utils.Cigv01cN.js";import"./hoisted.ut_nNM_H.js";import"./server-data.CUHTES8a.js";import"./price.CHiL6Z1J.js";import"./name.BZA9xqh-.js";import"./i18n.B3skIOFg.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=()=>{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=R(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(k,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 +1 @@
|
|
|
1
|
-
import{u as C,w as V,
|
|
1
|
+
import{u as C,w as V,e as I,a as R,t as S,b as Y}from"./use-analytics.CQDdNgwF.js";import{a as $}from"./afetch.DPLba2tr.js";import{e as D}from"./index.CFw6O-Kt.js";import"./customer-session.CNe1heRH.js";import"./server-data.CUHTES8a.js";import"./sf-utils.Cigv01cN.js";import"./shopping-cart.D-w8Z-4p.js";import"./price.CHiL6Z1J.js";import"./name.BZA9xqh-.js";import"./i18n.B3skIOFg.js";const h={waiting:Promise.resolve(),params:{content_ids:[],content_name:""}},A=(t,e="BRL",a=!1)=>{const n={currency:e,content_category:t.item_category,content_name:t.item_name,value:t.price,content_type:"product"};return a?(n.contents=[{id:t.item_id,quantity:t.quantity}],Number(t.quantity)<0&&(n.value=0)):n.content_ids=[t.item_id],n},W=async({event:t})=>{if(t.name==="page_view")return h.waiting=new Promise(n=>{setTimeout(n,110)}),h.params.content_name=t.params.page_title,[{name:"PageView"}];const{items:e,currency:a}=t.params;if(t.name==="view_item"&&e){const n=e[0];if(n)return n.item_list_id==="product-page"?[{name:"ViewContent",params:A(n,a)}]:(e.forEach(({item_id:r})=>{h.params.content_ids.push(r)}),h.params.content_ids.length>e.length?[{name:null}]:(await h.waiting,[{name:"ViewContent",params:{...h.params,content_type:"product"}}]))}if((t.name==="add_to_cart"||t.name==="remove_from_cart")&&e){const n=t.name==="add_to_cart";return e.map(r=>({name:"AddToCart",params:A({...r,quantity:n?r.quantity||1:-(r.quantity||1)},a,!0)}))}return[{name:null}]},y={waiting:Promise.resolve(),params:{description:"",contents:[]}},E=(t,e=!1)=>{const a={content_id:t.item_id,content_name:t.item_name,price:t.price,content_category:t.item_category,brand:t.item_brand};return e&&(a.quantity=t.quantity),a},F=async({event:t})=>{if(t.name==="page_view")return y.waiting=new Promise(n=>{setTimeout(n,110)}),y.params.description=t.params.page_title,[{name:"PageView"}];const{items:e,currency:a}=t.params;if(t.name==="view_item"&&e){const n=e[0];if(n)return n.item_list_id==="product-page"?[{name:"ViewContent",params:{contents:[E(n)],content_type:"product",currency:a,value:n.price}}]:(e.forEach(r=>{y.params.contents.push(E(r))}),y.params.contents.length>e.length?[{name:null}]:(await y.waiting,[{name:"ViewContent",params:{...y.params,content_type:"product",currency:a}}]))}if((t.name==="add_to_cart"||t.name==="remove_from_cart")&&e){const n=t.name==="add_to_cart";return e.map(r=>{const l=r.quantity||1,{price:m}=r;return{name:"AddToCart",params:{contents:[E({...r,quantity:n?l:-l},!0)],content_type:"product",currency:a,value:n&&typeof m=="number"?l*m:0}}})}return[{name:null}]},H={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1,SITE:"https://demo.ecomplus.app",ASSETS_PREFIX:void 0}.DEPLOY_RAND||"_";let b=[];const M=D(t=>{$("/_analytics",{method:"POST",body:{exp_variant_string:t?.expVariantString,...Y(),events:b}}),b=[]},200);if(!window.location.search.includes(`__isrV=${H}`)){const t=C(),e=r=>{b.push(r),M(t)};V(async r=>{const{name:l,params:m}=r.event;e({type:"gtag",name:l,params:m});const{gtag:i,dataLayer:s,fbq:d,ttq:o}=window;typeof i=="function"&&i("event",l,m),s&&typeof s.push=="function"&&s.push(["event",l,m]),(await W(r)).forEach(u=>{u.name&&(e({type:"fbq",...u}),typeof d=="function"&&d("track",u.name,u.params))}),(await F(r)).forEach(u=>{u.name&&(e({type:"ttk",...u}),typeof o?.page=="function"&&(u.name==="PageView"?o.page():o.track(u.name,u.params)))})});let a="";const n=()=>{const r=window.location.toString();r!==a&&(I("page_view",{...R(),page_location:r,client_id:S.g_client_id||S.client_id}),a=r)};n(),window.addEventListener("storefront:apiContext",()=>{try{window.dataLayer.push(function(){this.reset(),n()})}catch{n()}})}const g=t=>history.replaceState(t,""),P=!!document.startViewTransition,w=()=>!!document.querySelector('[name="astro-view-transitions-enabled"]'),k=t=>document.dispatchEvent(new Event(t)),x=()=>k("astro:load"),f="data-astro-transition-persist";let p=history.state?.index||0;!history.state&&w()&&g({index:p,scrollY:0});const O=(t,e)=>{let a=!1,n=!1;return(...r)=>{if(a){n=!0;return}t(...r),a=!0,setTimeout(()=>{n&&(n=!1,t(...r)),a=!1},e)}};async function G(t){const e=await fetch(t),a=await e.text();return{ok:e.ok,html:a}}function q(){const t=document.querySelector('[name="astro-view-transitions-fallback"]');return t?t.getAttribute("content"):"animate"}function L(){for(const t of document.scripts)t.dataset.astroExec=""}function B(){let t=Promise.resolve();for(const e of Array.from(document.scripts)){if(e.dataset.astroExec==="")continue;const a=document.createElement("script");a.innerHTML=e.innerHTML;for(const n of e.attributes){if(n.name==="src"){const r=new Promise(l=>{a.onload=l});t=t.then(()=>r)}a.setAttribute(n.name,n.value)}a.dataset.astroExec="",e.replaceWith(a)}return t}const K=new DOMParser;async function v(t,e,a){const n=K.parseFromString(t,"text/html"),r=i=>{const s=i.getAttribute(f),d=s&&n.head.querySelector(`[${f}="${s}"]`);if(d)return d;if(i.matches("link[rel=stylesheet]")){const o=i.getAttribute("href");return n.head.querySelector(`link[rel=stylesheet][href="${o}"]`)}if(i.tagName==="SCRIPT"){let o=i;for(const c of n.scripts)if(o.textContent&&o.textContent===c.textContent||o.type===c.type&&o.src&&o.src===c.src)return c}return null},l=()=>{n.querySelectorAll("head noscript").forEach(o=>o.remove());const i=document.documentElement,s=[...i.attributes].filter(({name:o})=>(i.removeAttribute(o),o.startsWith("data-astro-")));[...n.documentElement.attributes,...s].forEach(({name:o,value:c})=>i.setAttribute(o,c));for(const o of Array.from(document.head.children)){const c=r(o);c?c.remove():o.remove()}document.head.append(...n.head.children);const d=document.body;document.body.replaceWith(n.body);for(const o of d.querySelectorAll(`[${f}]`)){const c=o.getAttribute(f),_=document.querySelector(`[${f}="${c}"]`);_&&_.replaceWith(o)}if(scrollTo({left:0,top:0,behavior:"instant"}),e?.scrollY===0&&location.hash){const o=decodeURIComponent(location.hash.slice(1)),c=document.getElementById(o);c&&(e.scrollY=c.offsetTop,g(e),c.scrollIntoView())}else e&&e.scrollY!==0&&scrollTo(0,e.scrollY);k("astro:beforeload")},m=[];for(const i of n.querySelectorAll("head link[rel=stylesheet]"))if(!document.querySelector(`[${f}="${i.getAttribute(f)}"], link[rel=stylesheet]`)){const s=document.createElement("link");s.setAttribute("rel","preload"),s.setAttribute("as","style"),s.setAttribute("href",i.getAttribute("href")),m.push(new Promise(d=>{["load","error"].forEach(o=>s.addEventListener(o,d)),document.head.append(s)}))}if(m.length&&await Promise.all(m),a==="animate"){let i=!1;addEventListener("animationstart",()=>i=!0,{once:!0}),document.documentElement.dataset.astroTransitionFallback="old",await new Promise(s=>{const d=()=>{removeEventListener("animationend",d),clearTimeout(o),l(),s(!0),document.documentElement.dataset.astroTransitionFallback="new"};addEventListener("animationend",d,{once:!0});let o=setTimeout(()=>!i&&d())})}else l()}async function T(t,e,a){let n;const{html:r,ok:l}=await G(e);if(!l){location.href=e;return}document.documentElement.dataset.astroTransition=t,P?n=document.startViewTransition(()=>v(r,a)).finished:n=v(r,a,q());try{await n}finally{await B(),L(),x()}}function N(t){if(document.querySelector(`link[rel=prefetch][href="${t}"]`))return;if(navigator.connection){let a=navigator.connection;if(a.saveData||/(2|3)g/.test(a.effectiveType||""))return}let e=document.createElement("link");e.setAttribute("rel","prefetch"),e.setAttribute("href",t),document.head.append(e)}(P||q()!=="none")&&!location.pathname.startsWith("/app/")&&!location.pathname.startsWith("/admin/")&&(L(),document.addEventListener("click",t=>{let e=t.target;if(e instanceof Element&&e.tagName!=="A"&&(e=e.closest("a")),!e||!(e instanceof HTMLAnchorElement)||e.dataset.astroReload!==void 0||e.hasAttribute("download")||!e.href||e.pathname.startsWith("/app/")||e.pathname.startsWith("/admin/")||e.target&&e.target!=="_self"||e.origin!==location.origin||t.button!==0||t.metaKey||t.ctrlKey||t.altKey||t.shiftKey||t.defaultPrevented||!w())return;if(location.pathname===e.pathname&&location.search===e.search){if(e.hash)return;if(t.preventDefault(),g({...history.state,scrollY}),scrollTo({left:0,top:0,behavior:"instant"}),location.hash){const n={index:++p,scrollY:0};history.pushState(n,"",e.href)}return}t.preventDefault(),T("forward",e.href,{index:++p,scrollY:0});const a={index:p,scrollY};g({index:p-1,scrollY}),history.pushState(a,"",e.href)}),addEventListener("popstate",t=>{if(!w()&&t.state){location.reload();return}if(t.state===null)return;const e=history.state,a=e?.index??p+1,n=a>p?"forward":"back";T(n,location.href,e),p=a}),["mouseenter","touchstart","focus"].forEach(t=>{document.addEventListener(t,e=>{if(e.target instanceof HTMLAnchorElement){let a=e.target;a.origin===location.origin&&a.pathname!==location.pathname&&!a.pathname.startsWith("/app/")&&!a.pathname.startsWith("/admin/")&&a.dataset.astroReload===void 0&&!a.hasAttribute("download")&&a.role!=="button"&&w()&&N(a.pathname)}},{passive:!0,capture:!0})}),addEventListener("load",x),addEventListener("scroll",O(()=>{history.state&&g({...history.state,scrollY})},300),{passive:!0}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as t,_ as l}from"./sf-utils.Cigv01cN.js";const o=(e,f=l.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[t]||e[p];{const r=Array.isArray(e)?[]:{};for(const s in e)e[s]!==void 0&&(r[s]=o(e[s],f));return r}}return e};export{o as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o=t=>{let s={width:0,height:0},i;return typeof t=="object"&&t!==null?i=t.size:i=t,typeof i=="string"&&i.split("x").forEach((e,h)=>{e=parseFloat(e),isNaN(e)||(s[h===0?"width":"height"]=e)}),s};export{o as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as t}from"./sf-utils.Cigv01cN.js";const g=(l,n,o)=>{if(o||(o=t.get("default_img_size")||"normal"),l){let{pictures:a,picture:i}=l;i||a||(Array.isArray(l)?a=l:i=l),Array.isArray(a)&&(i=n&&a.filter(r=>r._id===n)[0]||a[0]);let f;if(typeof i=="object"&&i!==null){if(f=i[o],f&&f.url)return f;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 e=0;e<r.length;e++){const s=r[e];if(i[s]&&i[s].url)return i[s]}for(const e in i)if(i[e]&&i[e].url)return i[e]}}};export{g as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{P as C,_ as A,w as b,Q as T,R as W,a as y,S as O,c as _,T as R,U as k,V as I,W as M,X as V}from"./sf-utils.Cigv01cN.js";C.$ecomConfig||A;function z(e){return M()?(V(e),!0):!1}function H(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():W(e)}const F=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const E=Object.prototype.toString,J=e=>E.call(e)==="[object Object]",f=()=>{},K=G();function G(){var e,t;return F&&((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 w(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 S(e,t={}){let n,o,i=f;const r=s=>{clearTimeout(s),i(),i=f};return s=>{const u=m(e),a=m(t.maxWait);return n&&r(n),u<=0||a!==void 0&&a<=0?(o&&(r(o),o=null),Promise.resolve(s())):new Promise((l,v)=>{i=t.rejectOnCancel?v:l,a&&!o&&(o=setTimeout(()=>{n&&r(n),o=null,l(s())},a)),n=setTimeout(()=>{o&&r(o),o=null,l(s())},u)})}}function L(...e){let t=0,n,o=!0,i=f,r,c,s,u,a;!k(e[0])&&typeof e[0]=="object"?{delay:c,trailing:s=!0,leading:u=!0,rejectOnCancel:a=!1}=e[0]:[c,s=!0,u=!0,a=!1]=e;const l=()=>{n&&(clearTimeout(n),n=void 0,i(),i=f)};return x=>{const d=m(c),h=Date.now()-t,p=()=>r=x();return l(),d<=0?(t=Date.now(),p()):(h>d&&(u||!o)?(t=Date.now(),p()):s&&(r=new Promise((g,D)=>{i=a?D:g,n=setTimeout(()=>{t=Date.now(),o=!0,g(p()),l()},Math.max(0,d-h))})),!u&&!n&&(n=setTimeout(()=>o=!0,d)),o=!1,r)}}function U(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:O(t),pause:n,resume:o,eventFilter:i}}function Q(e){const t=Object.create(null);return n=>t[n]||(t[n]=e(n))}const X=/-(\w)/g,N=Q(e=>e.replace(X,(t,n)=>n?n.toUpperCase():""));function Y(e,t=!1,n="Timeout"){return new Promise((o,i)=>{setTimeout(t?()=>i(n):o,e)})}function $(e){return e||I()}function Z(e,t=200,n={}){return w(S(t,n),e)}function ee(e,t=200,n=!1,o=!0,i=!1){return w(L(t,n,o,i),e)}function j(e,t,n={}){const{eventFilter:o=P,...i}=n;return b(e,w(o,t),i)}function te(e,t,n={}){const{eventFilter:o,...i}=n,{eventFilter:r,pause:c,resume:s,isActive:u}=U(o);return{stop:j(e,t,{...i,eventFilter:r}),pause:c,resume:s,isActive:u}}function ne(e,t=!0,n){$()?R(e,n):t?e():T(e)}function q(e,t,n={}){const{immediate:o=!0}=n,i=y(!1);let r=null;function c(){r&&(clearTimeout(r),r=null)}function s(){i.value=!1,c()}function u(...a){c(),i.value=!0,r=setTimeout(()=>{i.value=!1,r=null,e(...a)},m(t))}return o&&(i.value=!0,F&&u()),z(s),{isPending:O(i),start:u,stop:s}}function oe(e=1e3,t={}){const{controls:n=!1,callback:o}=t,i=q(o??f,e,t),r=_(()=>!i.isPending.value);return n?{ready:r,...i}:r}function ie(e,t,n={}){const{debounce:o=0,maxWait:i=void 0,...r}=n;return j(e,t,{...r,eventFilter:S(o,{maxWait:i})})}function re(e,t,n){const o=b(e,(...i)=>(T(()=>o()),t(...i)),n);return o}export{J as a,ne as b,N as c,K as d,Z as e,z as f,re as g,ie as h,F as i,oe as j,H as m,f as n,Y as p,m as t,ee as u,te as w};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m as X,w as q,i as z,n as $,a as B,t as A,c as Q,u as Y,b as G,d as J,e as Z,f as ee}from"./index.CFw6O-Kt.js";import{s as te,r as D,w as oe,d as j,a as C,c as U}from"./sf-utils.Cigv01cN.js";function le(n={}){const{inheritAttrs:u=!0}=n,r=te(),a=j({setup(m,{slots:e}){return()=>{r.value=e.default}}}),y=j({inheritAttrs:u,setup(m,{attrs:e,slots:i}){return()=>{var p;r.value;const f=(p=r.value)==null?void 0:p.call(r,{...ne(e),$slots:i});return u&&f?.length===1?f[0]:f}}});return X({define:a,reuse:y},[a,y])}function ne(n){const u={};for(const r in n)u[Q(r)]=n[r];return u}function O(n){var u;const r=A(n);return(u=r?.$el)!=null?u:r}const R=z?window:void 0;function S(...n){let u,r,a,y;if(typeof n[0]=="string"||Array.isArray(n[0])?([r,a,y]=n,u=R):[u,r,a,y]=n,!u)return $;Array.isArray(r)||(r=[r]),Array.isArray(a)||(a=[a]);const m=[],e=()=>{m.forEach(b=>b()),m.length=0},i=(b,v,o,c)=>(b.addEventListener(v,o,c),()=>b.removeEventListener(v,o,c)),p=oe(()=>[O(u),A(y)],([b,v])=>{if(e(),!b)return;const o=B(v)?{...v}:v;m.push(...r.flatMap(c=>a.map(h=>i(b,c,h,o))))},{immediate:!0,flush:"post"}),f=()=>{p(),e()};return ee(f),f}let K=!1;function ae(n,u,r={}){const{window:a=R,ignore:y=[],capture:m=!0,detectIframe:e=!1}=r;if(!a)return $;J&&!K&&(K=!0,Array.from(a.document.body.children).forEach(o=>o.addEventListener("click",$)),a.document.documentElement.addEventListener("click",$));let i=!0;const p=o=>y.some(c=>{if(typeof c=="string")return Array.from(a.document.querySelectorAll(c)).some(h=>h===o.target||o.composedPath().includes(h));{const h=O(c);return h&&(o.target===h||o.composedPath().includes(h))}}),b=[S(a,"click",o=>{const c=O(n);if(!(!c||c===o.target||o.composedPath().includes(c))){if(o.detail===0&&(i=!p(o)),!i){i=!0;return}u(o)}},{passive:!0,capture:m}),S(a,"pointerdown",o=>{const c=O(n);i=!p(o)&&!!(c&&!o.composedPath().includes(c))},{passive:!0}),e&&S(a,"blur",o=>{setTimeout(()=>{var c;const h=O(n);((c=a.document.activeElement)==null?void 0:c.tagName)==="IFRAME"&&!h?.contains(a.document.activeElement)&&u(o)},0)})].filter(Boolean);return()=>b.forEach(o=>o())}function ie(n,u={}){const{delayEnter:r=0,delayLeave:a=0,window:y=R}=u,m=C(!1);let e;const i=p=>{const f=p?r:a;e&&(clearTimeout(e),e=void 0),f?e=setTimeout(()=>m.value=p,f):m.value=p};return y&&(S(n,"mouseenter",()=>i(!0),{passive:!0}),S(n,"mouseleave",()=>i(!1),{passive:!0})),m}const N=1;function ce(n,u={}){const{throttle:r=0,idle:a=200,onStop:y=$,onScroll:m=$,offset:e={left:0,right:0,top:0,bottom:0},eventListenerOptions:i={capture:!1,passive:!0},behavior:p="auto",window:f=R,onError:b=s=>{console.error(s)}}=u,v=C(0),o=C(0),c=U({get(){return v.value},set(s){x(s,void 0)}}),h=U({get(){return o.value},set(s){x(void 0,s)}});function x(s,T){var w,P,k;if(!f)return;const g=A(n);g&&((k=g instanceof Document?f.document.body:g)==null||k.scrollTo({top:(w=A(T))!=null?w:h.value,left:(P=A(s))!=null?P:c.value,behavior:A(p)}))}const _=C(!1),l=D({left:!0,right:!1,top:!0,bottom:!1}),t=D({left:!1,right:!1,top:!1,bottom:!1}),d=s=>{_.value&&(_.value=!1,t.left=!1,t.right=!1,t.top=!1,t.bottom=!1,y(s))},E=Z(d,r+a),H=s=>{var T;if(!f)return;const w=((T=s?.document)==null?void 0:T.documentElement)||s?.documentElement||O(s),{display:P,flexDirection:k}=getComputedStyle(w),g=w.scrollLeft;t.left=g<v.value,t.right=g>v.value;const F=Math.abs(g)<=(e.left||0),I=Math.abs(g)+w.clientWidth>=w.scrollWidth-(e.right||0)-N;P==="flex"&&k==="row-reverse"?(l.left=I,l.right=F):(l.left=F,l.right=I),v.value=g;let L=w.scrollTop;s===f.document&&!L&&(L=f.document.body.scrollTop),t.top=L<o.value,t.bottom=L>o.value;const V=Math.abs(L)<=(e.top||0),W=Math.abs(L)+w.clientHeight>=w.scrollHeight-(e.bottom||0)-N;P==="flex"&&k==="column-reverse"?(l.top=W,l.bottom=V):(l.top=V,l.bottom=W),o.value=L},M=s=>{var T;if(!f)return;const w=(T=s.target.documentElement)!=null?T:s.target;H(w),_.value=!0,E(s),m(s)};return S(n,"scroll",r?Y(M,r,!0,!1):M,i),G(()=>{try{const s=A(n);if(!s)return;H(s)}catch(s){b(s)}}),S(n,"scrollend",d,i),{x:c,y:h,isScrolling:_,arrivedState:l,directions:t,measure(){const s=A(n);f&&s&&H(s)}}}function ue(n="history",u={}){const{initialValue:r={},removeNullishValues:a=!0,removeFalsyValues:y=!1,write:m=!0,window:e=R}=u;if(!e)return D(r);const i=D({});function p(){if(n==="history")return e.location.search||"";if(n==="hash"){const l=e.location.hash||"",t=l.indexOf("?");return t>0?l.slice(t):""}else return(e.location.hash||"").replace(/^#/,"")}function f(l){const t=l.toString();if(n==="history")return`${t?`?${t}`:""}${e.location.hash||""}`;if(n==="hash-params")return`${e.location.search||""}${t?`#${t}`:""}`;const d=e.location.hash||"#",E=d.indexOf("?");return E>0?`${d.slice(0,E)}${t?`?${t}`:""}`:`${d}${t?`?${t}`:""}`}function b(){return new URLSearchParams(p())}function v(l){const t=new Set(Object.keys(i));for(const d of l.keys()){const E=l.getAll(d);i[d]=E.length>1?E:l.get(d)||"",t.delete(d)}Array.from(t).forEach(d=>delete i[d])}const{pause:o,resume:c}=q(i,()=>{const l=new URLSearchParams("");Object.keys(i).forEach(t=>{const d=i[t];Array.isArray(d)?d.forEach(E=>l.append(t,E)):a&&d==null||y&&!d?l.delete(t):l.set(t,d)}),h(l)},{deep:!0});function h(l,t){o(),t&&v(l),e.history.replaceState(e.history.state,e.document.title,e.location.pathname+f(l)),c()}function x(){m&&h(b(),!0)}S(e,"popstate",x,!1),n!=="history"&&S(e,"hashchange",x,!1);const _=b();return _.keys().next().value?v(_):Object.assign(i,r),i}export{ce as a,ie as b,le as c,ae as o,ue as u};
|
package/packages/storefront/dist/client/_astro/{modules-info.HP6478mG.js → modules-info.BHKiT6oA.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as g,u as h,a as d}from"./afetch.
|
|
1
|
+
import{l as g,u as h,a as d}from"./afetch.DPLba2tr.js";import"./server-data.CUHTES8a.js";import{r as b,b as v,c as p}from"./sf-utils.Cigv01cN.js";import{f as O}from"./format-money.DINpWB0x.js";const I={list_payments:{},calculate_shipping:{},apply_discount:{}},i=b(I);g.then(n=>{Object.assign(i,n)});const S=(n,r)=>{const{hostname:l}=window.location,{domain:o}=globalThis.$storefront.settings,a=l!=="localhost"&&l!=="127.0.0.1"?`https://${o}/_api/modules/`:"/_api/modules/";return d(`${a}${n}`,r)};{const n="MODULES_INFO",r=sessionStorage.getItem(n);if(r)try{const o=JSON.parse(r);o.__timestamp>=Date.now()-1e3*60*5?(delete o.__timestamp,Object.assign(i,o)):sessionStorage.removeItem(n)}catch{sessionStorage.removeItem(n)}v(()=>{const o=[];["list_payments","calculate_shipping"].forEach(a=>{Object.keys(i[a]).length||o.push({modName:a})}),Object.keys(h).length&&o.push({modName:"apply_discount",reqOptions:{method:"POST",body:{utm:h}}}),o.forEach(({modName:a,reqOptions:u})=>{S(a,u).then(async m=>{if(m.ok){const s={};i[a]=s;const{result:f}=await m.json();Array.isArray(f)&&f.forEach(({error:y,response:c})=>{if(!y){let t,e;switch(a){case"calculate_shipping":t="free_shipping_from_value",e=c[t],typeof e=="number"&&(s[t]===void 0||e<s[t])&&(s[t]=e);break;case"list_payments":t="installments_option",e=c[t],e&&(!s[t]||e.monthly_interest<s[t].monthly_interest||e.max_number>s[t].max_number)&&(s[t]=e),t="discount_option",e=c[t],e&&(!s[t]||e.value>s[t].value)&&c.payment_gateways.forEach(({discount:_})=>{_&&_.apply_at!=="freight"&&_.value===e.value&&(s[t]={apply_at:_.apply_at,...e})}),t="loyalty_points_programs",e=c[t],e&&(s[t]={...s[t],...e});break;default:t="available_extra_discount",e=c[t],e&&(!s[t]||e.value>s[t].value)&&(s[t]=e)}}}),sessionStorage.setItem(n,JSON.stringify({...i,__timestamp:Date.now()}))}}).catch(console.error)})})}const j=p(()=>i.calculate_shipping.free_shipping_from_value),$=p(()=>i.list_payments.installments_option),D=p(()=>i.list_payments.discount_option),F=p(()=>i.list_payments.loyalty_points_programs),J=p(()=>i.apply_discount.available_extra_discount),x=(n,r,l,o=O)=>p(()=>{const a=`{${l}}`,u=n.indexOf(a);if(u>-1){const m=i[r][l];if(m){const s=o(m);return n.substring(0,u)+s+n.substring(u+a.length)}return""}return n}),M=n=>x(n,"calculate_shipping","free_shipping_from_value");export{J as a,S as b,D as d,j as f,$ as i,F as l,M as p};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e}from"./sf-utils.Cigv01cN.js";import{i as r}from"./i18n.B3skIOFg.js";const s=(i,n=e.get("lang"))=>n&&i.i18n&&i.i18n[n]?i.i18n[n]:i.name||i.title||r(i.i18n,n)||"";export{s as n};
|
|
@@ -0,0 +1,4 @@
|
|
|
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;this.heavyAppended||!t.opener.isOpen||t.mainScroll.isShifted()||!this.isActive&&!!0||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",l=o+tt(i[t],.995);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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a=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},i=e=>a(e)?e.price:e?typeof e.final_price=="number"?e.final_price:Math.max(e.base_price||0,e.price||0):0;export{a as o,i as p};
|