@billgangcom/theme-lib 1.60.0 → 1.61.0

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.
@@ -4488,6 +4488,8 @@ const Ll = Zt(
4488
4488
  activeFont: null,
4489
4489
  setActiveFont: (n) => e(() => ({ activeFont: n })),
4490
4490
  setThemeSettings: (n) => e(() => ({ themeSettings: n })),
4491
+ activeColorCategory: null,
4492
+ setActiveColorCategory: (n) => e(() => ({ activeColorCategory: n })),
4491
4493
  themeSettings: {
4492
4494
  colors: {
4493
4495
  text: {
@@ -58,7 +58,7 @@ React keys must be passed directly to JSX without using spread:
58
58
  * LICENSE.md file in the root directory of this source tree.
59
59
  *
60
60
  * @license MIT
61
- */function Ua(){return Ua=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ua.apply(this,arguments)}function Dd(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o<r.length;o++)a=r[o],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}const ac="get",oc="application/x-www-form-urlencoded";function tu(e){return e!=null&&typeof e.tagName=="string"}function D7(e){return tu(e)&&e.tagName.toLowerCase()==="button"}function O7(e){return tu(e)&&e.tagName.toLowerCase()==="form"}function I7(e){return tu(e)&&e.tagName.toLowerCase()==="input"}function M7(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function B7(e,t){return e.button===0&&(!t||t==="_self")&&!M7(e)}function T1(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function F7(e,t){let n=T1(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(o=>{n.append(a,o)})}),n}let Tl=null;function H7(){if(Tl===null)try{new FormData(document.createElement("form"),0),Tl=!1}catch{Tl=!0}return Tl}const $7=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Mu(e){return e!=null&&!$7.has(e)?(process.env.NODE_ENV!=="production"&&en(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+oc+'"')),null):e}function V7(e,t){let n,r,a,o,i;if(O7(e)){let c=e.getAttribute("action");r=c?Tr(c,t):null,n=e.getAttribute("method")||ac,a=Mu(e.getAttribute("enctype"))||oc,o=new FormData(e)}else if(D7(e)||I7(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||c.getAttribute("action");if(r=u?Tr(u,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||ac,a=Mu(e.getAttribute("formenctype"))||Mu(c.getAttribute("enctype"))||oc,o=new FormData(c,e),!H7()){let{name:d,type:h,value:p}=e;if(h==="image"){let f=d?d+".":"";o.append(f+"x","0"),o.append(f+"y","0")}else d&&o.append(d,p)}}else{if(tu(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=ac,r=null,a=oc,i=e}return o&&a==="text/plain"&&(i=o,o=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:o,body:i}}const U7=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],W7=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],q7=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"],z7="6";try{window.__reactRouterVersion=z7}catch{}function Z7(e,t){return G6({basename:void 0,future:Ua({},void 0,{v7_prependBasename:!0}),history:y6({window:void 0}),hydrationData:G7(),routes:e,mapRouteProperties:R7,unstable_dataStrategy:void 0,unstable_patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function G7(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Ua({},t,{errors:Y7(t.errors)})),t}function Y7(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,a]of t)if(a&&a.__type==="RouteErrorResponse")n[r]=new gc(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let o=window[a.__subType];if(typeof o=="function")try{let i=new o(a.message);i.stack="",n[r]=i}catch{}}if(n[r]==null){let o=new Error(a.message);o.stack="",n[r]=o}}else n[r]=a;return n}const Od=H.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(Od.displayName="ViewTransition");const d2=H.createContext(new Map);process.env.NODE_ENV!=="production"&&(d2.displayName="Fetchers");const K7="startTransition",Of=H[K7],X7="flushSync",If=p6[X7];function J7(e){Of?Of(e):e()}function Xi(e){If?If(e):e()}class Q7{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function eg(e){let{fallbackElement:t,router:n,future:r}=e,[a,o]=H.useState(n.state),[i,c]=H.useState(),[u,d]=H.useState({isTransitioning:!1}),[h,p]=H.useState(),[f,y]=H.useState(),[g,m]=H.useState(),b=H.useRef(new Map),{v7_startTransition:w}=r||{},_=H.useCallback(S=>{w?J7(S):S()},[w]),x=H.useCallback((S,T)=>{let{deletedFetchers:I,unstable_flushSync:A,unstable_viewTransitionOpts:U}=T;I.forEach(X=>b.current.delete(X)),S.fetchers.forEach((X,G)=>{X.data!==void 0&&b.current.set(G,X.data)});let K=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!U||K){A?Xi(()=>o(S)):_(()=>o(S));return}if(A){Xi(()=>{f&&(h&&h.resolve(),f.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:U.currentLocation,nextLocation:U.nextLocation})});let X=n.window.document.startViewTransition(()=>{Xi(()=>o(S))});X.finished.finally(()=>{Xi(()=>{p(void 0),y(void 0),c(void 0),d({isTransitioning:!1})})}),Xi(()=>y(X));return}f?(h&&h.resolve(),f.skipTransition(),m({state:S,currentLocation:U.currentLocation,nextLocation:U.nextLocation})):(c(S),d({isTransitioning:!0,flushSync:!1,currentLocation:U.currentLocation,nextLocation:U.nextLocation}))},[n.window,f,h,b,_]);H.useLayoutEffect(()=>n.subscribe(x),[n,x]),H.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new Q7)},[u]),H.useEffect(()=>{if(h&&i&&n.window){let S=i,T=h.promise,I=n.window.document.startViewTransition(async()=>{_(()=>o(S)),await T});I.finished.finally(()=>{p(void 0),y(void 0),c(void 0),d({isTransitioning:!1})}),y(I)}},[_,i,h,n.window]),H.useEffect(()=>{h&&i&&a.location.key===i.location.key&&h.resolve()},[h,f,a.location,i]),H.useEffect(()=>{!u.isTransitioning&&g&&(c(g.state),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),m(void 0))},[u.isTransitioning,g]),H.useEffect(()=>{process.env.NODE_ENV!=="production"&&en(t==null||!n.future.v7_partialHydration,"`<RouterProvider fallbackElement>` is deprecated when using `v7_partialHydration`, use a `HydrateFallback` component instead")},[]);let j=H.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:S=>n.navigate(S),push:(S,T,I)=>n.navigate(S,{state:T,preventScrollReset:I==null?void 0:I.preventScrollReset}),replace:(S,T,I)=>n.navigate(S,{replace:!0,state:T,preventScrollReset:I==null?void 0:I.preventScrollReset})}),[n]),k=n.basename||"/",L=H.useMemo(()=>({router:n,navigator:j,static:!1,basename:k}),[n,j,k]),D=H.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return H.createElement(H.Fragment,null,H.createElement(Ni.Provider,{value:L},H.createElement(Qc.Provider,{value:a},H.createElement(d2.Provider,{value:b.current},H.createElement(Od.Provider,{value:u},H.createElement(A7,{basename:k,location:a.location,navigationType:a.historyAction,navigator:j,future:D},a.initialized||n.future.v7_partialHydration?H.createElement(tg,{routes:n.routes,future:n.future,state:a}):t))))),null)}const tg=H.memo(ng);function ng(e){let{routes:t,future:n,state:r}=e;return C7(t,void 0,r,n)}process.env.NODE_ENV;const rg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ag=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,h2=H.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:o,replace:i,state:c,target:u,to:d,preventScrollReset:h,unstable_viewTransition:p}=t,f=Dd(t,U7),{basename:y}=H.useContext(Dr),g,m=!1;if(typeof d=="string"&&ag.test(d)&&(g=d,rg))try{let x=new URL(window.location.href),j=d.startsWith("//")?new URL(x.protocol+d):new URL(d),k=Tr(j.pathname,y);j.origin===x.origin&&k!=null?d=k+j.search+j.hash:m=!0}catch{process.env.NODE_ENV!=="production"&&en(!1,'<Link to="'+d+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let b=m7(d,{relative:a}),w=sg(d,{replace:i,state:c,target:u,preventScrollReset:h,relative:a,unstable_viewTransition:p});function _(x){r&&r(x),x.defaultPrevented||w(x)}return H.createElement("a",Ua({},f,{href:g||b,onClick:m||o?r:_,ref:n,target:u}))});process.env.NODE_ENV!=="production"&&(h2.displayName="Link");const f2=H.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:a=!1,className:o="",end:i=!1,style:c,to:u,unstable_viewTransition:d,children:h}=t,p=Dd(t,W7),f=rl(u,{relative:p.relative}),y=no(),g=H.useContext(Qc),{navigator:m,basename:b}=H.useContext(Dr),w=g!=null&&fg(f)&&d===!0,_=m.encodeLocation?m.encodeLocation(f).pathname:f.pathname,x=y.pathname,j=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;a||(x=x.toLowerCase(),j=j?j.toLowerCase():null,_=_.toLowerCase()),j&&b&&(j=Tr(j,b)||j);const k=_!=="/"&&_.endsWith("/")?_.length-1:_.length;let L=x===_||!i&&x.startsWith(_)&&x.charAt(k)==="/",D=j!=null&&(j===_||!i&&j.startsWith(_)&&j.charAt(_.length)==="/"),S={isActive:L,isPending:D,isTransitioning:w},T=L?r:void 0,I;typeof o=="function"?I=o(S):I=[o,L?"active":null,D?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let A=typeof c=="function"?c(S):c;return H.createElement(h2,Ua({},p,{"aria-current":T,className:I,ref:n,style:A,to:u,unstable_viewTransition:d}),typeof h=="function"?h(S):h)});process.env.NODE_ENV!=="production"&&(f2.displayName="NavLink");const og=H.forwardRef((e,t)=>{let{fetcherKey:n,navigate:r,reloadDocument:a,replace:o,state:i,method:c=ac,action:u,onSubmit:d,relative:h,preventScrollReset:p,unstable_viewTransition:f}=e,y=Dd(e,q7),g=dg(),m=hg(u,{relative:h}),b=c.toLowerCase()==="get"?"get":"post",w=_=>{if(d&&d(_),_.defaultPrevented)return;_.preventDefault();let x=_.nativeEvent.submitter,j=(x==null?void 0:x.getAttribute("formmethod"))||c;g(x||_.currentTarget,{fetcherKey:n,method:j,navigate:r,replace:o,state:i,relative:h,preventScrollReset:p,unstable_viewTransition:f})};return H.createElement("form",Ua({ref:t,method:b,action:m,onSubmit:a?d:w},y))});process.env.NODE_ENV!=="production"&&(og.displayName="Form");process.env.NODE_ENV;var yc;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(yc||(yc={}));var Mf;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Mf||(Mf={}));function ig(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function p2(e){let t=H.useContext(Ni);return t||(process.env.NODE_ENV!=="production"?Te(!1,ig(e)):Te(!1)),t}function sg(e,t){let{target:n,replace:r,state:a,preventScrollReset:o,relative:i,unstable_viewTransition:c}=t===void 0?{}:t,u=ur(),d=no(),h=rl(e,{relative:i});return H.useCallback(p=>{if(B7(p,n)){p.preventDefault();let f=r!==void 0?r:Va(d)===Va(h);u(e,{replace:f,state:a,preventScrollReset:o,relative:i,unstable_viewTransition:c})}},[d,u,h,r,a,n,e,o,i,c])}function m2(e){process.env.NODE_ENV!=="production"&&en(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=H.useRef(T1(e)),n=H.useRef(!1),r=no(),a=H.useMemo(()=>F7(r.search,n.current?null:t.current),[r.search]),o=ur(),i=H.useCallback((c,u)=>{const d=T1(typeof c=="function"?c(a):c);n.current=!0,o("?"+d,u)},[o,a]);return[a,i]}function lg(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let cg=0,ug=()=>"__"+String(++cg)+"__";function dg(){let{router:e}=p2(yc.UseSubmit),{basename:t}=H.useContext(Dr),n=N7();return H.useCallback(function(r,a){a===void 0&&(a={}),lg();let{action:o,method:i,encType:c,formData:u,body:d}=V7(r,t);if(a.navigate===!1){let h=a.fetcherKey||ug();e.fetch(h,n,a.action||o,{preventScrollReset:a.preventScrollReset,formData:u,body:d,formMethod:a.method||i,formEncType:a.encType||c,unstable_flushSync:a.unstable_flushSync})}else e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:u,body:d,formMethod:a.method||i,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,unstable_flushSync:a.unstable_flushSync,unstable_viewTransition:a.unstable_viewTransition})},[e,t,n])}function hg(e,t){let{relative:n}=t===void 0?{}:t,{basename:r}=H.useContext(Dr),a=H.useContext(Or);a||(process.env.NODE_ENV!=="production"?Te(!1,"useFormAction must be used inside a RouteContext"):Te(!1));let[o]=a.matches.slice(-1),i=Ua({},rl(e||".",{relative:n})),c=no();if(e==null){i.search=c.search;let u=new URLSearchParams(i.search);u.has("index")&&u.get("index")===""&&(u.delete("index"),i.search=u.toString()?"?"+u.toString():"")}return(!e||e===".")&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(i.pathname=i.pathname==="/"?r:Xr([r,i.pathname])),Va(i)}function fg(e,t){t===void 0&&(t={});let n=H.useContext(Od);n==null&&(process.env.NODE_ENV!=="production"?Te(!1,"`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):Te(!1));let{basename:r}=p2(yc.useViewTransitionState),a=rl(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=Tr(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=Tr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return mc(a.pathname,i)!=null||mc(a.pathname,o)!=null}const Bf=e=>{let t;const n=new Set,r=(d,h)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const f=t;t=h??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(y=>y(t,f))}},a=()=>t,c={setState:r,getState:a,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d))},u=t=e(r,a,c);return c},pg=e=>e?Bf(e):Bf,mg=e=>e;function gg(e,t=mg){const n=C.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return C.useDebugValue(n),n}const Ff=e=>{const t=pg(e),n=r=>gg(t,r);return Object.assign(n,t),n},Ut=e=>e?Ff(e):Ff,vg=Ut(e=>({blocks:null,setBlocks:t=>e(()=>({blocks:t})),activeBlock:null,setActiveBlock:t=>e(()=>({activeBlock:t})),sourceBlocks:{},setSourceBlocks:t=>e(()=>({sourceBlocks:t})),currentInstance:null,setCurrentInstance:t=>e(()=>({currentInstance:t}))})),yg=Ut(e=>({currentDevice:{icon:"Desktop",value:"desktop"},setCurrentDevice:t=>e(()=>({currentDevice:t}))}));Ut(e=>({pageData:null,setPageData:t=>e(()=>({pageData:t}))}));const g2=[{icon:"TreeStructure",name:"Layers"},{icon:"Plus",name:"Add"},{icon:"Palette",name:"Theme"},{icon:"Gear",name:"Settings"}],Id="https://g-api.billgang.com",Cg="https://www.googleapis.com/webfonts/v1/webfonts",bg="https://stores-api.billgang.com",_g="https://sl-api.billgang.com",xg=window.location.hostname.includes("localhost"),wg=Ut(e=>({activeBlock:g2[0],setActiveBlock:t=>e(()=>({activeBlock:t}))}));function Sg(e,t){let n;try{n=e()}catch{return}return{getItem:a=>{var o;const i=u=>u===null?null:JSON.parse(u,void 0),c=(o=n.getItem(a))!=null?o:null;return c instanceof Promise?c.then(i):i(c)},setItem:(a,o)=>n.setItem(a,JSON.stringify(o,void 0)),removeItem:a=>n.removeItem(a)}}const P1=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return P1(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return P1(r)(n)}}}},jg=(e,t)=>(n,r,a)=>{let o={storage:Sg(()=>localStorage),partialize:m=>m,version:0,merge:(m,b)=>({...b,...m}),...t},i=!1;const c=new Set,u=new Set;let d=o.storage;if(!d)return e((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...m)},r,a);const h=()=>{const m=o.partialize({...r()});return d.setItem(o.name,{state:m,version:o.version})},p=a.setState;a.setState=(m,b)=>{p(m,b),h()};const f=e((...m)=>{n(...m),h()},r,a);a.getInitialState=()=>f;let y;const g=()=>{var m,b;if(!d)return;i=!1,c.forEach(_=>{var x;return _((x=r())!=null?x:f)});const w=((b=o.onRehydrateStorage)==null?void 0:b.call(o,(m=r())!=null?m:f))||void 0;return P1(d.getItem.bind(d))(o.name).then(_=>{if(_)if(typeof _.version=="number"&&_.version!==o.version){if(o.migrate)return[!0,o.migrate(_.state,_.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,_.state];return[!1,void 0]}).then(_=>{var x;const[j,k]=_;if(y=o.merge(k,(x=r())!=null?x:f),n(y,!0),j)return h()}).then(()=>{w==null||w(y,void 0),y=r(),i=!0,u.forEach(_=>_(y))}).catch(_=>{w==null||w(void 0,_)})};return a.persist={setOptions:m=>{o={...o,...m},m.storage&&(d=m.storage)},clearStorage:()=>{d==null||d.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>g(),hasHydrated:()=>i,onHydrate:m=>(c.add(m),()=>{c.delete(m)}),onFinishHydration:m=>(u.add(m),()=>{u.delete(m)})},o.skipHydration||g(),y||f},nu=jg,v2=Ut(nu(e=>({onPreview:!0,setOnPreview:t=>e(()=>({onPreview:t})),activeBlock:{id:null,neededScroll:!1},setActiveBlock:t=>e(()=>({activeBlock:t})),zoomLevel:1,setZoomLevel:t=>e(()=>({zoomLevel:t}))}),{name:"preview-storage",partialize:e=>{const{onPreview:t}=e;return{onPreview:t}}}));var dn=[];for(var Bu=0;Bu<256;++Bu)dn.push((Bu+256).toString(16).slice(1));function kg(e,t=0){return(dn[e[t+0]]+dn[e[t+1]]+dn[e[t+2]]+dn[e[t+3]]+"-"+dn[e[t+4]]+dn[e[t+5]]+"-"+dn[e[t+6]]+dn[e[t+7]]+"-"+dn[e[t+8]]+dn[e[t+9]]+"-"+dn[e[t+10]]+dn[e[t+11]]+dn[e[t+12]]+dn[e[t+13]]+dn[e[t+14]]+dn[e[t+15]]).toLowerCase()}var Pl,Eg=new Uint8Array(16);function Ng(){if(!Pl&&(Pl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Pl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Pl(Eg)}var Tg=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Hf={randomUUID:Tg};function yi(e,t,n){if(Hf.randomUUID&&!t&&!e)return Hf.randomUUID();e=e||{};var r=e.random||(e.rng||Ng)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,kg(r)}const hs=Ut(nu((e,t)=>({header:null,blocks:{},announcement:null,footer:null,currentBlock:null,positionBlock:null,setBlocks:n=>{e({blocks:n})},setHeader:n=>{e({header:n})},setFooter:n=>{e({footer:n})},setAnnouncement:n=>{e({announcement:n})},createPage:n=>{const r=t().blocks;r[n]={data:{},order:[]},e({blocks:r})},deletePage:n=>{const r=t().blocks;delete r[n],e({blocks:r})},updatePage:(n,r)=>{const a=t().blocks;if(a[r])return;const o=a[n];delete a[n],a[r]=o,e({blocks:a})},setCurrentBlock:n=>{e({currentBlock:n})},setPositionBlock:(n,r=!1)=>{const{blocks:a}=t(),{currentPage:o,pages:i}=Md.getState();if(!o||!i||!i[o]||!a[i[o].path]){console.error("Cannot set position: invalid page or block data");return}const c=i[o].path,u=a[c],d=n?u.order.indexOf(n):-1;if(d===-1&&n){console.error(`Block with ID "${n}" not found in page "${c}"`);return}const h=d!==-1?d+(r?1:0):u.order.length;e({positionBlock:h})},addBlock:(n,r)=>{const a=structuredClone(t().blocks)||JSON.parse(JSON.stringify(t().blocks));mr.getState().addHistory({layers:a});const o={...t().blocks},i=o[n]||{data:{},order:[]},c=t().positionBlock,u=yi(),d={name:r.name,value:r.value};return i.data[u]=d,c===null||c>=i.order.length?i.order.push(u):i.order.splice(c,0,u),e({blocks:{...o,[n]:{data:i.data,order:i.order}},currentBlock:u,positionBlock:null}),fs.getState().setNotification({message:"Block successfully added",status:"success"}),u},editBlock:(n,r,a)=>{const o=structuredClone(t().blocks)||JSON.parse(JSON.stringify(t().blocks));mr.getState().addHistory({layers:o});const i=t().blocks,c=i[n]||{};c.data[r]={name:a.name,value:{...a.value}},e({blocks:{...i,[n]:c}})},removeBlock:(n,r)=>{const a=structuredClone(t().blocks);mr.getState().addHistory({layers:a});const o=structuredClone(t().blocks),i=o[n];if(!i){console.error(`Page at path "${n}" does not exist.`);return}delete i.data[r],i.order=i.order.filter(c=>c!==r),e({blocks:{...o,[n]:i}}),fs.getState().setNotification({message:"Block successfully deleted",status:"success"})},moveBlock:(n,r,a)=>e(o=>{const i=structuredClone(t().blocks)||JSON.parse(JSON.stringify(t().blocks));if(mr.getState().addHistory({layers:i}),!o.blocks[n])return console.error(`Path ${n} does not exist in blocks`),o;const c={...o.blocks[n]},u=[...c.order];if(r<0||a<0||r>=u.length||a>=u.length)return console.error(`Invalid indices: fromIndex=${r}, toIndex=${a}`),o;const[d]=u.splice(r,1);return u.splice(a,0,d),fs.getState().setNotification({message:"Block successfully moved",status:"success"}),{blocks:{...o.blocks,[n]:{...c,order:u}}}}),duplicateBlock:(n,r)=>{const a=structuredClone(t().blocks);mr.getState().addHistory({layers:a});const o=structuredClone(t().blocks),i=o[n];if(!i||!i.data[r]){console.error(`Block with ID "${r}" not found in page "${n}"`);return}const c=yi(),u=i.data[r],d={name:u.name,value:structuredClone({...u.value})};i.data[c]={...d};const h=i.order.indexOf(r);if(h===-1){console.error(`Block ID "${r}" not found in order array`);return}i.order.splice(h+1,0,c),e({blocks:{...o,[n]:i},currentBlock:c}),v2.getState().setActiveBlock({id:c,neededScroll:!0}),fs.getState().setNotification({message:"Block successfully duplicated",status:"success"})},isLoadingLayers:!1,setIsLoadingLayers:n=>e(()=>({isLoadingLayers:n}))}),{name:"layers-storage",partialize:e=>{const{blocks:t,header:n,footer:r}=e;return{blocks:t,header:n,footer:r}}})),Pg=Ut((e,t)=>({isModalVisible:!1,hoverBlockId:null,isMouseOverModal:!1,hideTimeout:null,setHoverBlockId:n=>{e({hoverBlockId:n})},showModal:(n,r="hoverBlockId")=>{t().hideTimeout&&clearTimeout(t().hideTimeout),e({isModalVisible:!0,[r]:n})},hideModal:(n="hoverBlockId")=>{e({isModalVisible:!1,[n]:null})},startHideTimeout:()=>{if(!t().isMouseOverModal){const n=setTimeout(()=>{e({isModalVisible:!1,hoverBlockId:null,keyBlock:null})},500);e({hideTimeout:n})}},clearHideTimeout:()=>{t().hideTimeout&&(clearTimeout(t().hideTimeout),e({hideTimeout:null}))},setMouseOverModal:n=>{e({isMouseOverModal:n})},isPreviewVisible:!1,showPreview:(n,r="hoverBlockId")=>{e({isPreviewVisible:!0,[r]:n})},hidePreview:(n="hoverBlockId")=>{e({isPreviewVisible:!1,[n]:null})},keyBlock:null,setKeyBlock:n=>{e({keyBlock:n})},hoverBlockTopPosition:null,setHoverBlockTopPosition:n=>{e({hoverBlockTopPosition:n})}})),xo=Ut((e,t)=>({activeBlock:null,setActiveBlock:n=>e(()=>({activeBlock:n})),activeFont:null,setActiveFont:n=>e(()=>({activeFont:n})),setThemeSettings:n=>e(()=>({themeSettings:n})),themeSettings:{colors:{text:{primary:"#252525",secondary:"#757575",tertiary:"#C2C2C2",inverted:"#FFFFFF",action:"#FF3F19",actionHover:"#DA2400",disabled:"#C2C2C2",warning:"#FF3F19",error:"#C12A2A",success:"#338B13",information:"#3683F7",link:"#3683F7"},icon:{primary:"#252525",secondary:"#555555",tertiary:"#C2C2C2",inverted:"#FFFFFF",action:"#FF3F19",actionHover:"#DA2400",disabled:"#C2C2C2",warning:"#FF3F19",error:"#C12A2A",success:"#338B13",information:"#3683F7",link:"#3683F7"},border:{primary:"#C2C2C2",secondary:"#E6E6E6",action:"#FF3F19",actionHover:"#DA2400",disabled:"#E6E6E6",warning:"#FF3F19",error:"#C12A2A",success:"#338B13",information:"#3683F7",focus:"#FF3F19"},surface:{primary:"#FFFFFF",secondary:"#F8F8F8",action1:"#FF3F19",action1Hover:"#DA2400",action2:"#FFFFFF",action2Hover:"#F8F8F8",disabled:"#C2C2C2",warning:"#FAF4E6",error:"#FAE6E6",success:"#E5FADD",information:"#E9F1FE",modal:"rgba(1, 1, 4, 0.4)"}},fonts:{mobile:{fontSizePercentage:30},tablet:{fontSizePercentage:50},desktop:{heading:{h1:{font:"Archivo",weight:"900",size:48},h2:{font:"Archivo",weight:"700",size:32},h3:{font:"Archivo",weight:"600",size:24},h4:{font:"Archivo",weight:"500",size:16},h5:{font:"Archivo",weight:"400",size:16},h6:{font:"Archivo",weight:"400",size:16}},paragraph:{text:{font:"Archivo",size:14,weight:"400"}}}},borders:{radius:10,thickness:1},buttons:{primary:{size:26,alignment:"left",radius:32,height:40,background:"#ff3f19",hover:!0,font:"Archivo",boxShadow:{left:0,top:0,blur:0,spread:0,color:"#000000"}},secondary:{size:26,alignment:"left",radius:10,height:20,background:"#c2c2c2",hover:!1,font:"Archivo",boxShadow:{left:0,top:4,blur:10,spread:0,color:"#000000"}},tertiary:{size:12,alignment:"left",radius:30,height:30,background:"#c2c2c2",hover:!0,font:"Archivo",boxShadow:{left:0,top:4,blur:10,spread:0,color:"#000000"}}},inputs:{general:{height:48,size:48,color:"#000000"},field:{active:!0,color:"#000000",opacity:40},border:{active:!0,style:"solid",radius:0,thickness:0,color:"#000000"},label:{height:48,size:48,color:"#000000",alignment:"left"}}},updateColor:(n,r,a)=>e(o=>{const i=structuredClone(t().themeSettings);mr.getState().addHistory({themeSettings:i});const c={...o.themeSettings.colors,[n]:{...o.themeSettings.colors[n],[r]:a}};return{themeSettings:{...o.themeSettings,colors:c}}}),updateFont:(n,r,a,o,i)=>e(c=>{const u=structuredClone(t().themeSettings);mr.getState().addHistory({themeSettings:u});const d={...c.themeSettings.fonts,[n]:{...c.themeSettings.fonts[n],[r]:{...c.themeSettings.fonts[n][r],[a]:{...c.themeSettings.fonts[n][r][a],[o]:i}}}};return{themeSettings:{...c.themeSettings,fonts:d}}}),updateFontSizePercentage:(n,r)=>e(a=>{const o=structuredClone(t().themeSettings);mr.getState().addHistory({themeSettings:o});const i={...a.themeSettings.fonts,[n]:{...a.themeSettings.fonts[n],fontSizePercentage:r}};return{themeSettings:{...a.themeSettings,fonts:i}}}),updateBorder:(n,r)=>e(a=>{const o=structuredClone(t().themeSettings);mr.getState().addHistory({themeSettings:o});const i={...a.themeSettings.borders,[n]:r};return{themeSettings:{...a.themeSettings,borders:i}}}),updateButton:(n,r,a)=>e(o=>{const i=structuredClone(t().themeSettings);mr.getState().addHistory({themeSettings:i});const c={...o.themeSettings.buttons[n],[r]:a},u={...o.themeSettings.buttons,[n]:c};return{themeSettings:{...o.themeSettings,buttons:u}}}),updateInput:(n,r,a)=>e(o=>{const i=structuredClone(t().themeSettings);return mr.getState().addHistory({themeSettings:i}),{themeSettings:{...o.themeSettings,inputs:{...o.themeSettings.inputs,[n]:{...o.themeSettings.inputs[n],[a]:r}}}}}),isLoadingThemeSettings:!1,setIsLoadingThemeSettings:n=>e(()=>({isLoadingThemeSettings:n}))})),Lg=Ut(nu(e=>({fonts:[],setFonts:t=>e(()=>({fonts:t}))}),{name:"fonts-storage"})),Ag=Ut(e=>({settings:null,setSettings:t=>e(()=>({settings:t})),isLoadingSettings:!0,setIsLoadingSettings:t=>e(()=>({isLoadingSettings:t}))})),Rg=Ut()(e=>({color:"default",initialColor:"",setInitialColor:t=>e(()=>({initialColor:t})),colorChange:()=>{},update:()=>{},activeLabel:null,modalPosition:{left:0,top:0},showModal:!1,dragging:!1,hue:0,saturation:100,brightness:100,alpha:100,isGradientActive:!0,isGradient:!1,setIsGradient:t=>e(()=>({isGradient:t})),gradientDirection:"vertical",setGradientDirection:t=>e(()=>({gradientDirection:t})),hue2:0,saturation2:100,brightness2:100,alpha2:100,setHue2:t=>e(()=>({hue2:t})),setSaturation2:t=>e(()=>({saturation2:t})),setBrightness2:t=>e(()=>({brightness2:t})),setAlpha2:t=>e(()=>({alpha2:t})),activeColorIndex:1,setActiveColorIndex:t=>e(()=>({activeColorIndex:t})),setModalPosition:t=>e(()=>({modalPosition:t})),setHue:t=>e(()=>({hue:t})),setSaturation:t=>e(()=>({saturation:t})),setBrightness:t=>e(()=>({brightness:t})),setShowModal:t=>e(()=>({showModal:t})),setDragging:t=>e(()=>({dragging:t})),setActiveLabel:t=>e(()=>({activeLabel:t})),setColor:t=>e(()=>({color:t})),setUpdate:t=>e(()=>({update:t})),setColorChange:t=>e(()=>({colorChange:t})),setAlpha:t=>e(()=>({alpha:t})),setIsGradientActive:t=>e(()=>({isGradientActive:t})),resetColors:()=>e(()=>({color:"default",initialColor:"",activeLabel:null,modalPosition:{left:0,top:0},showModal:!1,dragging:!1,hue:0,saturation:100,brightness:100,alpha:100,isGradient:!1,gradientDirection:"vertical",hue2:0,saturation2:100,brightness2:100,alpha2:100,activeColorIndex:1,isGradientActive:!0}))})),Md=Ut(nu((e,t)=>({pages:null,currentPage:"",setPages:n=>e(()=>({pages:n})),pageContext:{listings:null,products:null,reviews:null,categories:null,faqs:null,general:null,fullPosts:null,posts:null},isOpenModal:!1,isOpenSelectModal:!1,isEdit:!1,editedPage:null,setEditedPage:n=>e(()=>({editedPage:n})),setCurrentPage:n=>e(()=>({currentPage:n})),setPageContext:n=>e(()=>({pageContext:n})),setIsOpenModal:n=>e(()=>({isOpenModal:n})),setIsOpenSelectModal:n=>e(()=>({isOpenSelectModal:n})),setIsEdit:n=>e(()=>({isEdit:n})),createPage:n=>{const r=t().pages,a=yi();if(r)r[a]=n,e({pages:r});else{const o=t().setPages;o({});const i=t().pages;i[a]=n,e({pages:i})}},updatePage:(n,r)=>{const a=t().pages;a&&(a[n]={...r},e({pages:a}))},deletePage:n=>{const r=t().pages;r&&(delete r[n],e({pages:r}))}}),{name:"pages-storage",partialize:e=>{const{pages:t,pageContext:n}=e;return{pages:t,pageContext:n}}})),Bd=Ut(e=>({openModal:!1,setOpenModal:t=>e(()=>({openModal:t})),onChange:null,setOnChange:t=>e(()=>({onChange:t})),tip:"",setTip:t=>e(()=>({tip:t}))})),mr=Ut((e,t)=>({past:[],future:[],addHistory:n=>{e(r=>({past:[...r.past,n],future:[]}))},undo:()=>{const{past:n,future:r}=t();if(n.length===0)return;const a=n[n.length-1],o=n.slice(0,-1),i={themeSettings:xo.getState().themeSettings,layers:hs.getState().blocks};e({past:o,future:[i,...r]}),a.themeSettings&&xo.setState({themeSettings:a.themeSettings}),a.layers&&hs.setState({blocks:a.layers})},redo:()=>{const{past:n,future:r}=t();if(r.length===0)return;const a=r[0],o=r.slice(1),i={themeSettings:xo.getState().themeSettings,layers:hs.getState().blocks};e({past:[...n,i],future:o}),a.themeSettings&&xo.setState({themeSettings:a.themeSettings}),a.layers&&hs.setState({blocks:a.layers})}})),Dg=Ut(e=>({isOpenModal:!1,setIsOpenModal:t=>e(()=>({isOpenModal:t}))})),fs=Ut(e=>({notification:null,setNotification:t=>e(()=>({notification:t}))})),Og=Ut(e=>({error:null,setError:t=>e(()=>({error:t}))})),Ig=Ut(e=>({title:null,description:null,onConfirm:null,setTitle:t=>e(()=>({title:t})),setDescription:t=>e(()=>({description:t})),setOnConfirm:t=>e(()=>({onConfirm:t}))})),Mg=Ut(e=>({showTooltip:!1,setShowTooltip:t=>e({showTooltip:t})})),Fd=Ut(e=>({isOpen:!0,setIsOpen:t=>e(()=>({isOpen:t}))})),Bg=Ut(e=>({general:null,setGeneral:t=>e(()=>({general:t}))})),Fg="_icon_bsuj2_1",Hg="_hoverable_bsuj2_5",$g="_rotated_bsuj2_9",$f={icon:Fg,hoverable:Hg,rotated:$g};var y2={exports:{}};/*!
61
+ */function Ua(){return Ua=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ua.apply(this,arguments)}function Dd(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o<r.length;o++)a=r[o],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}const ac="get",oc="application/x-www-form-urlencoded";function tu(e){return e!=null&&typeof e.tagName=="string"}function D7(e){return tu(e)&&e.tagName.toLowerCase()==="button"}function O7(e){return tu(e)&&e.tagName.toLowerCase()==="form"}function I7(e){return tu(e)&&e.tagName.toLowerCase()==="input"}function M7(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function B7(e,t){return e.button===0&&(!t||t==="_self")&&!M7(e)}function T1(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function F7(e,t){let n=T1(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(o=>{n.append(a,o)})}),n}let Tl=null;function H7(){if(Tl===null)try{new FormData(document.createElement("form"),0),Tl=!1}catch{Tl=!0}return Tl}const $7=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Mu(e){return e!=null&&!$7.has(e)?(process.env.NODE_ENV!=="production"&&en(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+oc+'"')),null):e}function V7(e,t){let n,r,a,o,i;if(O7(e)){let c=e.getAttribute("action");r=c?Tr(c,t):null,n=e.getAttribute("method")||ac,a=Mu(e.getAttribute("enctype"))||oc,o=new FormData(e)}else if(D7(e)||I7(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||c.getAttribute("action");if(r=u?Tr(u,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||ac,a=Mu(e.getAttribute("formenctype"))||Mu(c.getAttribute("enctype"))||oc,o=new FormData(c,e),!H7()){let{name:d,type:h,value:p}=e;if(h==="image"){let f=d?d+".":"";o.append(f+"x","0"),o.append(f+"y","0")}else d&&o.append(d,p)}}else{if(tu(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=ac,r=null,a=oc,i=e}return o&&a==="text/plain"&&(i=o,o=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:o,body:i}}const U7=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],W7=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],q7=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"],z7="6";try{window.__reactRouterVersion=z7}catch{}function Z7(e,t){return G6({basename:void 0,future:Ua({},void 0,{v7_prependBasename:!0}),history:y6({window:void 0}),hydrationData:G7(),routes:e,mapRouteProperties:R7,unstable_dataStrategy:void 0,unstable_patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function G7(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Ua({},t,{errors:Y7(t.errors)})),t}function Y7(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,a]of t)if(a&&a.__type==="RouteErrorResponse")n[r]=new gc(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let o=window[a.__subType];if(typeof o=="function")try{let i=new o(a.message);i.stack="",n[r]=i}catch{}}if(n[r]==null){let o=new Error(a.message);o.stack="",n[r]=o}}else n[r]=a;return n}const Od=H.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(Od.displayName="ViewTransition");const d2=H.createContext(new Map);process.env.NODE_ENV!=="production"&&(d2.displayName="Fetchers");const K7="startTransition",Of=H[K7],X7="flushSync",If=p6[X7];function J7(e){Of?Of(e):e()}function Xi(e){If?If(e):e()}class Q7{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function eg(e){let{fallbackElement:t,router:n,future:r}=e,[a,o]=H.useState(n.state),[i,c]=H.useState(),[u,d]=H.useState({isTransitioning:!1}),[h,p]=H.useState(),[f,y]=H.useState(),[g,m]=H.useState(),b=H.useRef(new Map),{v7_startTransition:w}=r||{},_=H.useCallback(S=>{w?J7(S):S()},[w]),x=H.useCallback((S,T)=>{let{deletedFetchers:I,unstable_flushSync:A,unstable_viewTransitionOpts:U}=T;I.forEach(X=>b.current.delete(X)),S.fetchers.forEach((X,G)=>{X.data!==void 0&&b.current.set(G,X.data)});let K=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!U||K){A?Xi(()=>o(S)):_(()=>o(S));return}if(A){Xi(()=>{f&&(h&&h.resolve(),f.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:U.currentLocation,nextLocation:U.nextLocation})});let X=n.window.document.startViewTransition(()=>{Xi(()=>o(S))});X.finished.finally(()=>{Xi(()=>{p(void 0),y(void 0),c(void 0),d({isTransitioning:!1})})}),Xi(()=>y(X));return}f?(h&&h.resolve(),f.skipTransition(),m({state:S,currentLocation:U.currentLocation,nextLocation:U.nextLocation})):(c(S),d({isTransitioning:!0,flushSync:!1,currentLocation:U.currentLocation,nextLocation:U.nextLocation}))},[n.window,f,h,b,_]);H.useLayoutEffect(()=>n.subscribe(x),[n,x]),H.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new Q7)},[u]),H.useEffect(()=>{if(h&&i&&n.window){let S=i,T=h.promise,I=n.window.document.startViewTransition(async()=>{_(()=>o(S)),await T});I.finished.finally(()=>{p(void 0),y(void 0),c(void 0),d({isTransitioning:!1})}),y(I)}},[_,i,h,n.window]),H.useEffect(()=>{h&&i&&a.location.key===i.location.key&&h.resolve()},[h,f,a.location,i]),H.useEffect(()=>{!u.isTransitioning&&g&&(c(g.state),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),m(void 0))},[u.isTransitioning,g]),H.useEffect(()=>{process.env.NODE_ENV!=="production"&&en(t==null||!n.future.v7_partialHydration,"`<RouterProvider fallbackElement>` is deprecated when using `v7_partialHydration`, use a `HydrateFallback` component instead")},[]);let j=H.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:S=>n.navigate(S),push:(S,T,I)=>n.navigate(S,{state:T,preventScrollReset:I==null?void 0:I.preventScrollReset}),replace:(S,T,I)=>n.navigate(S,{replace:!0,state:T,preventScrollReset:I==null?void 0:I.preventScrollReset})}),[n]),k=n.basename||"/",L=H.useMemo(()=>({router:n,navigator:j,static:!1,basename:k}),[n,j,k]),D=H.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return H.createElement(H.Fragment,null,H.createElement(Ni.Provider,{value:L},H.createElement(Qc.Provider,{value:a},H.createElement(d2.Provider,{value:b.current},H.createElement(Od.Provider,{value:u},H.createElement(A7,{basename:k,location:a.location,navigationType:a.historyAction,navigator:j,future:D},a.initialized||n.future.v7_partialHydration?H.createElement(tg,{routes:n.routes,future:n.future,state:a}):t))))),null)}const tg=H.memo(ng);function ng(e){let{routes:t,future:n,state:r}=e;return C7(t,void 0,r,n)}process.env.NODE_ENV;const rg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ag=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,h2=H.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:o,replace:i,state:c,target:u,to:d,preventScrollReset:h,unstable_viewTransition:p}=t,f=Dd(t,U7),{basename:y}=H.useContext(Dr),g,m=!1;if(typeof d=="string"&&ag.test(d)&&(g=d,rg))try{let x=new URL(window.location.href),j=d.startsWith("//")?new URL(x.protocol+d):new URL(d),k=Tr(j.pathname,y);j.origin===x.origin&&k!=null?d=k+j.search+j.hash:m=!0}catch{process.env.NODE_ENV!=="production"&&en(!1,'<Link to="'+d+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let b=m7(d,{relative:a}),w=sg(d,{replace:i,state:c,target:u,preventScrollReset:h,relative:a,unstable_viewTransition:p});function _(x){r&&r(x),x.defaultPrevented||w(x)}return H.createElement("a",Ua({},f,{href:g||b,onClick:m||o?r:_,ref:n,target:u}))});process.env.NODE_ENV!=="production"&&(h2.displayName="Link");const f2=H.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:a=!1,className:o="",end:i=!1,style:c,to:u,unstable_viewTransition:d,children:h}=t,p=Dd(t,W7),f=rl(u,{relative:p.relative}),y=no(),g=H.useContext(Qc),{navigator:m,basename:b}=H.useContext(Dr),w=g!=null&&fg(f)&&d===!0,_=m.encodeLocation?m.encodeLocation(f).pathname:f.pathname,x=y.pathname,j=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;a||(x=x.toLowerCase(),j=j?j.toLowerCase():null,_=_.toLowerCase()),j&&b&&(j=Tr(j,b)||j);const k=_!=="/"&&_.endsWith("/")?_.length-1:_.length;let L=x===_||!i&&x.startsWith(_)&&x.charAt(k)==="/",D=j!=null&&(j===_||!i&&j.startsWith(_)&&j.charAt(_.length)==="/"),S={isActive:L,isPending:D,isTransitioning:w},T=L?r:void 0,I;typeof o=="function"?I=o(S):I=[o,L?"active":null,D?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let A=typeof c=="function"?c(S):c;return H.createElement(h2,Ua({},p,{"aria-current":T,className:I,ref:n,style:A,to:u,unstable_viewTransition:d}),typeof h=="function"?h(S):h)});process.env.NODE_ENV!=="production"&&(f2.displayName="NavLink");const og=H.forwardRef((e,t)=>{let{fetcherKey:n,navigate:r,reloadDocument:a,replace:o,state:i,method:c=ac,action:u,onSubmit:d,relative:h,preventScrollReset:p,unstable_viewTransition:f}=e,y=Dd(e,q7),g=dg(),m=hg(u,{relative:h}),b=c.toLowerCase()==="get"?"get":"post",w=_=>{if(d&&d(_),_.defaultPrevented)return;_.preventDefault();let x=_.nativeEvent.submitter,j=(x==null?void 0:x.getAttribute("formmethod"))||c;g(x||_.currentTarget,{fetcherKey:n,method:j,navigate:r,replace:o,state:i,relative:h,preventScrollReset:p,unstable_viewTransition:f})};return H.createElement("form",Ua({ref:t,method:b,action:m,onSubmit:a?d:w},y))});process.env.NODE_ENV!=="production"&&(og.displayName="Form");process.env.NODE_ENV;var yc;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(yc||(yc={}));var Mf;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Mf||(Mf={}));function ig(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function p2(e){let t=H.useContext(Ni);return t||(process.env.NODE_ENV!=="production"?Te(!1,ig(e)):Te(!1)),t}function sg(e,t){let{target:n,replace:r,state:a,preventScrollReset:o,relative:i,unstable_viewTransition:c}=t===void 0?{}:t,u=ur(),d=no(),h=rl(e,{relative:i});return H.useCallback(p=>{if(B7(p,n)){p.preventDefault();let f=r!==void 0?r:Va(d)===Va(h);u(e,{replace:f,state:a,preventScrollReset:o,relative:i,unstable_viewTransition:c})}},[d,u,h,r,a,n,e,o,i,c])}function m2(e){process.env.NODE_ENV!=="production"&&en(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=H.useRef(T1(e)),n=H.useRef(!1),r=no(),a=H.useMemo(()=>F7(r.search,n.current?null:t.current),[r.search]),o=ur(),i=H.useCallback((c,u)=>{const d=T1(typeof c=="function"?c(a):c);n.current=!0,o("?"+d,u)},[o,a]);return[a,i]}function lg(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let cg=0,ug=()=>"__"+String(++cg)+"__";function dg(){let{router:e}=p2(yc.UseSubmit),{basename:t}=H.useContext(Dr),n=N7();return H.useCallback(function(r,a){a===void 0&&(a={}),lg();let{action:o,method:i,encType:c,formData:u,body:d}=V7(r,t);if(a.navigate===!1){let h=a.fetcherKey||ug();e.fetch(h,n,a.action||o,{preventScrollReset:a.preventScrollReset,formData:u,body:d,formMethod:a.method||i,formEncType:a.encType||c,unstable_flushSync:a.unstable_flushSync})}else e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:u,body:d,formMethod:a.method||i,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,unstable_flushSync:a.unstable_flushSync,unstable_viewTransition:a.unstable_viewTransition})},[e,t,n])}function hg(e,t){let{relative:n}=t===void 0?{}:t,{basename:r}=H.useContext(Dr),a=H.useContext(Or);a||(process.env.NODE_ENV!=="production"?Te(!1,"useFormAction must be used inside a RouteContext"):Te(!1));let[o]=a.matches.slice(-1),i=Ua({},rl(e||".",{relative:n})),c=no();if(e==null){i.search=c.search;let u=new URLSearchParams(i.search);u.has("index")&&u.get("index")===""&&(u.delete("index"),i.search=u.toString()?"?"+u.toString():"")}return(!e||e===".")&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(i.pathname=i.pathname==="/"?r:Xr([r,i.pathname])),Va(i)}function fg(e,t){t===void 0&&(t={});let n=H.useContext(Od);n==null&&(process.env.NODE_ENV!=="production"?Te(!1,"`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):Te(!1));let{basename:r}=p2(yc.useViewTransitionState),a=rl(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=Tr(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=Tr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return mc(a.pathname,i)!=null||mc(a.pathname,o)!=null}const Bf=e=>{let t;const n=new Set,r=(d,h)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const f=t;t=h??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(y=>y(t,f))}},a=()=>t,c={setState:r,getState:a,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d))},u=t=e(r,a,c);return c},pg=e=>e?Bf(e):Bf,mg=e=>e;function gg(e,t=mg){const n=C.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return C.useDebugValue(n),n}const Ff=e=>{const t=pg(e),n=r=>gg(t,r);return Object.assign(n,t),n},Ut=e=>e?Ff(e):Ff,vg=Ut(e=>({blocks:null,setBlocks:t=>e(()=>({blocks:t})),activeBlock:null,setActiveBlock:t=>e(()=>({activeBlock:t})),sourceBlocks:{},setSourceBlocks:t=>e(()=>({sourceBlocks:t})),currentInstance:null,setCurrentInstance:t=>e(()=>({currentInstance:t}))})),yg=Ut(e=>({currentDevice:{icon:"Desktop",value:"desktop"},setCurrentDevice:t=>e(()=>({currentDevice:t}))}));Ut(e=>({pageData:null,setPageData:t=>e(()=>({pageData:t}))}));const g2=[{icon:"TreeStructure",name:"Layers"},{icon:"Plus",name:"Add"},{icon:"Palette",name:"Theme"},{icon:"Gear",name:"Settings"}],Id="https://g-api.billgang.com",Cg="https://www.googleapis.com/webfonts/v1/webfonts",bg="https://stores-api.billgang.com",_g="https://sl-api.billgang.com",xg=window.location.hostname.includes("localhost"),wg=Ut(e=>({activeBlock:g2[0],setActiveBlock:t=>e(()=>({activeBlock:t}))}));function Sg(e,t){let n;try{n=e()}catch{return}return{getItem:a=>{var o;const i=u=>u===null?null:JSON.parse(u,void 0),c=(o=n.getItem(a))!=null?o:null;return c instanceof Promise?c.then(i):i(c)},setItem:(a,o)=>n.setItem(a,JSON.stringify(o,void 0)),removeItem:a=>n.removeItem(a)}}const P1=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return P1(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return P1(r)(n)}}}},jg=(e,t)=>(n,r,a)=>{let o={storage:Sg(()=>localStorage),partialize:m=>m,version:0,merge:(m,b)=>({...b,...m}),...t},i=!1;const c=new Set,u=new Set;let d=o.storage;if(!d)return e((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...m)},r,a);const h=()=>{const m=o.partialize({...r()});return d.setItem(o.name,{state:m,version:o.version})},p=a.setState;a.setState=(m,b)=>{p(m,b),h()};const f=e((...m)=>{n(...m),h()},r,a);a.getInitialState=()=>f;let y;const g=()=>{var m,b;if(!d)return;i=!1,c.forEach(_=>{var x;return _((x=r())!=null?x:f)});const w=((b=o.onRehydrateStorage)==null?void 0:b.call(o,(m=r())!=null?m:f))||void 0;return P1(d.getItem.bind(d))(o.name).then(_=>{if(_)if(typeof _.version=="number"&&_.version!==o.version){if(o.migrate)return[!0,o.migrate(_.state,_.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,_.state];return[!1,void 0]}).then(_=>{var x;const[j,k]=_;if(y=o.merge(k,(x=r())!=null?x:f),n(y,!0),j)return h()}).then(()=>{w==null||w(y,void 0),y=r(),i=!0,u.forEach(_=>_(y))}).catch(_=>{w==null||w(void 0,_)})};return a.persist={setOptions:m=>{o={...o,...m},m.storage&&(d=m.storage)},clearStorage:()=>{d==null||d.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>g(),hasHydrated:()=>i,onHydrate:m=>(c.add(m),()=>{c.delete(m)}),onFinishHydration:m=>(u.add(m),()=>{u.delete(m)})},o.skipHydration||g(),y||f},nu=jg,v2=Ut(nu(e=>({onPreview:!0,setOnPreview:t=>e(()=>({onPreview:t})),activeBlock:{id:null,neededScroll:!1},setActiveBlock:t=>e(()=>({activeBlock:t})),zoomLevel:1,setZoomLevel:t=>e(()=>({zoomLevel:t}))}),{name:"preview-storage",partialize:e=>{const{onPreview:t}=e;return{onPreview:t}}}));var dn=[];for(var Bu=0;Bu<256;++Bu)dn.push((Bu+256).toString(16).slice(1));function kg(e,t=0){return(dn[e[t+0]]+dn[e[t+1]]+dn[e[t+2]]+dn[e[t+3]]+"-"+dn[e[t+4]]+dn[e[t+5]]+"-"+dn[e[t+6]]+dn[e[t+7]]+"-"+dn[e[t+8]]+dn[e[t+9]]+"-"+dn[e[t+10]]+dn[e[t+11]]+dn[e[t+12]]+dn[e[t+13]]+dn[e[t+14]]+dn[e[t+15]]).toLowerCase()}var Pl,Eg=new Uint8Array(16);function Ng(){if(!Pl&&(Pl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Pl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Pl(Eg)}var Tg=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Hf={randomUUID:Tg};function yi(e,t,n){if(Hf.randomUUID&&!t&&!e)return Hf.randomUUID();e=e||{};var r=e.random||(e.rng||Ng)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,kg(r)}const hs=Ut(nu((e,t)=>({header:null,blocks:{},announcement:null,footer:null,currentBlock:null,positionBlock:null,setBlocks:n=>{e({blocks:n})},setHeader:n=>{e({header:n})},setFooter:n=>{e({footer:n})},setAnnouncement:n=>{e({announcement:n})},createPage:n=>{const r=t().blocks;r[n]={data:{},order:[]},e({blocks:r})},deletePage:n=>{const r=t().blocks;delete r[n],e({blocks:r})},updatePage:(n,r)=>{const a=t().blocks;if(a[r])return;const o=a[n];delete a[n],a[r]=o,e({blocks:a})},setCurrentBlock:n=>{e({currentBlock:n})},setPositionBlock:(n,r=!1)=>{const{blocks:a}=t(),{currentPage:o,pages:i}=Md.getState();if(!o||!i||!i[o]||!a[i[o].path]){console.error("Cannot set position: invalid page or block data");return}const c=i[o].path,u=a[c],d=n?u.order.indexOf(n):-1;if(d===-1&&n){console.error(`Block with ID "${n}" not found in page "${c}"`);return}const h=d!==-1?d+(r?1:0):u.order.length;e({positionBlock:h})},addBlock:(n,r)=>{const a=structuredClone(t().blocks)||JSON.parse(JSON.stringify(t().blocks));mr.getState().addHistory({layers:a});const o={...t().blocks},i=o[n]||{data:{},order:[]},c=t().positionBlock,u=yi(),d={name:r.name,value:r.value};return i.data[u]=d,c===null||c>=i.order.length?i.order.push(u):i.order.splice(c,0,u),e({blocks:{...o,[n]:{data:i.data,order:i.order}},currentBlock:u,positionBlock:null}),fs.getState().setNotification({message:"Block successfully added",status:"success"}),u},editBlock:(n,r,a)=>{const o=structuredClone(t().blocks)||JSON.parse(JSON.stringify(t().blocks));mr.getState().addHistory({layers:o});const i=t().blocks,c=i[n]||{};c.data[r]={name:a.name,value:{...a.value}},e({blocks:{...i,[n]:c}})},removeBlock:(n,r)=>{const a=structuredClone(t().blocks);mr.getState().addHistory({layers:a});const o=structuredClone(t().blocks),i=o[n];if(!i){console.error(`Page at path "${n}" does not exist.`);return}delete i.data[r],i.order=i.order.filter(c=>c!==r),e({blocks:{...o,[n]:i}}),fs.getState().setNotification({message:"Block successfully deleted",status:"success"})},moveBlock:(n,r,a)=>e(o=>{const i=structuredClone(t().blocks)||JSON.parse(JSON.stringify(t().blocks));if(mr.getState().addHistory({layers:i}),!o.blocks[n])return console.error(`Path ${n} does not exist in blocks`),o;const c={...o.blocks[n]},u=[...c.order];if(r<0||a<0||r>=u.length||a>=u.length)return console.error(`Invalid indices: fromIndex=${r}, toIndex=${a}`),o;const[d]=u.splice(r,1);return u.splice(a,0,d),fs.getState().setNotification({message:"Block successfully moved",status:"success"}),{blocks:{...o.blocks,[n]:{...c,order:u}}}}),duplicateBlock:(n,r)=>{const a=structuredClone(t().blocks);mr.getState().addHistory({layers:a});const o=structuredClone(t().blocks),i=o[n];if(!i||!i.data[r]){console.error(`Block with ID "${r}" not found in page "${n}"`);return}const c=yi(),u=i.data[r],d={name:u.name,value:structuredClone({...u.value})};i.data[c]={...d};const h=i.order.indexOf(r);if(h===-1){console.error(`Block ID "${r}" not found in order array`);return}i.order.splice(h+1,0,c),e({blocks:{...o,[n]:i},currentBlock:c}),v2.getState().setActiveBlock({id:c,neededScroll:!0}),fs.getState().setNotification({message:"Block successfully duplicated",status:"success"})},isLoadingLayers:!1,setIsLoadingLayers:n=>e(()=>({isLoadingLayers:n}))}),{name:"layers-storage",partialize:e=>{const{blocks:t,header:n,footer:r}=e;return{blocks:t,header:n,footer:r}}})),Pg=Ut((e,t)=>({isModalVisible:!1,hoverBlockId:null,isMouseOverModal:!1,hideTimeout:null,setHoverBlockId:n=>{e({hoverBlockId:n})},showModal:(n,r="hoverBlockId")=>{t().hideTimeout&&clearTimeout(t().hideTimeout),e({isModalVisible:!0,[r]:n})},hideModal:(n="hoverBlockId")=>{e({isModalVisible:!1,[n]:null})},startHideTimeout:()=>{if(!t().isMouseOverModal){const n=setTimeout(()=>{e({isModalVisible:!1,hoverBlockId:null,keyBlock:null})},500);e({hideTimeout:n})}},clearHideTimeout:()=>{t().hideTimeout&&(clearTimeout(t().hideTimeout),e({hideTimeout:null}))},setMouseOverModal:n=>{e({isMouseOverModal:n})},isPreviewVisible:!1,showPreview:(n,r="hoverBlockId")=>{e({isPreviewVisible:!0,[r]:n})},hidePreview:(n="hoverBlockId")=>{e({isPreviewVisible:!1,[n]:null})},keyBlock:null,setKeyBlock:n=>{e({keyBlock:n})},hoverBlockTopPosition:null,setHoverBlockTopPosition:n=>{e({hoverBlockTopPosition:n})}})),xo=Ut((e,t)=>({activeBlock:null,setActiveBlock:n=>e(()=>({activeBlock:n})),activeFont:null,setActiveFont:n=>e(()=>({activeFont:n})),setThemeSettings:n=>e(()=>({themeSettings:n})),activeColorCategory:null,setActiveColorCategory:n=>e(()=>({activeColorCategory:n})),themeSettings:{colors:{text:{primary:"#252525",secondary:"#757575",tertiary:"#C2C2C2",inverted:"#FFFFFF",action:"#FF3F19",actionHover:"#DA2400",disabled:"#C2C2C2",warning:"#FF3F19",error:"#C12A2A",success:"#338B13",information:"#3683F7",link:"#3683F7"},icon:{primary:"#252525",secondary:"#555555",tertiary:"#C2C2C2",inverted:"#FFFFFF",action:"#FF3F19",actionHover:"#DA2400",disabled:"#C2C2C2",warning:"#FF3F19",error:"#C12A2A",success:"#338B13",information:"#3683F7",link:"#3683F7"},border:{primary:"#C2C2C2",secondary:"#E6E6E6",action:"#FF3F19",actionHover:"#DA2400",disabled:"#E6E6E6",warning:"#FF3F19",error:"#C12A2A",success:"#338B13",information:"#3683F7",focus:"#FF3F19"},surface:{primary:"#FFFFFF",secondary:"#F8F8F8",action1:"#FF3F19",action1Hover:"#DA2400",action2:"#FFFFFF",action2Hover:"#F8F8F8",disabled:"#C2C2C2",warning:"#FAF4E6",error:"#FAE6E6",success:"#E5FADD",information:"#E9F1FE",modal:"rgba(1, 1, 4, 0.4)"}},fonts:{mobile:{fontSizePercentage:30},tablet:{fontSizePercentage:50},desktop:{heading:{h1:{font:"Archivo",weight:"900",size:48},h2:{font:"Archivo",weight:"700",size:32},h3:{font:"Archivo",weight:"600",size:24},h4:{font:"Archivo",weight:"500",size:16},h5:{font:"Archivo",weight:"400",size:16},h6:{font:"Archivo",weight:"400",size:16}},paragraph:{text:{font:"Archivo",size:14,weight:"400"}}}},borders:{radius:10,thickness:1},buttons:{primary:{size:26,alignment:"left",radius:32,height:40,background:"#ff3f19",hover:!0,font:"Archivo",boxShadow:{left:0,top:0,blur:0,spread:0,color:"#000000"}},secondary:{size:26,alignment:"left",radius:10,height:20,background:"#c2c2c2",hover:!1,font:"Archivo",boxShadow:{left:0,top:4,blur:10,spread:0,color:"#000000"}},tertiary:{size:12,alignment:"left",radius:30,height:30,background:"#c2c2c2",hover:!0,font:"Archivo",boxShadow:{left:0,top:4,blur:10,spread:0,color:"#000000"}}},inputs:{general:{height:48,size:48,color:"#000000"},field:{active:!0,color:"#000000",opacity:40},border:{active:!0,style:"solid",radius:0,thickness:0,color:"#000000"},label:{height:48,size:48,color:"#000000",alignment:"left"}}},updateColor:(n,r,a)=>e(o=>{const i=structuredClone(t().themeSettings);mr.getState().addHistory({themeSettings:i});const c={...o.themeSettings.colors,[n]:{...o.themeSettings.colors[n],[r]:a}};return{themeSettings:{...o.themeSettings,colors:c}}}),updateFont:(n,r,a,o,i)=>e(c=>{const u=structuredClone(t().themeSettings);mr.getState().addHistory({themeSettings:u});const d={...c.themeSettings.fonts,[n]:{...c.themeSettings.fonts[n],[r]:{...c.themeSettings.fonts[n][r],[a]:{...c.themeSettings.fonts[n][r][a],[o]:i}}}};return{themeSettings:{...c.themeSettings,fonts:d}}}),updateFontSizePercentage:(n,r)=>e(a=>{const o=structuredClone(t().themeSettings);mr.getState().addHistory({themeSettings:o});const i={...a.themeSettings.fonts,[n]:{...a.themeSettings.fonts[n],fontSizePercentage:r}};return{themeSettings:{...a.themeSettings,fonts:i}}}),updateBorder:(n,r)=>e(a=>{const o=structuredClone(t().themeSettings);mr.getState().addHistory({themeSettings:o});const i={...a.themeSettings.borders,[n]:r};return{themeSettings:{...a.themeSettings,borders:i}}}),updateButton:(n,r,a)=>e(o=>{const i=structuredClone(t().themeSettings);mr.getState().addHistory({themeSettings:i});const c={...o.themeSettings.buttons[n],[r]:a},u={...o.themeSettings.buttons,[n]:c};return{themeSettings:{...o.themeSettings,buttons:u}}}),updateInput:(n,r,a)=>e(o=>{const i=structuredClone(t().themeSettings);return mr.getState().addHistory({themeSettings:i}),{themeSettings:{...o.themeSettings,inputs:{...o.themeSettings.inputs,[n]:{...o.themeSettings.inputs[n],[a]:r}}}}}),isLoadingThemeSettings:!1,setIsLoadingThemeSettings:n=>e(()=>({isLoadingThemeSettings:n}))})),Lg=Ut(nu(e=>({fonts:[],setFonts:t=>e(()=>({fonts:t}))}),{name:"fonts-storage"})),Ag=Ut(e=>({settings:null,setSettings:t=>e(()=>({settings:t})),isLoadingSettings:!0,setIsLoadingSettings:t=>e(()=>({isLoadingSettings:t}))})),Rg=Ut()(e=>({color:"default",initialColor:"",setInitialColor:t=>e(()=>({initialColor:t})),colorChange:()=>{},update:()=>{},activeLabel:null,modalPosition:{left:0,top:0},showModal:!1,dragging:!1,hue:0,saturation:100,brightness:100,alpha:100,isGradientActive:!0,isGradient:!1,setIsGradient:t=>e(()=>({isGradient:t})),gradientDirection:"vertical",setGradientDirection:t=>e(()=>({gradientDirection:t})),hue2:0,saturation2:100,brightness2:100,alpha2:100,setHue2:t=>e(()=>({hue2:t})),setSaturation2:t=>e(()=>({saturation2:t})),setBrightness2:t=>e(()=>({brightness2:t})),setAlpha2:t=>e(()=>({alpha2:t})),activeColorIndex:1,setActiveColorIndex:t=>e(()=>({activeColorIndex:t})),setModalPosition:t=>e(()=>({modalPosition:t})),setHue:t=>e(()=>({hue:t})),setSaturation:t=>e(()=>({saturation:t})),setBrightness:t=>e(()=>({brightness:t})),setShowModal:t=>e(()=>({showModal:t})),setDragging:t=>e(()=>({dragging:t})),setActiveLabel:t=>e(()=>({activeLabel:t})),setColor:t=>e(()=>({color:t})),setUpdate:t=>e(()=>({update:t})),setColorChange:t=>e(()=>({colorChange:t})),setAlpha:t=>e(()=>({alpha:t})),setIsGradientActive:t=>e(()=>({isGradientActive:t})),resetColors:()=>e(()=>({color:"default",initialColor:"",activeLabel:null,modalPosition:{left:0,top:0},showModal:!1,dragging:!1,hue:0,saturation:100,brightness:100,alpha:100,isGradient:!1,gradientDirection:"vertical",hue2:0,saturation2:100,brightness2:100,alpha2:100,activeColorIndex:1,isGradientActive:!0}))})),Md=Ut(nu((e,t)=>({pages:null,currentPage:"",setPages:n=>e(()=>({pages:n})),pageContext:{listings:null,products:null,reviews:null,categories:null,faqs:null,general:null,fullPosts:null,posts:null},isOpenModal:!1,isOpenSelectModal:!1,isEdit:!1,editedPage:null,setEditedPage:n=>e(()=>({editedPage:n})),setCurrentPage:n=>e(()=>({currentPage:n})),setPageContext:n=>e(()=>({pageContext:n})),setIsOpenModal:n=>e(()=>({isOpenModal:n})),setIsOpenSelectModal:n=>e(()=>({isOpenSelectModal:n})),setIsEdit:n=>e(()=>({isEdit:n})),createPage:n=>{const r=t().pages,a=yi();if(r)r[a]=n,e({pages:r});else{const o=t().setPages;o({});const i=t().pages;i[a]=n,e({pages:i})}},updatePage:(n,r)=>{const a=t().pages;a&&(a[n]={...r},e({pages:a}))},deletePage:n=>{const r=t().pages;r&&(delete r[n],e({pages:r}))}}),{name:"pages-storage",partialize:e=>{const{pages:t,pageContext:n}=e;return{pages:t,pageContext:n}}})),Bd=Ut(e=>({openModal:!1,setOpenModal:t=>e(()=>({openModal:t})),onChange:null,setOnChange:t=>e(()=>({onChange:t})),tip:"",setTip:t=>e(()=>({tip:t}))})),mr=Ut((e,t)=>({past:[],future:[],addHistory:n=>{e(r=>({past:[...r.past,n],future:[]}))},undo:()=>{const{past:n,future:r}=t();if(n.length===0)return;const a=n[n.length-1],o=n.slice(0,-1),i={themeSettings:xo.getState().themeSettings,layers:hs.getState().blocks};e({past:o,future:[i,...r]}),a.themeSettings&&xo.setState({themeSettings:a.themeSettings}),a.layers&&hs.setState({blocks:a.layers})},redo:()=>{const{past:n,future:r}=t();if(r.length===0)return;const a=r[0],o=r.slice(1),i={themeSettings:xo.getState().themeSettings,layers:hs.getState().blocks};e({past:[...n,i],future:o}),a.themeSettings&&xo.setState({themeSettings:a.themeSettings}),a.layers&&hs.setState({blocks:a.layers})}})),Dg=Ut(e=>({isOpenModal:!1,setIsOpenModal:t=>e(()=>({isOpenModal:t}))})),fs=Ut(e=>({notification:null,setNotification:t=>e(()=>({notification:t}))})),Og=Ut(e=>({error:null,setError:t=>e(()=>({error:t}))})),Ig=Ut(e=>({title:null,description:null,onConfirm:null,setTitle:t=>e(()=>({title:t})),setDescription:t=>e(()=>({description:t})),setOnConfirm:t=>e(()=>({onConfirm:t}))})),Mg=Ut(e=>({showTooltip:!1,setShowTooltip:t=>e({showTooltip:t})})),Fd=Ut(e=>({isOpen:!0,setIsOpen:t=>e(()=>({isOpen:t}))})),Bg=Ut(e=>({general:null,setGeneral:t=>e(()=>({general:t}))})),Fg="_icon_bsuj2_1",Hg="_hoverable_bsuj2_5",$g="_rotated_bsuj2_9",$f={icon:Fg,hoverable:Hg,rotated:$g};var y2={exports:{}};/*!
62
62
  Copyright (c) 2018 Jed Watson.
63
63
  Licensed under the MIT License (MIT), see
64
64
  http://jedwatson.github.io/classnames
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./builder.cjs.js"),t=require("./index-B_WMDkcu.cjs");exports.App=e.App;exports.ColorVariables=e.ColorVariables;exports.createTicket=e.createTicket;exports.hotReload=e.hotReload;exports.iconNames=e.iconNames;exports.ReCaptchaProvider=t.Z2;exports.splitTextIntoSpans=t.splitTextIntoSpans;exports.useReCaptcha=t.bi;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./builder.cjs.js"),t=require("./index-DUvsY_aL.cjs");exports.App=e.App;exports.ColorVariables=e.ColorVariables;exports.createTicket=e.createTicket;exports.hotReload=e.hotReload;exports.iconNames=e.iconNames;exports.ReCaptchaProvider=t.Z2;exports.splitTextIntoSpans=t.splitTextIntoSpans;exports.useReCaptcha=t.bi;
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { App as o, ColorVariables as t, createTicket as r, hotReload as s, iconNames as p } from "./builder.es.js";
2
- import { Z as i, s as l, b as h } from "./index-VdHBtEiJ.js";
2
+ import { Z as i, s as l, b as h } from "./index-BpuklKXj.js";
3
3
  export {
4
4
  o as App,
5
5
  t as ColorVariables,
package/dist/ui.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-B_WMDkcu.cjs"),j=require("react");require("@phosphor-icons/react");const ct="_wrapper_1vmyb_2",lt="_alignmentBlock_1vmyb_8",ut="_title_1vmyb_15",dt="_subtitle_1vmyb_22",xt="_alignmentContent_1vmyb_29",mt="_alignments_1vmyb_37",pt="_alignment_1vmyb_8",jt="_circle_1vmyb_60",ht="_paddings_1vmyb_67",_t="_padding_1vmyb_67",gt="_active_1vmyb_91",ft="_input_1vmyb_98",F={wrapper:ct,alignmentBlock:lt,title:ut,subtitle:dt,alignmentContent:xt,alignments:mt,alignment:pt,circle:jt,paddings:ht,padding:_t,active:gt,input:ft},Et=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],Rt=["left","top","right","bottom"],bt=l=>{const{alignment:n,padding:e,setPadding:s,setAlignment:i}=l;function u(a){switch(a){case"left":case"topLeft":case"bottomLeft":return"TextAlignLeft";case"right":case"topRight":case"bottomRight":return"TextAlignRight";case"center":case"top":case"bottom":return"TextAlignCenter";default:return"TextAlignCenter"}}function d(a){switch(a){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}const[o,x]=j.useState(null),[h,S]=j.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:F.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:F.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:F.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:F.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:F.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:F.alignments,children:Et.map(a=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{i(a)},className:F.alignment,onMouseEnter:()=>{x(a)},onMouseLeave:()=>{x(null)},children:[a!==n&&o!==a&&t.jsxRuntimeExports.jsx("div",{className:F.circle}),a!==n&&o===a&&t.jsxRuntimeExports.jsx(t.Icon,{name:u(o),fill:"#c2c2c2",width:22,height:22}),a===n&&t.jsxRuntimeExports.jsx(t.Icon,{name:u(n),fill:"#FF3F19",width:22,height:22})]},a))}),t.jsxRuntimeExports.jsx("div",{className:F.paddings,children:Rt.map(a=>t.jsxRuntimeExports.jsxs("label",{className:t.clx(F.padding,{[F.active]:h===a}),onFocus:()=>{S(a)},onBlur:()=>{S(null)},children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:d(a),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(e[a]),onChange:c=>s({...e,[a]:Math.min(Number(c),999)}),max:999,paddingless:!0,borderless:!0})]},a))})]})]})]})},vt="_title_82zux_1",yt="_subtitle_82zux_5",It="_header_82zux_12",St="_text_82zux_13",Nt="_productsBlock_82zux_14",kt="_top_82zux_26",Ct="_itemsBlock_82zux_35",$t="_typeTexts_82zux_41",Bt="_block_82zux_48",wt="_active_82zux_61",Pt="_products_82zux_14",Mt="_product_82zux_14",Tt="_button_82zux_80",qt="_disabled_82zux_91",At="_image_82zux_95",Ot="_info_82zux_102",Lt="_name_82zux_114",Dt="_buttons_82zux_118",zt="_modal_82zux_125",Ut="_link_82zux_145",Ht="_modalOptions_82zux_151",Ft="_addButton_82zux_157",Vt="_deleteButton_82zux_179",V={title:vt,subtitle:yt,header:It,text:St,productsBlock:Nt,top:kt,itemsBlock:Ct,typeTexts:$t,block:Bt,active:wt,products:Pt,product:Mt,button:Tt,disabled:qt,image:At,info:Ot,name:Lt,buttons:Dt,modal:zt,link:Ut,modalOptions:Ht,addButton:Ft,deleteButton:Vt},Yt=l=>{const{isActiveItems:n,setIsActiveItems:e,items:s,setItems:i,other:u,title:d,subtitle:o,draggable:x=!1,withImage:h=!1,addable:S=!0,itemsOptions:a,hasRangeSelector:c=!1,rangeSelectorOptions:w,limit:k,autoScrollInterval:B,deletable:_}=l;function v(f){if(h)return f?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${f[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const r=(f,O=!1)=>{const N=a.find(I=>I.id===f);if(!N)return;const D=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[x&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Select,{onChange:I=>{const E=[...s],y=a.find(p=>p.name===I);if(!y)return;const P=y.id,C=E.map(p=>p===f?P:p);i([...C])},value:N.name,options:a.filter(I=>!s.find(E=>E===I.id)).map(I=>I.name),leftAddon:v(N.images)}),O&&t.jsxRuntimeExports.jsx("div",{className:V.buttons,children:t.jsxRuntimeExports.jsx("div",{className:V.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(I=>I!==f))})})})]});return t.jsxRuntimeExports.jsx("div",{className:V.product,children:D},f)};return t.jsxRuntimeExports.jsxs("div",{className:V.productsBlock,children:[(d||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:V.top,children:[d&&t.jsxRuntimeExports.jsx("h3",{className:V.title,children:d}),n!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:f=>e==null?void 0:e(f)})]}),c&&w&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...w}),t.jsxRuntimeExports.jsxs("div",{className:V.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:V.subtitle,children:o}),s.map(f=>r(f,_)),S&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center",gap:5},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(V.button,{[V.disabled]:!!(k&&k<=s.length||s.length===a.length)}),size:"s",disabled:!!(k&&k<=s.length||s.length===a.length),onClick:()=>{const f=[...s];let O=null;if(a){for(let N=0;N<a.length;N++)if(!s.find(D=>D===a[N].id)){O=a[N];break}}f.push((O==null?void 0:O.id)||a[0].id),i(f)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:V.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),u!==void 0&&t.jsxRuntimeExports.jsx(t.OtherSettings,{items:u}),B!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(B.scrollInterval),onChange:f=>B.setScrollInterval(Number(f)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},Gt="_title_roi3a_1",Wt="_subtitle_roi3a_5",Xt="_header_roi3a_12",Jt="_text_roi3a_13",Qt="_productsBlock_roi3a_14",Kt="_top_roi3a_26",Zt="_itemsBlock_roi3a_35",te="_typeTexts_roi3a_41",ee="_block_roi3a_48",se="_active_roi3a_61",ne="_products_roi3a_14",ie="_product_roi3a_14",oe="_button_roi3a_80",re="_disabled_roi3a_91",ae="_image_roi3a_95",ce="_info_roi3a_102",le="_name_roi3a_114",ue="_buttons_roi3a_118",de="_modal_roi3a_125",xe="_link_roi3a_145",me="_modalOptions_roi3a_151",pe="_addButton_roi3a_164",je="_deleteButton_roi3a_179",he="_closeIcon_roi3a_191",U={title:Gt,subtitle:Wt,header:Xt,text:Jt,productsBlock:Qt,top:Kt,itemsBlock:Zt,typeTexts:te,block:ee,active:se,products:ne,product:ie,button:oe,disabled:re,image:ae,info:ce,name:le,buttons:ue,modal:de,link:xe,modalOptions:me,addButton:pe,deleteButton:je,closeIcon:he};function _e({product:l,children:n}){const{attributes:e,listeners:s,setNodeRef:i,transform:u,transition:d,isDragging:o}=t.useSortable({id:l.id}),x={transform:t.CSS.Transform.toString(u),transition:d};return t.jsxRuntimeExports.jsx("div",{ref:i,style:x,className:`${U.product} ${o?U.dragging:""}`,...e,...s,children:n})}const ge=l=>{const{isActiveItems:n,setIsActiveItems:e,items:s,setItems:i,title:u,subtitle:d,editable:o=!0,draggable:x=!1,deletable:h=!0,addable:S=!0,itemsType:a,itemsOptions:c,addableOptions:w={},limit:k}=l,[B,_]=j.useState(null),[v,r]=j.useState(null),f=j.useRef(null),O=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));j.useEffect(()=>{if(B){const E=[...s].map(y=>y.id===B.id?B:y);i(E)}},[B]),j.useEffect(()=>{f.current&&v&&(f.current.getBoundingClientRect().height,v.top)},[f.current,v]);const N=(E,y)=>{E.stopPropagation();const P=E.target.getBoundingClientRect();r({top:P.top+window.scrollY,left:P.left-30}),_(y)},D=E=>{const{active:y,over:P}=E;if(P&&y.id!==P.id){const C=s.findIndex(g=>g.id===y.id),p=s.findIndex(g=>g.id===P.id);if(C!==-1&&p!==-1){const g=[...s],[M]=g.splice(C,1);g.splice(p,0,M),i(g)}}},I=(E,y)=>{const P=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[x&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),a==="select"&&c&&t.jsxRuntimeExports.jsx(t.Select,{onChange:C=>{const p=[...s],g=c.find(z=>z.name===C);if(!g)return;const M=p.map(z=>z.id===E.id?{...g,name:{"en-US":C}}:z);_({...E,name:{"en-US":C}}),i([...M])},value:E.name,options:c.filter(C=>!s.find(p=>p.name===C.name)).map(C=>C.name)}),t.jsxRuntimeExports.jsxs("div",{className:U.buttons,children:[o&&t.jsxRuntimeExports.jsx("div",{className:U.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:C=>N(C,E)})}),h&&t.jsxRuntimeExports.jsx("div",{className:U.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(C=>C.id!==E.id))})})]})]});return x?t.jsxRuntimeExports.jsx(_e,{product:E,index:y,children:P},E.id):t.jsxRuntimeExports.jsx("div",{className:U.product,children:P},E.id)};return t.jsxRuntimeExports.jsxs("div",{className:U.productsBlock,children:[(u||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:U.top,children:[u&&t.jsxRuntimeExports.jsx("h3",{className:U.title,children:u}),n!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:E=>e==null?void 0:e(E)})]}),t.jsxRuntimeExports.jsxs("div",{className:U.products,children:[d&&t.jsxRuntimeExports.jsx("h5",{className:U.subtitle,children:d}),x?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:O,onDragEnd:D,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(E=>E.id),strategy:t.verticalListSortingStrategy,children:s.map((E,y)=>I(E,y))})}):s.map((E,y)=>I(E,y)),S&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(U.button,{[U.disabled]:!!(k&&k<=s.length||s.length===(c==null?void 0:c.length))}),size:"s",disabled:!!(k&&k<=s.length||s.length===(c==null?void 0:c.length)),onClick:()=>{const E=[...s];let y=null;if(c){for(let P=0;P<c.length;P++)if(!s.find(C=>C.id===c[P].id)){y=c[P];break}}a==="select"&&c&&E.push({name:y?y.name:c[0].name,id:(y==null?void 0:y.id)||c[0].id,...w}),i(E)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:U.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})]})};function fe(l){const{product:n,children:e}=l,{attributes:s,listeners:i,setNodeRef:u,transform:d,transition:o,isDragging:x}=t.useSortable({id:n.id}),h={transform:t.CSS.Transform.toString(d),transition:o};return t.jsxRuntimeExports.jsx("div",{ref:u,style:h,className:`${t.styles.product} ${x?t.styles.dragging:""}`,...s,...i,children:e})}const Ee=l=>{const{isActiveItems:n,setIsActiveItems:e,items:s,setItems:i,other:u,title:d,subtitle:o,editable:x=!0,draggable:h=!1,withImage:S=!1,deletable:a=!0,addable:c=!0,itemsType:w,itemsPlaceholder:k="",itemsOptions:B,hasRangeSelector:_=!1,rangeSelectorOptions:v,modalOptions:r,addableOptions:f={},limit:O}=l,[N,D]=j.useState(null),[I,E]=j.useState({top:0,left:0}),[y,P]=j.useState(null),C=j.useRef(null),[p,g]=j.useState(!1),M=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));j.useEffect(()=>{const m=()=>{D(null),g(!1)};return document.body.addEventListener("click",m),D(null),g(!1),()=>{D(null),g(!1),document.body.removeEventListener("click",m)}},[]),j.useEffect(()=>{if(N){const m=[...s].map(q=>q.id===N.id?N:q);i(m)}},[N]),j.useEffect(()=>{if(C.current&&y){const m=C.current.getBoundingClientRect().height,q=window.innerHeight;let $=y.top;$+m>q+window.scrollY-200&&($=q+window.scrollY-m-200),$<0&&($=10),E({top:$,left:y.left})}},[C.current,y]);const z=(m,q)=>{m.stopPropagation();const $=m.target.getBoundingClientRect();P({top:$.top+window.scrollY,left:$.left-30}),D(q),g(!0)};function T(m){if(S)return m?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${m[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const L=m=>{const{active:q,over:$}=m;if($&&q.id!==$.id){const A=s.findIndex(H=>H.id===q.id),J=s.findIndex(H=>H.id===$.id);if(A!==-1&&J!==-1){const H=[...s],[Y]=H.splice(A,1);H.splice(J,0,Y),i(H)}}},G=m=>{var $;const q=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[h&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),w==="select"&&B&&t.jsxRuntimeExports.jsx(t.Select,{onChange:A=>{const H=[...s].map(Y=>Y.id===m.id?{...m,name:{"en-US":A}}:Y);D({...m,name:{"en-US":A}}),i([...H])},value:m.name["en-US"],options:B.filter(A=>!s.find(J=>J.name["en-US"]===A)),leftAddon:T(m.images)}),w==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:A=>{const H=[...s].map(Y=>Y.id===m.id?{...m,name:{"en-US":A}}:Y);i([...H])},value:m.name["en-US"],placeholder:k}),w==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:A=>{const H=[...s].map(Y=>Y.id===m.id?{...m,images:A}:Y);i([...H])},activeImage:($=s.find(A=>A.id===m.id))==null?void 0:$.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.buttons,children:[x&&t.jsxRuntimeExports.jsx("div",{className:t.styles.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:A=>z(A,m)})}),a&&t.jsxRuntimeExports.jsx("div",{className:t.styles.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(A=>A.id!==m.id))})})]})]});return h?t.jsxRuntimeExports.jsx(fe,{product:m,children:q},m.id):t.jsxRuntimeExports.jsx("div",{className:t.styles.product,children:q},m.id)};return t.jsxRuntimeExports.jsxs("div",{className:t.styles.productsBlock,children:[(d||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles.top,children:[d&&t.jsxRuntimeExports.jsx("h3",{className:t.styles.title,children:d}),n!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:m=>e==null?void 0:e(m)})]}),N&&x&&r&&p&&t.jsxRuntimeExports.jsx(t.ItemPopup,{ref:C,activeItem:N,setActiveItem:D,popupPosition:I,modalOptions:r,setIsOpenModal:g}),_&&v&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...v}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:t.styles.subtitle,children:o}),h?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:M,onDragEnd:L,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(m=>m.id),strategy:t.verticalListSortingStrategy,children:s.map(m=>G(m))})}):s.map(m=>G(m)),c&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(t.styles.button,{[t.styles.disabled]:!!(O&&O<=s.length)}),size:"s",disabled:!!(O&&O<=s.length),onClick:()=>{const m=[...s];let q=null;if(B){for(let $=0;$<B.length;$++)if(!s.find(A=>A.name["en-US"]===B[$])){q=B[$];break}}w==="select"&&B?m.push({name:{"en-US":q||B[0]},id:t.v4(),...f,maxSymbols:100}):w==="input"?m.push({name:{"en-US":""},id:t.v4(),...f,maxSymbols:100}):m.push({name:{"en-US":`Image ${s.length+1}`},id:t.v4(),...f,maxSymbols:100}),i(m)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:t.styles.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),u!==void 0&&t.jsxRuntimeExports.jsx(t.OtherSettings,{items:u})]})},Re="_subtitle_jql1y_1",be="_header_jql1y_8",ve="_text_jql1y_9",ye="_productsBlock_jql1y_10",Ie="_buttonsBlock_jql1y_11",Se="_top_jql1y_23",Ne="_itemsBlock_jql1y_32",ke="_typeTexts_jql1y_38",Ce="_block_jql1y_45",$e="_active_jql1y_58",Be="_products_jql1y_10",we="_product_jql1y_10",Pe="_button_jql1y_11",Me="_image_jql1y_88",Te="_info_jql1y_95",qe="_name_jql1y_107",Ae="_buttons_jql1y_11",Oe="_modal_jql1y_118",Le="_other_jql1y_138",De="_options_jql1y_144",ze="_addButton_jql1y_150",Ue="_deleteButton_jql1y_165",W={subtitle:Re,header:be,text:ve,productsBlock:ye,buttonsBlock:Ie,top:Se,itemsBlock:Ne,typeTexts:ke,block:Ce,active:$e,products:Be,product:we,button:Pe,image:Me,info:Te,name:qe,buttons:Ae,modal:Oe,other:Le,options:De,addButton:ze,deleteButton:Ue},et=l=>{const{buttons:n,setButtons:e,deletable:s=!0,addable:i=!0,editableLink:u=!0}=l,{pages:d}=t.usePagesStore(),[o,x]=j.useState(null),[h,S]=j.useState({top:0,left:0}),[a,c]=j.useState(null),w=j.useRef(null);j.useEffect(()=>{if(o){const _=[...n].map(v=>v.id===o.id?o:v);e(_)}},[o]),j.useEffect(()=>{if(w.current&&a){const _=w.current.getBoundingClientRect().height,v=window.innerHeight;let r=a.top;r+_>v+window.scrollY-200&&(r=v+window.scrollY-_-200),r<0&&(r=10),S({top:r,left:a.left})}},[w.current,a]);const k=(_,v)=>{_.stopPropagation();const r=_.target.getBoundingClientRect();c({top:r.top+window.scrollY-70,left:r.left-(i?30:65)}),x(v)},B=(_,v)=>{const r=[...n],f={..._,id:Math.random().toString(36).substr(2,9)};r.splice(v+1,0,f),e(r)};return t.jsxRuntimeExports.jsxs("div",{className:W.products,children:[t.jsxRuntimeExports.jsx("h5",{className:W.subtitle,children:"Button Type"}),n.map((_,v)=>t.jsxRuntimeExports.jsxs("div",{className:W.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:r=>{const O=[...n].map(N=>N.id===_.id?{..._,type:r}:N);e(O)},value:_.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:W.buttons,children:[t.jsxRuntimeExports.jsx("div",{className:W.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy",hoverable:!0,width:20,height:20,onClick:()=>{B(_,v)}})}),t.jsxRuntimeExports.jsx("div",{className:W.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:r=>{k(r,_)}})}),s&&t.jsxRuntimeExports.jsx("div",{className:W.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const r=n.filter(f=>f.id!==_.id);e(r)},width:20,height:20,fill:"#C12A2A"})})]})]},_.id)),o&&t.jsxRuntimeExports.jsx(t.ButtonPopup,{ref:w,activeButton:o,setActiveButton:x,popupPosition:h,editableLink:u}),i&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:W.button,size:"s",onClick:()=>{const _=[...n];u?_.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Button Name"},destination:"Go to Page",page:d?Object.values(d)[0].name:"Home",openInNewTab:!1}):_.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Create Ticket"},destination:"Go to Page",page:d?Object.values(d)[0].name:"Home",openInNewTab:!1}),e(_)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:W.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})},He=l=>{const{isActiveButtons:n,setIsActiveButtons:e,buttons:s,setButtons:i,editableLink:u=!0,addable:d=!0,deletable:o=!0}=l;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:t.styles$1.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:t.styles$1.top,children:[t.jsxRuntimeExports.jsx("h3",{className:t.styles$1.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:x=>e(x)})]}),n&&t.jsxRuntimeExports.jsx(et,{buttons:s,setButtons:i,editableLink:u,addable:d,deletable:o})]})})};function Fe(l){const{product:n,children:e}=l,{attributes:s,listeners:i,setNodeRef:u,transform:d,transition:o,isDragging:x}=t.useSortable({id:String(n.listingId)}),h={transform:t.CSS.Transform.toString(d),transition:o};return t.jsxRuntimeExports.jsx("div",{ref:u,style:h,className:`${t.styles$2.product} ${x?t.styles$2.dragging:""}`,...s,...i,children:e})}const Ve=l=>{const{isActiveItems:n,setIsActiveItems:e,items:s,setItems:i,other:u,title:d,subtitle:o,editable:x=!0,draggable:h=!1,withImage:S=!1,deletable:a=!0,addable:c=!0,itemsType:w,itemsOptions:k,limit:B}=l,[_,v]=j.useState(null),[r,f]=j.useState({top:0,left:0}),[O,N]=j.useState(!1),D=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));j.useEffect(()=>{const p=()=>{v(null),N(!1)};return document.body.addEventListener("click",p),v(null),N(!1),()=>{v(null),N(!1),document.body.removeEventListener("click",p)}},[]),j.useEffect(()=>{if(_){const p=[...s].map(g=>g.listingId===_.listingId?_:g);i(p)}},[_]);const I=(p,g)=>{p.stopPropagation();const M=p.target.getBoundingClientRect(),z=100,T=window.innerHeight;let L=M.top+window.scrollY;L+z>T&&(L=T-z-20),N(!0),f({top:L-80,left:M.left-30}),v(g)};function E(p){if(S)return p?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${p}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const y=p=>{const{active:g,over:M}=p;if(M&&g.id!==M.id){const z=s.findIndex(L=>String(L.listingId)===g.id),T=s.findIndex(L=>String(L.listingId)===M.id);if(z!==-1&&T!==-1){const L=[...s],[G]=L.splice(z,1);L.splice(T,0,G),i(L)}}},P=(p,g)=>{const M=k.find(T=>p.listingId===T.id);if(!M)return null;const z=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[h&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),w==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:T=>{const L=[...s],G=k.find($=>$.productData.name===T);if(!G)return;const m={listingId:G.id,image:G.productData.images.length>0?G.productData.images[0].cfId:""},q=L.map($=>$.listingId===p.listingId?m:$);v(m),i([...q])},value:M.productData.name,options:[...k.filter(T=>!s.find(L=>L.listingId===T.id)).map(T=>T.productData.name)],leftAddon:E(p.image||M.productData.images.length>0&&M.productData.images[0].cfId||"")},g),t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.buttons,children:[x&&t.jsxRuntimeExports.jsx("div",{className:t.styles$2.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:T=>I(T,p)})}),a&&t.jsxRuntimeExports.jsx("div",{className:t.styles$2.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(T=>T!==p))})})]})]});return h?t.jsxRuntimeExports.jsx(Fe,{product:p,children:z},p.listingId):t.jsxRuntimeExports.jsx("div",{className:t.styles$2.product,children:z},p.listingId)},C=j.useRef(null);return t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.productsBlock,children:[(d||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.top,children:[d&&t.jsxRuntimeExports.jsx("h3",{className:t.styles$2.title,children:d}),n!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:p=>e==null?void 0:e(p)})]}),O&&_&&t.jsxRuntimeExports.jsx(t.ListingPopup,{ref:C,activeItem:_,setActiveItem:v,setIsOpenModal:N,popupPosition:r,itemsOptions:k}),n&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:t.styles$2.subtitle,children:o}),h?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:D,onDragEnd:y,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(p=>String(p.listingId)),strategy:t.verticalListSortingStrategy,children:s.map((p,g)=>P(p,g))})}):s.map((p,g)=>P(p,g)),c&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.styles$2.button,size:"s",onClick:()=>{const p=[...s];for(let g=0;g<k.length;g++)if(!s.find(M=>M.listingId===k[g].id)){p.push({listingId:k[g].id,image:k[g].productData.images.length>0?k[g].productData.images[0].cfId:""});break}i(p)},disabled:s.length===(B||k.length),style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),n&&u!==void 0&&t.jsxRuntimeExports.jsx(t.OtherSettings,{items:u})]})},Ye="_options_6cemk_1",Ge="_price_6cemk_12",We="_oldPrice_6cemk_19",Xe="_newPrice_6cemk_27",Je="_animate_6cemk_34",Qe="_appearAndBounce_6cemk_1",Ke="_meta_6cemk_52",Ze="_info_6cemk_58",ts="_infoRight_6cemk_66",es="_buttons_6cemk_73",ss="_variants_6cemk_80",ns="_variant_6cemk_80",is="_stock_6cemk_98",os="_variantInfo_6cemk_105",rs="_quantity_6cemk_111",as="_count_6cemk_118",cs="_focused_6cemk_135",ls="_button_6cemk_73",us="_activeVariant_6cemk_161",ds="_chargeTypes_6cemk_165",xs="_charge_6cemk_165",ms="_chargeActive_6cemk_190",ps="_title_6cemk_198",b={options:Ye,price:Ge,oldPrice:We,newPrice:Xe,animate:Je,appearAndBounce:Qe,meta:Ke,info:Ze,infoRight:ts,buttons:es,variants:ss,variant:ns,stock:is,variantInfo:os,quantity:rs,count:as,focused:cs,button:ls,activeVariant:us,chargeTypes:ds,charge:xs,chargeActive:ms,title:ps};var st=(l=>(l.ONE_TIME="One-Time",l.RECURRING="Subscribe & Save",l))(st||{});const js=l=>{var _,v;const{variants:n}=l,[e,s]=j.useState(n[0]),[i,u]=j.useState(e.chargeTypes[0]),d=t.useNavigate(),[o,x]=j.useState(1),{reset:h,addProductToCart:S}=t.di(),[a,c]=j.useState(!1);j.useEffect(()=>{c(!0);const r=setTimeout(()=>c(!1),600);return()=>clearTimeout(r)},[o]);async function w(){await S({productId:l.id,productVariantId:e.id,quantity:o})}function k(){h(),w(),d("/checkout")}function B(r){if(r>=864e5){const I=Math.floor(r/864e5);return`${I} ${I===1?"day":"days"}`}else if(r>=36e5){const I=Math.floor(r/36e5);return`${I} ${I===1?"hour":"hours"}`}else if(r>=6e4){const I=Math.floor(r/6e4);return`${I} ${I===1?"minute":"minutes"}`}else{const I=Math.floor(r/1e3);return`${I} ${I===1?"second":"seconds"}`}}return j.useEffect(()=>{(e.quantity.available===0||!e.quantity.available)&&x(0)},[e.quantity.available]),t.jsxRuntimeExports.jsxs("div",{className:b.options,children:[e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:b.chargeTypes,children:e.chargeTypes.map(r=>t.jsxRuntimeExports.jsx("div",{className:t.clx(b.charge,{[b.chargeActive]:i===r}),onClick:()=>u(r),children:st[r]},r))}),t.jsxRuntimeExports.jsx("div",{className:b.variants,children:n.map(r=>{var f;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(b.variant,{[b.activeVariant]:e.id===r.id}),onClick:()=>s(r),children:[t.jsxRuntimeExports.jsxs("div",{className:b.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:b.title,children:r.name}),t.jsxRuntimeExports.jsxs("span",{children:["$",i==="ONE_TIME"?r.price.amount:r.subscriptionSettings?r.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:i==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:b.stock,children:[((f=r.quantity.restrictions)==null?void 0:f.max)||r.quantity.available||0," in stock"]})})]},r.id)})}),i==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:b.quantity,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{o>1?x(r=>r-1):x(1)},className:b.button,disabled:e.quantity.available===0||e.quantity.restrictions&&o<=e.quantity.restrictions.min||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx(t.Input$1,{type:"number",value:String(o),onChange:r=>x(Number(r)),max:((_=e.quantity.restrictions)==null?void 0:_.max)||e.quantity.available||1/0,min:((v=e.quantity.restrictions)==null?void 0:v.min)||0,centered:!0,disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{x(r=>r+1)},className:b.button,disabled:!!(e.quantity.restrictions&&o>=e.quantity.restrictions.max||e.quantity.available!==void 0&&o>=e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:b.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:b.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:b.infoRight,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lightning",fill:"#FF3F19",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{children:!e.deliveryTime||e.deliveryTime===0?"Instant":B(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:b.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:b.infoRight,children:i==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:b.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(b.newPrice,{[b.animate]:a}),children:["$ ",(e.price.amount||0)*o]}),t.jsxRuntimeExports.jsxs("span",{className:b.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*o]})]}):t.jsxRuntimeExports.jsxs("span",{className:t.clx(b.newPrice,{[b.animate]:a}),children:["$ ",(e.price.amount||0)*o]}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:b.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(b.newPrice,{[b.animate]:a}),children:["$ ",e.subscriptionSettings.price.amount||0]}),t.jsxRuntimeExports.jsxs("span",{className:b.oldPrice,children:["$ ",e.subscriptionSettings.compareAtPrice.amount||0]})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsxs("span",{className:t.clx(b.newPrice,{[b.animate]:a}),children:["$ ",e.subscriptionSettings.price.amount||0]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:b.buttons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:()=>k(),disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:i==="ONE_TIME"?"Buy Now":"Subscribe Now"}),i==="ONE_TIME"&&t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>w(),disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:"Add to Cart"})]})]})},hs="_button_1tdo3_1",_s="_login_1tdo3_14",gs="_signUp_1tdo3_18",fs="_buttons_1tdo3_23",Es="_modal_1tdo3_32",Rs="_closing_1tdo3_64",bs="_info_1tdo3_113",vs="_top_1tdo3_120",ys="_title_1tdo3_131",Is="_clear_1tdo3_138",Ss="_activeClear_1tdo3_145",Ns="_count_1tdo3_149",ks="_cart_1tdo3_164",Cs="_empty_1tdo3_172",$s="_product_1tdo3_198",Bs="_products_1tdo3_207",ws="_image_1tdo3_215",Ps="_productInfo_1tdo3_221",Ms="_content_1tdo3_228",Ts="_name_1tdo3_234",qs="_price_1tdo3_240",As="_productButtons_1tdo3_246",Os="_productButton_1tdo3_246",Ls="_productCount_1tdo3_266",Ds="_bottom_1tdo3_282",zs="_subtotal_1tdo3_290",Us="_block_1tdo3_298",Hs="_shoppingCount_1tdo3_305",Fs="_total_1tdo3_325",Vs="_link_1tdo3_331",Ys="_userInfo_1tdo3_338",Gs="_pagesMobileModal_1tdo3_349",Ws="_pagesMobileModalContent_1tdo3_363",Xs="_pagesMobileModalHeader_1tdo3_369",Js="_pagesMobileModalFooter_1tdo3_379",R={button:hs,login:_s,signUp:gs,buttons:fs,modal:Es,"slide-in-fade":"_slide-in-fade_1tdo3_1","mobile-slide-in-fade":"_mobile-slide-in-fade_1tdo3_1",closing:Rs,"mobile-slide-out-fade":"_mobile-slide-out-fade_1tdo3_1","slide-out-fade":"_slide-out-fade_1tdo3_1",info:bs,top:vs,title:ys,clear:Is,activeClear:Ss,count:Ns,cart:ks,empty:Cs,product:$s,products:Bs,image:ws,productInfo:Ps,content:Ms,name:Ts,price:qs,productButtons:As,productButton:Os,productCount:Ls,bottom:Ds,subtotal:zs,block:Us,shoppingCount:Hs,total:Fs,link:Vs,userInfo:Ys,pagesMobileModal:Gs,pagesMobileModalContent:Ws,pagesMobileModalHeader:Xs,pagesMobileModalFooter:Js},Qs=l=>{const{shopping:n,signUp:e,isShowUserInfo:s=!0}=l;return t.jsxRuntimeExports.jsxs("div",{className:R.buttons,children:[n&&t.jsxRuntimeExports.jsx(nt,{}),s&&t.jsxRuntimeExports.jsx(tt,{signUp:e})]})},nt=()=>{const[l,n]=j.useState(!1),[e,s]=j.useState([]),{cart:i}=t.di();function u(h){var S;return!h||!(h!=null&&h.variants)?!1:(S=h.variants.find(a=>a.id===h.activeVariantId))==null?void 0:S.subscriptionSettings}const d=i.parts.length>0&&e.length>0&&!u(e[0]),[o,x]=j.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",style:{padding:10},onClick:h=>{h.stopPropagation(),window.location.pathname.includes("/admin/builder")||(n(!0),x(!0))},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-primary)"}),d&&t.jsxRuntimeExports.jsx("div",{className:R.shoppingCount,children:i.parts.length})]}),l&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>{x(!1),setTimeout(()=>{n(!1)},300)},withAnimation:!1,children:t.jsxRuntimeExports.jsx(it,{activeProducts:e,isCartNotEmpty:d,isOpen:o})})]})},it=l=>{const{activeProducts:n,isCartNotEmpty:e,isOpen:s}=l,{cart:i,reset:u,getTotalAndDiscount:d,updateQuantityOfProduct:o}=t.di(),x=t.useNavigate();function h(c){x(c)}function S(c){o({productId:c.id,productVariantId:c.activeVariantId,quantity:c.quantity+1})}function a(c){o({productId:c.id,productVariantId:c.activeVariantId,quantity:c.quantity-1})}return t.jsxRuntimeExports.jsxs("div",{className:t.clx(R.modal,{[R.closing]:!s}),onClick:c=>c.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:R.top,children:[t.jsxRuntimeExports.jsxs("div",{className:R.info,children:[t.jsxRuntimeExports.jsx("span",{className:R.title,children:"Cart"}),e&&t.jsxRuntimeExports.jsx("div",{className:R.count,children:i.parts.length})]}),t.jsxRuntimeExports.jsx("button",{className:t.clx(R.clear,{[R.activeClear]:e}),disabled:!e,onClick:u,children:"Clear all"})]}),e?t.jsxRuntimeExports.jsxs("div",{className:R.cart,children:[t.jsxRuntimeExports.jsx("div",{className:R.products,children:n.map(c=>t.jsxRuntimeExports.jsxs("div",{className:R.product,children:[t.jsxRuntimeExports.jsxs("div",{className:R.productInfo,children:[t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${c.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:R.image}),t.jsxRuntimeExports.jsxs("div",{className:R.content,children:[t.jsxRuntimeExports.jsx("div",{className:R.name,children:c.name}),t.jsxRuntimeExports.jsxs("div",{className:R.price,children:["$",c.variants.find(w=>w.id===c.activeVariantId).price.amount*((c==null?void 0:c.quantity)||1)]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:R.productButtons,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{c.quantity!==1&&a(c)},className:R.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:R.productCount,children:c.quantity}),t.jsxRuntimeExports.jsx("div",{onClick:()=>S(c),className:R.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},c.id))}),t.jsxRuntimeExports.jsxs("div",{className:R.bottom,children:[t.jsxRuntimeExports.jsxs("div",{className:R.subtotal,children:[t.jsxRuntimeExports.jsxs("div",{className:R.block,children:[t.jsxRuntimeExports.jsx("span",{children:"Subtotal"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Info",width:20,height:20,fill:"#757575"})]}),t.jsxRuntimeExports.jsxs("div",{className:R.total,children:["$",d().total]})]}),t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>h("/checkout"),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(ot,{})]})},ot=()=>t.jsxRuntimeExports.jsxs("div",{className:R.empty,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-secondary)"})}),t.jsxRuntimeExports.jsx("span",{children:"Empty Cart"}),t.jsxRuntimeExports.jsxs("span",{children:["You don’t have any items in your shopping cart yet,"," ",t.jsxRuntimeExports.jsx("a",{href:"/products",className:R.link,children:"view products"})]})]}),tt=({signUp:l,close:n})=>{const e=JSON.parse(localStorage.getItem("token")||"{}"),{data:s}=e,i=t.useNavigate();function u(x){window.location.pathname.includes("/admin/builder")||i(x)}if(!s)return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>{u("/customer-dash"),n==null||n()},type:"Secondary",style:{padding:10},children:"Login"}),l&&t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>{u("/customer-dash"),n==null||n()},type:"Primary",style:{padding:10,whiteSpace:"nowrap"},children:"Sign Up"})]});const[d,o]=j.useState("test-email@gmail.com");return j.useEffect(()=>{(async()=>{const h=t.jwtDecode(s);o(h.email)})()},[s]),t.jsxRuntimeExports.jsx("div",{className:R.userInfo,onClick:()=>{u("/customer-dash"),n==null||n()},children:t.jsxRuntimeExports.jsx("div",{children:d||"test-email@gmail.com"})})},rt=({children:l,logo:n,setIsOpen:e,signUp:s})=>{const{setIsOpen:i}=t.useModalStore(),u=()=>{i(!1),setTimeout(()=>{e(!1),i(!0)},300)};return t.jsxRuntimeExports.jsxs("div",{className:R.pagesMobileModal,onClick:d=>d.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:R.pagesMobileModalHeader,children:[t.jsxRuntimeExports.jsx("div",{children:n}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:u,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"var(--icon-primary)"})})]}),t.jsxRuntimeExports.jsx("div",{className:R.pagesMobileModalContent,children:l}),t.jsxRuntimeExports.jsx("div",{className:R.pagesMobileModalFooter,children:t.jsxRuntimeExports.jsx(tt,{signUp:s,close:u})})]})},Ks=({children:l,logo:n,signUp:e})=>{const[s,i]=j.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(at,{setIsOpenModal:i}),s&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>i(!1),children:t.jsxRuntimeExports.jsx(rt,{logo:n,setIsOpen:i,signUp:e,children:l})})]})},at=l=>{const{setIsOpenModal:n}=l;return t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",style:{padding:10},onClick:e=>{e.stopPropagation(),n(!0)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"List",fill:"var(--icon-primary)"})})},Zs="_share_10urc_1",tn="_modal_10urc_9",en="_header_10urc_21",sn="_socials_10urc_31",nn="_social_10urc_31",on="_copy_10urc_41",rn="_title_10urc_48",an="_copyWrapper_10urc_54",cn="_copyText_10urc_63",ln="_copyTextMobile_10urc_76",un="_copyTextMiniMobile_10urc_95",X={share:Zs,modal:tn,header:en,socials:sn,social:nn,copy:on,title:rn,copyWrapper:an,copyText:cn,copyTextMobile:ln,copyTextMiniMobile:un},dn=({title:l="Copy Product Link"})=>{const{isOpenModal:n,setIsOpenModal:e}=t.useShareLinkStore();function s(){e(!0)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button$1,{className:X.share,onClick:i=>{i.stopPropagation(),s()},type:"Secondary",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Share",fill:"#757575",hoverable:!0})}),n&&t.jsxRuntimeExports.jsx(t.Modal,{close:e,children:t.jsxRuntimeExports.jsx(xn,{title:l})})]})},xn=({title:l="Copy Product Link"})=>{const{setIsOpenModal:n}=t.useShareLinkStore(),{notification:e,setNotification:s}=t.useNotificationStore(),{setIsOpen:i}=t.useModalStore(),u=window.location.href;function d(){navigator.clipboard.writeText(u),s({message:"Link copied to clipboard",status:"success"})}function o(){i(!1),setTimeout(()=>{n(!1),i(!0)},300)}function x(h,S){return h.length>S?h.slice(0,S)+"...":h}return t.jsxRuntimeExports.jsxs("div",{className:X.modal,onClick:h=>h.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:X.header,children:[t.jsxRuntimeExports.jsx("div",{className:X.title,children:l}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:o,hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:X.copyWrapper,children:[t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",onClick:d,style:{flex:1},children:[t.jsxRuntimeExports.jsx("div",{className:X.copyText,children:x(u,100)}),t.jsxRuntimeExports.jsx("div",{className:X.copyTextMobile,children:x(u,40)}),t.jsxRuntimeExports.jsx("div",{className:X.copyTextMiniMobile,children:x(u,20)})]}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:d,children:e?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},mn="_accordion_1s1lq_1",pn="_header_1s1lq_9",jn="_icon_1s1lq_18",hn="_open_1s1lq_21",_n="_content_1s1lq_25",Q={accordion:mn,header:pn,icon:jn,open:hn,content:_n},gn=({title:l,content:n,defaultOpen:e=!1})=>{const[s,i]=j.useState(e),[u,d]=j.useState(0),o=j.useRef(null),x=()=>{i(!s)};return j.useEffect(()=>{o.current&&d(s?o.current.scrollHeight:0)},[s]),t.jsxRuntimeExports.jsxs("div",{className:Q.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:Q.header,onClick:x,children:[t.jsxRuntimeExports.jsx("h5",{id:"h5",children:l}),t.jsxRuntimeExports.jsx("div",{className:t.clx(Q.icon,{[Q.open]:s}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:o,className:Q.content,style:{height:`${u}px`},children:t.jsxRuntimeExports.jsx("p",{id:"p",children:n})})]})},fn=({children:l,path:n,className:e,target:s="_self",id:i})=>{if(window.location.pathname.includes("/admin/builder"))return t.jsxRuntimeExports.jsx("div",{className:e,role:"link",style:{cursor:"pointer"},id:i,children:l});const u=t.useNavigate(),d=/^https?:\/\//.test(n),o=x=>{d||s==="_blank"?s==="_blank"?window.open(n,"_blank"):window.location.href=n:(x.preventDefault(),u(n,{replace:!0}))};return t.jsxRuntimeExports.jsx("div",{onClick:o,className:e,role:"link",style:{cursor:"pointer"},id:i,children:l})},En="_buttonsBlock_1b2rb_1",Rn="_slideUp_1b2rb_1",bn={buttonsBlock:En,slideUp:Rn},vn=()=>t.jsxRuntimeExports.jsxs("div",{className:bn.buttonsBlock,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",style:{width:"100%"},children:"Add to Cart"}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",children:"Buy"})]}),yn="_wrapper_27wzz_1",In="_logo_27wzz_8",Sn="_info_27wzz_12",Z={wrapper:yn,logo:In,info:Sn},Nn=({date:l})=>{const{general:n}=t.useGeneralStore();if(!n)return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{});function e(s){const i=new Date(s),u={month:"short",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1};return i.toLocaleDateString("en-US",u)}return t.jsxRuntimeExports.jsxs("div",{className:Z.wrapper,children:[t.jsxRuntimeExports.jsx("div",{className:Z.logo,children:n.info.logo?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${n.info.logo.cfId}/w=500,h=500`,alt:"image",style:{objectFit:"contain",width:"48px",height:"48px"}}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:48,height:48})}),t.jsxRuntimeExports.jsxs("div",{className:Z.info,children:[t.jsxRuntimeExports.jsx("h3",{id:"h4",children:n.info.name}),t.jsxRuntimeExports.jsx("p",{id:"p",children:e(l)})]})]})},kn="_wrapper_st58d_1",Cn="_label_st58d_10",$n="_textarea_st58d_18",Bn="_length_st58d_33",K={wrapper:kn,label:Cn,textarea:$n,length:Bn},wn=l=>{const{onChange:n,label:e,value:s,maxLength:i,placeholder:u="Type something...",type:d="text"}=l,[o,x]=j.useState(s.length);function h(S){return d==="number"?S.replace(/[^\d\n]+/g,""):S}return t.jsxRuntimeExports.jsxs("div",{className:K.wrapper,children:[e&&t.jsxRuntimeExports.jsx("label",{className:K.label,htmlFor:e,children:e}),t.jsxRuntimeExports.jsx("textarea",{id:e,value:s,onChange:S=>{const a=h(S.target.value);x(a.length),n(a)},placeholder:u,className:K.textarea,maxLength:i}),i&&t.jsxRuntimeExports.jsxs("div",{className:K.length,children:[o,"/",i]})]})};exports.Button=t.Button$1;exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.Icon=t.Icon;exports.InputSettings=t.Input;exports.InputUI=t.Input$1;exports.ItemsSettings=t.ItemsSettings;exports.Loader=t.Loader;exports.Modal=t.Modal;exports.RangeSelector=t.RangeSelector;exports.Select=t.Select;exports.Switch=t.Switch;exports.TextSettings=t.TextSettings;exports.TextareaSettings=t.Textarea;exports.TypesText=t.TypesText;exports.Accordion=gn;exports.BurgerMenuButton=at;exports.ButtonTypeSettings=et;exports.ButtonsSettings=He;exports.CategorySettings=Yt;exports.EmptyCart=ot;exports.FormSettings=Ee;exports.HeaderButtons=Qs;exports.LayoutSettings=bt;exports.Link=fn;exports.ListingSelector=Ve;exports.MetaInfoPost=Nn;exports.PagesMobileMenu=Ks;exports.PagesMobileModal=rt;exports.PagesSettings=ge;exports.ProductCardButtons=vn;exports.ProductOptions=js;exports.ShareLink=dn;exports.ShoppingButton=nt;exports.ShoppingModalCart=it;exports.TextareaUI=wn;exports.UserInfo=tt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-DUvsY_aL.cjs"),j=require("react");require("@phosphor-icons/react");const ct="_wrapper_1vmyb_2",lt="_alignmentBlock_1vmyb_8",ut="_title_1vmyb_15",dt="_subtitle_1vmyb_22",xt="_alignmentContent_1vmyb_29",mt="_alignments_1vmyb_37",pt="_alignment_1vmyb_8",jt="_circle_1vmyb_60",ht="_paddings_1vmyb_67",_t="_padding_1vmyb_67",gt="_active_1vmyb_91",ft="_input_1vmyb_98",F={wrapper:ct,alignmentBlock:lt,title:ut,subtitle:dt,alignmentContent:xt,alignments:mt,alignment:pt,circle:jt,paddings:ht,padding:_t,active:gt,input:ft},Et=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],Rt=["left","top","right","bottom"],bt=l=>{const{alignment:n,padding:e,setPadding:s,setAlignment:i}=l;function u(a){switch(a){case"left":case"topLeft":case"bottomLeft":return"TextAlignLeft";case"right":case"topRight":case"bottomRight":return"TextAlignRight";case"center":case"top":case"bottom":return"TextAlignCenter";default:return"TextAlignCenter"}}function d(a){switch(a){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}const[o,x]=j.useState(null),[h,S]=j.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:F.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:F.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:F.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:F.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:F.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:F.alignments,children:Et.map(a=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{i(a)},className:F.alignment,onMouseEnter:()=>{x(a)},onMouseLeave:()=>{x(null)},children:[a!==n&&o!==a&&t.jsxRuntimeExports.jsx("div",{className:F.circle}),a!==n&&o===a&&t.jsxRuntimeExports.jsx(t.Icon,{name:u(o),fill:"#c2c2c2",width:22,height:22}),a===n&&t.jsxRuntimeExports.jsx(t.Icon,{name:u(n),fill:"#FF3F19",width:22,height:22})]},a))}),t.jsxRuntimeExports.jsx("div",{className:F.paddings,children:Rt.map(a=>t.jsxRuntimeExports.jsxs("label",{className:t.clx(F.padding,{[F.active]:h===a}),onFocus:()=>{S(a)},onBlur:()=>{S(null)},children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:d(a),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(e[a]),onChange:c=>s({...e,[a]:Math.min(Number(c),999)}),max:999,paddingless:!0,borderless:!0})]},a))})]})]})]})},vt="_title_82zux_1",yt="_subtitle_82zux_5",It="_header_82zux_12",St="_text_82zux_13",Nt="_productsBlock_82zux_14",kt="_top_82zux_26",Ct="_itemsBlock_82zux_35",$t="_typeTexts_82zux_41",Bt="_block_82zux_48",wt="_active_82zux_61",Pt="_products_82zux_14",Mt="_product_82zux_14",Tt="_button_82zux_80",qt="_disabled_82zux_91",At="_image_82zux_95",Ot="_info_82zux_102",Lt="_name_82zux_114",Dt="_buttons_82zux_118",zt="_modal_82zux_125",Ut="_link_82zux_145",Ht="_modalOptions_82zux_151",Ft="_addButton_82zux_157",Vt="_deleteButton_82zux_179",V={title:vt,subtitle:yt,header:It,text:St,productsBlock:Nt,top:kt,itemsBlock:Ct,typeTexts:$t,block:Bt,active:wt,products:Pt,product:Mt,button:Tt,disabled:qt,image:At,info:Ot,name:Lt,buttons:Dt,modal:zt,link:Ut,modalOptions:Ht,addButton:Ft,deleteButton:Vt},Yt=l=>{const{isActiveItems:n,setIsActiveItems:e,items:s,setItems:i,other:u,title:d,subtitle:o,draggable:x=!1,withImage:h=!1,addable:S=!0,itemsOptions:a,hasRangeSelector:c=!1,rangeSelectorOptions:w,limit:k,autoScrollInterval:B,deletable:_}=l;function v(f){if(h)return f?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${f[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const r=(f,O=!1)=>{const N=a.find(I=>I.id===f);if(!N)return;const D=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[x&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Select,{onChange:I=>{const E=[...s],y=a.find(p=>p.name===I);if(!y)return;const P=y.id,C=E.map(p=>p===f?P:p);i([...C])},value:N.name,options:a.filter(I=>!s.find(E=>E===I.id)).map(I=>I.name),leftAddon:v(N.images)}),O&&t.jsxRuntimeExports.jsx("div",{className:V.buttons,children:t.jsxRuntimeExports.jsx("div",{className:V.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(I=>I!==f))})})})]});return t.jsxRuntimeExports.jsx("div",{className:V.product,children:D},f)};return t.jsxRuntimeExports.jsxs("div",{className:V.productsBlock,children:[(d||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:V.top,children:[d&&t.jsxRuntimeExports.jsx("h3",{className:V.title,children:d}),n!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:f=>e==null?void 0:e(f)})]}),c&&w&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...w}),t.jsxRuntimeExports.jsxs("div",{className:V.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:V.subtitle,children:o}),s.map(f=>r(f,_)),S&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center",gap:5},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(V.button,{[V.disabled]:!!(k&&k<=s.length||s.length===a.length)}),size:"s",disabled:!!(k&&k<=s.length||s.length===a.length),onClick:()=>{const f=[...s];let O=null;if(a){for(let N=0;N<a.length;N++)if(!s.find(D=>D===a[N].id)){O=a[N];break}}f.push((O==null?void 0:O.id)||a[0].id),i(f)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:V.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),u!==void 0&&t.jsxRuntimeExports.jsx(t.OtherSettings,{items:u}),B!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(B.scrollInterval),onChange:f=>B.setScrollInterval(Number(f)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},Gt="_title_roi3a_1",Wt="_subtitle_roi3a_5",Xt="_header_roi3a_12",Jt="_text_roi3a_13",Qt="_productsBlock_roi3a_14",Kt="_top_roi3a_26",Zt="_itemsBlock_roi3a_35",te="_typeTexts_roi3a_41",ee="_block_roi3a_48",se="_active_roi3a_61",ne="_products_roi3a_14",ie="_product_roi3a_14",oe="_button_roi3a_80",re="_disabled_roi3a_91",ae="_image_roi3a_95",ce="_info_roi3a_102",le="_name_roi3a_114",ue="_buttons_roi3a_118",de="_modal_roi3a_125",xe="_link_roi3a_145",me="_modalOptions_roi3a_151",pe="_addButton_roi3a_164",je="_deleteButton_roi3a_179",he="_closeIcon_roi3a_191",U={title:Gt,subtitle:Wt,header:Xt,text:Jt,productsBlock:Qt,top:Kt,itemsBlock:Zt,typeTexts:te,block:ee,active:se,products:ne,product:ie,button:oe,disabled:re,image:ae,info:ce,name:le,buttons:ue,modal:de,link:xe,modalOptions:me,addButton:pe,deleteButton:je,closeIcon:he};function _e({product:l,children:n}){const{attributes:e,listeners:s,setNodeRef:i,transform:u,transition:d,isDragging:o}=t.useSortable({id:l.id}),x={transform:t.CSS.Transform.toString(u),transition:d};return t.jsxRuntimeExports.jsx("div",{ref:i,style:x,className:`${U.product} ${o?U.dragging:""}`,...e,...s,children:n})}const ge=l=>{const{isActiveItems:n,setIsActiveItems:e,items:s,setItems:i,title:u,subtitle:d,editable:o=!0,draggable:x=!1,deletable:h=!0,addable:S=!0,itemsType:a,itemsOptions:c,addableOptions:w={},limit:k}=l,[B,_]=j.useState(null),[v,r]=j.useState(null),f=j.useRef(null),O=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));j.useEffect(()=>{if(B){const E=[...s].map(y=>y.id===B.id?B:y);i(E)}},[B]),j.useEffect(()=>{f.current&&v&&(f.current.getBoundingClientRect().height,v.top)},[f.current,v]);const N=(E,y)=>{E.stopPropagation();const P=E.target.getBoundingClientRect();r({top:P.top+window.scrollY,left:P.left-30}),_(y)},D=E=>{const{active:y,over:P}=E;if(P&&y.id!==P.id){const C=s.findIndex(g=>g.id===y.id),p=s.findIndex(g=>g.id===P.id);if(C!==-1&&p!==-1){const g=[...s],[M]=g.splice(C,1);g.splice(p,0,M),i(g)}}},I=(E,y)=>{const P=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[x&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),a==="select"&&c&&t.jsxRuntimeExports.jsx(t.Select,{onChange:C=>{const p=[...s],g=c.find(z=>z.name===C);if(!g)return;const M=p.map(z=>z.id===E.id?{...g,name:{"en-US":C}}:z);_({...E,name:{"en-US":C}}),i([...M])},value:E.name,options:c.filter(C=>!s.find(p=>p.name===C.name)).map(C=>C.name)}),t.jsxRuntimeExports.jsxs("div",{className:U.buttons,children:[o&&t.jsxRuntimeExports.jsx("div",{className:U.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:C=>N(C,E)})}),h&&t.jsxRuntimeExports.jsx("div",{className:U.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(C=>C.id!==E.id))})})]})]});return x?t.jsxRuntimeExports.jsx(_e,{product:E,index:y,children:P},E.id):t.jsxRuntimeExports.jsx("div",{className:U.product,children:P},E.id)};return t.jsxRuntimeExports.jsxs("div",{className:U.productsBlock,children:[(u||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:U.top,children:[u&&t.jsxRuntimeExports.jsx("h3",{className:U.title,children:u}),n!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:E=>e==null?void 0:e(E)})]}),t.jsxRuntimeExports.jsxs("div",{className:U.products,children:[d&&t.jsxRuntimeExports.jsx("h5",{className:U.subtitle,children:d}),x?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:O,onDragEnd:D,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(E=>E.id),strategy:t.verticalListSortingStrategy,children:s.map((E,y)=>I(E,y))})}):s.map((E,y)=>I(E,y)),S&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(U.button,{[U.disabled]:!!(k&&k<=s.length||s.length===(c==null?void 0:c.length))}),size:"s",disabled:!!(k&&k<=s.length||s.length===(c==null?void 0:c.length)),onClick:()=>{const E=[...s];let y=null;if(c){for(let P=0;P<c.length;P++)if(!s.find(C=>C.id===c[P].id)){y=c[P];break}}a==="select"&&c&&E.push({name:y?y.name:c[0].name,id:(y==null?void 0:y.id)||c[0].id,...w}),i(E)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:U.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})]})};function fe(l){const{product:n,children:e}=l,{attributes:s,listeners:i,setNodeRef:u,transform:d,transition:o,isDragging:x}=t.useSortable({id:n.id}),h={transform:t.CSS.Transform.toString(d),transition:o};return t.jsxRuntimeExports.jsx("div",{ref:u,style:h,className:`${t.styles.product} ${x?t.styles.dragging:""}`,...s,...i,children:e})}const Ee=l=>{const{isActiveItems:n,setIsActiveItems:e,items:s,setItems:i,other:u,title:d,subtitle:o,editable:x=!0,draggable:h=!1,withImage:S=!1,deletable:a=!0,addable:c=!0,itemsType:w,itemsPlaceholder:k="",itemsOptions:B,hasRangeSelector:_=!1,rangeSelectorOptions:v,modalOptions:r,addableOptions:f={},limit:O}=l,[N,D]=j.useState(null),[I,E]=j.useState({top:0,left:0}),[y,P]=j.useState(null),C=j.useRef(null),[p,g]=j.useState(!1),M=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));j.useEffect(()=>{const m=()=>{D(null),g(!1)};return document.body.addEventListener("click",m),D(null),g(!1),()=>{D(null),g(!1),document.body.removeEventListener("click",m)}},[]),j.useEffect(()=>{if(N){const m=[...s].map(q=>q.id===N.id?N:q);i(m)}},[N]),j.useEffect(()=>{if(C.current&&y){const m=C.current.getBoundingClientRect().height,q=window.innerHeight;let $=y.top;$+m>q+window.scrollY-200&&($=q+window.scrollY-m-200),$<0&&($=10),E({top:$,left:y.left})}},[C.current,y]);const z=(m,q)=>{m.stopPropagation();const $=m.target.getBoundingClientRect();P({top:$.top+window.scrollY,left:$.left-30}),D(q),g(!0)};function T(m){if(S)return m?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${m[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const L=m=>{const{active:q,over:$}=m;if($&&q.id!==$.id){const A=s.findIndex(H=>H.id===q.id),J=s.findIndex(H=>H.id===$.id);if(A!==-1&&J!==-1){const H=[...s],[Y]=H.splice(A,1);H.splice(J,0,Y),i(H)}}},G=m=>{var $;const q=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[h&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),w==="select"&&B&&t.jsxRuntimeExports.jsx(t.Select,{onChange:A=>{const H=[...s].map(Y=>Y.id===m.id?{...m,name:{"en-US":A}}:Y);D({...m,name:{"en-US":A}}),i([...H])},value:m.name["en-US"],options:B.filter(A=>!s.find(J=>J.name["en-US"]===A)),leftAddon:T(m.images)}),w==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:A=>{const H=[...s].map(Y=>Y.id===m.id?{...m,name:{"en-US":A}}:Y);i([...H])},value:m.name["en-US"],placeholder:k}),w==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:A=>{const H=[...s].map(Y=>Y.id===m.id?{...m,images:A}:Y);i([...H])},activeImage:($=s.find(A=>A.id===m.id))==null?void 0:$.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.buttons,children:[x&&t.jsxRuntimeExports.jsx("div",{className:t.styles.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:A=>z(A,m)})}),a&&t.jsxRuntimeExports.jsx("div",{className:t.styles.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(A=>A.id!==m.id))})})]})]});return h?t.jsxRuntimeExports.jsx(fe,{product:m,children:q},m.id):t.jsxRuntimeExports.jsx("div",{className:t.styles.product,children:q},m.id)};return t.jsxRuntimeExports.jsxs("div",{className:t.styles.productsBlock,children:[(d||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles.top,children:[d&&t.jsxRuntimeExports.jsx("h3",{className:t.styles.title,children:d}),n!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:m=>e==null?void 0:e(m)})]}),N&&x&&r&&p&&t.jsxRuntimeExports.jsx(t.ItemPopup,{ref:C,activeItem:N,setActiveItem:D,popupPosition:I,modalOptions:r,setIsOpenModal:g}),_&&v&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...v}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:t.styles.subtitle,children:o}),h?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:M,onDragEnd:L,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(m=>m.id),strategy:t.verticalListSortingStrategy,children:s.map(m=>G(m))})}):s.map(m=>G(m)),c&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(t.styles.button,{[t.styles.disabled]:!!(O&&O<=s.length)}),size:"s",disabled:!!(O&&O<=s.length),onClick:()=>{const m=[...s];let q=null;if(B){for(let $=0;$<B.length;$++)if(!s.find(A=>A.name["en-US"]===B[$])){q=B[$];break}}w==="select"&&B?m.push({name:{"en-US":q||B[0]},id:t.v4(),...f,maxSymbols:100}):w==="input"?m.push({name:{"en-US":""},id:t.v4(),...f,maxSymbols:100}):m.push({name:{"en-US":`Image ${s.length+1}`},id:t.v4(),...f,maxSymbols:100}),i(m)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:t.styles.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),u!==void 0&&t.jsxRuntimeExports.jsx(t.OtherSettings,{items:u})]})},Re="_subtitle_jql1y_1",be="_header_jql1y_8",ve="_text_jql1y_9",ye="_productsBlock_jql1y_10",Ie="_buttonsBlock_jql1y_11",Se="_top_jql1y_23",Ne="_itemsBlock_jql1y_32",ke="_typeTexts_jql1y_38",Ce="_block_jql1y_45",$e="_active_jql1y_58",Be="_products_jql1y_10",we="_product_jql1y_10",Pe="_button_jql1y_11",Me="_image_jql1y_88",Te="_info_jql1y_95",qe="_name_jql1y_107",Ae="_buttons_jql1y_11",Oe="_modal_jql1y_118",Le="_other_jql1y_138",De="_options_jql1y_144",ze="_addButton_jql1y_150",Ue="_deleteButton_jql1y_165",W={subtitle:Re,header:be,text:ve,productsBlock:ye,buttonsBlock:Ie,top:Se,itemsBlock:Ne,typeTexts:ke,block:Ce,active:$e,products:Be,product:we,button:Pe,image:Me,info:Te,name:qe,buttons:Ae,modal:Oe,other:Le,options:De,addButton:ze,deleteButton:Ue},et=l=>{const{buttons:n,setButtons:e,deletable:s=!0,addable:i=!0,editableLink:u=!0}=l,{pages:d}=t.usePagesStore(),[o,x]=j.useState(null),[h,S]=j.useState({top:0,left:0}),[a,c]=j.useState(null),w=j.useRef(null);j.useEffect(()=>{if(o){const _=[...n].map(v=>v.id===o.id?o:v);e(_)}},[o]),j.useEffect(()=>{if(w.current&&a){const _=w.current.getBoundingClientRect().height,v=window.innerHeight;let r=a.top;r+_>v+window.scrollY-200&&(r=v+window.scrollY-_-200),r<0&&(r=10),S({top:r,left:a.left})}},[w.current,a]);const k=(_,v)=>{_.stopPropagation();const r=_.target.getBoundingClientRect();c({top:r.top+window.scrollY-70,left:r.left-(i?30:65)}),x(v)},B=(_,v)=>{const r=[...n],f={..._,id:Math.random().toString(36).substr(2,9)};r.splice(v+1,0,f),e(r)};return t.jsxRuntimeExports.jsxs("div",{className:W.products,children:[t.jsxRuntimeExports.jsx("h5",{className:W.subtitle,children:"Button Type"}),n.map((_,v)=>t.jsxRuntimeExports.jsxs("div",{className:W.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:r=>{const O=[...n].map(N=>N.id===_.id?{..._,type:r}:N);e(O)},value:_.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:W.buttons,children:[t.jsxRuntimeExports.jsx("div",{className:W.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy",hoverable:!0,width:20,height:20,onClick:()=>{B(_,v)}})}),t.jsxRuntimeExports.jsx("div",{className:W.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:r=>{k(r,_)}})}),s&&t.jsxRuntimeExports.jsx("div",{className:W.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const r=n.filter(f=>f.id!==_.id);e(r)},width:20,height:20,fill:"#C12A2A"})})]})]},_.id)),o&&t.jsxRuntimeExports.jsx(t.ButtonPopup,{ref:w,activeButton:o,setActiveButton:x,popupPosition:h,editableLink:u}),i&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:W.button,size:"s",onClick:()=>{const _=[...n];u?_.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Button Name"},destination:"Go to Page",page:d?Object.values(d)[0].name:"Home",openInNewTab:!1}):_.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Create Ticket"},destination:"Go to Page",page:d?Object.values(d)[0].name:"Home",openInNewTab:!1}),e(_)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:W.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})},He=l=>{const{isActiveButtons:n,setIsActiveButtons:e,buttons:s,setButtons:i,editableLink:u=!0,addable:d=!0,deletable:o=!0}=l;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:t.styles$1.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:t.styles$1.top,children:[t.jsxRuntimeExports.jsx("h3",{className:t.styles$1.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:x=>e(x)})]}),n&&t.jsxRuntimeExports.jsx(et,{buttons:s,setButtons:i,editableLink:u,addable:d,deletable:o})]})})};function Fe(l){const{product:n,children:e}=l,{attributes:s,listeners:i,setNodeRef:u,transform:d,transition:o,isDragging:x}=t.useSortable({id:String(n.listingId)}),h={transform:t.CSS.Transform.toString(d),transition:o};return t.jsxRuntimeExports.jsx("div",{ref:u,style:h,className:`${t.styles$2.product} ${x?t.styles$2.dragging:""}`,...s,...i,children:e})}const Ve=l=>{const{isActiveItems:n,setIsActiveItems:e,items:s,setItems:i,other:u,title:d,subtitle:o,editable:x=!0,draggable:h=!1,withImage:S=!1,deletable:a=!0,addable:c=!0,itemsType:w,itemsOptions:k,limit:B}=l,[_,v]=j.useState(null),[r,f]=j.useState({top:0,left:0}),[O,N]=j.useState(!1),D=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));j.useEffect(()=>{const p=()=>{v(null),N(!1)};return document.body.addEventListener("click",p),v(null),N(!1),()=>{v(null),N(!1),document.body.removeEventListener("click",p)}},[]),j.useEffect(()=>{if(_){const p=[...s].map(g=>g.listingId===_.listingId?_:g);i(p)}},[_]);const I=(p,g)=>{p.stopPropagation();const M=p.target.getBoundingClientRect(),z=100,T=window.innerHeight;let L=M.top+window.scrollY;L+z>T&&(L=T-z-20),N(!0),f({top:L-80,left:M.left-30}),v(g)};function E(p){if(S)return p?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${p}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const y=p=>{const{active:g,over:M}=p;if(M&&g.id!==M.id){const z=s.findIndex(L=>String(L.listingId)===g.id),T=s.findIndex(L=>String(L.listingId)===M.id);if(z!==-1&&T!==-1){const L=[...s],[G]=L.splice(z,1);L.splice(T,0,G),i(L)}}},P=(p,g)=>{const M=k.find(T=>p.listingId===T.id);if(!M)return null;const z=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[h&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),w==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:T=>{const L=[...s],G=k.find($=>$.productData.name===T);if(!G)return;const m={listingId:G.id,image:G.productData.images.length>0?G.productData.images[0].cfId:""},q=L.map($=>$.listingId===p.listingId?m:$);v(m),i([...q])},value:M.productData.name,options:[...k.filter(T=>!s.find(L=>L.listingId===T.id)).map(T=>T.productData.name)],leftAddon:E(p.image||M.productData.images.length>0&&M.productData.images[0].cfId||"")},g),t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.buttons,children:[x&&t.jsxRuntimeExports.jsx("div",{className:t.styles$2.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:T=>I(T,p)})}),a&&t.jsxRuntimeExports.jsx("div",{className:t.styles$2.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(T=>T!==p))})})]})]});return h?t.jsxRuntimeExports.jsx(Fe,{product:p,children:z},p.listingId):t.jsxRuntimeExports.jsx("div",{className:t.styles$2.product,children:z},p.listingId)},C=j.useRef(null);return t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.productsBlock,children:[(d||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.top,children:[d&&t.jsxRuntimeExports.jsx("h3",{className:t.styles$2.title,children:d}),n!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:p=>e==null?void 0:e(p)})]}),O&&_&&t.jsxRuntimeExports.jsx(t.ListingPopup,{ref:C,activeItem:_,setActiveItem:v,setIsOpenModal:N,popupPosition:r,itemsOptions:k}),n&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:t.styles$2.subtitle,children:o}),h?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:D,onDragEnd:y,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(p=>String(p.listingId)),strategy:t.verticalListSortingStrategy,children:s.map((p,g)=>P(p,g))})}):s.map((p,g)=>P(p,g)),c&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.styles$2.button,size:"s",onClick:()=>{const p=[...s];for(let g=0;g<k.length;g++)if(!s.find(M=>M.listingId===k[g].id)){p.push({listingId:k[g].id,image:k[g].productData.images.length>0?k[g].productData.images[0].cfId:""});break}i(p)},disabled:s.length===(B||k.length),style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),n&&u!==void 0&&t.jsxRuntimeExports.jsx(t.OtherSettings,{items:u})]})},Ye="_options_6cemk_1",Ge="_price_6cemk_12",We="_oldPrice_6cemk_19",Xe="_newPrice_6cemk_27",Je="_animate_6cemk_34",Qe="_appearAndBounce_6cemk_1",Ke="_meta_6cemk_52",Ze="_info_6cemk_58",ts="_infoRight_6cemk_66",es="_buttons_6cemk_73",ss="_variants_6cemk_80",ns="_variant_6cemk_80",is="_stock_6cemk_98",os="_variantInfo_6cemk_105",rs="_quantity_6cemk_111",as="_count_6cemk_118",cs="_focused_6cemk_135",ls="_button_6cemk_73",us="_activeVariant_6cemk_161",ds="_chargeTypes_6cemk_165",xs="_charge_6cemk_165",ms="_chargeActive_6cemk_190",ps="_title_6cemk_198",b={options:Ye,price:Ge,oldPrice:We,newPrice:Xe,animate:Je,appearAndBounce:Qe,meta:Ke,info:Ze,infoRight:ts,buttons:es,variants:ss,variant:ns,stock:is,variantInfo:os,quantity:rs,count:as,focused:cs,button:ls,activeVariant:us,chargeTypes:ds,charge:xs,chargeActive:ms,title:ps};var st=(l=>(l.ONE_TIME="One-Time",l.RECURRING="Subscribe & Save",l))(st||{});const js=l=>{var _,v;const{variants:n}=l,[e,s]=j.useState(n[0]),[i,u]=j.useState(e.chargeTypes[0]),d=t.useNavigate(),[o,x]=j.useState(1),{reset:h,addProductToCart:S}=t.di(),[a,c]=j.useState(!1);j.useEffect(()=>{c(!0);const r=setTimeout(()=>c(!1),600);return()=>clearTimeout(r)},[o]);async function w(){await S({productId:l.id,productVariantId:e.id,quantity:o})}function k(){h(),w(),d("/checkout")}function B(r){if(r>=864e5){const I=Math.floor(r/864e5);return`${I} ${I===1?"day":"days"}`}else if(r>=36e5){const I=Math.floor(r/36e5);return`${I} ${I===1?"hour":"hours"}`}else if(r>=6e4){const I=Math.floor(r/6e4);return`${I} ${I===1?"minute":"minutes"}`}else{const I=Math.floor(r/1e3);return`${I} ${I===1?"second":"seconds"}`}}return j.useEffect(()=>{(e.quantity.available===0||!e.quantity.available)&&x(0)},[e.quantity.available]),t.jsxRuntimeExports.jsxs("div",{className:b.options,children:[e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:b.chargeTypes,children:e.chargeTypes.map(r=>t.jsxRuntimeExports.jsx("div",{className:t.clx(b.charge,{[b.chargeActive]:i===r}),onClick:()=>u(r),children:st[r]},r))}),t.jsxRuntimeExports.jsx("div",{className:b.variants,children:n.map(r=>{var f;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(b.variant,{[b.activeVariant]:e.id===r.id}),onClick:()=>s(r),children:[t.jsxRuntimeExports.jsxs("div",{className:b.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:b.title,children:r.name}),t.jsxRuntimeExports.jsxs("span",{children:["$",i==="ONE_TIME"?r.price.amount:r.subscriptionSettings?r.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:i==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:b.stock,children:[((f=r.quantity.restrictions)==null?void 0:f.max)||r.quantity.available||0," in stock"]})})]},r.id)})}),i==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:b.quantity,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{o>1?x(r=>r-1):x(1)},className:b.button,disabled:e.quantity.available===0||e.quantity.restrictions&&o<=e.quantity.restrictions.min||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx(t.Input$1,{type:"number",value:String(o),onChange:r=>x(Number(r)),max:((_=e.quantity.restrictions)==null?void 0:_.max)||e.quantity.available||1/0,min:((v=e.quantity.restrictions)==null?void 0:v.min)||0,centered:!0,disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{x(r=>r+1)},className:b.button,disabled:!!(e.quantity.restrictions&&o>=e.quantity.restrictions.max||e.quantity.available!==void 0&&o>=e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:b.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:b.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:b.infoRight,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lightning",fill:"#FF3F19",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{children:!e.deliveryTime||e.deliveryTime===0?"Instant":B(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:b.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:b.infoRight,children:i==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:b.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(b.newPrice,{[b.animate]:a}),children:["$ ",(e.price.amount||0)*o]}),t.jsxRuntimeExports.jsxs("span",{className:b.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*o]})]}):t.jsxRuntimeExports.jsxs("span",{className:t.clx(b.newPrice,{[b.animate]:a}),children:["$ ",(e.price.amount||0)*o]}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:b.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(b.newPrice,{[b.animate]:a}),children:["$ ",e.subscriptionSettings.price.amount||0]}),t.jsxRuntimeExports.jsxs("span",{className:b.oldPrice,children:["$ ",e.subscriptionSettings.compareAtPrice.amount||0]})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsxs("span",{className:t.clx(b.newPrice,{[b.animate]:a}),children:["$ ",e.subscriptionSettings.price.amount||0]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:b.buttons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:()=>k(),disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:i==="ONE_TIME"?"Buy Now":"Subscribe Now"}),i==="ONE_TIME"&&t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>w(),disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:"Add to Cart"})]})]})},hs="_button_1tdo3_1",_s="_login_1tdo3_14",gs="_signUp_1tdo3_18",fs="_buttons_1tdo3_23",Es="_modal_1tdo3_32",Rs="_closing_1tdo3_64",bs="_info_1tdo3_113",vs="_top_1tdo3_120",ys="_title_1tdo3_131",Is="_clear_1tdo3_138",Ss="_activeClear_1tdo3_145",Ns="_count_1tdo3_149",ks="_cart_1tdo3_164",Cs="_empty_1tdo3_172",$s="_product_1tdo3_198",Bs="_products_1tdo3_207",ws="_image_1tdo3_215",Ps="_productInfo_1tdo3_221",Ms="_content_1tdo3_228",Ts="_name_1tdo3_234",qs="_price_1tdo3_240",As="_productButtons_1tdo3_246",Os="_productButton_1tdo3_246",Ls="_productCount_1tdo3_266",Ds="_bottom_1tdo3_282",zs="_subtotal_1tdo3_290",Us="_block_1tdo3_298",Hs="_shoppingCount_1tdo3_305",Fs="_total_1tdo3_325",Vs="_link_1tdo3_331",Ys="_userInfo_1tdo3_338",Gs="_pagesMobileModal_1tdo3_349",Ws="_pagesMobileModalContent_1tdo3_363",Xs="_pagesMobileModalHeader_1tdo3_369",Js="_pagesMobileModalFooter_1tdo3_379",R={button:hs,login:_s,signUp:gs,buttons:fs,modal:Es,"slide-in-fade":"_slide-in-fade_1tdo3_1","mobile-slide-in-fade":"_mobile-slide-in-fade_1tdo3_1",closing:Rs,"mobile-slide-out-fade":"_mobile-slide-out-fade_1tdo3_1","slide-out-fade":"_slide-out-fade_1tdo3_1",info:bs,top:vs,title:ys,clear:Is,activeClear:Ss,count:Ns,cart:ks,empty:Cs,product:$s,products:Bs,image:ws,productInfo:Ps,content:Ms,name:Ts,price:qs,productButtons:As,productButton:Os,productCount:Ls,bottom:Ds,subtotal:zs,block:Us,shoppingCount:Hs,total:Fs,link:Vs,userInfo:Ys,pagesMobileModal:Gs,pagesMobileModalContent:Ws,pagesMobileModalHeader:Xs,pagesMobileModalFooter:Js},Qs=l=>{const{shopping:n,signUp:e,isShowUserInfo:s=!0}=l;return t.jsxRuntimeExports.jsxs("div",{className:R.buttons,children:[n&&t.jsxRuntimeExports.jsx(nt,{}),s&&t.jsxRuntimeExports.jsx(tt,{signUp:e})]})},nt=()=>{const[l,n]=j.useState(!1),[e,s]=j.useState([]),{cart:i}=t.di();function u(h){var S;return!h||!(h!=null&&h.variants)?!1:(S=h.variants.find(a=>a.id===h.activeVariantId))==null?void 0:S.subscriptionSettings}const d=i.parts.length>0&&e.length>0&&!u(e[0]),[o,x]=j.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",style:{padding:10},onClick:h=>{h.stopPropagation(),window.location.pathname.includes("/admin/builder")||(n(!0),x(!0))},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-primary)"}),d&&t.jsxRuntimeExports.jsx("div",{className:R.shoppingCount,children:i.parts.length})]}),l&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>{x(!1),setTimeout(()=>{n(!1)},300)},withAnimation:!1,children:t.jsxRuntimeExports.jsx(it,{activeProducts:e,isCartNotEmpty:d,isOpen:o})})]})},it=l=>{const{activeProducts:n,isCartNotEmpty:e,isOpen:s}=l,{cart:i,reset:u,getTotalAndDiscount:d,updateQuantityOfProduct:o}=t.di(),x=t.useNavigate();function h(c){x(c)}function S(c){o({productId:c.id,productVariantId:c.activeVariantId,quantity:c.quantity+1})}function a(c){o({productId:c.id,productVariantId:c.activeVariantId,quantity:c.quantity-1})}return t.jsxRuntimeExports.jsxs("div",{className:t.clx(R.modal,{[R.closing]:!s}),onClick:c=>c.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:R.top,children:[t.jsxRuntimeExports.jsxs("div",{className:R.info,children:[t.jsxRuntimeExports.jsx("span",{className:R.title,children:"Cart"}),e&&t.jsxRuntimeExports.jsx("div",{className:R.count,children:i.parts.length})]}),t.jsxRuntimeExports.jsx("button",{className:t.clx(R.clear,{[R.activeClear]:e}),disabled:!e,onClick:u,children:"Clear all"})]}),e?t.jsxRuntimeExports.jsxs("div",{className:R.cart,children:[t.jsxRuntimeExports.jsx("div",{className:R.products,children:n.map(c=>t.jsxRuntimeExports.jsxs("div",{className:R.product,children:[t.jsxRuntimeExports.jsxs("div",{className:R.productInfo,children:[t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${c.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:R.image}),t.jsxRuntimeExports.jsxs("div",{className:R.content,children:[t.jsxRuntimeExports.jsx("div",{className:R.name,children:c.name}),t.jsxRuntimeExports.jsxs("div",{className:R.price,children:["$",c.variants.find(w=>w.id===c.activeVariantId).price.amount*((c==null?void 0:c.quantity)||1)]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:R.productButtons,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{c.quantity!==1&&a(c)},className:R.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:R.productCount,children:c.quantity}),t.jsxRuntimeExports.jsx("div",{onClick:()=>S(c),className:R.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},c.id))}),t.jsxRuntimeExports.jsxs("div",{className:R.bottom,children:[t.jsxRuntimeExports.jsxs("div",{className:R.subtotal,children:[t.jsxRuntimeExports.jsxs("div",{className:R.block,children:[t.jsxRuntimeExports.jsx("span",{children:"Subtotal"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Info",width:20,height:20,fill:"#757575"})]}),t.jsxRuntimeExports.jsxs("div",{className:R.total,children:["$",d().total]})]}),t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>h("/checkout"),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(ot,{})]})},ot=()=>t.jsxRuntimeExports.jsxs("div",{className:R.empty,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-secondary)"})}),t.jsxRuntimeExports.jsx("span",{children:"Empty Cart"}),t.jsxRuntimeExports.jsxs("span",{children:["You don’t have any items in your shopping cart yet,"," ",t.jsxRuntimeExports.jsx("a",{href:"/products",className:R.link,children:"view products"})]})]}),tt=({signUp:l,close:n})=>{const e=JSON.parse(localStorage.getItem("token")||"{}"),{data:s}=e,i=t.useNavigate();function u(x){window.location.pathname.includes("/admin/builder")||i(x)}if(!s)return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>{u("/customer-dash"),n==null||n()},type:"Secondary",style:{padding:10},children:"Login"}),l&&t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>{u("/customer-dash"),n==null||n()},type:"Primary",style:{padding:10,whiteSpace:"nowrap"},children:"Sign Up"})]});const[d,o]=j.useState("test-email@gmail.com");return j.useEffect(()=>{(async()=>{const h=t.jwtDecode(s);o(h.email)})()},[s]),t.jsxRuntimeExports.jsx("div",{className:R.userInfo,onClick:()=>{u("/customer-dash"),n==null||n()},children:t.jsxRuntimeExports.jsx("div",{children:d||"test-email@gmail.com"})})},rt=({children:l,logo:n,setIsOpen:e,signUp:s})=>{const{setIsOpen:i}=t.useModalStore(),u=()=>{i(!1),setTimeout(()=>{e(!1),i(!0)},300)};return t.jsxRuntimeExports.jsxs("div",{className:R.pagesMobileModal,onClick:d=>d.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:R.pagesMobileModalHeader,children:[t.jsxRuntimeExports.jsx("div",{children:n}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:u,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"var(--icon-primary)"})})]}),t.jsxRuntimeExports.jsx("div",{className:R.pagesMobileModalContent,children:l}),t.jsxRuntimeExports.jsx("div",{className:R.pagesMobileModalFooter,children:t.jsxRuntimeExports.jsx(tt,{signUp:s,close:u})})]})},Ks=({children:l,logo:n,signUp:e})=>{const[s,i]=j.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(at,{setIsOpenModal:i}),s&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>i(!1),children:t.jsxRuntimeExports.jsx(rt,{logo:n,setIsOpen:i,signUp:e,children:l})})]})},at=l=>{const{setIsOpenModal:n}=l;return t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",style:{padding:10},onClick:e=>{e.stopPropagation(),n(!0)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"List",fill:"var(--icon-primary)"})})},Zs="_share_10urc_1",tn="_modal_10urc_9",en="_header_10urc_21",sn="_socials_10urc_31",nn="_social_10urc_31",on="_copy_10urc_41",rn="_title_10urc_48",an="_copyWrapper_10urc_54",cn="_copyText_10urc_63",ln="_copyTextMobile_10urc_76",un="_copyTextMiniMobile_10urc_95",X={share:Zs,modal:tn,header:en,socials:sn,social:nn,copy:on,title:rn,copyWrapper:an,copyText:cn,copyTextMobile:ln,copyTextMiniMobile:un},dn=({title:l="Copy Product Link"})=>{const{isOpenModal:n,setIsOpenModal:e}=t.useShareLinkStore();function s(){e(!0)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button$1,{className:X.share,onClick:i=>{i.stopPropagation(),s()},type:"Secondary",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Share",fill:"#757575",hoverable:!0})}),n&&t.jsxRuntimeExports.jsx(t.Modal,{close:e,children:t.jsxRuntimeExports.jsx(xn,{title:l})})]})},xn=({title:l="Copy Product Link"})=>{const{setIsOpenModal:n}=t.useShareLinkStore(),{notification:e,setNotification:s}=t.useNotificationStore(),{setIsOpen:i}=t.useModalStore(),u=window.location.href;function d(){navigator.clipboard.writeText(u),s({message:"Link copied to clipboard",status:"success"})}function o(){i(!1),setTimeout(()=>{n(!1),i(!0)},300)}function x(h,S){return h.length>S?h.slice(0,S)+"...":h}return t.jsxRuntimeExports.jsxs("div",{className:X.modal,onClick:h=>h.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:X.header,children:[t.jsxRuntimeExports.jsx("div",{className:X.title,children:l}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:o,hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:X.copyWrapper,children:[t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",onClick:d,style:{flex:1},children:[t.jsxRuntimeExports.jsx("div",{className:X.copyText,children:x(u,100)}),t.jsxRuntimeExports.jsx("div",{className:X.copyTextMobile,children:x(u,40)}),t.jsxRuntimeExports.jsx("div",{className:X.copyTextMiniMobile,children:x(u,20)})]}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:d,children:e?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},mn="_accordion_1s1lq_1",pn="_header_1s1lq_9",jn="_icon_1s1lq_18",hn="_open_1s1lq_21",_n="_content_1s1lq_25",Q={accordion:mn,header:pn,icon:jn,open:hn,content:_n},gn=({title:l,content:n,defaultOpen:e=!1})=>{const[s,i]=j.useState(e),[u,d]=j.useState(0),o=j.useRef(null),x=()=>{i(!s)};return j.useEffect(()=>{o.current&&d(s?o.current.scrollHeight:0)},[s]),t.jsxRuntimeExports.jsxs("div",{className:Q.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:Q.header,onClick:x,children:[t.jsxRuntimeExports.jsx("h5",{id:"h5",children:l}),t.jsxRuntimeExports.jsx("div",{className:t.clx(Q.icon,{[Q.open]:s}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:o,className:Q.content,style:{height:`${u}px`},children:t.jsxRuntimeExports.jsx("p",{id:"p",children:n})})]})},fn=({children:l,path:n,className:e,target:s="_self",id:i})=>{if(window.location.pathname.includes("/admin/builder"))return t.jsxRuntimeExports.jsx("div",{className:e,role:"link",style:{cursor:"pointer"},id:i,children:l});const u=t.useNavigate(),d=/^https?:\/\//.test(n),o=x=>{d||s==="_blank"?s==="_blank"?window.open(n,"_blank"):window.location.href=n:(x.preventDefault(),u(n,{replace:!0}))};return t.jsxRuntimeExports.jsx("div",{onClick:o,className:e,role:"link",style:{cursor:"pointer"},id:i,children:l})},En="_buttonsBlock_1b2rb_1",Rn="_slideUp_1b2rb_1",bn={buttonsBlock:En,slideUp:Rn},vn=()=>t.jsxRuntimeExports.jsxs("div",{className:bn.buttonsBlock,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",style:{width:"100%"},children:"Add to Cart"}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",children:"Buy"})]}),yn="_wrapper_27wzz_1",In="_logo_27wzz_8",Sn="_info_27wzz_12",Z={wrapper:yn,logo:In,info:Sn},Nn=({date:l})=>{const{general:n}=t.useGeneralStore();if(!n)return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{});function e(s){const i=new Date(s),u={month:"short",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1};return i.toLocaleDateString("en-US",u)}return t.jsxRuntimeExports.jsxs("div",{className:Z.wrapper,children:[t.jsxRuntimeExports.jsx("div",{className:Z.logo,children:n.info.logo?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${n.info.logo.cfId}/w=500,h=500`,alt:"image",style:{objectFit:"contain",width:"48px",height:"48px"}}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:48,height:48})}),t.jsxRuntimeExports.jsxs("div",{className:Z.info,children:[t.jsxRuntimeExports.jsx("h3",{id:"h4",children:n.info.name}),t.jsxRuntimeExports.jsx("p",{id:"p",children:e(l)})]})]})},kn="_wrapper_st58d_1",Cn="_label_st58d_10",$n="_textarea_st58d_18",Bn="_length_st58d_33",K={wrapper:kn,label:Cn,textarea:$n,length:Bn},wn=l=>{const{onChange:n,label:e,value:s,maxLength:i,placeholder:u="Type something...",type:d="text"}=l,[o,x]=j.useState(s.length);function h(S){return d==="number"?S.replace(/[^\d\n]+/g,""):S}return t.jsxRuntimeExports.jsxs("div",{className:K.wrapper,children:[e&&t.jsxRuntimeExports.jsx("label",{className:K.label,htmlFor:e,children:e}),t.jsxRuntimeExports.jsx("textarea",{id:e,value:s,onChange:S=>{const a=h(S.target.value);x(a.length),n(a)},placeholder:u,className:K.textarea,maxLength:i}),i&&t.jsxRuntimeExports.jsxs("div",{className:K.length,children:[o,"/",i]})]})};exports.Button=t.Button$1;exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.Icon=t.Icon;exports.InputSettings=t.Input;exports.InputUI=t.Input$1;exports.ItemsSettings=t.ItemsSettings;exports.Loader=t.Loader;exports.Modal=t.Modal;exports.RangeSelector=t.RangeSelector;exports.Select=t.Select;exports.Switch=t.Switch;exports.TextSettings=t.TextSettings;exports.TextareaSettings=t.Textarea;exports.TypesText=t.TypesText;exports.Accordion=gn;exports.BurgerMenuButton=at;exports.ButtonTypeSettings=et;exports.ButtonsSettings=He;exports.CategorySettings=Yt;exports.EmptyCart=ot;exports.FormSettings=Ee;exports.HeaderButtons=Qs;exports.LayoutSettings=bt;exports.Link=fn;exports.ListingSelector=Ve;exports.MetaInfoPost=Nn;exports.PagesMobileMenu=Ks;exports.PagesMobileModal=rt;exports.PagesSettings=ge;exports.ProductCardButtons=vn;exports.ProductOptions=js;exports.ShareLink=dn;exports.ShoppingButton=nt;exports.ShoppingModalCart=it;exports.TextareaUI=wn;exports.UserInfo=tt;
package/dist/ui.es.js CHANGED
@@ -1,5 +1,5 @@
1
- import { j as t, I as f, c as W, a as ut, S as it, R as Nt, B as ot, O as mt, d as at, u as ht, e as pt, P as _t, D as gt, f as ft, v as xt, g as jt, C as bt, h as F, i as wt, k as st, l as $t, m as Bt, n as Pt, o as rt, p as G, L as Mt, q as lt, r as vt, t as H, w as Tt, M as yt, x as kt, y as qt, z as It, A as At, E as Ot } from "./index-VdHBtEiJ.js";
2
- import { K as ji, G as bi, J as vi, F as yi, T as Ni, H as ki } from "./index-VdHBtEiJ.js";
1
+ import { j as t, I as f, c as W, a as ut, S as it, R as Nt, B as ot, O as mt, d as at, u as ht, e as pt, P as _t, D as gt, f as ft, v as xt, g as jt, C as bt, h as F, i as wt, k as st, l as $t, m as Bt, n as Pt, o as rt, p as G, L as Mt, q as lt, r as vt, t as H, w as Tt, M as yt, x as kt, y as qt, z as It, A as At, E as Ot } from "./index-BpuklKXj.js";
2
+ import { K as ji, G as bi, J as vi, F as yi, T as Ni, H as ki } from "./index-BpuklKXj.js";
3
3
  import _ from "react";
4
4
  import "@phosphor-icons/react";
5
5
  const Et = "_wrapper_1vmyb_2", Rt = "_alignmentBlock_1vmyb_8", Dt = "_title_1vmyb_15", Lt = "_subtitle_1vmyb_22", zt = "_alignmentContent_1vmyb_29", Ut = "_alignments_1vmyb_37", Ht = "_alignment_1vmyb_8", Ft = "_circle_1vmyb_60", Vt = "_paddings_1vmyb_67", Yt = "_padding_1vmyb_67", Gt = "_active_1vmyb_91", Wt = "_input_1vmyb_98", J = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@billgangcom/theme-lib",
3
- "version": "1.60.0",
3
+ "version": "1.61.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"