@swell/apps-sdk 1.0.28 → 1.0.29

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/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var N4=Object.create;var E1=Object.defineProperty;var I4=Object.getOwnPropertyDescriptor;var $4=Object.getOwnPropertyNames;var j4=Object.getPrototypeOf,O4=Object.prototype.hasOwnProperty;var U3=(i,t)=>{for(var e in t)E1(i,e,{get:t[e],enumerable:!0})},K3=(i,t,e,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of $4(t))!O4.call(i,c)&&c!==e&&E1(i,c,{get:()=>t[c],enumerable:!(l=I4(t,c))||l.enumerable});return i};var v1=(i,t,e)=>(e=i!=null?N4(j4(i)):{},K3(t||!i||!i.__esModule?E1(e,"default",{value:i,enumerable:!0}):e,i)),G4=i=>K3(E1({},"__esModule",{value:!0}),i);var dt={};U3(dt,{CACHE_TIMEOUT_RESOURCES:()=>m2,DEFAULT_QUERY_PAGE_LIMIT:()=>A3,DeferredShopifyResource:()=>O,LANG_TO_COUNTRY_CODES:()=>H3,LiquidSwell:()=>C1,MAX_QUERY_PAGE_LIMIT:()=>Z3,MockRecordResource:()=>I3,MockRecordSingleton:()=>$3,PageError:()=>M1,PageNotFound:()=>x1,ShopifyArticle:()=>u1,ShopifyBlog:()=>X1,ShopifyCart:()=>m1,ShopifyCollection:()=>g1,ShopifyCollections:()=>e2,ShopifyCompatibility:()=>p1,ShopifyCustomer:()=>U,ShopifyFont:()=>d1,ShopifyForm:()=>L1,ShopifyLink:()=>w1,ShopifyLocalization:()=>f1,ShopifyOrder:()=>e1,ShopifyPage:()=>c2,ShopifyPaginate:()=>o1,ShopifyPredictiveSearch:()=>i2,ShopifyProduct:()=>P,ShopifyResource:()=>v,ShopifySearch:()=>a2,ShopifyVariant:()=>V,StorefrontResource:()=>T,Swell:()=>A1,SwellBackendAPI:()=>p2,SwellError:()=>q1,SwellStorefrontCollection:()=>_,SwellStorefrontPagination:()=>z1,SwellStorefrontRecord:()=>C,SwellStorefrontResource:()=>y1,SwellStorefrontSingleton:()=>K,SwellTheme:()=>b3,ThemeColor:()=>S,ThemeFont:()=>R,ThemeForm:()=>$,ThemeFormErrors:()=>I1,adaptShopifyFontData:()=>s2,adaptShopifyFormData:()=>r2,adaptShopifyMenuData:()=>n2,arrayToObject:()=>z3,brightness:()=>u0,deferMenuItemUrlAndResource:()=>l1,dehydrateSwellRefsInStorefrontResources:()=>_4,diff:()=>W1,findCircularReferences:()=>I0,findEditorSetting:()=>T3,findThemeSettingsByType:()=>_3,fontMap:()=>U1,forEachKeyDeep:()=>F3,getAllSections:()=>M3,getBlog:()=>Q0,getBlogs:()=>J0,getCategories:()=>G0,getCategory:()=>R4,getCategoryWithProducts:()=>U0,getContentEntry:()=>B3,getContentList:()=>L4,getContentModel:()=>K0,getCountryCodeFromLocale:()=>N0,getEasyblocksBackend:()=>B4,getEasyblocksComponentDefinitions:()=>pt,getEasyblocksPagePropsWithConfigs:()=>mt,getEasyblocksPropsFromThemeConfigs:()=>lt,getLayoutSectionGroups:()=>x3,getMenuItemStorefrontUrl:()=>i1,getMenuItemUrlAndResource:()=>s4,getMenuItemValueId:()=>n4,getPage:()=>W0,getPageSections:()=>Y1,getProduct:()=>j0,getProducts:()=>E3,getProductsFiltered:()=>O0,getSectionSettingsFromProps:()=>F4,getThemeSettingsFromProps:()=>q4,isArray:()=>V0,isObject:()=>P1,md5:()=>Z1,mix:()=>_1,removeCircularReferences:()=>$0,resolveAsyncResources:()=>W,resolveLookupCollection:()=>r4,resolveMenuItemUrlAndResource:()=>c4,resolveMenuItems:()=>v3,resolveMenuSettings:()=>y3,resolveSectionSettings:()=>Q1,resolveThemeSettings:()=>k1,stringifyQueryParams:()=>E,systemFonts:()=>r0,themeConfigQuery:()=>C3,toBase64:()=>q3});module.exports=G4(dt);var k4=v1(require("swell-js"),1),P4=v1(require("qs"),1);var z4=v1(require("qs"),1),b4=require("lodash-es");var D3=require("lodash-es");var D1=require("lodash-es");var M=require("lodash-es");var g3=require("liquidjs");var h5=require("lodash-es");var I=require("liquidjs");function g2(i){return class extends I.Tag{value;branches=[];elseTemplates=[];isBlock=!1;constructor(e,l,c){super(e,l,c);let a=this.tokenizer.p,n=this.tokenizer.readValue()?.getText();this.isBlock=!!n?.startsWith("block."),this.tokenizer.p=a,this.value=new I.Value(this.tokenizer.readFilteredValue(),this.liquid),this.elseTemplates=[];let s=[],r=0,m=this.liquid.parser.parseStream(l).on("tag:when",p=>{if(r>0)return;s=[];let o=[];for(;!p.tokenizer.end();)o.push(p.tokenizer.readValueOrThrow()),p.tokenizer.skipBlank(),p.tokenizer.peek()===","?p.tokenizer.readTo(","):p.tokenizer.readTo("or");this.branches.push({values:o,templates:s})}).on("tag:else",()=>{r++,s=this.elseTemplates}).on("tag:endcase",()=>m.stop()).on("template",p=>{(s!==this.elseTemplates||r===1)&&s.push(p)}).on("end",()=>{throw new Error(`tag ${e.getText()} not closed`)});m.start()}*render(e){let l=this.liquid.renderer,c=(0,I.toValue)(yield this.value.value(e,e.opts.lenientIf)),a=!1,n="";for(let s of this.branches)for(let r of s.values){let m=yield(0,I.evalToken)(r,e,e.opts.lenientIf);if(c===m){let p=yield l.renderTemplates(s.templates,e);n+=this.isBlock&&i.isEditor?`<span class="swell-block">${p}</span>`:p,a=!0;break}}return a||(n+=yield l.renderTemplates(this.elseTemplates,e)),n}}}var r1=require("liquidjs");var Mt=require("liquidjs");var U4=Object.prototype.toString,Pt=Object.hasOwnProperty,B1=class{liquidMethodMissing(t){}},n1=class extends B1{i;length;name;test="test";index;index0;first;last;rindex;rindex0;constructor(t,e,l){super(),this.length=t,this.name=`${l}-${e}`,this.i=0,this.index=1,this.index0=0,this.first=!0,this.last=!1,this.rindex=t,this.rindex0=t-1}next(){this.i++,this.index++,this.index0++,this.first=!1,this.last=this.i===this.length-1,this.rindex--,this.rindex0--}valueOf(){return JSON.stringify(this)}};function Y(i){return i instanceof B1&&J3(i.valueOf)?i.valueOf():i}function W3(i){return typeof i=="string"}function d2(i){return typeof i=="number"}function J3(i){return typeof i=="function"}function Q3(i){return i==null}function s1(i){return U4.call(i)==="[object Array]"}function L(i){let t=typeof i;return i!==null&&(t==="object"||t==="function")}function K4(i){return L(i)&&Symbol.iterator in i}function W4(i){return L(i)&&typeof i.then=="function"}function Y3(i,t){return!J4(i,t)}function J4(i,t){return t.opts.jsTruthy?!i:i===!1||i===void 0||i===null}function S1(i){return L(i)&&J3(i.equals)}function X3(i){return Q3(i)?[]:s1(i)?i:[i]}function V1(i){return i=Y(i),s1(i)?i:W3(i)&&i.length>0?[i]:K4(i)?Array.from(i):L(i)?Object.entries(i).reduce((t,[e,l])=>(t.push({id:e,...l}),t),[]):[]}function w2(i){return i=Y(i),W3(i)?i:Q3(i)?"":s1(i)?i.map(t=>w2(t)).join(""):String(i)}function Z(i){if(Array.isArray(i))return i.reduce((t,e,l)=>{if(Array.isArray(e)){let[c,a]=e;t[c]=a}else l%2===0&&(t[e]=i[l+1]);return t},{});if(L(i)){let t={},e=Object.values(i);for(let l=0;l<e.length;l+=2)t[e[l]]=e[l+1];return t}return{}}async function N1(i,t=0){let e=i;e instanceof T&&(e=await e.resolve()),await t5(e);let l=[];return JSON.stringify(e,(c,a)=>{if(typeof a=="object"&&a!==null){if(l.includes(a))return;l.push(a)}return a},t)}async function t5(i,t=new WeakSet){await e5(i,async(e,l)=>{if(!L(l))return;let c=l[e];if(W4(c))l[e]=await c,await t5(l[e],t);else if(typeof c=="object"&&c!==null){if(t.has(c))return!1;t.add(c)}})}async function e5(i,t){if(!(typeof i!="object"||i===null)){for(let e in i)if(Object.prototype.hasOwnProperty.call(i,e)&&await t(e,i)!==!1){let c=i[e];typeof c=="object"&&c!==null&&await e5(c,t)}}}var l5=["offset","limit","reversed"];function y2(i){return class extends r1.Tag{variable;collection;hash;templates;elseTemplates;constructor(e,l,c){super(e,l,c);let a=this.tokenizer.readIdentifier(),n=this.tokenizer.readIdentifier(),s=this.tokenizer.readValue();if(!a.size()||n.content!=="in"||!s)throw new Error(`illegal tag: ${e.getText()}`);this.variable=a.content,this.collection=s,this.hash=new r1.Hash(this.tokenizer.remaining()),this.templates=[],this.elseTemplates=[];let r,m=this.liquid.parser.parseStream(l).on("start",()=>r=this.templates).on("tag:else",()=>r=this.elseTemplates).on("tag:endfor",()=>m.stop()).on("template",p=>r.push(p)).on("end",()=>{throw new Error(`tag ${e.getText()} not closed`)});m.start()}*render(e,l){let c=this.liquid.renderer,a=yield(0,r1.evalToken)(this.collection,e);if(!a?._result&&a?._get?yield a._get():a instanceof Array||(a=V1(a)),!a.length){yield c.renderTemplates(this.elseTemplates,e,l);return}let n="continue-"+this.variable+"-"+this.collection.getText();e.push({continue:e.getRegister(n)});let s=yield this.hash.render(e);e.pop(),a=(this.liquid.options.orderedFilterParameters?Object.keys(s).filter(o=>l5.includes(o)):l5.filter(o=>s[o]!==void 0)).reduce((o,g)=>g==="offset"?Y4(o,s.offset):g==="limit"?X4(o,s.limit):Q4(o),a),e.setRegister(n,(s.offset||0)+a.length);let m={forloop:new n1(a.length,this.collection.getText(),this.variable)};e.push(m);let p=0;for(let o of a){if(L(o)&&(o.index=p++),m[this.variable]=o,yield c.renderTemplates(this.templates,e,l),l.break){l.break=!1;break}l.continue=!1,m.forloop.next()}e.pop()}}}function Q4(i){return[...i].reverse()}function Y4(i,t){return i.slice(t)}function X4(i,t){return i.slice(0,t)}var j=require("liquidjs");var $=class{id;success=!1;errors=null;constructor(t){this.id=t}setSuccess(t=!0){this.success=t}setParams(t){Object.assign(this,t)}setErrors(t){this.errors=new I1(t)}clearErrors(){this.errors=null}},I1=class{errors;constructor(t){this.errors=t||[]}*[Symbol.iterator](){yield*this.errors}some(t,e){return this.errors.some(l=>t(l?.code),e)}};var t0=["new_comment","guest_login"];function v2(i){return class extends j.Tag{formType;formConfig;templates=[];hash;arg;constructor(e,l,c){super(e,l,c);let{tokenizer:a}=e;for(this.formType=a.readValue()?.content,this.formConfig=i.theme.getFormConfig(this.formType),a.advance(),this.arg=a.readValue(),this.hash=new j.Hash(this.tokenizer.remaining());l.length;){let n=l.shift();if(j.TypeGuards.isTagToken(n)&&n.name==="endform")return;this.templates.push(c.parser.parseToken(n,l))}if(!(!this.formConfig&&!t0.includes(this.formType)))throw new Error(`tag ${e.getText()} not closed`)}*render(e){if(!this.formConfig)return`<!-- form '${this.formType}' not found in theme configuration -->`;let l=this.liquid.renderer,c=yield(0,j.evalToken)(this.arg,e),a=yield this.hash.render(e),n=e.getAll(),s=" "+Object.entries(a).reduce((u,[d,w])=>w!==!0?[...u,`${d}="${w}"`]:u,[]).join(" "),m=i.theme.formData[this.formConfig.id]||new $(this.formConfig.id),p="";if(i.theme.shopifyCompatibility){Object.assign(m,i.theme.shopifyCompatibility.getFormData(m));let u=yield i.theme.shopifyCompatibility.getAdaptedFormClientHtml(this.formConfig.id,n,c);u&&(p=yield i.renderTemplateString(u));let d=yield i.theme.shopifyCompatibility.getAdaptedFormClientParams(this.formConfig.id,n,c);d&&m.setParams(d)}e.push({form:{...c||void 0,...m}});let o=yield l.renderTemplates(this.templates,e),g=this.formConfig.params instanceof Array?yield Promise.all(this.formConfig.params.map(async u=>{let d=await i.renderTemplateString(u.value,{value:c});return`<input type="hidden" name="${u.name}" value="${d}" />`})):[],f=a.return_to||i.theme.globals.request?.path;return`
1
+ "use strict";var N4=Object.create;var E1=Object.defineProperty;var I4=Object.getOwnPropertyDescriptor;var $4=Object.getOwnPropertyNames;var j4=Object.getPrototypeOf,O4=Object.prototype.hasOwnProperty;var U3=(i,t)=>{for(var e in t)E1(i,e,{get:t[e],enumerable:!0})},K3=(i,t,e,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of $4(t))!O4.call(i,c)&&c!==e&&E1(i,c,{get:()=>t[c],enumerable:!(l=I4(t,c))||l.enumerable});return i};var v1=(i,t,e)=>(e=i!=null?N4(j4(i)):{},K3(t||!i||!i.__esModule?E1(e,"default",{value:i,enumerable:!0}):e,i)),G4=i=>K3(E1({},"__esModule",{value:!0}),i);var dt={};U3(dt,{CACHE_TIMEOUT_RESOURCES:()=>m2,DEFAULT_QUERY_PAGE_LIMIT:()=>A3,DeferredShopifyResource:()=>O,LANG_TO_COUNTRY_CODES:()=>H3,LiquidSwell:()=>C1,MAX_QUERY_PAGE_LIMIT:()=>Z3,MockRecordResource:()=>I3,MockRecordSingleton:()=>$3,PageError:()=>M1,PageNotFound:()=>x1,ShopifyArticle:()=>u1,ShopifyBlog:()=>X1,ShopifyCart:()=>m1,ShopifyCollection:()=>g1,ShopifyCollections:()=>e2,ShopifyCompatibility:()=>p1,ShopifyCustomer:()=>U,ShopifyFont:()=>d1,ShopifyForm:()=>L1,ShopifyLink:()=>w1,ShopifyLocalization:()=>f1,ShopifyOrder:()=>e1,ShopifyPage:()=>c2,ShopifyPaginate:()=>o1,ShopifyPredictiveSearch:()=>i2,ShopifyProduct:()=>P,ShopifyResource:()=>v,ShopifySearch:()=>a2,ShopifyVariant:()=>V,StorefrontResource:()=>T,Swell:()=>A1,SwellBackendAPI:()=>p2,SwellError:()=>q1,SwellStorefrontCollection:()=>_,SwellStorefrontPagination:()=>z1,SwellStorefrontRecord:()=>C,SwellStorefrontResource:()=>y1,SwellStorefrontSingleton:()=>K,SwellTheme:()=>b3,ThemeColor:()=>S,ThemeFont:()=>R,ThemeForm:()=>$,ThemeFormErrors:()=>I1,adaptShopifyFontData:()=>s2,adaptShopifyFormData:()=>r2,adaptShopifyMenuData:()=>n2,arrayToObject:()=>z3,brightness:()=>u0,deferMenuItemUrlAndResource:()=>l1,dehydrateSwellRefsInStorefrontResources:()=>_4,diff:()=>W1,findCircularReferences:()=>I0,findEditorSetting:()=>T3,findThemeSettingsByType:()=>_3,fontMap:()=>U1,forEachKeyDeep:()=>F3,getAllSections:()=>M3,getBlog:()=>Q0,getBlogs:()=>J0,getCategories:()=>G0,getCategory:()=>R4,getCategoryWithProducts:()=>U0,getContentEntry:()=>B3,getContentList:()=>L4,getContentModel:()=>K0,getCountryCodeFromLocale:()=>N0,getEasyblocksBackend:()=>B4,getEasyblocksComponentDefinitions:()=>pt,getEasyblocksPagePropsWithConfigs:()=>mt,getEasyblocksPageTemplate:()=>E4,getEasyblocksPropsFromThemeConfigs:()=>lt,getLayoutSectionGroups:()=>x3,getMenuItemStorefrontUrl:()=>i1,getMenuItemUrlAndResource:()=>s4,getMenuItemValueId:()=>n4,getPage:()=>W0,getPageSections:()=>Y1,getProduct:()=>j0,getProducts:()=>E3,getProductsFiltered:()=>O0,getSectionSettingsFromProps:()=>q4,getThemeSettingsFromProps:()=>H4,isArray:()=>V0,isObject:()=>P1,md5:()=>Z1,mix:()=>_1,removeCircularReferences:()=>$0,resolveAsyncResources:()=>W,resolveLookupCollection:()=>r4,resolveMenuItemUrlAndResource:()=>c4,resolveMenuItems:()=>v3,resolveMenuSettings:()=>y3,resolveSectionSettings:()=>Q1,resolveThemeSettings:()=>k1,stringifyQueryParams:()=>E,systemFonts:()=>r0,themeConfigQuery:()=>C3,toBase64:()=>q3});module.exports=G4(dt);var k4=v1(require("swell-js"),1),P4=v1(require("qs"),1);var z4=v1(require("qs"),1),b4=require("lodash-es");var D3=require("lodash-es");var D1=require("lodash-es");var M=require("lodash-es");var g3=require("liquidjs");var h5=require("lodash-es");var I=require("liquidjs");function g2(i){return class extends I.Tag{value;branches=[];elseTemplates=[];isBlock=!1;constructor(e,l,c){super(e,l,c);let a=this.tokenizer.p,n=this.tokenizer.readValue()?.getText();this.isBlock=!!n?.startsWith("block."),this.tokenizer.p=a,this.value=new I.Value(this.tokenizer.readFilteredValue(),this.liquid),this.elseTemplates=[];let s=[],r=0,m=this.liquid.parser.parseStream(l).on("tag:when",p=>{if(r>0)return;s=[];let o=[];for(;!p.tokenizer.end();)o.push(p.tokenizer.readValueOrThrow()),p.tokenizer.skipBlank(),p.tokenizer.peek()===","?p.tokenizer.readTo(","):p.tokenizer.readTo("or");this.branches.push({values:o,templates:s})}).on("tag:else",()=>{r++,s=this.elseTemplates}).on("tag:endcase",()=>m.stop()).on("template",p=>{(s!==this.elseTemplates||r===1)&&s.push(p)}).on("end",()=>{throw new Error(`tag ${e.getText()} not closed`)});m.start()}*render(e){let l=this.liquid.renderer,c=(0,I.toValue)(yield this.value.value(e,e.opts.lenientIf)),a=!1,n="";for(let s of this.branches)for(let r of s.values){let m=yield(0,I.evalToken)(r,e,e.opts.lenientIf);if(c===m){let p=yield l.renderTemplates(s.templates,e);n+=this.isBlock&&i.isEditor?`<span class="swell-block">${p}</span>`:p,a=!0;break}}return a||(n+=yield l.renderTemplates(this.elseTemplates,e)),n}}}var r1=require("liquidjs");var Mt=require("liquidjs");var U4=Object.prototype.toString,Pt=Object.hasOwnProperty,B1=class{liquidMethodMissing(t){}},n1=class extends B1{i;length;name;test="test";index;index0;first;last;rindex;rindex0;constructor(t,e,l){super(),this.length=t,this.name=`${l}-${e}`,this.i=0,this.index=1,this.index0=0,this.first=!0,this.last=!1,this.rindex=t,this.rindex0=t-1}next(){this.i++,this.index++,this.index0++,this.first=!1,this.last=this.i===this.length-1,this.rindex--,this.rindex0--}valueOf(){return JSON.stringify(this)}};function Y(i){return i instanceof B1&&J3(i.valueOf)?i.valueOf():i}function W3(i){return typeof i=="string"}function d2(i){return typeof i=="number"}function J3(i){return typeof i=="function"}function Q3(i){return i==null}function s1(i){return U4.call(i)==="[object Array]"}function L(i){let t=typeof i;return i!==null&&(t==="object"||t==="function")}function K4(i){return L(i)&&Symbol.iterator in i}function W4(i){return L(i)&&typeof i.then=="function"}function Y3(i,t){return!J4(i,t)}function J4(i,t){return t.opts.jsTruthy?!i:i===!1||i===void 0||i===null}function S1(i){return L(i)&&J3(i.equals)}function X3(i){return Q3(i)?[]:s1(i)?i:[i]}function V1(i){return i=Y(i),s1(i)?i:W3(i)&&i.length>0?[i]:K4(i)?Array.from(i):L(i)?Object.entries(i).reduce((t,[e,l])=>(t.push({id:e,...l}),t),[]):[]}function w2(i){return i=Y(i),W3(i)?i:Q3(i)?"":s1(i)?i.map(t=>w2(t)).join(""):String(i)}function Z(i){if(Array.isArray(i))return i.reduce((t,e,l)=>{if(Array.isArray(e)){let[c,a]=e;t[c]=a}else l%2===0&&(t[e]=i[l+1]);return t},{});if(L(i)){let t={},e=Object.values(i);for(let l=0;l<e.length;l+=2)t[e[l]]=e[l+1];return t}return{}}async function N1(i,t=0){let e=i;e instanceof T&&(e=await e.resolve()),await t5(e);let l=[];return JSON.stringify(e,(c,a)=>{if(typeof a=="object"&&a!==null){if(l.includes(a))return;l.push(a)}return a},t)}async function t5(i,t=new WeakSet){await e5(i,async(e,l)=>{if(!L(l))return;let c=l[e];if(W4(c))l[e]=await c,await t5(l[e],t);else if(typeof c=="object"&&c!==null){if(t.has(c))return!1;t.add(c)}})}async function e5(i,t){if(!(typeof i!="object"||i===null)){for(let e in i)if(Object.prototype.hasOwnProperty.call(i,e)&&await t(e,i)!==!1){let c=i[e];typeof c=="object"&&c!==null&&await e5(c,t)}}}var l5=["offset","limit","reversed"];function y2(i){return class extends r1.Tag{variable;collection;hash;templates;elseTemplates;constructor(e,l,c){super(e,l,c);let a=this.tokenizer.readIdentifier(),n=this.tokenizer.readIdentifier(),s=this.tokenizer.readValue();if(!a.size()||n.content!=="in"||!s)throw new Error(`illegal tag: ${e.getText()}`);this.variable=a.content,this.collection=s,this.hash=new r1.Hash(this.tokenizer.remaining()),this.templates=[],this.elseTemplates=[];let r,m=this.liquid.parser.parseStream(l).on("start",()=>r=this.templates).on("tag:else",()=>r=this.elseTemplates).on("tag:endfor",()=>m.stop()).on("template",p=>r.push(p)).on("end",()=>{throw new Error(`tag ${e.getText()} not closed`)});m.start()}*render(e,l){let c=this.liquid.renderer,a=yield(0,r1.evalToken)(this.collection,e);if(!a?._result&&a?._get?yield a._get():a instanceof Array||(a=V1(a)),!a.length){yield c.renderTemplates(this.elseTemplates,e,l);return}let n="continue-"+this.variable+"-"+this.collection.getText();e.push({continue:e.getRegister(n)});let s=yield this.hash.render(e);e.pop(),a=(this.liquid.options.orderedFilterParameters?Object.keys(s).filter(o=>l5.includes(o)):l5.filter(o=>s[o]!==void 0)).reduce((o,g)=>g==="offset"?Y4(o,s.offset):g==="limit"?X4(o,s.limit):Q4(o),a),e.setRegister(n,(s.offset||0)+a.length);let m={forloop:new n1(a.length,this.collection.getText(),this.variable)};e.push(m);let p=0;for(let o of a){if(L(o)&&(o.index=p++),m[this.variable]=o,yield c.renderTemplates(this.templates,e,l),l.break){l.break=!1;break}l.continue=!1,m.forloop.next()}e.pop()}}}function Q4(i){return[...i].reverse()}function Y4(i,t){return i.slice(t)}function X4(i,t){return i.slice(0,t)}var j=require("liquidjs");var $=class{id;success=!1;errors=null;constructor(t){this.id=t}setSuccess(t=!0){this.success=t}setParams(t){Object.assign(this,t)}setErrors(t){this.errors=new I1(t)}clearErrors(){this.errors=null}},I1=class{errors;constructor(t){this.errors=t||[]}*[Symbol.iterator](){yield*this.errors}some(t,e){return this.errors.some(l=>t(l?.code),e)}};var t0=["new_comment","guest_login"];function v2(i){return class extends j.Tag{formType;formConfig;templates=[];hash;arg;constructor(e,l,c){super(e,l,c);let{tokenizer:a}=e;for(this.formType=a.readValue()?.content,this.formConfig=i.theme.getFormConfig(this.formType),a.advance(),this.arg=a.readValue(),this.hash=new j.Hash(this.tokenizer.remaining());l.length;){let n=l.shift();if(j.TypeGuards.isTagToken(n)&&n.name==="endform")return;this.templates.push(c.parser.parseToken(n,l))}if(!(!this.formConfig&&!t0.includes(this.formType)))throw new Error(`tag ${e.getText()} not closed`)}*render(e){if(!this.formConfig)return`<!-- form '${this.formType}' not found in theme configuration -->`;let l=this.liquid.renderer,c=yield(0,j.evalToken)(this.arg,e),a=yield this.hash.render(e),n=e.getAll(),s=" "+Object.entries(a).reduce((u,[d,w])=>w!==!0?[...u,`${d}="${w}"`]:u,[]).join(" "),m=i.theme.formData[this.formConfig.id]||new $(this.formConfig.id),p="";if(i.theme.shopifyCompatibility){Object.assign(m,i.theme.shopifyCompatibility.getFormData(m));let u=yield i.theme.shopifyCompatibility.getAdaptedFormClientHtml(this.formConfig.id,n,c);u&&(p=yield i.renderTemplateString(u));let d=yield i.theme.shopifyCompatibility.getAdaptedFormClientParams(this.formConfig.id,n,c);d&&m.setParams(d)}e.push({form:{...c||void 0,...m}});let o=yield l.renderTemplates(this.templates,e),g=this.formConfig.params instanceof Array?yield Promise.all(this.formConfig.params.map(async u=>{let d=await i.renderTemplateString(u.value,{value:c});return`<input type="hidden" name="${u.name}" value="${d}" />`})):[],f=a.return_to||i.theme.globals.request?.path;return`
2
2
  <form action="${this.formConfig.url}" method="post" accept-charset="UTF-8" enctype="multipart/form-data"${s}>
3
3
  <input type="hidden" name="form_type" value="${this.formConfig.id}" />
4
4
  ${g.join("")}
@@ -37,7 +37,7 @@
37
37
  `.trim(),a},{})}async renderSection(t,e){e&&this.setGlobals(e);let[l,c]=t?.split(/\_\_/).reverse(),a=await this.getThemeTemplateConfigByType(c?"templates":"sections",c||l);if(a){let n=await this.renderThemeTemplate(a.file_path,e);if(c&&n?.sections){let s={id:a.name,sections:{[l]:n?.sections?.[l]}},[r]=await this.renderPageSections(s,e);return r.output||""}return n}return""}async renderLayout(t){return this.liquidSwell.layoutName?this.renderLayoutTemplate(this.liquidSwell.layoutName,t):t?.content_for_layout||""}getContentForHeader(){let t=`
38
38
  `;return t+=this.renderFontHeaderLinks(),this.shopifyCompatibility&&(t+=`
39
39
  ${this.shopifyCompatibility.getContentForHeader()}`),t}renderFontHeaderLinks(){let t=this.globals.settings,e=this.globals.configs?.editor?.settings||[];if(t&&e){let l=_3("font",t,e),c=[];for(let a=0;a<l.length;a++){let n=l[a].value?.id||l[a].value;if(this.shopifyCompatibility){let s=this.shopifyCompatibility.getFontFromShopifySetting(n);c.includes(s||n)||c.push(s||n)}else c.includes(n)||c.push(n)}if(l.length>0)return`<link href="${R.combinedGoogleFontUrl(c)}" rel="stylesheet">`}return""}async getTemplateSchema(t){let e,l=await this.getThemeConfig(t.file_path);if(l){if(l.file_path.endsWith(".liquid")){if(this.shopifyCompatibility){this.liquidSwell.lastSchema=void 0,await this.renderTemplate(l);let c=this.liquidSwell.lastSchema||{};c&&(e=this.shopifyCompatibility.getSectionConfigSchema(c),e=await this.shopifyCompatibility.renderSchemaTranslations(this,e,this.globals.request?.locale))}}else if(l.file_data)try{e=JSON.parse(l?.file_data)||void 0}catch{}return e}}async resolveSectionDefaultSettings(t,e){let l={},c=e||t?.default||{};return t?.fields&&t.fields.forEach(a=>{a.default!==void 0&&(l[a.id]=a.default)}),Object.assign(l,c.settings,{blocks:c.blocks}),l.blocks instanceof Array&&(l.blocks=l.blocks.map(a=>{let n={},s=t?.blocks?.find(r=>r.type===a.type);return s?.fields&&s.fields.forEach(r=>{r.default!==void 0&&(n[r.id]=r.default)}),{...a,settings:{...n,...a.settings||void 0}}})),l}async getAllSections(){let t=await this.getAllThemeConfigs();return M3(t,this.getTemplateSchema.bind(this))}async getPageSections(t,e=!0){let l=await Y1(t,c=>this.getSectionSchema(c));if(e)for(let c of l){let{schema:a}=c;a?.fields&&this.globals&&c.settings&&(c.settings=Q1(this,c))}return l}async getLayoutSectionGroups(t=!0){let e=await this.getAllThemeConfigs(),l=await x3(e,this.getTemplateSchema.bind(this));if(t)for(let c of l)for(let a of c.sectionConfigs){let{schema:n}=a;n?.fields&&this.globals&&a.settings&&(a.settings=Q1(this,a))}return l}async renderPageSections(t,e){let l=await this.getPageSections(t);return this.renderSectionConfigs(l,e)}async renderSectionConfigs(t,e){return await Promise.all(t.map((l,c)=>{let{section:a,schema:n}=l,{settings:s}=l;return n?.fields&&this.globals&&(s=Q1(this,l)),new Promise(async r=>{let m=await this.getThemeTemplateConfigByType("sections",`${a.type}.liquid`),p=m?await this.renderTemplate(m,{...e,...s,index:c,template:m}):"";r({...l,output:p})})}))}async renderTemplateSections(t,e){return(await this.renderPageSections(t,e)).map(c=>`<${c.tag} ${c.class?`class="${c.class}"`:""}>${c.output}</${c.tag}>`).join(`
40
- `)}async renderTranslation(t,e,l){let c=this.globals.translations,a=this.globals.request?.locale;return this.renderTranslationValue(a,c,t,e,l)}async renderTranslationValue(t,e,l,c,a){if(l===void 0)return a||"";let n=l?.split(".")||[],s=n.pop()||"",r=n.join("."),m=(0,M.get)(e,r),p=(0,M.get)(m?.[t],s)||(0,M.get)(m?.[t.split("-")[0]],s)||m?.[s];return c?.count!==void 0&&p?.one&&(p=c.count===1?p.one:p.other),typeof p!="string"||p===""?a||"":await this.renderTemplateString(p,c)||a||""}renderCurrency(t,e){let l=this.swell.storefront.settings,c=this.swell.storefront.currency,a=l.state,n=c.code=a?.store?.currency||"USD";return c.locale=a?.store?.locale||"en-US",c.state=a?.store?.locales?.find(s=>s.code===n)||{code:n},c.format(t,e)}},M1=class{title;status=500;message;description;constructor(t="Something went wrong",e=500,l){this.title=String(t),this.status=e,this.message=this.title+(l?`: ${l}`:""),this.description=l}toString(){return this.message}},x1=class extends M1{constructor(t="Page not found",e=404,l){super(t,e,l)}};function Q1(i,t){let{settings:e,schema:l}=t;if(!e?.section?.settings||!l?.fields||!l?.id)return e;let c=[{label:l.label||l.id,fields:l.fields}];return{...e,section:{...e.section,id:l.id,settings:k1(i,e.section.settings,c),blocks:e.section.blocks?.map(a=>({...a,settings:k1(i,a.settings,l.blocks?.filter(n=>n.type===a.type))}))}}}function k1(i,t,e){let l=(0,M.cloneDeep)(t);return(0,M.each)(l,(c,a)=>{let n=(e&&T3(e,a))??null;if(P1(c)&&!(c instanceof T)){switch(n?.type){case"color_scheme_group":{(0,M.each)(c,(s,r)=>{(0,M.each)(c[r].settings,(m,p)=>{(0,M.find)(n.fields,{id:p})?.type==="color"&&m&&(c[r].id=r,c[r].settings[p]=new S(m))})});return}default:break}l[a]=k1(i,c,e)}else switch(n?.type){case"lookup":case"product_lookup":case"category_lookup":case"customer_lookup":l[a]=i.resolveLookupSetting(n,c);break;case"color":c&&(l[a]=new S(c));break;case"font":l[a]=i.resolveFontSetting(c);break;case"menu":l[a]=i.resolveMenuSetting(c);break;case"url":l[a]=i.resolveUrlSetting(c);break}}),l}function _3(i,t,e){let l=[];return(0,M.each)(t,(c,a)=>{if(P1(c)&&!(c instanceof R))l.push(..._3(i,c,e));else{let n=T3(e,a);n?.type===i&&l.push({setting:n,value:c})}}),l}function r4(i){if(i.collection)return i.collection;switch(i.type){case"product_lookup":return"products";case"category_lookup":return"categories";case"customer_lookup":return"accounts";default:break}}function T3(i,t){for(let e of i||[])for(let l of e.fields)if(l.id===t)return l;return null}function k3(i,t){let e=t.currencies.find(l=>l.code===t.currency);return new v({accepts_gift_cards:!0,address:{},brand:{},collections_count:0,currency:t.currency,customer_accounts_enabled:!0,customer_accounts_optional:!0,description:t.description,domain:t.url.replace(/^http[s]?:\/\//,""),email:t.support_email,enabled_currencies:t.currencies.map(l=>({iso_code:l.code,name:l.name,symbol:l.symbol})),enabled_payment_providers:[],id:t.id,metafields:null,metaobjects:null,money_format:t.currencies.find(l=>l.code===t.currency),money_with_currency_format:{...e,symbol:`${t.currency} ${e?.symbol||""}`},name:t.name,password_message:null,permanent_domain:`${t.id}.swell.store`,phone:t.support_phone,published_locales:t.locales.map(l=>({endonym_name:l.name,iso_code:l.code,name:l.name,primary:l.code===t.locale,root_url:t.url})),secure_url:t.url,types:[],url:t.url,vendors:[],policies:[],privacy_policy:null,refund_policy:null,shipping_policy:null,subscription_policy:null,terms_of_service:null,products_count:0})}function f1(i,t,e){let l=t.currencies.find(a=>a.code===e.currency)||t.currencies[0],c=t.locales.find(a=>a.code===e.locale)||t.locales[0];return new v({available_countries:C0(t),available_languages:h4(t),country:l&&p4(l,t),language:c&&m4(c,t),market:null})}function C0(i){return i.currencies.map(t=>p4(t,i))||[]}function h4(i){return i.locales.map(t=>m4(t,i))||[]}function m4(i,t){return{endonym_name:i.name,iso_code:i.code,name:i.name,primary:i.code===t.locale,root_url:t.url}}function p4(i,t){return{available_languages:h4(t),continent:null,currency:{iso_code:i.code,name:i.name,symbol:i.symbol},iso_code:i.code,market:null,name:M0(i.code),"popular?":!1,unit_system:"metric"}}function M0(i){return i in o4?o4[i]:null}var o4=Object.freeze({USD:"United States",EUR:"Europe",GBP:"United Kingdom",JPY:"Japan",CAD:"Canada",AUD:"Australia",CHF:"Switzerland",CNY:"China",SEK:"Sweden",NZD:"New Zealand",NOK:"Norway",MXN:"Mexico",SGD:"Singapore",HKD:"Hong Kong",KRW:"South Korea",INR:"India",BRL:"Brazil",RUB:"Russia",ZAR:"South Africa",TRY:"Turkey",AED:"United Arab Emirates",THB:"Thailand",IDR:"Indonesia",SAR:"Saudi Arabia",PLN:"Poland",PHP:"Philippines",ILS:"Israel",MYR:"Malaysia",CZK:"Czech Republic",HUF:"Hungary",CLP:"Chile",DKK:"Denmark",RON:"Romania",ARS:"Argentina",COP:"Colombia",TWD:"Taiwan",BGN:"Bulgaria",EGP:"Egypt",PKR:"Pakistan",NGN:"Nigeria",VND:"Vietnam",IQD:"Iraq",MAD:"Morocco",KES:"Kenya",DZD:"Algeria",UAH:"Ukraine",XAF:"Cameroon",XOF:"C\xF4te d'Ivoire",GHS:"Ghana",BYN:"Belarus",LKR:"Sri Lanka",SDG:"Sudan",AFN:"Afghanistan",ALL:"Albania",AMD:"Armenia",AOA:"Angola",AWG:"Aruba",AZN:"Azerbaijan",BAM:"Bosnia and Herzegovina",BBD:"Barbados",BDT:"Bangladesh",BHD:"Bahrain",BIF:"Burundi",BMD:"Bermuda",BND:"Brunei",BOB:"Bolivia",BSD:"Bahamas",BTN:"Bhutan",BWP:"Botswana",BZD:"Belize",CDF:"Democratic Republic of the Congo",CLF:"Chile (Unidad de Fomento)",CRC:"Costa Rica",CVE:"Cape Verde",DJF:"Djibouti",DOP:"Dominican Republic",ERN:"Eritrea",ETB:"Ethiopia",FKP:"Falkland Islands",GEL:"Georgia",GIP:"Gibraltar",GMD:"Gambia",GNF:"Guinea",GTQ:"Guatemala",GYD:"Guyana",HNL:"Honduras",HRK:"Croatia",HTG:"Haiti",IRR:"Iran",ISK:"Iceland",JMD:"Jamaica",JOD:"Jordan",KGS:"Kyrgyzstan",KHR:"Cambodia",KMF:"Comoros",KPW:"North Korea",KWD:"Kuwait",KYD:"Cayman Islands",KZT:"Kazakhstan",LAK:"Laos",LBP:"Lebanon",LRD:"Liberia",LSL:"Lesotho",LYD:"Libya",MDL:"Moldova",MGA:"Madagascar",MKD:"North Macedonia",MMK:"Myanmar",MNT:"Mongolia",MOP:"Macau",MRO:"Mauritania",MUR:"Mauritius",MVR:"Maldives",MWK:"Malawi",NAD:"Namibia",NPR:"Nepal",OMR:"Oman",PAB:"Panama",PEN:"Peru",PGK:"Papua New Guinea",PYG:"Paraguay",QAR:"Qatar",RSD:"Serbia",RWF:"Rwanda",SBD:"Solomon Islands",SCR:"Seychelles",SHP:"Saint Helena",SLL:"Sierra Leone",SOS:"Somalia",SRD:"Suriname",STD:"S\xE3o Tom\xE9 and Pr\xEDncipe",SZL:"Eswatini",TJS:"Tajikistan",TMT:"Turkmenistan",TND:"Tunisia",TOP:"Tonga",TTD:"Trinidad and Tobago",TZS:"Tanzania",UGX:"Uganda",UYU:"Uruguay",UZS:"Uzbekistan",VEF:"Venezuela",VUV:"Vanuatu",WST:"Samoa",XCD:"Eastern Caribbean",YER:"Yemen",ZMW:"Zambia",ZWL:"Zimbabwe"});var o2={};U3(o2,{DeferredShopifyResource:()=>O,ShopifyArticle:()=>u1,ShopifyBlog:()=>X1,ShopifyCart:()=>m1,ShopifyCollection:()=>g1,ShopifyCollections:()=>e2,ShopifyCustomer:()=>U,ShopifyFont:()=>d1,ShopifyForm:()=>L1,ShopifyLink:()=>w1,ShopifyLocalization:()=>f1,ShopifyOrder:()=>e1,ShopifyPage:()=>c2,ShopifyPaginate:()=>o1,ShopifyPredictiveSearch:()=>i2,ShopifyProduct:()=>P,ShopifyResource:()=>v,ShopifySearch:()=>a2,ShopifyVariant:()=>V,adaptShopifyFontData:()=>s2,adaptShopifyFormData:()=>r2,adaptShopifyMenuData:()=>n2});function u1(i,t,e){return t instanceof v?t.clone():(e&&(t.category=e),new v({author:h(t,l=>l.author?.name||l.author?.email),content:h(t,l=>l.content),created_at:y(()=>t.date_created),excerpt:y(()=>t.summary),excerpt_or_content:y(()=>t.summary||t.content),handle:y(()=>t.slug),id:h(t,l=>l.id),image:h(t,l=>l.image&&A(i,l.image)),metafields:null,published_at:h(t,l=>l.date_published||l.date_created),tags:h(t,l=>l.tags),template_suffix:null,title:h(t,l=>l.title),updated_at:h(t,l=>l.date_updated||l.date_created),url:h([t,t.category],(l,c)=>c&&`/blogs/${c?.slug}/${l.slug}`),user:y(()=>t.author),comment_post_url:null,comments:null,comments_count:null,"comments_enabled?":!1,moderated:!1}))}function X1(i,t){if(t instanceof v)return t.clone();let e=h(t.blogs,l=>l?.results?.reduce((c,a)=>{for(let n of a.tags||[])c.includes(n)||c.push(n);return c},[]));return new v({all_tags:e,articles:h(t,l=>l.blogs?._cloneWithCompatibilityResult(c=>({results:c?.results?.map(a=>u1(i,a,l))}))||[]),articles_count:h(t.blogs,l=>l?.count||0),handle:y(()=>t.slug),id:h(t,l=>l.id),metafields:null,next_article:null,previous_article:null,tags:e,template_suffix:null,title:h(t,l=>l.title),url:h(t,l=>`/blogs/${l.slug}`),"comments_enabled?":!1,moderated:!1})}var f4=require("lodash-es");function R1(i,t){let e=t.type==="range",l=t.type==="boolean";return new v({active_values:e?void 0:t.active_options?.map(c=>c1(i,c,t)),false_value:l?c1(i,{value:""},t):void 0,inactive_values:e?void 0:t.inactive_options?.map(c=>c1(i,c,t)),label:t.label,max_value:e?c1(i,{value:t.range_max},t,"lte"):void 0,min_value:e?c1(i,{value:t.range_min},t,"gte"):void 0,operator:e?"AND":"OR",param_name:t.param_name,presentation:"text",range_max:t.range_max,true_value:l?c1(i,{value:t.options[0].value},t):void 0,type:t.id==="price"?"price_range":l?"boolean":"list",url_to_remove:k0(i,`filter_${t.id}`,!0),values:t.id!=="price"&&t.options?.map(c=>c1(i,c,t))})}function c1(i,t,e,l){let c=l?`${e.param_name}[${l}]`:e.param_name;return new v({active:t.active,count:t.count,image:null,label:t.label,param_name:c,swatch:null,url_to_add:R0(i,c,t.value),url_to_remove:P0(i,e.param_name,t.value),value:x0(i,t,e,l)})}function x0(i,t,e,l){let{queryParams:c}=i.swell,a=l?c[e.param_name]?.[l]:c[e.param_name];return e.type==="range"?a!==void 0&&a!==""?a:null:t.value}function t2(i){return Object.keys(i).reduce((t,e)=>(i[e]!==""&&(t[e]=(0,f4.isObject)(i[e])?t2(i[e]):i[e]),t),{})}function k0(i,t,e=!1){let{queryParams:l}=i.swell,c=E({...t2(l),...e?{[`${t}[gte]`]:void 0,[`${t}[lte]`]:void 0}:void 0,[t]:void 0,page:void 0});return P3(i,c)}function P0(i,t,e){let{queryParams:l}=i.swell,c=E({...t2(l),[t]:Array.isArray(l[t])?l[t].filter(a=>a!==e):void 0,page:void 0});return P3(i,c)}function R0(i,t,e){let{queryParams:l}=i.swell,c=E({...t2(l),[t]:Array.isArray(l[t])?l[t].concat(e):typeof l[t]=="string"?[l[t],e]:e,page:void 0});return P3(i,c)}function P3(i,t){let{url:e}=i.swell;return`${e.pathname}${t?`?${t}`:""}`}function g1(i,t){if(t instanceof v)return t.clone();let e=h(t,c=>c.products?._cloneWithCompatibilityResult(a=>({results:a?.results?.map(n=>P(i,n))}))??null);async function l(){let c=await e.resolve();return c&&"_resolve"in c?c._resolve():c}return new v({all_products_count:y(async()=>(await l())?.count||0),all_tags:y(async()=>(await l())?.results?.reduce((c,a)=>(Array.isArray(a.tags)&&c.push(...a.tags),c),[])||[]),all_types:y(async()=>{let c=await l();if(!c?.results)return[];let a=c.results.reduce((n,s)=>(s.type&&n.add(s.type),n),new Set);return Array.from(a.values())}),all_vendors:[],current_type:null,current_vendor:null,default_sort_by:h(t,c=>c.sort_options?.[0].value),description:h(t,c=>c.description),featured_image:h(t,c=>c.images?.[0]&&A(i,c.images[0])),filters:y(async()=>(await l())?.filter_options?.map(c=>R1(i,c))||[]),handle:y(()=>t.slug),id:h(t,c=>c.id),image:null,metafields:null,next_product:null,previous_product:null,products:e,products_count:y(async()=>(await l())?.results?.length||0),published_at:null,sort_by:y(()=>t.sort),sort_options:h(t,c=>c.sort_options),tags:[],template_suffix:null,title:y(()=>t.name),url:h(t,c=>`/collections/${c.slug}`)})}function e2(i,t){return new _(i.swell,t._collection,t._query,async()=>{let e=(await t.results)?.map(l=>g1(i,l));return{page:t.page??1,count:t.count??0,results:e,page_count:t.page_count??0,limit:t.limit,pages:t.pages??{}}})}function d1(i,t){return t instanceof v?t.clone():new v({baseline_ratio:null,fallback_families:t.fallback_families,family:t.family,style:t.style,"system?":t.system,variants:t.variants.map(e=>d1(i,e)),weight:t.weight})}var L0={account_login:{params:()=>({password_needed:!0})}};function L1(i,t){if(t instanceof v)return t.clone();let e=L0[t.id];return new v({...e?.params?.(t)||void 0,errors:t.errors&&new L3(t.errors),"posted_successfully?":t.success})}var R3=class{code;message;field_name;field_label;type;constructor(t){this.code=t.code,this.message=t.message,this.field_name=t.field_name,this.field_label=t.field_label,this.type=this.getShopifyErrorType(t)}getShopifyErrorType(t){return t.field_name==="email"?"email":t.field_name==="password"?"password":"form"}valueOf(){return this.type}toString(){return this.type}},L3=class i{errors;pointer=0;messages;translated_fields;constructor(t){return this.errors=Array.from(t).map(e=>new R3(e)),this.messages=new l2(this.errors,this.errors.map(e=>e.message)),this.translated_fields=new l2(this.errors,this.errors.map(e=>e.field_label)),new Proxy(this.errors,{get:(e,l)=>{let c=e;return l==="toJSON"?this.errors:l==="some"?this.some.bind(this):l==="messages"?this.messages:l==="translated_fields"?this.translated_fields:c[l]},getPrototypeOf(){return i.prototype}})}*[Symbol.iterator](){yield*this.errors}some(t,e){return this.errors.some(l=>t(l?.type),e)}},l2=class{values;constructor(t,e){return this.values=e,new Proxy(e,{get:(l,c)=>{let a=l;if(c==="toJSON")return e;let n=t?.findIndex?.(s=>s?.type===c);return n!==-1?e[n]:a[c]}})}};function i2(i,t){return t instanceof v?t.clone():new v({performed:h(t,e=>e.performed),resources:D0(i,t),terms:y(()=>t.query),types:["product"]})}function D0(i,t){return t instanceof v?t.clone():new v({products:h(t.products,e=>e?.results?.map(l=>{let c=P(i,l);return c.object_type="product",c}))})}function c2(i,t){return t instanceof v?t.clone():new v({content:h(t,e=>e.content),handle:y(()=>t.slug),metafields:null,published_at:y(async()=>await t.date_published||t.date_created),template_suffix:null,title:h(t,e=>e.title||e.name),url:h(t,e=>`/pages/${e.slug}`),author:null})}var u4=require("lodash-es");function w1(i,t,e){let l=t.handle||t.id;return new v({active:e.active,child_active:e.child_active,child_current:e.child_current,current:e.current,handle:`${l}-${(0,u4.snakeCase)(e.name)}`,levels:e.levels,links:e.items?.map(c=>w1(i,e,c)),object:e.resource,title:e.name,type:Z0(e.type),url:e.url})}function Z0(i){switch(i){case"home":return"frontpage_link";case"category":return"collection_link";case"product":return"product_link";case"search":return"search_link";default:return""}}function a2(i,t){if(t instanceof v)return t.clone();let e=h(t,l=>l.products?._cloneWithCompatibilityResult(c=>({results:c?.results?.map(a=>{let n=P(i,a);return n.object_type="product",n})}))||[]);return new v({default_sort_by:h(t,l=>l.sort_options?.[0].value),filters:y(async()=>(await(await e.resolve())?.filter_options)?.map(c=>R1(i,c))||[]),performed:h(t,l=>l.performed),results:e,results_count:y(async()=>(await e.resolve())?.count||0),sort_by:y(()=>t.sort),sort_options:h(t,l=>l.sort_options),terms:y(()=>t.query),types:["product"]})}function n2(i,t){let e={...t,handle:t.id.replace(/\_/g,"-"),title:t.name};return{...e,links:t.items?.map(l=>w1(i,e,l))}}function s2(i,t){return d1(i,t)}function r2(i,t){return L1(i,t)}function g4(i){let t={settings:[]};return Array.isArray(i)&&(i[0]?.name==="theme_info"&&i.shift(),i.forEach(e=>{t.settings.push(q0(e))})),t}function d4(i){return typeof i.current=="string"&&i.presets?.[i.current]?i.presets[i.current]:typeof i.current=="object"?i.current||{}:{}}function w4(i){return Object.entries(i.presets||{}).map(([t,e])=>({label:t,settings:e}))}function y4(i){return{label:i.name,type:i.type,tag:i.tag,class:i.class,enabled_on:i.enabled_on,disabled_on:i.disabled_on,fields:(i.settings||[]).map(e=>h2(e)),blocks:(i.blocks||[]).map(e=>A0(e)),presets:(i.presets||[]).map(e=>H0(e)),default:i.default}}function A0(i){return{type:i.type,label:i.name,limit:i.limit,fields:(i.settings||[]).map(e=>h2(e))}}function H0(i){return{label:i.name,settings:i.settings,blocks:i.blocks}}function q0(i){return{label:i.name,fields:(i.settings||[]).map(e=>h2(e))}}function h2(i){let t={};switch(i.type){case"text":t={type:"text"};break;case"textarea":t={type:"textarea"};break;case"paragraph":t={type:"paragraph",label:i.content};break;case"select":t={type:"select",options:i.options};break;case"checkbox":t={type:"checkbox"};break;case"radio":t={type:"radio",options:i.options};break;case"number":t={type:"integer"};break;case"range":t={type:"number",min:i.min,max:i.max,increment:i.step,unit:i.unit};break;case"article":t={type:"lookup",collection:"content/blogs:posts"};break;case"blog":t={type:"lookup",collection:"content/blogs"};break;case"collection":t={type:"category_lookup"};break;case"collection_list":t={type:"category_lookup",multiple:!0,limit:i.limit};break;case"color":t={type:"color"};break;case"color_background":t={type:"color_background"};break;case"color_scheme":t={type:"color_scheme"};break;case"color_scheme_group":t={type:"color_scheme_group",fields:(i.definition||[]).map(e=>h2(e)),role:i.role};break;case"font_picker":t={type:"font"};break;case"html":t={type:"html"};break;case"image_picker":t={type:"image"};break;case"inline_richtext":t={type:"rich_text"};break;case"link_list":t={type:"menu"};break;case"liquid":t={type:"liquid"};break;case"page":t={type:"lookup",collection:"content/pages"};break;case"product":t={type:"product_lookup"};break;case"product_list":t={type:"product_lookup",multiple:!0,limit:i.limit};break;case"richtext":t={type:"rich_html"};break;case"text_alignment":t={type:"select",options:[{value:"left",label:"Left"},{value:"center",label:"Center"},{value:"right",label:"Right"}]};break;case"url":t={type:"url"};break;case"video":t={type:"video"};break;case"video_url":t={type:"url"};break;case"header":t={type:"header",label:i.content};break}return{id:i.id,label:i.label,default:i.default,description:i.info,...t}}function v4(i){let t=i.lastIndexOf("_"),e=i.substring(0,t),l=i.substring(t+1),c=F0[e];if(c){let a=c.variants[l];return`${c.family}:${a}`}return null}var F0={abel:{family:"Abel",variants:{n4:"wght@400"}},abril_fatface:{family:"Abril Fatface",variants:{n4:"wght@400"}},alegreya:{family:"Alegreya",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},alegreya_sans:{family:"Alegreya Sans",variants:{n1:"wght@100",i1:"ital,wght@1,100",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},amiri:{family:"Amiri",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},anonymous_pro:{family:"Anonymous Pro",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},arapey:{family:"Arapey",variants:{n4:"wght@400",i4:"ital,wght@1,400"}},archivo:{family:"Archivo",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},archivo_narrow:{family:"Archivo Narrow",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},arimo:{family:"Arimo",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},armata:{family:"Armata",variants:{n4:"wght@400"}},arvo:{family:"Arvo",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},asap:{family:"Asap",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},assistant:{family:"Assistant",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",n6:"wght@600",n7:"wght@700",n8:"wght@800"}},asul:{family:"Asul",variants:{n4:"wght@400",n7:"wght@700"}},bio_rhyme:{family:"Bio Rhyme",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",n7:"wght@700",n8:"wght@800"}},bitter:{family:"Bitter",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700"}},cabin:{family:"Cabin",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},cardo:{family:"Cardo",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700"}},catamaran:{family:"Catamaran",variants:{n1:"wght@100",n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},chivo:{family:"Chivo",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900",i9:"ital,wght@1,900"}},cormorant:{family:"Cormorant",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},crimson_text:{family:"Crimson Text",variants:{n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},dm_sans:{family:"DM Sans",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700"}},domine:{family:"Domine",variants:{n4:"wght@400",n7:"wght@700"}},dosis:{family:"Dosis",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800"}},eczar:{family:"Eczar",variants:{n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800"}},fira_sans:{family:"Fira Sans",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},fjalla_one:{family:"Fjalla One",variants:{n4:"wght@400"}},glegoo:{family:"Glegoo",variants:{n4:"wght@400",n7:"wght@700"}},ibm_plex_sans:{family:"IBM Plex Sans",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},inconsolata:{family:"Inconsolata",variants:{n4:"wght@400",n7:"wght@700"}},inknut_antiqua:{family:"Inknut Antiqua",variants:{n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},inter:{family:"Inter",variants:{n1:"wght@100",n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},josefin_sans:{family:"Josefin Sans",variants:{n1:"wght@100",i1:"ital,wght@1,100",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},josefin_slab:{family:"Josefin Slab",variants:{n1:"wght@100",i1:"ital,wght@1,100",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},kalam:{family:"Kalam",variants:{n3:"wght@300",n4:"wght@400",n7:"wght@700"}},karla:{family:"Karla",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},kreon:{family:"Kreon",variants:{n3:"wght@300",n4:"wght@400",n7:"wght@700"}},lato:{family:"Lato",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},libre_baskerville:{family:"Libre Baskerville",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700"}},libre_franklin:{family:"Libre Franklin",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},lobster:{family:"Lobster",variants:{n4:"wght@400"}},lobster_two:{family:"Lobster Two",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},lora:{family:"Lora",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},maven_pro:{family:"Maven Pro",variants:{n4:"wght@400",n5:"wght@500",n7:"wght@700",n9:"wght@900"}},megrim:{family:"Megrim",variants:{n4:"wght@400"}},merriweather_sans:{family:"Merriweather Sans",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800"}},montserrat:{family:"Montserrat",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},mouse_memoirs:{family:"Mouse Memoirs",variants:{n4:"wght@400"}},muli:{family:"Muli",variants:{n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},neuton:{family:"Neuton",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",n8:"wght@800"}},news_cycle:{family:"News Cycle",variants:{n4:"wght@400",n7:"wght@700"}},newsreader:{family:"Newsreader",variants:{n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800"}},nobile:{family:"Nobile",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700"}},noticia_text:{family:"Noticia Text",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},noto_serif:{family:"Noto Serif",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},nunito:{family:"Nunito",variants:{n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},nunito_sans:{family:"Nunito Sans",variants:{n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},old_standard_tt:{family:"Old Standard TT",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700"}},open_sans:{family:"Open Sans",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800"}},open_sans_condensed:{family:"Open Sans Condensed",variants:{n3:"wght@300",i3:"ital,wght@1,300",n7:"wght@700"}},oswald:{family:"Oswald",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700"}},ovo:{family:"Ovo",variants:{n4:"wght@400"}},oxygen:{family:"Oxygen",variants:{n3:"wght@300",n4:"wght@400",n7:"wght@700"}},pt_mono:{family:"PT Mono",variants:{n4:"wght@400"}},pt_sans:{family:"PT Sans",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},pt_sans_narrow:{family:"PT Sans Narrow",variants:{n4:"wght@400",n7:"wght@700"}},pt_serif:{family:"PT Serif",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},pacifico:{family:"Pacifico",variants:{n4:"wght@400"}},playball:{family:"Playball",variants:{n4:"wght@400"}},playfair_display:{family:"Playfair Display",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900",i9:"ital,wght@1,900"}},poppins:{family:"Poppins",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},prata:{family:"Prata",variants:{n4:"wght@400"}},prompt:{family:"Prompt",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},proza_libre:{family:"Proza Libre",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800"}},quantico:{family:"Quantico",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},quattrocento:{family:"Quattrocento",variants:{n4:"wght@400",n7:"wght@700"}},quattrocento_sans:{family:"Quattrocento Sans",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},questrial:{family:"Questrial",variants:{n4:"wght@400"}},quicksand:{family:"Quicksand",variants:{n3:"wght@300",n4:"wght@400",n5:"wght@500",n7:"wght@700"}},rajdhani:{family:"Rajdhani",variants:{n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700"}},raleway:{family:"Raleway",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},righteous:{family:"Righteous",variants:{n4:"wght@400"}},roboto:{family:"Roboto",variants:{n1:"wght@100",i1:"ital,wght@1,100",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900",i9:"ital,wght@1,900"}},roboto_condensed:{family:"Roboto Condensed",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},roboto_mono:{family:"Roboto Mono",variants:{n1:"wght@100",i1:"ital,wght@1,100",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700"}},roboto_slab:{family:"Roboto Slab",variants:{n1:"wght@100",n3:"wght@300",n4:"wght@400",n7:"wght@700"}},rubik:{family:"Rubik",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900",i9:"ital,wght@1,900"}},shadows_into_light:{family:"Shadows Into Light",variants:{n4:"wght@400"}},slabo_13px:{family:"Slabo 13px",variants:{n4:"wght@400"}},smooch:{family:"Smooch",variants:{n4:"wght@400"}},source_code_pro:{family:"Source Code Pro",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n9:"wght@900"}},source_sans_pro:{family:"Source Sans Pro",variants:{n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900",i9:"ital,wght@1,900"}},space_mono:{family:"Space Mono",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},syne:{family:"Syne",variants:{n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800"}},tenor_sans:{family:"Tenor Sans",variants:{n4:"wght@400"}},tinos:{family:"Tinos",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},titillium_web:{family:"Titillium Web",variants:{n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900"}},ubuntu:{family:"Ubuntu",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700"}},unica_one:{family:"Unica One",variants:{n4:"wght@400"}},unna:{family:"Unna",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},varela:{family:"Varela",variants:{n4:"wght@400"}},varela_round:{family:"Varela Round",variants:{n4:"wght@400"}},vidaloka:{family:"Vidaloka",variants:{n4:"wght@400"}},volkhov:{family:"Volkhov",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},vollkorn:{family:"Vollkorn",variants:{n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900",i9:"ital,wght@1,900"}},work_sans:{family:"Work Sans",variants:{n1:"wght@100",n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},biz_udpmincho:{family:"BIZ UDPMincho",variants:{n4:"wght@400",n7:"wght@700"}},dela_gothic_one:{family:"Dela Gothic One",variants:{n4:"wght@400"}},hina_mincho:{family:"Hina Mincho",variants:{n4:"wght@400"}},kaisei_decol:{family:"Kaisei Decol",variants:{n4:"wght@400",n5:"wght@500",n7:"wght@700"}},kaisei_opti:{family:"Kaisei Opti",variants:{n4:"wght@400",n5:"wght@500",n7:"wght@700"}},kaisei_tokumin:{family:"Kaisei Tokumin",variants:{n4:"wght@400",n5:"wght@500",n7:"wght@700",n8:"wght@800"}},m_plus_1:{family:"M PLUS 1",variants:{n1:"wght@100",n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},m_plus_rounded_1c:{family:"M PLUS Rounded 1c",variants:{n1:"wght@100",n3:"wght@300",n4:"wght@400",n5:"wght@500",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},mochiy_pop_p_one:{family:"Mochiy Pop P One",variants:{n4:"wght@400"}},murecho:{family:"Murecho",variants:{n1:"wght@100",n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},noto_sans_japanese:{family:"Noto Sans Japanese",variants:{n1:"wght@100",n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},noto_serif_japanese:{family:"Noto Serif Japanese",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n9:"wght@900"}},shippori_mincho:{family:"Shippori Mincho",variants:{n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800"}},zen_kaku_gothic_new:{family:"Zen Kaku Gothic New",variants:{n3:"wght@300",n4:"wght@400",n5:"wght@500",n7:"wght@700",n9:"wght@900"}},zen_kurenaido:{family:"Zen Kurenaido",variants:{n4:"wght@400"}},zen_maru_gothic:{family:"Zen Maru Gothic",variants:{n3:"wght@300",n4:"wght@400",n5:"wght@500",n7:"wght@700",n9:"wght@900"}},zen_old_mincho:{family:"Zen Old Mincho",variants:{n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n9:"wght@900"}}};var p1=class{theme;swell;pageId;pageResourceMap;objectResourceMap;formResourceMap;queryParamsMap;editorLocaleConfig;shopifyCompatibilityConfig;constructor(t){this.theme=t,this.swell=t.swell,this.shopifyCompatibilityConfig=this.swell.shopifyCompatibilityConfig??void 0,this.pageResourceMap=this.getPageResourceMap(),this.objectResourceMap=this.getObjectResourceMap(),this.formResourceMap=this.getFormResourceMap(),this.queryParamsMap=this.getQueryParamsMap()}adaptGlobals(t){let{store:e,request:l,page:c,menus:a}=t;this.pageId=this.getPageType(c?.id),t.shop=this.getShopData(t),t.page={...c||void 0},t.request={...l||void 0,design_mode:this.swell.isEditor,visual_section_preview:!1,page_type:c?.id},t.linklists=a,t.current_page=this.swell.queryParams.page||1,t.routes=this.getPageRoutes(),t.localization=this.getLocalizationObject(e,l),t.all_country_option_tags=this.getAllCountryOptionTags(t.geo)}adaptPageData(t){let e=this.pageResourceMap.find(({page:l})=>l===this.pageId);if(e)for(let[l,c]of Object.entries(t)){let a=e.resources.find(({from:n})=>n===l);a&&c instanceof T&&(t[a.to]=a.object(this,c))}this.adaptObjectData(t)}adaptObjectData(t){for(let e of Object.values(t)){let l=this.objectResourceMap.find(({from:c})=>c===e?.constructor.name);if(l){let c=l.object(this,e);e instanceof T?e.setCompatibilityProps(c):Object.assign(e,c)}}}adaptQueryParams(){let t={};for(let[e,l]of Object.entries(this.swell.queryParams)){let c=this.queryParamsMap.find(({from:a})=>typeof a=="function"?a(e):a===e);if(c){let a=typeof c.to=="function"?c.to(e,l):{[c.to]:l};Object.assign(t,a)}else t[e]=l}this.swell.queryParams=t}getAdaptedFormType(t){return this.formResourceMap.find(l=>l.shopifyType===t)?.type}async getAdaptedFormClientParams(t,e,l){let c=this.formResourceMap.find(a=>a.type===t);if(c?.clientParams)return await c.clientParams(e,l)}async getAdaptedFormClientHtml(t,e,l){let c=this.formResourceMap.find(n=>n.type===t),a=this.shopifyCompatibilityConfig?.forms?.find(n=>n.id===t);if(c&&a)return a.client_params?.reduce((n,s)=>`<input type="hidden" name="${s.name}" value="${s.value}" />`+n,"")}async getAdaptedFormServerParams(t,e){let l=this.formResourceMap.find(c=>c.type===t||c.shopifyType===t);if(l?.serverParams)return l.serverParams(e)}async getAdaptedFormServerResponse(t,e){let l=this.formResourceMap.find(c=>c.type===t||c.shopifyType===t);if(l?.serverResponse)return await l.serverResponse(e)}getShopData({store:t}){return t?k3(this,t):{}}getContentForHeader(){return"<script>var Shopify = Shopify || {};</script>"}getMenuData(t){return n2(this,t)}getFontData(t){return s2(this,t)}getFormData(t){return r2(this,t)}getFontFromShopifySetting(t){return v4(t)}getThemeConfig(t){return d4(t)}getPresetsConfig(t){return w4(t)}getEditorConfig(t){return g4(t)}getSectionConfigSchema(t){return y4(t)}async getLocaleConfig(t,e="en",l=".json"){let c=await t.getAllThemeConfigs(),a=new Map;for(let s of c.values())s.file_path.startsWith("theme/locales/")&&s.file_path.endsWith(l)&&a.set(s.file_path,s);let n=a.get(`theme/locales/${e}${l}`)??null;if(!n){let s=e.split("-")[0];if(n=a.get(`theme/locales/${s}${l}`)??null,!n){let r=`.default${l}`;for(let m of a.values())if(m.file_path.endsWith(r)){n=m;break}}}if(n){n=await t.getThemeConfig(n.file_path);try{return JSON.parse(n?.file_data||"")}catch{}}return{}}async getEditorLocaleConfig(t,e){if(this.editorLocaleConfig?.[e])return this.editorLocaleConfig[e];let l=await this.getLocaleConfig(t,e,".schema.json");return this.editorLocaleConfig={[e]:l},l}async renderSchemaTranslations(t,e,l="en"){if(!(0,D1.isObject)(e))return e;let c=await this.getEditorLocaleConfig(t,l);return await this.renderSchemaTranslationValue(t,e,l,c)}async renderSchemaTranslationValue(t,e,l,c){if(typeof e=="string"){if(e.startsWith("t:")){let a=e.slice(2),n=a?.split("."),s=n.pop()||"",r=n.join(".");return(0,D1.get)(c,r)?.[s]??a}}else if(e instanceof Array){let a=[];for(let n of e)a.push(await this.renderSchemaTranslationValue(t,n,l,c));return a}else if((0,D1.isObject)(e)){let a={...e};for(let[n,s]of Object.entries(e))a[n]=await this.renderSchemaTranslationValue(t,s,l,c);return a}return e}getPageType(t){return this.shopifyCompatibilityConfig?.page_types?.[t]||t}getPageRouteUrl(t){return this.theme.props.pages?.find(e=>e.id===t)?.url||t}getPageRoutes(){let t={account_addresses_url:this.getPageRouteUrl("account/addresses"),account_login_url:this.getPageRouteUrl("account/login"),account_logout_url:this.getPageRouteUrl("account/logout"),account_recover_url:this.getPageRouteUrl("account/recover"),account_register_url:this.getPageRouteUrl("account/signup"),account_url:this.getPageRouteUrl("account/index"),all_products_collection_url:this.getPageRouteUrl("products/index"),cart_add_url:this.getPageRouteUrl("cart/add"),cart_change_url:this.getPageRouteUrl("cart/change"),cart_clear_url:this.getPageRouteUrl("cart/clear"),cart_update_url:this.getPageRouteUrl("cart/update"),cart_url:this.getPageRouteUrl("cart/index"),collections_url:this.getPageRouteUrl("categories/index"),predictive_search_url:this.getPageRouteUrl("search/suggest"),product_recommendations_url:this.getPageRouteUrl("products/index"),root_url:this.getPageRouteUrl("index"),search_url:this.getPageRouteUrl("search")};if(this.shopifyCompatibilityConfig?.page_routes)for(let[e,l]of Object.entries(this.shopifyCompatibilityConfig.page_routes))l&&typeof l=="object"&&l.page_id?t[e]=this.getPageRouteUrl(l.page_id):typeof l=="string"&&(t[e]=l);return t}getLocalizationObject(t,e){return f1(this,t,e)}getAdaptedPageUrl(t){if(!t)return;let e,l,c={},[a,n]=t.split("?"),s=a.split("."),r=s[1]?s.pop():null,[m,p,o,g]=s.join(".").split("/");switch(r==="js"&&(l="json"),p){case"account":switch(o){case"order":e="account/order",c.id=g;break;case"register":e="account/login";break;default:break}break;case"blog":o&&(e="blogs/category",c.category=o),g&&(e="blogs/blog",c.slug=g);break;case"collections":o?o==="all"?e="products/index":(e="categories/category",c.slug=o):e="categories/index";break;case"gift_card":o&&(e="gift-card",c.code=o);break}if(e){let f=this.getPageRouteUrl(e);if(f)return f.replace(/:(\w+)/g,(d,w)=>c[w])+(r?`.${r}`:"")+(n?`?${n}`:"")}else if(l)return a.replace(new RegExp(`.${r}$`),`.${l}`)+(n?`?${n}`:"")}getThemeFilePath(t,e){switch(t){case"assets":return`assets/${e}`;case"components":return`snippets/${e}`;case"config":return`config/${e}`;case"layouts":return`layout/${e}`;case"templates":return`templates/${this.getPageType(e)}`;case"sections":return`sections/${e}`;default:throw new Error(`Theme file type not supported: ${t}`)}}getPageResourceMap(){return this.shopifyCompatibilityConfig?.page_resources?this.shopifyCompatibilityConfig.page_resources.map(t=>({page:t.page,resources:t.resources.map(({from:e,to:l,object:c})=>{let a=o2[c];if(!a)throw new Error(`ShopifyObject for '${c}' not found.`);return{from:e,to:l,object:a}})})):[]}getObjectResourceMap(){return this.shopifyCompatibilityConfig?.object_resources?this.shopifyCompatibilityConfig.object_resources.map(t=>{let e=o2[t.object];if(!e)throw new Error(`ShopifyObject for '${t.object}' not found.`);return{from:t.from,object:e}}):[]}getFormResourceMap(){return this.shopifyCompatibilityConfig?.forms?this.shopifyCompatibilityConfig.forms.map(t=>({shopifyType:t.shopify_type,type:t.id})):[]}getQueryParamsMap(){return[{from:"sort_by",to:"sort"},{from:t=>t.startsWith("filter.v."),to:(t,e)=>{let l=t.split("filter.v.")[1],c=e;return{[l]:c}}}]}getAllCountryOptionTags(t){return t?.countries?.map(e=>{if(!e)return;let l=[...(t?.states||[]).filter(a=>a.country===e.id).map(a=>[a.id,a.name])],c=JSON.stringify(l).replace(/"/g,"&quot;");return`<option value="${e.id}" data-provinces="${c}">${e.name}</option>`}).filter(Boolean).join(`
40
+ `)}async renderTranslation(t,e,l){let c=this.globals.translations,a=this.globals.request?.locale;return this.renderTranslationValue(a,c,t,e,l)}async renderTranslationValue(t,e,l,c,a){if(l===void 0)return a||"";let n=l?.split(".")||[],s=n.pop()||"",r=n.join("."),m=(0,M.get)(e,r),p=(0,M.get)(m?.[t],s)||(0,M.get)(m?.[t.split("-")[0]],s)||m?.[s];return c?.count!==void 0&&p?.one&&(p=c.count===1?p.one:p.other),typeof p!="string"||p===""?a||"":await this.renderTemplateString(p,c)||a||""}renderCurrency(t,e){let l=this.swell.storefront.settings,c=this.swell.storefront.currency,a=l.state,n=c.code=a?.store?.currency||"USD";return c.locale=a?.store?.locale||"en-US",c.state=a?.store?.locales?.find(s=>s.code===n)||{code:n},c.format(t,e)}},M1=class{title;status=500;message;description;constructor(t="Something went wrong",e=500,l){this.title=String(t),this.status=e,this.message=this.title+(l?`: ${l}`:""),this.description=l}toString(){return this.message}},x1=class extends M1{constructor(t="Page not found",e=404,l){super(t,e,l)}};function Q1(i,t){let{settings:e,schema:l}=t;if(!e?.section?.settings||!l?.fields||!l?.id)return e;let c=[{label:l.label||l.id,fields:l.fields}];return{...e,section:{...e.section,id:l.id,settings:k1(i,e.section.settings,c),blocks:e.section.blocks?.map(a=>({...a,settings:k1(i,a.settings,l.blocks?.filter(n=>n.type===a.type))}))}}}function k1(i,t,e){let l=(0,M.cloneDeep)(t);return(0,M.each)(l,(c,a)=>{let n=(e&&T3(e,a))??null;if(P1(c)&&!(c instanceof T)){switch(n?.type){case"color_scheme_group":{(0,M.each)(c,(s,r)=>{(0,M.each)(c[r].settings,(m,p)=>{(0,M.find)(n.fields,{id:p})?.type==="color"&&m&&(c[r].id=r,c[r].settings[p]=new S(m))})});return}default:break}l[a]=k1(i,c,e)}else switch(n?.type){case"lookup":case"product_lookup":case"category_lookup":case"customer_lookup":l[a]=i.resolveLookupSetting(n,c);break;case"color":c&&(l[a]=new S(c));break;case"font":l[a]=i.resolveFontSetting(c);break;case"menu":l[a]=i.resolveMenuSetting(c);break;case"url":l[a]=i.resolveUrlSetting(c);break}}),l}function _3(i,t,e){let l=[];return(0,M.each)(t,(c,a)=>{if(P1(c)&&!(c instanceof R))l.push(..._3(i,c,e));else{let n=T3(e,a);n?.type===i&&l.push({setting:n,value:c})}}),l}function r4(i){if(i.collection)return i.collection;switch(i.type){case"product_lookup":return"products";case"category_lookup":return"categories";case"customer_lookup":return"accounts";default:break}}function T3(i,t){for(let e of i||[])for(let l of e.fields)if(l.id===t)return l;return null}function k3(i,t){let e=t.currencies.find(l=>l.code===t.currency);return new v({accepts_gift_cards:!0,address:{},brand:{},collections_count:0,currency:t.currency,customer_accounts_enabled:!0,customer_accounts_optional:!0,description:t.description,domain:t.url.replace(/^http[s]?:\/\//,""),email:t.support_email,enabled_currencies:t.currencies.map(l=>({iso_code:l.code,name:l.name,symbol:l.symbol})),enabled_payment_providers:[],id:t.id,metafields:null,metaobjects:null,money_format:t.currencies.find(l=>l.code===t.currency),money_with_currency_format:{...e,symbol:`${t.currency} ${e?.symbol||""}`},name:t.name,password_message:null,permanent_domain:`${t.id}.swell.store`,phone:t.support_phone,published_locales:t.locales.map(l=>({endonym_name:l.name,iso_code:l.code,name:l.name,primary:l.code===t.locale,root_url:t.url})),secure_url:t.url,types:[],url:t.url,vendors:[],policies:[],privacy_policy:null,refund_policy:null,shipping_policy:null,subscription_policy:null,terms_of_service:null,products_count:0})}function f1(i,t,e){let l=t.currencies.find(a=>a.code===e.currency)||t.currencies[0],c=t.locales.find(a=>a.code===e.locale)||t.locales[0];return new v({available_countries:C0(t),available_languages:h4(t),country:l&&p4(l,t),language:c&&m4(c,t),market:null})}function C0(i){return i.currencies.map(t=>p4(t,i))||[]}function h4(i){return i.locales.map(t=>m4(t,i))||[]}function m4(i,t){return{endonym_name:i.name,iso_code:i.code,name:i.name,primary:i.code===t.locale,root_url:t.url}}function p4(i,t){return{available_languages:h4(t),continent:null,currency:{iso_code:i.code,name:i.name,symbol:i.symbol},iso_code:i.code,market:null,name:M0(i.code),"popular?":!1,unit_system:"metric"}}function M0(i){return i in o4?o4[i]:null}var o4=Object.freeze({USD:"United States",EUR:"Europe",GBP:"United Kingdom",JPY:"Japan",CAD:"Canada",AUD:"Australia",CHF:"Switzerland",CNY:"China",SEK:"Sweden",NZD:"New Zealand",NOK:"Norway",MXN:"Mexico",SGD:"Singapore",HKD:"Hong Kong",KRW:"South Korea",INR:"India",BRL:"Brazil",RUB:"Russia",ZAR:"South Africa",TRY:"Turkey",AED:"United Arab Emirates",THB:"Thailand",IDR:"Indonesia",SAR:"Saudi Arabia",PLN:"Poland",PHP:"Philippines",ILS:"Israel",MYR:"Malaysia",CZK:"Czech Republic",HUF:"Hungary",CLP:"Chile",DKK:"Denmark",RON:"Romania",ARS:"Argentina",COP:"Colombia",TWD:"Taiwan",BGN:"Bulgaria",EGP:"Egypt",PKR:"Pakistan",NGN:"Nigeria",VND:"Vietnam",IQD:"Iraq",MAD:"Morocco",KES:"Kenya",DZD:"Algeria",UAH:"Ukraine",XAF:"Cameroon",XOF:"C\xF4te d'Ivoire",GHS:"Ghana",BYN:"Belarus",LKR:"Sri Lanka",SDG:"Sudan",AFN:"Afghanistan",ALL:"Albania",AMD:"Armenia",AOA:"Angola",AWG:"Aruba",AZN:"Azerbaijan",BAM:"Bosnia and Herzegovina",BBD:"Barbados",BDT:"Bangladesh",BHD:"Bahrain",BIF:"Burundi",BMD:"Bermuda",BND:"Brunei",BOB:"Bolivia",BSD:"Bahamas",BTN:"Bhutan",BWP:"Botswana",BZD:"Belize",CDF:"Democratic Republic of the Congo",CLF:"Chile (Unidad de Fomento)",CRC:"Costa Rica",CVE:"Cape Verde",DJF:"Djibouti",DOP:"Dominican Republic",ERN:"Eritrea",ETB:"Ethiopia",FKP:"Falkland Islands",GEL:"Georgia",GIP:"Gibraltar",GMD:"Gambia",GNF:"Guinea",GTQ:"Guatemala",GYD:"Guyana",HNL:"Honduras",HRK:"Croatia",HTG:"Haiti",IRR:"Iran",ISK:"Iceland",JMD:"Jamaica",JOD:"Jordan",KGS:"Kyrgyzstan",KHR:"Cambodia",KMF:"Comoros",KPW:"North Korea",KWD:"Kuwait",KYD:"Cayman Islands",KZT:"Kazakhstan",LAK:"Laos",LBP:"Lebanon",LRD:"Liberia",LSL:"Lesotho",LYD:"Libya",MDL:"Moldova",MGA:"Madagascar",MKD:"North Macedonia",MMK:"Myanmar",MNT:"Mongolia",MOP:"Macau",MRO:"Mauritania",MUR:"Mauritius",MVR:"Maldives",MWK:"Malawi",NAD:"Namibia",NPR:"Nepal",OMR:"Oman",PAB:"Panama",PEN:"Peru",PGK:"Papua New Guinea",PYG:"Paraguay",QAR:"Qatar",RSD:"Serbia",RWF:"Rwanda",SBD:"Solomon Islands",SCR:"Seychelles",SHP:"Saint Helena",SLL:"Sierra Leone",SOS:"Somalia",SRD:"Suriname",STD:"S\xE3o Tom\xE9 and Pr\xEDncipe",SZL:"Eswatini",TJS:"Tajikistan",TMT:"Turkmenistan",TND:"Tunisia",TOP:"Tonga",TTD:"Trinidad and Tobago",TZS:"Tanzania",UGX:"Uganda",UYU:"Uruguay",UZS:"Uzbekistan",VEF:"Venezuela",VUV:"Vanuatu",WST:"Samoa",XCD:"Eastern Caribbean",YER:"Yemen",ZMW:"Zambia",ZWL:"Zimbabwe"});var o2={};U3(o2,{DeferredShopifyResource:()=>O,ShopifyArticle:()=>u1,ShopifyBlog:()=>X1,ShopifyCart:()=>m1,ShopifyCollection:()=>g1,ShopifyCollections:()=>e2,ShopifyCustomer:()=>U,ShopifyFont:()=>d1,ShopifyForm:()=>L1,ShopifyLink:()=>w1,ShopifyLocalization:()=>f1,ShopifyOrder:()=>e1,ShopifyPage:()=>c2,ShopifyPaginate:()=>o1,ShopifyPredictiveSearch:()=>i2,ShopifyProduct:()=>P,ShopifyResource:()=>v,ShopifySearch:()=>a2,ShopifyVariant:()=>V,adaptShopifyFontData:()=>s2,adaptShopifyFormData:()=>r2,adaptShopifyMenuData:()=>n2});function u1(i,t,e){return t instanceof v?t.clone():(e&&(t.category=e),new v({author:h(t,l=>l.author?.name||l.author?.email),content:h(t,l=>l.content),created_at:y(()=>t.date_created),excerpt:y(()=>t.summary),excerpt_or_content:y(()=>t.summary||t.content),handle:y(()=>t.slug),id:h(t,l=>l.id),image:h(t,l=>l.image&&A(i,l.image)),metafields:null,published_at:h(t,l=>l.date_published||l.date_created),tags:h(t,l=>l.tags),template_suffix:null,title:h(t,l=>l.title),updated_at:h(t,l=>l.date_updated||l.date_created),url:h([t,t.category],(l,c)=>c&&`/blogs/${c?.slug}/${l.slug}`),user:y(()=>t.author),comment_post_url:null,comments:null,comments_count:null,"comments_enabled?":!1,moderated:!1}))}function X1(i,t){if(t instanceof v)return t.clone();let e=h(t.blogs,l=>l?.results?.reduce((c,a)=>{for(let n of a.tags||[])c.includes(n)||c.push(n);return c},[]));return new v({all_tags:e,articles:h(t,l=>l.blogs?._cloneWithCompatibilityResult(c=>({results:c?.results?.map(a=>u1(i,a,l))}))||[]),articles_count:h(t.blogs,l=>l?.count||0),handle:y(()=>t.slug),id:h(t,l=>l.id),metafields:null,next_article:null,previous_article:null,tags:e,template_suffix:null,title:h(t,l=>l.title),url:h(t,l=>`/blogs/${l.slug}`),"comments_enabled?":!1,moderated:!1})}var f4=require("lodash-es");function R1(i,t){let e=t.type==="range",l=t.type==="boolean";return new v({active_values:e?void 0:t.active_options?.map(c=>c1(i,c,t)),false_value:l?c1(i,{value:""},t):void 0,inactive_values:e?void 0:t.inactive_options?.map(c=>c1(i,c,t)),label:t.label,max_value:e?c1(i,{value:t.range_max},t,"lte"):void 0,min_value:e?c1(i,{value:t.range_min},t,"gte"):void 0,operator:e?"AND":"OR",param_name:t.param_name,presentation:"text",range_max:t.range_max,true_value:l?c1(i,{value:t.options[0].value},t):void 0,type:t.id==="price"?"price_range":l?"boolean":"list",url_to_remove:k0(i,`filter_${t.id}`,!0),values:t.id!=="price"&&t.options?.map(c=>c1(i,c,t))})}function c1(i,t,e,l){let c=l?`${e.param_name}[${l}]`:e.param_name;return new v({active:t.active,count:t.count,image:null,label:t.label,param_name:c,swatch:null,url_to_add:R0(i,c,t.value),url_to_remove:P0(i,e.param_name,t.value),value:x0(i,t,e,l)})}function x0(i,t,e,l){let{queryParams:c}=i.swell,a=l?c[e.param_name]?.[l]:c[e.param_name];return e.type==="range"?a!==void 0&&a!==""?a:null:t.value}function t2(i){return Object.keys(i).reduce((t,e)=>(i[e]!==""&&(t[e]=(0,f4.isObject)(i[e])?t2(i[e]):i[e]),t),{})}function k0(i,t,e=!1){let{queryParams:l}=i.swell,c=E({...t2(l),...e?{[`${t}[gte]`]:void 0,[`${t}[lte]`]:void 0}:void 0,[t]:void 0,page:void 0});return P3(i,c)}function P0(i,t,e){let{queryParams:l}=i.swell,c=E({...t2(l),[t]:Array.isArray(l[t])?l[t].filter(a=>a!==e):void 0,page:void 0});return P3(i,c)}function R0(i,t,e){let{queryParams:l}=i.swell,c=E({...t2(l),[t]:Array.isArray(l[t])?l[t].concat(e):typeof l[t]=="string"?[l[t],e]:e,page:void 0});return P3(i,c)}function P3(i,t){let{url:e}=i.swell;return`${e.pathname}${t?`?${t}`:""}`}function g1(i,t){if(t instanceof v)return t.clone();let e=h(t,c=>c.products?._cloneWithCompatibilityResult(a=>({results:a?.results?.map(n=>P(i,n))}))??null);async function l(){let c=await e.resolve();return c&&"_resolve"in c?c._resolve():c}return new v({all_products_count:y(async()=>(await l())?.count||0),all_tags:y(async()=>(await l())?.results?.reduce((c,a)=>(Array.isArray(a.tags)&&c.push(...a.tags),c),[])||[]),all_types:y(async()=>{let c=await l();if(!c?.results)return[];let a=c.results.reduce((n,s)=>(s.type&&n.add(s.type),n),new Set);return Array.from(a.values())}),all_vendors:[],current_type:null,current_vendor:null,default_sort_by:h(t,c=>c.sort_options?.[0].value),description:h(t,c=>c.description),featured_image:h(t,c=>c.images?.[0]&&A(i,c.images[0])),filters:y(async()=>(await l())?.filter_options?.map(c=>R1(i,c))||[]),handle:y(()=>t.slug),id:h(t,c=>c.id),image:null,metafields:null,next_product:null,previous_product:null,products:e,products_count:y(async()=>(await l())?.results?.length||0),published_at:null,sort_by:y(()=>t.sort),sort_options:h(t,c=>c.sort_options),tags:[],template_suffix:null,title:y(()=>t.name),url:h(t,c=>`/collections/${c.slug}`)})}function e2(i,t){return new _(i.swell,t._collection,t._query,async()=>{let e=(await t.results)?.map(l=>g1(i,l));return{page:t.page??1,count:t.count??0,results:e,page_count:t.page_count??0,limit:t.limit,pages:t.pages??{}}})}function d1(i,t){return t instanceof v?t.clone():new v({baseline_ratio:null,fallback_families:t.fallback_families,family:t.family,style:t.style,"system?":t.system,variants:t.variants.map(e=>d1(i,e)),weight:t.weight})}var L0={account_login:{params:()=>({password_needed:!0})}};function L1(i,t){if(t instanceof v)return t.clone();let e=L0[t.id];return new v({...e?.params?.(t)||void 0,errors:t.errors&&new L3(t.errors),"posted_successfully?":t.success})}var R3=class{code;message;field_name;field_label;type;constructor(t){this.code=t.code,this.message=t.message,this.field_name=t.field_name,this.field_label=t.field_label,this.type=this.getShopifyErrorType(t)}getShopifyErrorType(t){return t.field_name==="email"?"email":t.field_name==="password"?"password":"form"}valueOf(){return this.type}toString(){return this.type}},L3=class i{errors;pointer=0;messages;translated_fields;constructor(t){return this.errors=Array.from(t).map(e=>new R3(e)),this.messages=new l2(this.errors,this.errors.map(e=>e.message)),this.translated_fields=new l2(this.errors,this.errors.map(e=>e.field_label)),new Proxy(this.errors,{get:(e,l)=>{let c=e;return l==="toJSON"?this.errors:l==="some"?this.some.bind(this):l==="messages"?this.messages:l==="translated_fields"?this.translated_fields:c[l]},getPrototypeOf(){return i.prototype}})}*[Symbol.iterator](){yield*this.errors}some(t,e){return this.errors.some(l=>t(l?.type),e)}},l2=class{values;constructor(t,e){return this.values=e,new Proxy(e,{get:(l,c)=>{let a=l;if(c==="toJSON")return e;let n=t?.findIndex?.(s=>s?.type===c);return n!==-1?e[n]:a[c]}})}};function i2(i,t){return t instanceof v?t.clone():new v({performed:h(t,e=>e.performed),resources:D0(i,t),terms:y(()=>t.query),types:["product"]})}function D0(i,t){return t instanceof v?t.clone():new v({products:h(t.products,e=>e?.results?.map(l=>{let c=P(i,l);return c.object_type="product",c}))})}function c2(i,t){return t instanceof v?t.clone():new v({content:h(t,e=>e.content),handle:y(()=>t.slug),metafields:null,published_at:y(async()=>await t.date_published||t.date_created),template_suffix:null,title:h(t,e=>e.title||e.name),url:h(t,e=>`/pages/${e.slug}`),author:null})}var u4=require("lodash-es");function w1(i,t,e){let l=t.handle||t.id;return new v({active:e.active,child_active:e.child_active,child_current:e.child_current,current:e.current,handle:`${l}-${(0,u4.snakeCase)(e.name)}`,levels:e.levels,links:e.items?.map(c=>w1(i,e,c)),object:e.resource,title:e.name,type:Z0(e.type),url:e.url})}function Z0(i){switch(i){case"home":return"frontpage_link";case"category":return"collection_link";case"product":return"product_link";case"search":return"search_link";default:return""}}function a2(i,t){if(t instanceof v)return t.clone();let e=h(t,l=>l.products?._cloneWithCompatibilityResult(c=>({results:c?.results?.map(a=>{let n=P(i,a);return n.object_type="product",n})}))||[]);return new v({default_sort_by:h(t,l=>l.sort_options?.[0].value),filters:y(async()=>(await(await e.resolve())?.filter_options)?.map(c=>R1(i,c))||[]),performed:h(t,l=>l.performed),results:e,results_count:y(async()=>(await e.resolve())?.count||0),sort_by:y(()=>t.sort),sort_options:h(t,l=>l.sort_options),terms:y(()=>t.query),types:["product"]})}function n2(i,t){let e={...t,handle:t.id.replace(/\_/g,"-"),title:t.name};return{...e,links:t.items?.map(l=>w1(i,e,l))}}function s2(i,t){return d1(i,t)}function r2(i,t){return L1(i,t)}function g4(i){let t={settings:[]};return Array.isArray(i)&&(i[0]?.name==="theme_info"&&i.shift(),i.forEach(e=>{t.settings.push(q0(e))})),t}function d4(i){return typeof i.current=="string"&&i.presets?.[i.current]?i.presets[i.current]:typeof i.current=="object"?i.current||{}:{}}function w4(i){return Object.entries(i.presets||{}).map(([t,e])=>({label:t,settings:e}))}function y4(i){return{label:i.name,type:i.type,tag:i.tag,class:i.class,enabled_on:i.enabled_on,disabled_on:i.disabled_on,fields:(i.settings||[]).map(e=>h2(e)),blocks:(i.blocks||[]).map(e=>A0(e)),presets:(i.presets||[]).map(e=>H0(e)),default:i.default}}function A0(i){return{type:i.type,label:i.name,limit:i.limit,fields:(i.settings||[]).map(e=>h2(e))}}function H0(i){return{label:i.name,settings:i.settings,blocks:i.blocks}}function q0(i){return{label:i.name,fields:(i.settings||[]).map(e=>h2(e))}}function h2(i){let t={};switch(i.type){case"text":t={type:"text"};break;case"textarea":t={type:"textarea"};break;case"paragraph":t={type:"paragraph",label:i.content};break;case"select":t={type:"select",options:i.options};break;case"checkbox":t={type:"checkbox"};break;case"radio":t={type:"radio",options:i.options};break;case"number":t={type:"integer"};break;case"range":t={type:"number",min:i.min,max:i.max,increment:i.step,unit:i.unit};break;case"article":t={type:"lookup",collection:"content/blogs:posts"};break;case"blog":t={type:"lookup",collection:"content/blogs"};break;case"collection":t={type:"category_lookup"};break;case"collection_list":t={type:"category_lookup",multiple:!0,limit:i.limit};break;case"color":t={type:"color"};break;case"color_background":t={type:"color_background"};break;case"color_scheme":t={type:"color_scheme"};break;case"color_scheme_group":t={type:"color_scheme_group",fields:(i.definition||[]).map(e=>h2(e)),role:i.role};break;case"font_picker":t={type:"font"};break;case"html":t={type:"html"};break;case"image_picker":t={type:"image"};break;case"inline_richtext":t={type:"rich_text"};break;case"link_list":t={type:"menu"};break;case"liquid":t={type:"liquid"};break;case"page":t={type:"lookup",collection:"content/pages"};break;case"product":t={type:"product_lookup"};break;case"product_list":t={type:"product_lookup",multiple:!0,limit:i.limit};break;case"richtext":t={type:"rich_html"};break;case"text_alignment":t={type:"select",options:[{value:"left",label:"Left"},{value:"center",label:"Center"},{value:"right",label:"Right"}]};break;case"url":t={type:"url"};break;case"video":t={type:"video"};break;case"video_url":t={type:"url"};break;case"header":t={type:"header",label:i.content};break}return{id:i.id,label:i.label,default:i.default,description:i.info,...t}}function v4(i){let t=i.lastIndexOf("_"),e=i.substring(0,t),l=i.substring(t+1),c=F0[e];if(c){let a=c.variants[l];return`${c.family}:${a}`}return null}var F0={abel:{family:"Abel",variants:{n4:"wght@400"}},abril_fatface:{family:"Abril Fatface",variants:{n4:"wght@400"}},alegreya:{family:"Alegreya",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},alegreya_sans:{family:"Alegreya Sans",variants:{n1:"wght@100",i1:"ital,wght@1,100",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},amiri:{family:"Amiri",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},anonymous_pro:{family:"Anonymous Pro",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},arapey:{family:"Arapey",variants:{n4:"wght@400",i4:"ital,wght@1,400"}},archivo:{family:"Archivo",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},archivo_narrow:{family:"Archivo Narrow",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},arimo:{family:"Arimo",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},armata:{family:"Armata",variants:{n4:"wght@400"}},arvo:{family:"Arvo",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},asap:{family:"Asap",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},assistant:{family:"Assistant",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",n6:"wght@600",n7:"wght@700",n8:"wght@800"}},asul:{family:"Asul",variants:{n4:"wght@400",n7:"wght@700"}},bio_rhyme:{family:"Bio Rhyme",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",n7:"wght@700",n8:"wght@800"}},bitter:{family:"Bitter",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700"}},cabin:{family:"Cabin",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},cardo:{family:"Cardo",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700"}},catamaran:{family:"Catamaran",variants:{n1:"wght@100",n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},chivo:{family:"Chivo",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900",i9:"ital,wght@1,900"}},cormorant:{family:"Cormorant",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},crimson_text:{family:"Crimson Text",variants:{n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},dm_sans:{family:"DM Sans",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700"}},domine:{family:"Domine",variants:{n4:"wght@400",n7:"wght@700"}},dosis:{family:"Dosis",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800"}},eczar:{family:"Eczar",variants:{n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800"}},fira_sans:{family:"Fira Sans",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},fjalla_one:{family:"Fjalla One",variants:{n4:"wght@400"}},glegoo:{family:"Glegoo",variants:{n4:"wght@400",n7:"wght@700"}},ibm_plex_sans:{family:"IBM Plex Sans",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},inconsolata:{family:"Inconsolata",variants:{n4:"wght@400",n7:"wght@700"}},inknut_antiqua:{family:"Inknut Antiqua",variants:{n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},inter:{family:"Inter",variants:{n1:"wght@100",n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},josefin_sans:{family:"Josefin Sans",variants:{n1:"wght@100",i1:"ital,wght@1,100",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},josefin_slab:{family:"Josefin Slab",variants:{n1:"wght@100",i1:"ital,wght@1,100",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700"}},kalam:{family:"Kalam",variants:{n3:"wght@300",n4:"wght@400",n7:"wght@700"}},karla:{family:"Karla",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},kreon:{family:"Kreon",variants:{n3:"wght@300",n4:"wght@400",n7:"wght@700"}},lato:{family:"Lato",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},libre_baskerville:{family:"Libre Baskerville",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700"}},libre_franklin:{family:"Libre Franklin",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},lobster:{family:"Lobster",variants:{n4:"wght@400"}},lobster_two:{family:"Lobster Two",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},lora:{family:"Lora",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},maven_pro:{family:"Maven Pro",variants:{n4:"wght@400",n5:"wght@500",n7:"wght@700",n9:"wght@900"}},megrim:{family:"Megrim",variants:{n4:"wght@400"}},merriweather_sans:{family:"Merriweather Sans",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800"}},montserrat:{family:"Montserrat",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},mouse_memoirs:{family:"Mouse Memoirs",variants:{n4:"wght@400"}},muli:{family:"Muli",variants:{n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},neuton:{family:"Neuton",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",n8:"wght@800"}},news_cycle:{family:"News Cycle",variants:{n4:"wght@400",n7:"wght@700"}},newsreader:{family:"Newsreader",variants:{n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800"}},nobile:{family:"Nobile",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700"}},noticia_text:{family:"Noticia Text",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},noto_serif:{family:"Noto Serif",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},nunito:{family:"Nunito",variants:{n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},nunito_sans:{family:"Nunito Sans",variants:{n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},old_standard_tt:{family:"Old Standard TT",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700"}},open_sans:{family:"Open Sans",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800"}},open_sans_condensed:{family:"Open Sans Condensed",variants:{n3:"wght@300",i3:"ital,wght@1,300",n7:"wght@700"}},oswald:{family:"Oswald",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700"}},ovo:{family:"Ovo",variants:{n4:"wght@400"}},oxygen:{family:"Oxygen",variants:{n3:"wght@300",n4:"wght@400",n7:"wght@700"}},pt_mono:{family:"PT Mono",variants:{n4:"wght@400"}},pt_sans:{family:"PT Sans",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},pt_sans_narrow:{family:"PT Sans Narrow",variants:{n4:"wght@400",n7:"wght@700"}},pt_serif:{family:"PT Serif",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},pacifico:{family:"Pacifico",variants:{n4:"wght@400"}},playball:{family:"Playball",variants:{n4:"wght@400"}},playfair_display:{family:"Playfair Display",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900",i9:"ital,wght@1,900"}},poppins:{family:"Poppins",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},prata:{family:"Prata",variants:{n4:"wght@400"}},prompt:{family:"Prompt",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},proza_libre:{family:"Proza Libre",variants:{n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800"}},quantico:{family:"Quantico",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},quattrocento:{family:"Quattrocento",variants:{n4:"wght@400",n7:"wght@700"}},quattrocento_sans:{family:"Quattrocento Sans",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},questrial:{family:"Questrial",variants:{n4:"wght@400"}},quicksand:{family:"Quicksand",variants:{n3:"wght@300",n4:"wght@400",n5:"wght@500",n7:"wght@700"}},rajdhani:{family:"Rajdhani",variants:{n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700"}},raleway:{family:"Raleway",variants:{n1:"wght@100",i1:"ital,wght@1,100",n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n8:"wght@800",i8:"ital,wght@1,800",n9:"wght@900",i9:"ital,wght@1,900"}},righteous:{family:"Righteous",variants:{n4:"wght@400"}},roboto:{family:"Roboto",variants:{n1:"wght@100",i1:"ital,wght@1,100",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900",i9:"ital,wght@1,900"}},roboto_condensed:{family:"Roboto Condensed",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},roboto_mono:{family:"Roboto Mono",variants:{n1:"wght@100",i1:"ital,wght@1,100",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700"}},roboto_slab:{family:"Roboto Slab",variants:{n1:"wght@100",n3:"wght@300",n4:"wght@400",n7:"wght@700"}},rubik:{family:"Rubik",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900",i9:"ital,wght@1,900"}},shadows_into_light:{family:"Shadows Into Light",variants:{n4:"wght@400"}},slabo_13px:{family:"Slabo 13px",variants:{n4:"wght@400"}},smooch:{family:"Smooch",variants:{n4:"wght@400"}},source_code_pro:{family:"Source Code Pro",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n9:"wght@900"}},source_sans_pro:{family:"Source Sans Pro",variants:{n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900",i9:"ital,wght@1,900"}},space_mono:{family:"Space Mono",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},syne:{family:"Syne",variants:{n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800"}},tenor_sans:{family:"Tenor Sans",variants:{n4:"wght@400"}},tinos:{family:"Tinos",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},titillium_web:{family:"Titillium Web",variants:{n2:"wght@200",i2:"ital,wght@1,200",n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900"}},ubuntu:{family:"Ubuntu",variants:{n3:"wght@300",i3:"ital,wght@1,300",n4:"wght@400",i4:"ital,wght@1,400",n5:"wght@500",i5:"ital,wght@1,500",n7:"wght@700",i7:"ital,wght@1,700"}},unica_one:{family:"Unica One",variants:{n4:"wght@400"}},unna:{family:"Unna",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},varela:{family:"Varela",variants:{n4:"wght@400"}},varela_round:{family:"Varela Round",variants:{n4:"wght@400"}},vidaloka:{family:"Vidaloka",variants:{n4:"wght@400"}},volkhov:{family:"Volkhov",variants:{n4:"wght@400",i4:"ital,wght@1,400",n7:"wght@700",i7:"ital,wght@1,700"}},vollkorn:{family:"Vollkorn",variants:{n4:"wght@400",i4:"ital,wght@1,400",n6:"wght@600",i6:"ital,wght@1,600",n7:"wght@700",i7:"ital,wght@1,700",n9:"wght@900",i9:"ital,wght@1,900"}},work_sans:{family:"Work Sans",variants:{n1:"wght@100",n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},biz_udpmincho:{family:"BIZ UDPMincho",variants:{n4:"wght@400",n7:"wght@700"}},dela_gothic_one:{family:"Dela Gothic One",variants:{n4:"wght@400"}},hina_mincho:{family:"Hina Mincho",variants:{n4:"wght@400"}},kaisei_decol:{family:"Kaisei Decol",variants:{n4:"wght@400",n5:"wght@500",n7:"wght@700"}},kaisei_opti:{family:"Kaisei Opti",variants:{n4:"wght@400",n5:"wght@500",n7:"wght@700"}},kaisei_tokumin:{family:"Kaisei Tokumin",variants:{n4:"wght@400",n5:"wght@500",n7:"wght@700",n8:"wght@800"}},m_plus_1:{family:"M PLUS 1",variants:{n1:"wght@100",n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},m_plus_rounded_1c:{family:"M PLUS Rounded 1c",variants:{n1:"wght@100",n3:"wght@300",n4:"wght@400",n5:"wght@500",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},mochiy_pop_p_one:{family:"Mochiy Pop P One",variants:{n4:"wght@400"}},murecho:{family:"Murecho",variants:{n1:"wght@100",n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},noto_sans_japanese:{family:"Noto Sans Japanese",variants:{n1:"wght@100",n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800",n9:"wght@900"}},noto_serif_japanese:{family:"Noto Serif Japanese",variants:{n2:"wght@200",n3:"wght@300",n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n9:"wght@900"}},shippori_mincho:{family:"Shippori Mincho",variants:{n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n8:"wght@800"}},zen_kaku_gothic_new:{family:"Zen Kaku Gothic New",variants:{n3:"wght@300",n4:"wght@400",n5:"wght@500",n7:"wght@700",n9:"wght@900"}},zen_kurenaido:{family:"Zen Kurenaido",variants:{n4:"wght@400"}},zen_maru_gothic:{family:"Zen Maru Gothic",variants:{n3:"wght@300",n4:"wght@400",n5:"wght@500",n7:"wght@700",n9:"wght@900"}},zen_old_mincho:{family:"Zen Old Mincho",variants:{n4:"wght@400",n5:"wght@500",n6:"wght@600",n7:"wght@700",n9:"wght@900"}}};var p1=class{theme;swell;pageId;pageResourceMap;objectResourceMap;formResourceMap;queryParamsMap;editorLocaleConfig;shopifyCompatibilityConfig;constructor(t){this.theme=t,this.swell=t.swell,this.shopifyCompatibilityConfig=this.swell.shopifyCompatibilityConfig??void 0,this.pageResourceMap=this.getPageResourceMap(),this.objectResourceMap=this.getObjectResourceMap(),this.formResourceMap=this.getFormResourceMap(),this.queryParamsMap=this.getQueryParamsMap()}adaptGlobals(t){let{store:e,request:l,page:c,menus:a}=t;this.pageId=this.getPageType(c?.id),t.shop=this.getShopData(t),t.page={...c||void 0},t.request={...l||void 0,design_mode:this.swell.isEditor,visual_section_preview:!1,page_type:c?.id},t.linklists=a,t.current_page=this.swell.queryParams.page||1,t.routes=this.getPageRoutes(),t.localization=this.getLocalizationObject(e,l),t.all_country_option_tags=this.getAllCountryOptionTags(t.geo)}adaptPageData(t){let e=this.pageResourceMap.find(({page:l})=>l===this.pageId);if(e)for(let[l,c]of Object.entries(t)){let a=e.resources.find(({from:n})=>n===l);a&&c instanceof T&&(t[a.to]=a.object(this,c))}this.adaptObjectData(t)}adaptObjectData(t){for(let e of Object.values(t)){let l=this.objectResourceMap.find(({from:c})=>c===e?.constructor.name);if(l){let c=l.object(this,e);e instanceof T?e.setCompatibilityProps(c):Object.assign(e,c)}}}adaptQueryParams(){let t={};for(let[e,l]of Object.entries(this.swell.queryParams)){let c=this.queryParamsMap.find(({from:a})=>typeof a=="function"?a(e):a===e);if(c){let a=typeof c.to=="function"?c.to(e,l):{[c.to]:l};Object.assign(t,a)}else t[e]=l}this.swell.queryParams=t}getAdaptedFormType(t){return this.formResourceMap.find(l=>l.shopifyType===t)?.type}async getAdaptedFormClientParams(t,e,l){let c=this.formResourceMap.find(a=>a.type===t);if(c?.clientParams)return await c.clientParams(e,l)}async getAdaptedFormClientHtml(t,e,l){let c=this.formResourceMap.find(n=>n.type===t),a=this.shopifyCompatibilityConfig?.forms?.find(n=>n.id===t);if(c&&a)return a.client_params?.reduce((n,s)=>`<input type="hidden" name="${s.name}" value="${s.value}" />`+n,"")}async getAdaptedFormServerParams(t,e){let l=this.formResourceMap.find(c=>c.type===t||c.shopifyType===t);if(typeof l?.serverParams=="function")return l.serverParams(e)}async getAdaptedFormServerResponse(t,e){let l=this.formResourceMap.find(c=>c.type===t||c.shopifyType===t);if(typeof l?.serverResponse=="function")return await l.serverResponse(e)}getShopData({store:t}){return t?k3(this,t):{}}getContentForHeader(){return"<script>var Shopify = Shopify || {};</script>"}getMenuData(t){return n2(this,t)}getFontData(t){return s2(this,t)}getFormData(t){return r2(this,t)}getFontFromShopifySetting(t){return v4(t)}getThemeConfig(t){return d4(t)}getPresetsConfig(t){return w4(t)}getEditorConfig(t){return g4(t)}getSectionConfigSchema(t){return y4(t)}async getLocaleConfig(t,e="en",l=".json"){let c=await t.getAllThemeConfigs(),a=new Map;for(let s of c.values())s.file_path.startsWith("theme/locales/")&&s.file_path.endsWith(l)&&a.set(s.file_path,s);let n=a.get(`theme/locales/${e}${l}`)??null;if(!n){let s=e.split("-")[0];if(n=a.get(`theme/locales/${s}${l}`)??null,!n){let r=`.default${l}`;for(let m of a.values())if(m.file_path.endsWith(r)){n=m;break}}}if(n){n=await t.getThemeConfig(n.file_path);try{return JSON.parse(n?.file_data||"")}catch{}}return{}}async getEditorLocaleConfig(t,e){if(this.editorLocaleConfig?.[e])return this.editorLocaleConfig[e];let l=await this.getLocaleConfig(t,e,".schema.json");return this.editorLocaleConfig={[e]:l},l}async renderSchemaTranslations(t,e,l="en"){if(!(0,D1.isObject)(e))return e;let c=await this.getEditorLocaleConfig(t,l);return await this.renderSchemaTranslationValue(t,e,l,c)}async renderSchemaTranslationValue(t,e,l,c){if(typeof e=="string"){if(e.startsWith("t:")){let a=e.slice(2),n=a?.split("."),s=n.pop()||"",r=n.join(".");return(0,D1.get)(c,r)?.[s]??a}}else if(e instanceof Array){let a=[];for(let n of e)a.push(await this.renderSchemaTranslationValue(t,n,l,c));return a}else if((0,D1.isObject)(e)){let a={...e};for(let[n,s]of Object.entries(e))a[n]=await this.renderSchemaTranslationValue(t,s,l,c);return a}return e}getPageType(t){return this.shopifyCompatibilityConfig?.page_types?.[t]||t}getPageRouteUrl(t){return this.theme.props.pages?.find(e=>e.id===t)?.url||t}getPageRoutes(){let t={account_addresses_url:this.getPageRouteUrl("account/addresses"),account_login_url:this.getPageRouteUrl("account/login"),account_logout_url:this.getPageRouteUrl("account/logout"),account_recover_url:this.getPageRouteUrl("account/recover"),account_register_url:this.getPageRouteUrl("account/signup"),account_url:this.getPageRouteUrl("account/index"),all_products_collection_url:this.getPageRouteUrl("products/index"),cart_add_url:this.getPageRouteUrl("cart/add"),cart_change_url:this.getPageRouteUrl("cart/change"),cart_clear_url:this.getPageRouteUrl("cart/clear"),cart_update_url:this.getPageRouteUrl("cart/update"),cart_url:this.getPageRouteUrl("cart/index"),collections_url:this.getPageRouteUrl("categories/index"),predictive_search_url:this.getPageRouteUrl("search/suggest"),product_recommendations_url:this.getPageRouteUrl("products/index"),root_url:this.getPageRouteUrl("index"),search_url:this.getPageRouteUrl("search")};if(this.shopifyCompatibilityConfig?.page_routes)for(let[e,l]of Object.entries(this.shopifyCompatibilityConfig.page_routes))l&&typeof l=="object"&&l.page_id?t[e]=this.getPageRouteUrl(l.page_id):typeof l=="string"&&(t[e]=l);return t}getLocalizationObject(t,e){return f1(this,t,e)}getAdaptedPageUrl(t){if(!t)return;let e,l,c={},[a,n]=t.split("?"),s=a.split("."),r=s[1]?s.pop():null,[m,p,o,g]=s.join(".").split("/");switch(r==="js"&&(l="json"),p){case"account":switch(o){case"order":e="account/order",c.id=g;break;case"register":e="account/login";break;default:break}break;case"blog":o&&(e="blogs/category",c.category=o),g&&(e="blogs/blog",c.slug=g);break;case"collections":o?o==="all"?e="products/index":(e="categories/category",c.slug=o):e="categories/index";break;case"gift_card":o&&(e="gift-card",c.code=o);break}if(e){let f=this.getPageRouteUrl(e);if(f)return f.replace(/:(\w+)/g,(d,w)=>c[w])+(r?`.${r}`:"")+(n?`?${n}`:"")}else if(l)return a.replace(new RegExp(`.${r}$`),`.${l}`)+(n?`?${n}`:"")}getThemeFilePath(t,e){switch(t){case"assets":return`assets/${e}`;case"components":return`snippets/${e}`;case"config":return`config/${e}`;case"layouts":return`layout/${e}`;case"templates":return`templates/${this.getPageType(e)}`;case"sections":return`sections/${e}`;default:throw new Error(`Theme file type not supported: ${t}`)}}getPageResourceMap(){return this.shopifyCompatibilityConfig?.page_resources?this.shopifyCompatibilityConfig.page_resources.map(t=>({page:t.page,resources:t.resources.map(({from:e,to:l,object:c})=>{let a=o2[c];if(!a)throw new Error(`ShopifyObject for '${c}' not found.`);return{from:e,to:l,object:a}})})):[]}getObjectResourceMap(){return this.shopifyCompatibilityConfig?.object_resources?this.shopifyCompatibilityConfig.object_resources.map(t=>{let e=o2[t.object];if(!e)throw new Error(`ShopifyObject for '${t.object}' not found.`);return{from:t.from,object:e}}):[]}getFormResourceMap(){return this.shopifyCompatibilityConfig?.forms?this.shopifyCompatibilityConfig.forms.map(t=>({shopifyType:t.shopify_type,type:t.id})):[]}getQueryParamsMap(){return[{from:"sort_by",to:"sort"},{from:t=>t.startsWith("filter.v."),to:(t,e)=>{let l=t.split("filter.v.")[1],c=e;return{[l]:c}}}]}getAllCountryOptionTags(t){return t?.countries?.map(e=>{if(!e)return;let l=[...(t?.states||[]).filter(a=>a.country===e.id).map(a=>[a.id,a.name])],c=JSON.stringify(l).replace(/"/g,"&quot;");return`<option value="${e.id}" data-provinces="${c}">${e.name}</option>`}).filter(Boolean).join(`
41
41
  `)}};var Z3=100,A3=15,m2=1e3*5,T=class{_getter;_getterHash;_result;_compatibilityProps={};constructor(t){return t&&this._setGetter(t),this._getProxy()}_getProxy(){return new Proxy(this,{get(t,e){let l=t;switch(e){case"toLiquid":case"next":return;case"then":return!1;case"toJSON":case"toObject":return()=>l.toObject();default:break}if(typeof l[e]=="function"||e.startsWith?.("_"))return l[e];if(typeof e=="symbol"&&e===Symbol.toStringTag)return l._result instanceof Promise?"[object Promise]":l._result!==void 0?"[object Object]":"undefined";if(l._result===void 0){if(l[e]!==void 0)return l[e];l._result=l._get().catch(c=>(console.log(c),l._getCollectionResultOrProp(l,e)))}return l._result instanceof Promise?l._result.then(()=>l._getCollectionResultOrProp(l,e)).catch(c=>(console.log(c),null)):l._getCollectionResultOrProp(l,e)},set(t,e,l){return t[e]=l,!0}})}_getCollectionResultOrProp(t,e){if(t._result&&Array.isArray(t._result.results)){let l=t._result.results.find(c=>c.slug===e||c.id===e)||(typeof e=="number"?t._result.results[e]:void 0);if(l)return l}return e in t._compatibilityProps?t._compatibilityProps[e]:t._result&&e in t._result?t._result[e]:t[e]}async _get(...t){if(this._getter){let e=this._getter;this._result=Promise.resolve().then(()=>e()).then(l=>(this._result=l,l&&Object.assign(this,l),l)).catch(l=>(console.log(l),null))}return this._result}_setGetter(t){this._getter=t,this._getterHash=Z1(t.toString())}async _resolve(){return this._result===void 0?this._get():this._result}_isResultResolved(){return this._result!==void 0&&!(this._result instanceof Promise)}async resolve(t=!0,e=!1){let l={},c=await this._resolve();return c===null?null:(Object.assign(l,c),Object.assign(l,this._compatibilityProps),W(l,t,e))}toObject(){if(this._result===null)return null;let t={};return Object.assign(t,this._result),Object.assign(t,this._compatibilityProps),t}toJSON(){return this.toObject()}valueOf(){return this.resolve()}setCompatibilityProps(t){this._compatibilityProps=t}getCompatibilityProp(t){return this._compatibilityProps[t]}},y1=class extends T{_swell;_resource;_collection;_query={};_compatibilityInstance=null;constructor(t,e,l){if(!(t instanceof A1))throw new Error("Storefront resource requires `swell` instance.");return super(l),this._swell=t,this._collection=e,this._getProxy()}_getProxy(){return super._getProxy()}getResourceObject(){let{_swell:t,_collection:e}=this;if(this._resource=(t?.storefront)[e],t&&e.startsWith("content/")){let l=e.split("/")[1]?.replace(/\/$/,"").trim();this._resource={list:c=>t.storefront.content.list(l,c),get:(c,a)=>t.storefront.content.get(l,c,a)}}if(!this._resource?.get)throw new Error(`Swell storefront resource for collection '${e}' does not exist.`);return this._resource}},_=class i extends y1{length=0;results;count;page;pages;page_count;limit=A3;name;constructor(t,e,l={},c){return super(t,e,c),this._query=this._initQuery(l),c||this._setGetter(this._defaultGetter()),this._getProxy()}_getProxy(){return super._getProxy()}_initQuery(t){let e=t||{};return e.limit>Z3||e.limit===null?e.limit=Z3:e.limit||(e.limit=A3),this.limit=e.limit,e}_defaultGetter(){let t=this.getResourceObject();async function e(){return t.list(this._query)}return e}async _get(t={}){if(this._query={...this._query,...t},this._getter){let e=this._getter;this._result=this._swell.getCachedResource("storefront-list",[this._collection,this._query,this._getterHash],async()=>e.call(this)).then(l=>(this._result=l,l&&Object.assign(this,l,{length:l.results?.length||0}),l)).catch(l=>(console.log(l),null))}return this._result}[Symbol.iterator](){return this.iterator()}*iterator(){for(let t of this.results||[])yield t}_clone(t){let e=new i(this._swell,this._collection,this._query,this._getter);return this._isResultResolved()&&(e._result=(0,D3.cloneDeep)(this._result)),this._compatibilityProps&&e.setCompatibilityProps(this._compatibilityProps),t!==void 0&&(Object.assign(e,t),t._getter&&e._setGetter(t._getter)),e}_cloneWithCompatibilityResult(t){let e=this._getter,l=this._clone({_getter:async()=>{let c=await e?.call(l);if(c){let a=t(c);return{...c,...a||void 0}}return c}});if(this._isResultResolved()){let c=(0,D3.cloneDeep)(this._result);if(c){let a=t(c);Object.assign(l,c),a&&Object.assign(l,a)}}return l}},C=class extends y1{_id;id;constructor(t,e,l,c={},a){return super(t,e,a),this._id=l,this._query=c,a||this._setGetter(this._defaultGetter()),this._getProxy()}_getProxy(){return super._getProxy()}_defaultGetter(){let t=this.getResourceObject();async function e(){return t.get(this._id,this._query)}return e}async _get(t,e={}){if(this._id=t||this._id,this._query={...this._query,...e},this._getter){let l=this._getter;this._result=this._swell.getCachedResource("storefront-record",[this._collection,this._id,this._query,this._getterHash],async()=>l.call(this)).then(c=>(this._result=c,c&&Object.assign(this,c),c)).catch(c=>(console.log(c),null))}return this._result}},K=class extends y1{constructor(t,e,l){return super(t,e,l),l||this._setGetter(this._defaultGetter()),this._getProxy()}_getProxy(){return super._getProxy()}_defaultGetter(){let t=this.getResourceObject();async function e(){return t.get()}return e}async _get(){if(this._getter){let t=this._getter;this._result=Promise.resolve().then(()=>t.call(this)).then(e=>(this._result=e,e&&Object.assign(this,e),e)).catch(e=>(console.log(e),null))}return this._result}},z1=class{_resource;count=0;page=0;page_count=0;limit=0;pages={};next;previous;constructor(t){this._resource=t,t instanceof _&&this.setPaginationProps()}setPaginationProps(){let{_resource:t}=this;if(this.count=t.count||0,this.page=t.page||0,this.page_count=t.page_count||0,this.limit=t.limit||0,this.pages={},t.pages)for(let[c,a]of Object.entries(t.pages))this.pages[c]={start:a.start,end:a.end,url:this.getPageUrl(Number(c))};let e=this.pages[this.page+1];this.next=e?{start:e.start,end:e.end,url:this.getPageUrl(this.page+1)}:void 0;let l=this.pages[this.page-1];this.previous=l?{start:l.start,end:l.end,url:this.getPageUrl(this.page-1)}:void 0}getPageUrl(t){let{url:e,queryParams:l}=this._resource._swell;return`${e.pathname}?${E({...l,page:t})}`}setCompatibilityProps(t){Object.assign(this,t)}};var H3={aa:"ET",ab:"GE",abr:"GH",ace:"ID",ach:"UG",ada:"GH",ady:"RU",ae:"IR",aeb:"TN",af:"ZA",agq:"CM",aho:"IN",ak:"GH",akk:"IQ",aln:"XK",alt:"RU",am:"ET",amo:"NG",aoz:"ID",apd:"TG",ar:"EG",arc:"IR","arc-Nbat":"JO","arc-Palm":"SY",arn:"CL",aro:"BO",arq:"DZ",ary:"MA",arz:"EG",as:"IN",asa:"TZ",ase:"US",ast:"ES",atj:"CA",av:"RU",awa:"IN",ay:"BO",az:"AZ","az-Arab":"IR",ba:"RU",bal:"PK",ban:"ID",bap:"NP",bar:"AT",bas:"CM",bax:"CM",bbc:"ID",bbj:"CM",bci:"CI",be:"BY",bej:"SD",bem:"ZM",bew:"ID",bez:"TZ",bfd:"CM",bfq:"IN",bft:"PK",bfy:"IN",bg:"BG",bgc:"IN",bgn:"PK",bgx:"TR",bhb:"IN",bhi:"IN",bhk:"PH",bho:"IN",bi:"VU",bik:"PH",bin:"NG",bjj:"IN",bjn:"ID",bjt:"SN",bkm:"CM",bku:"PH",blt:"VN",bm:"ML",bmq:"ML",bn:"BD",bo:"CN",bpy:"IN",bqi:"IR",bqv:"CI",br:"FR",bra:"IN",brh:"PK",brx:"IN",bs:"BA",bsq:"LR",bss:"CM",bto:"PH",btv:"PK",bua:"RU",buc:"YT",bug:"ID",bum:"CM",bvb:"GQ",byn:"ER",byv:"CM",bze:"ML",ca:"ES",cch:"NG",ccp:"BD",ce:"RU",ceb:"PH",cgg:"UG",ch:"GU",chk:"FM",chm:"RU",cho:"US",chp:"CA",chr:"US",cja:"KH",cjm:"VN",ckb:"IQ",co:"FR",cop:"EG",cps:"PH",cr:"CA",crh:"UA",crj:"CA",crk:"CA",crl:"CA",crm:"CA",crs:"SC",cs:"CZ",csb:"PL",csw:"CA",ctd:"MM",cu:"RU","cu-Glag":"BG",cv:"RU",cy:"GB",da:"DK",dak:"US",dar:"RU",dav:"KE",dcc:"IN",de:"DE",den:"CA",dgr:"CA",dje:"NE",dnj:"CI",doi:"IN",dsb:"DE",dtm:"ML",dtp:"MY",dty:"NP",dua:"CM",dv:"MV",dyo:"SN",dyu:"BF",dz:"BT",ebu:"KE",ee:"GH",efi:"NG",egl:"IT",egy:"EG",eky:"MM",el:"GR",en:"US","en-Shaw":"GB",es:"ES",esu:"US",et:"EE",ett:"IT",eu:"ES",ewo:"CM",ext:"ES",fa:"IR",fan:"GQ",ff:"SN","ff-Adlm":"GN",ffm:"ML",fi:"FI",fia:"SD",fil:"PH",fit:"SE",fj:"FJ",fo:"FO",fon:"BJ",fr:"FR",frc:"US",frp:"FR",frr:"DE",frs:"DE",fub:"CM",fud:"WF",fuf:"GN",fuq:"NE",fur:"IT",fuv:"NG",fvr:"SD",fy:"NL",ga:"IE",gaa:"GH",gag:"MD",gan:"CN",gay:"ID",gbm:"IN",gbz:"IR",gcr:"GF",gd:"GB",gez:"ET",ggn:"NP",gil:"KI",gjk:"PK",gju:"PK",gl:"ES",glk:"IR",gn:"PY",gom:"IN",gon:"IN",gor:"ID",gos:"NL",got:"UA",grc:"CY","grc-Linb":"GR",grt:"IN",gsw:"CH",gu:"IN",gub:"BR",guc:"CO",gur:"GH",guz:"KE",gv:"IM",gvr:"NP",gwi:"CA",ha:"NG",hak:"CN",haw:"US",haz:"AF",he:"IL",hi:"IN",hif:"FJ",hil:"PH",hlu:"TR",hmd:"CN",hnd:"PK",hne:"IN",hnj:"LA",hnn:"PH",hno:"PK",ho:"PG",hoc:"IN",hoj:"IN",hr:"HR",hsb:"DE",hsn:"CN",ht:"HT",hu:"HU",hy:"AM",hz:"NA",ia:"FR",iba:"MY",ibb:"NG",id:"ID",ife:"TG",ig:"NG",ii:"CN",ik:"US",ikt:"CA",ilo:"PH",in:"ID",inh:"RU",is:"IS",it:"IT",iu:"CA",iw:"IL",izh:"RU",ja:"JP",jam:"JM",jgo:"CM",ji:"UA",jmc:"TZ",jml:"NP",jut:"DK",jv:"ID",jw:"ID",ka:"GE",kaa:"UZ",kab:"DZ",kac:"MM",kaj:"NG",kam:"KE",kao:"ML",kbd:"RU",kby:"NE",kcg:"NG",kck:"ZW",kde:"TZ",kdh:"TG",kdt:"TH",kea:"CV",ken:"CM",kfo:"CI",kfr:"IN",kfy:"IN",kg:"CD",kge:"ID",kgp:"BR",kha:"IN",khb:"CN",khn:"IN",khq:"ML",kht:"IN",khw:"PK",ki:"KE",kiu:"TR",kj:"NA",kjg:"LA",kk:"KZ","kk-Arab":"CN",kkj:"CM",kl:"GL",kln:"KE",km:"KH",kmb:"AO",kn:"IN",knf:"SN",ko:"KR",koi:"RU",kok:"IN",kos:"FM",kpe:"LR",krc:"RU",kri:"SL",krj:"PH",krl:"RU",kru:"IN",ks:"IN",ksb:"TZ",ksf:"CM",ksh:"DE",ku:"TR","ku-Arab":"IQ",kum:"RU",kv:"RU",kvr:"ID",kvx:"PK",kw:"GB",kxm:"TH",kxp:"PK",ky:"KG","ky-Arab":"CN","ky-Latn":"TR",la:"VA",lab:"GR",lad:"IL",lag:"TZ",lah:"PK",laj:"UG",lb:"LU",lbe:"RU",lbw:"ID",lcp:"CN",lep:"IN",lez:"RU",lg:"UG",li:"NL",lif:"NP","lif-Limb":"IN",lij:"IT",lis:"CN",ljp:"ID",lki:"IR",lkt:"US",lmn:"IN",lmo:"IT",ln:"CD",lo:"LA",lol:"CD",loz:"ZM",lrc:"IR",lt:"LT",ltg:"LV",lu:"CD",lua:"CD",luo:"KE",luy:"KE",luz:"IR",lv:"LV",lwl:"TH",lzh:"CN",lzz:"TR",mad:"ID",maf:"CM",mag:"IN",mai:"IN",mak:"ID",man:"GM","man-Nkoo":"GN",mas:"KE",maz:"MX",mdf:"RU",mdh:"PH",mdr:"ID",men:"SL",mer:"KE",mfa:"TH",mfe:"MU",mg:"MG",mgh:"MZ",mgo:"CM",mgp:"NP",mgy:"TZ",mh:"MH",mi:"NZ",min:"ID",mis:"IQ",mk:"MK",ml:"IN",mls:"SD",mn:"MN","mn-Mong":"CN",mni:"IN",mnw:"MM",moe:"CA",moh:"CA",mos:"BF",mr:"IN",mrd:"NP",mrj:"RU",mro:"BD",ms:"MY",mt:"MT",mtr:"IN",mua:"CM",mus:"US",mvy:"PK",mwk:"ML",mwr:"IN",mwv:"ID",mxc:"ZW",my:"MM",myv:"RU",myx:"UG",myz:"IR",mzn:"IR",na:"NR",nan:"CN",nap:"IT",naq:"NA",nb:"NO",nch:"MX",nd:"ZW",ndc:"MZ",nds:"DE",ne:"NP",new:"NP",ng:"NA",ngl:"MZ",nhe:"MX",nhw:"MX",nij:"ID",niu:"NU",njo:"IN",nl:"NL",nmg:"CM",nn:"NO",nnh:"CM",no:"NO",nod:"TH",noe:"IN",non:"SE",nqo:"GN",nr:"ZA",nsk:"CA",nso:"ZA",nus:"SS",nv:"US",nxq:"CN",ny:"MW",nym:"TZ",nyn:"UG",nzi:"GH",oc:"FR",om:"ET",or:"IN",os:"GE",osa:"US",otk:"MN",pa:"IN","pa-Arab":"PK",pag:"PH",pal:"IR","pal-Phlp":"CN",pam:"PH",pap:"AW",pau:"PW",pcd:"FR",pcm:"NG",pdc:"US",pdt:"CA",peo:"IR",pfl:"DE",phn:"LB",pka:"IN",pko:"KE",pl:"PL",pms:"IT",pnt:"GR",pon:"FM",pra:"PK",prd:"IR",ps:"AF",pt:"BR",puu:"GA",qu:"PE",quc:"GT",qug:"EC",raj:"IN",rcf:"RE",rej:"ID",rgn:"IT",ria:"IN",rif:"MA",rjs:"NP",rkt:"BD",rm:"CH",rmf:"FI",rmo:"CH",rmt:"IR",rmu:"SE",rn:"BI",rng:"MZ",ro:"RO",rob:"ID",rof:"TZ",rtm:"FJ",ru:"RU",rue:"UA",rug:"SB",rw:"RW",rwk:"TZ",ryu:"JP",sa:"IN",saf:"GH",sah:"RU",saq:"KE",sas:"ID",sat:"IN",sav:"SN",saz:"IN",sbp:"TZ",sc:"IT",sck:"IN",scn:"IT",sco:"GB",scs:"CA",sd:"PK","sd-Deva":"IN","sd-Khoj":"IN","sd-Sind":"IN",sdc:"IT",sdh:"IR",se:"NO",sef:"CI",seh:"MZ",sei:"MX",ses:"ML",sg:"CF",sga:"IE",sgs:"LT",shi:"MA",shn:"MM",si:"LK",sid:"ET",sk:"SK",skr:"PK",sl:"SI",sli:"PL",sly:"ID",sm:"WS",sma:"SE",smj:"SE",smn:"FI",smp:"IL",sms:"FI",sn:"ZW",snk:"ML",so:"SO",sou:"TH",sq:"AL",sr:"RS",srb:"IN",srn:"SR",srr:"SN",srx:"IN",ss:"ZA",ssy:"ER",st:"ZA",stq:"DE",su:"ID",suk:"TZ",sus:"GN",sv:"SE",sw:"TZ",swb:"YT",swc:"CD",swg:"DE",swv:"IN",sxn:"ID",syl:"BD",syr:"IQ",szl:"PL",ta:"IN",taj:"NP",tbw:"PH",tcy:"IN",tdd:"CN",tdg:"NP",tdh:"NP",te:"IN",tem:"SL",teo:"UG",tet:"TL",tg:"TJ","tg-Arab":"PK",th:"TH",thl:"NP",thq:"NP",thr:"NP",ti:"ET",tig:"ER",tiv:"NG",tk:"TM",tkl:"TK",tkr:"AZ",tkt:"NP",tl:"PH",tly:"AZ",tmh:"NE",tn:"ZA",to:"TO",tog:"MW",tpi:"PG",tr:"TR",tru:"TR",trv:"TW",ts:"ZA",tsd:"GR",tsf:"NP",tsg:"PH",tsj:"BT",tt:"RU",ttj:"UG",tts:"TH",ttt:"AZ",tum:"MW",tvl:"TV",twq:"NE",txg:"CN",ty:"PF",tyv:"RU",tzm:"MA",udm:"RU",ug:"CN","ug-Cyrl":"KZ",uga:"SY",uk:"UA",uli:"FM",umb:"AO",und:"US",unr:"IN","unr-Deva":"NP",unx:"IN",ur:"PK",uz:"UZ","uz-Arab":"AF",vai:"LR",ve:"ZA",vec:"IT",vep:"RU",vi:"VN",vic:"SX",vls:"BE",vmf:"DE",vmw:"MZ",vot:"RU",vro:"EE",vun:"TZ",wa:"BE",wae:"CH",wal:"ET",war:"PH",wbp:"AU",wbq:"IN",wbr:"IN",wls:"WF",wni:"KM",wo:"SN",wtm:"IN",wuu:"CN",xav:"BR",xcr:"TR",xh:"ZA",xlc:"TR",xld:"TR",xmf:"GE",xmn:"CN",xmr:"SD",xna:"SA",xnr:"IN",xog:"UG",xpr:"IR",xsa:"YE",xsr:"NP",yao:"MZ",yap:"FM",yav:"CM",ybb:"CM",yo:"NG",yrl:"BR",yua:"MX",yue:"HK","yue-Hans":"CN",za:"CN",zag:"SD",zdj:"KM",zea:"NL",zgh:"MA",zh:"CN","zh-Bopo":"TW","zh-Hanb":"TW","zh-Hant":"TW",zlm:"TG",zmi:"MY",zu:"ZA",zza:"TR"};function Z1(i){var t="0123456789abcdef";function e(b){var z,x="";for(z=0;z<=3;z++)x+=t.charAt(b>>z*8+4&15)+t.charAt(b>>z*8&15);return x}function l(b,z){var x=(b&65535)+(z&65535),k=(b>>16)+(z>>16)+(x>>16);return k<<16|x&65535}function c(b,z){return b<<z|b>>>32-z}function a(b,z,x,k,q,F){return l(c(l(l(z,b),l(k,F)),q),x)}function n(b,z,x,k,q,F,Q){return a(z&x|~z&k,b,z,q,F,Q)}function s(b,z,x,k,q,F,Q){return a(z&k|x&~k,b,z,q,F,Q)}function r(b,z,x,k,q,F,Q){return a(z^x^k,b,z,q,F,Q)}function m(b,z,x,k,q,F,Q){return a(x^(z|~k),b,z,q,F,Q)}function p(b){var z,x=(b.length+8>>6)+1,k=new Array(x*16);for(z=0;z<x*16;z++)k[z]=0;for(z=0;z<b.length;z++)k[z>>2]|=b.charCodeAt(z)<<z%4*8;return k[z>>2]|=128<<z%4*8,k[x*16-2]=b.length*8,k}var o,g=p(""+i),f=1732584193,u=-271733879,d=-1732584194,w=271733878,J,a1,O3,G3;for(o=0;o<g.length;o+=16)J=f,a1=u,O3=d,G3=w,f=n(f,u,d,w,g[o+0],7,-680876936),w=n(w,f,u,d,g[o+1],12,-389564586),d=n(d,w,f,u,g[o+2],17,606105819),u=n(u,d,w,f,g[o+3],22,-1044525330),f=n(f,u,d,w,g[o+4],7,-176418897),w=n(w,f,u,d,g[o+5],12,1200080426),d=n(d,w,f,u,g[o+6],17,-1473231341),u=n(u,d,w,f,g[o+7],22,-45705983),f=n(f,u,d,w,g[o+8],7,1770035416),w=n(w,f,u,d,g[o+9],12,-1958414417),d=n(d,w,f,u,g[o+10],17,-42063),u=n(u,d,w,f,g[o+11],22,-1990404162),f=n(f,u,d,w,g[o+12],7,1804603682),w=n(w,f,u,d,g[o+13],12,-40341101),d=n(d,w,f,u,g[o+14],17,-1502002290),u=n(u,d,w,f,g[o+15],22,1236535329),f=s(f,u,d,w,g[o+1],5,-165796510),w=s(w,f,u,d,g[o+6],9,-1069501632),d=s(d,w,f,u,g[o+11],14,643717713),u=s(u,d,w,f,g[o+0],20,-373897302),f=s(f,u,d,w,g[o+5],5,-701558691),w=s(w,f,u,d,g[o+10],9,38016083),d=s(d,w,f,u,g[o+15],14,-660478335),u=s(u,d,w,f,g[o+4],20,-405537848),f=s(f,u,d,w,g[o+9],5,568446438),w=s(w,f,u,d,g[o+14],9,-1019803690),d=s(d,w,f,u,g[o+3],14,-187363961),u=s(u,d,w,f,g[o+8],20,1163531501),f=s(f,u,d,w,g[o+13],5,-1444681467),w=s(w,f,u,d,g[o+2],9,-51403784),d=s(d,w,f,u,g[o+7],14,1735328473),u=s(u,d,w,f,g[o+12],20,-1926607734),f=r(f,u,d,w,g[o+5],4,-378558),w=r(w,f,u,d,g[o+8],11,-2022574463),d=r(d,w,f,u,g[o+11],16,1839030562),u=r(u,d,w,f,g[o+14],23,-35309556),f=r(f,u,d,w,g[o+1],4,-1530992060),w=r(w,f,u,d,g[o+4],11,1272893353),d=r(d,w,f,u,g[o+7],16,-155497632),u=r(u,d,w,f,g[o+10],23,-1094730640),f=r(f,u,d,w,g[o+13],4,681279174),w=r(w,f,u,d,g[o+0],11,-358537222),d=r(d,w,f,u,g[o+3],16,-722521979),u=r(u,d,w,f,g[o+6],23,76029189),f=r(f,u,d,w,g[o+9],4,-640364487),w=r(w,f,u,d,g[o+12],11,-421815835),d=r(d,w,f,u,g[o+15],16,530742520),u=r(u,d,w,f,g[o+2],23,-995338651),f=m(f,u,d,w,g[o+0],6,-198630844),w=m(w,f,u,d,g[o+7],10,1126891415),d=m(d,w,f,u,g[o+14],15,-1416354905),u=m(u,d,w,f,g[o+5],21,-57434055),f=m(f,u,d,w,g[o+12],6,1700485571),w=m(w,f,u,d,g[o+3],10,-1894986606),d=m(d,w,f,u,g[o+10],15,-1051523),u=m(u,d,w,f,g[o+1],21,-2054922799),f=m(f,u,d,w,g[o+8],6,1873313359),w=m(w,f,u,d,g[o+15],10,-30611744),d=m(d,w,f,u,g[o+6],15,-1560198380),u=m(u,d,w,f,g[o+13],21,1309151649),f=m(f,u,d,w,g[o+4],6,-145523070),w=m(w,f,u,d,g[o+11],10,-1120210379),d=m(d,w,f,u,g[o+2],15,718787259),u=m(u,d,w,f,g[o+9],21,-343485551),f=l(f,J),u=l(u,a1),d=l(d,O3),w=l(w,G3);return e(f)+e(u)+e(d)+e(w)}function C3(i){return{parent_id:i["theme-id"],branch_id:i["theme-branch-id"]||null,preview:i["deployment-mode"]==="editor"||i["deployment-mode"]==="preview"?!0:{$ne:!0}}}function E0(i,t){if(!i.file_path.startsWith("theme/sections/"))return!1;if(i.file_path.endsWith(".liquid")){if(!t.get(i.file_path.replace(/\.liquid$/,".json")))return!0}else if(i.file_path.endsWith(".json"))return!0;return!1}async function M3(i,t){let e=[];for(let l of i.values())if(E0(l,i)){let c=await t(l);e.push({id:l.name.split(".").pop(),...c,...c&&{presets:B0(c)}})}return e}function B0(i){return Array.isArray(i?.presets)?i.presets.map(t=>({label:t.label,settings:{...i.fields?.reduce((e,l)=>(l.id&&l.default!==void 0&&(e[l.id]=l.default),e),{}),...t.settings||void 0},blocks:t.blocks?.map(e=>{let l=i.blocks?.find(c=>c.type===e.type);return l?{...e,settings:{...l.fields.reduce((c,a)=>(a.id&&a.default!==void 0&&(c[a.id]=a.default),c),{}),...e.settings||void 0}}:e})})):[]}async function x3(i,t){let e=Array.from(i.values()),l=e.filter(n=>n.file_path.startsWith("theme/sections/")&&n.file_path.endsWith(".json")&&!i.has(n.file_path.replace(/\.json$/,".liquid"))),c=async n=>{let s=e.find(m=>{if(!m.file_path.endsWith(`/${n}.json`)&&!m.file_path.endsWith(`/${n}.liquid`))return!1;if(m.file_path.endsWith(".liquid")){if(!i.get(m.file_path.replace(/\.liquid$/,".json")))return!0}else if(m.file_path.endsWith(".json"))return!0;return!1});return s?{...await t(s),id:s.name.split(".").pop()}:void 0},a=[];for(let n of l){let s;try{s=JSON.parse(n.file_data),s?.name&&(s.label=s.name,delete s.name)}catch{}if(s?.type){let r=await Y1(s,c);a.push({...s,id:n.name.split(".").pop(),sectionConfigs:r})}}return a}async function Y1(i,t){let e=i.order instanceof Array?i.order:Object.keys(i.sections||{}),l=[];for(let c of e){let a=i.sections[c];if(!a)continue;let n=await t(a.type)||{id:a.type,tag:"div",class:"",fields:[],blocks:[]},s=i.id?`page__${i.id}__${c}`:n.id,m=(a.block_order instanceof Array?a.block_order:Object.keys(a.blocks||{})).map(o=>a.blocks?.[o]).filter(Boolean),p={section:{id:s,...a,blocks:m}};l.push({id:s,section:{id:s,...a},schema:n,settings:p,tag:n.tag||"div",class:n.class})}return l}function V0(i){return String(i)==="[object Array]"}function P1(i){let t=typeof i;return i!==null&&(t==="object"||t==="function")}function q3(i){let t=new TextEncoder().encode(i),e="";for(let l=0;l<t.length;l+=3){let c=Array.from(t.slice(l,l+3));e+=btoa(String.fromCharCode(...c))}return e}function z3(i,t="id"){return(0,b4.reduce)(i,(e,l)=>(e[l[t]]=l,e),{})}function N0(i){let t=i.toUpperCase().split(/-|_/),e=t.shift(),l=t.pop(),c="";return l&&(c=l),l||(c=H3[e.toLowerCase()]||""),c.toLowerCase()}function F3(i,t){if(!(typeof i!="object"||i===null)){for(let e of Object.keys(i))if(Object.hasOwn(i,e)&&t(e,i)!==!1){let c=i[e];typeof c=="object"&&c!==null&&F3(c,t)}}}function I0(i){let t=new Set;return F3(i,(e,l)=>{if(typeof l=="object"&&l!==null){if(t.has(l))return!1;t.add(l)}}),Array.from(t)}function $0(i){let t=new WeakSet;return i&&JSON.parse(JSON.stringify(i,(e,l)=>{if(typeof l=="object"&&l!==null){if(t.has(l))return JSON.parse(JSON.stringify(l));t.add(l)}return l}))}function _4(i){if(typeof i!="object"||i===null)return i;for(let t in i)t==="_swell"?i[t]=void 0:_4(i[t])}function S4(i){if(i!==void 0)return i instanceof _?"SwellStorefrontCollection":i instanceof C?"SwellStorefrontRecord":i instanceof v?"ShopifyResource":i instanceof T?"StorefrontResource":"promise"}async function W(i,t=!0,e=!1){let l=i,c=t;try{if(i instanceof Promise&&(c=!1,l=await i),i instanceof T&&(c=!1,l=await W(i.resolve(),t,e)),l instanceof Array){if(l=await Promise.all(l.map(a=>W(a,t,e))),l.filter(a=>a!==void 0).length===0)return t?[]:void 0}else if(typeof l=="object"&&l!==null&&!l._swell){let a={};for(let[n]of Object.entries(l)){if(!t&&(l[n]instanceof Promise||l[n]instanceof T||l[n]instanceof v)){a[n]={_type:S4(l[n]),...e?{value:await W(l[n],c,e)}:{}};continue}if(l[n]instanceof T&&e){a[n]={_type:S4(l[n]),value:await W(l[n],c,e)};continue}a[n]=await W(l[n],c,e)}return!t&&Object.keys(a).length===0?void 0:a}}catch(a){return console.error(a),i}return l}function E(i){return z4.default.stringify({...i,sections:void 0,section_id:void 0},{encodeValuesOnly:!0,arrayFormat:"repeat"})}var H1=class{map=new Map;kvStore;timeoutDefault;constructor(t,e=6e4){t&&(this.kvStore=t),console.log(`Initializing cache - timeout: ${e}${t?" - KV: enabled":""}`),this.timeoutDefault=e}setValues(t){this.map=new Map(t.map(([e,l])=>[e,[0,l]]))}getValues(){return Array.from(this.map).map(([t,e])=>[t,e[1]])}async get(t){let e=this.map.get(t);if(e!==void 0)return e[1];if(this.kvStore){let l,c=await this.kvStore.get(t);if(c===null)l=void 0;else try{l=JSON.parse(c),l==="KV_NULL"&&(l=null),this.setSync(t,l,this.timeoutDefault)}catch(a){console.error("Cache.get JSON.parse error",t,a.message,c)}return l}}getSync(t){let e=this.map.get(t);return e?e[1]:void 0}async set(t,e,l=this.timeoutDefault){if(this.setSync(t,e,l),this.kvStore){let c=e;if(e instanceof Promise&&(c=await e),c instanceof T)return;c===null&&(c="KV_NULL");let a=l*10,n=a>=6e4?Math.ceil(a/1e3):0;this.kvStore.put(t,JSON.stringify(c),{...n>0?{expirationTtl:n}:void 0})}}setSync(t,e,l=this.timeoutDefault){let c=this.map.get(t);c!==void 0&&clearTimeout(c[0]);let a=l?setTimeout(()=>{this.map.delete(t)},l):0;this.map.set(t,[a,e])}async delete(t){this.deleteSync(t),this.kvStore&&await this.kvStore.delete(t)}deleteSync(t){let e=this.map.get(t);e!==void 0&&(clearTimeout(e[0]),this.map.delete(t))}async has(t){return await this.get(t)!==void 0}hasSync(t){return this.map.has(t)}async clear(t){if(t)for(let[l,c]of this.map.entries())l.startsWith(t)&&(clearTimeout(c[0]),this.map.delete(l));else{for(let l of this.map.values())clearTimeout(l[0]);this.map.clear()}let{kvStore:e}=this;if(e){let l="",c=!1;for(;!c;){let a=await e.list({prefix:t,cursor:l||void 0});l=a.cursor??"",c=a.list_complete,a.keys.length>0&&await Promise.all(a.keys.map(n=>e.delete(n.name)))}}}};var T4="https://api.schema.io",C4=1e3*60,M4="storefront_api",x4=Object.freeze(["swell-store-id","swell-environment-id","swell-app-id","swell-app-version","swell-theme-id","swell-theme-version","swell-theme-branch-id","swell-theme-config-version","swell-public-key","swell-admin-url","swell-vault-url","swell-deployment-mode","swell-request-id"]),A1=class i{url;headers;swellHeaders;queryParams;workerEnv;config;shopifyCompatibilityConfig;backend;storefront;instanceId="";isPreview=!1;isEditor=!1;sentResponse=!1;static cache=new Map;storefront_url;constructor(t){let{url:e,config:l,shopifyCompatibilityConfig:c,headers:a,swellHeaders:n,serverHeaders:s,queryParams:r,workerEnv:m,...p}=t;if(this.url=e instanceof URL?e:new URL(e||""),this.config=l,this.shopifyCompatibilityConfig=c,this.queryParams=i.formatQueryParams(r||this.url.searchParams),this.workerEnv=m,s){let{headers:o,swellHeaders:g}=i.formatHeaders(s);this.headers=o,this.swellHeaders=g,this.backend=new p2({storeId:g["store-id"],accessToken:g["access-token"],apiHost:g["api-host"]}),this.storefront=this.getStorefrontInstance({...t,headers:o,swellHeaders:g}),this.instanceId=["store-id","environment-id","deployment-mode","theme-id","theme-branch-id"].map(f=>g[f]).join("|"),this.isEditor=p.isEditor??g["deployment-mode"]==="editor",this.isPreview=this.isEditor||g["deployment-mode"]==="preview"}else if(a&&n)Object.assign(this,p),p.cache&&this.setCacheValues(p.cache),this.headers=a,this.swellHeaders=n,this.storefront=this.getStorefrontInstance(t);else throw new Error("Swell client requires `serverHeaders` when initialized on the server-side, or `headers` and `swellHeaders` when initialized on the client-side.")}static formatHeaders(t){let e={},l={};t instanceof Headers?t.forEach((c,a)=>{e[a]=c}):t&&(e=t);for(let c in e)c.startsWith("swell-")&&(l[c.replace("swell-","")]=e[c]||"");return{headers:e,swellHeaders:l}}static formatQueryParams(t){let e={};return t instanceof URLSearchParams?e=P4.default.parse(t.toString()):t&&(e=t),e}getClientProps(){let t=x4.reduce((c,a)=>(c[a]=this.headers[a],c),{}),e=x4.reduce((c,a)=>{let n=a.replace("swell-","");return c[n]=this.swellHeaders[n],c},{}),l=this.storefront.settings;return{url:this.url,headers:t,swellHeaders:e,queryParams:this.queryParams,instanceId:this.instanceId,isPreview:this.isPreview,isEditor:this.isEditor,cache:this.getCacheInstance().getValues(),storefrontSettingStates:{state:l.state,menuState:l.menuState,paymentState:l.paymentState,subscriptionState:l.subscriptionState,sessionState:l.sessionState}}}getStorefrontInstance(t){let{swellHeaders:e,getCookie:l,setCookie:c,storefrontSettingStates:a}=t,n=k4.default.create(e["store-id"],e["public-key"],{url:e["admin-url"],vaultUrl:e["vault-url"],getCookie:l,setCookie:c&&((s,r,m)=>c(s,r,m,this)),headers:{"Swell-Store-id":e["store-id"],"Swell-Storefront-Id":e["storefront-id"]}});return a&&Object.assign(n.settings,a),n.request=this.getCacheableStorefrontRequestHandler(n),n}isStorefrontRequestCacheable(t,e){if(t==="get")switch(e.split("/")[1]){case"products":case"categories":case"content":case"settings":return!0;default:return!1}return!1}getCacheableStorefrontRequestHandler(t){let e=t.request;return(l,c,a,n,s)=>this.isStorefrontRequestCacheable(l,c)?this.getCachedSync(M4,[l,c,a,n,s],()=>e(l,c,a,n,s),m2):e(l,c,a,n,s)}getCacheInstance(){let t=i.cache.get(this.instanceId);return t||(t=new H1(this.workerEnv?.THEME,C4),i.cache.set(this.instanceId,t)),t}setCacheValues(t){let e=new H1(this.workerEnv?.THEME,C4);e.setValues(t),i.cache.set(this.instanceId,e)}getCacheKeyPrefix(){return`${this.instanceId}:`}getCacheKey(t,e){let l=Array.isArray(e)&&e.length>0?`${this.getCacheKeyPrefix()}${t}_${JSON.stringify(e)}`:`${this.getCacheKeyPrefix()}${t}`;return l.length<=512?l:`${l.slice(0,480)}${Z1(l)}`}setCachedSync(t,e,l,c,a=!0){let n=this.getCacheKey(t,e),s=this.getCacheInstance();return a?s.setSync(n,l,c):s.set(n,l,c)}getCachedSync(t,e,l,c,a=!0){let n=typeof e=="function"?void 0:e,s=typeof e=="function"?e:l,r=this.getCacheKey(t,n),m=this.getCacheInstance();if(a){if(m.hasSync(r))return m.getSync(r);if(s)return this.resolveCacheHandler(m,r,s,c,a)}else return m.get(r).then(p=>{if(p!==void 0)return p;if(s)return this.resolveCacheHandler(m,r,s,c,a)})}resolveCacheHandler(t,e,l,c,a=!0){let n;try{n=l(),a?t.setSync(e,n,c):t.set(e,n,c),n instanceof Promise&&n.then(s=>{a?t.setSync(e,s,c):t.set(e,s,c)})}catch(s){console.error(s)}return n}async setCached(t,e,l,c){return this.setCachedSync(t,e,l,c,!1)}async getCached(t,e,l,c){return this.getCachedSync(t,e,l,c,!1)}async getCachedVersion(t,e,l,c=0){let a=JSON.stringify(t),n=async()=>(await this.deleteCachedVersion(a),l());return this.getCachedSync(`${a}:v@${e}`,void 0,n,c,!1)}async getCachedResource(t,e,l,c){let a=this.swellHeaders["request-id"],n=typeof e=="function"?[a]:[a,e],s=typeof e=="function"?e:l;return this.getCachedSync(t,n,s,c||m2)}async updateCacheModified(t){t&&await this.getCached("_cache-modified")!==t&&(await this.clearCache(M4),await this.getCacheInstance().set(this.getCacheKey("_cache-modified"),t,0))}async deleteCachedVersion(t){await this.clearCache(`${t}:v@`)}async clearCache(t){await this.getCacheInstance().clear(this.getCacheKey(t))}async getAppSettings(){return await this.get("/:storefronts/{id}/configs/settings/values",{id:this.swellHeaders["storefront-id"]})||{}}async getStorefrontSettings(){try{let{settings:t,menus:e,payments:l,subscriptions:c,session:a}=await this.storefront.request("get","/settings/all"),n=this.storefront.settings;n.localizedState={},n.set({value:t}),n.set({model:"menus",value:e}),n.set({model:"payments",value:l}),n.set({model:"subscriptions",value:c}),n.set({model:"session",value:a})}catch(t){console.error(`Swell: unable to load settings (${t})`)}return this.storefront.settings.get()}getStorefrontMenus(){let t=this.storefront.settings.getState("/settings/menus","menuState");return!t||t instanceof Promise?[]:t}async get(...t){return this.backend?.get(...t)}async put(...t){return this.backend?.put(...t)}async post(...t){return this.backend?.post(...t)}async delete(...t){return this.backend?.delete(...t)}},p2=class{apiHost=T4;apiAuth="";constructor({storeId:t,accessToken:e,apiHost:l}){this.apiHost=l||T4,this.apiAuth=q3(`${t}:${e}`)}async makeRequest(t,e,l){let c={method:t,headers:{Authorization:`Basic ${this.apiAuth}`,"User-Agent":"swell-functions/1.0","Content-Type":"application/json"}},a="";if(l)try{t==="GET"?a=`?${this.stringifyQuery(l)}`:(c.body=JSON.stringify(l),c.headers["Content-Length"]=String(c.body.length))}catch{throw new Error(`Error serializing data: ${l}`)}let n=String(e).startsWith("/")?e.substring(1):e,s=`${this.apiHost}/${n}${a}`,r=await fetch(s,c),m=await r.text(),p;try{p=JSON.parse(m)}catch{p=String(m||"").trim()}if(r.status>299)throw new q1(p,{status:r.status,method:t,endpointUrl:n});if(t!=="GET"&&p?.errors)throw new q1(p.errors,{status:400,method:t,endpointUrl:n});return p}stringifyQuery(t,e){let l=[];for(let[c,a]of Object.entries(t)){let n=e?`${e}[${c}]`:c,r=a!==null&&typeof a=="object"?this.stringifyQuery(a,n):`${encodeURIComponent(n)}=${a===null?"":encodeURIComponent(a)}`;l.push(r)}return l.join("&")}async get(t,e){return this.makeRequest("GET",t,e)}async put(t,e){return this.makeRequest("PUT",t,e)}async post(t,e){return this.makeRequest("POST",t,e)}async delete(t,e){return this.makeRequest("DELETE",t,e)}},q1=class extends Error{status=200;constructor(t,e={}){let l;typeof t=="string"?l=t:l=JSON.stringify(t,null,2),e.method&&e.endpointUrl&&(l=`${e.method} /${e.endpointUrl}
42
- ${l}`),super(l),this.name="SwellError",this.status=e.status||500}};function E3(i,t){return new _(i,"products",t)}function j0(i,t,e){return new C(i,"products",t,e)}function O0(i,{search:t,filter:e,sort:l}){return new _(i,"products",{search:t,filter:e,sort:l})}function G0(i,t){return new _(i,"categories",t)}function R4(i,t,e){return new C(i,"categories",t,e)}async function U0(i,t,e){let l=R4(i,t,e),c=await l.id;return l.products=E3(i,{category:c}),l}function K0(i,t){return i.getCachedResource(`content-model-${t}`,()=>i.get("/:content/{name}",{name:t,public:!0,"storefront.enabled":!0}))}async function L4(i,t,e){return new _(i,`content/${t}`,e)}async function B3(i,t,e,l){return new C(i,`content/${t}`,e,l)}async function W0(i,t,e){return B3(i,"pages",t,e)}async function J0(i,t){return L4(i,"blogs",t)}async function Q0(i,t,e){return B3(i,"blogs",t,e)}var N=require("lodash-es");function D4(i,t){return i.renderPageTemplate(t)}async function Z4(i,t){let e=[];for(let l of t)if(X0(l,t)){let c=await N3(i,l);e.push({id:l.name.split(".").pop(),...c})}return e}async function V3(i,t,e=Y0){let l=t.order instanceof Array?t.order:Object.keys(t.sections||{}),c=[];for(let a of l){let n=t.sections[a],s=await e(i,n.type);if(!s)continue;let r=t.id?`page__${t.id}__${a}`:s.id,p=(n.block_order instanceof Array?n.block_order:Object.keys(n.blocks||{})).map(g=>n.blocks?.[g]).filter(Boolean),o={section:{id:r,...n,blocks:p}};c.push({id:r,settings:o,section:{id:r,...n},tag:s.tag||"div",class:s.class,schema:s})}return c}async function A4(i,t){let e=t.filter(a=>tt(a,t)),l=async(a,n)=>{let s=t.find(m=>et(m,t,n));return{...await N3(a,s),id:s?.name.split(".").pop()}},c=[];for(let a of e){let n;try{n=JSON.parse(a.file_data),n?.name&&(n.label=n.name,delete n.name)}catch{}if(n?.type){let s=await V3(i,n,l);c.push({...n,id:a.name.split(".").pop(),sectionConfigs:s})}}return c}async function Y0(i,t){let e=await i.getThemeTemplateConfigByType("sections",t);return N3(i,e)}async function N3(i,t){let e={};if(t?.file_path?.endsWith(".liquid")){if(i.shopifyCompatibility){i.liquidSwell.lastSchema=void 0,await i.renderTemplate(t);let l=i.liquidSwell.lastSchema||{};l&&(e=i.shopifyCompatibility.getSectionConfigSchema(l))}}else if(t?.file_data)try{e=JSON.parse(t?.file_data)||void 0}catch{}return e}function X0(i,t){return i.file_path.startsWith("theme/sections/")?H4(i,t):!1}function tt(i,t){if(!i.file_path.startsWith("theme/sections/")||!i.file_path.endsWith(".json"))return!1;let e=i.file_path.replace(/\.json$/,".liquid");return!t.find(l=>l.file_path===e)}function et(i,t,e){return!i.file_path.endsWith(`/${e}.json`)&&!i.file_path.endsWith(`/${e}.liquid`)?!1:H4(i,t)}function H4(i,t){if(i.file_path.endsWith(".liquid")){let e=i.file_path.replace(/\.liquid$/,".json");if(!t.find(c=>c.file_path===e))return!0}else if(i.file_path.endsWith(".json"))return!0;return!1}function f2(i){let t={description:i.description,defaultValue:i.default!==void 0?i.default:null,isLabelHidden:!0,layout:"column",params:i},e;switch(i?.type){case"text":case"short_text":e={type:"swell_short_text"};break;case"paragraph":e={type:"swell_paragraph"};break;case"textarea":case"long_text":case"liquid":e={type:"swell_long_text"};break;case"basic_html":case"rich_text":case"rich_html":case"markdown":e={type:"swell_editor"};break;case"number":e={type:"swell_number"};break;case"select":e={type:"swell_select"};break;case"radio":e={type:"swell_radio"};break;case"checkbox":e={type:"swell_boolean"};break;case"color":e={type:"swell_color"};break;case"color_scheme":e={type:"swell_color_scheme"};break;case"color_scheme_group":e={type:"swell_color_scheme_group"};break;case"font":e={type:"swell_font"};break;case"header":e={type:"swell_header"};break;case"icon":e={type:"swell_menu"};break;case"menu":e={type:"swell_menu"};break;case"url":e={type:"swell_url"};break;case"lookup":case"generic_lookup":case"product_lookup":case"category_lookup":case"customer_lookup":e={type:"swell_lookup"};break;case"image":e={type:"swell_image",defaultValue:""};break;case"asset":case"document":case"video":e={type:"swell_file"};break;default:e={type:"swell_short_text"};break}return{...t,...e}}function H(i,t,e){if(e===void 0)return null;switch(i?.find(c=>c.id===t)?.type){default:return e}}function q4(i,t){return t?.reduce((e,l)=>{for(let c of l.fields||[])c?.id&&(e[c.id]=i[c.id]);return e},{})}function F4(i,t){return t?{settings:t.fields?.reduce((e,l)=>(l?.id&&(e[l.id]=i[l.id]),e),{}),id:t.id,blocks:i.Blocks?.filter(e=>e.props.compiled?._component).map(e=>{let l=e.props.compiled.props,c=e.props.compiled._component.split("__")[2],a=t.blocks?.find(n=>n.type===c);return{type:c,settings:a?.fields?.reduce((n,s)=>(s?.id&&(n[s.id]=l[s.id]),n),{})}})}:{}}async function lt(i,t,e){let l=await D4(i,e),c=await Z4(i,t),a=await V3(i,l),n=await A4(i,t);return{pageTemplate:l,allSections:c,pageSections:a,layoutSectionGroups:n}}function it(i,t){return i.reduce((e,l)=>(l.enabled_on?u2(l.enabled_on,"groups",t)&&e.push(String(l.id)):l.disabled_on?u2(l.disabled_on,"groups",t)||e.push(String(l.id)):l.id===t&&e.push(String(l.id)),e),[])}function ct(i,t){return t.map(e=>({prop:`SectionGroup_${e.id}`,type:"component-collection",required:!0,accepts:it(i,e.type)}))}function u2(i,t,e){return!!(i.templates==="*"||i[t]?.includes(e))}function at(i,t,e){return i.reduce((l,c)=>(c.enabled_on?u2(c.enabled_on,"templates",e)&&l.push(String(c.id)):c.disabled_on?u2(c.disabled_on,"templates",e)||l.push(String(c.id)):t.some(({type:a})=>a===c.id)||l.push(String(c.id)),l),[])}function nt(i){return(i?.configs?.editor?.settings??[]).reduce((t,e)=>{for(let l of e.fields||[])l?.id&&t.push({prop:l.id,label:l.label,optional:!0,group:e.label,...f2(l)});return t},[])}function st(i){let t=[];for(let e of i){let l=Array.isArray(e.blocks)&&e.blocks.length>0;t.push({id:`${e.id}`,label:e.label,schema:[...(e.fields||[]).reduce((c,a)=>(a.id&&a.type&&c.push({prop:a.id,label:a.label,optional:!0,...f2(a)}),c),[]),...l?[{prop:"Blocks",type:"component-collection",required:!0,accepts:(e.blocks||[]).map(c=>`Block__${e.id}__${c.type}`),defaultValue:e.presets?.[0]?.blocks?.reduce((c,a)=>{let n=e.blocks?.find(({type:s})=>s===a.type);return n&&c.push({_component:`Block__${e.id}__${a.type}`,...(0,N.reduce)(n.fields,(s,r)=>(r.id&&(s[r.id]=H(n.fields,r.id,r.default)),s),{})}),c},[]),placeholderAppearance:{height:50,label:"Add block",aspectRatio:1}}]:[]],styles:()=>({styled:{Root:{}}})}),l&&t.push(...(e.blocks||[]).map(c=>({id:`Block__${e.id}__${c.type}`,label:c.label,schema:(c.fields||[]).reduce((a,n)=>(n.id&&n.type&&a.push({prop:n.id,label:n.label,optional:!0,...f2(n)}),a),[]),styles:()=>({styled:{Root:{}}})})))}return t}function rt(i){return i?.configs?.editor?.settings?.reduce((t,e)=>{for(let l of e.fields||[])l?.id&&(t[l.id]=H(e.fields,l.id,i?.configs?.theme?.[l.id]));return t},{})}function ot(i){return i.reduce((t,e)=>(t[`SectionGroup_${e.id}`]=e.sectionConfigs.map(({section:l,settings:c,schema:a})=>({_id:`SectionGroup__${l.type}_${E4()}`,_component:`${l.type}`,...(0,N.reduce)(c?.section.settings,(n,s,r)=>(n[r]=H(a?.fields,r,s),n),{}),...c?.section.blocks?{Blocks:c.section.blocks.map(n=>({_id:`Block__${l.type}__${n.type}_${E4()}`,_component:`Block__${l.type}__${n.type}`,...(0,N.reduce)(n.settings,(s,r,m)=>(s[m]=H(a?.blocks?.find(({type:p})=>p===n.type)?.fields,m,r),s),{})}))}:void 0})),t),{})}function ht(i){let t=[];for(let e of i)e.presets&&t.push(...e.presets.map((l,c)=>({id:`${e.id}__preset_${c}`,entry:{_id:`${e.id}__preset_${c}`,_component:e.id,...(0,N.reduce)(e.fields,(a,n)=>(a[n.id]=H(e.fields,n.id,l.settings?.[n.id]),a),{}),Blocks:l.blocks?.reduce((a,n)=>{let s=e.blocks?.find(({type:r})=>r===n.type);return s&&a.push({_id:`Block__${e.id}__${n.type}__preset_${c}`,_component:`Block__${e.id}__${n.type}`,...(0,N.reduce)(s.fields,(r,m)=>(m.id&&(r[m.id]=H(s.fields,m.id,n.settings?.[m.id])),r),{})}),a},[])}}))),e.blocks&&t.push(...e.blocks.map(l=>({id:`Block__${e.id}__${l.type}`,entry:{_id:`Block__${e.id}__${l.type}`,_component:`Block__${e.id}__${l.type}`,...(0,N.reduce)(l.fields,(c,a)=>(a.id&&a.default!==void 0&&(c[a.id]=H(l.fields,a.id,a.default)),c),{})}})));return t.filter(e=>Object.keys(e.entry).some(l=>l!=="_id"&&l!=="_component"))}function mt(i,t,e,l,c){let a={id:"swell_global",label:"Theme settings",schema:[{prop:"swell_page",type:"component",required:!0,accepts:["swell_page"],isNonChangable:!0,noInline:!0},...nt(i)],groups:(i?.configs?.editor?.settings??[]).map(p=>({key:p.label,label:p.label,collapsable:!0,collapsed:!0})),styles:()=>({styled:{Root:{}}})},n={id:"swell_page",label:"Page settings",schema:[{prop:"ContentSections",type:"component-collection",required:!0,accepts:at(t,l,c),placeholderAppearance:{height:250,label:"Add section",aspectRatio:1}},...ct(t,l)],allowSave:!0,styles:()=>({styled:{Root:{}}})},s=[a,n,...st(t)],r=a.schema.find(p=>p.prop==="color_schemes");if(r){let{params:p}=r;s.push({id:"swell_color_scheme_group",label:"Swell color scheme",schema:p.fields.map(o=>({prop:o.id,type:o.id==="background_gradient"?"text":o.type,label:o.label,description:o.description,defaultValue:{value:o.default},required:!0})),styles(){return{styled:{Root:{}}}}})}let m=[{id:"swell_global",entry:{_id:"swell_global",_component:"swell_global",...rt(i),swell_page:[{_id:"swell_page",_component:"swell_page",ContentSections:e.map(({section:p,settings:o,schema:g})=>({_id:`${p.type}_${Math.random()}`,_component:`${p.type}`,...(0,N.reduce)(g?.fields,(f,u)=>u?.id?{...f,[u.id]:H(g?.fields,u.id,o?.section?.settings?.[u.id])}:f,{}),...p?.blocks?{Blocks:Object.keys(p.blocks).map(f=>{if(!p.blocks)return;let u=p.blocks[f];return{_id:`Block__${f}__${u.type}_${Math.random()}`,_component:`Block__${p.type}__${u.type}`,...(0,N.reduce)(u.settings,(d,w,J)=>({...d,[J]:H(g?.blocks?.find(({type:a1})=>a1===u.type)?.fields,J,w)}),{})}})}:{}})),...ot(l)}]}},{id:"swell_page",entry:{_id:"swell_page",_component:"swell_page"}},...ht(t)];return{easyblocksConfig:{components:s,templates:m,backend:B4(),hideCloseButton:!0,allowSave:!0,readOnly:!1,locales:[{code:"en-US",isDefault:!0}],types:{swell_boolean:{type:"inline",widget:{id:"SwellBoolean"}},swell_color:{type:"inline",widget:{id:"SwellColor"}},swell_color_scheme:{type:"inline",widget:{id:"SwellColorScheme"}},swell_color_scheme_group:{type:"inline",widget:{id:"SwellColorSchemeGroup"}},swell_font:{type:"inline",widget:{id:"SwellFont"}},swell_header:{type:"inline",widget:{id:"SwellHeader"}},swell_icon:{type:"inline",widget:{id:"SwellIcon"}},swell_lookup:{type:"inline",widget:{id:"SwellLookup"}},swell_menu:{type:"inline",widget:{id:"SwellMenu"}},swell_url:{type:"inline",widget:{id:"SwellUrl"}},swell_number:{type:"inline",widget:{id:"SwellNumber"}},swell_select:{type:"inline",widget:{id:"SwellSelect"}},swell_short_text:{type:"inline",widget:{id:"SwellText"}},swell_long_text:{type:"inline",widget:{id:"SwellTextarea"}},swell_paragraph:{type:"inline",widget:{id:"SwellParagraph"}},swell_editor:{type:"inline",widget:{id:"SwellEditor"}},swell_file:{type:"inline",widget:{id:"SwellFile"}},swell_image:{type:"inline",widget:{id:"SwellImage"}}},tokens:{colors:[],fonts:[]}}}}function pt(i,t,e){let l=i.reduce((n,s)=>(n[`${s.id}`]=e("pageSection",s),n),{}),c=t.reduce((n,s)=>(n[`SectionGroup___${s.id}`]=e("layoutSectionGroup",s),n),{}),a=i.reduce((n,s)=>{if(s.blocks)for(let r of s.blocks){let m=`Block__${s.id}__${r.type}`;n[m]=e("block",{section:s,block:r})}return n},{});return{...l,...c,...a,swell_page:e("root"),swell_global:e("global")}}function B4(){return{documents:{get:async({id:t})=>(console.log("Easyblocks backend documents.get()",t),{id:t,version:1,entry:{_id:"page",_component:"swell_page"}}),create:async t=>(console.log("Easyblocks backend documents.create()",t),{}),update:async t=>(console.log("Easyblocks backend documents.update()",t),{})},templates:{get:async t=>(console.log("Easyblocks backend templates.get()",t),{}),getAll:async()=>(console.log("Easyblocks backend get templates.getAll()"),[]),create:async t=>(console.log("Easyblocks backend get templates.create()",t),{}),update:async t=>(console.log("Easyblocks backend get templates.update()",t),{}),delete:async t=>{console.log("Easyblocks backend get templates.delete()",t)}}}}function E4(){return(Math.random()+1).toString(36).substring(7)}var I3=class extends C{constructor(t,e,l={}){super(t,"",e,l,async function(){let c=await V4(t,this.constructor.name,e,l);return F1(this.constructor.name,c,t,"",e,l)})}},$3=class extends K{constructor(t,e,l={}){super(t,"",async function(){let c=await V4(t,this.constructor.name,e,l);return F1(this.constructor.name,c,t,"",e,l)})}};async function V4(i,t,e,l){let c=new URLSearchParams({...e&&{slug:e},...l&&{query:JSON.stringify(l)}});return(await fetch(`${i.storefront_url}/resources/${t}.json/?${c.toString()}`)).json()}function F1(i,t,e,l="",c,a){let n={};for(let s in t){let r=t[s],m=l+`${l===""?"":"/"}${s}`,p;switch(r?._type){case"SwellStorefrontCollection":p=gt;break;case"SwellStorefrontRecord":p=ut;break;case"createStorefrontResource":p=ft;break;default:break}n[s]=p?p(i,e,m,c,a):r}return n}function ft(i,t,e,l,c){return new T(async function(){let a=await j3(t,i,e,l,c);return F1(i,a,t,e,l,c)})}function ut(i,t,e,l,c){return new C(t,i,e,{},async function(){let a=await j3(t,i,e,l,c);return F1(i,a,t,e,l,c)})}function gt(i,t,e,l,c){return new _(t,i,{},async function(){let a=await j3(t,i,e,l,c);return F1(i,a,t,e,l,c)})}async function j3(i,t,e,l,c){let a=new URLSearchParams({path:e,...l&&{slug:l},...c&&{query:JSON.stringify(c)}});return(await fetch(`${i.storefront_url}/resources/${t}.json?${a}`)).json()}0&&(module.exports={CACHE_TIMEOUT_RESOURCES,DEFAULT_QUERY_PAGE_LIMIT,DeferredShopifyResource,LANG_TO_COUNTRY_CODES,LiquidSwell,MAX_QUERY_PAGE_LIMIT,MockRecordResource,MockRecordSingleton,PageError,PageNotFound,ShopifyArticle,ShopifyBlog,ShopifyCart,ShopifyCollection,ShopifyCollections,ShopifyCompatibility,ShopifyCustomer,ShopifyFont,ShopifyForm,ShopifyLink,ShopifyLocalization,ShopifyOrder,ShopifyPage,ShopifyPaginate,ShopifyPredictiveSearch,ShopifyProduct,ShopifyResource,ShopifySearch,ShopifyVariant,StorefrontResource,Swell,SwellBackendAPI,SwellError,SwellStorefrontCollection,SwellStorefrontPagination,SwellStorefrontRecord,SwellStorefrontResource,SwellStorefrontSingleton,SwellTheme,ThemeColor,ThemeFont,ThemeForm,ThemeFormErrors,adaptShopifyFontData,adaptShopifyFormData,adaptShopifyMenuData,arrayToObject,brightness,deferMenuItemUrlAndResource,dehydrateSwellRefsInStorefrontResources,diff,findCircularReferences,findEditorSetting,findThemeSettingsByType,fontMap,forEachKeyDeep,getAllSections,getBlog,getBlogs,getCategories,getCategory,getCategoryWithProducts,getContentEntry,getContentList,getContentModel,getCountryCodeFromLocale,getEasyblocksBackend,getEasyblocksComponentDefinitions,getEasyblocksPagePropsWithConfigs,getEasyblocksPropsFromThemeConfigs,getLayoutSectionGroups,getMenuItemStorefrontUrl,getMenuItemUrlAndResource,getMenuItemValueId,getPage,getPageSections,getProduct,getProducts,getProductsFiltered,getSectionSettingsFromProps,getThemeSettingsFromProps,isArray,isObject,md5,mix,removeCircularReferences,resolveAsyncResources,resolveLookupCollection,resolveMenuItemUrlAndResource,resolveMenuItems,resolveMenuSettings,resolveSectionSettings,resolveThemeSettings,stringifyQueryParams,systemFonts,themeConfigQuery,toBase64});
42
+ ${l}`),super(l),this.name="SwellError",this.status=e.status||500}};function E3(i,t){return new _(i,"products",t)}function j0(i,t,e){return new C(i,"products",t,e)}function O0(i,{search:t,filter:e,sort:l}){return new _(i,"products",{search:t,filter:e,sort:l})}function G0(i,t){return new _(i,"categories",t)}function R4(i,t,e){return new C(i,"categories",t,e)}async function U0(i,t,e){let l=R4(i,t,e),c=await l.id;return l.products=E3(i,{category:c}),l}function K0(i,t){return i.getCachedResource(`content-model-${t}`,()=>i.get("/:content/{name}",{name:t,public:!0,"storefront.enabled":!0}))}async function L4(i,t,e){return new _(i,`content/${t}`,e)}async function B3(i,t,e,l){return new C(i,`content/${t}`,e,l)}async function W0(i,t,e){return B3(i,"pages",t,e)}async function J0(i,t){return L4(i,"blogs",t)}async function Q0(i,t,e){return B3(i,"blogs",t,e)}var N=require("lodash-es");async function D4(i,t){let e=[];for(let l of t)if(X0(l,t)){let c=await N3(i,l);e.push({id:l.name.split(".").pop(),...c})}return e}async function V3(i,t,e=Y0){let l=t.order instanceof Array?t.order:Object.keys(t.sections||{}),c=[];for(let a of l){let n=t.sections[a],s=await e(i,n.type);if(!s)continue;let r=t.id?`page__${t.id}__${a}`:s.id,p=(n.block_order instanceof Array?n.block_order:Object.keys(n.blocks||{})).map(g=>n.blocks?.[g]).filter(Boolean),o={section:{id:r,...n,blocks:p}};c.push({id:r,settings:o,section:{id:r,...n},tag:s.tag||"div",class:s.class,schema:s})}return c}async function Z4(i,t){let e=t.filter(a=>tt(a,t)),l=async(a,n)=>{let s=t.find(m=>et(m,t,n));return{...await N3(a,s),id:s?.name.split(".").pop()}},c=[];for(let a of e){let n;try{n=JSON.parse(a.file_data),n?.name&&(n.label=n.name,delete n.name)}catch{}if(n?.type){let s=await V3(i,n,l);c.push({...n,id:a.name.split(".").pop(),sectionConfigs:s})}}return c}async function Y0(i,t){let e=await i.getThemeTemplateConfigByType("sections",t);return N3(i,e)}async function N3(i,t){let e={};if(t?.file_path?.endsWith(".liquid")){if(i.shopifyCompatibility){i.liquidSwell.lastSchema=void 0,await i.renderTemplate(t);let l=i.liquidSwell.lastSchema||{};l&&(e=i.shopifyCompatibility.getSectionConfigSchema(l))}}else if(t?.file_data)try{e=JSON.parse(t?.file_data)||void 0}catch{}return e}function X0(i,t){return i.file_path.startsWith("theme/sections/")?A4(i,t):!1}function tt(i,t){if(!i.file_path.startsWith("theme/sections/")||!i.file_path.endsWith(".json"))return!1;let e=i.file_path.replace(/\.json$/,".liquid");return!t.find(l=>l.file_path===e)}function et(i,t,e){return!i.file_path.endsWith(`/${e}.json`)&&!i.file_path.endsWith(`/${e}.liquid`)?!1:A4(i,t)}function A4(i,t){if(i.file_path.endsWith(".liquid")){let e=i.file_path.replace(/\.liquid$/,".json");if(!t.find(c=>c.file_path===e))return!0}else if(i.file_path.endsWith(".json"))return!0;return!1}function f2(i){let t={description:i.description,defaultValue:i.default!==void 0?i.default:null,isLabelHidden:!0,layout:"column",params:i},e;switch(i?.type){case"text":case"short_text":e={type:"swell_short_text"};break;case"paragraph":e={type:"swell_paragraph"};break;case"textarea":case"long_text":case"liquid":e={type:"swell_long_text"};break;case"basic_html":case"rich_text":case"rich_html":case"markdown":e={type:"swell_editor"};break;case"number":e={type:"swell_number"};break;case"select":e={type:"swell_select"};break;case"radio":e={type:"swell_radio"};break;case"checkbox":e={type:"swell_boolean"};break;case"color":e={type:"swell_color"};break;case"color_scheme":e={type:"swell_color_scheme"};break;case"color_scheme_group":e={type:"swell_color_scheme_group"};break;case"font":e={type:"swell_font"};break;case"header":e={type:"swell_header"};break;case"icon":e={type:"swell_menu"};break;case"menu":e={type:"swell_menu"};break;case"url":e={type:"swell_url"};break;case"lookup":case"generic_lookup":case"product_lookup":case"category_lookup":case"customer_lookup":e={type:"swell_lookup"};break;case"image":e={type:"swell_image",defaultValue:""};break;case"asset":case"document":case"video":e={type:"swell_file"};break;default:e={type:"swell_short_text"};break}return{...t,...e}}function H(i,t,e){if(e===void 0)return null;switch(i?.find(c=>c.id===t)?.type){default:return e}}function H4(i,t){return t?.reduce((e,l)=>{for(let c of l.fields||[])c?.id&&(e[c.id]=i[c.id]);return e},{})}function q4(i,t){return t?{settings:t.fields?.reduce((e,l)=>(l?.id&&(e[l.id]=i[l.id]),e),{}),id:t.id,blocks:i.Blocks?.filter(e=>e.props.compiled?._component).map(e=>{let l=e.props.compiled.props,c=e.props.compiled._component.split("__")[2],a=t.blocks?.find(n=>n.type===c);return{type:c,settings:a?.fields?.reduce((n,s)=>(s?.id&&(n[s.id]=l[s.id]),n),{})}})}:{}}async function lt(i,t,e){let l=await E4(i,e),c=await D4(i,t),a=await V3(i,l),n=await Z4(i,t);return{pageTemplate:l,allSections:c,pageSections:a,layoutSectionGroups:n}}async function E4(i,t){let e=null;if(e=await i.getThemeTemplateConfigByType("templates",t),e)return JSON.parse(e.file_data)}function it(i,t){return i.reduce((e,l)=>(l.enabled_on?u2(l.enabled_on,"groups",t)&&e.push(String(l.id)):l.disabled_on?u2(l.disabled_on,"groups",t)||e.push(String(l.id)):l.id===t&&e.push(String(l.id)),e),[])}function ct(i,t){return t.map(e=>({prop:`SectionGroup_${e.id}`,type:"component-collection",required:!0,accepts:it(i,e.type)}))}function u2(i,t,e){return!!(i.templates==="*"||i[t]?.includes(e))}function at(i,t,e){return i.reduce((l,c)=>(c.enabled_on?u2(c.enabled_on,"templates",e)&&l.push(String(c.id)):c.disabled_on?u2(c.disabled_on,"templates",e)||l.push(String(c.id)):t.some(({type:a})=>a===c.id)||l.push(String(c.id)),l),[])}function nt(i){return(i?.configs?.editor?.settings??[]).reduce((t,e)=>{for(let l of e.fields||[])l?.id&&t.push({prop:l.id,label:l.label,optional:!0,group:e.label,...f2(l)});return t},[])}function st(i){let t=[];for(let e of i){let l=Array.isArray(e.blocks)&&e.blocks.length>0;t.push({id:`${e.id}`,label:e.label,schema:[...(e.fields||[]).reduce((c,a)=>(a.id&&a.type&&c.push({prop:a.id,label:a.label,optional:!0,...f2(a)}),c),[]),...l?[{prop:"Blocks",type:"component-collection",required:!0,accepts:(e.blocks||[]).map(c=>`Block__${e.id}__${c.type}`),defaultValue:e.presets?.[0]?.blocks?.reduce((c,a)=>{let n=e.blocks?.find(({type:s})=>s===a.type);return n&&c.push({_component:`Block__${e.id}__${a.type}`,...(0,N.reduce)(n.fields,(s,r)=>(r.id&&(s[r.id]=H(n.fields,r.id,r.default)),s),{})}),c},[]),placeholderAppearance:{height:50,label:"Add block",aspectRatio:1}}]:[]],styles:()=>({styled:{Root:{}}})}),l&&t.push(...(e.blocks||[]).map(c=>({id:`Block__${e.id}__${c.type}`,label:c.label,schema:(c.fields||[]).reduce((a,n)=>(n.id&&n.type&&a.push({prop:n.id,label:n.label,optional:!0,...f2(n)}),a),[]),styles:()=>({styled:{Root:{}}})})))}return t}function rt(i){return i?.configs?.editor?.settings?.reduce((t,e)=>{for(let l of e.fields||[])l?.id&&(t[l.id]=H(e.fields,l.id,i?.configs?.theme?.[l.id]));return t},{})}function ot(i){return i.reduce((t,e)=>(t[`SectionGroup_${e.id}`]=e.sectionConfigs.map(({section:l,settings:c,schema:a})=>({_id:`SectionGroup__${l.type}_${F4()}`,_component:`${l.type}`,...(0,N.reduce)(c?.section.settings,(n,s,r)=>(n[r]=H(a?.fields,r,s),n),{}),...c?.section.blocks?{Blocks:c.section.blocks.map(n=>({_id:`Block__${l.type}__${n.type}_${F4()}`,_component:`Block__${l.type}__${n.type}`,...(0,N.reduce)(n.settings,(s,r,m)=>(s[m]=H(a?.blocks?.find(({type:p})=>p===n.type)?.fields,m,r),s),{})}))}:void 0})),t),{})}function ht(i){let t=[];for(let e of i)e.presets&&t.push(...e.presets.map((l,c)=>({id:`${e.id}__preset_${c}`,entry:{_id:`${e.id}__preset_${c}`,_component:e.id,...(0,N.reduce)(e.fields,(a,n)=>(a[n.id]=H(e.fields,n.id,l.settings?.[n.id]),a),{}),Blocks:l.blocks?.reduce((a,n)=>{let s=e.blocks?.find(({type:r})=>r===n.type);return s&&a.push({_id:`Block__${e.id}__${n.type}__preset_${c}`,_component:`Block__${e.id}__${n.type}`,...(0,N.reduce)(s.fields,(r,m)=>(m.id&&(r[m.id]=H(s.fields,m.id,n.settings?.[m.id])),r),{})}),a},[])}}))),e.blocks&&t.push(...e.blocks.map(l=>({id:`Block__${e.id}__${l.type}`,entry:{_id:`Block__${e.id}__${l.type}`,_component:`Block__${e.id}__${l.type}`,...(0,N.reduce)(l.fields,(c,a)=>(a.id&&a.default!==void 0&&(c[a.id]=H(l.fields,a.id,a.default)),c),{})}})));return t.filter(e=>Object.keys(e.entry).some(l=>l!=="_id"&&l!=="_component"))}function mt(i,t,e,l,c){let a={id:"swell_global",label:"Theme settings",schema:[{prop:"swell_page",type:"component",required:!0,accepts:["swell_page"],isNonChangable:!0,noInline:!0},...nt(i)],groups:(i?.configs?.editor?.settings??[]).map(p=>({key:p.label,label:p.label,collapsable:!0,collapsed:!0})),styles:()=>({styled:{Root:{}}})},n={id:"swell_page",label:"Page settings",schema:[{prop:"ContentSections",type:"component-collection",required:!0,accepts:at(t,l,c),placeholderAppearance:{height:250,label:"Add section",aspectRatio:1}},...ct(t,l)],allowSave:!0,styles:()=>({styled:{Root:{}}})},s=[a,n,...st(t)],r=a.schema.find(p=>p.prop==="color_schemes");if(r){let{params:p}=r;s.push({id:"swell_color_scheme_group",label:"Swell color scheme",schema:p.fields.map(o=>({prop:o.id,type:o.id==="background_gradient"?"text":o.type,label:o.label,description:o.description,defaultValue:{value:o.default},required:!0})),styles(){return{styled:{Root:{}}}}})}let m=[{id:"swell_global",entry:{_id:"swell_global",_component:"swell_global",...rt(i),swell_page:[{_id:"swell_page",_component:"swell_page",ContentSections:e.map(({section:p,settings:o,schema:g})=>({_id:`${p.type}_${Math.random()}`,_component:`${p.type}`,...(0,N.reduce)(g?.fields,(f,u)=>u?.id?{...f,[u.id]:H(g?.fields,u.id,o?.section?.settings?.[u.id])}:f,{}),...p?.blocks?{Blocks:Object.keys(p.blocks).map(f=>{if(!p.blocks)return;let u=p.blocks[f];return{_id:`Block__${f}__${u.type}_${Math.random()}`,_component:`Block__${p.type}__${u.type}`,...(0,N.reduce)(u.settings,(d,w,J)=>({...d,[J]:H(g?.blocks?.find(({type:a1})=>a1===u.type)?.fields,J,w)}),{})}})}:{}})),...ot(l)}]}},{id:"swell_page",entry:{_id:"swell_page",_component:"swell_page"}},...ht(t)];return{easyblocksConfig:{components:s,templates:m,backend:B4(),hideCloseButton:!0,allowSave:!0,readOnly:!1,locales:[{code:"en-US",isDefault:!0}],types:{swell_boolean:{type:"inline",widget:{id:"SwellBoolean"}},swell_color:{type:"inline",widget:{id:"SwellColor"}},swell_color_scheme:{type:"inline",widget:{id:"SwellColorScheme"}},swell_color_scheme_group:{type:"inline",widget:{id:"SwellColorSchemeGroup"}},swell_font:{type:"inline",widget:{id:"SwellFont"}},swell_header:{type:"inline",widget:{id:"SwellHeader"}},swell_icon:{type:"inline",widget:{id:"SwellIcon"}},swell_lookup:{type:"inline",widget:{id:"SwellLookup"}},swell_menu:{type:"inline",widget:{id:"SwellMenu"}},swell_url:{type:"inline",widget:{id:"SwellUrl"}},swell_number:{type:"inline",widget:{id:"SwellNumber"}},swell_select:{type:"inline",widget:{id:"SwellSelect"}},swell_short_text:{type:"inline",widget:{id:"SwellText"}},swell_long_text:{type:"inline",widget:{id:"SwellTextarea"}},swell_paragraph:{type:"inline",widget:{id:"SwellParagraph"}},swell_editor:{type:"inline",widget:{id:"SwellEditor"}},swell_file:{type:"inline",widget:{id:"SwellFile"}},swell_image:{type:"inline",widget:{id:"SwellImage"}}},tokens:{colors:[],fonts:[]}}}}function pt(i,t,e){let l=i.reduce((n,s)=>(n[`${s.id}`]=e("pageSection",s),n),{}),c=t.reduce((n,s)=>(n[`SectionGroup___${s.id}`]=e("layoutSectionGroup",s),n),{}),a=i.reduce((n,s)=>{if(s.blocks)for(let r of s.blocks){let m=`Block__${s.id}__${r.type}`;n[m]=e("block",{section:s,block:r})}return n},{});return{...l,...c,...a,swell_page:e("root"),swell_global:e("global")}}function B4(){return{documents:{get:async({id:t})=>(console.log("Easyblocks backend documents.get()",t),{id:t,version:1,entry:{_id:"page",_component:"swell_page"}}),create:async t=>(console.log("Easyblocks backend documents.create()",t),{}),update:async t=>(console.log("Easyblocks backend documents.update()",t),{})},templates:{get:async t=>(console.log("Easyblocks backend templates.get()",t),{}),getAll:async()=>(console.log("Easyblocks backend get templates.getAll()"),[]),create:async t=>(console.log("Easyblocks backend get templates.create()",t),{}),update:async t=>(console.log("Easyblocks backend get templates.update()",t),{}),delete:async t=>{console.log("Easyblocks backend get templates.delete()",t)}}}}function F4(){return(Math.random()+1).toString(36).substring(7)}var I3=class extends C{constructor(t,e,l={}){super(t,"",e,l,async function(){let c=await V4(t,this.constructor.name,e,l);return F1(this.constructor.name,c,t,"",e,l)})}},$3=class extends K{constructor(t,e,l={}){super(t,"",async function(){let c=await V4(t,this.constructor.name,e,l);return F1(this.constructor.name,c,t,"",e,l)})}};async function V4(i,t,e,l){let c=new URLSearchParams({...e&&{slug:e},...l&&{query:JSON.stringify(l)}});return(await fetch(`${i.storefront_url}/resources/${t}.json/?${c.toString()}`)).json()}function F1(i,t,e,l="",c,a){let n={};for(let s in t){let r=t[s],m=l+`${l===""?"":"/"}${s}`,p;switch(r?._type){case"SwellStorefrontCollection":p=gt;break;case"SwellStorefrontRecord":p=ut;break;case"createStorefrontResource":p=ft;break;default:break}n[s]=p?p(i,e,m,c,a):r}return n}function ft(i,t,e,l,c){return new T(async function(){let a=await j3(t,i,e,l,c);return F1(i,a,t,e,l,c)})}function ut(i,t,e,l,c){return new C(t,i,e,{},async function(){let a=await j3(t,i,e,l,c);return F1(i,a,t,e,l,c)})}function gt(i,t,e,l,c){return new _(t,i,{},async function(){let a=await j3(t,i,e,l,c);return F1(i,a,t,e,l,c)})}async function j3(i,t,e,l,c){let a=new URLSearchParams({path:e,...l&&{slug:l},...c&&{query:JSON.stringify(c)}});return(await fetch(`${i.storefront_url}/resources/${t}.json?${a}`)).json()}0&&(module.exports={CACHE_TIMEOUT_RESOURCES,DEFAULT_QUERY_PAGE_LIMIT,DeferredShopifyResource,LANG_TO_COUNTRY_CODES,LiquidSwell,MAX_QUERY_PAGE_LIMIT,MockRecordResource,MockRecordSingleton,PageError,PageNotFound,ShopifyArticle,ShopifyBlog,ShopifyCart,ShopifyCollection,ShopifyCollections,ShopifyCompatibility,ShopifyCustomer,ShopifyFont,ShopifyForm,ShopifyLink,ShopifyLocalization,ShopifyOrder,ShopifyPage,ShopifyPaginate,ShopifyPredictiveSearch,ShopifyProduct,ShopifyResource,ShopifySearch,ShopifyVariant,StorefrontResource,Swell,SwellBackendAPI,SwellError,SwellStorefrontCollection,SwellStorefrontPagination,SwellStorefrontRecord,SwellStorefrontResource,SwellStorefrontSingleton,SwellTheme,ThemeColor,ThemeFont,ThemeForm,ThemeFormErrors,adaptShopifyFontData,adaptShopifyFormData,adaptShopifyMenuData,arrayToObject,brightness,deferMenuItemUrlAndResource,dehydrateSwellRefsInStorefrontResources,diff,findCircularReferences,findEditorSetting,findThemeSettingsByType,fontMap,forEachKeyDeep,getAllSections,getBlog,getBlogs,getCategories,getCategory,getCategoryWithProducts,getContentEntry,getContentList,getContentModel,getCountryCodeFromLocale,getEasyblocksBackend,getEasyblocksComponentDefinitions,getEasyblocksPagePropsWithConfigs,getEasyblocksPageTemplate,getEasyblocksPropsFromThemeConfigs,getLayoutSectionGroups,getMenuItemStorefrontUrl,getMenuItemUrlAndResource,getMenuItemValueId,getPage,getPageSections,getProduct,getProducts,getProductsFiltered,getSectionSettingsFromProps,getThemeSettingsFromProps,isArray,isObject,md5,mix,removeCircularReferences,resolveAsyncResources,resolveLookupCollection,resolveMenuItemUrlAndResource,resolveMenuItems,resolveMenuSettings,resolveSectionSettings,resolveThemeSettings,stringifyQueryParams,systemFonts,themeConfigQuery,toBase64});
43
43
  //# sourceMappingURL=index.cjs.map