@billgangcom/theme-lib 1.64.0 → 1.65.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builder/constants/theme-settings.d.ts +6 -5
- package/dist/builder/store/useFontsStore.d.ts +6 -2
- package/dist/builder/store/useThemeSettingsStore.d.ts +4 -4
- package/dist/builder.cjs.js +6 -5
- package/dist/builder.es.js +1301 -1266
- package/dist/{index-Dg3k5gYy.js → index-BPn2qi_o.js} +494 -464
- package/dist/{index-CWZkhE-z.cjs → index-Dc4CgFbD.cjs} +2 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/ui/ItemsSettings/index.d.ts +1 -1
- package/dist/ui/TextSettings/index.d.ts +2 -2
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +756 -692
- package/package.json +1 -1
|
@@ -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 Wa(){return Wa=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},Wa.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?Lr(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?Lr(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:Wa({},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=Wa({},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 Ji(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:x}=r||{},_=H.useCallback(j=>{x?J7(j):j()},[x]),S=H.useCallback((j,T)=>{let{deletedFetchers:I,unstable_flushSync:A,unstable_viewTransitionOpts:U}=T;I.forEach(X=>b.current.delete(X)),j.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?Ji(()=>o(j)):_(()=>o(j));return}if(A){Ji(()=>{f&&(h&&h.resolve(),f.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:U.currentLocation,nextLocation:U.nextLocation})});let X=n.window.document.startViewTransition(()=>{Ji(()=>o(j))});X.finished.finally(()=>{Ji(()=>{p(void 0),y(void 0),c(void 0),d({isTransitioning:!1})})}),Ji(()=>y(X));return}f?(h&&h.resolve(),f.skipTransition(),m({state:j,currentLocation:U.currentLocation,nextLocation:U.nextLocation})):(c(j),d({isTransitioning:!0,flushSync:!1,currentLocation:U.currentLocation,nextLocation:U.nextLocation}))},[n.window,f,h,b,_]);H.useLayoutEffect(()=>n.subscribe(S),[n,S]),H.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new Q7)},[u]),H.useEffect(()=>{if(h&&i&&n.window){let j=i,T=h.promise,I=n.window.document.startViewTransition(async()=>{_(()=>o(j)),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 w=H.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:j=>n.navigate(j),push:(j,T,I)=>n.navigate(j,{state:T,preventScrollReset:I==null?void 0:I.preventScrollReset}),replace:(j,T,I)=>n.navigate(j,{replace:!0,state:T,preventScrollReset:I==null?void 0:I.preventScrollReset})}),[n]),k=n.basename||"/",L=H.useMemo(()=>({router:n,navigator:w,static:!1,basename:k}),[n,w,k]),D=H.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return H.createElement(H.Fragment,null,H.createElement(Ti.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:w,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(Ir),g,m=!1;if(typeof d=="string"&&ag.test(d)&&(g=d,rg))try{let S=new URL(window.location.href),w=d.startsWith("//")?new URL(S.protocol+d):new URL(d),k=Lr(w.pathname,y);w.origin===S.origin&&k!=null?d=k+w.search+w.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}),x=sg(d,{replace:i,state:c,target:u,preventScrollReset:h,relative:a,unstable_viewTransition:p});function _(S){r&&r(S),S.defaultPrevented||x(S)}return H.createElement("a",Wa({},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=ro(),g=H.useContext(Qc),{navigator:m,basename:b}=H.useContext(Ir),x=g!=null&&fg(f)&&d===!0,_=m.encodeLocation?m.encodeLocation(f).pathname:f.pathname,S=y.pathname,w=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;a||(S=S.toLowerCase(),w=w?w.toLowerCase():null,_=_.toLowerCase()),w&&b&&(w=Lr(w,b)||w);const k=_!=="/"&&_.endsWith("/")?_.length-1:_.length;let L=S===_||!i&&S.startsWith(_)&&S.charAt(k)==="/",D=w!=null&&(w===_||!i&&w.startsWith(_)&&w.charAt(_.length)==="/"),j={isActive:L,isPending:D,isTransitioning:x},T=L?r:void 0,I;typeof o=="function"?I=o(j):I=[o,L?"active":null,D?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let A=typeof c=="function"?c(j):c;return H.createElement(h2,Wa({},p,{"aria-current":T,className:I,ref:n,style:A,to:u,unstable_viewTransition:d}),typeof h=="function"?h(j):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",x=_=>{if(d&&d(_),_.defaultPrevented)return;_.preventDefault();let S=_.nativeEvent.submitter,w=(S==null?void 0:S.getAttribute("formmethod"))||c;g(S||_.currentTarget,{fetcherKey:n,method:w,navigate:r,replace:o,state:i,relative:h,preventScrollReset:p,unstable_viewTransition:f})};return H.createElement("form",Wa({ref:t,method:b,action:m,onSubmit:a?d:x},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(Ti);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=hr(),d=ro(),h=rl(e,{relative:i});return H.useCallback(p=>{if(B7(p,n)){p.preventDefault();let f=r!==void 0?r:Ua(d)===Ua(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=ro(),a=H.useMemo(()=>F7(r.search,n.current?null:t.current),[r.search]),o=hr(),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(Ir),n=E7();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(Ir),a=H.useContext(Mr);a||(process.env.NODE_ENV!=="production"?Te(!1,"useFormAction must be used inside a RouteContext"):Te(!1));let[o]=a.matches.slice(-1),i=Wa({},rl(e||".",{relative:n})),c=ro();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:Qr([r,i.pathname])),Ua(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=Lr(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=Lr(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=>({header:null,footer:null,announcement:null,setHeader:t=>e(()=>({header:t})),setFooter:t=>e(()=>({footer:t})),setAnnouncement:t=>e(()=>({announcement:t})),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",v2=["/","/reviews","/faqs","/contact","/products","/ticket","/login"],xg={"/":{path:"/",name:"Home",icon:"HouseSimple",seo:{pageDescription:"",pageTitle:""},visibility:"public"},"/products":{path:"/products",name:"products",icon:"SquaresFour",seo:{pageDescription:"",pageTitle:""},visibility:"public"},"/faqs":{path:"/faqs",name:"faqs",icon:"SealQuestion",seo:{pageDescription:"",pageTitle:""},visibility:"public"},"/reviews":{path:"/reviews",name:"reviews",icon:"Star",seo:{pageDescription:"",pageTitle:""},visibility:"public"},"/contact":{path:"/contact",name:"contact",icon:"ChatCentered",seo:{pageDescription:"",pageTitle:""},visibility:"public"},"/ticket":{path:"/ticket",name:"ticket",icon:"Ticket",seo:{pageDescription:"",pageTitle:""},visibility:"public"},"/login":{path:"/login",name:"login",icon:"UserCircleGear",seo:{pageDescription:"",pageTitle:""},visibility:"public"}},wg=window.location.hostname.includes("localhost"),Sg=Ut(e=>({activeBlock:g2[0],setActiveBlock:t=>e(()=>({activeBlock:t}))}));function jg(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)}}}},kg=(e,t)=>(n,r,a)=>{let o={storage:jg(()=>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 S;return _((S=r())!=null?S:f)});const x=((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 S;const[w,k]=_;if(y=o.merge(k,(S=r())!=null?S:f),n(y,!0),w)return h()}).then(()=>{x==null||x(y,void 0),y=r(),i=!0,u.forEach(_=>_(y))}).catch(_=>{x==null||x(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=kg,y2=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 hn=[];for(var Bu=0;Bu<256;++Bu)hn.push((Bu+256).toString(16).slice(1));function Ng(e,t=0){return(hn[e[t+0]]+hn[e[t+1]]+hn[e[t+2]]+hn[e[t+3]]+"-"+hn[e[t+4]]+hn[e[t+5]]+"-"+hn[e[t+6]]+hn[e[t+7]]+"-"+hn[e[t+8]]+hn[e[t+9]]+"-"+hn[e[t+10]]+hn[e[t+11]]+hn[e[t+12]]+hn[e[t+13]]+hn[e[t+14]]+hn[e[t+15]]).toLowerCase()}var Pl,Eg=new Uint8Array(16);function Tg(){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 Pg=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Hf={randomUUID:Pg};function Ci(e,t,n){if(Hf.randomUUID&&!t&&!e)return Hf.randomUUID();e=e||{};var r=e.random||(e.rng||Tg)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Ng(r)}const fn=Ut(nu((e,t)=>({header:null,blocks:{},announcement:null,footer:null,currentBlock:null,positionBlock:null,setBlocks:n=>{e({blocks:n})},setHeader:n=>{const r=structuredClone(t().header)||JSON.parse(JSON.stringify(t().header));Bn.getState().addHistory({header:r}),e({header:n})},setFooter:n=>{const r=structuredClone(t().footer)||JSON.parse(JSON.stringify(t().footer));Bn.getState().addHistory({footer:r}),e({footer:n})},setAnnouncement:n=>{const r=structuredClone(t().announcement)||JSON.parse(JSON.stringify(t().announcement));Bn.getState().addHistory({announcement:r}),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));Bn.getState().addHistory({layers:a});const o={...t().blocks},i=o[n]||{data:{},order:[]},c=t().positionBlock,u=Ci(),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));Bn.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);Bn.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(Bn.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);Bn.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=Ci(),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}),y2.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,announcement:a}=e;return{blocks:t,header:n,footer:r,announcement:a}}})),Lg=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})}})),wo=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:"var(--radius-lg)",thickness:"var(--border-none)"},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);Bn.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);Bn.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);Bn.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);Bn.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);Bn.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 Bn.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}))})),Ag=Ut(nu(e=>({fonts:[],setFonts:t=>e(()=>({fonts:t}))}),{name:"fonts-storage"})),Rg=Ut(e=>({settings:null,setSettings:t=>e(()=>({settings:t})),isLoadingSettings:!0,setIsLoadingSettings:t=>e(()=>({isLoadingSettings:t}))})),Dg=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=Ci();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}))})),Bn=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:wo.getState().themeSettings,layers:fn.getState().blocks,header:fn.getState().header,footer:fn.getState().footer,announcement:fn.getState().announcement};e({past:o,future:[i,...r]}),a.themeSettings&&wo.setState({themeSettings:a.themeSettings}),a.layers&&fn.setState({blocks:a.layers}),a.header&&fn.setState({header:a.header}),a.footer&&fn.setState({footer:a.footer}),a.announcement&&fn.setState({announcement:a.announcement})},redo:()=>{const{past:n,future:r}=t();if(r.length===0)return;const a=r[0],o=r.slice(1),i={themeSettings:wo.getState().themeSettings,layers:fn.getState().blocks,header:fn.getState().header,footer:fn.getState().footer,announcement:fn.getState().announcement};e({past:[...n,i],future:o}),a.themeSettings&&wo.setState({themeSettings:a.themeSettings}),a.layers&&fn.setState({blocks:a.layers}),a.header&&fn.setState({header:a.header}),a.footer&&fn.setState({footer:a.footer}),a.announcement&&fn.setState({announcement:a.announcement})}})),Og=Ut(e=>({isOpenModal:!1,setIsOpenModal:t=>e(()=>({isOpenModal:t}))})),fs=Ut(e=>({notification:null,setNotification:t=>e(()=>({notification:t}))})),Ig=Ut(e=>({error:null,setError:t=>e(()=>({error:t}))})),Mg=Ut(e=>({title:null,description:null,onConfirm:null,setTitle:t=>e(()=>({title:t})),setDescription:t=>e(()=>({description:t})),setOnConfirm:t=>e(()=>({onConfirm:t}))})),Bg=Ut(e=>({showTooltip:!1,setShowTooltip:t=>e({showTooltip:t})})),Fd=Ut(e=>({isOpen:!0,setIsOpen:t=>e(()=>({isOpen:t}))})),Fg=Ut(e=>({general:null,setGeneral:t=>e(()=>({general:t}))})),Hg="_icon_bsuj2_1",$g="_hoverable_bsuj2_5",Vg="_rotated_bsuj2_9",$f={icon:Hg,hoverable:$g,rotated:Vg};var C2={exports:{}};/*!
|
|
61
|
+
*/function Wa(){return Wa=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},Wa.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?Lr(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?Lr(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:Wa({},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=Wa({},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 Ji(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:x}=r||{},_=H.useCallback(j=>{x?J7(j):j()},[x]),S=H.useCallback((j,T)=>{let{deletedFetchers:I,unstable_flushSync:A,unstable_viewTransitionOpts:U}=T;I.forEach(X=>b.current.delete(X)),j.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?Ji(()=>o(j)):_(()=>o(j));return}if(A){Ji(()=>{f&&(h&&h.resolve(),f.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:U.currentLocation,nextLocation:U.nextLocation})});let X=n.window.document.startViewTransition(()=>{Ji(()=>o(j))});X.finished.finally(()=>{Ji(()=>{p(void 0),y(void 0),c(void 0),d({isTransitioning:!1})})}),Ji(()=>y(X));return}f?(h&&h.resolve(),f.skipTransition(),m({state:j,currentLocation:U.currentLocation,nextLocation:U.nextLocation})):(c(j),d({isTransitioning:!0,flushSync:!1,currentLocation:U.currentLocation,nextLocation:U.nextLocation}))},[n.window,f,h,b,_]);H.useLayoutEffect(()=>n.subscribe(S),[n,S]),H.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new Q7)},[u]),H.useEffect(()=>{if(h&&i&&n.window){let j=i,T=h.promise,I=n.window.document.startViewTransition(async()=>{_(()=>o(j)),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 w=H.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:j=>n.navigate(j),push:(j,T,I)=>n.navigate(j,{state:T,preventScrollReset:I==null?void 0:I.preventScrollReset}),replace:(j,T,I)=>n.navigate(j,{replace:!0,state:T,preventScrollReset:I==null?void 0:I.preventScrollReset})}),[n]),k=n.basename||"/",L=H.useMemo(()=>({router:n,navigator:w,static:!1,basename:k}),[n,w,k]),D=H.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return H.createElement(H.Fragment,null,H.createElement(Ti.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:w,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(Ir),g,m=!1;if(typeof d=="string"&&ag.test(d)&&(g=d,rg))try{let S=new URL(window.location.href),w=d.startsWith("//")?new URL(S.protocol+d):new URL(d),k=Lr(w.pathname,y);w.origin===S.origin&&k!=null?d=k+w.search+w.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}),x=sg(d,{replace:i,state:c,target:u,preventScrollReset:h,relative:a,unstable_viewTransition:p});function _(S){r&&r(S),S.defaultPrevented||x(S)}return H.createElement("a",Wa({},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=ro(),g=H.useContext(Qc),{navigator:m,basename:b}=H.useContext(Ir),x=g!=null&&fg(f)&&d===!0,_=m.encodeLocation?m.encodeLocation(f).pathname:f.pathname,S=y.pathname,w=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;a||(S=S.toLowerCase(),w=w?w.toLowerCase():null,_=_.toLowerCase()),w&&b&&(w=Lr(w,b)||w);const k=_!=="/"&&_.endsWith("/")?_.length-1:_.length;let L=S===_||!i&&S.startsWith(_)&&S.charAt(k)==="/",D=w!=null&&(w===_||!i&&w.startsWith(_)&&w.charAt(_.length)==="/"),j={isActive:L,isPending:D,isTransitioning:x},T=L?r:void 0,I;typeof o=="function"?I=o(j):I=[o,L?"active":null,D?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let A=typeof c=="function"?c(j):c;return H.createElement(h2,Wa({},p,{"aria-current":T,className:I,ref:n,style:A,to:u,unstable_viewTransition:d}),typeof h=="function"?h(j):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",x=_=>{if(d&&d(_),_.defaultPrevented)return;_.preventDefault();let S=_.nativeEvent.submitter,w=(S==null?void 0:S.getAttribute("formmethod"))||c;g(S||_.currentTarget,{fetcherKey:n,method:w,navigate:r,replace:o,state:i,relative:h,preventScrollReset:p,unstable_viewTransition:f})};return H.createElement("form",Wa({ref:t,method:b,action:m,onSubmit:a?d:x},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(Ti);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=hr(),d=ro(),h=rl(e,{relative:i});return H.useCallback(p=>{if(B7(p,n)){p.preventDefault();let f=r!==void 0?r:Ua(d)===Ua(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=ro(),a=H.useMemo(()=>F7(r.search,n.current?null:t.current),[r.search]),o=hr(),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(Ir),n=E7();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(Ir),a=H.useContext(Mr);a||(process.env.NODE_ENV!=="production"?Te(!1,"useFormAction must be used inside a RouteContext"):Te(!1));let[o]=a.matches.slice(-1),i=Wa({},rl(e||".",{relative:n})),c=ro();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:Qr([r,i.pathname])),Ua(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=Lr(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=Lr(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=>({header:null,footer:null,announcement:null,setHeader:t=>e(()=>({header:t})),setFooter:t=>e(()=>({footer:t})),setAnnouncement:t=>e(()=>({announcement:t})),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",v2=["/","/reviews","/faqs","/contact","/products","/ticket","/login"],xg={"/":{path:"/",name:"Home",icon:"HouseSimple",seo:{pageDescription:"",pageTitle:""},visibility:"public"},"/products":{path:"/products",name:"products",icon:"SquaresFour",seo:{pageDescription:"",pageTitle:""},visibility:"public"},"/faqs":{path:"/faqs",name:"faqs",icon:"SealQuestion",seo:{pageDescription:"",pageTitle:""},visibility:"public"},"/reviews":{path:"/reviews",name:"reviews",icon:"Star",seo:{pageDescription:"",pageTitle:""},visibility:"public"},"/contact":{path:"/contact",name:"contact",icon:"ChatCentered",seo:{pageDescription:"",pageTitle:""},visibility:"public"},"/ticket":{path:"/ticket",name:"ticket",icon:"Ticket",seo:{pageDescription:"",pageTitle:""},visibility:"public"},"/login":{path:"/login",name:"login",icon:"UserCircleGear",seo:{pageDescription:"",pageTitle:""},visibility:"public"}},wg=window.location.hostname.includes("localhost"),Sg=Ut(e=>({activeBlock:g2[0],setActiveBlock:t=>e(()=>({activeBlock:t}))}));function jg(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)}}}},kg=(e,t)=>(n,r,a)=>{let o={storage:jg(()=>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 S;return _((S=r())!=null?S:f)});const x=((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 S;const[w,k]=_;if(y=o.merge(k,(S=r())!=null?S:f),n(y,!0),w)return h()}).then(()=>{x==null||x(y,void 0),y=r(),i=!0,u.forEach(_=>_(y))}).catch(_=>{x==null||x(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=kg,y2=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 hn=[];for(var Bu=0;Bu<256;++Bu)hn.push((Bu+256).toString(16).slice(1));function Ng(e,t=0){return(hn[e[t+0]]+hn[e[t+1]]+hn[e[t+2]]+hn[e[t+3]]+"-"+hn[e[t+4]]+hn[e[t+5]]+"-"+hn[e[t+6]]+hn[e[t+7]]+"-"+hn[e[t+8]]+hn[e[t+9]]+"-"+hn[e[t+10]]+hn[e[t+11]]+hn[e[t+12]]+hn[e[t+13]]+hn[e[t+14]]+hn[e[t+15]]).toLowerCase()}var Pl,Eg=new Uint8Array(16);function Tg(){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 Pg=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Hf={randomUUID:Pg};function Ci(e,t,n){if(Hf.randomUUID&&!t&&!e)return Hf.randomUUID();e=e||{};var r=e.random||(e.rng||Tg)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Ng(r)}const fn=Ut(nu((e,t)=>({header:null,blocks:{},announcement:null,footer:null,currentBlock:null,positionBlock:null,setBlocks:n=>{e({blocks:n})},setHeader:n=>{const r=structuredClone(t().header)||JSON.parse(JSON.stringify(t().header));Bn.getState().addHistory({header:r}),e({header:n})},setFooter:n=>{const r=structuredClone(t().footer)||JSON.parse(JSON.stringify(t().footer));Bn.getState().addHistory({footer:r}),e({footer:n})},setAnnouncement:n=>{const r=structuredClone(t().announcement)||JSON.parse(JSON.stringify(t().announcement));Bn.getState().addHistory({announcement:r}),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));Bn.getState().addHistory({layers:a});const o={...t().blocks},i=o[n]||{data:{},order:[]},c=t().positionBlock,u=Ci(),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));Bn.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);Bn.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(Bn.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);Bn.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=Ci(),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}),y2.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,announcement:a}=e;return{blocks:t,header:n,footer:r,announcement:a}}})),Lg=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})}})),wo=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:"700",size:48,boldWeight:"900"},h2:{font:"Archivo",weight:"700",size:32,boldWeight:"800"},h3:{font:"Archivo",weight:"600",size:24,boldWeight:"700"},h4:{font:"Archivo",weight:"500",size:16,boldWeight:"700"},h5:{font:"Archivo",weight:"400",size:16,boldWeight:"700"},h6:{font:"Archivo",weight:"400",size:14,boldWeight:"700"},h7:{font:"Archivo",weight:"400",size:14,boldWeight:"700"}},body:{lg:{font:"Archivo",size:16,weight:"400",boldWeight:"700"},md:{font:"Archivo",size:14,weight:"400",boldWeight:"700"},sm:{font:"Archivo",size:12,weight:"400",boldWeight:"700"}}}},borders:{radius:"var(--radius-lg)",thickness:"var(--border-none)"},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);Bn.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);Bn.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);Bn.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);Bn.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);Bn.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 Bn.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}))})),Ag=Ut(nu(e=>({fonts:[],setFonts:t=>e(()=>({fonts:t}))}),{name:"fonts-storage"})),Rg=Ut(e=>({settings:null,setSettings:t=>e(()=>({settings:t})),isLoadingSettings:!0,setIsLoadingSettings:t=>e(()=>({isLoadingSettings:t}))})),Dg=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=Ci();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}))})),Bn=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:wo.getState().themeSettings,layers:fn.getState().blocks,header:fn.getState().header,footer:fn.getState().footer,announcement:fn.getState().announcement};e({past:o,future:[i,...r]}),a.themeSettings&&wo.setState({themeSettings:a.themeSettings}),a.layers&&fn.setState({blocks:a.layers}),a.header&&fn.setState({header:a.header}),a.footer&&fn.setState({footer:a.footer}),a.announcement&&fn.setState({announcement:a.announcement})},redo:()=>{const{past:n,future:r}=t();if(r.length===0)return;const a=r[0],o=r.slice(1),i={themeSettings:wo.getState().themeSettings,layers:fn.getState().blocks,header:fn.getState().header,footer:fn.getState().footer,announcement:fn.getState().announcement};e({past:[...n,i],future:o}),a.themeSettings&&wo.setState({themeSettings:a.themeSettings}),a.layers&&fn.setState({blocks:a.layers}),a.header&&fn.setState({header:a.header}),a.footer&&fn.setState({footer:a.footer}),a.announcement&&fn.setState({announcement:a.announcement})}})),Og=Ut(e=>({isOpenModal:!1,setIsOpenModal:t=>e(()=>({isOpenModal:t}))})),fs=Ut(e=>({notification:null,setNotification:t=>e(()=>({notification:t}))})),Ig=Ut(e=>({error:null,setError:t=>e(()=>({error:t}))})),Mg=Ut(e=>({title:null,description:null,onConfirm:null,setTitle:t=>e(()=>({title:t})),setDescription:t=>e(()=>({description:t})),setOnConfirm:t=>e(()=>({onConfirm:t}))})),Bg=Ut(e=>({showTooltip:!1,setShowTooltip:t=>e({showTooltip:t})})),Fd=Ut(e=>({isOpen:!0,setIsOpen:t=>e(()=>({isOpen:t}))})),Fg=Ut(e=>({general:null,setGeneral:t=>e(()=>({general:t}))})),Hg="_icon_bsuj2_1",$g="_hoverable_bsuj2_5",Vg="_rotated_bsuj2_9",$f={icon:Hg,hoverable:$g,rotated:Vg};var C2={exports:{}};/*!
|
|
62
62
|
Copyright (c) 2018 Jed Watson.
|
|
63
63
|
Licensed under the MIT License (MIT), see
|
|
64
64
|
http://jedwatson.github.io/classnames
|
|
@@ -67,7 +67,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
67
67
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(a=>r.set(a)),r}static accessor(t){const r=(this[Jf]=this[Jf]={accessors:{}}).accessors,a=this.prototype;function o(i){const c=Qi(i);r[c]||(Y9(a,i),r[c]=!0)}return Y.isArray(t)?t.forEach(o):o(t),this}}Yn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Y.reduceDescriptors(Yn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});Y.freezeMethods(Yn);function Uu(e,t){const n=this||ol,r=t||n,a=Yn.from(r.headers);let o=r.data;return Y.forEach(e,function(c){o=c.call(n,o,a.normalize(),t?t.status:void 0)}),a.normalize(),o}function W2(e){return!!(e&&e.__CANCEL__)}function Ai(e,t,n){Fe.call(this,e??"canceled",Fe.ERR_CANCELED,t,n),this.name="CanceledError"}Y.inherits(Ai,Fe,{__CANCEL__:!0});function q2(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Fe("Request failed with status code "+n.status,[Fe.ERR_BAD_REQUEST,Fe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function K9(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function X9(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a=0,o=0,i;return t=t!==void 0?t:1e3,function(u){const d=Date.now(),h=r[o];i||(i=d),n[a]=u,r[a]=d;let p=o,f=0;for(;p!==a;)f+=n[p++],p=p%e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),d-i<t)return;const y=h&&d-h;return y?Math.round(f*1e3/y):void 0}}function J9(e,t){let n=0,r=1e3/t,a,o;const i=(d,h=Date.now())=>{n=h,a=null,o&&(clearTimeout(o),o=null),e.apply(null,d)};return[(...d)=>{const h=Date.now(),p=h-n;p>=r?i(d,h):(a=d,o||(o=setTimeout(()=>{o=null,i(a)},r-p)))},()=>a&&i(a)]}const bc=(e,t,n=3)=>{let r=0;const a=X9(50,250);return J9(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,u=i-r,d=a(u),h=i<=c;r=i;const p={loaded:i,total:c,progress:c?i/c:void 0,bytes:u,rate:d||void 0,estimated:d&&c&&h?(c-i)/d:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(p)},n)},Qf=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ep=e=>(...t)=>Y.asap(()=>e(...t)),Q9=Gn.hasStandardBrowserEnv?function(){const t=Gn.navigator&&/(msie|trident)/i.test(Gn.navigator.userAgent),n=document.createElement("a");let r;function a(o){let i=o;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=a(window.location.href),function(i){const c=Y.isString(i)?a(i):i;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}(),ev=Gn.hasStandardBrowserEnv?{write(e,t,n,r,a,o){const i=[e+"="+encodeURIComponent(t)];Y.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),Y.isString(r)&&i.push("path="+r),Y.isString(a)&&i.push("domain="+a),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function tv(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function nv(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function z2(e,t){return e&&!tv(t)?nv(e,t):t}const tp=e=>e instanceof Yn?{...e}:e;function Ao(e,t){t=t||{};const n={};function r(d,h,p){return Y.isPlainObject(d)&&Y.isPlainObject(h)?Y.merge.call({caseless:p},d,h):Y.isPlainObject(h)?Y.merge({},h):Y.isArray(h)?h.slice():h}function a(d,h,p){if(Y.isUndefined(h)){if(!Y.isUndefined(d))return r(void 0,d,p)}else return r(d,h,p)}function o(d,h){if(!Y.isUndefined(h))return r(void 0,h)}function i(d,h){if(Y.isUndefined(h)){if(!Y.isUndefined(d))return r(void 0,d)}else return r(void 0,h)}function c(d,h,p){if(p in t)return r(d,h);if(p in e)return r(void 0,d)}const u={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(d,h)=>a(tp(d),tp(h),!0)};return Y.forEach(Object.keys(Object.assign({},e,t)),function(h){const p=u[h]||a,f=p(e[h],t[h],h);Y.isUndefined(f)&&p!==c||(n[h]=f)}),n}const Z2=e=>{const t=Ao({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:o,headers:i,auth:c}=t;t.headers=i=Yn.from(i),t.url=$2(z2(t.baseURL,t.url),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let u;if(Y.isFormData(n)){if(Gn.hasStandardBrowserEnv||Gn.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((u=i.getContentType())!==!1){const[d,...h]=u?u.split(";").map(p=>p.trim()).filter(Boolean):[];i.setContentType([d||"multipart/form-data",...h].join("; "))}}if(Gn.hasStandardBrowserEnv&&(r&&Y.isFunction(r)&&(r=r(t)),r||r!==!1&&Q9(t.url))){const d=a&&o&&ev.read(o);d&&i.set(a,d)}return t},rv=typeof XMLHttpRequest<"u",av=rv&&function(e){return new Promise(function(n,r){const a=Z2(e);let o=a.data;const i=Yn.from(a.headers).normalize();let{responseType:c,onUploadProgress:u,onDownloadProgress:d}=a,h,p,f,y,g;function m(){y&&y(),g&&g(),a.cancelToken&&a.cancelToken.unsubscribe(h),a.signal&&a.signal.removeEventListener("abort",h)}let b=new XMLHttpRequest;b.open(a.method.toUpperCase(),a.url,!0),b.timeout=a.timeout;function x(){if(!b)return;const S=Yn.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),k={data:!c||c==="text"||c==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:S,config:e,request:b};q2(function(D){n(D),m()},function(D){r(D),m()},k),b=null}"onloadend"in b?b.onloadend=x:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(x)},b.onabort=function(){b&&(r(new Fe("Request aborted",Fe.ECONNABORTED,e,b)),b=null)},b.onerror=function(){r(new Fe("Network Error",Fe.ERR_NETWORK,e,b)),b=null},b.ontimeout=function(){let w=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const k=a.transitional||V2;a.timeoutErrorMessage&&(w=a.timeoutErrorMessage),r(new Fe(w,k.clarifyTimeoutError?Fe.ETIMEDOUT:Fe.ECONNABORTED,e,b)),b=null},o===void 0&&i.setContentType(null),"setRequestHeader"in b&&Y.forEach(i.toJSON(),function(w,k){b.setRequestHeader(k,w)}),Y.isUndefined(a.withCredentials)||(b.withCredentials=!!a.withCredentials),c&&c!=="json"&&(b.responseType=a.responseType),d&&([f,g]=bc(d,!0),b.addEventListener("progress",f)),u&&b.upload&&([p,y]=bc(u),b.upload.addEventListener("progress",p),b.upload.addEventListener("loadend",y)),(a.cancelToken||a.signal)&&(h=S=>{b&&(r(!S||S.type?new Ai(null,e,b):S),b.abort(),b=null)},a.cancelToken&&a.cancelToken.subscribe(h),a.signal&&(a.signal.aborted?h():a.signal.addEventListener("abort",h)));const _=K9(a.url);if(_&&Gn.protocols.indexOf(_)===-1){r(new Fe("Unsupported protocol "+_+":",Fe.ERR_BAD_REQUEST,e));return}b.send(o||null)})},ov=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,a;const o=function(d){if(!a){a=!0,c();const h=d instanceof Error?d:this.reason;r.abort(h instanceof Fe?h:new Ai(h instanceof Error?h.message:h))}};let i=t&&setTimeout(()=>{i=null,o(new Fe(`timeout ${t} of ms exceeded`,Fe.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(o):d.removeEventListener("abort",o)}),e=null)};e.forEach(d=>d.addEventListener("abort",o));const{signal:u}=r;return u.unsubscribe=()=>Y.asap(c),u}},iv=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,a;for(;r<n;)a=r+t,yield e.slice(r,a),r=a},sv=async function*(e,t){for await(const n of lv(e))yield*iv(n,t)},lv=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},np=(e,t,n,r)=>{const a=sv(e,t);let o=0,i,c=u=>{i||(i=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:d,value:h}=await a.next();if(d){c(),u.close();return}let p=h.byteLength;if(n){let f=o+=p;n(f)}u.enqueue(new Uint8Array(h))}catch(d){throw c(d),d}},cancel(u){return c(u),a.return()}},{highWaterMark:2})},su=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",G2=su&&typeof ReadableStream=="function",cv=su&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Y2=(e,...t)=>{try{return!!e(...t)}catch{return!1}},uv=G2&&Y2(()=>{let e=!1;const t=new Request(Gn.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),rp=64*1024,H1=G2&&Y2(()=>Y.isReadableStream(new Response("").body)),_c={stream:H1&&(e=>e.body)};su&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!_c[t]&&(_c[t]=Y.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Fe(`Response type '${t}' is not supported`,Fe.ERR_NOT_SUPPORT,r)})})})(new Response);const dv=async e=>{if(e==null)return 0;if(Y.isBlob(e))return e.size;if(Y.isSpecCompliantForm(e))return(await new Request(Gn.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(Y.isArrayBufferView(e)||Y.isArrayBuffer(e))return e.byteLength;if(Y.isURLSearchParams(e)&&(e=e+""),Y.isString(e))return(await cv(e)).byteLength},hv=async(e,t)=>{const n=Y.toFiniteNumber(e.getContentLength());return n??dv(t)},fv=su&&(async e=>{let{url:t,method:n,data:r,signal:a,cancelToken:o,timeout:i,onDownloadProgress:c,onUploadProgress:u,responseType:d,headers:h,withCredentials:p="same-origin",fetchOptions:f}=Z2(e);d=d?(d+"").toLowerCase():"text";let y=ov([a,o&&o.toAbortSignal()],i),g;const m=y&&y.unsubscribe&&(()=>{y.unsubscribe()});let b;try{if(u&&uv&&n!=="get"&&n!=="head"&&(b=await hv(h,r))!==0){let k=new Request(t,{method:"POST",body:r,duplex:"half"}),L;if(Y.isFormData(r)&&(L=k.headers.get("content-type"))&&h.setContentType(L),k.body){const[D,j]=Qf(b,bc(ep(u)));r=np(k.body,rp,D,j)}}Y.isString(p)||(p=p?"include":"omit");const x="credentials"in Request.prototype;g=new Request(t,{...f,signal:y,method:n.toUpperCase(),headers:h.normalize().toJSON(),body:r,duplex:"half",credentials:x?p:void 0});let _=await fetch(g);const S=H1&&(d==="stream"||d==="response");if(H1&&(c||S&&m)){const k={};["status","statusText","headers"].forEach(T=>{k[T]=_[T]});const L=Y.toFiniteNumber(_.headers.get("content-length")),[D,j]=c&&Qf(L,bc(ep(c),!0))||[];_=new Response(np(_.body,rp,D,()=>{j&&j(),m&&m()}),k)}d=d||"text";let w=await _c[Y.findKey(_c,d)||"text"](_,e);return!S&&m&&m(),await new Promise((k,L)=>{q2(k,L,{data:w,headers:Yn.from(_.headers),status:_.status,statusText:_.statusText,config:e,request:g})})}catch(x){throw m&&m(),x&&x.name==="TypeError"&&/fetch/i.test(x.message)?Object.assign(new Fe("Network Error",Fe.ERR_NETWORK,e,g),{cause:x.cause||x}):Fe.from(x,x&&x.code,e,g)}}),$1={http:E9,xhr:av,fetch:fv};Y.forEach($1,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ap=e=>`- ${e}`,pv=e=>Y.isFunction(e)||e===null||e===!1,K2={getAdapter:e=>{e=Y.isArray(e)?e:[e];const{length:t}=e;let n,r;const a={};for(let o=0;o<t;o++){n=e[o];let i;if(r=n,!pv(n)&&(r=$1[(i=String(n)).toLowerCase()],r===void 0))throw new Fe(`Unknown adapter '${i}'`);if(r)break;a[i||"#"+o]=r}if(!r){const o=Object.entries(a).map(([c,u])=>`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since :
|
|
68
68
|
`+o.map(ap).join(`
|
|
69
69
|
`):" "+ap(o[0]):"as no adapter specified";throw new Fe("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:$1};function Wu(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ai(null,e)}function op(e){return Wu(e),e.headers=Yn.from(e.headers),e.data=Uu.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),K2.getAdapter(e.adapter||ol.adapter)(e).then(function(r){return Wu(e),r.data=Uu.call(e,e.transformResponse,r),r.headers=Yn.from(r.headers),r},function(r){return W2(r)||(Wu(e),r&&r.response&&(r.response.data=Uu.call(e,e.transformResponse,r.response),r.response.headers=Yn.from(r.response.headers))),Promise.reject(r)})}const X2="1.7.7",Wd={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Wd[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const ip={};Wd.transitional=function(t,n,r){function a(o,i){return"[Axios v"+X2+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,c)=>{if(t===!1)throw new Fe(a(i," has been removed"+(n?" in "+n:"")),Fe.ERR_DEPRECATED);return n&&!ip[i]&&(ip[i]=!0,console.warn(a(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}};function mv(e,t,n){if(typeof e!="object")throw new Fe("options must be an object",Fe.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const o=r[a],i=t[o];if(i){const c=e[o],u=c===void 0||i(c,o,e);if(u!==!0)throw new Fe("option "+o+" must be "+u,Fe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Fe("Unknown option "+o,Fe.ERR_BAD_OPTION)}}const V1={assertOptions:mv,validators:Wd},Na=V1.validators;class No{constructor(t){this.defaults=t,this.interceptors={request:new Xf,response:new Xf}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let a;Error.captureStackTrace?Error.captureStackTrace(a={}):a=new Error;const o=a.stack?a.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
70
|
-
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Ao(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:o}=n;r!==void 0&&V1.assertOptions(r,{silentJSONParsing:Na.transitional(Na.boolean),forcedJSONParsing:Na.transitional(Na.boolean),clarifyTimeoutError:Na.transitional(Na.boolean)},!1),a!=null&&(Y.isFunction(a)?n.paramsSerializer={serialize:a}:V1.assertOptions(a,{encode:Na.function,serialize:Na.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&Y.merge(o.common,o[n.method]);o&&Y.forEach(["delete","get","head","post","put","patch","common"],g=>{delete o[g]}),n.headers=Yn.concat(i,o);const c=[];let u=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(u=u&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});const d=[];this.interceptors.response.forEach(function(m){d.push(m.fulfilled,m.rejected)});let h,p=0,f;if(!u){const g=[op.bind(this),void 0];for(g.unshift.apply(g,c),g.push.apply(g,d),f=g.length,h=Promise.resolve(n);p<f;)h=h.then(g[p++],g[p++]);return h}f=c.length;let y=n;for(p=0;p<f;){const g=c[p++],m=c[p++];try{y=g(y)}catch(b){m.call(this,b);break}}try{h=op.call(this,y)}catch(g){return Promise.reject(g)}for(p=0,f=d.length;p<f;)h=h.then(d[p++],d[p++]);return h}getUri(t){t=Ao(this.defaults,t);const n=z2(t.baseURL,t.url);return $2(n,t.params,t.paramsSerializer)}}Y.forEach(["delete","get","head","options"],function(t){No.prototype[t]=function(n,r){return this.request(Ao(r||{},{method:t,url:n,data:(r||{}).data}))}});Y.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,c){return this.request(Ao(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}No.prototype[t]=n(),No.prototype[t+"Form"]=n(!0)});class qd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(a=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](a);r._listeners=null}),this.promise.then=a=>{let o;const i=new Promise(c=>{r.subscribe(c),o=c}).then(a);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new Ai(o,i,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new qd(function(a){t=a}),cancel:t}}}function gv(e){return function(n){return e.apply(null,n)}}function vv(e){return Y.isObject(e)&&e.isAxiosError===!0}const U1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(U1).forEach(([e,t])=>{U1[t]=e});function J2(e){const t=new No(e),n=T2(No.prototype.request,t);return Y.extend(n,No.prototype,t,{allOwnKeys:!0}),Y.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return J2(Ao(e,a))},n}const At=J2(ol);At.Axios=No;At.CanceledError=Ai;At.CancelToken=qd;At.isCancel=W2;At.VERSION=X2;At.toFormData=iu;At.AxiosError=Fe;At.Cancel=At.CanceledError;At.all=function(t){return Promise.all(t)};At.spread=gv;At.isAxiosError=vv;At.mergeConfig=Ao;At.AxiosHeaders=Yn;At.formToJSON=e=>U2(Y.isHTMLForm(e)?new FormData(e):e);At.getAdapter=K2.getAdapter;At.HttpStatusCode=U1;At.default=At;const Al="https://localhost:5043",zd=async e=>{const{url:t,withToken:n,method:r,body:a,contentType:o}=e,i=n?localStorage.getItem("sellerAccessToken"):null,c=localStorage.getItem("dv");let u;switch(r){case"get":u=await At.get(c?Al:t,{headers:{Authorization:`Bearer ${i}`,"Content-Type":o||"application/json"}});break;case"post":u=await At.post(c?Al:t,a,{headers:{Authorization:`Bearer ${i}`,"Content-Type":o||"application/json"}});break;case"put":u=await At.put(c?Al:t,a,{headers:{Authorization:`Bearer ${i}`,"Content-Type":o||"application/json"}});break;case"delete":u=await At.delete(c?Al:t,{headers:{Authorization:`Bearer ${i}`,"Content-Type":o||"application/json"}});break}return{data:u.data,status:u.status}},yv=async()=>{const e=localStorage.getItem("shopId")||void 0,t=`${Id}/v1/dash/shops/${e}/images`;return await zd({url:t,withToken:!0,method:"get"})},Cv=async e=>{const t=localStorage.getItem("shopId")||void 0,n=`${Id}/v1/dash/shops/${t}/images`;return await zd({url:n,withToken:!0,method:"post",body:e,contentType:"mutlipart/form-data"})},bv="_customCheckbox_w9x8g_1",_v="_checkboxBox_w9x8g_7",xv="_checked_w9x8g_23",wv="_icon_w9x8g_31",Rl={customCheckbox:bv,checkboxBox:_v,checked:xv,icon:wv},Sv=e=>{const{value:t,onChange:n}=e,[r,a]=C.useState(t),o=()=>{a(!r),n(!r)};return C.useEffect(()=>{a(t)},[t]),P.jsxs("label",{className:Rl.customCheckbox,onClick:i=>i.stopPropagation(),children:[P.jsx("input",{type:"checkbox",checked:r,onChange:o,style:{display:"none"}}),P.jsx("span",{className:Ot(Rl.checkboxBox,{[Rl.checked]:r})}),r&&P.jsx("div",{className:Rl.icon,children:P.jsx(pt,{name:"Check",width:14,height:14,fill:"#ff3f19"})})]})},jv="_button_1gxoe_1",kv="_primary_1gxoe_14",Nv="_secondary_1gxoe_22",Ev="_tertiary_1gxoe_30",Tv="_content_1gxoe_38",Pv="_withoutHover_1gxoe_45",Qo={button:jv,primary:kv,secondary:Nv,tertiary:Ev,content:Tv,withoutHover:Pv},xc=e=>{const{children:t,onClick:n,style:r,className:a,disabled:o=!1,size:i="m",type:c="Primary",withoutHover:u=!1}=e;return P.jsx("button",{className:Ot(Qo.button,a,{[Qo.primary]:c==="Primary",[Qo.secondary]:c==="Secondary",[Qo.tertiary]:c==="Tertiary",[Qo.withoutHover]:u}),onClick:n,style:{...r,fontSize:i==="m"?14:i==="s"?12:16},disabled:o,children:c==="Tertiary"?P.jsxs("div",{className:Qo.content,children:[t,P.jsx(pt,{name:"ArrowRight",fill:"#757575",width:20,height:20})]}):P.jsx(P.Fragment,{children:t})})},Lv="_tip_q9ixw_1",Av="_text_q9ixw_12",Rv="_warning_q9ixw_18",Dv="_error_q9ixw_23",Ov="_success_q9ixw_28",Iv="_hide_q9ixw_33",ei={tip:Lv,text:Av,warning:Rv,error:Dv,success:Ov,hide:Iv},sp={warning:"#C1972A",error:"#FF3F19",success:"#338B13"},Q2=e=>{const{type:t,message:n,style:r,padding:a}=e,[o,i]=C.useState(!1);return P.jsx("div",{style:{padding:a},children:P.jsxs("div",{className:Ot(ei.tip,{[ei.warning]:t==="warning",[ei.error]:t==="error",[ei.success]:t==="success",[ei.hide]:o}),style:r,children:[P.jsx("div",{children:P.jsx(pt,{name:"Info",fill:sp[t],width:20,height:20})}),P.jsx("div",{className:ei.text,children:n}),P.jsx("div",{children:P.jsx(pt,{name:"X",fill:sp[t],width:20,height:20,hoverable:!0,onClick:()=>i(!0)})})]})})},il=e=>{const{label:t,onChange:n,activeImage:r,tip:a}=e,{setOpenModal:o,setOnChange:i,setTip:c}=Bd();return P.jsx(P.Fragment,{children:P.jsxs("div",{className:Lt.wrapper,onClick:u=>u.stopPropagation(),children:[t&&P.jsx("h4",{className:Lt.label,children:t}),P.jsxs("div",{onClick:()=>{i(n),o(!0),a&&c(a)},className:Lt.content,children:[P.jsx("div",{className:Lt.icon,children:r?P.jsx("img",{src:`https://imagedelivery.net/${r}/w=156,h=156`,alt:"image",style:{width:"20px",height:"20px",objectFit:"contain"}}):P.jsx(pt,{name:"Plus",width:20,height:20,fill:"#757575"})}),P.jsx("span",{className:Lt.text,children:r?"Change Image":"Select Image"})]})]})})},Mv=()=>{const{setOpenModal:e,onChange:t,tip:n,setTip:r}=Bd(),{setIsOpen:a}=Fd(),[o,i]=C.useState(!1),c=()=>{var _;(_=u.current)==null||_.click()},u=C.useRef(null),[d,h]=C.useState([]),[p,f]=C.useState(!1),y=async _=>{var D;const S=((D=_.target.files)==null?void 0:D[0])||null;if(!S)return;const w=new FormData;w.append("file",S),f(!0);const{data:k}=await Cv(w),L=[...d];L.unshift({...k.data,cfId:k.data.path}),h([...L]),f(!1)},g=_=>{_.preventDefault(),i(!1);const S=_.dataTransfer.files;if(S&&S.length>0){const k={target:{files:[S[0]]}};y(k)}},m=()=>{a(!1),r(""),setTimeout(()=>{e(!1),a(!0)},300)},b=_=>{const S=d.map(w=>({...w,isSelected:w.id===_.id?!w.isSelected:!1}));h([...S])};function x(){const _=d.find(S=>S.isSelected);_&&(t==null||t([_.cfId]))}return C.useEffect(()=>{(async()=>{const{data:S}=await yv(),w=S.data.map(k=>({...k,isSelected:!1}));h(w)})()},[]),P.jsxs("div",{onClick:_=>_.stopPropagation(),className:Lt.modal,children:[P.jsxs("div",{className:Lt.top,children:[P.jsx("h4",{className:Lt.title,children:"Select Image"}),P.jsx(pt,{name:"X",width:20,height:20,hoverable:!0,onClick:m})]}),n&&P.jsx(Q2,{type:"warning",message:n,padding:5}),P.jsx("div",{className:Lt.modalContent,children:P.jsxs("div",{className:Lt.images,children:[P.jsxs("div",{className:Lt.input,onDragOver:_=>_.preventDefault(),onDragEnter:()=>i(!0),onDragLeave:()=>i(!1),onDrop:g,children:[P.jsxs("div",{onClick:c,className:Ot(Lt.add,{[Lt.dragging]:o}),children:[P.jsx("div",{className:Lt.icon,children:P.jsx(pt,{name:"Plus",width:20,height:20,fill:"#757575"})}),P.jsxs("div",{className:Lt.description,children:[P.jsx("span",{children:"Drag and drop images here, or "}),P.jsx("span",{className:Lt.highlight,children:"click to browse"}),P.jsx("br",{}),P.jsx("span",{className:Lt.accent,children:"up to 10MB."})]})]}),P.jsx("input",{type:"file",ref:u,style:{display:"none"},onChange:y,multiple:!1,accept:"image/*"})]}),p&&P.jsx(lp,{}),d.map(_=>P.jsx(Bv,{image:_,updateImage:b},_.id)),d.length===0&&[...new Array(5)].map((_,S)=>P.jsx(lp,{},S))]})}),P.jsxs("div",{className:Lt.bottom,children:[P.jsx(xc,{className:Lt.cancel,onClick:m,type:"Secondary",children:"Cancel"}),P.jsx(xc,{onClick:()=>{e(!1),x()},children:"Select"})]})]})},Bv=e=>{const{image:t,updateImage:n}=e;return P.jsxs("div",{className:Ot(Lt.image,{[Lt.selected]:t.isSelected}),onClick:()=>{n({...t,isSelected:!t.isSelected})},children:[P.jsx("div",{className:Lt.checkbox,children:P.jsx(Sv,{value:t.isSelected,onChange:r=>{n({...t,isSelected:r})}})}),P.jsx("img",{src:`https://imagedelivery.net/${t.cfId}/w=156,h=156`,alt:"image",style:{objectFit:"contain",width:"156px",height:"100px"}})]},t.id)},lp=()=>P.jsx("div",{className:Lt.loading,children:P.jsx("div",{className:Lt.spinner})}),Fv="_title_1jkiw_1",Hv="_subtitle_1jkiw_5",$v="_header_1jkiw_12",Vv="_text_1jkiw_13",Uv="_top_1jkiw_20",Wv="_itemsBlock_1jkiw_29",es={title:Fv,subtitle:Hv,header:$v,text:Vv,top:Uv,itemsBlock:Wv},qv="_typeTexts_167ez_1",zv="_block_167ez_8",Zv="_active_167ez_25",qu={typeTexts:qv,block:zv,active:Zv},Gv=["bold","italic","underline","strike-through"],Zd=e=>{const{typesText:t,setTypesText:n}=e;function r(a){switch(a){case"bold":return"TextB";case"italic":return"TextItalic";case"strike-through":return"TextStrikethrough";case"underline":return"TextUnderline"}}return P.jsx("div",{className:qu.typeTexts,children:Gv.map(a=>P.jsx("div",{className:Ot(qu.block,{[qu.active]:t.includes(a)}),onClick:()=>{const o=[...t];if(o.includes(a)){const i=o.filter(c=>c!==a);n(i)}else o.push(a),n(o)},children:P.jsx(pt,{name:r(a),fill:t.includes(a)?"#252525":"#757575",width:20,height:20})},String(a)))})},Yv="_wrapper_34cvp_1",Kv="_label_34cvp_10",Xv="_textarea_34cvp_18",Jv="_length_34cvp_46",Qv="_full_34cvp_54",ts={wrapper:Yv,label:Kv,textarea:Xv,length:Jv,full:Qv},Gd=e=>{const{onChange:t,label:n,value:r,maxLength:a,placeholder:o="Type something..."}=e,[i,c]=C.useState(r.length);return P.jsxs("div",{className:ts.wrapper,children:[n&&P.jsx("label",{className:ts.label,htmlFor:n,children:n}),P.jsx("textarea",{id:n,value:r,onChange:u=>{c(u.target.value.length),t(u.target.value)},placeholder:o,className:ts.textarea,maxLength:a}),a&&P.jsxs("div",{className:Ot(ts.length,{[ts.full]:i===a}),children:[i,"/",a]})]})},ns={h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",p:"Paragraph"},Yd=e=>{const{typesText:t,isActiveText:n,setIsActiveText:r,text:a,setText:o,setTypesText:i,title:c,subtitle:u="Items",typeFont:d,setTypeFont:h}=e,[p,f]=C.useState([]),y=()=>{const g=document.documentElement,m=getComputedStyle(g),b=["h1","h2","h3","h4","h5","h6"].map(x=>m.getPropertyValue(`--font-heading-${x}-size`).trim());return b.push(m.getPropertyValue("--font-paragraph-text-size").trim()),b};return C.useEffect(()=>{const g=y();g.every(m=>m)&&f(g)},[]),P.jsxs("div",{className:es.text,children:[(c||n!==void 0)&&P.jsxs("div",{className:es.top,children:[c&&P.jsx("h3",{className:es.title,children:c}),n!==void 0&&r&&P.jsx(ao,{current:n,onChange:g=>r(g)})]}),(n===void 0||n)&&P.jsxs("div",{className:es.itemsBlock,children:[P.jsx("h5",{className:es.subtitle,children:u}),P.jsx(Gd,{onChange:g=>o(g),value:a,maxLength:150}),P.jsx(Zd,{typesText:t,setTypesText:i}),P.jsx(Lo,{label:"Type Text",options:Object.values(ns).filter(g=>g!==ns[d]),onChange:g=>h(Object.keys(ns).find(m=>ns[m]===g)),value:ns[d],postfixs:p})]})]})},ey="_title_1c11t_1",ty="_subtitle_1c11t_5",ny="_header_1c11t_12",ry="_text_1c11t_13",ay="_productsBlock_1c11t_14",oy="_top_1c11t_26",iy="_itemsBlock_1c11t_35",sy="_typeTexts_1c11t_41",ly="_block_1c11t_48",cy="_active_1c11t_61",uy="_products_1c11t_14",dy="_product_1c11t_14",hy="_button_1c11t_80",fy="_disabled_1c11t_91",py="_image_1c11t_95",my="_info_1c11t_102",gy="_name_1c11t_114",vy="_buttons_1c11t_118",yy="_modal_1c11t_125",Cy="_link_1c11t_146",by="_modalOptions_1c11t_152",_y="_addButton_1c11t_165",xy="_deleteButton_1c11t_180",wy="_closeIcon_1c11t_192",$t={title:ey,subtitle:ty,header:ny,text:ry,productsBlock:ay,top:oy,itemsBlock:iy,typeTexts:sy,block:ly,active:cy,products:uy,product:dy,button:hy,disabled:fy,image:py,info:my,name:gy,buttons:vy,modal:yy,link:Cy,modalOptions:by,addButton:_y,deleteButton:xy,closeIcon:wy},Sy=C.forwardRef((e,t)=>{const{activeItem:n,setActiveItem:r,popupPosition:a,modalOptions:o,setIsOpenModal:i}=e;Pi(t,()=>{r(null),i(!1)});function c(u,d){return u.length>d?`${u.slice(0,d)}...`:u}return P.jsxs("div",{ref:t,className:$t.modal,onClick:u=>{u.stopPropagation()},style:{top:`${a.top}px`,left:`${a.left}px`},children:[P.jsxs("div",{className:$t.top,children:[P.jsx("h3",{className:$t.title,children:c(n.name["en-US"],20)}),P.jsx("div",{className:$t.closeIcon,children:P.jsx(pt,{name:"X",height:20,width:20,onClick:()=>{r(null),i(!1)}})})]}),P.jsx("div",{className:$t.modalOptions,children:o.map(u=>{if(u.type==="image")return P.jsx(il,{label:"Put up an attractive image",activeImage:n[u.field],onChange:d=>{const h={...n,[u.field]:d};r(h)}},String(u.field));if(u.type==="text")return P.jsx(Yd,{isActiveText:!0,typesText:n[u.field.type],setTypesText:d=>{const h={...n,[u.field.type]:d};r(h)},text:n[u.field.text]["en-US"]||"",setText:d=>{const h={...n,[u.field.text]:{"en-US":d}};r(h)},typeFont:n[u.field.typeFont],setTypeFont:d=>{const h={...n,[u.field.typeFont]:d};r(h)},subtitle:u.label});if(u.type==="input")return P.jsx(Er,{onChange:d=>{const h={...n,[u.field]:d};r(h)},value:n[u.field]||"",label:u.label,placeholder:u.placeholder});if(u.type==="inputSwitch")return P.jsxs("div",{className:$t.link,children:[P.jsx(Er,{onChange:d=>{const h={...n,[u.field.text]:d};r(h)},value:n[u.field.text]||"",label:u.inputLabel,placeholder:u.placeholder}),P.jsx(ao,{current:!!n[u.field.switch]||!1,label:u.switchLabel,onChange:d=>{const h={...n,[u.field.switch]:d};r(h)}})]});if(u.type==="list")return P.jsx(Em,{items:n[u.field]||[],setItems:d=>{const h={...n,[u.field]:d};r(h)},itemsType:"select",draggable:u.draggable||!1,itemsOptions:u.itemsOptions,deletable:u.deletable||!1,editable:u.editable||!1,subtitle:u.label,addableOptions:u.addableOptions,modalOptions:u.modalOptions});if(u.type==="select")return P.jsx(Lo,{options:u.itemsOptions,onChange:d=>{const h={...n,[u.field]:d};r(h)},label:u.label,value:n[u.field]||"String",leftAddon:u.leftAddon&&u.leftAddon==="icon"&&P.jsx(pt,{name:n[u.field]}),switcher:u.switcher?{value:!!n[u.switcher],onChange:d=>{if(u.switcher==="isActive"){const h={...n,[u.switcher]:d};r(h)}}}:void 0})})})]})}),jy="_other_g74jx_1",ky="_subtitle_g74jx_7",Ny="_items_g74jx_14",zu={other:jy,subtitle:ky,items:Ny},em=e=>{const{items:t,title:n="Other"}=e;return P.jsxs("div",{className:zu.other,children:[P.jsx("h5",{className:zu.subtitle,children:n}),P.jsx("div",{className:zu.items,children:t.map((r,a)=>P.jsx(ao,{current:r.isItem,onChange:o=>r.setIsItem(o),label:r.label,hasBackground:!0,paddingless:!1},a))})]})};function Ey(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return C.useMemo(()=>r=>{t.forEach(a=>a(r))},t)}const lu=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ri(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Kd(e){return"nodeType"in e}function Jn(e){var t,n;return e?Ri(e)?e:Kd(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Xd(e){const{Document:t}=Jn(e);return e instanceof t}function sl(e){return Ri(e)?!1:e instanceof Jn(e).HTMLElement}function tm(e){return e instanceof Jn(e).SVGElement}function Di(e){return e?Ri(e)?e.document:Kd(e)?Xd(e)?e:sl(e)||tm(e)?e.ownerDocument:document:document:document}const na=lu?C.useLayoutEffect:C.useEffect;function Jd(e){const t=C.useRef(e);return na(()=>{t.current=e}),C.useCallback(function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return t.current==null?void 0:t.current(...r)},[])}function Ty(){const e=C.useRef(null),t=C.useCallback((r,a)=>{e.current=setInterval(r,a)},[]),n=C.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Ps(e,t){t===void 0&&(t=[e]);const n=C.useRef(e);return na(()=>{n.current!==e&&(n.current=e)},t),n}function ll(e,t){const n=C.useRef();return C.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function wc(e){const t=Jd(e),n=C.useRef(null),r=C.useCallback(a=>{a!==n.current&&(t==null||t(a,n.current)),n.current=a},[]);return[n,r]}function W1(e){const t=C.useRef();return C.useEffect(()=>{t.current=e},[e]),t.current}let Zu={};function cl(e,t){return C.useMemo(()=>{if(t)return t;const n=Zu[e]==null?0:Zu[e]+1;return Zu[e]=n,e+"-"+n},[e,t])}function nm(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return r.reduce((o,i)=>{const c=Object.entries(i);for(const[u,d]of c){const h=o[u];h!=null&&(o[u]=h+e*d)}return o},{...t})}}const gi=nm(1),Sc=nm(-1);function Py(e){return"clientX"in e&&"clientY"in e}function Qd(e){if(!e)return!1;const{KeyboardEvent:t}=Jn(e.target);return t&&e instanceof t}function Ly(e){if(!e)return!1;const{TouchEvent:t}=Jn(e.target);return t&&e instanceof t}function q1(e){if(Ly(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Py(e)?{x:e.clientX,y:e.clientY}:null}const bi=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[bi.Translate.toString(e),bi.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),cp="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Ay(e){return e.matches(cp)?e:e.querySelector(cp)}const Ry={display:"none"};function Dy(e){let{id:t,value:n}=e;return C.createElement("div",{id:t,style:Ry},n)}function Oy(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const a={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return C.createElement("div",{id:t,style:a,role:"status","aria-live":r,"aria-atomic":!0},n)}function Iy(){const[e,t]=C.useState("");return{announce:C.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const rm=C.createContext(null);function My(e){const t=C.useContext(rm);C.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function By(){const[e]=C.useState(()=>new Set),t=C.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[C.useCallback(r=>{let{type:a,event:o}=r;e.forEach(i=>{var c;return(c=i[a])==null?void 0:c.call(i,o)})},[e]),t]}const Fy={draggable:`
|
|
70
|
+
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Ao(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:o}=n;r!==void 0&&V1.assertOptions(r,{silentJSONParsing:Na.transitional(Na.boolean),forcedJSONParsing:Na.transitional(Na.boolean),clarifyTimeoutError:Na.transitional(Na.boolean)},!1),a!=null&&(Y.isFunction(a)?n.paramsSerializer={serialize:a}:V1.assertOptions(a,{encode:Na.function,serialize:Na.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&Y.merge(o.common,o[n.method]);o&&Y.forEach(["delete","get","head","post","put","patch","common"],g=>{delete o[g]}),n.headers=Yn.concat(i,o);const c=[];let u=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(u=u&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});const d=[];this.interceptors.response.forEach(function(m){d.push(m.fulfilled,m.rejected)});let h,p=0,f;if(!u){const g=[op.bind(this),void 0];for(g.unshift.apply(g,c),g.push.apply(g,d),f=g.length,h=Promise.resolve(n);p<f;)h=h.then(g[p++],g[p++]);return h}f=c.length;let y=n;for(p=0;p<f;){const g=c[p++],m=c[p++];try{y=g(y)}catch(b){m.call(this,b);break}}try{h=op.call(this,y)}catch(g){return Promise.reject(g)}for(p=0,f=d.length;p<f;)h=h.then(d[p++],d[p++]);return h}getUri(t){t=Ao(this.defaults,t);const n=z2(t.baseURL,t.url);return $2(n,t.params,t.paramsSerializer)}}Y.forEach(["delete","get","head","options"],function(t){No.prototype[t]=function(n,r){return this.request(Ao(r||{},{method:t,url:n,data:(r||{}).data}))}});Y.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,c){return this.request(Ao(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}No.prototype[t]=n(),No.prototype[t+"Form"]=n(!0)});class qd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(a=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](a);r._listeners=null}),this.promise.then=a=>{let o;const i=new Promise(c=>{r.subscribe(c),o=c}).then(a);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new Ai(o,i,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new qd(function(a){t=a}),cancel:t}}}function gv(e){return function(n){return e.apply(null,n)}}function vv(e){return Y.isObject(e)&&e.isAxiosError===!0}const U1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(U1).forEach(([e,t])=>{U1[t]=e});function J2(e){const t=new No(e),n=T2(No.prototype.request,t);return Y.extend(n,No.prototype,t,{allOwnKeys:!0}),Y.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return J2(Ao(e,a))},n}const At=J2(ol);At.Axios=No;At.CanceledError=Ai;At.CancelToken=qd;At.isCancel=W2;At.VERSION=X2;At.toFormData=iu;At.AxiosError=Fe;At.Cancel=At.CanceledError;At.all=function(t){return Promise.all(t)};At.spread=gv;At.isAxiosError=vv;At.mergeConfig=Ao;At.AxiosHeaders=Yn;At.formToJSON=e=>U2(Y.isHTMLForm(e)?new FormData(e):e);At.getAdapter=K2.getAdapter;At.HttpStatusCode=U1;At.default=At;const Al="https://localhost:5043",zd=async e=>{const{url:t,withToken:n,method:r,body:a,contentType:o}=e,i=n?localStorage.getItem("sellerAccessToken"):null,c=localStorage.getItem("dv");let u;switch(r){case"get":u=await At.get(c?Al:t,{headers:{Authorization:`Bearer ${i}`,"Content-Type":o||"application/json"}});break;case"post":u=await At.post(c?Al:t,a,{headers:{Authorization:`Bearer ${i}`,"Content-Type":o||"application/json"}});break;case"put":u=await At.put(c?Al:t,a,{headers:{Authorization:`Bearer ${i}`,"Content-Type":o||"application/json"}});break;case"delete":u=await At.delete(c?Al:t,{headers:{Authorization:`Bearer ${i}`,"Content-Type":o||"application/json"}});break}return{data:u.data,status:u.status}},yv=async()=>{const e=localStorage.getItem("shopId")||void 0,t=`${Id}/v1/dash/shops/${e}/images`;return await zd({url:t,withToken:!0,method:"get"})},Cv=async e=>{const t=localStorage.getItem("shopId")||void 0,n=`${Id}/v1/dash/shops/${t}/images`;return await zd({url:n,withToken:!0,method:"post",body:e,contentType:"mutlipart/form-data"})},bv="_customCheckbox_w9x8g_1",_v="_checkboxBox_w9x8g_7",xv="_checked_w9x8g_23",wv="_icon_w9x8g_31",Rl={customCheckbox:bv,checkboxBox:_v,checked:xv,icon:wv},Sv=e=>{const{value:t,onChange:n}=e,[r,a]=C.useState(t),o=()=>{a(!r),n(!r)};return C.useEffect(()=>{a(t)},[t]),P.jsxs("label",{className:Rl.customCheckbox,onClick:i=>i.stopPropagation(),children:[P.jsx("input",{type:"checkbox",checked:r,onChange:o,style:{display:"none"}}),P.jsx("span",{className:Ot(Rl.checkboxBox,{[Rl.checked]:r})}),r&&P.jsx("div",{className:Rl.icon,children:P.jsx(pt,{name:"Check",width:14,height:14,fill:"#ff3f19"})})]})},jv="_button_1gxoe_1",kv="_primary_1gxoe_14",Nv="_secondary_1gxoe_22",Ev="_tertiary_1gxoe_30",Tv="_content_1gxoe_38",Pv="_withoutHover_1gxoe_45",Qo={button:jv,primary:kv,secondary:Nv,tertiary:Ev,content:Tv,withoutHover:Pv},xc=e=>{const{children:t,onClick:n,style:r,className:a,disabled:o=!1,size:i="m",type:c="Primary",withoutHover:u=!1}=e;return P.jsx("button",{className:Ot(Qo.button,a,{[Qo.primary]:c==="Primary",[Qo.secondary]:c==="Secondary",[Qo.tertiary]:c==="Tertiary",[Qo.withoutHover]:u}),onClick:n,style:{...r,fontSize:i==="m"?14:i==="s"?12:16},disabled:o,children:c==="Tertiary"?P.jsxs("div",{className:Qo.content,children:[t,P.jsx(pt,{name:"ArrowRight",fill:"#757575",width:20,height:20})]}):P.jsx(P.Fragment,{children:t})})},Lv="_tip_q9ixw_1",Av="_text_q9ixw_12",Rv="_warning_q9ixw_18",Dv="_error_q9ixw_23",Ov="_success_q9ixw_28",Iv="_hide_q9ixw_33",ei={tip:Lv,text:Av,warning:Rv,error:Dv,success:Ov,hide:Iv},sp={warning:"#C1972A",error:"#FF3F19",success:"#338B13"},Q2=e=>{const{type:t,message:n,style:r,padding:a}=e,[o,i]=C.useState(!1);return P.jsx("div",{style:{padding:a},children:P.jsxs("div",{className:Ot(ei.tip,{[ei.warning]:t==="warning",[ei.error]:t==="error",[ei.success]:t==="success",[ei.hide]:o}),style:r,children:[P.jsx("div",{children:P.jsx(pt,{name:"Info",fill:sp[t],width:20,height:20})}),P.jsx("div",{className:ei.text,children:n}),P.jsx("div",{children:P.jsx(pt,{name:"X",fill:sp[t],width:20,height:20,hoverable:!0,onClick:()=>i(!0)})})]})})},il=e=>{const{label:t,onChange:n,activeImage:r,tip:a}=e,{setOpenModal:o,setOnChange:i,setTip:c}=Bd();return P.jsx(P.Fragment,{children:P.jsxs("div",{className:Lt.wrapper,onClick:u=>u.stopPropagation(),children:[t&&P.jsx("h4",{className:Lt.label,children:t}),P.jsxs("div",{onClick:()=>{i(n),o(!0),a&&c(a)},className:Lt.content,children:[P.jsx("div",{className:Lt.icon,children:r?P.jsx("img",{src:`https://imagedelivery.net/${r}/w=156,h=156`,alt:"image",style:{width:"20px",height:"20px",objectFit:"contain"}}):P.jsx(pt,{name:"Plus",width:20,height:20,fill:"#757575"})}),P.jsx("span",{className:Lt.text,children:r?"Change Image":"Select Image"})]})]})})},Mv=()=>{const{setOpenModal:e,onChange:t,tip:n,setTip:r}=Bd(),{setIsOpen:a}=Fd(),[o,i]=C.useState(!1),c=()=>{var _;(_=u.current)==null||_.click()},u=C.useRef(null),[d,h]=C.useState([]),[p,f]=C.useState(!1),y=async _=>{var D;const S=((D=_.target.files)==null?void 0:D[0])||null;if(!S)return;const w=new FormData;w.append("file",S),f(!0);const{data:k}=await Cv(w),L=[...d];L.unshift({...k.data,cfId:k.data.path}),h([...L]),f(!1)},g=_=>{_.preventDefault(),i(!1);const S=_.dataTransfer.files;if(S&&S.length>0){const k={target:{files:[S[0]]}};y(k)}},m=()=>{a(!1),r(""),setTimeout(()=>{e(!1),a(!0)},300)},b=_=>{const S=d.map(w=>({...w,isSelected:w.id===_.id?!w.isSelected:!1}));h([...S])};function x(){const _=d.find(S=>S.isSelected);_&&(t==null||t([_.cfId]))}return C.useEffect(()=>{(async()=>{const{data:S}=await yv(),w=S.data.map(k=>({...k,isSelected:!1}));h(w)})()},[]),P.jsxs("div",{onClick:_=>_.stopPropagation(),className:Lt.modal,children:[P.jsxs("div",{className:Lt.top,children:[P.jsx("h4",{className:Lt.title,children:"Select Image"}),P.jsx(pt,{name:"X",width:20,height:20,hoverable:!0,onClick:m})]}),n&&P.jsx(Q2,{type:"warning",message:n,padding:5}),P.jsx("div",{className:Lt.modalContent,children:P.jsxs("div",{className:Lt.images,children:[P.jsxs("div",{className:Lt.input,onDragOver:_=>_.preventDefault(),onDragEnter:()=>i(!0),onDragLeave:()=>i(!1),onDrop:g,children:[P.jsxs("div",{onClick:c,className:Ot(Lt.add,{[Lt.dragging]:o}),children:[P.jsx("div",{className:Lt.icon,children:P.jsx(pt,{name:"Plus",width:20,height:20,fill:"#757575"})}),P.jsxs("div",{className:Lt.description,children:[P.jsx("span",{children:"Drag and drop images here, or "}),P.jsx("span",{className:Lt.highlight,children:"click to browse"}),P.jsx("br",{}),P.jsx("span",{className:Lt.accent,children:"up to 10MB."})]})]}),P.jsx("input",{type:"file",ref:u,style:{display:"none"},onChange:y,multiple:!1,accept:"image/*"})]}),p&&P.jsx(lp,{}),d.map(_=>P.jsx(Bv,{image:_,updateImage:b},_.id)),d.length===0&&[...new Array(5)].map((_,S)=>P.jsx(lp,{},S))]})}),P.jsxs("div",{className:Lt.bottom,children:[P.jsx(xc,{className:Lt.cancel,onClick:m,type:"Secondary",children:"Cancel"}),P.jsx(xc,{onClick:()=>{e(!1),x()},children:"Select"})]})]})},Bv=e=>{const{image:t,updateImage:n}=e;return P.jsxs("div",{className:Ot(Lt.image,{[Lt.selected]:t.isSelected}),onClick:()=>{n({...t,isSelected:!t.isSelected})},children:[P.jsx("div",{className:Lt.checkbox,children:P.jsx(Sv,{value:t.isSelected,onChange:r=>{n({...t,isSelected:r})}})}),P.jsx("img",{src:`https://imagedelivery.net/${t.cfId}/w=156,h=156`,alt:"image",style:{objectFit:"contain",width:"156px",height:"100px"}})]},t.id)},lp=()=>P.jsx("div",{className:Lt.loading,children:P.jsx("div",{className:Lt.spinner})}),Fv="_title_1jkiw_1",Hv="_subtitle_1jkiw_5",$v="_header_1jkiw_12",Vv="_text_1jkiw_13",Uv="_top_1jkiw_20",Wv="_itemsBlock_1jkiw_29",es={title:Fv,subtitle:Hv,header:$v,text:Vv,top:Uv,itemsBlock:Wv},qv="_typeTexts_167ez_1",zv="_block_167ez_8",Zv="_active_167ez_25",qu={typeTexts:qv,block:zv,active:Zv},Gv=["bold","italic","underline","strike-through"],Zd=e=>{const{typesText:t,setTypesText:n}=e;function r(a){switch(a){case"bold":return"TextB";case"italic":return"TextItalic";case"strike-through":return"TextStrikethrough";case"underline":return"TextUnderline"}}return P.jsx("div",{className:qu.typeTexts,children:Gv.map(a=>P.jsx("div",{className:Ot(qu.block,{[qu.active]:t.includes(a)}),onClick:()=>{const o=[...t];if(o.includes(a)){const i=o.filter(c=>c!==a);n(i)}else o.push(a),n(o)},children:P.jsx(pt,{name:r(a),fill:t.includes(a)?"#252525":"#757575",width:20,height:20})},String(a)))})},Yv="_wrapper_34cvp_1",Kv="_label_34cvp_10",Xv="_textarea_34cvp_18",Jv="_length_34cvp_46",Qv="_full_34cvp_54",ts={wrapper:Yv,label:Kv,textarea:Xv,length:Jv,full:Qv},Gd=e=>{const{onChange:t,label:n,value:r,maxLength:a,placeholder:o="Type something..."}=e,[i,c]=C.useState(r.length);return P.jsxs("div",{className:ts.wrapper,children:[n&&P.jsx("label",{className:ts.label,htmlFor:n,children:n}),P.jsx("textarea",{id:n,value:r,onChange:u=>{c(u.target.value.length),t(u.target.value)},placeholder:o,className:ts.textarea,maxLength:a}),a&&P.jsxs("div",{className:Ot(ts.length,{[ts.full]:i===a}),children:[i,"/",a]})]})},ns={h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",h7:"Heading 7",lg:"Paragraph Large",md:"Paragraph Medium",sm:"Paragraph Small"},Yd=e=>{const{typesText:t,isActiveText:n,setIsActiveText:r,text:a,setText:o,setTypesText:i,title:c,subtitle:u="Items",typeFont:d,setTypeFont:h}=e,[p,f]=C.useState([]),y=()=>{const g=document.documentElement,m=getComputedStyle(g),b=["h1","h2","h3","h4","h5","h6","h7"].map(_=>m.getPropertyValue(`--font-heading-${_}-size`).trim()),x=["lg","md","sm"].map(_=>m.getPropertyValue(`--font-body-${_}-size`).trim());return b.push(...x),b};return C.useEffect(()=>{const g=y();g.every(m=>m)&&f(g)},[]),P.jsxs("div",{className:es.text,children:[(c||n!==void 0)&&P.jsxs("div",{className:es.top,children:[c&&P.jsx("h3",{className:es.title,children:c}),n!==void 0&&r&&P.jsx(ao,{current:n,onChange:g=>r(g)})]}),(n===void 0||n)&&P.jsxs("div",{className:es.itemsBlock,children:[P.jsx("h5",{className:es.subtitle,children:u}),P.jsx(Gd,{onChange:g=>o(g),value:a,maxLength:150}),P.jsx(Zd,{typesText:t,setTypesText:i}),P.jsx(Lo,{label:"Type Text",options:Object.values(ns).filter(g=>g!==ns[d]),onChange:g=>h(Object.keys(ns).find(m=>ns[m]===g)),value:ns[d],postfixs:p})]})]})},ey="_title_1c11t_1",ty="_subtitle_1c11t_5",ny="_header_1c11t_12",ry="_text_1c11t_13",ay="_productsBlock_1c11t_14",oy="_top_1c11t_26",iy="_itemsBlock_1c11t_35",sy="_typeTexts_1c11t_41",ly="_block_1c11t_48",cy="_active_1c11t_61",uy="_products_1c11t_14",dy="_product_1c11t_14",hy="_button_1c11t_80",fy="_disabled_1c11t_91",py="_image_1c11t_95",my="_info_1c11t_102",gy="_name_1c11t_114",vy="_buttons_1c11t_118",yy="_modal_1c11t_125",Cy="_link_1c11t_146",by="_modalOptions_1c11t_152",_y="_addButton_1c11t_165",xy="_deleteButton_1c11t_180",wy="_closeIcon_1c11t_192",$t={title:ey,subtitle:ty,header:ny,text:ry,productsBlock:ay,top:oy,itemsBlock:iy,typeTexts:sy,block:ly,active:cy,products:uy,product:dy,button:hy,disabled:fy,image:py,info:my,name:gy,buttons:vy,modal:yy,link:Cy,modalOptions:by,addButton:_y,deleteButton:xy,closeIcon:wy},Sy=C.forwardRef((e,t)=>{const{activeItem:n,setActiveItem:r,popupPosition:a,modalOptions:o,setIsOpenModal:i}=e;Pi(t,()=>{r(null),i(!1)});function c(u,d){return u.length>d?`${u.slice(0,d)}...`:u}return P.jsxs("div",{ref:t,className:$t.modal,onClick:u=>{u.stopPropagation()},style:{top:`${a.top}px`,left:`${a.left}px`},children:[P.jsxs("div",{className:$t.top,children:[P.jsx("h3",{className:$t.title,children:c(n.name["en-US"],20)}),P.jsx("div",{className:$t.closeIcon,children:P.jsx(pt,{name:"X",height:20,width:20,onClick:()=>{r(null),i(!1)}})})]}),P.jsx("div",{className:$t.modalOptions,children:o.map(u=>{if(u.type==="image")return P.jsx(il,{label:"Put up an attractive image",activeImage:n[u.field],onChange:d=>{const h={...n,[u.field]:d};r(h)}},String(u.field));if(u.type==="text")return P.jsx(Yd,{isActiveText:!0,typesText:n[u.field.type],setTypesText:d=>{const h={...n,[u.field.type]:d};r(h)},text:n[u.field.text]["en-US"]||"",setText:d=>{const h={...n,[u.field.text]:{"en-US":d}};r(h)},typeFont:n[u.field.typeFont],setTypeFont:d=>{const h={...n,[u.field.typeFont]:d};r(h)},subtitle:u.label});if(u.type==="input")return P.jsx(Er,{onChange:d=>{const h={...n,[u.field]:d};r(h)},value:n[u.field]||"",label:u.label,placeholder:u.placeholder});if(u.type==="inputSwitch")return P.jsxs("div",{className:$t.link,children:[P.jsx(Er,{onChange:d=>{const h={...n,[u.field.text]:d};r(h)},value:n[u.field.text]||"",label:u.inputLabel,placeholder:u.placeholder}),P.jsx(ao,{current:!!n[u.field.switch]||!1,label:u.switchLabel,onChange:d=>{const h={...n,[u.field.switch]:d};r(h)}})]});if(u.type==="list")return P.jsx(Em,{items:n[u.field]||[],setItems:d=>{const h={...n,[u.field]:d};r(h)},itemsType:"select",draggable:u.draggable||!1,itemsOptions:u.itemsOptions,deletable:u.deletable||!1,editable:u.editable||!1,subtitle:u.label,addableOptions:u.addableOptions,modalOptions:u.modalOptions});if(u.type==="select")return P.jsx(Lo,{options:u.itemsOptions,onChange:d=>{const h={...n,[u.field]:d};r(h)},label:u.label,value:n[u.field]||"String",leftAddon:u.leftAddon&&u.leftAddon==="icon"&&P.jsx(pt,{name:n[u.field]}),switcher:u.switcher?{value:!!n[u.switcher],onChange:d=>{if(u.switcher==="isActive"){const h={...n,[u.switcher]:d};r(h)}}}:void 0})})})]})}),jy="_other_g74jx_1",ky="_subtitle_g74jx_7",Ny="_items_g74jx_14",zu={other:jy,subtitle:ky,items:Ny},em=e=>{const{items:t,title:n="Other"}=e;return P.jsxs("div",{className:zu.other,children:[P.jsx("h5",{className:zu.subtitle,children:n}),P.jsx("div",{className:zu.items,children:t.map((r,a)=>P.jsx(ao,{current:r.isItem,onChange:o=>r.setIsItem(o),label:r.label,hasBackground:!0,paddingless:!1},a))})]})};function Ey(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return C.useMemo(()=>r=>{t.forEach(a=>a(r))},t)}const lu=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ri(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Kd(e){return"nodeType"in e}function Jn(e){var t,n;return e?Ri(e)?e:Kd(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Xd(e){const{Document:t}=Jn(e);return e instanceof t}function sl(e){return Ri(e)?!1:e instanceof Jn(e).HTMLElement}function tm(e){return e instanceof Jn(e).SVGElement}function Di(e){return e?Ri(e)?e.document:Kd(e)?Xd(e)?e:sl(e)||tm(e)?e.ownerDocument:document:document:document}const na=lu?C.useLayoutEffect:C.useEffect;function Jd(e){const t=C.useRef(e);return na(()=>{t.current=e}),C.useCallback(function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return t.current==null?void 0:t.current(...r)},[])}function Ty(){const e=C.useRef(null),t=C.useCallback((r,a)=>{e.current=setInterval(r,a)},[]),n=C.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Ps(e,t){t===void 0&&(t=[e]);const n=C.useRef(e);return na(()=>{n.current!==e&&(n.current=e)},t),n}function ll(e,t){const n=C.useRef();return C.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function wc(e){const t=Jd(e),n=C.useRef(null),r=C.useCallback(a=>{a!==n.current&&(t==null||t(a,n.current)),n.current=a},[]);return[n,r]}function W1(e){const t=C.useRef();return C.useEffect(()=>{t.current=e},[e]),t.current}let Zu={};function cl(e,t){return C.useMemo(()=>{if(t)return t;const n=Zu[e]==null?0:Zu[e]+1;return Zu[e]=n,e+"-"+n},[e,t])}function nm(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return r.reduce((o,i)=>{const c=Object.entries(i);for(const[u,d]of c){const h=o[u];h!=null&&(o[u]=h+e*d)}return o},{...t})}}const gi=nm(1),Sc=nm(-1);function Py(e){return"clientX"in e&&"clientY"in e}function Qd(e){if(!e)return!1;const{KeyboardEvent:t}=Jn(e.target);return t&&e instanceof t}function Ly(e){if(!e)return!1;const{TouchEvent:t}=Jn(e.target);return t&&e instanceof t}function q1(e){if(Ly(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Py(e)?{x:e.clientX,y:e.clientY}:null}const bi=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[bi.Translate.toString(e),bi.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),cp="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Ay(e){return e.matches(cp)?e:e.querySelector(cp)}const Ry={display:"none"};function Dy(e){let{id:t,value:n}=e;return C.createElement("div",{id:t,style:Ry},n)}function Oy(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const a={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return C.createElement("div",{id:t,style:a,role:"status","aria-live":r,"aria-atomic":!0},n)}function Iy(){const[e,t]=C.useState("");return{announce:C.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const rm=C.createContext(null);function My(e){const t=C.useContext(rm);C.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function By(){const[e]=C.useState(()=>new Set),t=C.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[C.useCallback(r=>{let{type:a,event:o}=r;e.forEach(i=>{var c;return(c=i[a])==null?void 0:c.call(i,o)})},[e]),t]}const Fy={draggable:`
|
|
71
71
|
To pick up a draggable item, press the space bar.
|
|
72
72
|
While dragging, use the arrow keys to move the item.
|
|
73
73
|
Press space again to drop the item in its new position, or press escape to cancel.
|
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-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./builder.cjs.js"),t=require("./index-Dc4CgFbD.cjs");exports.App=e.App;exports.ColorVariables=e.ColorVariables;exports.createTicket=e.createTicket;exports.hotReload=e.hotReload;exports.iconNames=e.iconNames;exports.ReCaptchaProvider=t.q2;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 { q as i, s as l, b as h } from "./index-
|
|
2
|
+
import { q as i, s as l, b as h } from "./index-BPn2qi_o.js";
|
|
3
3
|
export {
|
|
4
4
|
o as App,
|
|
5
5
|
t as ColorVariables,
|
|
@@ -56,5 +56,5 @@ interface ImageProps<T extends ItemBase> extends CommomPropsBase<T> {
|
|
|
56
56
|
itemsOptions?: never;
|
|
57
57
|
}
|
|
58
58
|
type Props<T extends ItemBase> = SelectProps<T> | InputProps<T> | ImageProps<T>;
|
|
59
|
-
export declare const ItemsSettings: <T extends ItemBase>(props: Props<T>) => import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
export declare const ItemsSettings: <T extends ItemBase = ItemBase>(props: Props<T>) => import("react/jsx-runtime").JSX.Element;
|
|
60
60
|
export {};
|
|
@@ -12,7 +12,7 @@ interface Props {
|
|
|
12
12
|
typeFont: TypeFontKeys;
|
|
13
13
|
setTypeFont: (value: TypeFontKeys) => void;
|
|
14
14
|
}
|
|
15
|
-
export type TypeFontKeys = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | '
|
|
16
|
-
export type TypeFontValues = 'Heading 1' | 'Heading 2' | 'Heading 3' | 'Heading 4' | 'Heading 5' | 'Heading 6' | 'Paragraph';
|
|
15
|
+
export type TypeFontKeys = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'h7' | 'lg' | 'md' | 'sm';
|
|
16
|
+
export type TypeFontValues = 'Heading 1' | 'Heading 2' | 'Heading 3' | 'Heading 4' | 'Heading 5' | 'Heading 6' | 'Heading 7' | 'Paragraph Large' | 'Paragraph Medium' | 'Paragraph Small';
|
|
17
17
|
export declare const TextSettings: React.FC<Props>;
|
|
18
18
|
export {};
|