@billgangcom/theme-lib 1.101.5 → 1.101.6
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.cjs.js +3 -3
- package/dist/builder.es.js +6 -5
- package/dist/{index-DVZrX3Xc.js → index-B-ytgN9H.js} +9 -3
- package/dist/{index-DcfdU2iD.cjs → index-nqkL4eku.cjs} +2 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +2 -2
- package/package.json +1 -1
|
@@ -66,11 +66,11 @@ React keys must be passed directly to JSX without using spread:
|
|
|
66
66
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const o=new this(t);return n.forEach(i=>o.set(i)),o}static accessor(t){const o=(this[f1]=this[f1]={accessors:{}}).accessors,i=this.prototype;function a(s){const l=ki(s);o[l]||(eC(i,s),o[l]=!0)}return Y.isArray(t)?t.forEach(a):a(t),this}};Dn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Y.reduceDescriptors(Dn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(o){this[n]=o}}});Y.freezeMethods(Dn);function Ol(e,t){const n=this||Ta,o=t||n,i=Dn.from(o.headers);let a=o.data;return Y.forEach(e,function(l){a=l.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function Tp(e){return!!(e&&e.__CANCEL__)}function ci(e,t,n){je.call(this,e??"canceled",je.ERR_CANCELED,t,n),this.name="CanceledError"}Y.inherits(ci,je,{__CANCEL__:!0});function xp(e,t,n){const o=n.config.validateStatus;!n.status||!o||o(n.status)?e(n):t(new je("Request failed with status code "+n.status,[je.ERR_BAD_REQUEST,je.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function tC(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function nC(e,t){e=e||10;const n=new Array(e),o=new Array(e);let i=0,a=0,s;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),h=o[a];s||(s=u),n[i]=c,o[i]=u;let f=a,g=0;for(;f!==i;)g+=n[f++],f=f%e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),u-s<t)return;const m=h&&u-h;return m?Math.round(g*1e3/m):void 0}}function rC(e,t){let n=0,o=1e3/t,i,a;const s=(u,h=Date.now())=>{n=h,i=null,a&&(clearTimeout(a),a=null),e.apply(null,u)};return[(...u)=>{const h=Date.now(),f=h-n;f>=o?s(u,h):(i=u,a||(a=setTimeout(()=>{a=null,s(i)},o-f)))},()=>i&&s(i)]}const Ps=(e,t,n=3)=>{let o=0;const i=nC(50,250);return rC(a=>{const s=a.loaded,l=a.lengthComputable?a.total:void 0,c=s-o,u=i(c),h=s<=l;o=s;const f={loaded:s,total:l,progress:l?s/l:void 0,bytes:c,rate:u||void 0,estimated:u&&l&&h?(l-s)/u:void 0,event:a,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},n)},p1=(e,t)=>{const n=e!=null;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},m1=e=>(...t)=>Y.asap(()=>e(...t)),oC=bn.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,bn.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(bn.origin),bn.navigator&&/(msie|trident)/i.test(bn.navigator.userAgent)):()=>!0,iC=bn.hasStandardBrowserEnv?{write(e,t,n,o,i,a){const s=[e+"="+encodeURIComponent(t)];Y.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),Y.isString(o)&&s.push("path="+o),Y.isString(i)&&s.push("domain="+i),a===!0&&s.push("secure"),document.cookie=s.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 aC(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function sC(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function _p(e,t,n){let o=!aC(t);return e&&o||n==!1?sC(e,t):t}const g1=e=>e instanceof Dn?{...e}:e;function Po(e,t){t=t||{};const n={};function o(u,h,f,g){return Y.isPlainObject(u)&&Y.isPlainObject(h)?Y.merge.call({caseless:g},u,h):Y.isPlainObject(h)?Y.merge({},h):Y.isArray(h)?h.slice():h}function i(u,h,f,g){if(Y.isUndefined(h)){if(!Y.isUndefined(u))return o(void 0,u,f,g)}else return o(u,h,f,g)}function a(u,h){if(!Y.isUndefined(h))return o(void 0,h)}function s(u,h){if(Y.isUndefined(h)){if(!Y.isUndefined(u))return o(void 0,u)}else return o(void 0,h)}function l(u,h,f){if(f in t)return o(u,h);if(f in e)return o(void 0,u)}const c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(u,h,f)=>i(g1(u),g1(h),f,!0)};return Y.forEach(Object.keys(Object.assign({},e,t)),function(h){const f=c[h]||i,g=f(e[h],t[h],h);Y.isUndefined(g)&&f!==l||(n[h]=g)}),n}const wp=e=>{const t=Po({},e);let{data:n,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:a,headers:s,auth:l}=t;t.headers=s=Dn.from(s),t.url=Sp(_p(t.baseURL,t.url),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let c;if(Y.isFormData(n)){if(bn.hasStandardBrowserEnv||bn.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((c=s.getContentType())!==!1){const[u,...h]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];s.setContentType([u||"multipart/form-data",...h].join("; "))}}if(bn.hasStandardBrowserEnv&&(o&&Y.isFunction(o)&&(o=o(t)),o||o!==!1&&oC(t.url))){const u=i&&a&&iC.read(a);u&&s.set(i,u)}return t},lC=typeof XMLHttpRequest<"u",cC=lC&&function(e){return new Promise(function(n,o){const i=wp(e);let a=i.data;const s=Dn.from(i.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:u}=i,h,f,g,m,C;function I(){m&&m(),C&&C(),i.cancelToken&&i.cancelToken.unsubscribe(h),i.signal&&i.signal.removeEventListener("abort",h)}let b=new XMLHttpRequest;b.open(i.method.toUpperCase(),i.url,!0),b.timeout=i.timeout;function S(){if(!b)return;const T=Dn.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),A={data:!l||l==="text"||l==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:T,config:e,request:b};xp(function(E){n(E),I()},function(E){o(E),I()},A),b=null}"onloadend"in b?b.onloadend=S:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(S)},b.onabort=function(){b&&(o(new je("Request aborted",je.ECONNABORTED,e,b)),b=null)},b.onerror=function(){o(new je("Network Error",je.ERR_NETWORK,e,b)),b=null},b.ontimeout=function(){let k=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const A=i.transitional||yp;i.timeoutErrorMessage&&(k=i.timeoutErrorMessage),o(new je(k,A.clarifyTimeoutError?je.ETIMEDOUT:je.ECONNABORTED,e,b)),b=null},a===void 0&&s.setContentType(null),"setRequestHeader"in b&&Y.forEach(s.toJSON(),function(k,A){b.setRequestHeader(A,k)}),Y.isUndefined(i.withCredentials)||(b.withCredentials=!!i.withCredentials),l&&l!=="json"&&(b.responseType=i.responseType),u&&([g,C]=Ps(u,!0),b.addEventListener("progress",g)),c&&b.upload&&([f,m]=Ps(c),b.upload.addEventListener("progress",f),b.upload.addEventListener("loadend",m)),(i.cancelToken||i.signal)&&(h=T=>{b&&(o(!T||T.type?new ci(null,e,b):T),b.abort(),b=null)},i.cancelToken&&i.cancelToken.subscribe(h),i.signal&&(i.signal.aborted?h():i.signal.addEventListener("abort",h)));const y=tC(i.url);if(y&&bn.protocols.indexOf(y)===-1){o(new je("Unsupported protocol "+y+":",je.ERR_BAD_REQUEST,e));return}b.send(a||null)})},uC=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let o=new AbortController,i;const a=function(u){if(!i){i=!0,l();const h=u instanceof Error?u:this.reason;o.abort(h instanceof je?h:new ci(h instanceof Error?h.message:h))}};let s=t&&setTimeout(()=>{s=null,a(new je(`timeout ${t} of ms exceeded`,je.ETIMEDOUT))},t);const l=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(a):u.removeEventListener("abort",a)}),e=null)};e.forEach(u=>u.addEventListener("abort",a));const{signal:c}=o;return c.unsubscribe=()=>Y.asap(l),c}},dC=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let o=0,i;for(;o<n;)i=o+t,yield e.slice(o,i),o=i},hC=async function*(e,t){for await(const n of fC(e))yield*dC(n,t)},fC=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:o}=await t.read();if(n)break;yield o}}finally{await t.cancel()}},I1=(e,t,n,o)=>{const i=hC(e,t);let a=0,s,l=c=>{s||(s=!0,o&&o(c))};return new ReadableStream({async pull(c){try{const{done:u,value:h}=await i.next();if(u){l(),c.close();return}let f=h.byteLength;if(n){let g=a+=f;n(g)}c.enqueue(new Uint8Array(h))}catch(u){throw l(u),u}},cancel(c){return l(c),i.return()}},{highWaterMark:2})},tl=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",vp=tl&&typeof ReadableStream=="function",pC=tl&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Ap=(e,...t)=>{try{return!!e(...t)}catch{return!1}},mC=vp&&Ap(()=>{let e=!1;const t=new Request(bn.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),C1=64*1024,Mc=vp&&Ap(()=>Y.isReadableStream(new Response("").body)),Rs={stream:Mc&&(e=>e.body)};tl&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Rs[t]&&(Rs[t]=Y.isFunction(e[t])?n=>n[t]():(n,o)=>{throw new je(`Response type '${t}' is not supported`,je.ERR_NOT_SUPPORT,o)})})})(new Response);const gC=async e=>{if(e==null)return 0;if(Y.isBlob(e))return e.size;if(Y.isSpecCompliantForm(e))return(await new Request(bn.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 pC(e)).byteLength},IC=async(e,t)=>{const n=Y.toFiniteNumber(e.getContentLength());return n??gC(t)},CC=tl&&(async e=>{let{url:t,method:n,data:o,signal:i,cancelToken:a,timeout:s,onDownloadProgress:l,onUploadProgress:c,responseType:u,headers:h,withCredentials:f="same-origin",fetchOptions:g}=wp(e);u=u?(u+"").toLowerCase():"text";let m=uC([i,a&&a.toAbortSignal()],s),C;const I=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let b;try{if(c&&mC&&n!=="get"&&n!=="head"&&(b=await IC(h,o))!==0){let A=new Request(t,{method:"POST",body:o,duplex:"half"}),P;if(Y.isFormData(o)&&(P=A.headers.get("content-type"))&&h.setContentType(P),A.body){const[E,M]=p1(b,Ps(m1(c)));o=I1(A.body,C1,E,M)}}Y.isString(f)||(f=f?"include":"omit");const S="credentials"in Request.prototype;C=new Request(t,{...g,signal:m,method:n.toUpperCase(),headers:h.normalize().toJSON(),body:o,duplex:"half",credentials:S?f:void 0});let y=await fetch(C);const T=Mc&&(u==="stream"||u==="response");if(Mc&&(l||T&&I)){const A={};["status","statusText","headers"].forEach(B=>{A[B]=y[B]});const P=Y.toFiniteNumber(y.headers.get("content-length")),[E,M]=l&&p1(P,Ps(m1(l),!0))||[];y=new Response(I1(y.body,C1,E,()=>{M&&M(),I&&I()}),A)}u=u||"text";let k=await Rs[Y.findKey(Rs,u)||"text"](y,e);return!T&&I&&I(),await new Promise((A,P)=>{xp(A,P,{data:k,headers:Dn.from(y.headers),status:y.status,statusText:y.statusText,config:e,request:C})})}catch(S){throw I&&I(),S&&S.name==="TypeError"&&/fetch/i.test(S.message)?Object.assign(new je("Network Error",je.ERR_NETWORK,e,C),{cause:S.cause||S}):je.from(S,S&&S.code,e,C)}}),Bc={http:RI,xhr:cC,fetch:CC};Y.forEach(Bc,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const b1=e=>`- ${e}`,bC=e=>Y.isFunction(e)||e===null||e===!1,kp={getAdapter:e=>{e=Y.isArray(e)?e:[e];const{length:t}=e;let n,o;const i={};for(let a=0;a<t;a++){n=e[a];let s;if(o=n,!bC(n)&&(o=Bc[(s=String(n)).toLowerCase()],o===void 0))throw new je(`Unknown adapter '${s}'`);if(o)break;i[s||"#"+a]=o}if(!o){const a=Object.entries(i).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let s=t?a.length>1?`since :
|
|
67
67
|
`+a.map(b1).join(`
|
|
68
68
|
`):" "+b1(a[0]):"as no adapter specified";throw new je("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return o},adapters:Bc};function Ml(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ci(null,e)}function S1(e){return Ml(e),e.headers=Dn.from(e.headers),e.data=Ol.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),kp.getAdapter(e.adapter||Ta.adapter)(e).then(function(o){return Ml(e),o.data=Ol.call(e,e.transformResponse,o),o.headers=Dn.from(o.headers),o},function(o){return Tp(o)||(Ml(e),o&&o.response&&(o.response.data=Ol.call(e,e.transformResponse,o.response),o.response.headers=Dn.from(o.response.headers))),Promise.reject(o)})}const Lp="1.8.1",nl={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{nl[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});const y1={};nl.transitional=function(t,n,o){function i(a,s){return"[Axios v"+Lp+"] Transitional option '"+a+"'"+s+(o?". "+o:"")}return(a,s,l)=>{if(t===!1)throw new je(i(s," has been removed"+(n?" in "+n:"")),je.ERR_DEPRECATED);return n&&!y1[s]&&(y1[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(a,s,l):!0}};nl.spelling=function(t){return(n,o)=>(console.warn(`${o} is likely a misspelling of ${t}`),!0)};function SC(e,t,n){if(typeof e!="object")throw new je("options must be an object",je.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let i=o.length;for(;i-- >0;){const a=o[i],s=t[a];if(s){const l=e[a],c=l===void 0||s(l,a,e);if(c!==!0)throw new je("option "+a+" must be "+c,je.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new je("Unknown option "+a,je.ERR_BAD_OPTION)}}const Is={assertOptions:SC,validators:nl},Cr=Is.validators;let vo=class{constructor(t){this.defaults=t,this.interceptors={request:new h1,response:new h1}}async request(t,n){try{return await this._request(t,n)}catch(o){if(o instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const a=i.stack?i.stack.replace(/^.+\n/,""):"";try{o.stack?a&&!String(o.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(o.stack+=`
|
|
69
|
-
`+a):o.stack=a}catch{}}throw o}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Po(this.defaults,n);const{transitional:o,paramsSerializer:i,headers:a}=n;o!==void 0&&Is.assertOptions(o,{silentJSONParsing:Cr.transitional(Cr.boolean),forcedJSONParsing:Cr.transitional(Cr.boolean),clarifyTimeoutError:Cr.transitional(Cr.boolean)},!1),i!=null&&(Y.isFunction(i)?n.paramsSerializer={serialize:i}:Is.assertOptions(i,{encode:Cr.function,serialize:Cr.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Is.assertOptions(n,{baseUrl:Cr.spelling("baseURL"),withXsrfToken:Cr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=a&&Y.merge(a.common,a[n.method]);a&&Y.forEach(["delete","get","head","post","put","patch","common"],C=>{delete a[C]}),n.headers=Dn.concat(s,a);const l=[];let c=!0;this.interceptors.request.forEach(function(I){typeof I.runWhen=="function"&&I.runWhen(n)===!1||(c=c&&I.synchronous,l.unshift(I.fulfilled,I.rejected))});const u=[];this.interceptors.response.forEach(function(I){u.push(I.fulfilled,I.rejected)});let h,f=0,g;if(!c){const C=[S1.bind(this),void 0];for(C.unshift.apply(C,l),C.push.apply(C,u),g=C.length,h=Promise.resolve(n);f<g;)h=h.then(C[f++],C[f++]);return h}g=l.length;let m=n;for(f=0;f<g;){const C=l[f++],I=l[f++];try{m=C(m)}catch(b){I.call(this,b);break}}try{h=S1.call(this,m)}catch(C){return Promise.reject(C)}for(f=0,g=u.length;f<g;)h=h.then(u[f++],u[f++]);return h}getUri(t){t=Po(this.defaults,t);const n=_p(t.baseURL,t.url,t.allowAbsoluteUrls);return Sp(n,t.params,t.paramsSerializer)}};Y.forEach(["delete","get","head","options"],function(t){vo.prototype[t]=function(n,o){return this.request(Po(o||{},{method:t,url:n,data:(o||{}).data}))}});Y.forEach(["post","put","patch"],function(t){function n(o){return function(a,s,l){return this.request(Po(l||{},{method:t,headers:o?{"Content-Type":"multipart/form-data"}:{},url:a,data:s}))}}vo.prototype[t]=n(),vo.prototype[t+"Form"]=n(!0)});let yC=class Np{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const o=this;this.promise.then(i=>{if(!o._listeners)return;let a=o._listeners.length;for(;a-- >0;)o._listeners[a](i);o._listeners=null}),this.promise.then=i=>{let a;const s=new Promise(l=>{o.subscribe(l),a=l}).then(i);return s.cancel=function(){o.unsubscribe(a)},s},t(function(a,s,l){o.reason||(o.reason=new ci(a,s,l),n(o.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=o=>{t.abort(o)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Np(function(i){t=i}),cancel:t}}};function EC(e){return function(n){return e.apply(null,n)}}function TC(e){return Y.isObject(e)&&e.isAxiosError===!0}const Fc={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(Fc).forEach(([e,t])=>{Fc[t]=e});function Pp(e){const t=new vo(e),n=cp(vo.prototype.request,t);return Y.extend(n,vo.prototype,t,{allOwnKeys:!0}),Y.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return Pp(Po(e,i))},n}const ht=Pp(Ta);ht.Axios=vo;ht.CanceledError=ci;ht.CancelToken=yC;ht.isCancel=Tp;ht.VERSION=Lp;ht.toFormData=el;ht.AxiosError=je;ht.Cancel=ht.CanceledError;ht.all=function(t){return Promise.all(t)};ht.spread=EC;ht.isAxiosError=TC;ht.mergeConfig=Po;ht.AxiosHeaders=Dn;ht.formToJSON=e=>Ep(Y.isHTMLForm(e)?new FormData(e):e);ht.getAdapter=kp.getAdapter;ht.HttpStatusCode=Fc;ht.default=ht;const{Axios:HH,AxiosError:xC,CanceledError:jH,isCancel:UH,CancelToken:VH,VERSION:zH,all:$H,Cancel:WH,isAxiosError:qH,spread:GH,toFormData:YH,AxiosHeaders:ZH,HttpStatusCode:XH,formToJSON:KH,getAdapter:QH,mergeConfig:JH}=ht,_C="https://g-api.billgang.com",wC="https://www.googleapis.com/webfonts/v1/webfonts",vC="https://stores-api.billgang.com",AC="https://sl-api.billgang.com",kC="https://customers-api.billgang.com",LC="https://cashapp-api.billgang.com",Rp={api:_C,googleFonts:wC,storeApi:vC,slApi:AC,customersApi:kC,cashappApi:LC},Wa="https://localhost:5043",lt=async e=>{var g,m;const{url:t,withToken:n,method:o,body:i,contentType:a,typeToken:s="seller"}=e,l=n?localStorage.getItem("sellerAccessToken"):null,c=n?localStorage.getItem("token"):null,u=s==="seller"?l:c,h=localStorage.getItem("dv"),f={"Content-Type":a||"application/json"};n&&u&&(f.Authorization=`Bearer ${u}`);try{let C=null;switch(o){case"get":C=await ht.get(h?Wa:t,{headers:f});break;case"post":C=await ht.post(h?Wa:t,i,{headers:f});break;case"put":C=await ht.put(h?Wa:t,i,{headers:f});break;case"delete":C=await ht.delete(h?Wa:t,{headers:f});break}return{data:C==null?void 0:C.data,status:C==null?void 0:C.status,headers:C==null?void 0:C.headers}}catch(C){const I=C,S=((g=I.response)==null?void 0:g.data).errors[0],y=(m=I.response)==null?void 0:m.status;if(y===401&&t.includes(Rp.customersApi)){const{logoutCustomer:T}=await Promise.resolve().then(()=>Gy);await T()}throw new xC(S,(y==null?void 0:y.toString())||"400")}};var Ut=(e=>(e.Home="Home",e.Orders="Orders",e.Rewards="Rewards",e.Balance="Balance",e.Subscriptions="Subscriptions",e.Tickets="Tickets",e))(Ut||{}),ji=(e=>(e.Home="Home",e.Orders="Orders",e.Rewards="Rewards",e.Balance="Balance",e.Tickets="Tickets",e))(ji||{});const NC=[{caption:"Share link",description:"Send the link to your friends in all convenient ways"},{caption:"Purchase",description:"They buy a product from our store"},{caption:"Percentages",description:"You get rewards"}],rr=st(e=>({route:Ut.Home,setRoute:t=>e(()=>({route:t})),dashInfo:null,setDashInfo:t=>e(()=>({dashInfo:t})),balance:null,setBalance:t=>e(()=>({balance:t})),otpRequest:{requested:!1,email:""},setOtpRequest:t=>e(()=>({otpRequest:t})),balanceSettings:null,setBalanceSettings:t=>e(()=>({balanceSettings:t})),gatewaysDetail:null,setGatewaysDetail:t=>e(()=>({gatewaysDetail:t}))})),uo=st(e=>({token:localStorage.getItem("token")||null,setToken:t=>e(()=>({token:t})),shopDomain:"",setShopDomain:t=>e(()=>({shopDomain:t})),shopId:"",setShopId:t=>e(()=>({shopId:t})),shopLogo:null,setShopLogo:t=>e(()=>({shopLogo:t})),shopPassword:localStorage.getItem("shopPassword")||"",setShopPassword:t=>e(()=>({shopPassword:t})),shopGeneral:null,setShopGeneral:t=>e(()=>({shopGeneral:t})),shopTerms:null,setShopTerms:t=>e(()=>({shopTerms:t})),shopPrivacyPolicy:null,setShopPrivacyPolicy:t=>e(()=>({shopPrivacyPolicy:t})),shopRefundPolicy:null,setShopRefundPolicy:t=>e(()=>({shopRefundPolicy:t}))}));class Ui extends Error{}Ui.prototype.name="InvalidTokenError";function PC(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,n)=>{let o=n.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}function RC(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return PC(t)}catch{return atob(t)}}function Dp(e,t){if(typeof e!="string")throw new Ui("Invalid token specified: must be a string");t||(t={});const n=t.header===!0?0:1,o=e.split(".")[n];if(typeof o!="string")throw new Ui(`Invalid token specified: missing part #${n+1}`);let i;try{i=RC(o)}catch(a){throw new Ui(`Invalid token specified: invalid base64 for part #${n+1} (${a.message})`)}try{return JSON.parse(i)}catch(a){throw new Ui(`Invalid token specified: invalid json for part #${n+1} (${a.message})`)}}const er=(e,t="auto")=>e==="not found"?"empty":`https://imagedelivery.net/${e}/w=${t}`,Rn=e=>{const t=new Intl.NumberFormat("en-US",{style:"currency",currency:e.currency||"USD"});let n=e.amount;return e.quantity&&(n=n*e.quantity),t.format(n)},DC=(e,t)=>{if(e===0)throw new Error("Old value cannot be zero, as it would result in division by zero.");return(t-e)/Math.abs(e)*100},OC=e=>{if(Math.abs(e-365)<=15){const a=Math.round(e/365);return a===1?"year":`${a} years`}else if(Math.abs(e-30)<=5){const a=Math.round(e/30);return a===1?"month":`${a} months`}else return`${e} days`},MC=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),ua=e=>{const t=new Date(e),n={day:"2-digit",month:"2-digit",year:"numeric"},o={hour:"2-digit",minute:"2-digit"},i=t.toLocaleString("en-US",n),a=t.toLocaleString("en-US",o);return[i,a]},Hc=e=>{const t=window.localStorage.getItem(e);if(t===null)return null;try{return JSON.parse(t)}catch{return t}},E1=(e,t)=>{(t===null||typeof t!="object")&&window.localStorage.setItem(e,String(t));const n=JSON.stringify(t);window.localStorage.setItem(e,n)},Bl="f10120ab-7ebb-4785-b240-7428edaa3c4e",Li="https://t-api.billgang.com",Vi="I",BC=10*1e3,FC=15*1e3,HC=15*60*1e3,so=()=>{var t;const e=Hc(Vi);return((t=e==null?void 0:e.s)==null?void 0:t.i)||""},jC=(e,t="production")=>{const{pathname:n}=Ur(),o=_.useRef(),i=_.useRef(document.visibilityState);_.useEffect(()=>{if(!e)return;const a=()=>Date.now(),s=async()=>(await lt({url:`${Li}/${e}/t/p`,method:"post",withToken:!1})).data.data.id,l=async m=>(await lt({url:`${Li}/${e}/t/p/${t==="development"?Bl:m}/s`,method:"post",withToken:!1})).data.data.id,c=async(m,C,I,b)=>{const S=t==="development"?Bl:m;try{return(await lt({url:`${Li}/${e}/t/p/${S}/s/${C}/e`,method:"post",withToken:!1,body:{url:I,oldEventId:b},contentType:"application/json"})).data.data.id}catch{return C=await l(m),(await lt({url:`${Li}/${e}/t/p/${S}/s/${C}/e`,method:"post",withToken:!1,body:{url:I},contentType:"application/json"})).data.data.id}},u=async(m,C,I)=>{await lt({url:`${Li}/${e}/t/p/${t==="development"?Bl:m}/s/${C}/e/${I}/h`,method:"post",withToken:!1});const S=Hc(Vi);S&&(S.s.u=a().toString(),S.lu=a().toString(),E1(Vi,S))},h=(m,C,I)=>{o.current&&clearInterval(o.current),o.current=setInterval(async()=>{if(document.visibilityState==="visible")try{await u(m,C,I)}catch{await f()}},BC)},f=async()=>{var b,S,y,T;const m=`${window.location.hostname}${n}`,C=Hc(Vi),I=a();try{let k=C==null?void 0:C.p;k||(k=await s());let A=(b=C==null?void 0:C.s)==null?void 0:b.i;const P=Number(((S=C==null?void 0:C.s)==null?void 0:S.u)||((y=C==null?void 0:C.s)==null?void 0:y.c)),E=!A||I-P>HC;(!A||E)&&(A=await l(k));const M=Number((C==null?void 0:C.lu)||0),B=I-M>FC,w=await c(k,A,m,C!=null&&C.l&&!B?C.l:void 0),V={p:k,s:{i:A,c:((T=C==null?void 0:C.s)==null?void 0:T.c)??I.toString(),u:I.toString()},l:w,lu:I.toString()};E1(Vi,V),h(k,A,w)}catch(k){console.error("[TrackingAnalytics] error",k)}};f();const g=()=>{document.visibilityState==="visible"&&i.current!=="visible"&&f(),i.current=document.visibilityState};return document.addEventListener("visibilitychange",g),()=>{o.current&&clearInterval(o.current),document.removeEventListener("visibilitychange",g)}},[n,e,t])},UC={recaptcha:"",gateway:"",paymentMethod:"",parts:[],customFields:{},discordSocialConnectId:null,coupon:null,tsId:so()};let Zo=null;const T1=localStorage.getItem("token");if(T1)try{Zo=Dp(JSON.parse(T1)||"")}catch{Zo=null}const Br=st(e=>({cart:{...UC,customerEmail:Zo?Zo.email:""},products:[],coupon:null,pending:!1,applyCouponPending:!1,customerEmail:Zo?Zo.email:"",recaptcha:"",priceAdjusment:null,setCart:t=>e(n=>({cart:typeof t=="function"?t(n.cart):t})),setProducts:t=>e(n=>({products:typeof t=="function"?t(n.products):t})),setRecaptcha:t=>e({recaptcha:t}),setCoupon:t=>e({coupon:t}),setPending:t=>e({pending:t}),setApplyCouponPending:t=>e({applyCouponPending:t}),setCustomerEmail:t=>e({customerEmail:t}),setPriceAdjustment:t=>e({priceAdjusment:t})})),xa=st(e=>({page:1,setPage:t=>e(()=>({page:t}))})),Op=st(e=>({discordInfo:null,setDiscordInfo:t=>e(()=>({discordInfo:t}))})),VC=st(e=>({subscription:null,setSubscription:t=>e({subscription:t})})),kt=st(e=>({apiUrls:Rp,setApiUrls:t=>e(()=>({apiUrls:t}))})),zC=async()=>{const e=localStorage.getItem("shopId")||void 0,n=`${kt.getState().apiUrls.api}/v1/dash/shops/${e}/images`;return await lt({url:n,withToken:!0,method:"get"})},$C=async e=>{const t=localStorage.getItem("shopId")||void 0,o=`${kt.getState().apiUrls.api}/v1/dash/shops/${t}/images`;return await lt({url:o,withToken:!0,method:"post",body:e,contentType:"mutlipart/form-data"})},WC="_customCheckbox_w9x8g_1",qC="_checkboxBox_w9x8g_7",GC="_checked_w9x8g_23",YC="_icon_w9x8g_31",qa={customCheckbox:WC,checkboxBox:qC,checked:GC,icon:YC},Mp=e=>{const{value:t,onChange:n}=e,[o,i]=_.useState(t),a=()=>{i(!o),n(!o)};return _.useEffect(()=>{i(t)},[t]),d.jsxs("label",{className:qa.customCheckbox,onClick:s=>s.stopPropagation(),children:[d.jsx("input",{type:"checkbox",checked:o,onChange:a,style:{display:"none"}}),d.jsx("span",{className:ge(qa.checkboxBox,{[qa.checked]:o})}),o&&d.jsx("div",{className:qa.icon,children:d.jsx(ie,{name:"Check",width:14,height:14,fill:"#ff3f19"})})]})},ZC="_button_1gxoe_1",XC="_primary_1gxoe_14",KC="_secondary_1gxoe_22",QC="_tertiary_1gxoe_30",JC="_content_1gxoe_38",eb="_withoutHover_1gxoe_45",zo={button:ZC,primary:XC,secondary:KC,tertiary:QC,content:JC,withoutHover:eb},ti=e=>{const{children:t,onClick:n,style:o,className:i,disabled:a=!1,size:s="m",type:l="Primary",withoutHover:c=!1}=e;return d.jsx("button",{className:ge(zo.button,i,{[zo.primary]:l==="Primary",[zo.secondary]:l==="Secondary",[zo.tertiary]:l==="Tertiary",[zo.withoutHover]:c}),onClick:n,style:{...o,fontSize:s==="m"?14:s==="s"?12:16},disabled:a,children:l==="Tertiary"?d.jsxs("div",{className:zo.content,children:[t,d.jsx(ie,{name:"ArrowRight",fill:"#757575",width:20,height:20})]}):d.jsx(d.Fragment,{children:t})})},tb="_tip_q9ixw_1",nb="_text_q9ixw_12",rb="_warning_q9ixw_18",ob="_error_q9ixw_23",ib="_success_q9ixw_28",ab="_hide_q9ixw_33",$o={tip:tb,text:nb,warning:rb,error:ob,success:ib,hide:ab},x1={warning:"#C1972A",error:"#FF3F19",success:"#338B13"},Bp=e=>{const{type:t,message:n,style:o,padding:i,id:a}=e,[s,l]=_.useState(!1);return d.jsx("div",{style:{padding:i},children:d.jsxs("div",{className:ge($o.tip,{[$o.warning]:t==="warning",[$o.error]:t==="error",[$o.success]:t==="success",[$o.hide]:s}),style:o,children:[d.jsx("div",{children:d.jsx(ie,{name:"Info",fill:x1[t],width:20,height:20})}),d.jsx("div",{className:$o.text,id:a,children:n}),d.jsx("div",{children:d.jsx(ie,{name:"X",fill:x1[t],width:20,height:20,hoverable:!0,onClick:()=>l(!0)})})]})})},_a=e=>{const{label:t,onChange:n,activeImage:o,tip:i}=e,{setOpenModal:a,setOnChange:s,setTip:l}=Au();return d.jsx(d.Fragment,{children:d.jsxs("div",{className:St.wrapper,onClick:c=>c.stopPropagation(),children:[t&&d.jsx("h4",{className:St.label,children:t}),d.jsxs("div",{onClick:()=>{s(n),a(!0),i&&l(i)},className:St.content,children:[d.jsx("div",{className:St.icon,children:o?d.jsx("img",{src:`https://imagedelivery.net/${o}/w=156,h=156`,alt:"image",style:{width:"20px",height:"20px",objectFit:"contain"}}):d.jsx(ie,{name:"Plus",width:20,height:20,fill:"#757575"})}),d.jsx("span",{className:St.text,children:o?"Change Image":"Select Image"}),o&&d.jsx(ie,{name:"X",width:20,height:18,fill:"#ff3f19",hoverable:!0,onClick:c=>{c.stopPropagation(),n([])}})]})]})})},sb=()=>{const{setOpenModal:e,onChange:t,tip:n,setTip:o}=Au(),{setIsOpen:i}=$r(),[a,s]=_.useState(!1),l=()=>{var y;(y=c.current)==null||y.click()},c=_.useRef(null),[u,h]=_.useState([]),[f,g]=_.useState(!1),m=async y=>{var E;const T=((E=y.target.files)==null?void 0:E[0])||null;if(!T)return;const k=new FormData;k.append("file",T),g(!0);const{data:A}=await $C(k),P=[...u];P.unshift({...A.data,cfId:A.data.path}),h([...P]),g(!1)},C=y=>{y.preventDefault(),s(!1);const T=y.dataTransfer.files;if(T&&T.length>0){const A={target:{files:[T[0]]}};m(A)}},I=()=>{i(!1),o(""),setTimeout(()=>{e(!1),i(!0)},300)},b=y=>{const T=u.map(k=>({...k,isSelected:k.id===y.id?!k.isSelected:!1}));h([...T])};function S(){const y=u.find(T=>T.isSelected);y&&(t==null||t([y.cfId]))}return _.useEffect(()=>{(async()=>{const{data:T}=await zC(),k=T.data.map(A=>({...A,isSelected:!1}));h(k)})()},[]),d.jsxs("div",{onClick:y=>y.stopPropagation(),className:St.modal,children:[d.jsxs("div",{className:St.top,children:[d.jsx("h4",{className:St.title,children:"Select Image"}),d.jsx(ie,{name:"X",width:20,height:20,hoverable:!0,onClick:I})]}),n&&d.jsx(Bp,{type:"warning",message:n,padding:5}),d.jsx("div",{className:St.modalContent,children:d.jsxs("div",{className:St.images,children:[d.jsxs("div",{className:St.input,onDragOver:y=>y.preventDefault(),onDragEnter:()=>s(!0),onDragLeave:()=>s(!1),onDrop:C,children:[d.jsxs("div",{onClick:l,className:ge(St.add,{[St.dragging]:a}),children:[d.jsx("div",{className:St.icon,children:d.jsx(ie,{name:"Plus",width:20,height:20,fill:"#757575"})}),d.jsxs("div",{className:St.description,children:[d.jsx("span",{children:"Drag and drop images here, or "}),d.jsx("span",{className:St.highlight,children:"click to browse"}),d.jsx("br",{}),d.jsx("span",{className:St.accent,children:"up to 10MB."})]})]}),d.jsx("input",{type:"file",ref:c,style:{display:"none"},onChange:m,multiple:!1,accept:"image/*"})]}),f&&d.jsx(_1,{}),u.map(y=>d.jsx(lb,{image:y,updateImage:b},y.id)),u.length===0&&[...new Array(5)].map((y,T)=>d.jsx(_1,{},T))]})}),d.jsxs("div",{className:St.bottom,children:[d.jsx(ti,{className:St.cancel,onClick:I,type:"Secondary",children:"Cancel"}),d.jsx(ti,{onClick:()=>{e(!1),S()},children:"Select"})]})]})},lb=e=>{const{image:t,updateImage:n}=e;return d.jsxs("div",{className:ge(St.image,{[St.selected]:t.isSelected}),onClick:()=>{n({...t,isSelected:!t.isSelected})},children:[d.jsx("div",{className:St.checkbox,children:d.jsx(Mp,{value:t.isSelected,onChange:o=>{n({...t,isSelected:o})}})}),d.jsx("img",{src:`https://imagedelivery.net/${t.cfId}/w=156,h=156`,alt:"image",style:{objectFit:"contain",width:"156px",height:"100px"}})]},t.id)},_1=()=>d.jsx("div",{className:St.loading,children:d.jsx("div",{className:St.spinner})}),cb="_title_1uycf_1",ub="_subtitle_1uycf_5",db="_text_1uycf_13",hb="_top_1uycf_20",fb="_itemsBlock_1uycf_29",pb="_textSettings_1uycf_35",Wo={title:cb,subtitle:ub,text:db,top:hb,itemsBlock:fb,textSettings:pb},mb="_typeTexts_1gfda_1",gb="_block_1gfda_8",Ib="_active_1gfda_25",Fl={typeTexts:mb,block:gb,active:Ib},Cb=["bold","italic","underline","strike-through"],Du=e=>{const{typesText:t,setTypesText:n}=e;function o(i){switch(i){case"bold":return"TextB";case"italic":return"TextItalic";case"strike-through":return"TextStrikethrough";case"underline":return"TextUnderline"}}return d.jsx("div",{className:Fl.typeTexts,children:Cb.map(i=>d.jsx("div",{className:ge(Fl.block,{[Fl.active]:t.includes(i)}),onClick:()=>{const a=[...t];if(a.includes(i)){const s=a.filter(l=>l!==i);n(s)}else a.push(i),n(a)},children:d.jsx(ie,{name:o(i),fill:t.includes(i)?"#252525":"#757575",width:20,height:20})},String(i)))})},bb="_wrapper_34cvp_1",Sb="_label_34cvp_10",yb="_textarea_34cvp_18",Eb="_length_34cvp_46",Tb="_full_34cvp_54",Ni={wrapper:bb,label:Sb,textarea:yb,length:Eb,full:Tb},Ou=e=>{const{onChange:t,label:n,value:o,maxLength:i,placeholder:a="Type something..."}=e,[s,l]=_.useState(o.length);return d.jsxs("div",{className:Ni.wrapper,children:[n&&d.jsx("label",{className:Ni.label,htmlFor:n,children:n}),d.jsx("textarea",{id:n,value:o,onChange:c=>{l(c.target.value.length),t(c.target.value)},placeholder:a,className:Ni.textarea,maxLength:i}),i&&d.jsxs("div",{className:ge(Ni.length,{[Ni.full]:s===i}),children:[s,"/",i]})]})},Mu=e=>{const{typeFont:t,setTypeFont:n}=e,[o,i]=_.useState([]),a=()=>{const s=document.documentElement,l=getComputedStyle(s),c=["h1","h2","h3","h4","h5","h6","h7"].map(h=>l.getPropertyValue(`--font-heading-${h}-size`).trim()),u=["lg","md","sm"].map(h=>l.getPropertyValue(`--font-body-${h}-size`).trim());return c.push(...u),c};return _.useEffect(()=>{const s=a();s.every(l=>l)&&i(s)},[]),d.jsx(ao,{label:"Type Text",options:Object.values(Va),onChange:s=>n(Object.keys(Va).find(l=>Va[l]===s)),value:Va[t],postfixs:o})},xb="_alignTexts_xs0ug_1",_b="_block_xs0ug_10",wb="_active_xs0ug_28",Hl={alignTexts:xb,block:_b,active:wb},vb=["left","center","right"],Fp=e=>{const{alignText:t,setAlignText:n}=e;function o(i){switch(i){case"left":return"TextAlignLeft";case"center":return"TextAlignCenter";case"right":return"TextAlignRight"}}return d.jsx("div",{className:Hl.alignTexts,children:vb.map(i=>d.jsx("div",{className:ge(Hl.block,{[Hl.active]:t===i}),onClick:()=>{n(i)},children:d.jsx(ie,{name:o(i),fill:t===i?"#252525":"#757575",width:20,height:20})},String(i)))})},Bu=e=>{const{typesText:t,isActiveText:n,setIsActiveText:o,text:i,setText:a,setTypesText:s,title:l,subtitle:c="Items",typeFont:u,setTypeFont:h,alignText:f,setAlignText:g}=e;return d.jsxs("div",{className:Wo.text,children:[(l||n!==void 0)&&d.jsxs("div",{className:Wo.top,children:[l&&d.jsx("h3",{className:Wo.title,children:l}),n!==void 0&&o&&d.jsx(vr,{current:n,onChange:m=>o(m)})]}),(n===void 0||n)&&d.jsxs("div",{className:Wo.itemsBlock,children:[d.jsx("h5",{className:Wo.subtitle,children:c}),d.jsx(Ou,{onChange:m=>a(m),value:i}),d.jsxs("div",{className:Wo.textSettings,children:[d.jsx(Du,{typesText:t,setTypesText:s}),d.jsx(Fp,{alignText:f,setAlignText:g})]}),d.jsx(Mu,{typeFont:u,setTypeFont:h})]})]})},Ab="_title_msd5s_1",kb="_subtitle_msd5s_5",Lb="_productsBlock_msd5s_14",Nb="_top_msd5s_26",Pb="_products_msd5s_14",Rb="_product_msd5s_14",Db="_button_msd5s_80",Ob="_disabled_msd5s_91",Mb="_buttons_msd5s_118",Bb="_modal_msd5s_125",Fb="_link_msd5s_146",Hb="_modalOptions_msd5s_152",jb="_addButton_msd5s_165",Ub="_deleteButton_msd5s_180",Vb="_closeIcon_msd5s_192",Ot={title:Ab,subtitle:kb,productsBlock:Lb,top:Nb,products:Pb,product:Rb,button:Db,disabled:Ob,buttons:Mb,modal:Bb,link:Fb,modalOptions:Hb,addButton:jb,deleteButton:Ub,closeIcon:Vb},zb=_.forwardRef((e,t)=>{const{activeItem:n,setActiveItem:o,popupPosition:i,modalOptions:a,setIsOpenModal:s}=e;si(t,()=>{o(null),s(!1)});function l(c,u){return c.length>u?`${c.slice(0,u)}...`:c}return d.jsxs("div",{ref:t,className:Ot.modal,onClick:c=>{c.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[d.jsxs("div",{className:Ot.top,children:[d.jsx("h3",{className:Ot.title,children:l(n.name["en-US"],20)}),d.jsx("div",{className:Ot.closeIcon,children:d.jsx(ie,{name:"X",height:20,width:20,onClick:()=>{o(null),s(!1)}})})]}),d.jsx("div",{className:Ot.modalOptions,children:a.map(c=>{if(c.type==="image")return d.jsx(_a,{label:"Put up an attractive image",activeImage:n[c.field],onChange:u=>{const h={...n,[c.field]:u};o(h)}},String(c.field));if(c.type==="text")return d.jsx(Bu,{isActiveText:!0,typesText:n[c.field.type],setTypesText:u=>{const h={...n,[c.field.type]:u};o(h)},alignText:n[c.field.alignText],setAlignText:u=>{const h={...n,[c.field.alignText]:u};o(h)},text:n[c.field.text]["en-US"]||"",setText:u=>{const h={...n,[c.field.text]:{"en-US":u}};o(h)},typeFont:n[c.field.typeFont],setTypeFont:u=>{const h={...n,[c.field.typeFont]:u};o(h)},subtitle:c.label});if(c.type==="input")return d.jsx(nr,{onChange:u=>{const h={...n,[c.field]:u};o(h)},value:n[c.field]||"",label:c.label,placeholder:c.placeholder});if(c.type==="inputSwitch")return d.jsxs("div",{className:Ot.link,children:[d.jsx(nr,{onChange:u=>{const h={...n,[c.field.text]:u};o(h)},value:n[c.field.text]||"",label:c.inputLabel,placeholder:c.placeholder}),d.jsx(vr,{current:!!n[c.field.switch]||!1,label:c.switchLabel,onChange:u=>{const h={...n,[c.field.switch]:u};o(h)}})]});if(c.type==="list")return d.jsx(f0,{items:n[c.field]||[],setItems:u=>{const h={...n,[c.field]:u};o(h)},itemsType:"select",draggable:c.draggable||!1,itemsOptions:c.itemsOptions,deletable:c.deletable||!1,editable:c.editable||!1,subtitle:c.label,addableOptions:c.addableOptions,modalOptions:c.modalOptions});if(c.type==="select")return d.jsx(ao,{options:c.itemsOptions,onChange:u=>{const h={...n,[c.field]:u};o(h)},label:c.label,value:n[c.field]||"String",leftAddonOptions:c.leftAddonOptions,switcher:c.switcher?{value:!!n[c.switcher],onChange:u=>{if(c.switcher==="isActive"){const h={...n,[c.switcher]:u};o(h)}}}:void 0});if(c.type==="selectTypeFont")return d.jsx(Mu,{typeFont:n[c.field],setTypeFont:u=>{const h={...n,[c.field]:u};o(h)}});if(c.type==="selectInfiniteList")return d.jsx(Lu,{options:c.itemsOptions,onChange:u=>{const h={...n,[c.field]:u};o(h)},label:c.label,value:n[c.field]||"String",leftAddonOptions:c.leftAddonOptions,switcher:c.switcher?{value:!!n[c.switcher],onChange:u=>{if(c.switcher==="isActive"){const h={...n,[c.switcher]:u};o(h)}}}:void 0})})})]})}),$b="_other_1a1tk_1",Wb="_subtitle_1a1tk_7",qb="_items_1a1tk_14",jl={other:$b,subtitle:Wb,items:qb},Hp=e=>{const{items:t,otherTitle:n,tagsTitle:o}=e;return d.jsxs("div",{className:jl.other,children:[d.jsx("h5",{className:jl.subtitle,children:n||o}),d.jsx("div",{className:jl.items,children:t.map((i,a)=>d.jsx(vr,{current:i.isItem,onChange:s=>i.setIsItem(s),label:i.label,hasBackground:!0,paddingless:!1},a))})]})};function Gb(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return _.useMemo(()=>o=>{t.forEach(i=>i(o))},t)}const rl=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ui(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Fu(e){return"nodeType"in e}function On(e){var t,n;return e?ui(e)?e:Fu(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Hu(e){const{Document:t}=On(e);return e instanceof t}function wa(e){return ui(e)?!1:e instanceof On(e).HTMLElement}function jp(e){return e instanceof On(e).SVGElement}function di(e){return e?ui(e)?e.document:Fu(e)?Hu(e)?e:wa(e)||jp(e)?e.ownerDocument:document:document:document}const wr=rl?_.useLayoutEffect:_.useEffect;function ju(e){const t=_.useRef(e);return wr(()=>{t.current=e}),_.useCallback(function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return t.current==null?void 0:t.current(...o)},[])}function Yb(){const e=_.useRef(null),t=_.useCallback((o,i)=>{e.current=setInterval(o,i)},[]),n=_.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function da(e,t){t===void 0&&(t=[e]);const n=_.useRef(e);return wr(()=>{n.current!==e&&(n.current=e)},t),n}function va(e,t){const n=_.useRef();return _.useMemo(()=>{const o=e(n.current);return n.current=o,o},[...t])}function Ds(e){const t=ju(e),n=_.useRef(null),o=_.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,o]}function jc(e){const t=_.useRef();return _.useEffect(()=>{t.current=e},[e]),t.current}let Ul={};function Aa(e,t){return _.useMemo(()=>{if(t)return t;const n=Ul[e]==null?0:Ul[e]+1;return Ul[e]=n,e+"-"+n},[e,t])}function Up(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return o.reduce((a,s)=>{const l=Object.entries(s);for(const[c,u]of l){const h=a[c];h!=null&&(a[c]=h+e*u)}return a},{...t})}}const Ko=Up(1),Os=Up(-1);function Zb(e){return"clientX"in e&&"clientY"in e}function Uu(e){if(!e)return!1;const{KeyboardEvent:t}=On(e.target);return t&&e instanceof t}function Xb(e){if(!e)return!1;const{TouchEvent:t}=On(e.target);return t&&e instanceof t}function Uc(e){if(Xb(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 Zb(e)?{x:e.clientX,y:e.clientY}:null}const ni=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[ni.Translate.toString(e),ni.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}}),w1="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Kb(e){return e.matches(w1)?e:e.querySelector(w1)}const Qb={display:"none"};function Jb(e){let{id:t,value:n}=e;return _.createElement("div",{id:t,style:Qb},n)}function eS(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e;const i={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 _.createElement("div",{id:t,style:i,role:"status","aria-live":o,"aria-atomic":!0},n)}function tS(){const[e,t]=_.useState("");return{announce:_.useCallback(o=>{o!=null&&t(o)},[]),announcement:e}}const Vp=_.createContext(null);function nS(e){const t=_.useContext(Vp);_.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function rS(){const[e]=_.useState(()=>new Set),t=_.useCallback(o=>(e.add(o),()=>e.delete(o)),[e]);return[_.useCallback(o=>{let{type:i,event:a}=o;e.forEach(s=>{var l;return(l=s[i])==null?void 0:l.call(s,a)})},[e]),t]}const oS={draggable:`
|
|
69
|
+
`+a):o.stack=a}catch{}}throw o}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Po(this.defaults,n);const{transitional:o,paramsSerializer:i,headers:a}=n;o!==void 0&&Is.assertOptions(o,{silentJSONParsing:Cr.transitional(Cr.boolean),forcedJSONParsing:Cr.transitional(Cr.boolean),clarifyTimeoutError:Cr.transitional(Cr.boolean)},!1),i!=null&&(Y.isFunction(i)?n.paramsSerializer={serialize:i}:Is.assertOptions(i,{encode:Cr.function,serialize:Cr.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Is.assertOptions(n,{baseUrl:Cr.spelling("baseURL"),withXsrfToken:Cr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=a&&Y.merge(a.common,a[n.method]);a&&Y.forEach(["delete","get","head","post","put","patch","common"],C=>{delete a[C]}),n.headers=Dn.concat(s,a);const l=[];let c=!0;this.interceptors.request.forEach(function(I){typeof I.runWhen=="function"&&I.runWhen(n)===!1||(c=c&&I.synchronous,l.unshift(I.fulfilled,I.rejected))});const u=[];this.interceptors.response.forEach(function(I){u.push(I.fulfilled,I.rejected)});let h,f=0,g;if(!c){const C=[S1.bind(this),void 0];for(C.unshift.apply(C,l),C.push.apply(C,u),g=C.length,h=Promise.resolve(n);f<g;)h=h.then(C[f++],C[f++]);return h}g=l.length;let m=n;for(f=0;f<g;){const C=l[f++],I=l[f++];try{m=C(m)}catch(b){I.call(this,b);break}}try{h=S1.call(this,m)}catch(C){return Promise.reject(C)}for(f=0,g=u.length;f<g;)h=h.then(u[f++],u[f++]);return h}getUri(t){t=Po(this.defaults,t);const n=_p(t.baseURL,t.url,t.allowAbsoluteUrls);return Sp(n,t.params,t.paramsSerializer)}};Y.forEach(["delete","get","head","options"],function(t){vo.prototype[t]=function(n,o){return this.request(Po(o||{},{method:t,url:n,data:(o||{}).data}))}});Y.forEach(["post","put","patch"],function(t){function n(o){return function(a,s,l){return this.request(Po(l||{},{method:t,headers:o?{"Content-Type":"multipart/form-data"}:{},url:a,data:s}))}}vo.prototype[t]=n(),vo.prototype[t+"Form"]=n(!0)});let yC=class Np{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const o=this;this.promise.then(i=>{if(!o._listeners)return;let a=o._listeners.length;for(;a-- >0;)o._listeners[a](i);o._listeners=null}),this.promise.then=i=>{let a;const s=new Promise(l=>{o.subscribe(l),a=l}).then(i);return s.cancel=function(){o.unsubscribe(a)},s},t(function(a,s,l){o.reason||(o.reason=new ci(a,s,l),n(o.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=o=>{t.abort(o)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Np(function(i){t=i}),cancel:t}}};function EC(e){return function(n){return e.apply(null,n)}}function TC(e){return Y.isObject(e)&&e.isAxiosError===!0}const Fc={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(Fc).forEach(([e,t])=>{Fc[t]=e});function Pp(e){const t=new vo(e),n=cp(vo.prototype.request,t);return Y.extend(n,vo.prototype,t,{allOwnKeys:!0}),Y.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return Pp(Po(e,i))},n}const ht=Pp(Ta);ht.Axios=vo;ht.CanceledError=ci;ht.CancelToken=yC;ht.isCancel=Tp;ht.VERSION=Lp;ht.toFormData=el;ht.AxiosError=je;ht.Cancel=ht.CanceledError;ht.all=function(t){return Promise.all(t)};ht.spread=EC;ht.isAxiosError=TC;ht.mergeConfig=Po;ht.AxiosHeaders=Dn;ht.formToJSON=e=>Ep(Y.isHTMLForm(e)?new FormData(e):e);ht.getAdapter=kp.getAdapter;ht.HttpStatusCode=Fc;ht.default=ht;const{Axios:HH,AxiosError:xC,CanceledError:jH,isCancel:UH,CancelToken:VH,VERSION:zH,all:$H,Cancel:WH,isAxiosError:qH,spread:GH,toFormData:YH,AxiosHeaders:ZH,HttpStatusCode:XH,formToJSON:KH,getAdapter:QH,mergeConfig:JH}=ht,_C="https://g-api.billgang.com",wC="https://www.googleapis.com/webfonts/v1/webfonts",vC="https://stores-api.billgang.com",AC="https://sl-api.billgang.com",kC="https://customers-api.billgang.com",LC="https://cashapp-api.billgang.com",Rp={api:_C,googleFonts:wC,storeApi:vC,slApi:AC,customersApi:kC,cashappApi:LC},Wa="https://localhost:5043",lt=async e=>{var g,m;const{url:t,withToken:n,method:o,body:i,contentType:a,typeToken:s="seller"}=e,l=n?localStorage.getItem("sellerAccessToken"):null,c=n?localStorage.getItem("token"):null,u=s==="seller"?l:c,h=localStorage.getItem("dv"),f={"Content-Type":a||"application/json"};n&&u&&(f.Authorization=`Bearer ${u}`);try{let C=null;switch(o){case"get":C=await ht.get(h?Wa:t,{headers:f});break;case"post":C=await ht.post(h?Wa:t,i,{headers:f});break;case"put":C=await ht.put(h?Wa:t,i,{headers:f});break;case"delete":C=await ht.delete(h?Wa:t,{headers:f});break}return{data:C==null?void 0:C.data,status:C==null?void 0:C.status,headers:C==null?void 0:C.headers}}catch(C){const I=C,b=(g=I.response)==null?void 0:g.data;let S="Something Went Wrong";b&&(S=b.errors[0]);const y=(m=I.response)==null?void 0:m.status;if(y===401&&t.includes(Rp.customersApi)){const{logoutCustomer:T}=await Promise.resolve().then(()=>Gy);await T()}throw new xC(S,(y==null?void 0:y.toString())||"400")}};var Ut=(e=>(e.Home="Home",e.Orders="Orders",e.Rewards="Rewards",e.Balance="Balance",e.Subscriptions="Subscriptions",e.Tickets="Tickets",e))(Ut||{}),ji=(e=>(e.Home="Home",e.Orders="Orders",e.Rewards="Rewards",e.Balance="Balance",e.Tickets="Tickets",e))(ji||{});const NC=[{caption:"Share link",description:"Send the link to your friends in all convenient ways"},{caption:"Purchase",description:"They buy a product from our store"},{caption:"Percentages",description:"You get rewards"}],rr=st(e=>({route:Ut.Home,setRoute:t=>e(()=>({route:t})),dashInfo:null,setDashInfo:t=>e(()=>({dashInfo:t})),balance:null,setBalance:t=>e(()=>({balance:t})),otpRequest:{requested:!1,email:""},setOtpRequest:t=>e(()=>({otpRequest:t})),balanceSettings:null,setBalanceSettings:t=>e(()=>({balanceSettings:t})),gatewaysDetail:null,setGatewaysDetail:t=>e(()=>({gatewaysDetail:t}))})),uo=st(e=>({token:localStorage.getItem("token")||null,setToken:t=>e(()=>({token:t})),shopDomain:"",setShopDomain:t=>e(()=>({shopDomain:t})),shopId:"",setShopId:t=>e(()=>({shopId:t})),shopLogo:null,setShopLogo:t=>e(()=>({shopLogo:t})),shopPassword:localStorage.getItem("shopPassword")||"",setShopPassword:t=>e(()=>({shopPassword:t})),shopGeneral:null,setShopGeneral:t=>e(()=>({shopGeneral:t})),shopTerms:null,setShopTerms:t=>e(()=>({shopTerms:t})),shopPrivacyPolicy:null,setShopPrivacyPolicy:t=>e(()=>({shopPrivacyPolicy:t})),shopRefundPolicy:null,setShopRefundPolicy:t=>e(()=>({shopRefundPolicy:t}))}));class Ui extends Error{}Ui.prototype.name="InvalidTokenError";function PC(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,n)=>{let o=n.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}function RC(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return PC(t)}catch{return atob(t)}}function Dp(e,t){if(typeof e!="string")throw new Ui("Invalid token specified: must be a string");t||(t={});const n=t.header===!0?0:1,o=e.split(".")[n];if(typeof o!="string")throw new Ui(`Invalid token specified: missing part #${n+1}`);let i;try{i=RC(o)}catch(a){throw new Ui(`Invalid token specified: invalid base64 for part #${n+1} (${a.message})`)}try{return JSON.parse(i)}catch(a){throw new Ui(`Invalid token specified: invalid json for part #${n+1} (${a.message})`)}}const er=(e,t="auto")=>e==="not found"?"empty":`https://imagedelivery.net/${e}/w=${t}`,Rn=e=>{const t=new Intl.NumberFormat("en-US",{style:"currency",currency:e.currency||"USD"});let n=e.amount;return e.quantity&&(n=n*e.quantity),t.format(n)},DC=(e,t)=>{if(e===0)throw new Error("Old value cannot be zero, as it would result in division by zero.");return(t-e)/Math.abs(e)*100},OC=e=>{if(Math.abs(e-365)<=15){const a=Math.round(e/365);return a===1?"year":`${a} years`}else if(Math.abs(e-30)<=5){const a=Math.round(e/30);return a===1?"month":`${a} months`}else return`${e} days`},MC=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),ua=e=>{const t=new Date(e),n={day:"2-digit",month:"2-digit",year:"numeric"},o={hour:"2-digit",minute:"2-digit"},i=t.toLocaleString("en-US",n),a=t.toLocaleString("en-US",o);return[i,a]},Hc=e=>{const t=window.localStorage.getItem(e);if(t===null)return null;try{return JSON.parse(t)}catch{return t}},E1=(e,t)=>{(t===null||typeof t!="object")&&window.localStorage.setItem(e,String(t));const n=JSON.stringify(t);window.localStorage.setItem(e,n)},Bl="f10120ab-7ebb-4785-b240-7428edaa3c4e",Li="https://t-api.billgang.com",Vi="I",BC=10*1e3,FC=15*1e3,HC=15*60*1e3,so=()=>{var t;const e=Hc(Vi);return((t=e==null?void 0:e.s)==null?void 0:t.i)||""},jC=(e,t="production")=>{const{pathname:n}=Ur(),o=_.useRef(),i=_.useRef(document.visibilityState);_.useEffect(()=>{if(!e)return;const a=()=>Date.now(),s=async()=>(await lt({url:`${Li}/${e}/t/p`,method:"post",withToken:!1})).data.data.id,l=async m=>(await lt({url:`${Li}/${e}/t/p/${t==="development"?Bl:m}/s`,method:"post",withToken:!1})).data.data.id,c=async(m,C,I,b)=>{const S=t==="development"?Bl:m;try{return(await lt({url:`${Li}/${e}/t/p/${S}/s/${C}/e`,method:"post",withToken:!1,body:{url:I,oldEventId:b},contentType:"application/json"})).data.data.id}catch{return C=await l(m),(await lt({url:`${Li}/${e}/t/p/${S}/s/${C}/e`,method:"post",withToken:!1,body:{url:I},contentType:"application/json"})).data.data.id}},u=async(m,C,I)=>{await lt({url:`${Li}/${e}/t/p/${t==="development"?Bl:m}/s/${C}/e/${I}/h`,method:"post",withToken:!1});const S=Hc(Vi);S&&(S.s.u=a().toString(),S.lu=a().toString(),E1(Vi,S))},h=(m,C,I)=>{o.current&&clearInterval(o.current),o.current=setInterval(async()=>{if(document.visibilityState==="visible")try{await u(m,C,I)}catch{await f()}},BC)},f=async()=>{var b,S,y,T;const m=`${window.location.hostname}${n}`,C=Hc(Vi),I=a();try{let k=C==null?void 0:C.p;k||(k=await s());let A=(b=C==null?void 0:C.s)==null?void 0:b.i;const P=Number(((S=C==null?void 0:C.s)==null?void 0:S.u)||((y=C==null?void 0:C.s)==null?void 0:y.c)),E=!A||I-P>HC;(!A||E)&&(A=await l(k));const M=Number((C==null?void 0:C.lu)||0),B=I-M>FC,w=await c(k,A,m,C!=null&&C.l&&!B?C.l:void 0),V={p:k,s:{i:A,c:((T=C==null?void 0:C.s)==null?void 0:T.c)??I.toString(),u:I.toString()},l:w,lu:I.toString()};E1(Vi,V),h(k,A,w)}catch(k){console.error("[TrackingAnalytics] error",k)}};f();const g=()=>{document.visibilityState==="visible"&&i.current!=="visible"&&f(),i.current=document.visibilityState};return document.addEventListener("visibilitychange",g),()=>{o.current&&clearInterval(o.current),document.removeEventListener("visibilitychange",g)}},[n,e,t])},UC={recaptcha:"",gateway:"",paymentMethod:"",parts:[],customFields:{},discordSocialConnectId:null,coupon:null,tsId:so()};let Zo=null;const T1=localStorage.getItem("token");if(T1)try{Zo=Dp(JSON.parse(T1)||"")}catch{Zo=null}const Br=st(e=>({cart:{...UC,customerEmail:Zo?Zo.email:""},products:[],coupon:null,pending:!1,applyCouponPending:!1,customerEmail:Zo?Zo.email:"",recaptcha:"",priceAdjusment:null,setCart:t=>e(n=>({cart:typeof t=="function"?t(n.cart):t})),setProducts:t=>e(n=>({products:typeof t=="function"?t(n.products):t})),setRecaptcha:t=>e({recaptcha:t}),setCoupon:t=>e({coupon:t}),setPending:t=>e({pending:t}),setApplyCouponPending:t=>e({applyCouponPending:t}),setCustomerEmail:t=>e({customerEmail:t}),setPriceAdjustment:t=>e({priceAdjusment:t})})),xa=st(e=>({page:1,setPage:t=>e(()=>({page:t}))})),Op=st(e=>({discordInfo:null,setDiscordInfo:t=>e(()=>({discordInfo:t}))})),VC=st(e=>({subscription:null,setSubscription:t=>e({subscription:t})})),kt=st(e=>({apiUrls:Rp,setApiUrls:t=>e(()=>({apiUrls:t}))})),zC=async()=>{const e=localStorage.getItem("shopId")||void 0,n=`${kt.getState().apiUrls.api}/v1/dash/shops/${e}/images`;return await lt({url:n,withToken:!0,method:"get"})},$C=async e=>{const t=localStorage.getItem("shopId")||void 0,o=`${kt.getState().apiUrls.api}/v1/dash/shops/${t}/images`;return await lt({url:o,withToken:!0,method:"post",body:e,contentType:"mutlipart/form-data"})},WC="_customCheckbox_w9x8g_1",qC="_checkboxBox_w9x8g_7",GC="_checked_w9x8g_23",YC="_icon_w9x8g_31",qa={customCheckbox:WC,checkboxBox:qC,checked:GC,icon:YC},Mp=e=>{const{value:t,onChange:n}=e,[o,i]=_.useState(t),a=()=>{i(!o),n(!o)};return _.useEffect(()=>{i(t)},[t]),d.jsxs("label",{className:qa.customCheckbox,onClick:s=>s.stopPropagation(),children:[d.jsx("input",{type:"checkbox",checked:o,onChange:a,style:{display:"none"}}),d.jsx("span",{className:ge(qa.checkboxBox,{[qa.checked]:o})}),o&&d.jsx("div",{className:qa.icon,children:d.jsx(ie,{name:"Check",width:14,height:14,fill:"#ff3f19"})})]})},ZC="_button_1gxoe_1",XC="_primary_1gxoe_14",KC="_secondary_1gxoe_22",QC="_tertiary_1gxoe_30",JC="_content_1gxoe_38",eb="_withoutHover_1gxoe_45",zo={button:ZC,primary:XC,secondary:KC,tertiary:QC,content:JC,withoutHover:eb},ti=e=>{const{children:t,onClick:n,style:o,className:i,disabled:a=!1,size:s="m",type:l="Primary",withoutHover:c=!1}=e;return d.jsx("button",{className:ge(zo.button,i,{[zo.primary]:l==="Primary",[zo.secondary]:l==="Secondary",[zo.tertiary]:l==="Tertiary",[zo.withoutHover]:c}),onClick:n,style:{...o,fontSize:s==="m"?14:s==="s"?12:16},disabled:a,children:l==="Tertiary"?d.jsxs("div",{className:zo.content,children:[t,d.jsx(ie,{name:"ArrowRight",fill:"#757575",width:20,height:20})]}):d.jsx(d.Fragment,{children:t})})},tb="_tip_q9ixw_1",nb="_text_q9ixw_12",rb="_warning_q9ixw_18",ob="_error_q9ixw_23",ib="_success_q9ixw_28",ab="_hide_q9ixw_33",$o={tip:tb,text:nb,warning:rb,error:ob,success:ib,hide:ab},x1={warning:"#C1972A",error:"#FF3F19",success:"#338B13"},Bp=e=>{const{type:t,message:n,style:o,padding:i,id:a}=e,[s,l]=_.useState(!1);return d.jsx("div",{style:{padding:i},children:d.jsxs("div",{className:ge($o.tip,{[$o.warning]:t==="warning",[$o.error]:t==="error",[$o.success]:t==="success",[$o.hide]:s}),style:o,children:[d.jsx("div",{children:d.jsx(ie,{name:"Info",fill:x1[t],width:20,height:20})}),d.jsx("div",{className:$o.text,id:a,children:n}),d.jsx("div",{children:d.jsx(ie,{name:"X",fill:x1[t],width:20,height:20,hoverable:!0,onClick:()=>l(!0)})})]})})},_a=e=>{const{label:t,onChange:n,activeImage:o,tip:i}=e,{setOpenModal:a,setOnChange:s,setTip:l}=Au();return d.jsx(d.Fragment,{children:d.jsxs("div",{className:St.wrapper,onClick:c=>c.stopPropagation(),children:[t&&d.jsx("h4",{className:St.label,children:t}),d.jsxs("div",{onClick:()=>{s(n),a(!0),i&&l(i)},className:St.content,children:[d.jsx("div",{className:St.icon,children:o?d.jsx("img",{src:`https://imagedelivery.net/${o}/w=156,h=156`,alt:"image",style:{width:"20px",height:"20px",objectFit:"contain"}}):d.jsx(ie,{name:"Plus",width:20,height:20,fill:"#757575"})}),d.jsx("span",{className:St.text,children:o?"Change Image":"Select Image"}),o&&d.jsx(ie,{name:"X",width:20,height:18,fill:"#ff3f19",hoverable:!0,onClick:c=>{c.stopPropagation(),n([])}})]})]})})},sb=()=>{const{setOpenModal:e,onChange:t,tip:n,setTip:o}=Au(),{setIsOpen:i}=$r(),[a,s]=_.useState(!1),l=()=>{var y;(y=c.current)==null||y.click()},c=_.useRef(null),[u,h]=_.useState([]),[f,g]=_.useState(!1),m=async y=>{var E;const T=((E=y.target.files)==null?void 0:E[0])||null;if(!T)return;const k=new FormData;k.append("file",T),g(!0);const{data:A}=await $C(k),P=[...u];P.unshift({...A.data,cfId:A.data.path}),h([...P]),g(!1)},C=y=>{y.preventDefault(),s(!1);const T=y.dataTransfer.files;if(T&&T.length>0){const A={target:{files:[T[0]]}};m(A)}},I=()=>{i(!1),o(""),setTimeout(()=>{e(!1),i(!0)},300)},b=y=>{const T=u.map(k=>({...k,isSelected:k.id===y.id?!k.isSelected:!1}));h([...T])};function S(){const y=u.find(T=>T.isSelected);y&&(t==null||t([y.cfId]))}return _.useEffect(()=>{(async()=>{const{data:T}=await zC(),k=T.data.map(A=>({...A,isSelected:!1}));h(k)})()},[]),d.jsxs("div",{onClick:y=>y.stopPropagation(),className:St.modal,children:[d.jsxs("div",{className:St.top,children:[d.jsx("h4",{className:St.title,children:"Select Image"}),d.jsx(ie,{name:"X",width:20,height:20,hoverable:!0,onClick:I})]}),n&&d.jsx(Bp,{type:"warning",message:n,padding:5}),d.jsx("div",{className:St.modalContent,children:d.jsxs("div",{className:St.images,children:[d.jsxs("div",{className:St.input,onDragOver:y=>y.preventDefault(),onDragEnter:()=>s(!0),onDragLeave:()=>s(!1),onDrop:C,children:[d.jsxs("div",{onClick:l,className:ge(St.add,{[St.dragging]:a}),children:[d.jsx("div",{className:St.icon,children:d.jsx(ie,{name:"Plus",width:20,height:20,fill:"#757575"})}),d.jsxs("div",{className:St.description,children:[d.jsx("span",{children:"Drag and drop images here, or "}),d.jsx("span",{className:St.highlight,children:"click to browse"}),d.jsx("br",{}),d.jsx("span",{className:St.accent,children:"up to 10MB."})]})]}),d.jsx("input",{type:"file",ref:c,style:{display:"none"},onChange:m,multiple:!1,accept:"image/*"})]}),f&&d.jsx(_1,{}),u.map(y=>d.jsx(lb,{image:y,updateImage:b},y.id)),u.length===0&&[...new Array(5)].map((y,T)=>d.jsx(_1,{},T))]})}),d.jsxs("div",{className:St.bottom,children:[d.jsx(ti,{className:St.cancel,onClick:I,type:"Secondary",children:"Cancel"}),d.jsx(ti,{onClick:()=>{e(!1),S()},children:"Select"})]})]})},lb=e=>{const{image:t,updateImage:n}=e;return d.jsxs("div",{className:ge(St.image,{[St.selected]:t.isSelected}),onClick:()=>{n({...t,isSelected:!t.isSelected})},children:[d.jsx("div",{className:St.checkbox,children:d.jsx(Mp,{value:t.isSelected,onChange:o=>{n({...t,isSelected:o})}})}),d.jsx("img",{src:`https://imagedelivery.net/${t.cfId}/w=156,h=156`,alt:"image",style:{objectFit:"contain",width:"156px",height:"100px"}})]},t.id)},_1=()=>d.jsx("div",{className:St.loading,children:d.jsx("div",{className:St.spinner})}),cb="_title_1uycf_1",ub="_subtitle_1uycf_5",db="_text_1uycf_13",hb="_top_1uycf_20",fb="_itemsBlock_1uycf_29",pb="_textSettings_1uycf_35",Wo={title:cb,subtitle:ub,text:db,top:hb,itemsBlock:fb,textSettings:pb},mb="_typeTexts_1gfda_1",gb="_block_1gfda_8",Ib="_active_1gfda_25",Fl={typeTexts:mb,block:gb,active:Ib},Cb=["bold","italic","underline","strike-through"],Du=e=>{const{typesText:t,setTypesText:n}=e;function o(i){switch(i){case"bold":return"TextB";case"italic":return"TextItalic";case"strike-through":return"TextStrikethrough";case"underline":return"TextUnderline"}}return d.jsx("div",{className:Fl.typeTexts,children:Cb.map(i=>d.jsx("div",{className:ge(Fl.block,{[Fl.active]:t.includes(i)}),onClick:()=>{const a=[...t];if(a.includes(i)){const s=a.filter(l=>l!==i);n(s)}else a.push(i),n(a)},children:d.jsx(ie,{name:o(i),fill:t.includes(i)?"#252525":"#757575",width:20,height:20})},String(i)))})},bb="_wrapper_34cvp_1",Sb="_label_34cvp_10",yb="_textarea_34cvp_18",Eb="_length_34cvp_46",Tb="_full_34cvp_54",Ni={wrapper:bb,label:Sb,textarea:yb,length:Eb,full:Tb},Ou=e=>{const{onChange:t,label:n,value:o,maxLength:i,placeholder:a="Type something..."}=e,[s,l]=_.useState(o.length);return d.jsxs("div",{className:Ni.wrapper,children:[n&&d.jsx("label",{className:Ni.label,htmlFor:n,children:n}),d.jsx("textarea",{id:n,value:o,onChange:c=>{l(c.target.value.length),t(c.target.value)},placeholder:a,className:Ni.textarea,maxLength:i}),i&&d.jsxs("div",{className:ge(Ni.length,{[Ni.full]:s===i}),children:[s,"/",i]})]})},Mu=e=>{const{typeFont:t,setTypeFont:n}=e,[o,i]=_.useState([]),a=()=>{const s=document.documentElement,l=getComputedStyle(s),c=["h1","h2","h3","h4","h5","h6","h7"].map(h=>l.getPropertyValue(`--font-heading-${h}-size`).trim()),u=["lg","md","sm"].map(h=>l.getPropertyValue(`--font-body-${h}-size`).trim());return c.push(...u),c};return _.useEffect(()=>{const s=a();s.every(l=>l)&&i(s)},[]),d.jsx(ao,{label:"Type Text",options:Object.values(Va),onChange:s=>n(Object.keys(Va).find(l=>Va[l]===s)),value:Va[t],postfixs:o})},xb="_alignTexts_xs0ug_1",_b="_block_xs0ug_10",wb="_active_xs0ug_28",Hl={alignTexts:xb,block:_b,active:wb},vb=["left","center","right"],Fp=e=>{const{alignText:t,setAlignText:n}=e;function o(i){switch(i){case"left":return"TextAlignLeft";case"center":return"TextAlignCenter";case"right":return"TextAlignRight"}}return d.jsx("div",{className:Hl.alignTexts,children:vb.map(i=>d.jsx("div",{className:ge(Hl.block,{[Hl.active]:t===i}),onClick:()=>{n(i)},children:d.jsx(ie,{name:o(i),fill:t===i?"#252525":"#757575",width:20,height:20})},String(i)))})},Bu=e=>{const{typesText:t,isActiveText:n,setIsActiveText:o,text:i,setText:a,setTypesText:s,title:l,subtitle:c="Items",typeFont:u,setTypeFont:h,alignText:f,setAlignText:g}=e;return d.jsxs("div",{className:Wo.text,children:[(l||n!==void 0)&&d.jsxs("div",{className:Wo.top,children:[l&&d.jsx("h3",{className:Wo.title,children:l}),n!==void 0&&o&&d.jsx(vr,{current:n,onChange:m=>o(m)})]}),(n===void 0||n)&&d.jsxs("div",{className:Wo.itemsBlock,children:[d.jsx("h5",{className:Wo.subtitle,children:c}),d.jsx(Ou,{onChange:m=>a(m),value:i}),d.jsxs("div",{className:Wo.textSettings,children:[d.jsx(Du,{typesText:t,setTypesText:s}),d.jsx(Fp,{alignText:f,setAlignText:g})]}),d.jsx(Mu,{typeFont:u,setTypeFont:h})]})]})},Ab="_title_msd5s_1",kb="_subtitle_msd5s_5",Lb="_productsBlock_msd5s_14",Nb="_top_msd5s_26",Pb="_products_msd5s_14",Rb="_product_msd5s_14",Db="_button_msd5s_80",Ob="_disabled_msd5s_91",Mb="_buttons_msd5s_118",Bb="_modal_msd5s_125",Fb="_link_msd5s_146",Hb="_modalOptions_msd5s_152",jb="_addButton_msd5s_165",Ub="_deleteButton_msd5s_180",Vb="_closeIcon_msd5s_192",Ot={title:Ab,subtitle:kb,productsBlock:Lb,top:Nb,products:Pb,product:Rb,button:Db,disabled:Ob,buttons:Mb,modal:Bb,link:Fb,modalOptions:Hb,addButton:jb,deleteButton:Ub,closeIcon:Vb},zb=_.forwardRef((e,t)=>{const{activeItem:n,setActiveItem:o,popupPosition:i,modalOptions:a,setIsOpenModal:s}=e;si(t,()=>{o(null),s(!1)});function l(c,u){return c.length>u?`${c.slice(0,u)}...`:c}return d.jsxs("div",{ref:t,className:Ot.modal,onClick:c=>{c.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[d.jsxs("div",{className:Ot.top,children:[d.jsx("h3",{className:Ot.title,children:l(n.name["en-US"],20)}),d.jsx("div",{className:Ot.closeIcon,children:d.jsx(ie,{name:"X",height:20,width:20,onClick:()=>{o(null),s(!1)}})})]}),d.jsx("div",{className:Ot.modalOptions,children:a.map(c=>{if(c.type==="image")return d.jsx(_a,{label:"Put up an attractive image",activeImage:n[c.field],onChange:u=>{const h={...n,[c.field]:u};o(h)}},String(c.field));if(c.type==="text")return d.jsx(Bu,{isActiveText:!0,typesText:n[c.field.type],setTypesText:u=>{const h={...n,[c.field.type]:u};o(h)},alignText:n[c.field.alignText],setAlignText:u=>{const h={...n,[c.field.alignText]:u};o(h)},text:n[c.field.text]["en-US"]||"",setText:u=>{const h={...n,[c.field.text]:{"en-US":u}};o(h)},typeFont:n[c.field.typeFont],setTypeFont:u=>{const h={...n,[c.field.typeFont]:u};o(h)},subtitle:c.label});if(c.type==="input")return d.jsx(nr,{onChange:u=>{const h={...n,[c.field]:u};o(h)},value:n[c.field]||"",label:c.label,placeholder:c.placeholder});if(c.type==="inputSwitch")return d.jsxs("div",{className:Ot.link,children:[d.jsx(nr,{onChange:u=>{const h={...n,[c.field.text]:u};o(h)},value:n[c.field.text]||"",label:c.inputLabel,placeholder:c.placeholder}),d.jsx(vr,{current:!!n[c.field.switch]||!1,label:c.switchLabel,onChange:u=>{const h={...n,[c.field.switch]:u};o(h)}})]});if(c.type==="list")return d.jsx(f0,{items:n[c.field]||[],setItems:u=>{const h={...n,[c.field]:u};o(h)},itemsType:"select",draggable:c.draggable||!1,itemsOptions:c.itemsOptions,deletable:c.deletable||!1,editable:c.editable||!1,subtitle:c.label,addableOptions:c.addableOptions,modalOptions:c.modalOptions});if(c.type==="select")return d.jsx(ao,{options:c.itemsOptions,onChange:u=>{const h={...n,[c.field]:u};o(h)},label:c.label,value:n[c.field]||"String",leftAddonOptions:c.leftAddonOptions,switcher:c.switcher?{value:!!n[c.switcher],onChange:u=>{if(c.switcher==="isActive"){const h={...n,[c.switcher]:u};o(h)}}}:void 0});if(c.type==="selectTypeFont")return d.jsx(Mu,{typeFont:n[c.field],setTypeFont:u=>{const h={...n,[c.field]:u};o(h)}});if(c.type==="selectInfiniteList")return d.jsx(Lu,{options:c.itemsOptions,onChange:u=>{const h={...n,[c.field]:u};o(h)},label:c.label,value:n[c.field]||"String",leftAddonOptions:c.leftAddonOptions,switcher:c.switcher?{value:!!n[c.switcher],onChange:u=>{if(c.switcher==="isActive"){const h={...n,[c.switcher]:u};o(h)}}}:void 0})})})]})}),$b="_other_1a1tk_1",Wb="_subtitle_1a1tk_7",qb="_items_1a1tk_14",jl={other:$b,subtitle:Wb,items:qb},Hp=e=>{const{items:t,otherTitle:n,tagsTitle:o}=e;return d.jsxs("div",{className:jl.other,children:[d.jsx("h5",{className:jl.subtitle,children:n||o}),d.jsx("div",{className:jl.items,children:t.map((i,a)=>d.jsx(vr,{current:i.isItem,onChange:s=>i.setIsItem(s),label:i.label,hasBackground:!0,paddingless:!1},a))})]})};function Gb(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return _.useMemo(()=>o=>{t.forEach(i=>i(o))},t)}const rl=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ui(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Fu(e){return"nodeType"in e}function On(e){var t,n;return e?ui(e)?e:Fu(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Hu(e){const{Document:t}=On(e);return e instanceof t}function wa(e){return ui(e)?!1:e instanceof On(e).HTMLElement}function jp(e){return e instanceof On(e).SVGElement}function di(e){return e?ui(e)?e.document:Fu(e)?Hu(e)?e:wa(e)||jp(e)?e.ownerDocument:document:document:document}const wr=rl?_.useLayoutEffect:_.useEffect;function ju(e){const t=_.useRef(e);return wr(()=>{t.current=e}),_.useCallback(function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return t.current==null?void 0:t.current(...o)},[])}function Yb(){const e=_.useRef(null),t=_.useCallback((o,i)=>{e.current=setInterval(o,i)},[]),n=_.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function da(e,t){t===void 0&&(t=[e]);const n=_.useRef(e);return wr(()=>{n.current!==e&&(n.current=e)},t),n}function va(e,t){const n=_.useRef();return _.useMemo(()=>{const o=e(n.current);return n.current=o,o},[...t])}function Ds(e){const t=ju(e),n=_.useRef(null),o=_.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,o]}function jc(e){const t=_.useRef();return _.useEffect(()=>{t.current=e},[e]),t.current}let Ul={};function Aa(e,t){return _.useMemo(()=>{if(t)return t;const n=Ul[e]==null?0:Ul[e]+1;return Ul[e]=n,e+"-"+n},[e,t])}function Up(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return o.reduce((a,s)=>{const l=Object.entries(s);for(const[c,u]of l){const h=a[c];h!=null&&(a[c]=h+e*u)}return a},{...t})}}const Ko=Up(1),Os=Up(-1);function Zb(e){return"clientX"in e&&"clientY"in e}function Uu(e){if(!e)return!1;const{KeyboardEvent:t}=On(e.target);return t&&e instanceof t}function Xb(e){if(!e)return!1;const{TouchEvent:t}=On(e.target);return t&&e instanceof t}function Uc(e){if(Xb(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 Zb(e)?{x:e.clientX,y:e.clientY}:null}const ni=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[ni.Translate.toString(e),ni.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}}),w1="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Kb(e){return e.matches(w1)?e:e.querySelector(w1)}const Qb={display:"none"};function Jb(e){let{id:t,value:n}=e;return _.createElement("div",{id:t,style:Qb},n)}function eS(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e;const i={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 _.createElement("div",{id:t,style:i,role:"status","aria-live":o,"aria-atomic":!0},n)}function tS(){const[e,t]=_.useState("");return{announce:_.useCallback(o=>{o!=null&&t(o)},[]),announcement:e}}const Vp=_.createContext(null);function nS(e){const t=_.useContext(Vp);_.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function rS(){const[e]=_.useState(()=>new Set),t=_.useCallback(o=>(e.add(o),()=>e.delete(o)),[e]);return[_.useCallback(o=>{let{type:i,event:a}=o;e.forEach(s=>{var l;return(l=s[i])==null?void 0:l.call(s,a)})},[e]),t]}const oS={draggable:`
|
|
70
70
|
To pick up a draggable item, press the space bar.
|
|
71
71
|
While dragging, use the arrow keys to move the item.
|
|
72
72
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
73
|
-
`},iS={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function aS(e){let{announcements:t=iS,container:n,hiddenTextDescribedById:o,screenReaderInstructions:i=oS}=e;const{announce:a,announcement:s}=tS(),l=Aa("DndLiveRegion"),[c,u]=_.useState(!1);if(_.useEffect(()=>{u(!0)},[]),nS(_.useMemo(()=>({onDragStart(f){let{active:g}=f;a(t.onDragStart({active:g}))},onDragMove(f){let{active:g,over:m}=f;t.onDragMove&&a(t.onDragMove({active:g,over:m}))},onDragOver(f){let{active:g,over:m}=f;a(t.onDragOver({active:g,over:m}))},onDragEnd(f){let{active:g,over:m}=f;a(t.onDragEnd({active:g,over:m}))},onDragCancel(f){let{active:g,over:m}=f;a(t.onDragCancel({active:g,over:m}))}}),[a,t])),!c)return null;const h=_.createElement(_.Fragment,null,_.createElement(Jb,{id:o,value:i.draggable}),_.createElement(eS,{id:l,announcement:s}));return n?To.createPortal(h,n):h}var qt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(qt||(qt={}));function Ms(){}function zp(e,t){return _.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function $p(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return _.useMemo(()=>[...t].filter(o=>o!=null),[...t])}const dr=Object.freeze({x:0,y:0});function sS(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function lS(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function cS(e,t){const n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),s=i-o,l=a-n;if(o<i&&n<a){const c=t.width*t.height,u=e.width*e.height,h=s*l,f=h/(c+u-h);return Number(f.toFixed(4))}return 0}const uS=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const i=[];for(const a of o){const{id:s}=a,l=n.get(s);if(l){const c=cS(l,t);c>0&&i.push({id:s,data:{droppableContainer:a,value:c}})}}return i.sort(sS)};function dS(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Wp(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:dr}function hS(e){return function(n){for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return i.reduce((s,l)=>({...s,top:s.top+e*l.y,bottom:s.bottom+e*l.y,left:s.left+e*l.x,right:s.right+e*l.x}),{...n})}}const fS=hS(1);function pS(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function mS(e,t,n){const o=pS(t);if(!o)return e;const{scaleX:i,scaleY:a,x:s,y:l}=o,c=e.left-s-(1-i)*parseFloat(n),u=e.top-l-(1-a)*parseFloat(n.slice(n.indexOf(" ")+1)),h=i?e.width/i:e.width,f=a?e.height/a:e.height;return{width:h,height:f,top:u,right:c+h,bottom:u+f,left:c}}const gS={ignoreTransform:!1};function hi(e,t){t===void 0&&(t=gS);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:h}=On(e).getComputedStyle(e);u&&(n=mS(n,u,h))}const{top:o,left:i,width:a,height:s,bottom:l,right:c}=n;return{top:o,left:i,width:a,height:s,bottom:l,right:c}}function v1(e){return hi(e,{ignoreTransform:!0})}function IS(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function CS(e,t){return t===void 0&&(t=On(e).getComputedStyle(e)),t.position==="fixed"}function bS(e,t){t===void 0&&(t=On(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const a=t[i];return typeof a=="string"?n.test(a):!1})}function Vu(e,t){const n=[];function o(i){if(t!=null&&n.length>=t||!i)return n;if(Hu(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!wa(i)||jp(i)||n.includes(i))return n;const a=On(e).getComputedStyle(i);return i!==e&&bS(i,a)&&n.push(i),CS(i,a)?n:o(i.parentNode)}return e?o(e):n}function qp(e){const[t]=Vu(e,1);return t??null}function Vl(e){return!rl||!e?null:ui(e)?e:Fu(e)?Hu(e)||e===di(e).scrollingElement?window:wa(e)?e:null:null}function Gp(e){return ui(e)?e.scrollX:e.scrollLeft}function Yp(e){return ui(e)?e.scrollY:e.scrollTop}function Vc(e){return{x:Gp(e),y:Yp(e)}}var nn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(nn||(nn={}));function Zp(e){return!rl||!e?!1:e===document.scrollingElement}function Xp(e){const t={x:0,y:0},n=Zp(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,s=e.scrollTop>=o.y,l=e.scrollLeft>=o.x;return{isTop:i,isLeft:a,isBottom:s,isRight:l,maxScroll:o,minScroll:t}}const SS={x:.2,y:.2};function yS(e,t,n,o,i){let{top:a,left:s,right:l,bottom:c}=n;o===void 0&&(o=10),i===void 0&&(i=SS);const{isTop:u,isBottom:h,isLeft:f,isRight:g}=Xp(e),m={x:0,y:0},C={x:0,y:0},I={height:t.height*i.y,width:t.width*i.x};return!u&&a<=t.top+I.height?(m.y=nn.Backward,C.y=o*Math.abs((t.top+I.height-a)/I.height)):!h&&c>=t.bottom-I.height&&(m.y=nn.Forward,C.y=o*Math.abs((t.bottom-I.height-c)/I.height)),!g&&l>=t.right-I.width?(m.x=nn.Forward,C.x=o*Math.abs((t.right-I.width-l)/I.width)):!f&&s<=t.left+I.width&&(m.x=nn.Backward,C.x=o*Math.abs((t.left+I.width-s)/I.width)),{direction:m,speed:C}}function ES(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:s}=window;return{top:0,left:0,right:a,bottom:s,width:a,height:s}}const{top:t,left:n,right:o,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Kp(e){return e.reduce((t,n)=>Ko(t,Vc(n)),dr)}function TS(e){return e.reduce((t,n)=>t+Gp(n),0)}function xS(e){return e.reduce((t,n)=>t+Yp(n),0)}function _S(e,t){if(t===void 0&&(t=hi),!e)return;const{top:n,left:o,bottom:i,right:a}=t(e);qp(e)&&(i<=0||a<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const wS=[["x",["left","right"],TS],["y",["top","bottom"],xS]];class zu{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=Vu(n),i=Kp(o);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,s,l]of wS)for(const c of s)Object.defineProperty(this,c,{get:()=>{const u=l(o),h=i[a]-u;return this.rect[c]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Yi{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...n)})},this.target=t}add(t,n,o){var i;(i=this.target)==null||i.addEventListener(t,n,o),this.listeners.push([t,n,o])}}function vS(e){const{EventTarget:t}=On(e);return e instanceof t?e:di(e)}function zl(e,t){const n=Math.abs(e.x),o=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t?o>t.y:!1}var Kn;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Kn||(Kn={}));function A1(e){e.preventDefault()}function AS(e){e.stopPropagation()}var Qe;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Qe||(Qe={}));const Qp={start:[Qe.Space,Qe.Enter],cancel:[Qe.Esc],end:[Qe.Space,Qe.Enter,Qe.Tab]},kS=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Qe.Right:return{...n,x:n.x+25};case Qe.Left:return{...n,x:n.x-25};case Qe.Down:return{...n,y:n.y+25};case Qe.Up:return{...n,y:n.y-25}}};class Jp{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Yi(di(n)),this.windowListeners=new Yi(On(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Kn.Resize,this.handleCancel),this.windowListeners.add(Kn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Kn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,o=t.node.current;o&&_S(o),n(dr)}handleKeyDown(t){if(Uu(t)){const{active:n,context:o,options:i}=this.props,{keyboardCodes:a=Qp,coordinateGetter:s=kS,scrollBehavior:l="smooth"}=i,{code:c}=t;if(a.end.includes(c)){this.handleEnd(t);return}if(a.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:u}=o.current,h=u?{x:u.left,y:u.top}:dr;this.referenceCoordinates||(this.referenceCoordinates=h);const f=s(t,{active:n,context:o.current,currentCoordinates:h});if(f){const g=Os(f,h),m={x:0,y:0},{scrollableAncestors:C}=o.current;for(const I of C){const b=t.code,{isTop:S,isRight:y,isLeft:T,isBottom:k,maxScroll:A,minScroll:P}=Xp(I),E=ES(I),M={x:Math.min(b===Qe.Right?E.right-E.width/2:E.right,Math.max(b===Qe.Right?E.left:E.left+E.width/2,f.x)),y:Math.min(b===Qe.Down?E.bottom-E.height/2:E.bottom,Math.max(b===Qe.Down?E.top:E.top+E.height/2,f.y))},B=b===Qe.Right&&!y||b===Qe.Left&&!T,w=b===Qe.Down&&!k||b===Qe.Up&&!S;if(B&&M.x!==f.x){const V=I.scrollLeft+g.x,H=b===Qe.Right&&V<=A.x||b===Qe.Left&&V>=P.x;if(H&&!g.y){I.scrollTo({left:V,behavior:l});return}H?m.x=I.scrollLeft-V:m.x=b===Qe.Right?I.scrollLeft-A.x:I.scrollLeft-P.x,m.x&&I.scrollBy({left:-m.x,behavior:l});break}else if(w&&M.y!==f.y){const V=I.scrollTop+g.y,H=b===Qe.Down&&V<=A.y||b===Qe.Up&&V>=P.y;if(H&&!g.x){I.scrollTo({top:V,behavior:l});return}H?m.y=I.scrollTop-V:m.y=b===Qe.Down?I.scrollTop-A.y:I.scrollTop-P.y,m.y&&I.scrollBy({top:-m.y,behavior:l});break}}this.handleMove(t,Ko(Os(f,this.referenceCoordinates),m))}}}handleMove(t,n){const{onMove:o}=this.props;t.preventDefault(),o(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Jp.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=Qp,onActivation:i}=t,{active:a}=n;const{code:s}=e.nativeEvent;if(o.start.includes(s)){const l=a.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function k1(e){return!!(e&&"distance"in e)}function L1(e){return!!(e&&"delay"in e)}class $u{constructor(t,n,o){var i;o===void 0&&(o=vS(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:a}=t,{target:s}=a;this.props=t,this.events=n,this.document=di(s),this.documentListeners=new Yi(this.document),this.listeners=new Yi(o),this.windowListeners=new Yi(On(s)),this.initialCoordinates=(i=Uc(a))!=null?i:dr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:o}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Kn.Resize,this.handleCancel),this.windowListeners.add(Kn.DragStart,A1),this.windowListeners.add(Kn.VisibilityChange,this.handleCancel),this.windowListeners.add(Kn.ContextMenu,A1),this.documentListeners.add(Kn.Keydown,this.handleKeydown),n){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(L1(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(k1(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:o,onPending:i}=this.props;i(o,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Kn.Click,AS,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Kn.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:o,initialCoordinates:i,props:a}=this,{onMove:s,options:{activationConstraint:l}}=a;if(!i)return;const c=(n=Uc(t))!=null?n:dr,u=Os(i,c);if(!o&&l){if(k1(l)){if(l.tolerance!=null&&zl(u,l.tolerance))return this.handleCancel();if(zl(u,l.distance))return this.handleStart()}if(L1(l)&&zl(u,l.tolerance))return this.handleCancel();this.handlePending(l,u);return}t.cancelable&&t.preventDefault(),s(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Qe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const LS={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ol extends $u{constructor(t){const{event:n}=t,o=di(n.target);super(t,LS,o)}}ol.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!n.isPrimary||n.button!==0?!1:(o==null||o({event:n}),!0)}}];const NS={move:{name:"mousemove"},end:{name:"mouseup"}};var zc;(function(e){e[e.RightClick=2]="RightClick"})(zc||(zc={}));class PS extends $u{constructor(t){super(t,NS,di(t.event.target))}}PS.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button===zc.RightClick?!1:(o==null||o({event:n}),!0)}}];const $l={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class RS extends $u{constructor(t){super(t,$l)}static setup(){return window.addEventListener($l.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener($l.move.name,t)};function t(){}}}RS.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;const{touches:i}=n;return i.length>1?!1:(o==null||o({event:n}),!0)}}];var Zi;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Zi||(Zi={}));var Bs;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Bs||(Bs={}));function DS(e){let{acceleration:t,activator:n=Zi.Pointer,canScroll:o,draggingRect:i,enabled:a,interval:s=5,order:l=Bs.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:h,delta:f,threshold:g}=e;const m=MS({delta:f,disabled:!a}),[C,I]=Yb(),b=_.useRef({x:0,y:0}),S=_.useRef({x:0,y:0}),y=_.useMemo(()=>{switch(n){case Zi.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Zi.DraggableRect:return i}},[n,i,c]),T=_.useRef(null),k=_.useCallback(()=>{const P=T.current;if(!P)return;const E=b.current.x*S.current.x,M=b.current.y*S.current.y;P.scrollBy(E,M)},[]),A=_.useMemo(()=>l===Bs.TreeOrder?[...u].reverse():u,[l,u]);_.useEffect(()=>{if(!a||!u.length||!y){I();return}for(const P of A){if((o==null?void 0:o(P))===!1)continue;const E=u.indexOf(P),M=h[E];if(!M)continue;const{direction:B,speed:w}=yS(P,M,y,t,g);for(const V of["x","y"])m[V][B[V]]||(w[V]=0,B[V]=0);if(w.x>0||w.y>0){I(),T.current=P,C(k,s),b.current=w,S.current=B;return}}b.current={x:0,y:0},S.current={x:0,y:0},I()},[t,k,o,I,a,s,JSON.stringify(y),JSON.stringify(m),C,u,A,h,JSON.stringify(g)])}const OS={x:{[nn.Backward]:!1,[nn.Forward]:!1},y:{[nn.Backward]:!1,[nn.Forward]:!1}};function MS(e){let{delta:t,disabled:n}=e;const o=jc(t);return va(i=>{if(n||!o||!i)return OS;const a={x:Math.sign(t.x-o.x),y:Math.sign(t.y-o.y)};return{x:{[nn.Backward]:i.x[nn.Backward]||a.x===-1,[nn.Forward]:i.x[nn.Forward]||a.x===1},y:{[nn.Backward]:i.y[nn.Backward]||a.y===-1,[nn.Forward]:i.y[nn.Forward]||a.y===1}}},[n,t,o])}function BS(e,t){const n=t!=null?e.get(t):void 0,o=n?n.node.current:null;return va(i=>{var a;return t==null?null:(a=o??i)!=null?a:null},[o,t])}function FS(e,t){return _.useMemo(()=>e.reduce((n,o)=>{const{sensor:i}=o,a=i.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,o)}));return[...n,...a]},[]),[e,t])}var ha;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ha||(ha={}));var $c;(function(e){e.Optimized="optimized"})($c||($c={}));const N1=new Map;function HS(e,t){let{dragging:n,dependencies:o,config:i}=t;const[a,s]=_.useState(null),{frequency:l,measure:c,strategy:u}=i,h=_.useRef(e),f=b(),g=da(f),m=_.useCallback(function(S){S===void 0&&(S=[]),!g.current&&s(y=>y===null?S:y.concat(S.filter(T=>!y.includes(T))))},[g]),C=_.useRef(null),I=va(S=>{if(f&&!n)return N1;if(!S||S===N1||h.current!==e||a!=null){const y=new Map;for(let T of e){if(!T)continue;if(a&&a.length>0&&!a.includes(T.id)&&T.rect.current){y.set(T.id,T.rect.current);continue}const k=T.node.current,A=k?new zu(c(k),k):null;T.rect.current=A,A&&y.set(T.id,A)}return y}return S},[e,a,n,f,c]);return _.useEffect(()=>{h.current=e},[e]),_.useEffect(()=>{f||m()},[n,f]),_.useEffect(()=>{a&&a.length>0&&s(null)},[JSON.stringify(a)]),_.useEffect(()=>{f||typeof l!="number"||C.current!==null||(C.current=setTimeout(()=>{m(),C.current=null},l))},[l,f,m,...o]),{droppableRects:I,measureDroppableContainers:m,measuringScheduled:a!=null};function b(){switch(u){case ha.Always:return!1;case ha.BeforeDragging:return n;default:return!n}}}function e0(e,t){return va(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function jS(e,t){return e0(e,t)}function US(e){let{callback:t,disabled:n}=e;const o=ju(t),i=_.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(o)},[o,n]);return _.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function il(e){let{callback:t,disabled:n}=e;const o=ju(t),i=_.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(o)},[n]);return _.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function VS(e){return new zu(hi(e),e)}function P1(e,t,n){t===void 0&&(t=VS);const[o,i]=_.useState(null);function a(){i(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c??n)!=null?u:null}const h=t(e);return JSON.stringify(c)===JSON.stringify(h)?c:h})}const s=US({callback(c){if(e)for(const u of c){const{type:h,target:f}=u;if(h==="childList"&&f instanceof HTMLElement&&f.contains(e)){a();break}}}}),l=il({callback:a});return wr(()=>{a(),e?(l==null||l.observe(e),s==null||s.observe(document.body,{childList:!0,subtree:!0})):(l==null||l.disconnect(),s==null||s.disconnect())},[e]),o}function zS(e){const t=e0(e);return Wp(e,t)}const R1=[];function $S(e){const t=_.useRef(e),n=va(o=>e?o&&o!==R1&&e&&t.current&&e.parentNode===t.current.parentNode?o:Vu(e):R1,[e]);return _.useEffect(()=>{t.current=e},[e]),n}function WS(e){const[t,n]=_.useState(null),o=_.useRef(e),i=_.useCallback(a=>{const s=Vl(a.target);s&&n(l=>l?(l.set(s,Vc(s)),new Map(l)):null)},[]);return _.useEffect(()=>{const a=o.current;if(e!==a){s(a);const l=e.map(c=>{const u=Vl(c);return u?(u.addEventListener("scroll",i,{passive:!0}),[u,Vc(u)]):null}).filter(c=>c!=null);n(l.length?new Map(l):null),o.current=e}return()=>{s(e),s(a)};function s(l){l.forEach(c=>{const u=Vl(c);u==null||u.removeEventListener("scroll",i)})}},[i,e]),_.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,s)=>Ko(a,s),dr):Kp(e):dr,[e,t])}function D1(e,t){t===void 0&&(t=[]);const n=_.useRef(null);return _.useEffect(()=>{n.current=null},t),_.useEffect(()=>{const o=e!==dr;o&&!n.current&&(n.current=e),!o&&n.current&&(n.current=null)},[e]),n.current?Os(e,n.current):dr}function qS(e){_.useEffect(()=>{if(!rl)return;const t=e.map(n=>{let{sensor:o}=n;return o.setup==null?void 0:o.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function GS(e,t){return _.useMemo(()=>e.reduce((n,o)=>{let{eventName:i,handler:a}=o;return n[i]=s=>{a(s,t)},n},{}),[e,t])}function t0(e){return _.useMemo(()=>e?IS(e):null,[e])}const O1=[];function YS(e,t){t===void 0&&(t=hi);const[n]=e,o=t0(n?On(n):null),[i,a]=_.useState(O1);function s(){a(()=>e.length?e.map(c=>Zp(c)?o:new zu(t(c),c)):O1)}const l=il({callback:s});return wr(()=>{l==null||l.disconnect(),s(),e.forEach(c=>l==null?void 0:l.observe(c))},[e]),i}function ZS(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return wa(t)?t:e}function XS(e){let{measure:t}=e;const[n,o]=_.useState(null),i=_.useCallback(u=>{for(const{target:h}of u)if(wa(h)){o(f=>{const g=t(h);return f?{...f,width:g.width,height:g.height}:g});break}},[t]),a=il({callback:i}),s=_.useCallback(u=>{const h=ZS(u);a==null||a.disconnect(),h&&(a==null||a.observe(h)),o(h?t(h):null)},[t,a]),[l,c]=Ds(s);return _.useMemo(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const KS=[{sensor:ol,options:{}},{sensor:Jp,options:{}}],QS={current:{}},Cs={draggable:{measure:v1},droppable:{measure:v1,strategy:ha.WhileDragging,frequency:$c.Optimized},dragOverlay:{measure:hi}};class Xi extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,o;return(n=(o=this.get(t))==null?void 0:o.node.current)!=null?n:void 0}}const JS={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Xi,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ms},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Cs,measureDroppableContainers:Ms,windowRect:null,measuringScheduled:!1},e7={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ms,draggableNodes:new Map,over:null,measureDroppableContainers:Ms},al=_.createContext(e7),n0=_.createContext(JS);function t7(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Xi}}}function n7(e,t){switch(t.type){case qt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case qt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case qt.DragEnd:case qt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case qt.RegisterDroppable:{const{element:n}=t,{id:o}=n,i=new Xi(e.droppable.containers);return i.set(o,n),{...e,droppable:{...e.droppable,containers:i}}}case qt.SetDroppableDisabled:{const{id:n,key:o,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||o!==a.key)return e;const s=new Xi(e.droppable.containers);return s.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:s}}}case qt.UnregisterDroppable:{const{id:n,key:o}=t,i=e.droppable.containers.get(n);if(!i||o!==i.key)return e;const a=new Xi(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function r7(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:i}=_.useContext(al),a=jc(o),s=jc(n==null?void 0:n.id);return _.useEffect(()=>{if(!t&&!o&&a&&s!=null){if(!Uu(a)||document.activeElement===a.target)return;const l=i.get(s);if(!l)return;const{activatorNode:c,node:u}=l;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const h of[c.current,u.current]){if(!h)continue;const f=Kb(h);if(f){f.focus();break}}})}},[o,t,i,s,a]),null}function o7(e,t){let{transform:n,...o}=t;return e!=null&&e.length?e.reduce((i,a)=>a({transform:i,...o}),n):n}function i7(e){return _.useMemo(()=>({draggable:{...Cs.draggable,...e==null?void 0:e.draggable},droppable:{...Cs.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Cs.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function a7(e){let{activeNode:t,measure:n,initialRect:o,config:i=!0}=e;const a=_.useRef(!1),{x:s,y:l}=typeof i=="boolean"?{x:i,y:i}:i;wr(()=>{if(!s&&!l||!t){a.current=!1;return}if(a.current||!o)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const h=n(u),f=Wp(h,o);if(s||(f.x=0),l||(f.y=0),a.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const g=qp(u);g&&g.scrollBy({top:f.y,left:f.x})}},[t,s,l,o,n])}const r0=_.createContext({...dr,scaleX:1,scaleY:1});var eo;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(eo||(eo={}));const o0=_.memo(function(t){var n,o,i,a;let{id:s,accessibility:l,autoScroll:c=!0,children:u,sensors:h=KS,collisionDetection:f=uS,measuring:g,modifiers:m,...C}=t;const I=_.useReducer(n7,void 0,t7),[b,S]=I,[y,T]=rS(),[k,A]=_.useState(eo.Uninitialized),P=k===eo.Initialized,{draggable:{active:E,nodes:M,translate:B},droppable:{containers:w}}=b,V=E!=null?M.get(E):null,H=_.useRef({initial:null,translated:null}),X=_.useMemo(()=>{var Ct;return E!=null?{id:E,data:(Ct=V==null?void 0:V.data)!=null?Ct:QS,rect:H}:null},[E,V]),W=_.useRef(null),[se,Ce]=_.useState(null),[be,ve]=_.useState(null),Le=da(C,Object.values(C)),x=Aa("DndDescribedBy",s),ne=_.useMemo(()=>w.getEnabled(),[w]),pe=i7(g),{droppableRects:L,measureDroppableContainers:Z,measuringScheduled:le}=HS(ne,{dragging:P,dependencies:[B.x,B.y],config:pe.droppable}),ee=BS(M,E),Ie=_.useMemo(()=>be?Uc(be):null,[be]),Se=Nr(),ae=jS(ee,pe.draggable.measure);a7({activeNode:E!=null?M.get(E):null,config:Se.layoutShiftCompensation,initialRect:ae,measure:pe.draggable.measure});const ce=P1(ee,pe.draggable.measure,ae),Ue=P1(ee?ee.parentElement:null),Q=_.useRef({activatorEvent:null,active:null,activeNode:ee,collisionRect:null,collisions:null,droppableRects:L,draggableNodes:M,draggingNode:null,draggingNodeRect:null,droppableContainers:w,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ve=w.getNodeFor((n=Q.current.over)==null?void 0:n.id),Te=XS({measure:pe.dragOverlay.measure}),we=(o=Te.nodeRef.current)!=null?o:ee,ze=P?(i=Te.rect)!=null?i:ce:null,Tt=!!(Te.nodeRef.current&&Te.rect),wt=zS(Tt?null:ce),$e=t0(we?On(we):null),nt=$S(P?Ve??ee:null),Tn=YS(nt),gt=o7(m,{transform:{x:B.x-wt.x,y:B.y-wt.y,scaleX:1,scaleY:1},activatorEvent:be,active:X,activeNodeRect:ce,containerNodeRect:Ue,draggingNodeRect:ze,over:Q.current.over,overlayNodeRect:Te.rect,scrollableAncestors:nt,scrollableAncestorRects:Tn,windowRect:$e}),dn=Ie?Ko(Ie,B):null,It=WS(nt),Lt=D1(It),q=D1(It,[ce]),oe=Ko(gt,Lt),_e=ze?fS(ze,gt):null,Ae=X&&_e?f({active:X,collisionRect:_e,droppableRects:L,droppableContainers:ne,pointerCoordinates:dn}):null,We=lS(Ae,"id"),[rt,hn]=_.useState(null),Je=Tt?gt:Ko(gt,q),fn=dS(Je,(a=rt==null?void 0:rt.rect)!=null?a:null,ce),pn=_.useRef(null),Nt=_.useCallback((Ct,Yt)=>{let{sensor:Zt,options:Bn}=Yt;if(W.current==null)return;const on=M.get(W.current);if(!on)return;const Pt=Ct.nativeEvent,Xt=new Zt({active:W.current,activeNode:on,event:Pt,options:Bn,context:Q,onAbort(Rt){if(!M.get(Rt))return;const{onDragAbort:F}=Le.current,$={id:Rt};F==null||F($),y({type:"onDragAbort",event:$})},onPending(Rt,O,F,$){if(!M.get(Rt))return;const{onDragPending:me}=Le.current,xe={id:Rt,constraint:O,initialCoordinates:F,offset:$};me==null||me(xe),y({type:"onDragPending",event:xe})},onStart(Rt){const O=W.current;if(O==null)return;const F=M.get(O);if(!F)return;const{onDragStart:$}=Le.current,te={activatorEvent:Pt,active:{id:O,data:F.data,rect:H}};To.unstable_batchedUpdates(()=>{$==null||$(te),A(eo.Initializing),S({type:qt.DragStart,initialCoordinates:Rt,active:O}),y({type:"onDragStart",event:te}),Ce(pn.current),ve(Pt)})},onMove(Rt){S({type:qt.DragMove,coordinates:Rt})},onEnd:gr(qt.DragEnd),onCancel:gr(qt.DragCancel)});pn.current=Xt;function gr(Rt){return async function(){const{active:F,collisions:$,over:te,scrollAdjustedTranslate:me}=Q.current;let xe=null;if(F&&me){const{cancelDrop:N}=Le.current;xe={activatorEvent:Pt,active:F,collisions:$,delta:me,over:te},Rt===qt.DragEnd&&typeof N=="function"&&await Promise.resolve(N(xe))&&(Rt=qt.DragCancel)}W.current=null,To.unstable_batchedUpdates(()=>{S({type:Rt}),A(eo.Uninitialized),hn(null),Ce(null),ve(null),pn.current=null;const N=Rt===qt.DragEnd?"onDragEnd":"onDragCancel";if(xe){const U=Le.current[N];U==null||U(xe),y({type:N,event:xe})}})}}},[M]),Gn=_.useCallback((Ct,Yt)=>(Zt,Bn)=>{const on=Zt.nativeEvent,Pt=M.get(Bn);if(W.current!==null||!Pt||on.dndKit||on.defaultPrevented)return;const Xt={active:Pt};Ct(Zt,Yt.options,Xt)===!0&&(on.dndKit={capturedBy:Yt.sensor},W.current=Bn,Nt(Zt,Yt))},[M,Nt]),zt=FS(h,Gn);qS(h),wr(()=>{ce&&k===eo.Initializing&&A(eo.Initialized)},[ce,k]),_.useEffect(()=>{const{onDragMove:Ct}=Le.current,{active:Yt,activatorEvent:Zt,collisions:Bn,over:on}=Q.current;if(!Yt||!Zt)return;const Pt={active:Yt,activatorEvent:Zt,collisions:Bn,delta:{x:oe.x,y:oe.y},over:on};To.unstable_batchedUpdates(()=>{Ct==null||Ct(Pt),y({type:"onDragMove",event:Pt})})},[oe.x,oe.y]),_.useEffect(()=>{const{active:Ct,activatorEvent:Yt,collisions:Zt,droppableContainers:Bn,scrollAdjustedTranslate:on}=Q.current;if(!Ct||W.current==null||!Yt||!on)return;const{onDragOver:Pt}=Le.current,Xt=Bn.get(We),gr=Xt&&Xt.rect.current?{id:Xt.id,rect:Xt.rect.current,data:Xt.data,disabled:Xt.disabled}:null,Rt={active:Ct,activatorEvent:Yt,collisions:Zt,delta:{x:on.x,y:on.y},over:gr};To.unstable_batchedUpdates(()=>{hn(gr),Pt==null||Pt(Rt),y({type:"onDragOver",event:Rt})})},[We]),wr(()=>{Q.current={activatorEvent:be,active:X,activeNode:ee,collisionRect:_e,collisions:Ae,droppableRects:L,draggableNodes:M,draggingNode:we,draggingNodeRect:ze,droppableContainers:w,over:rt,scrollableAncestors:nt,scrollAdjustedTranslate:oe},H.current={initial:ze,translated:_e}},[X,ee,Ae,_e,M,we,ze,L,w,rt,nt,oe]),DS({...Se,delta:B,draggingRect:_e,pointerCoordinates:dn,scrollableAncestors:nt,scrollableAncestorRects:Tn});const Lr=_.useMemo(()=>({active:X,activeNode:ee,activeNodeRect:ce,activatorEvent:be,collisions:Ae,containerNodeRect:Ue,dragOverlay:Te,draggableNodes:M,droppableContainers:w,droppableRects:L,over:rt,measureDroppableContainers:Z,scrollableAncestors:nt,scrollableAncestorRects:Tn,measuringConfiguration:pe,measuringScheduled:le,windowRect:$e}),[X,ee,ce,be,Ae,Ue,Te,M,w,L,rt,Z,nt,Tn,pe,le,$e]),ir=_.useMemo(()=>({activatorEvent:be,activators:zt,active:X,activeNodeRect:ce,ariaDescribedById:{draggable:x},dispatch:S,draggableNodes:M,over:rt,measureDroppableContainers:Z}),[be,zt,X,ce,S,x,M,rt,Z]);return _.createElement(Vp.Provider,{value:T},_.createElement(al.Provider,{value:ir},_.createElement(n0.Provider,{value:Lr},_.createElement(r0.Provider,{value:fn},u)),_.createElement(r7,{disabled:(l==null?void 0:l.restoreFocus)===!1})),_.createElement(aS,{...l,hiddenTextDescribedById:x}));function Nr(){const Ct=(se==null?void 0:se.autoScrollEnabled)===!1,Yt=typeof c=="object"?c.enabled===!1:c===!1,Zt=P&&!Ct&&!Yt;return typeof c=="object"?{...c,enabled:Zt}:{enabled:Zt}}}),s7=_.createContext(null),M1="button",l7="Draggable";function c7(e){let{id:t,data:n,disabled:o=!1,attributes:i}=e;const a=Aa(l7),{activators:s,activatorEvent:l,active:c,activeNodeRect:u,ariaDescribedById:h,draggableNodes:f,over:g}=_.useContext(al),{role:m=M1,roleDescription:C="draggable",tabIndex:I=0}=i??{},b=(c==null?void 0:c.id)===t,S=_.useContext(b?r0:s7),[y,T]=Ds(),[k,A]=Ds(),P=GS(s,t),E=da(n);wr(()=>(f.set(t,{id:t,key:a,node:y,activatorNode:k,data:E}),()=>{const B=f.get(t);B&&B.key===a&&f.delete(t)}),[f,t]);const M=_.useMemo(()=>({role:m,tabIndex:I,"aria-disabled":o,"aria-pressed":b&&m===M1?!0:void 0,"aria-roledescription":C,"aria-describedby":h.draggable}),[o,m,I,b,C,h.draggable]);return{active:c,activatorEvent:l,activeNodeRect:u,attributes:M,isDragging:b,listeners:o?void 0:P,node:y,over:g,setNodeRef:T,setActivatorNodeRef:A,transform:S}}function u7(){return _.useContext(n0)}const d7="Droppable",h7={timeout:25};function f7(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:i}=e;const a=Aa(d7),{active:s,dispatch:l,over:c,measureDroppableContainers:u}=_.useContext(al),h=_.useRef({disabled:n}),f=_.useRef(!1),g=_.useRef(null),m=_.useRef(null),{disabled:C,updateMeasurementsFor:I,timeout:b}={...h7,...i},S=da(I??o),y=_.useCallback(()=>{if(!f.current){f.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{u(Array.isArray(S.current)?S.current:[S.current]),m.current=null},b)},[b]),T=il({callback:y,disabled:C||!s}),k=_.useCallback((M,B)=>{T&&(B&&(T.unobserve(B),f.current=!1),M&&T.observe(M))},[T]),[A,P]=Ds(k),E=da(t);return _.useEffect(()=>{!T||!A.current||(T.disconnect(),f.current=!1,T.observe(A.current))},[A,T]),_.useEffect(()=>(l({type:qt.RegisterDroppable,element:{id:o,key:a,disabled:n,node:A,rect:g,data:E}}),()=>l({type:qt.UnregisterDroppable,key:a,id:o})),[o]),_.useEffect(()=>{n!==h.current.disabled&&(l({type:qt.SetDroppableDisabled,id:o,key:a,disabled:n}),h.current.disabled=n)},[o,a,n,l]),{active:s,rect:g,isOver:(c==null?void 0:c.id)===o,node:A,over:c,setNodeRef:P}}function i0(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function p7(e,t){return e.reduce((n,o,i)=>{const a=t.get(o);return a&&(n[i]=a),n},Array(e.length))}function Ga(e){return e!==null&&e>=0}function m7(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function g7(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const a0=e=>{let{rects:t,activeIndex:n,overIndex:o,index:i}=e;const a=i0(t,o,n),s=t[i],l=a[i];return!l||!s?null:{x:l.left-s.left,y:l.top-s.top,scaleX:l.width/s.width,scaleY:l.height/s.height}},Ya={scaleX:1,scaleY:1},s0=e=>{var t;let{activeIndex:n,activeNodeRect:o,index:i,rects:a,overIndex:s}=e;const l=(t=a[n])!=null?t:o;if(!l)return null;if(i===n){const u=a[s];return u?{x:0,y:n<s?u.top+u.height-(l.top+l.height):u.top-l.top,...Ya}:null}const c=I7(a,i,n);return i>n&&i<=s?{x:0,y:-l.height-c,...Ya}:i<n&&i>=s?{x:0,y:l.height+c,...Ya}:{x:0,y:0,...Ya}};function I7(e,t,n){const o=e[t],i=e[t-1],a=e[t+1];return o?n<t?i?o.top-(i.top+i.height):a?a.top-(o.top+o.height):0:a?a.top-(o.top+o.height):i?o.top-(i.top+i.height):0:0}const l0="Sortable",c0=_.createContext({activeIndex:-1,containerId:l0,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:a0,disabled:{draggable:!1,droppable:!1}});function u0(e){let{children:t,id:n,items:o,strategy:i=a0,disabled:a=!1}=e;const{active:s,dragOverlay:l,droppableRects:c,over:u,measureDroppableContainers:h}=u7(),f=Aa(l0,n),g=l.rect!==null,m=_.useMemo(()=>o.map(P=>typeof P=="object"&&"id"in P?P.id:P),[o]),C=s!=null,I=s?m.indexOf(s.id):-1,b=u?m.indexOf(u.id):-1,S=_.useRef(m),y=!m7(m,S.current),T=b!==-1&&I===-1||y,k=g7(a);wr(()=>{y&&C&&h(m)},[y,m,C,h]),_.useEffect(()=>{S.current=m},[m]);const A=_.useMemo(()=>({activeIndex:I,containerId:f,disabled:k,disableTransforms:T,items:m,overIndex:b,useDragOverlay:g,sortedRects:p7(m,c),strategy:i}),[I,f,k.draggable,k.droppable,T,m,b,c,g,i]);return _.createElement(c0.Provider,{value:A},t)}const C7=e=>{let{id:t,items:n,activeIndex:o,overIndex:i}=e;return i0(n,o,i).indexOf(t)},b7=e=>{let{containerId:t,isSorting:n,wasDragging:o,index:i,items:a,newIndex:s,previousItems:l,previousContainerId:c,transition:u}=e;return!u||!o||l!==a&&i===s?!1:n?!0:s!==i&&t===c},S7={duration:200,easing:"ease"},d0="transform",y7=ni.Transition.toString({property:d0,duration:0,easing:"linear"}),E7={roleDescription:"sortable"};function T7(e){let{disabled:t,index:n,node:o,rect:i}=e;const[a,s]=_.useState(null),l=_.useRef(n);return wr(()=>{if(!t&&n!==l.current&&o.current){const c=i.current;if(c){const u=hi(o.current,{ignoreTransform:!0}),h={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(h.x||h.y)&&s(h)}}n!==l.current&&(l.current=n)},[t,n,o,i]),_.useEffect(()=>{a&&s(null)},[a]),a}function h0(e){let{animateLayoutChanges:t=b7,attributes:n,disabled:o,data:i,getNewIndex:a=C7,id:s,strategy:l,resizeObserverConfig:c,transition:u=S7}=e;const{items:h,containerId:f,activeIndex:g,disabled:m,disableTransforms:C,sortedRects:I,overIndex:b,useDragOverlay:S,strategy:y}=_.useContext(c0),T=x7(o,m),k=h.indexOf(s),A=_.useMemo(()=>({sortable:{containerId:f,index:k,items:h},...i}),[f,i,k,h]),P=_.useMemo(()=>h.slice(h.indexOf(s)),[h,s]),{rect:E,node:M,isOver:B,setNodeRef:w}=f7({id:s,data:A,disabled:T.droppable,resizeObserverConfig:{updateMeasurementsFor:P,...c}}),{active:V,activatorEvent:H,activeNodeRect:X,attributes:W,setNodeRef:se,listeners:Ce,isDragging:be,over:ve,setActivatorNodeRef:Le,transform:x}=c7({id:s,data:A,attributes:{...E7,...n},disabled:T.draggable}),ne=Gb(w,se),pe=!!V,L=pe&&!C&&Ga(g)&&Ga(b),Z=!S&&be,le=Z&&L?x:null,Ie=L?le??(l??y)({rects:I,activeNodeRect:X,activeIndex:g,overIndex:b,index:k}):null,Se=Ga(g)&&Ga(b)?a({id:s,items:h,activeIndex:g,overIndex:b}):k,ae=V==null?void 0:V.id,ce=_.useRef({activeId:ae,items:h,newIndex:Se,containerId:f}),Ue=h!==ce.current.items,Q=t({active:V,containerId:f,isDragging:be,isSorting:pe,id:s,index:k,items:h,newIndex:ce.current.newIndex,previousItems:ce.current.items,previousContainerId:ce.current.containerId,transition:u,wasDragging:ce.current.activeId!=null}),Ve=T7({disabled:!Q,index:k,node:M,rect:E});return _.useEffect(()=>{pe&&ce.current.newIndex!==Se&&(ce.current.newIndex=Se),f!==ce.current.containerId&&(ce.current.containerId=f),h!==ce.current.items&&(ce.current.items=h)},[pe,Se,f,h]),_.useEffect(()=>{if(ae===ce.current.activeId)return;if(ae!=null&&ce.current.activeId==null){ce.current.activeId=ae;return}const we=setTimeout(()=>{ce.current.activeId=ae},50);return()=>clearTimeout(we)},[ae]),{active:V,activeIndex:g,attributes:W,data:A,rect:E,index:k,newIndex:Se,items:h,isOver:B,isSorting:pe,isDragging:be,listeners:Ce,node:M,overIndex:b,over:ve,setNodeRef:ne,setActivatorNodeRef:Le,setDroppableNodeRef:w,setDraggableNodeRef:se,transform:Ve??Ie,transition:Te()};function Te(){if(Ve||Ue&&ce.current.newIndex===k)return y7;if(!(Z&&!Uu(H)||!u)&&(pe||Q))return ni.Transition.toString({...u,property:d0})}}function x7(e,t){var n,o;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(o=e==null?void 0:e.droppable)!=null?o:t.droppable}}Qe.Down,Qe.Right,Qe.Up,Qe.Left;function _7({product:e,children:t}){const{attributes:n,listeners:o,setNodeRef:i,transform:a,transition:s,isDragging:l}=h0({id:e.id}),c={transform:ni.Transform.toString(a),transition:s};return d.jsx("div",{ref:i,style:c,className:`${Ot.product} ${l?Ot.dragging:""}`,...n,...o,children:t})}const f0=e=>{const{isActiveItems:t,setIsActiveItems:n,items:o,setItems:i,other:a,title:s,subtitle:l,editable:c=!0,draggable:u=!1,withImage:h=!1,deletable:f=!0,addable:g=!0,itemsType:m,itemsPlaceholder:C="",itemsOptions:I,hasRangeSelector:b=!1,rangeSelectorOptions:S,modalOptions:y,addableOptions:T={},limit:k,autoInterval:A,tip:P,aspectRatio:E,setAspectRatio:M}=e,[B,w]=_.useState(null),[V,H]=_.useState({top:0,left:0}),[X,W]=_.useState(null),se=_.useRef(null),[Ce,be]=_.useState(!1),ve=$p(zp(ol,{activationConstraint:{distance:5}}));_.useEffect(()=>{if(B){const Z=[...o].map(le=>le.id===B.id?B:le);i(Z)}},[B]),_.useEffect(()=>{if(se.current&&X){const Z=se.current.getBoundingClientRect().height,le=window.innerHeight;let ee=X.top;ee+Z>le+window.scrollY-200&&(ee=le+window.scrollY-Z-200),ee<0&&(ee=10),H({top:ee-30,left:X.left})}},[se.current,X]);const Le=(Z,le)=>{Z.stopPropagation();const ee=Z.target.getBoundingClientRect();W({top:ee.top+window.scrollY-70,left:ee.left-(g?30:65)}),w(le),be(!0)},x=(Z,le)=>{const ee=[...o],Ie={...Z,id:Math.random().toString(36).substr(2,9)};ee.splice(le+1,0,Ie),i(ee)};function ne(Z){if(h)return Z?d.jsx("img",{src:`https://imagedelivery.net/${Z[0]}/w=1000`,alt:"image",width:16,height:16}):d.jsx(ie,{name:"Image",width:16,height:16,fill:"#757575"})}const pe=Z=>{const{active:le,over:ee}=Z;if(ee&&le.id!==ee.id){const Ie=o.findIndex(ae=>ae.id===le.id),Se=o.findIndex(ae=>ae.id===ee.id);if(Ie!==-1&&Se!==-1){const ae=[...o],[ce]=ae.splice(Ie,1);ae.splice(Se,0,ce),i(ae)}}},L=(Z,le)=>{var Ie,Se;const ee=d.jsxs(d.Fragment,{children:[u&&d.jsx("div",{children:d.jsx(ie,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),m==="select"&&I&&d.jsx(ao,{onChange:ae=>{const ce=[...o],Ue=I.find(Ve=>Ve.name["en-US"]===ae);if(!Ue)return;const Q=ce.map(Ve=>Ve.id===Z.id?{...Ue,name:{"en-US":ae}}:Ve);w({...Z,name:{"en-US":ae}}),i([...Q])},value:Z.name["en-US"],options:I.filter(ae=>!o.find(ce=>ce.name["en-US"]===ae.name["en-US"])).map(ae=>ae.name["en-US"]),leftAddonOptions:I.filter(ae=>{var ce;return((ce=ae.images)==null?void 0:ce.length)>0}).map(ae=>({value:ae.name["en-US"],addon:ne(ae.images)}))}),m==="selectInfiniteList"&&I&&d.jsx(Lu,{onChange:ae=>{const ce=[...o],Ue=I.find(Ve=>Ve.name["en-US"]===ae);if(!Ue)return;const Q=ce.map(Ve=>Ve.id===Z.id?{...Ue,name:{"en-US":ae}}:Ve);w({...Z,name:{"en-US":ae}}),i([...Q])},value:Z.name["en-US"],options:I.filter(ae=>!o.find(ce=>ce.name["en-US"]===ae.name["en-US"])).map(ae=>ae.name["en-US"]),leftAddonOptions:I.filter(ae=>{var ce;return((ce=ae.images)==null?void 0:ce.length)>0}).map(ae=>({value:ae.name["en-US"],addon:ne(ae.images)}))}),m==="input"&&d.jsx(nr,{onChange:ae=>{const Ue=[...o].map(Q=>Q.id===Z.id?{...Z,name:{"en-US":ae}}:Q);i([...Ue])},value:Z.name["en-US"],placeholder:C}),m==="image"&&d.jsx(_a,{onChange:ae=>{const Ue=[...o].map(Q=>Q.id===Z.id?{...Z,images:ae}:Q);i([...Ue])},activeImage:(Ie=o.find(ae=>ae.id===Z.id))!=null&&Ie.images?(Se=o.find(ae=>ae.id===Z.id))==null?void 0:Se.images[0]:void 0,tip:P}),d.jsxs("div",{className:Ot.buttons,children:[k&&k>o.length&&g&&d.jsx("div",{className:Ot.deleteButton,children:d.jsx(ie,{name:"Copy",hoverable:!0,width:20,height:20,onClick:()=>{x(Z,le)}})}),c&&d.jsx("div",{className:Ot.deleteButton,children:d.jsx(ie,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:ae=>{Le(ae,Z)}})}),f&&d.jsx("div",{className:Ot.deleteButton,children:d.jsx(ie,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(o.filter(ae=>ae.id!==Z.id))})})]})]});return u?d.jsx(_7,{product:Z,index:le,children:ee},Z.id):d.jsx("div",{className:Ot.product,children:ee},Z.id)};return d.jsxs("div",{className:Ot.productsBlock,children:[(s||t!==void 0)&&d.jsxs("div",{className:Ot.top,children:[s&&d.jsx("h3",{className:Ot.title,children:s}),t!==void 0&&d.jsx(vr,{current:t,onChange:Z=>n==null?void 0:n(Z)})]}),B&&c&&y&&Ce&&d.jsx(zb,{ref:se,activeItem:B,setActiveItem:w,popupPosition:V,modalOptions:y,setIsOpenModal:be}),(t===void 0||t)&&b&&S&&d.jsx(p0,{...S}),(t===void 0||t)&&d.jsxs("div",{className:Ot.products,children:[l&&d.jsx("h5",{className:Ot.subtitle,children:l}),u?d.jsx(o0,{sensors:ve,onDragEnd:pe,children:d.jsx(u0,{items:o.map(Z=>Z.id),strategy:s0,children:o.map((Z,le)=>L(Z,le))})}):o.map((Z,le)=>L(Z,le)),g&&d.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:d.jsx(ti,{withoutHover:!0,className:ge(Ot.button,{[Ot.disabled]:!!(k&&k<=o.length||o.length===(I==null?void 0:I.length))}),size:"s",disabled:!!(k&&k<=o.length||o.length===(I==null?void 0:I.length)),onClick:()=>{const Z=[...o];let le=null;if(I){for(let ee=0;ee<I.length;ee++)if(!o.find(Ie=>Ie.id===I[ee].id)){le=I[ee];break}}m==="select"&&I?Z.push({name:le?le.name:I[0].name,id:(le==null?void 0:le.id)||I[0].id,...T}):m==="input"?Z.push({name:{"en-US":""},id:pt(),...T}):Z.push({name:{"en-US":`Image ${o.length+1}`},id:pt(),...T}),i(Z)},style:{width:"fit-content"},children:d.jsxs("div",{className:Ot.addButton,children:[d.jsx("span",{children:"Add Option"}),d.jsx(ie,{name:"Plus",width:16,height:16})]})})})]}),E&&M&&d.jsx(ao,{value:E,label:"Aspect Ratio",options:Object.keys(Zf),onChange:Z=>M(Z),leftAddonOptions:Xf}),(t===void 0||t)&&a!==void 0&&d.jsx(Hp,{otherTitle:"Other",items:a}),(t===void 0||t)&&A!==void 0&&d.jsx(nr,{label:A.title||"Auto scroll interval",type:"number",value:String(A.autoInterval),onChange:Z=>A.setAutoInterval(Number(Z)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},w7="_title_cx65i_1",v7="_subtitle_cx65i_5",A7="_productsBlock_cx65i_14",k7="_top_cx65i_26",L7="_products_cx65i_14",N7="_product_cx65i_14",P7="_button_cx65i_80",R7="_disabled_cx65i_91",D7="_buttons_cx65i_118",O7="_modal_cx65i_125",M7="_link_cx65i_146",B7="_modalOptions_cx65i_152",F7="_addButton_cx65i_165",H7="_deleteButton_cx65i_180",j7="_closeIcon_cx65i_192",Co={title:w7,subtitle:v7,productsBlock:A7,top:k7,products:L7,product:N7,button:P7,disabled:R7,buttons:D7,modal:O7,link:M7,modalOptions:B7,addButton:F7,deleteButton:H7,closeIcon:j7},U7=_.forwardRef((e,t)=>{const{activeItem:n,setActiveItem:o,popupPosition:i,modalOptions:a,setIsOpenModal:s}=e;return si(t,()=>{o(null),s(!1)}),d.jsxs("div",{ref:t,className:Co.modal,onClick:l=>{l.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[d.jsxs("div",{className:Co.top,children:[d.jsx("h3",{className:Co.title,children:n.name["en-US"]}),d.jsx("div",{className:Co.closeIcon,children:d.jsx(ie,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{o(null),s(!1)}})})]}),d.jsx("div",{className:Co.modalOptions,children:a.map(l=>{if(l.type==="image")return d.jsx(_a,{label:"Put up an attractive image",activeImage:n[l.field],onChange:c=>{const u={...n,[l.field]:c};o(u)}},String(l.field));if(l.type==="text")return d.jsx(Bu,{isActiveText:!0,typesText:n[l.field.type],setTypesText:c=>{const u={...n,[l.field.type]:c};o(u)},alignText:n[l.field.alignText],setAlignText:c=>{const u={...n,[l.field.alignText]:c};o(u)},text:n[l.field.text]["en-US"]||"",setText:c=>{const u={...n,[l.field.text]:{"en-US":c}};o(u)},typeFont:n[l.field.type],setTypeFont:c=>{const u={...n,[l.field.type]:c};o(u)},subtitle:l.label});if(l.type==="input")return d.jsx(nr,{onChange:c=>{const u={...n,[l.field]:{"en-US":c}};o(u)},value:n[l.field]["en-US"]||"",label:l.label,placeholder:l.placeholder});if(l.type==="inputNumber")return d.jsx(nr,{onChange:c=>{const u={...n,[l.field]:c};o(u)},value:n[l.field]||"",label:l.label,placeholder:l.placeholder,type:"number"});if(l.type==="inputSwitch")return d.jsxs("div",{className:Co.link,children:[d.jsx(nr,{onChange:c=>{const u={...n,[l.field.text]:{"en-US":c}};o(u)},value:n[l.field.text]["en-US"]||"",label:l.inputLabel,placeholder:l.placeholder}),d.jsx(vr,{current:!!n[l.field.switch]||!1,label:l.switchLabel,onChange:c=>{const u={...n,[l.field.switch]:c};o(u)}})]});if(l.type==="select")return d.jsx(ao,{options:l.itemsOptions,onChange:c=>{const u={...n,[l.field]:c};o(u)},label:l.label,value:n[l.field]||"String",leftAddonOptions:l.leftAddonOptions})})})]})}),V7="_title_hvj8m_1",z7="_buttonsBlock_hvj8m_15",$7="_top_hvj8m_26",W7="_modal_hvj8m_120",q7="_options_hvj8m_146",G7="_closeIcon_hvj8m_154",Go={title:V7,buttonsBlock:z7,top:$7,modal:W7,options:q7,closeIcon:G7},Y7=_.forwardRef((e,t)=>{var T;const{activeButton:n,setActiveButton:o,popupPosition:i,editableLink:a=!0}=e,[s,l]=_.useState(n.typesText),[c,u]=_.useState(n.destination),[h,f]=_.useState(n.page),[g,m]=_.useState(n.link||""),[C,I]=_.useState(n.text||{"en-US":""}),[b,S]=_.useState(n.openInNewTab),{pages:y}=zr();return si(t,()=>{o(null)}),_.useEffect(()=>{o({...n,...{text:C,link:g,destination:c,typesText:s,page:h,openInNewTab:b}})},[s,c,g,C,h,b]),d.jsxs("div",{className:Go.modal,onClick:k=>{k.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},ref:t,children:[d.jsxs("div",{className:Go.top,children:[d.jsx("h3",{className:Go.title,children:n.type}),d.jsx("div",{className:Go.closeIcon,children:d.jsx(ie,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>o(null)})})]}),d.jsxs("div",{className:Go.options,children:[a&&d.jsx(ao,{label:"Destination",onChange:k=>u(k),options:["Go to Page","Open Link"].filter(k=>k!==c),value:c}),a&&(c==="Go to Page"?d.jsx(ao,{label:"Go to",onChange:k=>{if(k==="Sign In")f("/customer-dash");else if(y){for(const A in y)if(y[A].name===k){f(y[A].path);break}}else f(Yf[0])},options:y?[...Object.values(y).filter(k=>k.path!==h).map(k=>k.name),"Sign In"]:["Sign In"],value:y?h==="/customer-dash"?"Sign In":((T=Object.values(y).find(k=>k.path===h))==null?void 0:T.name)||"Home":"Home"}):d.jsx(nr,{onChange:k=>m(k),value:g,placeholder:"https://",label:"Link"})),a&&d.jsx(vr,{current:n.openInNewTab,label:"Open in new tab",onChange:k=>S(k)}),d.jsx(Ou,{onChange:k=>I({"en-US":k}),value:C["en-US"],label:"Text"}),d.jsx(Du,{typesText:s,setTypesText:l})]})]})}),Z7="_wrapper_m18qi_1",X7="_subtitle_m18qi_7",K7="_content_m18qi_14",Q7="_range_m18qi_22",J7="_track_m18qi_27",ey="_progress_m18qi_36",ty="_dots_m18qi_46",ny="_dot_m18qi_46",ry="_active_m18qi_65",oy="_input_m18qi_77",iy="_countBlock_m18qi_91",ay="_controls_m18qi_107",sy="_button_m18qi_113",mn={wrapper:Z7,subtitle:X7,content:K7,range:Q7,track:J7,progress:ey,dots:ty,dot:ny,active:ry,input:oy,countBlock:iy,controls:ay,button:sy},p0=e=>{const{label:t,min:n=1,max:o=4,step:i=1,count:a,setCount:s}=e,[l,c]=_.useState(!1),u=Array.from({length:(o-n)/i+1}),h=(a-n)/(o-n)*100,f=()=>{a<o&&s(a+i)},g=()=>{a>n&&s(a-i)},m=C=>{const I=n+C*i;s(I)};return d.jsxs("div",{className:mn.wrapper,children:[t&&d.jsx("h5",{className:mn.subtitle,children:t}),d.jsxs("div",{className:mn.content,children:[d.jsxs("div",{className:mn.range,children:[d.jsx("div",{className:mn.track}),d.jsx("div",{className:mn.progress,style:{width:`${h}%`}}),d.jsx("div",{className:mn.dots,children:u.map((C,I)=>{const b=I<=(a-n)/i;return d.jsx("button",{onClick:()=>m(I),className:ge(mn.dot,{[mn.active]:b,[mn.inactive]:!b,[mn.dragging]:l}),"aria-label":`Set value to ${n+I*i}`},I)})}),d.jsx("input",{type:"range",min:n,max:o,step:i,value:a,onChange:C=>s(Number(C.target.value)),onMouseDown:()=>c(!0),onMouseUp:()=>c(!1),onTouchStart:()=>c(!0),onTouchEnd:()=>c(!1),className:mn.input})]}),d.jsxs("div",{className:mn.countBlock,children:[d.jsx(nr,{type:"number",min:n,max:o,paddingless:!0,onChange:C=>{const I=Number(C);I>o?s(o):I<n?s(n):s(I)},value:String(a)}),d.jsxs("div",{className:mn.controls,children:[d.jsx("button",{onClick:f,disabled:a>=o,className:mn.button,"aria-label":"Increment count",children:d.jsx(ie,{name:"CaretUp",width:15,height:15})}),d.jsx("button",{onClick:g,disabled:a<=n,className:mn.button,"aria-label":"Decrement count",children:d.jsx(ie,{name:"CaretDown",width:15,height:15})})]})]})]})]})},ly="_title_11jyy_1",cy="_subtitle_11jyy_5",uy="_productsBlock_11jyy_14",dy="_top_11jyy_26",hy="_products_11jyy_14",fy="_product_11jyy_14",py="_button_11jyy_80",my="_buttons_11jyy_114",gy="_modal_11jyy_121",Iy="_modalOptions_11jyy_148",Cy="_addButton_11jyy_161",by="_deleteButton_11jyy_176",Sy="_closeIcon_11jyy_188",zi={title:ly,subtitle:cy,productsBlock:uy,top:dy,products:hy,product:fy,button:py,buttons:my,modal:gy,modalOptions:Iy,addButton:Cy,deleteButton:by,closeIcon:Sy},m0=({render:e,block:t})=>e(t),g0=({settings:e,pageContext:t})=>{const{footer:n}=Hr(),{settings:o}=ya(),{pageContext:i}=zr(),{footer:a}=Lo();if(!a||!n)return null;const s=new a;return Object.keys(n).map(l=>{s[l]=n[l]}),s.renderBlock((e==null?void 0:e.blockSettings)||o,t||i)},I0=({settings:e,pageContext:t})=>{const{header:n}=Hr(),{settings:o}=ya(),{pageContext:i}=zr(),{header:a}=Lo();if(!a||!n)return null;const s=new a;return Object.keys(n).map(l=>{s[l]=n[l]}),s.renderBlock((e==null?void 0:e.blockSettings)||o,t||i)},C0=({settings:e,pageContext:t})=>{const{announcement:n}=Hr(),{settings:o}=ya(),{pageContext:i}=zr(),{announcement:a}=Lo();if(!a||!n)return null;const s=new a;return Object.keys(n).map(l=>{s[l]=n[l]}),s.renderBlock(e||o,t||i)},yy=async(e,t)=>{const n=kt.getState().apiUrls,o=Vt?localStorage.getItem("fakeDomain")||"flagship-theme.pages.dev":window.location.hostname,i=localStorage.getItem("shopPassword");if(t&&!i)return null;const a=`${n.storeApi}/v2/shops/${o}/pages/${e}`+(t?`?password=${i}`:"");try{return await lt({url:a,withToken:!0,method:"get"})}catch(s){if(ht.isAxiosError(s)&&s.response&&s.response.status===404)return null}},Ey="_wrapper_5w9s8_1",Ty={wrapper:Ey},Wc=e=>{const{error:t}=e;return d.jsx("div",{className:Ty.wrapper,children:t})},xy=async e=>{const t=kt.getState().apiUrls,n=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${t.slApi}/v1/balance/top-up/${n}`;return await lt({url:o,method:"post",body:e,withToken:!1})},fi=async e=>{const t=kt.getState().apiUrls,n=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${t.customersApi}/v2/${n}/customers/${e}`;return await lt({url:o,withToken:!0,method:"get",typeToken:"customer"})},_y=()=>fi("dash/info"),wy=()=>fi("dash/dashboard/home"),vy=()=>fi("rewards"),Ay=()=>fi("balance"),ky=()=>fi("balance/top-up/settings"),Ly=()=>fi("referral-system"),qc=10,sl=async({url:e,PageNumber:t})=>{var l;const n=kt.getState().apiUrls,o=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,i=`${n.customersApi}/v2/${o}/${e}?PageNumber=${t}&PageSize=${qc}`,a=await lt({url:i,withToken:!0,method:"get",typeToken:"customer"}),s=Number((l=a.headers)==null?void 0:l["x-pagination-total"]);return{list:a.data,totalCount:s}},Wu=async(e,t="get",n)=>{const o=kt.getState().apiUrls,i=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${o.slApi}/v1/orders/${i}/${e}`;return await lt({url:a,method:t,withToken:!0,body:n,typeToken:"customer"})},Ny=e=>Wu("","post",e),Py=({PageNumber:e})=>sl({url:"customers/orders",PageNumber:e}),Ry=e=>Wu(e),Dy=e=>Wu(e),Oy=async e=>{const t=kt.getState().apiUrls,n=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${t.slApi}/v1/${n}/subscriptions`;return await lt({url:o,method:"post",withToken:!1,body:e})},My=async(e,t)=>{const n=kt.getState().apiUrls,o=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,i=`${n.slApi}/v2/${o}/subscriptions/${e}/${t}`;return await lt({url:i,method:"get",withToken:!1})},By=async(e,t)=>{const n=kt.getState().apiUrls,o=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,i=`${n.slApi}/v1/${o}/subscriptions/${e}/${t}/upgrades`;return await lt({url:i,method:"get",withToken:!1})},Fy=async(e,t,n)=>{const o=kt.getState().apiUrls,i=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${o.slApi}/v1/${i}/subscriptions/${e}/${t}/cancel`;return await lt({url:a,method:"post",withToken:!1,body:n})},Hy=async(e,t)=>{const n=kt.getState().apiUrls,o=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,i=`${n.slApi}/v2/${o}/subscriptions/${e}/change-gateway`;return await lt({url:i,method:"post",withToken:!1,body:{gateway:t}})},jy=({PageNumber:e})=>sl({url:"customers/subscriptions",PageNumber:e}),Uy=async({id:e,accessToken:t})=>await By(e,t),Vy=async(e,t)=>{const n=kt.getState().apiUrls,o=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,i=`${n.slApi}/v2/${o}/subscriptions/${e}/order`;return await lt({url:i,method:"post",withToken:!1,body:t})},zy=async(e,t)=>{const n=kt.getState().apiUrls,o=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,i=`${n.slApi}/v1/public/${o}/tickets/${e}/${t}`;return await lt({url:i,method:"get",withToken:!1})},$y=async(e,t,n,o,i)=>{const a=kt.getState().apiUrls,s=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,l=`${a.slApi}/v1/public/${s}/tickets/${e}/${t}/answer`;return(await lt({url:l,method:"post",body:{message:n,recaptcha:o,tsId:i},withToken:!1})).data},Wy=({PageNumber:e})=>sl({url:"customers/tickets",PageNumber:e}),qy=({PageNumber:e})=>sl({url:"customers/balance/transactions",PageNumber:e}),b0=async e=>{const t=kt.getState().apiUrls,n=e.map(s=>["names",s]),o=new URLSearchParams(n),i=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${t.slApi}/v2/gateways?shopDomain=${i}&${o.toString()}`;return await lt({url:a,method:"get",withToken:!1})},S0=async({email:e,recaptcha:t,tsId:n})=>{const o=kt.getState().apiUrls,i=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${o.customersApi}/v2/${i}/auth/otp/request`;return(await lt({url:a,body:{email:e,recaptcha:t,tsId:n},method:"post",withToken:!1})).data?{requested:!0,email:e}:{requested:!1,email:void 0}},y0=async({email:e,otp:t,recaptcha:n,tsId:o})=>{const i=kt.getState().apiUrls,a=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,s=`${i.customersApi}/v2/${a}/auth/otp/login`,{data:l}=await lt({url:s,method:"post",body:{email:e,otp:t,recaptcha:n,tsId:o},withToken:!1});return uo.getState().setToken(l.data),localStorage.setItem("token",l.data),{token:l.data,requested:!1}},Gc=async()=>{uo.getState().setToken(""),localStorage.removeItem("token")},Gy=Object.freeze(Object.defineProperty({__proto__:null,loginCustomer:y0,logoutCustomer:Gc,requestOtp:S0},Symbol.toStringTag,{value:"Module"})),Yy=async e=>{const t=kt.getState().apiUrls,n=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${t.slApi}/v2/coupons/${n}/validate`;return await lt({url:o,method:"post",body:e,withToken:!1})},Zy=async e=>{const t=kt.getState().apiUrls,n=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${t.customersApi}/v2/${n}/customers/referral-system/signup`;return(await lt({url:o,withToken:!0,method:"post",body:e,typeToken:"customer"})).data},Xy=async()=>{const{data:e}=await Ly();return e},Ky=async e=>{const{data:t}=await Zy(e);return t};async function Qy(e){const t=kt.getState().apiUrls,n=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${t.customersApi}/v2/${n}/customers/rewards/${e.id}/claim`;return lt({url:o,method:"post",withToken:!0,typeToken:"customer"})}const Wl="Balance",Jy={Number:"NUMBER",Textarea:"LARGE_TEXT",Checkbox:"CHECK_BOX",Hidden:"HIDDEN"},e8={recaptcha:"",gateway:"",paymentMethod:"",parts:[],customFields:{},discordSocialConnectId:null,coupon:null,tsId:""},B1=(e,t)=>{var u;const{productId:n,productVariantId:o,quantity:i,chargeType:a}=t,s=e.find(h=>h.id===n);if(!s)throw new Error("Product does not exist");const l=s.variants.find(h=>h.id===o);if(!l)throw new Error("Variant does not exist");if(a==="RECURRING"&&!l.subscriptionSettings)throw new Error("Variant does not have subscription settings");if(i!==void 0&&((u=l.quantity)!=null&&u.available)&&l.quantity.available<i)throw new Error("Not enough quantity available");const c=Br.getState().cart;if(c.parts.length>0){const h=e.find(g=>g.id===c.parts[0].productId),f=h==null?void 0:h.variants.find(g=>g.id===c.parts[0].productVariantId);if(f&&l.price.currency!==f.price.currency)throw new Error("Product have different currency")}return l},t8=(e,t)=>{if(!e.volumeDiscounts||e.volumeDiscounts.length===0)return 0;const n=e.volumeDiscounts.filter(i=>t>=i.amount);return n.length===0?0:n.reduce((i,a)=>a.amount>i.amount?a:i).percentage},n8=(e,t)=>{let n=0,o=0;return e.forEach(i=>{var g,m;const a=t.find(C=>(C==null?void 0:C.id)===i.productId),s=a==null?void 0:a.variants.find(C=>C.id===i.productVariantId);if(!s)return;const{gateway:l}=Br.getState().cart,c=(s==null?void 0:s.gateways)||[],u=c.some(C=>C.name===l&&C.overrodePrice)?(g=c.find(C=>C.name===l))==null?void 0:g.overrodePrice:null;let h=0,f=0;if(i.chargeType==="ONE_TIME"?(h=(u==null?void 0:u.amount)||(s==null?void 0:s.price.amount)||0,f=h*i.quantity):f=s!=null&&s.subscriptionSettings?s.subscriptionSettings.price.amount+(((m=s.subscriptionSettings.entryFee)==null?void 0:m.amount)||0):0,n+=f,i.chargeType==="ONE_TIME"){const C=t8(s,i.quantity),I=f*(1-C/100);o+=I}else o+=f}),{total:n,totalWithVolumeDiscounts:o}},r8=(e,t)=>({isRequired:t.some(o=>{var a;const i=e.find(s=>(s==null?void 0:s.id)===o.productId);return(a=i==null?void 0:i.variants.find(s=>s.id===o.productVariantId))==null?void 0:a.discordSettings.isRequired}),isEnabled:t.some(o=>{var a;const i=e.find(s=>(s==null?void 0:s.id)===o.productId);return(a=i==null?void 0:i.variants.find(s=>s.id===o.productVariantId))==null?void 0:a.discordSettings.isEnabled})}),F1=e=>new Set(e.gateways.map(t=>t.name)),H1={availableGateways:[],requiresSignInGateways:[]},j1=(e,t)=>{var a;if(t.length===0)return H1;const n=(a=t[0])==null?void 0:a.variants[0];if(!n)return H1;const o=F1(n);for(const s of e){const l=t.find(h=>h.id===s.productId);if(!l)continue;const c=l.variants.find(h=>h.id===s.productVariantId);if(!c)continue;const u=F1(c);for(const h of o)u.has(h)||o.delete(h)}return!localStorage.getItem("token")&&o.has(Wl)?(o.delete(Wl),{availableGateways:[...o],requiresSignInGateways:[Wl]}):{availableGateways:[...o],requiresSignInGateways:[]}},o8=(e,t)=>{if(e.length===0)return[];const o=e.map(a=>{const s=t.find(c=>c.id===a.productId),l=s==null?void 0:s.variants.find(c=>c.id===a.productVariantId);return(l==null?void 0:l.customFields)??[]}).flat().reduce((a,s)=>{const l=a[s.name];return l?(s.required&&!l.required&&(a[s.name]={...s,value:s.defaultValue}),a):(a[s.name]={...s,value:s.defaultValue},a)},{});return Object.values(o).map(a=>({...a,value:""}))},i8=(e,t)=>{const n=t.find(i=>i.id===e.productId),o=n==null?void 0:n.variants.find(i=>i.id===e.productVariantId);return e.chargeType==="RECURRING"?!!(o!=null&&o.subscriptionSettings):!1},a8=()=>{const{cart:e,products:t,coupon:n,pending:o,applyCouponPending:i,customerEmail:a,setCart:s,setProducts:l,setCoupon:c,setPending:u,setApplyCouponPending:h}=Br(),f=async I=>{var E;h(!0);const{cart:b}=Br.getState(),{gateway:S,parts:y}=b,{notifications:T,setNotifications:k}=cn.getState();S||(h(!1),k([...T,{message:"There should be a gateway for the coupon",status:"error",id:pt()}]));const A=y.map(M=>M.productId);let P=null;try{const{data:M}=await Yy({gateway:S,couponName:I,productIds:A});P=M.data,k([...T,{message:"Coupon is applied",status:"success",id:pt()}]),s(B=>({...B,coupon:I}))}catch(M){const B=M;k([...T,{message:`Coupon is not applied: ${B.message}`,status:"error",id:pt()}]),s(w=>({...w,coupon:null})),c(null),h(!1)}if(h(!1),(E=P==null?void 0:P.restrictToProductIds)!=null&&E.length&&!A.every(M=>{var B;return(B=P==null?void 0:P.restrictToProductIds)==null?void 0:B.includes(M)}))throw new Error("Coupon can't be applied to such products");return c(P),P},C={reset(){s({...e8})},addProducts:I=>{const b=Br.getState().products,S=I.filter(y=>!b.some(T=>T.id===y.id));l([...b,...S])},addProductToCart:I=>{const b=Br.getState().cart;try{B1(t,I)}catch(y){throw new Error(y)}const S=b.parts.find(y=>y.productId===I.productId&&y.productVariantId===I.productVariantId&&y.chargeType===I.chargeType);if(S)return C.updateQuantityOfProduct({...S,quantity:(S.quantity||1)+(I.quantity||1),chargeType:I.chargeType});if(b.parts.length&&j1([...b.parts,I],t).availableGateways.length===0)throw new Error("No common payment gateways available");s({...b,parts:[...b.parts,I]}),b.coupon&&f(b.coupon)},removeProduct({productId:I,productVariantId:b}){s(S=>({...S,parts:S.parts.filter(y=>y.productId!==I||y.productVariantId!==b)})),e.coupon&&f(e.coupon)},getPossibleGateways(){return j1(e.parts,t)},removeCoupon(){c(null)},getDiscordSettings(){return r8(t,e.parts)},updateQuantityOfProduct(I){B1(t,I),s(b=>({...b,parts:b.parts.map(S=>S.productId===I.productId&&S.productVariantId===I.productVariantId?{...S,quantity:I.quantity,chargeType:I.chargeType}:S)})),e.coupon&&f(e.coupon)},getTotalAndDiscount(){const{coupon:I}=Br.getState(),{total:b,totalWithVolumeDiscounts:S}=n8(e.parts,t);let y;const T=S;return I&&I.discount?!I.isFixed&&I.discount===100?y=0:y=I.isFixed?Math.max(0,T-I.discount):T*(1-I.discount/100):S!==b&&(y=S),{total:b,totalWithVolumeDiscounts:S!==b?S:void 0,totalWithDiscount:y}},setGateway(I){s(S=>({...S,gateway:I}));const{isAntistock:b}=mt.getState();e.coupon&&!b&&f(e.coupon)},setPaymentMethod(I){s(b=>({...b,paymentMethod:I}))},async submitCart(I){u(!0);const{cart:b}=Br.getState(),{discordInfo:S}=Op.getState();let y;if(b.parts&&a&&i8(b.parts[0],t))try{const{data:T}=await Oy({...b,partOrder:b.parts[0],referralCode:localStorage.getItem("referralCode"),discordSocialConnectId:S!=null&&S.authorized?S.id:null,customerEmail:a,recaptcha:I,customFields:{...b.customFields},tsId:so()});y=T.data}catch(T){console.error(T)}else try{const{data:T}=await Ny({...b,referralCode:localStorage.getItem("referralCode"),recaptcha:I,customFields:{...b.customFields},tsId:so(),discordSocialConnectId:S!=null&&S.authorized?S.id:null});y=T.data}catch(T){const k=T,{notifications:A,setNotifications:P}=cn.getState();P([...A,{message:`Failed to create order: ${k.message}`,status:"error",id:pt()}])}if(u(!1),y)return y;throw new Error("Failed to create order")},setDiscordSocialConnectId(I){s(b=>({...b,discordSocialConnectId:I}))},setCustomFields(I){s(b=>({...b,customFields:{...I}}))}};return _.useEffect(()=>{s(I=>({...I,customerEmail:a??""}))},[a,s]),{cart:e,products:t,coupon:n,pending:o,applyCouponPending:i,applyCoupon:f,...C}},ll=()=>{const{notifications:e,setNotifications:t}=cn();return n=>{navigator.clipboard.writeText(n),t([...e,{status:"success",message:"Successfully copied",id:pt()}])}};function E0(e,t=!0){if(!e||typeof e!="string")return"";if(/<[a-z][\s\S]*>/i.test(e))return e;const o=e.split(" "),i=20;if(t){let a="",s=[];return o.forEach(l=>{l.length>i?(s.length>0&&(a+=`<span style="hyphens: manual">${s.join(" ")} </span>`,s=[]),a+=`<span style="hyphens: auto" lang="en">${l} </span>`):s.push(l)}),s.length>0&&(a+=`<span style="hyphens: manual">${s.join(" ")}</span>`),a}else{const a=[];let s=[],l=0;return o.forEach(c=>{c.length>i?(s.length>0&&(a.push(d.jsxs("span",{style:{hyphens:"manual"},children:[s.join(" ")," "]},l++)),s=[]),a.push(d.jsxs("span",{style:{hyphens:"auto"},lang:"en",children:[c," "]},l++))):s.push(c)}),s.length>0&&a.push(d.jsx("span",{style:{hyphens:"manual"},children:s.join(" ")},l++)),a}}const s8=_.forwardRef((e,t)=>{const{activeItem:n,setActiveItem:o,popupPosition:i,setIsOpenModal:a,itemsOptions:s}=e,l=s.find(c=>c.id===n.listingId);return si(t,()=>{o(null),a(!1)}),l?d.jsxs("div",{className:zi.modal,onClick:c=>{c.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[d.jsxs("div",{className:zi.top,children:[d.jsx("h3",{dangerouslySetInnerHTML:{__html:E0(l.productData.name)}}),d.jsx("div",{className:zi.closeIcon,children:d.jsx(ie,{name:"X",height:20,width:20,onClick:()=>{a(!1),o(null)}})})]}),d.jsx("div",{className:zi.modalOptions,children:d.jsx(_a,{label:"Put up an attractive image",activeImage:l.productData.images.length>0?l.productData.images[0].cfId:n.image?n.image:void 0,onChange:c=>{const u={...n,image:c[0]};o(u)}})})]}):null}),l8="_wrapper_ipyfg_1",c8="_label_ipyfg_9",u8="_input_ipyfg_18",d8="_disabled_ipyfg_31",h8="_paddingless_ipyfg_36",f8="_content_ipyfg_47",p8="_contentBorder_ipyfg_60",m8="_contentField_ipyfg_65",g8="_contentIsAntistock_ipyfg_69",I8="_borderless_ipyfg_74",C8="_rightIcon_ipyfg_79",b8="_leftIcon_ipyfg_87",S8="_requiredStar_ipyfg_94",xn={wrapper:l8,label:c8,input:u8,disabled:d8,paddingless:h8,content:f8,contentBorder:p8,contentField:m8,contentIsAntistock:g8,borderless:I8,rightIcon:C8,leftIcon:b8,requiredStar:S8},Ro=e=>{const{onChange:t,style:n,label:o,value:i,type:a="text",min:s,max:l,placeholder:c,disabled:u=!1,required:h=!1,regex:f,paddingless:g=!1,borderless:m=!1,editable:C=!1,isSearch:I=!1,centered:b=!1,maxSymbols:S,rightIcon:y,onFocus:T,leftIcon:k}=e,{themeSettings:A}=No(),{isAntistock:P}=mt(),{inputs:E}=A,[M,B]=_.useState(!1);function w(H){if(Number(H)<0)return String(s);const X=H.replace(/[^\d-]/g,"");return Number(X)<0?String(s):X}function V(H){if(!h||!f)return!0;try{return new RegExp(f).test(H)}catch(X){return console.error("Invalid regex pattern:",f,X),!0}}return d.jsxs("div",{className:xn.wrapper,children:[o&&d.jsxs("label",{className:xn.label,htmlFor:o,style:{color:P?"var(--text-secondary)":void 0},children:[o,h&&d.jsx("span",{className:xn.requiredStar,children:"*"})]}),d.jsxs("div",{className:ge(xn.content,{[xn.contentBorder]:!P&&E.border.active,[xn.contentField]:E.field.active,[xn.disabled]:u,[xn.contentIsAntistock]:P}),style:{...n},children:[k&&d.jsx("div",{className:xn.leftIcon,children:k}),d.jsx("input",{maxLength:S,id:o,type:a||"text",onChange:H=>{if(a==="text")t(H.target.value);else{const X=w(H.target.value);t(X)}},value:i,autoComplete:"off",placeholder:c||"Type something...",className:ge(xn.input,{[xn.required]:M&&h&&!V(i),[xn.paddingless]:g,[xn.borderless]:m}),min:a==="number"?s:void 0,max:a==="number"?l:void 0,onFocus:()=>{T==null||T(),B(!0)},disabled:u,style:{textAlign:b?"center":"left",padding:I?`7px ${Number(E.general.size)+20}px 7px ${k?35:11}px`:`7px ${y?35:11}px 7px ${k?35:11}px`}}),y&&d.jsx("div",{className:xn.rightIcon,children:y}),I&&d.jsx("div",{className:xn.rightIcon,children:d.jsx(ie,{name:"MagnifyingGlass",fill:"var(--text-secondary)",width:E.general.size,height:E.general.size})}),C&&d.jsx("div",{children:d.jsx(ie,{name:"Sliders",width:20,height:20,hoverable:!0})})]})]})},y8="_button_1v5k3_1",E8="_primary_1v5k3_20",T8="_primaryHovered_1v5k3_30",x8="_secondary_1v5k3_35",_8="_secondaryHovered_1v5k3_45",w8="_secondaryAntistock_1v5k3_50",v8="_tertiary_1v5k3_61",A8="_special_1v5k3_71",k8="_tertiaryHovered_1v5k3_75",L8="_content_1v5k3_80",N8="_isAntistock_1v5k3_88",ar={button:y8,primary:E8,primaryHovered:T8,secondary:x8,secondaryHovered:_8,secondaryAntistock:w8,tertiary:v8,special:A8,tertiaryHovered:k8,content:L8,isAntistock:N8},P8=()=>typeof document<"u"?document.documentElement.hasAttribute("translated")||document.documentElement.querySelector(".translated-ltr, .translated-rtl")!==null||document.head.querySelector('meta[name="_translator"]')!==null:!1,T0=({children:e,className:t,as:n="span",...o})=>{const[i,a]=_.useState(!1);return _.useEffect(()=>{typeof window<"u"&&a(P8())},[]),i?d.jsx(n,{className:t,...o,"data-stable-text":e,dangerouslySetInnerHTML:{__html:""}}):d.jsx(n,{className:t,...o,children:e})},_t=e=>{const{children:t,onClick:n,style:o,className:i,disabled:a=!1,type:s="Primary",dangerouslySetInnerHTML:l}=e,{themeSettings:c}=No(),{isAntistock:u}=mt(),h=I=>typeof I=="string"?d.jsx(T0,{children:I}):I,f={onClick:n,disabled:a,style:o,className:ge(ar.button,i,{[ar.primary]:s==="Primary",[ar.secondary]:s==="Secondary"&&!u,[ar.secondaryAntistock]:s==="Secondary"&&u,[ar.tertiary]:s==="Tertiary",[ar.primaryHovered]:s==="Primary"&&!a&&c.buttons.primary.hover&&!u,[ar.secondaryHovered]:s==="Secondary"&&!a&&c.buttons.secondary.hover&&!u,[ar.tertiaryHovered]:s==="Tertiary"&&!a&&c.buttons.tertiary.hover&&!u,[ar.isAntistock]:u})};if(s==="Special")return d.jsx("button",{...f,className:ar.special,...l?{dangerouslySetInnerHTML:l}:{children:h(t)}});const g=s.toLowerCase(),m=c.buttons[g],C=s==="Tertiary"?d.jsxs("div",{className:ar.content,children:[h(t),d.jsx(ie,{name:"ArrowRight",fill:"var(--text-tertiary)",width:20,height:20})]}):h(t);return d.jsx("button",{...f,style:{...o,textAlign:m.alignment},...l?{dangerouslySetInnerHTML:l}:{children:C}})},R8="_modal_1iz94_1",D8="_padding_1iz94_17",O8="_content_1iz94_21",M8="_close_1iz94_42",Za={modal:R8,padding:D8,content:O8,close:M8},cl=e=>{const{close:t,children:n,withAnimation:o=!0,hasPadding:i=!0}=e,{isOpen:a,setIsOpen:s}=$r(),l=()=>{s(!1),o?setTimeout(()=>{t(!1),s(!0)},300):(t(!1),s(!0))};return _.useEffect(()=>{const c=u=>{u.key==="Escape"&&l()};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c)}},[]),To.createPortal(d.jsx("div",{className:ge(Za.modal,{[Za.padding]:i}),onClick:l,children:o?d.jsx("div",{className:ge(Za.content,{[Za.close]:!a}),children:n}):d.jsx(d.Fragment,{children:n})}),document.body)},B8="_loader_1kbu3_1",F8="_loaderAntistock_1kbu3_18",U1={loader:B8,loaderAntistock:F8},An=e=>{const{isAntistock:t}=mt();return t?d.jsx("span",{className:U1.loaderAntistock,style:{width:"15px",height:"15px",borderWidth:"2px"}}):d.jsx("div",{className:U1.loader,...e})},H8="_container_6vcrl_1",j8="_wrapper_6vcrl_5",V1={container:H8,wrapper:j8};class U8{constructor(){Ti(this,"observer",null);Ti(this,"callbacks",new Map);Ti(this,"handleWindowResize",()=>{this.callbacks.forEach((t,n)=>{const o=n.getBoundingClientRect().width;t.forEach(i=>i(o))})});this.observer=new ResizeObserver(t=>{var n;for(const o of t){const i=o.contentRect.width,a=o.target;this.callbacks.has(a)&&((n=this.callbacks.get(a))==null||n.forEach(s=>s(i)))}}),window.addEventListener("resize",this.handleWindowResize)}observe(t,n){var i;if(!this.observer)return;this.callbacks.has(t)||(this.callbacks.set(t,[]),this.observer.observe(t)),(this.callbacks.get(t)||[]).includes(n)||(i=this.callbacks.get(t))==null||i.push(n)}unobserve(t,n){var o;if(!(!this.observer||!this.callbacks.has(t))){if(n){const i=this.callbacks.get(t)||[];this.callbacks.set(t,i.filter(a=>a!==n))}(o=this.callbacks.get(t))!=null&&o.length||(this.callbacks.delete(t),this.observer.unobserve(t))}}disconnect(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callbacks.clear(),window.removeEventListener("resize",this.handleWindowResize)}}const z1=new U8;function x0(e){const[t,n]=_.useState("desktop");return _.useEffect(()=>{const o=e.current;if(!o)return;const i=l=>l>=1081?"desktop":l>=720?"tablet":"mobile",a=l=>{const c=i(l);n(c)};z1.observe(o,a);const s=o.getBoundingClientRect().width;return a(s),()=>{z1.unobserve(o,a)}},[e]),t}const Xa=16,_0=({children:e,padding:t,style:n,notPadding:o=!1,maxWidth:i="var(--max-width-store)"})=>{const a=_.useRef(null),s=x0(a);return d.jsx("div",{className:V1.container,ref:a,style:n,children:d.jsx("div",{className:V1.wrapper,style:{maxWidth:i,paddingTop:s==="desktop"?t==null?void 0:t.top:o?0:Xa,paddingBottom:s==="desktop"?t==null?void 0:t.bottom:o?0:Xa,paddingLeft:s==="desktop"?t==null?void 0:t.left:o?0:Xa,paddingRight:s==="desktop"?t==null?void 0:t.right:o?0:Xa,...n},children:e(s)})})},V8="_wrapper_d9z4o_1",z8="_label_d9z4o_10",$8="_contentBorder_d9z4o_19",W8="_textarea_d9z4o_23",q8="_contentField_d9z4o_35",G8="_antistock_d9z4o_49",Y8="_length_d9z4o_58",Gr={wrapper:V8,label:z8,contentBorder:$8,textarea:W8,contentField:q8,antistock:G8,length:Y8},Z8=e=>{const{onChange:t,label:n,value:o,maxLength:i,placeholder:a="Type something...",type:s="text",required:l=!1}=e,[c,u]=_.useState(o.length),{themeSettings:h}=No(),{isAntistock:f}=mt();function g(m){return s==="number"?m.replace(/[^\d\n]+/g,""):m}return d.jsxs("div",{className:Gr.wrapper,children:[n&&d.jsxs("label",{className:Gr.label,htmlFor:n,style:{color:f?"var(--text-secondary)":void 0},children:[n,l&&d.jsx("span",{className:Gr.requiredStar,children:"*"})]}),d.jsx("textarea",{id:n,value:o,onChange:m=>{const C=g(m.target.value);u(C.length),t(C)},placeholder:a,className:ge(Gr.textarea,{[Gr.contentBorder]:h.inputs.border.active,[Gr.contentField]:h.inputs.field.active,[Gr.antistock]:f}),maxLength:i}),i&&d.jsxs("div",{className:Gr.length,children:[c,"/",i]})]})},X8="_wrapper_ty9h3_2",K8="_label_ty9h3_9",Q8="_top_ty9h3_17",J8="_select_ty9h3_23",eE="_borderFocused_ty9h3_42",tE="_input_ty9h3_49",nE="_icon_ty9h3_59",rE="_rotate_ty9h3_64",oE="_content_ty9h3_68",iE="_options_ty9h3_72",aE="_filteredOptions_ty9h3_93",sE="_open_ty9h3_97",lE="_option_ty9h3_72",cE="_focused_ty9h3_115",uE="_addon_ty9h3_119",dE="_value_ty9h3_130",hE="_postfix_ty9h3_135",fE="_leftAddon_ty9h3_139",Jt={wrapper:X8,label:K8,top:Q8,select:J8,borderFocused:eE,input:tE,icon:nE,rotate:rE,content:oE,options:iE,filteredOptions:aE,open:sE,option:lE,focused:cE,addon:uE,value:dE,postfix:hE,leftAddon:fE};function pE(e,t){_.useEffect(()=>{function n(o){!e.current||e.current.contains(o.target)||t(o)}return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[e,t])}const w0=e=>{var M,B;const{onChange:t,label:n,value:o,options:i,style:a,switcher:s,postfixs:l,leftAddonOptions:c}=e,[u,h]=_.useState(!1),[f,g]=_.useState(""),[m,C]=_.useState(null),[I,b]=_.useState(!1),S=_.useRef(null);pE(S,()=>h(!1));function y(w){g(""),t(w),h(!1),C(null)}function T(w,V){return w?w.length>V+3?`${w.slice(0,V)}...`:w:""}function k(w){if(!u){(w.key==="Enter"||w.key==="ArrowDown")&&h(!0);return}const V=E;w.key==="ArrowDown"&&(w.preventDefault(),C(H=>H===null||H===V.length-1?0:H+1)),w.key==="ArrowUp"&&(w.preventDefault(),C(H=>H===null||H===0?V.length-1:H-1)),w.key==="Enter"&&m!==null&&(w.preventDefault(),y(V[m])),w.key==="Escape"&&h(!1)}const A=_.useRef(null),P=_.useMemo(()=>new Wr(i,{threshold:.4,minMatchCharLength:2}),[i]),E=_.useMemo(()=>I&&f.trim()!==""?P.search(f).map(w=>w.item):i,[f,i,I,P]);return d.jsxs("div",{className:Jt.wrapper,style:{...a},children:[n&&d.jsxs("div",{className:Jt.top,children:[d.jsx("label",{className:Jt.label,htmlFor:n,children:n}),s&&d.jsx(vr,{current:s.value,onChange:s.onChange})]}),d.jsxs("label",{className:Jt.content,ref:S,children:[d.jsxs("div",{className:ge(Jt.select,{[Jt.borderFocused]:u}),onKeyDown:k,onClick:w=>{w.stopPropagation(),h(V=>!V),b(!1)},ref:A,tabIndex:0,children:[c&&c.length>0&&d.jsx("div",{className:Jt.addon,children:(M=c.find(w=>w.value===o))==null?void 0:M.addon}),d.jsx("div",{className:Jt.input,id:"md",children:T(o,15)}),d.jsx("div",{className:ge(Jt.icon,{[Jt.rotate]:u}),onClick:w=>{w.stopPropagation(),h(V=>!V)},children:d.jsx(ie,{name:"CaretDown",width:16,height:16,fill:"var(--text-primary)"})})]}),d.jsxs("div",{className:ge(Jt.options,{[Jt.open]:u}),style:{top:((B=A.current)==null?void 0:B.clientHeight)+10},children:[i.length>6&&d.jsx(Ro,{type:"text",value:f,placeholder:"Search...",onChange:w=>{g(w),b(!0)},isSearch:!0}),d.jsxs("div",{className:Jt.filteredOptions,children:[E.map((w,V)=>{var H;return d.jsxs("div",{className:ge(Jt.option,{[Jt.focused]:V===m}),onClick:()=>{y(w),h(!1)},id:"md",children:[c&&c.length>0&&d.jsx("div",{className:Jt.leftAddon,children:(H=c.find(X=>X.value===w))==null?void 0:H.addon}),d.jsx("span",{className:Jt.value,id:"md",children:T(w,20)}),l&&d.jsx("span",{className:Jt.postfix,id:"md",children:l[V]})]},w)}),E.length===0&&d.jsx("div",{children:"No results found."})]})]})]})]})},mE="_wrapper_2vleg_1",gE="_label_2vleg_9",IE="_options_2vleg_17",CE="_radioLabel_2vleg_23",bE="_radio_2vleg_23",SE="_custom_2vleg_38",yE="_option_2vleg_17",mo={wrapper:mE,label:gE,options:IE,radioLabel:CE,radio:bE,custom:SE,option:yE},EE=e=>{const{defaultValue:t,options:n,onChange:o,label:i,flexDirection:a="row"}=e,[s,l]=_.useState(t),c=u=>{const h=u.target.value;l(h),o(h)};return d.jsxs("div",{className:mo.wrapper,children:[d.jsx("span",{className:mo.label,children:i}),d.jsx("div",{className:mo.options,style:{flexDirection:a},children:n.map(u=>d.jsxs("label",{className:mo.radioLabel,children:[d.jsx("input",{type:"radio",value:u.value,checked:s===u.value,onChange:c,className:mo.radio}),d.jsx("span",{className:mo.custom}),d.jsx("span",{className:mo.option,children:u.label})]},u.value))})]})},TE="_content_eonwv_1",xE="_main_eonwv_12",_E="_block_eonwv_16",wE="_active_eonwv_22",vE="_name_eonwv_32",AE="_addSection_eonwv_109",kE="_addSectionTop_eonwv_117",Yr={content:TE,main:xE,block:_E,active:wE,name:vE,addSection:AE,addSectionTop:kE},LE="_sidebar_xhqpt_1",NE="_content_xhqpt_14",PE="_button_xhqpt_24",RE="_moveButton_xhqpt_40",DE="_deleteButton_xhqpt_49",br={sidebar:LE,content:NE,button:PE,moveButton:RE,deleteButton:DE},OE=()=>{var A;const{activeBlock:e,setActiveBlock:t}=Xs(),{blocks:n,removeBlock:o,moveBlock:i,duplicateBlock:a,setCurrentBlock:s}=Hr(),{currentPage:l,pages:c}=zr(),{setTitle:u,setDescription:h,setOnConfirm:f}=Qf(),{setActiveBlock:g}=Lo(),m=(A=c==null?void 0:c[l])==null?void 0:A.path,C=m?n[m]:null,I=(C==null?void 0:C.order)||[],b=I.indexOf(e.id),S=P=>{P.stopPropagation(),b>0&&m&&(i(m,b,b-1),t({id:e.id,neededScroll:!0}),setTimeout(()=>{t({id:e.id,neededScroll:!1})},100))},y=P=>{P.stopPropagation(),b<I.length-1&&m&&(i(m,b,b+1),t({id:e.id,neededScroll:!0}),setTimeout(()=>{t({id:e.id,neededScroll:!1})},100))},T=P=>{P.stopPropagation(),m&&a(m,e.id)},k=()=>{m&&(o(m,e.id),s(null),g(null),t({id:null,neededScroll:!1}))};return d.jsx("div",{className:br.sidebar,children:d.jsxs("div",{className:br.content,children:[d.jsx("button",{onClick:S,className:ge(br.button,br.moveButton),disabled:b===0,children:d.jsx(ie,{name:"ArrowUp"})}),d.jsx("button",{onClick:y,className:ge(br.button,br.moveButton),disabled:b===I.length-1,children:d.jsx(ie,{name:"ArrowDown"})}),d.jsx("button",{onClick:T,className:ge(br.button,br.moveButton),children:d.jsx(ie,{name:"Copy"})}),d.jsx("button",{className:ge(br.button,br.deleteButton),onClick:P=>{P.stopPropagation(),u("Remove Block"),h(`Are you sure you want to delete ${(C==null?void 0:C.data[e.id].name)||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),f(k)},children:d.jsx(ie,{name:"Trash",hoverable:!0,fill:"#C12A2A"})})]})})};function $i(e,t){if(!t||!t[e])return"unknown name";const n=new t[e];return!n.blockSettings||!n.blockSettings.displayName?"unknown name":n.blockSettings.displayName}const ME=_.memo(({scrollableRef:e})=>{const{setActiveBlock:t,activeBlock:n,zoomLevel:o}=Xs(),{blocks:i,sourceBlocks:a}=Lo(),{blocks:s,setCurrentBlock:l,currentBlock:c,setPositionBlock:u,announcement:h}=Hr(),{settings:f}=ya(),{currentPage:g,pages:m,pageContext:C}=zr(),{activeBlock:I,setActiveBlock:b}=No(),{setError:S}=Kf(),{setActiveBlock:y}=Lo(),T=_.useRef(n.id),k=_.useRef({});_.useEffect(()=>{if(n.id&&n.neededScroll&&k.current[n.id]){const E=k.current[n.id];if(E&&e.current){const M=E.offsetTop;e.current.scrollTo({top:M-30,behavior:"smooth"})}}},[n,e]);const A=Vr();_.useEffect(()=>{T.current=n.id},[n.id]);const P=E=>{if(!E||!E.name)return S({message:"Block or block.name is undefined.",failedSettings:!1,failedThemeSettings:!1,failedPageIds:m&&m[g].id?[m[g].id]:[]}),d.jsx(Wc,{error:"Block or block.name is undefined."});if(!i||!i[E.name])return S({message:'Block "${block.name}" does not exist in blocks.',failedSettings:!1,failedThemeSettings:!1,failedPageIds:m&&m[g].id?[m[g].id]:[]}),d.jsx(Wc,{error:`Block "${E.name}" does not exist in blocks.`});const M=new i[E.name];return E.value&&Object.assign(M,E.value),M.renderBlock(f,C)};return d.jsxs("div",{onClick:E=>{E.stopPropagation()},className:Yr.content,style:{width:"100%",height:"100%",zoom:`${o}`},ref:e,children:[h&&d.jsx(C0,{}),d.jsx(I0,{}),d.jsx("div",{className:Yr.main,children:m&&m[g]&&s[m[g].path]&&s[m[g].path].data&&s[m[g].path].order.map(E=>d.jsxs("div",{ref:M=>k.current[E]=M,onClick:M=>{M.stopPropagation(),y(null),I&&b(null),t({id:E,neededScroll:!0}),setTimeout(()=>{t({id:E,neededScroll:!1})},100),l(null),c?setTimeout(()=>{l(n.id)},100):l(n.id)},onMouseEnter:M=>{M.stopPropagation(),n.neededScroll||t({id:E,neededScroll:!1})},onMouseLeave:M=>{M.stopPropagation(),n.neededScroll||t({id:null,neededScroll:!1})},className:ge(Yr.block),children:[(n.id===E||c===E)&&d.jsx("div",{className:Yr.active}),(n.id===E||c===E)&&d.jsx("div",{className:Yr.name,children:$i(s[m[g].path].data[E].name,a)}),(n.id===E||c===E)&&$i(s[m[g].path].data[E].name,a)!=="unknown name"&&d.jsx(OE,{}),(n.id===E||c===E)&&$i(s[m[g].path].data[E].name,a)!=="unknown name"&&d.jsx("div",{className:Yr.addSection,children:d.jsx(ti,{onClick:M=>{M.stopPropagation(),u(E,!0),l(null),t({id:null,neededScroll:!1}),y(null),A("/admin/builder/add")},children:"Add Section"})}),(n.id===E||c===E)&&$i(s[m[g].path].data[E].name,a)!=="unknown name"&&d.jsx("div",{className:ge(Yr.addSection,Yr.addSectionTop),children:d.jsx(ti,{onClick:M=>{M.stopPropagation(),u(E,!1),l(null),t({id:null,neededScroll:!1}),y(null),A("/admin/builder/add")},children:"Add Section"})}),i&&d.jsx(m0,{render:P,block:s[m[g].path].data[E]})]},E))}),d.jsx(g0,{})]})}),BE="_statItem_fzeec_1",FE="_content_fzeec_44",HE="_withChildren_fzeec_50",jE="_info_fzeec_56",UE="_iconWrapper_fzeec_68",VE="_text_fzeec_78",zE="_title_fzeec_84",$E="_value_fzeec_88",WE="_emptyImage_fzeec_94",qE="_image_fzeec_11",GE="_imageTitle_fzeec_112",YE="_emptyImageText_fzeec_122",ZE="_hoverable_fzeec_147",Wt={statItem:BE,content:FE,withChildren:HE,info:jE,iconWrapper:UE,text:VE,title:zE,value:$E,emptyImage:WE,image:qE,imageTitle:GE,emptyImageText:YE,hoverable:ZE},Zn=({iconName:e,title:t,value:n,image:o,imageName:i,children:a,className:s,logo:l,customLogo:c,productSlug:u})=>{const h=Vr();return d.jsxs("div",{className:`${Wt.statItem} ${s}`,children:[o&&o!=="empty"&&d.jsxs("div",{style:{position:"relative"},onClick:()=>{u&&h(`/${u}`)},children:[d.jsx("div",{style:{background:"#000000"},children:d.jsx("img",{src:o,alt:i,className:ge(Wt.image,Wt.emptyImage,{[Wt.hoverable]:u})})}),d.jsx("div",{className:Wt.emptyImageText,children:d.jsx("div",{className:ge(Wt.title,Wt.imageTitle),id:"h5",children:i})})]}),o==="empty"&&d.jsx("div",{style:{background:"#000000"},children:d.jsxs("div",{className:ge(Wt.emptyImage,{[Wt.hoverable]:u}),onClick:()=>{u&&h(`/${u}`)},children:[d.jsx(ie,{name:"Image",width:64,height:64,fill:"var(--text-secondary)"}),d.jsx("div",{className:Wt.emptyImageText,children:d.jsx("div",{className:Wt.title,id:"h5",children:i||"No Product"})})]})}),d.jsxs("div",{className:`${Wt.content} ${a?Wt.withChildren:""}`,children:[d.jsxs("div",{className:Wt.info,children:[c?d.jsx("div",{style:{color:"var(--text-action)"},children:c}):l?d.jsx("div",{className:Wt.iconWrapper,children:d.jsx("img",{src:l,width:28,height:28,style:{objectFit:"contain"}})}):d.jsx(ie,{name:e||"File",className:Wt.iconWrapper,width:28,height:28,fill:"var(--text-action)"}),d.jsxs("div",{className:Wt.text,children:[d.jsx("div",{className:Wt.title,id:"h5",children:t}),d.jsx("div",{className:Wt.value,id:"h5-bold",children:n})]})]}),a]})]})},XE="_card_8m277_2",KE="_mobile_8m277_15",QE="_email_8m277_19",JE="_balance_8m277_25",eT="_sidebar_8m277_32",tT="_sidebarAntistock_8m277_33",nT="_navList_8m277_68",rT="_navListAntistock_8m277_86",oT="_navItem_8m277_91",iT="_antistockNavItem_8m277_92",aT="_activeNavItem_8m277_116",sT="_antistockActiveNavItem_8m277_121",lT="_antistockInactiveNavItem_8m277_139",cT="_inactiveNavItem_8m277_140",uT="_logoutNavItem_8m277_150",dT="_logoutNavItemAntistock_8m277_159",hT="_logoutNavItemContentAntistock_8m277_173",fT="_iconWrapper_8m277_185",pT="_skeleton_8m277_190",yt={card:XE,mobile:KE,email:QE,balance:JE,sidebar:eT,sidebarAntistock:tT,navList:nT,navListAntistock:rT,navItem:oT,antistockNavItem:iT,activeNavItem:aT,antistockActiveNavItem:sT,antistockInactiveNavItem:lT,inactiveNavItem:cT,logoutNavItem:uT,logoutNavItemAntistock:dT,logoutNavItemContentAntistock:hT,iconWrapper:fT,skeleton:pT},mT=({email:e,balance:t,adaptiveStyles:n})=>d.jsxs("div",{className:ge(yt.card,{[yt.mobile]:n!=="desktop"}),children:[d.jsx("div",{className:yt.email,id:"h5",children:e}),d.jsxs("div",{className:yt.balance,id:"md",children:["Balance: ",t]})]}),gT=[[Ut.Home,"House"],[Ut.Orders,"CurrencyCircleDollar"],[Ut.Rewards,"Medal"],[Ut.Balance,"Wallet"],[Ut.Subscriptions,"CalendarCheck"],[Ut.Tickets,"Question"]],IT=[[ji.Home,"House"],[ji.Orders,"CurrencyCircleDollar"],[ji.Balance,"Wallet"],[ji.Tickets,"Question"]],$1=({children:e,className:t="",onClick:n})=>{const{isAntistock:o}=mt();return d.jsx("button",{type:"button",className:ge(o?yt.antistockNavItem:yt.navItem,t),onClick:n,children:e})},CT=({adaptiveStyles:e})=>{const{route:t,setRoute:n}=rr(),{isAntistock:o}=mt(),i=o?IT:gT;return d.jsxs("div",{className:ge(yt.navList,{[yt.mobile]:e!=="desktop",[yt.navListAntistock]:o}),children:[i.map(([a,s])=>{const l=a===t;return d.jsxs($1,{onClick:()=>n(a),className:ge(l?o?yt.antistockActiveNavItem:yt.activeNavItem:o?yt.antistockInactiveNavItem:yt.inactiveNavItem),children:[o?null:d.jsx("div",{className:yt.iconWrapper,children:d.jsx(ie,{name:s})}),d.jsx("div",{children:a})]},a)}),d.jsx($1,{className:ge(yt.logoutNavItem,{[yt.logoutNavItemAntistock]:o}),onClick:()=>{o||Gc()},children:o?d.jsxs("div",{className:ge({[yt.logoutNavItemContentAntistock]:o}),onClick:()=>{Gc()},children:[d.jsx("div",{className:yt.iconWrapper,children:d.jsx(ie,{name:"SignOut"})}),d.jsx("div",{children:"Sign Out"})]}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:yt.iconWrapper,children:d.jsx(ie,{name:"SignOut"})}),d.jsx("div",{children:"Sign Out"})]})})]})};var Ge=(e=>(e.New="NEW",e.Pending="PENDING",e.Completed="COMPLETED",e.Cancelled="CANCELLED",e.Expired="EXPIRED",e.FullDeliveryFailure="FULL_DELIVERY_FAILURE",e.PartiallyDelivered="PARTIALLY_DELIVERED",e.Refunded="REFUNDED",e.Failed="FAILED",e))(Ge||{}),at=(e=>(e.Text="TEXT",e.Serial="SERIALS",e.Ebook="EBOOK",e.Link="LINK",e.Download="DOWNLOAD",e.Discord="DISCORD",e.Custom="CUSTOM",e))(at||{}),Or=(e=>(e.RIAL="RIAL",e.AWAITING_PAYMENT="AWAITING_PAYMENT",e.ACTIVE="ACTIVE",e.PAST_DUE="PAST_DUE",e.CANCELLED="CANCELLED",e.EXPIRED="EXPIRED",e.CHANGED_GATEWAY="CHANGED_GATEWAY",e.REPLACED="REPLACED",e))(Or||{});const ka=async e=>(await b0(e)).data,v0=async()=>{var n;const t=(await ky()).data;if(t.isEnabled){const o=(n=t==null?void 0:t.topUpSettings)==null?void 0:n.gateways;o&&ka(o)}return t},qu=async()=>{const t=(await Ay()).data;return{amount:t.realBalance+t.manualBalance,currency:t.currency}};var Wi=(e=>(e.ADDED="ADDED",e.REMOVED="REMOVED",e))(Wi||{}),it=(e=>(e.NotPaid="NOT_PAID",e.Pending="PENDING",e.Paid="PAID",e.Expired="EXPIRED",e.Cancelled="CANCELLED",e))(it||{}),fa=(e=>(e.Balance="BALANCE",e.Product="PRODUCT",e))(fa||{}),$n=(e=>(e.Spend="SPEND_AMOUNT",e.Order="ORDER_COUNT",e.Referral="REFER_FRIEND",e.Review="LEAVE_REVIEW",e))($n||{});const bT=async()=>(await vy()).data;/*! *****************************************************************************
|
|
73
|
+
`},iS={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function aS(e){let{announcements:t=iS,container:n,hiddenTextDescribedById:o,screenReaderInstructions:i=oS}=e;const{announce:a,announcement:s}=tS(),l=Aa("DndLiveRegion"),[c,u]=_.useState(!1);if(_.useEffect(()=>{u(!0)},[]),nS(_.useMemo(()=>({onDragStart(f){let{active:g}=f;a(t.onDragStart({active:g}))},onDragMove(f){let{active:g,over:m}=f;t.onDragMove&&a(t.onDragMove({active:g,over:m}))},onDragOver(f){let{active:g,over:m}=f;a(t.onDragOver({active:g,over:m}))},onDragEnd(f){let{active:g,over:m}=f;a(t.onDragEnd({active:g,over:m}))},onDragCancel(f){let{active:g,over:m}=f;a(t.onDragCancel({active:g,over:m}))}}),[a,t])),!c)return null;const h=_.createElement(_.Fragment,null,_.createElement(Jb,{id:o,value:i.draggable}),_.createElement(eS,{id:l,announcement:s}));return n?To.createPortal(h,n):h}var qt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(qt||(qt={}));function Ms(){}function zp(e,t){return _.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function $p(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return _.useMemo(()=>[...t].filter(o=>o!=null),[...t])}const dr=Object.freeze({x:0,y:0});function sS(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function lS(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function cS(e,t){const n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),s=i-o,l=a-n;if(o<i&&n<a){const c=t.width*t.height,u=e.width*e.height,h=s*l,f=h/(c+u-h);return Number(f.toFixed(4))}return 0}const uS=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const i=[];for(const a of o){const{id:s}=a,l=n.get(s);if(l){const c=cS(l,t);c>0&&i.push({id:s,data:{droppableContainer:a,value:c}})}}return i.sort(sS)};function dS(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Wp(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:dr}function hS(e){return function(n){for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return i.reduce((s,l)=>({...s,top:s.top+e*l.y,bottom:s.bottom+e*l.y,left:s.left+e*l.x,right:s.right+e*l.x}),{...n})}}const fS=hS(1);function pS(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function mS(e,t,n){const o=pS(t);if(!o)return e;const{scaleX:i,scaleY:a,x:s,y:l}=o,c=e.left-s-(1-i)*parseFloat(n),u=e.top-l-(1-a)*parseFloat(n.slice(n.indexOf(" ")+1)),h=i?e.width/i:e.width,f=a?e.height/a:e.height;return{width:h,height:f,top:u,right:c+h,bottom:u+f,left:c}}const gS={ignoreTransform:!1};function hi(e,t){t===void 0&&(t=gS);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:h}=On(e).getComputedStyle(e);u&&(n=mS(n,u,h))}const{top:o,left:i,width:a,height:s,bottom:l,right:c}=n;return{top:o,left:i,width:a,height:s,bottom:l,right:c}}function v1(e){return hi(e,{ignoreTransform:!0})}function IS(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function CS(e,t){return t===void 0&&(t=On(e).getComputedStyle(e)),t.position==="fixed"}function bS(e,t){t===void 0&&(t=On(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const a=t[i];return typeof a=="string"?n.test(a):!1})}function Vu(e,t){const n=[];function o(i){if(t!=null&&n.length>=t||!i)return n;if(Hu(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!wa(i)||jp(i)||n.includes(i))return n;const a=On(e).getComputedStyle(i);return i!==e&&bS(i,a)&&n.push(i),CS(i,a)?n:o(i.parentNode)}return e?o(e):n}function qp(e){const[t]=Vu(e,1);return t??null}function Vl(e){return!rl||!e?null:ui(e)?e:Fu(e)?Hu(e)||e===di(e).scrollingElement?window:wa(e)?e:null:null}function Gp(e){return ui(e)?e.scrollX:e.scrollLeft}function Yp(e){return ui(e)?e.scrollY:e.scrollTop}function Vc(e){return{x:Gp(e),y:Yp(e)}}var nn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(nn||(nn={}));function Zp(e){return!rl||!e?!1:e===document.scrollingElement}function Xp(e){const t={x:0,y:0},n=Zp(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,s=e.scrollTop>=o.y,l=e.scrollLeft>=o.x;return{isTop:i,isLeft:a,isBottom:s,isRight:l,maxScroll:o,minScroll:t}}const SS={x:.2,y:.2};function yS(e,t,n,o,i){let{top:a,left:s,right:l,bottom:c}=n;o===void 0&&(o=10),i===void 0&&(i=SS);const{isTop:u,isBottom:h,isLeft:f,isRight:g}=Xp(e),m={x:0,y:0},C={x:0,y:0},I={height:t.height*i.y,width:t.width*i.x};return!u&&a<=t.top+I.height?(m.y=nn.Backward,C.y=o*Math.abs((t.top+I.height-a)/I.height)):!h&&c>=t.bottom-I.height&&(m.y=nn.Forward,C.y=o*Math.abs((t.bottom-I.height-c)/I.height)),!g&&l>=t.right-I.width?(m.x=nn.Forward,C.x=o*Math.abs((t.right-I.width-l)/I.width)):!f&&s<=t.left+I.width&&(m.x=nn.Backward,C.x=o*Math.abs((t.left+I.width-s)/I.width)),{direction:m,speed:C}}function ES(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:s}=window;return{top:0,left:0,right:a,bottom:s,width:a,height:s}}const{top:t,left:n,right:o,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Kp(e){return e.reduce((t,n)=>Ko(t,Vc(n)),dr)}function TS(e){return e.reduce((t,n)=>t+Gp(n),0)}function xS(e){return e.reduce((t,n)=>t+Yp(n),0)}function _S(e,t){if(t===void 0&&(t=hi),!e)return;const{top:n,left:o,bottom:i,right:a}=t(e);qp(e)&&(i<=0||a<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const wS=[["x",["left","right"],TS],["y",["top","bottom"],xS]];class zu{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=Vu(n),i=Kp(o);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,s,l]of wS)for(const c of s)Object.defineProperty(this,c,{get:()=>{const u=l(o),h=i[a]-u;return this.rect[c]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Yi{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...n)})},this.target=t}add(t,n,o){var i;(i=this.target)==null||i.addEventListener(t,n,o),this.listeners.push([t,n,o])}}function vS(e){const{EventTarget:t}=On(e);return e instanceof t?e:di(e)}function zl(e,t){const n=Math.abs(e.x),o=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t?o>t.y:!1}var Kn;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Kn||(Kn={}));function A1(e){e.preventDefault()}function AS(e){e.stopPropagation()}var Qe;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Qe||(Qe={}));const Qp={start:[Qe.Space,Qe.Enter],cancel:[Qe.Esc],end:[Qe.Space,Qe.Enter,Qe.Tab]},kS=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Qe.Right:return{...n,x:n.x+25};case Qe.Left:return{...n,x:n.x-25};case Qe.Down:return{...n,y:n.y+25};case Qe.Up:return{...n,y:n.y-25}}};class Jp{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Yi(di(n)),this.windowListeners=new Yi(On(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Kn.Resize,this.handleCancel),this.windowListeners.add(Kn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Kn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,o=t.node.current;o&&_S(o),n(dr)}handleKeyDown(t){if(Uu(t)){const{active:n,context:o,options:i}=this.props,{keyboardCodes:a=Qp,coordinateGetter:s=kS,scrollBehavior:l="smooth"}=i,{code:c}=t;if(a.end.includes(c)){this.handleEnd(t);return}if(a.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:u}=o.current,h=u?{x:u.left,y:u.top}:dr;this.referenceCoordinates||(this.referenceCoordinates=h);const f=s(t,{active:n,context:o.current,currentCoordinates:h});if(f){const g=Os(f,h),m={x:0,y:0},{scrollableAncestors:C}=o.current;for(const I of C){const b=t.code,{isTop:S,isRight:y,isLeft:T,isBottom:k,maxScroll:A,minScroll:P}=Xp(I),E=ES(I),M={x:Math.min(b===Qe.Right?E.right-E.width/2:E.right,Math.max(b===Qe.Right?E.left:E.left+E.width/2,f.x)),y:Math.min(b===Qe.Down?E.bottom-E.height/2:E.bottom,Math.max(b===Qe.Down?E.top:E.top+E.height/2,f.y))},B=b===Qe.Right&&!y||b===Qe.Left&&!T,w=b===Qe.Down&&!k||b===Qe.Up&&!S;if(B&&M.x!==f.x){const V=I.scrollLeft+g.x,H=b===Qe.Right&&V<=A.x||b===Qe.Left&&V>=P.x;if(H&&!g.y){I.scrollTo({left:V,behavior:l});return}H?m.x=I.scrollLeft-V:m.x=b===Qe.Right?I.scrollLeft-A.x:I.scrollLeft-P.x,m.x&&I.scrollBy({left:-m.x,behavior:l});break}else if(w&&M.y!==f.y){const V=I.scrollTop+g.y,H=b===Qe.Down&&V<=A.y||b===Qe.Up&&V>=P.y;if(H&&!g.x){I.scrollTo({top:V,behavior:l});return}H?m.y=I.scrollTop-V:m.y=b===Qe.Down?I.scrollTop-A.y:I.scrollTop-P.y,m.y&&I.scrollBy({top:-m.y,behavior:l});break}}this.handleMove(t,Ko(Os(f,this.referenceCoordinates),m))}}}handleMove(t,n){const{onMove:o}=this.props;t.preventDefault(),o(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Jp.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=Qp,onActivation:i}=t,{active:a}=n;const{code:s}=e.nativeEvent;if(o.start.includes(s)){const l=a.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function k1(e){return!!(e&&"distance"in e)}function L1(e){return!!(e&&"delay"in e)}class $u{constructor(t,n,o){var i;o===void 0&&(o=vS(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:a}=t,{target:s}=a;this.props=t,this.events=n,this.document=di(s),this.documentListeners=new Yi(this.document),this.listeners=new Yi(o),this.windowListeners=new Yi(On(s)),this.initialCoordinates=(i=Uc(a))!=null?i:dr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:o}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Kn.Resize,this.handleCancel),this.windowListeners.add(Kn.DragStart,A1),this.windowListeners.add(Kn.VisibilityChange,this.handleCancel),this.windowListeners.add(Kn.ContextMenu,A1),this.documentListeners.add(Kn.Keydown,this.handleKeydown),n){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(L1(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(k1(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:o,onPending:i}=this.props;i(o,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Kn.Click,AS,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Kn.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:o,initialCoordinates:i,props:a}=this,{onMove:s,options:{activationConstraint:l}}=a;if(!i)return;const c=(n=Uc(t))!=null?n:dr,u=Os(i,c);if(!o&&l){if(k1(l)){if(l.tolerance!=null&&zl(u,l.tolerance))return this.handleCancel();if(zl(u,l.distance))return this.handleStart()}if(L1(l)&&zl(u,l.tolerance))return this.handleCancel();this.handlePending(l,u);return}t.cancelable&&t.preventDefault(),s(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Qe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const LS={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ol extends $u{constructor(t){const{event:n}=t,o=di(n.target);super(t,LS,o)}}ol.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!n.isPrimary||n.button!==0?!1:(o==null||o({event:n}),!0)}}];const NS={move:{name:"mousemove"},end:{name:"mouseup"}};var zc;(function(e){e[e.RightClick=2]="RightClick"})(zc||(zc={}));class PS extends $u{constructor(t){super(t,NS,di(t.event.target))}}PS.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button===zc.RightClick?!1:(o==null||o({event:n}),!0)}}];const $l={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class RS extends $u{constructor(t){super(t,$l)}static setup(){return window.addEventListener($l.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener($l.move.name,t)};function t(){}}}RS.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;const{touches:i}=n;return i.length>1?!1:(o==null||o({event:n}),!0)}}];var Zi;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Zi||(Zi={}));var Bs;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Bs||(Bs={}));function DS(e){let{acceleration:t,activator:n=Zi.Pointer,canScroll:o,draggingRect:i,enabled:a,interval:s=5,order:l=Bs.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:h,delta:f,threshold:g}=e;const m=MS({delta:f,disabled:!a}),[C,I]=Yb(),b=_.useRef({x:0,y:0}),S=_.useRef({x:0,y:0}),y=_.useMemo(()=>{switch(n){case Zi.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Zi.DraggableRect:return i}},[n,i,c]),T=_.useRef(null),k=_.useCallback(()=>{const P=T.current;if(!P)return;const E=b.current.x*S.current.x,M=b.current.y*S.current.y;P.scrollBy(E,M)},[]),A=_.useMemo(()=>l===Bs.TreeOrder?[...u].reverse():u,[l,u]);_.useEffect(()=>{if(!a||!u.length||!y){I();return}for(const P of A){if((o==null?void 0:o(P))===!1)continue;const E=u.indexOf(P),M=h[E];if(!M)continue;const{direction:B,speed:w}=yS(P,M,y,t,g);for(const V of["x","y"])m[V][B[V]]||(w[V]=0,B[V]=0);if(w.x>0||w.y>0){I(),T.current=P,C(k,s),b.current=w,S.current=B;return}}b.current={x:0,y:0},S.current={x:0,y:0},I()},[t,k,o,I,a,s,JSON.stringify(y),JSON.stringify(m),C,u,A,h,JSON.stringify(g)])}const OS={x:{[nn.Backward]:!1,[nn.Forward]:!1},y:{[nn.Backward]:!1,[nn.Forward]:!1}};function MS(e){let{delta:t,disabled:n}=e;const o=jc(t);return va(i=>{if(n||!o||!i)return OS;const a={x:Math.sign(t.x-o.x),y:Math.sign(t.y-o.y)};return{x:{[nn.Backward]:i.x[nn.Backward]||a.x===-1,[nn.Forward]:i.x[nn.Forward]||a.x===1},y:{[nn.Backward]:i.y[nn.Backward]||a.y===-1,[nn.Forward]:i.y[nn.Forward]||a.y===1}}},[n,t,o])}function BS(e,t){const n=t!=null?e.get(t):void 0,o=n?n.node.current:null;return va(i=>{var a;return t==null?null:(a=o??i)!=null?a:null},[o,t])}function FS(e,t){return _.useMemo(()=>e.reduce((n,o)=>{const{sensor:i}=o,a=i.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,o)}));return[...n,...a]},[]),[e,t])}var ha;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ha||(ha={}));var $c;(function(e){e.Optimized="optimized"})($c||($c={}));const N1=new Map;function HS(e,t){let{dragging:n,dependencies:o,config:i}=t;const[a,s]=_.useState(null),{frequency:l,measure:c,strategy:u}=i,h=_.useRef(e),f=b(),g=da(f),m=_.useCallback(function(S){S===void 0&&(S=[]),!g.current&&s(y=>y===null?S:y.concat(S.filter(T=>!y.includes(T))))},[g]),C=_.useRef(null),I=va(S=>{if(f&&!n)return N1;if(!S||S===N1||h.current!==e||a!=null){const y=new Map;for(let T of e){if(!T)continue;if(a&&a.length>0&&!a.includes(T.id)&&T.rect.current){y.set(T.id,T.rect.current);continue}const k=T.node.current,A=k?new zu(c(k),k):null;T.rect.current=A,A&&y.set(T.id,A)}return y}return S},[e,a,n,f,c]);return _.useEffect(()=>{h.current=e},[e]),_.useEffect(()=>{f||m()},[n,f]),_.useEffect(()=>{a&&a.length>0&&s(null)},[JSON.stringify(a)]),_.useEffect(()=>{f||typeof l!="number"||C.current!==null||(C.current=setTimeout(()=>{m(),C.current=null},l))},[l,f,m,...o]),{droppableRects:I,measureDroppableContainers:m,measuringScheduled:a!=null};function b(){switch(u){case ha.Always:return!1;case ha.BeforeDragging:return n;default:return!n}}}function e0(e,t){return va(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function jS(e,t){return e0(e,t)}function US(e){let{callback:t,disabled:n}=e;const o=ju(t),i=_.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(o)},[o,n]);return _.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function il(e){let{callback:t,disabled:n}=e;const o=ju(t),i=_.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(o)},[n]);return _.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function VS(e){return new zu(hi(e),e)}function P1(e,t,n){t===void 0&&(t=VS);const[o,i]=_.useState(null);function a(){i(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c??n)!=null?u:null}const h=t(e);return JSON.stringify(c)===JSON.stringify(h)?c:h})}const s=US({callback(c){if(e)for(const u of c){const{type:h,target:f}=u;if(h==="childList"&&f instanceof HTMLElement&&f.contains(e)){a();break}}}}),l=il({callback:a});return wr(()=>{a(),e?(l==null||l.observe(e),s==null||s.observe(document.body,{childList:!0,subtree:!0})):(l==null||l.disconnect(),s==null||s.disconnect())},[e]),o}function zS(e){const t=e0(e);return Wp(e,t)}const R1=[];function $S(e){const t=_.useRef(e),n=va(o=>e?o&&o!==R1&&e&&t.current&&e.parentNode===t.current.parentNode?o:Vu(e):R1,[e]);return _.useEffect(()=>{t.current=e},[e]),n}function WS(e){const[t,n]=_.useState(null),o=_.useRef(e),i=_.useCallback(a=>{const s=Vl(a.target);s&&n(l=>l?(l.set(s,Vc(s)),new Map(l)):null)},[]);return _.useEffect(()=>{const a=o.current;if(e!==a){s(a);const l=e.map(c=>{const u=Vl(c);return u?(u.addEventListener("scroll",i,{passive:!0}),[u,Vc(u)]):null}).filter(c=>c!=null);n(l.length?new Map(l):null),o.current=e}return()=>{s(e),s(a)};function s(l){l.forEach(c=>{const u=Vl(c);u==null||u.removeEventListener("scroll",i)})}},[i,e]),_.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,s)=>Ko(a,s),dr):Kp(e):dr,[e,t])}function D1(e,t){t===void 0&&(t=[]);const n=_.useRef(null);return _.useEffect(()=>{n.current=null},t),_.useEffect(()=>{const o=e!==dr;o&&!n.current&&(n.current=e),!o&&n.current&&(n.current=null)},[e]),n.current?Os(e,n.current):dr}function qS(e){_.useEffect(()=>{if(!rl)return;const t=e.map(n=>{let{sensor:o}=n;return o.setup==null?void 0:o.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function GS(e,t){return _.useMemo(()=>e.reduce((n,o)=>{let{eventName:i,handler:a}=o;return n[i]=s=>{a(s,t)},n},{}),[e,t])}function t0(e){return _.useMemo(()=>e?IS(e):null,[e])}const O1=[];function YS(e,t){t===void 0&&(t=hi);const[n]=e,o=t0(n?On(n):null),[i,a]=_.useState(O1);function s(){a(()=>e.length?e.map(c=>Zp(c)?o:new zu(t(c),c)):O1)}const l=il({callback:s});return wr(()=>{l==null||l.disconnect(),s(),e.forEach(c=>l==null?void 0:l.observe(c))},[e]),i}function ZS(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return wa(t)?t:e}function XS(e){let{measure:t}=e;const[n,o]=_.useState(null),i=_.useCallback(u=>{for(const{target:h}of u)if(wa(h)){o(f=>{const g=t(h);return f?{...f,width:g.width,height:g.height}:g});break}},[t]),a=il({callback:i}),s=_.useCallback(u=>{const h=ZS(u);a==null||a.disconnect(),h&&(a==null||a.observe(h)),o(h?t(h):null)},[t,a]),[l,c]=Ds(s);return _.useMemo(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const KS=[{sensor:ol,options:{}},{sensor:Jp,options:{}}],QS={current:{}},Cs={draggable:{measure:v1},droppable:{measure:v1,strategy:ha.WhileDragging,frequency:$c.Optimized},dragOverlay:{measure:hi}};class Xi extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,o;return(n=(o=this.get(t))==null?void 0:o.node.current)!=null?n:void 0}}const JS={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Xi,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ms},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Cs,measureDroppableContainers:Ms,windowRect:null,measuringScheduled:!1},e7={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ms,draggableNodes:new Map,over:null,measureDroppableContainers:Ms},al=_.createContext(e7),n0=_.createContext(JS);function t7(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Xi}}}function n7(e,t){switch(t.type){case qt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case qt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case qt.DragEnd:case qt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case qt.RegisterDroppable:{const{element:n}=t,{id:o}=n,i=new Xi(e.droppable.containers);return i.set(o,n),{...e,droppable:{...e.droppable,containers:i}}}case qt.SetDroppableDisabled:{const{id:n,key:o,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||o!==a.key)return e;const s=new Xi(e.droppable.containers);return s.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:s}}}case qt.UnregisterDroppable:{const{id:n,key:o}=t,i=e.droppable.containers.get(n);if(!i||o!==i.key)return e;const a=new Xi(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function r7(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:i}=_.useContext(al),a=jc(o),s=jc(n==null?void 0:n.id);return _.useEffect(()=>{if(!t&&!o&&a&&s!=null){if(!Uu(a)||document.activeElement===a.target)return;const l=i.get(s);if(!l)return;const{activatorNode:c,node:u}=l;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const h of[c.current,u.current]){if(!h)continue;const f=Kb(h);if(f){f.focus();break}}})}},[o,t,i,s,a]),null}function o7(e,t){let{transform:n,...o}=t;return e!=null&&e.length?e.reduce((i,a)=>a({transform:i,...o}),n):n}function i7(e){return _.useMemo(()=>({draggable:{...Cs.draggable,...e==null?void 0:e.draggable},droppable:{...Cs.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Cs.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function a7(e){let{activeNode:t,measure:n,initialRect:o,config:i=!0}=e;const a=_.useRef(!1),{x:s,y:l}=typeof i=="boolean"?{x:i,y:i}:i;wr(()=>{if(!s&&!l||!t){a.current=!1;return}if(a.current||!o)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const h=n(u),f=Wp(h,o);if(s||(f.x=0),l||(f.y=0),a.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const g=qp(u);g&&g.scrollBy({top:f.y,left:f.x})}},[t,s,l,o,n])}const r0=_.createContext({...dr,scaleX:1,scaleY:1});var eo;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(eo||(eo={}));const o0=_.memo(function(t){var n,o,i,a;let{id:s,accessibility:l,autoScroll:c=!0,children:u,sensors:h=KS,collisionDetection:f=uS,measuring:g,modifiers:m,...C}=t;const I=_.useReducer(n7,void 0,t7),[b,S]=I,[y,T]=rS(),[k,A]=_.useState(eo.Uninitialized),P=k===eo.Initialized,{draggable:{active:E,nodes:M,translate:B},droppable:{containers:w}}=b,V=E!=null?M.get(E):null,H=_.useRef({initial:null,translated:null}),X=_.useMemo(()=>{var Ct;return E!=null?{id:E,data:(Ct=V==null?void 0:V.data)!=null?Ct:QS,rect:H}:null},[E,V]),W=_.useRef(null),[se,Ce]=_.useState(null),[be,ve]=_.useState(null),Le=da(C,Object.values(C)),x=Aa("DndDescribedBy",s),ne=_.useMemo(()=>w.getEnabled(),[w]),pe=i7(g),{droppableRects:L,measureDroppableContainers:Z,measuringScheduled:le}=HS(ne,{dragging:P,dependencies:[B.x,B.y],config:pe.droppable}),ee=BS(M,E),Ie=_.useMemo(()=>be?Uc(be):null,[be]),Se=Nr(),ae=jS(ee,pe.draggable.measure);a7({activeNode:E!=null?M.get(E):null,config:Se.layoutShiftCompensation,initialRect:ae,measure:pe.draggable.measure});const ce=P1(ee,pe.draggable.measure,ae),Ue=P1(ee?ee.parentElement:null),Q=_.useRef({activatorEvent:null,active:null,activeNode:ee,collisionRect:null,collisions:null,droppableRects:L,draggableNodes:M,draggingNode:null,draggingNodeRect:null,droppableContainers:w,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ve=w.getNodeFor((n=Q.current.over)==null?void 0:n.id),Te=XS({measure:pe.dragOverlay.measure}),we=(o=Te.nodeRef.current)!=null?o:ee,ze=P?(i=Te.rect)!=null?i:ce:null,Tt=!!(Te.nodeRef.current&&Te.rect),wt=zS(Tt?null:ce),$e=t0(we?On(we):null),nt=$S(P?Ve??ee:null),Tn=YS(nt),gt=o7(m,{transform:{x:B.x-wt.x,y:B.y-wt.y,scaleX:1,scaleY:1},activatorEvent:be,active:X,activeNodeRect:ce,containerNodeRect:Ue,draggingNodeRect:ze,over:Q.current.over,overlayNodeRect:Te.rect,scrollableAncestors:nt,scrollableAncestorRects:Tn,windowRect:$e}),dn=Ie?Ko(Ie,B):null,It=WS(nt),Lt=D1(It),q=D1(It,[ce]),oe=Ko(gt,Lt),_e=ze?fS(ze,gt):null,Ae=X&&_e?f({active:X,collisionRect:_e,droppableRects:L,droppableContainers:ne,pointerCoordinates:dn}):null,We=lS(Ae,"id"),[rt,hn]=_.useState(null),Je=Tt?gt:Ko(gt,q),fn=dS(Je,(a=rt==null?void 0:rt.rect)!=null?a:null,ce),pn=_.useRef(null),Nt=_.useCallback((Ct,Yt)=>{let{sensor:Zt,options:Bn}=Yt;if(W.current==null)return;const on=M.get(W.current);if(!on)return;const Pt=Ct.nativeEvent,Xt=new Zt({active:W.current,activeNode:on,event:Pt,options:Bn,context:Q,onAbort(Rt){if(!M.get(Rt))return;const{onDragAbort:F}=Le.current,$={id:Rt};F==null||F($),y({type:"onDragAbort",event:$})},onPending(Rt,O,F,$){if(!M.get(Rt))return;const{onDragPending:me}=Le.current,xe={id:Rt,constraint:O,initialCoordinates:F,offset:$};me==null||me(xe),y({type:"onDragPending",event:xe})},onStart(Rt){const O=W.current;if(O==null)return;const F=M.get(O);if(!F)return;const{onDragStart:$}=Le.current,te={activatorEvent:Pt,active:{id:O,data:F.data,rect:H}};To.unstable_batchedUpdates(()=>{$==null||$(te),A(eo.Initializing),S({type:qt.DragStart,initialCoordinates:Rt,active:O}),y({type:"onDragStart",event:te}),Ce(pn.current),ve(Pt)})},onMove(Rt){S({type:qt.DragMove,coordinates:Rt})},onEnd:gr(qt.DragEnd),onCancel:gr(qt.DragCancel)});pn.current=Xt;function gr(Rt){return async function(){const{active:F,collisions:$,over:te,scrollAdjustedTranslate:me}=Q.current;let xe=null;if(F&&me){const{cancelDrop:N}=Le.current;xe={activatorEvent:Pt,active:F,collisions:$,delta:me,over:te},Rt===qt.DragEnd&&typeof N=="function"&&await Promise.resolve(N(xe))&&(Rt=qt.DragCancel)}W.current=null,To.unstable_batchedUpdates(()=>{S({type:Rt}),A(eo.Uninitialized),hn(null),Ce(null),ve(null),pn.current=null;const N=Rt===qt.DragEnd?"onDragEnd":"onDragCancel";if(xe){const U=Le.current[N];U==null||U(xe),y({type:N,event:xe})}})}}},[M]),Gn=_.useCallback((Ct,Yt)=>(Zt,Bn)=>{const on=Zt.nativeEvent,Pt=M.get(Bn);if(W.current!==null||!Pt||on.dndKit||on.defaultPrevented)return;const Xt={active:Pt};Ct(Zt,Yt.options,Xt)===!0&&(on.dndKit={capturedBy:Yt.sensor},W.current=Bn,Nt(Zt,Yt))},[M,Nt]),zt=FS(h,Gn);qS(h),wr(()=>{ce&&k===eo.Initializing&&A(eo.Initialized)},[ce,k]),_.useEffect(()=>{const{onDragMove:Ct}=Le.current,{active:Yt,activatorEvent:Zt,collisions:Bn,over:on}=Q.current;if(!Yt||!Zt)return;const Pt={active:Yt,activatorEvent:Zt,collisions:Bn,delta:{x:oe.x,y:oe.y},over:on};To.unstable_batchedUpdates(()=>{Ct==null||Ct(Pt),y({type:"onDragMove",event:Pt})})},[oe.x,oe.y]),_.useEffect(()=>{const{active:Ct,activatorEvent:Yt,collisions:Zt,droppableContainers:Bn,scrollAdjustedTranslate:on}=Q.current;if(!Ct||W.current==null||!Yt||!on)return;const{onDragOver:Pt}=Le.current,Xt=Bn.get(We),gr=Xt&&Xt.rect.current?{id:Xt.id,rect:Xt.rect.current,data:Xt.data,disabled:Xt.disabled}:null,Rt={active:Ct,activatorEvent:Yt,collisions:Zt,delta:{x:on.x,y:on.y},over:gr};To.unstable_batchedUpdates(()=>{hn(gr),Pt==null||Pt(Rt),y({type:"onDragOver",event:Rt})})},[We]),wr(()=>{Q.current={activatorEvent:be,active:X,activeNode:ee,collisionRect:_e,collisions:Ae,droppableRects:L,draggableNodes:M,draggingNode:we,draggingNodeRect:ze,droppableContainers:w,over:rt,scrollableAncestors:nt,scrollAdjustedTranslate:oe},H.current={initial:ze,translated:_e}},[X,ee,Ae,_e,M,we,ze,L,w,rt,nt,oe]),DS({...Se,delta:B,draggingRect:_e,pointerCoordinates:dn,scrollableAncestors:nt,scrollableAncestorRects:Tn});const Lr=_.useMemo(()=>({active:X,activeNode:ee,activeNodeRect:ce,activatorEvent:be,collisions:Ae,containerNodeRect:Ue,dragOverlay:Te,draggableNodes:M,droppableContainers:w,droppableRects:L,over:rt,measureDroppableContainers:Z,scrollableAncestors:nt,scrollableAncestorRects:Tn,measuringConfiguration:pe,measuringScheduled:le,windowRect:$e}),[X,ee,ce,be,Ae,Ue,Te,M,w,L,rt,Z,nt,Tn,pe,le,$e]),ir=_.useMemo(()=>({activatorEvent:be,activators:zt,active:X,activeNodeRect:ce,ariaDescribedById:{draggable:x},dispatch:S,draggableNodes:M,over:rt,measureDroppableContainers:Z}),[be,zt,X,ce,S,x,M,rt,Z]);return _.createElement(Vp.Provider,{value:T},_.createElement(al.Provider,{value:ir},_.createElement(n0.Provider,{value:Lr},_.createElement(r0.Provider,{value:fn},u)),_.createElement(r7,{disabled:(l==null?void 0:l.restoreFocus)===!1})),_.createElement(aS,{...l,hiddenTextDescribedById:x}));function Nr(){const Ct=(se==null?void 0:se.autoScrollEnabled)===!1,Yt=typeof c=="object"?c.enabled===!1:c===!1,Zt=P&&!Ct&&!Yt;return typeof c=="object"?{...c,enabled:Zt}:{enabled:Zt}}}),s7=_.createContext(null),M1="button",l7="Draggable";function c7(e){let{id:t,data:n,disabled:o=!1,attributes:i}=e;const a=Aa(l7),{activators:s,activatorEvent:l,active:c,activeNodeRect:u,ariaDescribedById:h,draggableNodes:f,over:g}=_.useContext(al),{role:m=M1,roleDescription:C="draggable",tabIndex:I=0}=i??{},b=(c==null?void 0:c.id)===t,S=_.useContext(b?r0:s7),[y,T]=Ds(),[k,A]=Ds(),P=GS(s,t),E=da(n);wr(()=>(f.set(t,{id:t,key:a,node:y,activatorNode:k,data:E}),()=>{const B=f.get(t);B&&B.key===a&&f.delete(t)}),[f,t]);const M=_.useMemo(()=>({role:m,tabIndex:I,"aria-disabled":o,"aria-pressed":b&&m===M1?!0:void 0,"aria-roledescription":C,"aria-describedby":h.draggable}),[o,m,I,b,C,h.draggable]);return{active:c,activatorEvent:l,activeNodeRect:u,attributes:M,isDragging:b,listeners:o?void 0:P,node:y,over:g,setNodeRef:T,setActivatorNodeRef:A,transform:S}}function u7(){return _.useContext(n0)}const d7="Droppable",h7={timeout:25};function f7(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:i}=e;const a=Aa(d7),{active:s,dispatch:l,over:c,measureDroppableContainers:u}=_.useContext(al),h=_.useRef({disabled:n}),f=_.useRef(!1),g=_.useRef(null),m=_.useRef(null),{disabled:C,updateMeasurementsFor:I,timeout:b}={...h7,...i},S=da(I??o),y=_.useCallback(()=>{if(!f.current){f.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{u(Array.isArray(S.current)?S.current:[S.current]),m.current=null},b)},[b]),T=il({callback:y,disabled:C||!s}),k=_.useCallback((M,B)=>{T&&(B&&(T.unobserve(B),f.current=!1),M&&T.observe(M))},[T]),[A,P]=Ds(k),E=da(t);return _.useEffect(()=>{!T||!A.current||(T.disconnect(),f.current=!1,T.observe(A.current))},[A,T]),_.useEffect(()=>(l({type:qt.RegisterDroppable,element:{id:o,key:a,disabled:n,node:A,rect:g,data:E}}),()=>l({type:qt.UnregisterDroppable,key:a,id:o})),[o]),_.useEffect(()=>{n!==h.current.disabled&&(l({type:qt.SetDroppableDisabled,id:o,key:a,disabled:n}),h.current.disabled=n)},[o,a,n,l]),{active:s,rect:g,isOver:(c==null?void 0:c.id)===o,node:A,over:c,setNodeRef:P}}function i0(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function p7(e,t){return e.reduce((n,o,i)=>{const a=t.get(o);return a&&(n[i]=a),n},Array(e.length))}function Ga(e){return e!==null&&e>=0}function m7(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function g7(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const a0=e=>{let{rects:t,activeIndex:n,overIndex:o,index:i}=e;const a=i0(t,o,n),s=t[i],l=a[i];return!l||!s?null:{x:l.left-s.left,y:l.top-s.top,scaleX:l.width/s.width,scaleY:l.height/s.height}},Ya={scaleX:1,scaleY:1},s0=e=>{var t;let{activeIndex:n,activeNodeRect:o,index:i,rects:a,overIndex:s}=e;const l=(t=a[n])!=null?t:o;if(!l)return null;if(i===n){const u=a[s];return u?{x:0,y:n<s?u.top+u.height-(l.top+l.height):u.top-l.top,...Ya}:null}const c=I7(a,i,n);return i>n&&i<=s?{x:0,y:-l.height-c,...Ya}:i<n&&i>=s?{x:0,y:l.height+c,...Ya}:{x:0,y:0,...Ya}};function I7(e,t,n){const o=e[t],i=e[t-1],a=e[t+1];return o?n<t?i?o.top-(i.top+i.height):a?a.top-(o.top+o.height):0:a?a.top-(o.top+o.height):i?o.top-(i.top+i.height):0:0}const l0="Sortable",c0=_.createContext({activeIndex:-1,containerId:l0,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:a0,disabled:{draggable:!1,droppable:!1}});function u0(e){let{children:t,id:n,items:o,strategy:i=a0,disabled:a=!1}=e;const{active:s,dragOverlay:l,droppableRects:c,over:u,measureDroppableContainers:h}=u7(),f=Aa(l0,n),g=l.rect!==null,m=_.useMemo(()=>o.map(P=>typeof P=="object"&&"id"in P?P.id:P),[o]),C=s!=null,I=s?m.indexOf(s.id):-1,b=u?m.indexOf(u.id):-1,S=_.useRef(m),y=!m7(m,S.current),T=b!==-1&&I===-1||y,k=g7(a);wr(()=>{y&&C&&h(m)},[y,m,C,h]),_.useEffect(()=>{S.current=m},[m]);const A=_.useMemo(()=>({activeIndex:I,containerId:f,disabled:k,disableTransforms:T,items:m,overIndex:b,useDragOverlay:g,sortedRects:p7(m,c),strategy:i}),[I,f,k.draggable,k.droppable,T,m,b,c,g,i]);return _.createElement(c0.Provider,{value:A},t)}const C7=e=>{let{id:t,items:n,activeIndex:o,overIndex:i}=e;return i0(n,o,i).indexOf(t)},b7=e=>{let{containerId:t,isSorting:n,wasDragging:o,index:i,items:a,newIndex:s,previousItems:l,previousContainerId:c,transition:u}=e;return!u||!o||l!==a&&i===s?!1:n?!0:s!==i&&t===c},S7={duration:200,easing:"ease"},d0="transform",y7=ni.Transition.toString({property:d0,duration:0,easing:"linear"}),E7={roleDescription:"sortable"};function T7(e){let{disabled:t,index:n,node:o,rect:i}=e;const[a,s]=_.useState(null),l=_.useRef(n);return wr(()=>{if(!t&&n!==l.current&&o.current){const c=i.current;if(c){const u=hi(o.current,{ignoreTransform:!0}),h={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(h.x||h.y)&&s(h)}}n!==l.current&&(l.current=n)},[t,n,o,i]),_.useEffect(()=>{a&&s(null)},[a]),a}function h0(e){let{animateLayoutChanges:t=b7,attributes:n,disabled:o,data:i,getNewIndex:a=C7,id:s,strategy:l,resizeObserverConfig:c,transition:u=S7}=e;const{items:h,containerId:f,activeIndex:g,disabled:m,disableTransforms:C,sortedRects:I,overIndex:b,useDragOverlay:S,strategy:y}=_.useContext(c0),T=x7(o,m),k=h.indexOf(s),A=_.useMemo(()=>({sortable:{containerId:f,index:k,items:h},...i}),[f,i,k,h]),P=_.useMemo(()=>h.slice(h.indexOf(s)),[h,s]),{rect:E,node:M,isOver:B,setNodeRef:w}=f7({id:s,data:A,disabled:T.droppable,resizeObserverConfig:{updateMeasurementsFor:P,...c}}),{active:V,activatorEvent:H,activeNodeRect:X,attributes:W,setNodeRef:se,listeners:Ce,isDragging:be,over:ve,setActivatorNodeRef:Le,transform:x}=c7({id:s,data:A,attributes:{...E7,...n},disabled:T.draggable}),ne=Gb(w,se),pe=!!V,L=pe&&!C&&Ga(g)&&Ga(b),Z=!S&&be,le=Z&&L?x:null,Ie=L?le??(l??y)({rects:I,activeNodeRect:X,activeIndex:g,overIndex:b,index:k}):null,Se=Ga(g)&&Ga(b)?a({id:s,items:h,activeIndex:g,overIndex:b}):k,ae=V==null?void 0:V.id,ce=_.useRef({activeId:ae,items:h,newIndex:Se,containerId:f}),Ue=h!==ce.current.items,Q=t({active:V,containerId:f,isDragging:be,isSorting:pe,id:s,index:k,items:h,newIndex:ce.current.newIndex,previousItems:ce.current.items,previousContainerId:ce.current.containerId,transition:u,wasDragging:ce.current.activeId!=null}),Ve=T7({disabled:!Q,index:k,node:M,rect:E});return _.useEffect(()=>{pe&&ce.current.newIndex!==Se&&(ce.current.newIndex=Se),f!==ce.current.containerId&&(ce.current.containerId=f),h!==ce.current.items&&(ce.current.items=h)},[pe,Se,f,h]),_.useEffect(()=>{if(ae===ce.current.activeId)return;if(ae!=null&&ce.current.activeId==null){ce.current.activeId=ae;return}const we=setTimeout(()=>{ce.current.activeId=ae},50);return()=>clearTimeout(we)},[ae]),{active:V,activeIndex:g,attributes:W,data:A,rect:E,index:k,newIndex:Se,items:h,isOver:B,isSorting:pe,isDragging:be,listeners:Ce,node:M,overIndex:b,over:ve,setNodeRef:ne,setActivatorNodeRef:Le,setDroppableNodeRef:w,setDraggableNodeRef:se,transform:Ve??Ie,transition:Te()};function Te(){if(Ve||Ue&&ce.current.newIndex===k)return y7;if(!(Z&&!Uu(H)||!u)&&(pe||Q))return ni.Transition.toString({...u,property:d0})}}function x7(e,t){var n,o;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(o=e==null?void 0:e.droppable)!=null?o:t.droppable}}Qe.Down,Qe.Right,Qe.Up,Qe.Left;function _7({product:e,children:t}){const{attributes:n,listeners:o,setNodeRef:i,transform:a,transition:s,isDragging:l}=h0({id:e.id}),c={transform:ni.Transform.toString(a),transition:s};return d.jsx("div",{ref:i,style:c,className:`${Ot.product} ${l?Ot.dragging:""}`,...n,...o,children:t})}const f0=e=>{const{isActiveItems:t,setIsActiveItems:n,items:o,setItems:i,other:a,title:s,subtitle:l,editable:c=!0,draggable:u=!1,withImage:h=!1,deletable:f=!0,addable:g=!0,itemsType:m,itemsPlaceholder:C="",itemsOptions:I,hasRangeSelector:b=!1,rangeSelectorOptions:S,modalOptions:y,addableOptions:T={},limit:k,autoInterval:A,tip:P,aspectRatio:E,setAspectRatio:M}=e,[B,w]=_.useState(null),[V,H]=_.useState({top:0,left:0}),[X,W]=_.useState(null),se=_.useRef(null),[Ce,be]=_.useState(!1),ve=$p(zp(ol,{activationConstraint:{distance:5}}));_.useEffect(()=>{if(B){const Z=[...o].map(le=>le.id===B.id?B:le);i(Z)}},[B]),_.useEffect(()=>{if(se.current&&X){const Z=se.current.getBoundingClientRect().height,le=window.innerHeight;let ee=X.top;ee+Z>le+window.scrollY-200&&(ee=le+window.scrollY-Z-200),ee<0&&(ee=10),H({top:ee-30,left:X.left})}},[se.current,X]);const Le=(Z,le)=>{Z.stopPropagation();const ee=Z.target.getBoundingClientRect();W({top:ee.top+window.scrollY-70,left:ee.left-(g?30:65)}),w(le),be(!0)},x=(Z,le)=>{const ee=[...o],Ie={...Z,id:Math.random().toString(36).substr(2,9)};ee.splice(le+1,0,Ie),i(ee)};function ne(Z){if(h)return Z?d.jsx("img",{src:`https://imagedelivery.net/${Z[0]}/w=1000`,alt:"image",width:16,height:16}):d.jsx(ie,{name:"Image",width:16,height:16,fill:"#757575"})}const pe=Z=>{const{active:le,over:ee}=Z;if(ee&&le.id!==ee.id){const Ie=o.findIndex(ae=>ae.id===le.id),Se=o.findIndex(ae=>ae.id===ee.id);if(Ie!==-1&&Se!==-1){const ae=[...o],[ce]=ae.splice(Ie,1);ae.splice(Se,0,ce),i(ae)}}},L=(Z,le)=>{var Ie,Se;const ee=d.jsxs(d.Fragment,{children:[u&&d.jsx("div",{children:d.jsx(ie,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),m==="select"&&I&&d.jsx(ao,{onChange:ae=>{const ce=[...o],Ue=I.find(Ve=>Ve.name["en-US"]===ae);if(!Ue)return;const Q=ce.map(Ve=>Ve.id===Z.id?{...Ue,name:{"en-US":ae}}:Ve);w({...Z,name:{"en-US":ae}}),i([...Q])},value:Z.name["en-US"],options:I.filter(ae=>!o.find(ce=>ce.name["en-US"]===ae.name["en-US"])).map(ae=>ae.name["en-US"]),leftAddonOptions:I.filter(ae=>{var ce;return((ce=ae.images)==null?void 0:ce.length)>0}).map(ae=>({value:ae.name["en-US"],addon:ne(ae.images)}))}),m==="selectInfiniteList"&&I&&d.jsx(Lu,{onChange:ae=>{const ce=[...o],Ue=I.find(Ve=>Ve.name["en-US"]===ae);if(!Ue)return;const Q=ce.map(Ve=>Ve.id===Z.id?{...Ue,name:{"en-US":ae}}:Ve);w({...Z,name:{"en-US":ae}}),i([...Q])},value:Z.name["en-US"],options:I.filter(ae=>!o.find(ce=>ce.name["en-US"]===ae.name["en-US"])).map(ae=>ae.name["en-US"]),leftAddonOptions:I.filter(ae=>{var ce;return((ce=ae.images)==null?void 0:ce.length)>0}).map(ae=>({value:ae.name["en-US"],addon:ne(ae.images)}))}),m==="input"&&d.jsx(nr,{onChange:ae=>{const Ue=[...o].map(Q=>Q.id===Z.id?{...Z,name:{"en-US":ae}}:Q);i([...Ue])},value:Z.name["en-US"],placeholder:C}),m==="image"&&d.jsx(_a,{onChange:ae=>{const Ue=[...o].map(Q=>Q.id===Z.id?{...Z,images:ae}:Q);i([...Ue])},activeImage:(Ie=o.find(ae=>ae.id===Z.id))!=null&&Ie.images?(Se=o.find(ae=>ae.id===Z.id))==null?void 0:Se.images[0]:void 0,tip:P}),d.jsxs("div",{className:Ot.buttons,children:[k&&k>o.length&&g&&d.jsx("div",{className:Ot.deleteButton,children:d.jsx(ie,{name:"Copy",hoverable:!0,width:20,height:20,onClick:()=>{x(Z,le)}})}),c&&d.jsx("div",{className:Ot.deleteButton,children:d.jsx(ie,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:ae=>{Le(ae,Z)}})}),f&&d.jsx("div",{className:Ot.deleteButton,children:d.jsx(ie,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(o.filter(ae=>ae.id!==Z.id))})})]})]});return u?d.jsx(_7,{product:Z,index:le,children:ee},Z.id):d.jsx("div",{className:Ot.product,children:ee},Z.id)};return d.jsxs("div",{className:Ot.productsBlock,children:[(s||t!==void 0)&&d.jsxs("div",{className:Ot.top,children:[s&&d.jsx("h3",{className:Ot.title,children:s}),t!==void 0&&d.jsx(vr,{current:t,onChange:Z=>n==null?void 0:n(Z)})]}),B&&c&&y&&Ce&&d.jsx(zb,{ref:se,activeItem:B,setActiveItem:w,popupPosition:V,modalOptions:y,setIsOpenModal:be}),(t===void 0||t)&&b&&S&&d.jsx(p0,{...S}),(t===void 0||t)&&d.jsxs("div",{className:Ot.products,children:[l&&d.jsx("h5",{className:Ot.subtitle,children:l}),u?d.jsx(o0,{sensors:ve,onDragEnd:pe,children:d.jsx(u0,{items:o.map(Z=>Z.id),strategy:s0,children:o.map((Z,le)=>L(Z,le))})}):o.map((Z,le)=>L(Z,le)),g&&d.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:d.jsx(ti,{withoutHover:!0,className:ge(Ot.button,{[Ot.disabled]:!!(k&&k<=o.length||o.length===(I==null?void 0:I.length))}),size:"s",disabled:!!(k&&k<=o.length||o.length===(I==null?void 0:I.length)),onClick:()=>{const Z=[...o];let le=null;if(I){for(let ee=0;ee<I.length;ee++)if(!o.find(Ie=>Ie.id===I[ee].id)){le=I[ee];break}}m==="select"&&I?Z.push({name:le?le.name:I[0].name,id:(le==null?void 0:le.id)||I[0].id,...T}):m==="input"?Z.push({name:{"en-US":""},id:pt(),...T}):Z.push({name:{"en-US":`Image ${o.length+1}`},id:pt(),...T}),i(Z)},style:{width:"fit-content"},children:d.jsxs("div",{className:Ot.addButton,children:[d.jsx("span",{children:"Add Option"}),d.jsx(ie,{name:"Plus",width:16,height:16})]})})})]}),E&&M&&d.jsx(ao,{value:E,label:"Aspect Ratio",options:Object.keys(Zf),onChange:Z=>M(Z),leftAddonOptions:Xf}),(t===void 0||t)&&a!==void 0&&d.jsx(Hp,{otherTitle:"Other",items:a}),(t===void 0||t)&&A!==void 0&&d.jsx(nr,{label:A.title||"Auto scroll interval",type:"number",value:String(A.autoInterval),onChange:Z=>A.setAutoInterval(Number(Z)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},w7="_title_cx65i_1",v7="_subtitle_cx65i_5",A7="_productsBlock_cx65i_14",k7="_top_cx65i_26",L7="_products_cx65i_14",N7="_product_cx65i_14",P7="_button_cx65i_80",R7="_disabled_cx65i_91",D7="_buttons_cx65i_118",O7="_modal_cx65i_125",M7="_link_cx65i_146",B7="_modalOptions_cx65i_152",F7="_addButton_cx65i_165",H7="_deleteButton_cx65i_180",j7="_closeIcon_cx65i_192",Co={title:w7,subtitle:v7,productsBlock:A7,top:k7,products:L7,product:N7,button:P7,disabled:R7,buttons:D7,modal:O7,link:M7,modalOptions:B7,addButton:F7,deleteButton:H7,closeIcon:j7},U7=_.forwardRef((e,t)=>{const{activeItem:n,setActiveItem:o,popupPosition:i,modalOptions:a,setIsOpenModal:s}=e;return si(t,()=>{o(null),s(!1)}),d.jsxs("div",{ref:t,className:Co.modal,onClick:l=>{l.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[d.jsxs("div",{className:Co.top,children:[d.jsx("h3",{className:Co.title,children:n.name["en-US"]}),d.jsx("div",{className:Co.closeIcon,children:d.jsx(ie,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{o(null),s(!1)}})})]}),d.jsx("div",{className:Co.modalOptions,children:a.map(l=>{if(l.type==="image")return d.jsx(_a,{label:"Put up an attractive image",activeImage:n[l.field],onChange:c=>{const u={...n,[l.field]:c};o(u)}},String(l.field));if(l.type==="text")return d.jsx(Bu,{isActiveText:!0,typesText:n[l.field.type],setTypesText:c=>{const u={...n,[l.field.type]:c};o(u)},alignText:n[l.field.alignText],setAlignText:c=>{const u={...n,[l.field.alignText]:c};o(u)},text:n[l.field.text]["en-US"]||"",setText:c=>{const u={...n,[l.field.text]:{"en-US":c}};o(u)},typeFont:n[l.field.type],setTypeFont:c=>{const u={...n,[l.field.type]:c};o(u)},subtitle:l.label});if(l.type==="input")return d.jsx(nr,{onChange:c=>{const u={...n,[l.field]:{"en-US":c}};o(u)},value:n[l.field]["en-US"]||"",label:l.label,placeholder:l.placeholder});if(l.type==="inputNumber")return d.jsx(nr,{onChange:c=>{const u={...n,[l.field]:c};o(u)},value:n[l.field]||"",label:l.label,placeholder:l.placeholder,type:"number"});if(l.type==="inputSwitch")return d.jsxs("div",{className:Co.link,children:[d.jsx(nr,{onChange:c=>{const u={...n,[l.field.text]:{"en-US":c}};o(u)},value:n[l.field.text]["en-US"]||"",label:l.inputLabel,placeholder:l.placeholder}),d.jsx(vr,{current:!!n[l.field.switch]||!1,label:l.switchLabel,onChange:c=>{const u={...n,[l.field.switch]:c};o(u)}})]});if(l.type==="select")return d.jsx(ao,{options:l.itemsOptions,onChange:c=>{const u={...n,[l.field]:c};o(u)},label:l.label,value:n[l.field]||"String",leftAddonOptions:l.leftAddonOptions})})})]})}),V7="_title_hvj8m_1",z7="_buttonsBlock_hvj8m_15",$7="_top_hvj8m_26",W7="_modal_hvj8m_120",q7="_options_hvj8m_146",G7="_closeIcon_hvj8m_154",Go={title:V7,buttonsBlock:z7,top:$7,modal:W7,options:q7,closeIcon:G7},Y7=_.forwardRef((e,t)=>{var T;const{activeButton:n,setActiveButton:o,popupPosition:i,editableLink:a=!0}=e,[s,l]=_.useState(n.typesText),[c,u]=_.useState(n.destination),[h,f]=_.useState(n.page),[g,m]=_.useState(n.link||""),[C,I]=_.useState(n.text||{"en-US":""}),[b,S]=_.useState(n.openInNewTab),{pages:y}=zr();return si(t,()=>{o(null)}),_.useEffect(()=>{o({...n,...{text:C,link:g,destination:c,typesText:s,page:h,openInNewTab:b}})},[s,c,g,C,h,b]),d.jsxs("div",{className:Go.modal,onClick:k=>{k.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},ref:t,children:[d.jsxs("div",{className:Go.top,children:[d.jsx("h3",{className:Go.title,children:n.type}),d.jsx("div",{className:Go.closeIcon,children:d.jsx(ie,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>o(null)})})]}),d.jsxs("div",{className:Go.options,children:[a&&d.jsx(ao,{label:"Destination",onChange:k=>u(k),options:["Go to Page","Open Link"].filter(k=>k!==c),value:c}),a&&(c==="Go to Page"?d.jsx(ao,{label:"Go to",onChange:k=>{if(k==="Sign In")f("/customer-dash");else if(y){for(const A in y)if(y[A].name===k){f(y[A].path);break}}else f(Yf[0])},options:y?[...Object.values(y).filter(k=>k.path!==h).map(k=>k.name),"Sign In"]:["Sign In"],value:y?h==="/customer-dash"?"Sign In":((T=Object.values(y).find(k=>k.path===h))==null?void 0:T.name)||"Home":"Home"}):d.jsx(nr,{onChange:k=>m(k),value:g,placeholder:"https://",label:"Link"})),a&&d.jsx(vr,{current:n.openInNewTab,label:"Open in new tab",onChange:k=>S(k)}),d.jsx(Ou,{onChange:k=>I({"en-US":k}),value:C["en-US"],label:"Text"}),d.jsx(Du,{typesText:s,setTypesText:l})]})]})}),Z7="_wrapper_m18qi_1",X7="_subtitle_m18qi_7",K7="_content_m18qi_14",Q7="_range_m18qi_22",J7="_track_m18qi_27",ey="_progress_m18qi_36",ty="_dots_m18qi_46",ny="_dot_m18qi_46",ry="_active_m18qi_65",oy="_input_m18qi_77",iy="_countBlock_m18qi_91",ay="_controls_m18qi_107",sy="_button_m18qi_113",mn={wrapper:Z7,subtitle:X7,content:K7,range:Q7,track:J7,progress:ey,dots:ty,dot:ny,active:ry,input:oy,countBlock:iy,controls:ay,button:sy},p0=e=>{const{label:t,min:n=1,max:o=4,step:i=1,count:a,setCount:s}=e,[l,c]=_.useState(!1),u=Array.from({length:(o-n)/i+1}),h=(a-n)/(o-n)*100,f=()=>{a<o&&s(a+i)},g=()=>{a>n&&s(a-i)},m=C=>{const I=n+C*i;s(I)};return d.jsxs("div",{className:mn.wrapper,children:[t&&d.jsx("h5",{className:mn.subtitle,children:t}),d.jsxs("div",{className:mn.content,children:[d.jsxs("div",{className:mn.range,children:[d.jsx("div",{className:mn.track}),d.jsx("div",{className:mn.progress,style:{width:`${h}%`}}),d.jsx("div",{className:mn.dots,children:u.map((C,I)=>{const b=I<=(a-n)/i;return d.jsx("button",{onClick:()=>m(I),className:ge(mn.dot,{[mn.active]:b,[mn.inactive]:!b,[mn.dragging]:l}),"aria-label":`Set value to ${n+I*i}`},I)})}),d.jsx("input",{type:"range",min:n,max:o,step:i,value:a,onChange:C=>s(Number(C.target.value)),onMouseDown:()=>c(!0),onMouseUp:()=>c(!1),onTouchStart:()=>c(!0),onTouchEnd:()=>c(!1),className:mn.input})]}),d.jsxs("div",{className:mn.countBlock,children:[d.jsx(nr,{type:"number",min:n,max:o,paddingless:!0,onChange:C=>{const I=Number(C);I>o?s(o):I<n?s(n):s(I)},value:String(a)}),d.jsxs("div",{className:mn.controls,children:[d.jsx("button",{onClick:f,disabled:a>=o,className:mn.button,"aria-label":"Increment count",children:d.jsx(ie,{name:"CaretUp",width:15,height:15})}),d.jsx("button",{onClick:g,disabled:a<=n,className:mn.button,"aria-label":"Decrement count",children:d.jsx(ie,{name:"CaretDown",width:15,height:15})})]})]})]})]})},ly="_title_11jyy_1",cy="_subtitle_11jyy_5",uy="_productsBlock_11jyy_14",dy="_top_11jyy_26",hy="_products_11jyy_14",fy="_product_11jyy_14",py="_button_11jyy_80",my="_buttons_11jyy_114",gy="_modal_11jyy_121",Iy="_modalOptions_11jyy_148",Cy="_addButton_11jyy_161",by="_deleteButton_11jyy_176",Sy="_closeIcon_11jyy_188",zi={title:ly,subtitle:cy,productsBlock:uy,top:dy,products:hy,product:fy,button:py,buttons:my,modal:gy,modalOptions:Iy,addButton:Cy,deleteButton:by,closeIcon:Sy},m0=({render:e,block:t})=>e(t),g0=({settings:e,pageContext:t})=>{const{footer:n}=Hr(),{settings:o}=ya(),{pageContext:i}=zr(),{footer:a}=Lo();if(!a||!n)return null;const s=new a;return Object.keys(n).map(l=>{s[l]=n[l]}),s.renderBlock((e==null?void 0:e.blockSettings)||o,t||i)},I0=({settings:e,pageContext:t})=>{const{header:n}=Hr(),{settings:o}=ya(),{pageContext:i}=zr(),{header:a}=Lo();if(!a||!n)return null;const s=new a;return Object.keys(n).map(l=>{s[l]=n[l]}),s.renderBlock((e==null?void 0:e.blockSettings)||o,t||i)},C0=({settings:e,pageContext:t})=>{const{announcement:n}=Hr(),{settings:o}=ya(),{pageContext:i}=zr(),{announcement:a}=Lo();if(!a||!n)return null;const s=new a;return Object.keys(n).map(l=>{s[l]=n[l]}),s.renderBlock(e||o,t||i)},yy=async(e,t)=>{const n=kt.getState().apiUrls,o=Vt?localStorage.getItem("fakeDomain")||"flagship-theme.pages.dev":window.location.hostname,i=localStorage.getItem("shopPassword");if(t&&!i)return null;const a=`${n.storeApi}/v2/shops/${o}/pages/${e}`+(t?`?password=${i}`:"");try{return await lt({url:a,withToken:!0,method:"get"})}catch(s){if(ht.isAxiosError(s)&&s.response&&s.response.status===404)return null}},Ey="_wrapper_5w9s8_1",Ty={wrapper:Ey},Wc=e=>{const{error:t}=e;return d.jsx("div",{className:Ty.wrapper,children:t})},xy=async e=>{const t=kt.getState().apiUrls,n=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${t.slApi}/v1/balance/top-up/${n}`;return await lt({url:o,method:"post",body:e,withToken:!1})},fi=async e=>{const t=kt.getState().apiUrls;if(!localStorage.getItem("token"))throw new Error("No access token");const o=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,i=`${t.customersApi}/v2/${o}/customers/${e}`;return await lt({url:i,withToken:!0,method:"get",typeToken:"customer"})},_y=()=>fi("dash/info"),wy=()=>fi("dash/dashboard/home"),vy=()=>fi("rewards"),Ay=()=>fi("balance"),ky=()=>fi("balance/top-up/settings"),Ly=()=>fi("referral-system"),qc=10,sl=async({url:e,PageNumber:t})=>{var l;const n=kt.getState().apiUrls,o=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,i=`${n.customersApi}/v2/${o}/${e}?PageNumber=${t}&PageSize=${qc}`,a=await lt({url:i,withToken:!0,method:"get",typeToken:"customer"}),s=Number((l=a.headers)==null?void 0:l["x-pagination-total"]);return{list:a.data,totalCount:s}},Wu=async(e,t="get",n)=>{const o=kt.getState().apiUrls,i=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${o.slApi}/v1/orders/${i}/${e}`;return await lt({url:a,method:t,withToken:!0,body:n,typeToken:"customer"})},Ny=e=>Wu("","post",e),Py=({PageNumber:e})=>sl({url:"customers/orders",PageNumber:e}),Ry=e=>Wu(e),Dy=e=>Wu(e),Oy=async e=>{const t=kt.getState().apiUrls,n=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${t.slApi}/v1/${n}/subscriptions`;return await lt({url:o,method:"post",withToken:!1,body:e})},My=async(e,t)=>{const n=kt.getState().apiUrls,o=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,i=`${n.slApi}/v2/${o}/subscriptions/${e}/${t}`;return await lt({url:i,method:"get",withToken:!1})},By=async(e,t)=>{const n=kt.getState().apiUrls,o=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,i=`${n.slApi}/v1/${o}/subscriptions/${e}/${t}/upgrades`;return await lt({url:i,method:"get",withToken:!1})},Fy=async(e,t,n)=>{const o=kt.getState().apiUrls,i=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${o.slApi}/v1/${i}/subscriptions/${e}/${t}/cancel`;return await lt({url:a,method:"post",withToken:!1,body:n})},Hy=async(e,t)=>{const n=kt.getState().apiUrls,o=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,i=`${n.slApi}/v2/${o}/subscriptions/${e}/change-gateway`;return await lt({url:i,method:"post",withToken:!1,body:{gateway:t}})},jy=({PageNumber:e})=>sl({url:"customers/subscriptions",PageNumber:e}),Uy=async({id:e,accessToken:t})=>await By(e,t),Vy=async(e,t)=>{const n=kt.getState().apiUrls,o=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,i=`${n.slApi}/v2/${o}/subscriptions/${e}/order`;return await lt({url:i,method:"post",withToken:!1,body:t})},zy=async(e,t)=>{const n=kt.getState().apiUrls,o=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,i=`${n.slApi}/v1/public/${o}/tickets/${e}/${t}`;return await lt({url:i,method:"get",withToken:!1})},$y=async(e,t,n,o,i)=>{const a=kt.getState().apiUrls,s=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,l=`${a.slApi}/v1/public/${s}/tickets/${e}/${t}/answer`;return(await lt({url:l,method:"post",body:{message:n,recaptcha:o,tsId:i},withToken:!1})).data},Wy=({PageNumber:e})=>sl({url:"customers/tickets",PageNumber:e}),qy=({PageNumber:e})=>sl({url:"customers/balance/transactions",PageNumber:e}),b0=async e=>{const t=kt.getState().apiUrls,n=e.map(s=>["names",s]),o=new URLSearchParams(n),i=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${t.slApi}/v2/gateways?shopDomain=${i}&${o.toString()}`;return await lt({url:a,method:"get",withToken:!1})},S0=async({email:e,recaptcha:t,tsId:n})=>{const o=kt.getState().apiUrls,i=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${o.customersApi}/v2/${i}/auth/otp/request`;return(await lt({url:a,body:{email:e,recaptcha:t,tsId:n},method:"post",withToken:!1})).data?{requested:!0,email:e}:{requested:!1,email:void 0}},y0=async({email:e,otp:t,recaptcha:n,tsId:o})=>{const i=kt.getState().apiUrls,a=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,s=`${i.customersApi}/v2/${a}/auth/otp/login`,{data:l}=await lt({url:s,method:"post",body:{email:e,otp:t,recaptcha:n,tsId:o},withToken:!1});return uo.getState().setToken(l.data),localStorage.setItem("token",l.data),{token:l.data,requested:!1}},Gc=async()=>{uo.getState().setToken(""),localStorage.removeItem("token")},Gy=Object.freeze(Object.defineProperty({__proto__:null,loginCustomer:y0,logoutCustomer:Gc,requestOtp:S0},Symbol.toStringTag,{value:"Module"})),Yy=async e=>{const t=kt.getState().apiUrls,n=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${t.slApi}/v2/coupons/${n}/validate`;return await lt({url:o,method:"post",body:e,withToken:!1})},Zy=async e=>{const t=kt.getState().apiUrls,n=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${t.customersApi}/v2/${n}/customers/referral-system/signup`;return(await lt({url:o,withToken:!0,method:"post",body:e,typeToken:"customer"})).data},Xy=async()=>{const{data:e}=await Ly();return e},Ky=async e=>{const{data:t}=await Zy(e);return t};async function Qy(e){const t=kt.getState().apiUrls,n=Vt?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${t.customersApi}/v2/${n}/customers/rewards/${e.id}/claim`;return lt({url:o,method:"post",withToken:!0,typeToken:"customer"})}const Wl="Balance",Jy={Number:"NUMBER",Textarea:"LARGE_TEXT",Checkbox:"CHECK_BOX",Hidden:"HIDDEN"},e8={recaptcha:"",gateway:"",paymentMethod:"",parts:[],customFields:{},discordSocialConnectId:null,coupon:null,tsId:""},B1=(e,t)=>{var u;const{productId:n,productVariantId:o,quantity:i,chargeType:a}=t,s=e.find(h=>h.id===n);if(!s)throw new Error("Product does not exist");const l=s.variants.find(h=>h.id===o);if(!l)throw new Error("Variant does not exist");if(a==="RECURRING"&&!l.subscriptionSettings)throw new Error("Variant does not have subscription settings");if(i!==void 0&&((u=l.quantity)!=null&&u.available)&&l.quantity.available<i)throw new Error("Not enough quantity available");const c=Br.getState().cart;if(c.parts.length>0){const h=e.find(g=>g.id===c.parts[0].productId),f=h==null?void 0:h.variants.find(g=>g.id===c.parts[0].productVariantId);if(f&&l.price.currency!==f.price.currency)throw new Error("Product have different currency")}return l},t8=(e,t)=>{if(!e.volumeDiscounts||e.volumeDiscounts.length===0)return 0;const n=e.volumeDiscounts.filter(i=>t>=i.amount);return n.length===0?0:n.reduce((i,a)=>a.amount>i.amount?a:i).percentage},n8=(e,t)=>{let n=0,o=0;return e.forEach(i=>{var g,m;const a=t.find(C=>(C==null?void 0:C.id)===i.productId),s=a==null?void 0:a.variants.find(C=>C.id===i.productVariantId);if(!s)return;const{gateway:l}=Br.getState().cart,c=(s==null?void 0:s.gateways)||[],u=c.some(C=>C.name===l&&C.overrodePrice)?(g=c.find(C=>C.name===l))==null?void 0:g.overrodePrice:null;let h=0,f=0;if(i.chargeType==="ONE_TIME"?(h=(u==null?void 0:u.amount)||(s==null?void 0:s.price.amount)||0,f=h*i.quantity):f=s!=null&&s.subscriptionSettings?s.subscriptionSettings.price.amount+(((m=s.subscriptionSettings.entryFee)==null?void 0:m.amount)||0):0,n+=f,i.chargeType==="ONE_TIME"){const C=t8(s,i.quantity),I=f*(1-C/100);o+=I}else o+=f}),{total:n,totalWithVolumeDiscounts:o}},r8=(e,t)=>({isRequired:t.some(o=>{var a;const i=e.find(s=>(s==null?void 0:s.id)===o.productId);return(a=i==null?void 0:i.variants.find(s=>s.id===o.productVariantId))==null?void 0:a.discordSettings.isRequired}),isEnabled:t.some(o=>{var a;const i=e.find(s=>(s==null?void 0:s.id)===o.productId);return(a=i==null?void 0:i.variants.find(s=>s.id===o.productVariantId))==null?void 0:a.discordSettings.isEnabled})}),F1=e=>new Set(e.gateways.map(t=>t.name)),H1={availableGateways:[],requiresSignInGateways:[]},j1=(e,t)=>{var a;if(t.length===0)return H1;const n=(a=t[0])==null?void 0:a.variants[0];if(!n)return H1;const o=F1(n);for(const s of e){const l=t.find(h=>h.id===s.productId);if(!l)continue;const c=l.variants.find(h=>h.id===s.productVariantId);if(!c)continue;const u=F1(c);for(const h of o)u.has(h)||o.delete(h)}return!localStorage.getItem("token")&&o.has(Wl)?(o.delete(Wl),{availableGateways:[...o],requiresSignInGateways:[Wl]}):{availableGateways:[...o],requiresSignInGateways:[]}},o8=(e,t)=>{if(e.length===0)return[];const o=e.map(a=>{const s=t.find(c=>c.id===a.productId),l=s==null?void 0:s.variants.find(c=>c.id===a.productVariantId);return(l==null?void 0:l.customFields)??[]}).flat().reduce((a,s)=>{const l=a[s.name];return l?(s.required&&!l.required&&(a[s.name]={...s,value:s.defaultValue}),a):(a[s.name]={...s,value:s.defaultValue},a)},{});return Object.values(o).map(a=>({...a,value:""}))},i8=(e,t)=>{const n=t.find(i=>i.id===e.productId),o=n==null?void 0:n.variants.find(i=>i.id===e.productVariantId);return e.chargeType==="RECURRING"?!!(o!=null&&o.subscriptionSettings):!1},a8=()=>{const{cart:e,products:t,coupon:n,pending:o,applyCouponPending:i,customerEmail:a,setCart:s,setProducts:l,setCoupon:c,setPending:u,setApplyCouponPending:h}=Br(),f=async I=>{var E;h(!0);const{cart:b}=Br.getState(),{gateway:S,parts:y}=b,{notifications:T,setNotifications:k}=cn.getState();S||(h(!1),k([...T,{message:"There should be a gateway for the coupon",status:"error",id:pt()}]));const A=y.map(M=>M.productId);let P=null;try{const{data:M}=await Yy({gateway:S,couponName:I,productIds:A});P=M.data,k([...T,{message:"Coupon is applied",status:"success",id:pt()}]),s(B=>({...B,coupon:I}))}catch(M){const B=M;k([...T,{message:`Coupon is not applied: ${B.message}`,status:"error",id:pt()}]),s(w=>({...w,coupon:null})),c(null),h(!1)}if(h(!1),(E=P==null?void 0:P.restrictToProductIds)!=null&&E.length&&!A.every(M=>{var B;return(B=P==null?void 0:P.restrictToProductIds)==null?void 0:B.includes(M)}))throw new Error("Coupon can't be applied to such products");return c(P),P},C={reset(){s({...e8})},addProducts:I=>{const b=Br.getState().products,S=I.filter(y=>!b.some(T=>T.id===y.id));l([...b,...S])},addProductToCart:I=>{const b=Br.getState().cart;try{B1(t,I)}catch(y){throw new Error(y)}const S=b.parts.find(y=>y.productId===I.productId&&y.productVariantId===I.productVariantId&&y.chargeType===I.chargeType);if(S)return C.updateQuantityOfProduct({...S,quantity:(S.quantity||1)+(I.quantity||1),chargeType:I.chargeType});if(b.parts.length&&j1([...b.parts,I],t).availableGateways.length===0)throw new Error("No common payment gateways available");s({...b,parts:[...b.parts,I]}),b.coupon&&f(b.coupon)},removeProduct({productId:I,productVariantId:b}){s(S=>({...S,parts:S.parts.filter(y=>y.productId!==I||y.productVariantId!==b)})),e.coupon&&f(e.coupon)},getPossibleGateways(){return j1(e.parts,t)},removeCoupon(){c(null)},getDiscordSettings(){return r8(t,e.parts)},updateQuantityOfProduct(I){B1(t,I),s(b=>({...b,parts:b.parts.map(S=>S.productId===I.productId&&S.productVariantId===I.productVariantId?{...S,quantity:I.quantity,chargeType:I.chargeType}:S)})),e.coupon&&f(e.coupon)},getTotalAndDiscount(){const{coupon:I}=Br.getState(),{total:b,totalWithVolumeDiscounts:S}=n8(e.parts,t);let y;const T=S;return I&&I.discount?!I.isFixed&&I.discount===100?y=0:y=I.isFixed?Math.max(0,T-I.discount):T*(1-I.discount/100):S!==b&&(y=S),{total:b,totalWithVolumeDiscounts:S!==b?S:void 0,totalWithDiscount:y}},setGateway(I){s(S=>({...S,gateway:I}));const{isAntistock:b}=mt.getState();e.coupon&&!b&&f(e.coupon)},setPaymentMethod(I){s(b=>({...b,paymentMethod:I}))},async submitCart(I){u(!0);const{cart:b}=Br.getState(),{discordInfo:S}=Op.getState();let y;if(b.parts&&a&&i8(b.parts[0],t))try{const{data:T}=await Oy({...b,partOrder:b.parts[0],referralCode:localStorage.getItem("referralCode"),discordSocialConnectId:S!=null&&S.authorized?S.id:null,customerEmail:a,recaptcha:I,customFields:{...b.customFields},tsId:so()});y=T.data}catch(T){console.error(T)}else try{const{data:T}=await Ny({...b,referralCode:localStorage.getItem("referralCode"),recaptcha:I,customFields:{...b.customFields},tsId:so(),discordSocialConnectId:S!=null&&S.authorized?S.id:null});y=T.data}catch(T){const k=T,{notifications:A,setNotifications:P}=cn.getState();P([...A,{message:`Failed to create order: ${k.message}`,status:"error",id:pt()}])}if(u(!1),y)return y;throw new Error("Failed to create order")},setDiscordSocialConnectId(I){s(b=>({...b,discordSocialConnectId:I}))},setCustomFields(I){s(b=>({...b,customFields:{...I}}))}};return _.useEffect(()=>{s(I=>({...I,customerEmail:a??""}))},[a,s]),{cart:e,products:t,coupon:n,pending:o,applyCouponPending:i,applyCoupon:f,...C}},ll=()=>{const{notifications:e,setNotifications:t}=cn();return n=>{navigator.clipboard.writeText(n),t([...e,{status:"success",message:"Successfully copied",id:pt()}])}};function E0(e,t=!0){if(!e||typeof e!="string")return"";if(/<[a-z][\s\S]*>/i.test(e))return e;const o=e.split(" "),i=20;if(t){let a="",s=[];return o.forEach(l=>{l.length>i?(s.length>0&&(a+=`<span style="hyphens: manual">${s.join(" ")} </span>`,s=[]),a+=`<span style="hyphens: auto" lang="en">${l} </span>`):s.push(l)}),s.length>0&&(a+=`<span style="hyphens: manual">${s.join(" ")}</span>`),a}else{const a=[];let s=[],l=0;return o.forEach(c=>{c.length>i?(s.length>0&&(a.push(d.jsxs("span",{style:{hyphens:"manual"},children:[s.join(" ")," "]},l++)),s=[]),a.push(d.jsxs("span",{style:{hyphens:"auto"},lang:"en",children:[c," "]},l++))):s.push(c)}),s.length>0&&a.push(d.jsx("span",{style:{hyphens:"manual"},children:s.join(" ")},l++)),a}}const s8=_.forwardRef((e,t)=>{const{activeItem:n,setActiveItem:o,popupPosition:i,setIsOpenModal:a,itemsOptions:s}=e,l=s.find(c=>c.id===n.listingId);return si(t,()=>{o(null),a(!1)}),l?d.jsxs("div",{className:zi.modal,onClick:c=>{c.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[d.jsxs("div",{className:zi.top,children:[d.jsx("h3",{dangerouslySetInnerHTML:{__html:E0(l.productData.name)}}),d.jsx("div",{className:zi.closeIcon,children:d.jsx(ie,{name:"X",height:20,width:20,onClick:()=>{a(!1),o(null)}})})]}),d.jsx("div",{className:zi.modalOptions,children:d.jsx(_a,{label:"Put up an attractive image",activeImage:l.productData.images.length>0?l.productData.images[0].cfId:n.image?n.image:void 0,onChange:c=>{const u={...n,image:c[0]};o(u)}})})]}):null}),l8="_wrapper_ipyfg_1",c8="_label_ipyfg_9",u8="_input_ipyfg_18",d8="_disabled_ipyfg_31",h8="_paddingless_ipyfg_36",f8="_content_ipyfg_47",p8="_contentBorder_ipyfg_60",m8="_contentField_ipyfg_65",g8="_contentIsAntistock_ipyfg_69",I8="_borderless_ipyfg_74",C8="_rightIcon_ipyfg_79",b8="_leftIcon_ipyfg_87",S8="_requiredStar_ipyfg_94",xn={wrapper:l8,label:c8,input:u8,disabled:d8,paddingless:h8,content:f8,contentBorder:p8,contentField:m8,contentIsAntistock:g8,borderless:I8,rightIcon:C8,leftIcon:b8,requiredStar:S8},Ro=e=>{const{onChange:t,style:n,label:o,value:i,type:a="text",min:s,max:l,placeholder:c,disabled:u=!1,required:h=!1,regex:f,paddingless:g=!1,borderless:m=!1,editable:C=!1,isSearch:I=!1,centered:b=!1,maxSymbols:S,rightIcon:y,onFocus:T,leftIcon:k}=e,{themeSettings:A}=No(),{isAntistock:P}=mt(),{inputs:E}=A,[M,B]=_.useState(!1);function w(H){if(Number(H)<0)return String(s);const X=H.replace(/[^\d-]/g,"");return Number(X)<0?String(s):X}function V(H){if(!h||!f)return!0;try{return new RegExp(f).test(H)}catch(X){return console.error("Invalid regex pattern:",f,X),!0}}return d.jsxs("div",{className:xn.wrapper,children:[o&&d.jsxs("label",{className:xn.label,htmlFor:o,style:{color:P?"var(--text-secondary)":void 0},children:[o,h&&d.jsx("span",{className:xn.requiredStar,children:"*"})]}),d.jsxs("div",{className:ge(xn.content,{[xn.contentBorder]:!P&&E.border.active,[xn.contentField]:E.field.active,[xn.disabled]:u,[xn.contentIsAntistock]:P}),style:{...n},children:[k&&d.jsx("div",{className:xn.leftIcon,children:k}),d.jsx("input",{maxLength:S,id:o,type:a||"text",onChange:H=>{if(a==="text")t(H.target.value);else{const X=w(H.target.value);t(X)}},value:i,autoComplete:"off",placeholder:c||"Type something...",className:ge(xn.input,{[xn.required]:M&&h&&!V(i),[xn.paddingless]:g,[xn.borderless]:m}),min:a==="number"?s:void 0,max:a==="number"?l:void 0,onFocus:()=>{T==null||T(),B(!0)},disabled:u,style:{textAlign:b?"center":"left",padding:I?`7px ${Number(E.general.size)+20}px 7px ${k?35:11}px`:`7px ${y?35:11}px 7px ${k?35:11}px`}}),y&&d.jsx("div",{className:xn.rightIcon,children:y}),I&&d.jsx("div",{className:xn.rightIcon,children:d.jsx(ie,{name:"MagnifyingGlass",fill:"var(--text-secondary)",width:E.general.size,height:E.general.size})}),C&&d.jsx("div",{children:d.jsx(ie,{name:"Sliders",width:20,height:20,hoverable:!0})})]})]})},y8="_button_1v5k3_1",E8="_primary_1v5k3_20",T8="_primaryHovered_1v5k3_30",x8="_secondary_1v5k3_35",_8="_secondaryHovered_1v5k3_45",w8="_secondaryAntistock_1v5k3_50",v8="_tertiary_1v5k3_61",A8="_special_1v5k3_71",k8="_tertiaryHovered_1v5k3_75",L8="_content_1v5k3_80",N8="_isAntistock_1v5k3_88",ar={button:y8,primary:E8,primaryHovered:T8,secondary:x8,secondaryHovered:_8,secondaryAntistock:w8,tertiary:v8,special:A8,tertiaryHovered:k8,content:L8,isAntistock:N8},P8=()=>typeof document<"u"?document.documentElement.hasAttribute("translated")||document.documentElement.querySelector(".translated-ltr, .translated-rtl")!==null||document.head.querySelector('meta[name="_translator"]')!==null:!1,T0=({children:e,className:t,as:n="span",...o})=>{const[i,a]=_.useState(!1);return _.useEffect(()=>{typeof window<"u"&&a(P8())},[]),i?d.jsx(n,{className:t,...o,"data-stable-text":e,dangerouslySetInnerHTML:{__html:""}}):d.jsx(n,{className:t,...o,children:e})},_t=e=>{const{children:t,onClick:n,style:o,className:i,disabled:a=!1,type:s="Primary",dangerouslySetInnerHTML:l}=e,{themeSettings:c}=No(),{isAntistock:u}=mt(),h=I=>typeof I=="string"?d.jsx(T0,{children:I}):I,f={onClick:n,disabled:a,style:o,className:ge(ar.button,i,{[ar.primary]:s==="Primary",[ar.secondary]:s==="Secondary"&&!u,[ar.secondaryAntistock]:s==="Secondary"&&u,[ar.tertiary]:s==="Tertiary",[ar.primaryHovered]:s==="Primary"&&!a&&c.buttons.primary.hover&&!u,[ar.secondaryHovered]:s==="Secondary"&&!a&&c.buttons.secondary.hover&&!u,[ar.tertiaryHovered]:s==="Tertiary"&&!a&&c.buttons.tertiary.hover&&!u,[ar.isAntistock]:u})};if(s==="Special")return d.jsx("button",{...f,className:ar.special,...l?{dangerouslySetInnerHTML:l}:{children:h(t)}});const g=s.toLowerCase(),m=c.buttons[g],C=s==="Tertiary"?d.jsxs("div",{className:ar.content,children:[h(t),d.jsx(ie,{name:"ArrowRight",fill:"var(--text-tertiary)",width:20,height:20})]}):h(t);return d.jsx("button",{...f,style:{...o,textAlign:m.alignment},...l?{dangerouslySetInnerHTML:l}:{children:C}})},R8="_modal_1iz94_1",D8="_padding_1iz94_17",O8="_content_1iz94_21",M8="_close_1iz94_42",Za={modal:R8,padding:D8,content:O8,close:M8},cl=e=>{const{close:t,children:n,withAnimation:o=!0,hasPadding:i=!0}=e,{isOpen:a,setIsOpen:s}=$r(),l=()=>{s(!1),o?setTimeout(()=>{t(!1),s(!0)},300):(t(!1),s(!0))};return _.useEffect(()=>{const c=u=>{u.key==="Escape"&&l()};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c)}},[]),To.createPortal(d.jsx("div",{className:ge(Za.modal,{[Za.padding]:i}),onClick:l,children:o?d.jsx("div",{className:ge(Za.content,{[Za.close]:!a}),children:n}):d.jsx(d.Fragment,{children:n})}),document.body)},B8="_loader_1kbu3_1",F8="_loaderAntistock_1kbu3_18",U1={loader:B8,loaderAntistock:F8},An=e=>{const{isAntistock:t}=mt();return t?d.jsx("span",{className:U1.loaderAntistock,style:{width:"15px",height:"15px",borderWidth:"2px"}}):d.jsx("div",{className:U1.loader,...e})},H8="_container_6vcrl_1",j8="_wrapper_6vcrl_5",V1={container:H8,wrapper:j8};class U8{constructor(){Ti(this,"observer",null);Ti(this,"callbacks",new Map);Ti(this,"handleWindowResize",()=>{this.callbacks.forEach((t,n)=>{const o=n.getBoundingClientRect().width;t.forEach(i=>i(o))})});this.observer=new ResizeObserver(t=>{var n;for(const o of t){const i=o.contentRect.width,a=o.target;this.callbacks.has(a)&&((n=this.callbacks.get(a))==null||n.forEach(s=>s(i)))}}),window.addEventListener("resize",this.handleWindowResize)}observe(t,n){var i;if(!this.observer)return;this.callbacks.has(t)||(this.callbacks.set(t,[]),this.observer.observe(t)),(this.callbacks.get(t)||[]).includes(n)||(i=this.callbacks.get(t))==null||i.push(n)}unobserve(t,n){var o;if(!(!this.observer||!this.callbacks.has(t))){if(n){const i=this.callbacks.get(t)||[];this.callbacks.set(t,i.filter(a=>a!==n))}(o=this.callbacks.get(t))!=null&&o.length||(this.callbacks.delete(t),this.observer.unobserve(t))}}disconnect(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callbacks.clear(),window.removeEventListener("resize",this.handleWindowResize)}}const z1=new U8;function x0(e){const[t,n]=_.useState("desktop");return _.useEffect(()=>{const o=e.current;if(!o)return;const i=l=>l>=1081?"desktop":l>=720?"tablet":"mobile",a=l=>{const c=i(l);n(c)};z1.observe(o,a);const s=o.getBoundingClientRect().width;return a(s),()=>{z1.unobserve(o,a)}},[e]),t}const Xa=16,_0=({children:e,padding:t,style:n,notPadding:o=!1,maxWidth:i="var(--max-width-store)"})=>{const a=_.useRef(null),s=x0(a);return d.jsx("div",{className:V1.container,ref:a,style:n,children:d.jsx("div",{className:V1.wrapper,style:{maxWidth:i,paddingTop:s==="desktop"?t==null?void 0:t.top:o?0:Xa,paddingBottom:s==="desktop"?t==null?void 0:t.bottom:o?0:Xa,paddingLeft:s==="desktop"?t==null?void 0:t.left:o?0:Xa,paddingRight:s==="desktop"?t==null?void 0:t.right:o?0:Xa,...n},children:e(s)})})},V8="_wrapper_d9z4o_1",z8="_label_d9z4o_10",$8="_contentBorder_d9z4o_19",W8="_textarea_d9z4o_23",q8="_contentField_d9z4o_35",G8="_antistock_d9z4o_49",Y8="_length_d9z4o_58",Gr={wrapper:V8,label:z8,contentBorder:$8,textarea:W8,contentField:q8,antistock:G8,length:Y8},Z8=e=>{const{onChange:t,label:n,value:o,maxLength:i,placeholder:a="Type something...",type:s="text",required:l=!1}=e,[c,u]=_.useState(o.length),{themeSettings:h}=No(),{isAntistock:f}=mt();function g(m){return s==="number"?m.replace(/[^\d\n]+/g,""):m}return d.jsxs("div",{className:Gr.wrapper,children:[n&&d.jsxs("label",{className:Gr.label,htmlFor:n,style:{color:f?"var(--text-secondary)":void 0},children:[n,l&&d.jsx("span",{className:Gr.requiredStar,children:"*"})]}),d.jsx("textarea",{id:n,value:o,onChange:m=>{const C=g(m.target.value);u(C.length),t(C)},placeholder:a,className:ge(Gr.textarea,{[Gr.contentBorder]:h.inputs.border.active,[Gr.contentField]:h.inputs.field.active,[Gr.antistock]:f}),maxLength:i}),i&&d.jsxs("div",{className:Gr.length,children:[c,"/",i]})]})},X8="_wrapper_ty9h3_2",K8="_label_ty9h3_9",Q8="_top_ty9h3_17",J8="_select_ty9h3_23",eE="_borderFocused_ty9h3_42",tE="_input_ty9h3_49",nE="_icon_ty9h3_59",rE="_rotate_ty9h3_64",oE="_content_ty9h3_68",iE="_options_ty9h3_72",aE="_filteredOptions_ty9h3_93",sE="_open_ty9h3_97",lE="_option_ty9h3_72",cE="_focused_ty9h3_115",uE="_addon_ty9h3_119",dE="_value_ty9h3_130",hE="_postfix_ty9h3_135",fE="_leftAddon_ty9h3_139",Jt={wrapper:X8,label:K8,top:Q8,select:J8,borderFocused:eE,input:tE,icon:nE,rotate:rE,content:oE,options:iE,filteredOptions:aE,open:sE,option:lE,focused:cE,addon:uE,value:dE,postfix:hE,leftAddon:fE};function pE(e,t){_.useEffect(()=>{function n(o){!e.current||e.current.contains(o.target)||t(o)}return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[e,t])}const w0=e=>{var M,B;const{onChange:t,label:n,value:o,options:i,style:a,switcher:s,postfixs:l,leftAddonOptions:c}=e,[u,h]=_.useState(!1),[f,g]=_.useState(""),[m,C]=_.useState(null),[I,b]=_.useState(!1),S=_.useRef(null);pE(S,()=>h(!1));function y(w){g(""),t(w),h(!1),C(null)}function T(w,V){return w?w.length>V+3?`${w.slice(0,V)}...`:w:""}function k(w){if(!u){(w.key==="Enter"||w.key==="ArrowDown")&&h(!0);return}const V=E;w.key==="ArrowDown"&&(w.preventDefault(),C(H=>H===null||H===V.length-1?0:H+1)),w.key==="ArrowUp"&&(w.preventDefault(),C(H=>H===null||H===0?V.length-1:H-1)),w.key==="Enter"&&m!==null&&(w.preventDefault(),y(V[m])),w.key==="Escape"&&h(!1)}const A=_.useRef(null),P=_.useMemo(()=>new Wr(i,{threshold:.4,minMatchCharLength:2}),[i]),E=_.useMemo(()=>I&&f.trim()!==""?P.search(f).map(w=>w.item):i,[f,i,I,P]);return d.jsxs("div",{className:Jt.wrapper,style:{...a},children:[n&&d.jsxs("div",{className:Jt.top,children:[d.jsx("label",{className:Jt.label,htmlFor:n,children:n}),s&&d.jsx(vr,{current:s.value,onChange:s.onChange})]}),d.jsxs("label",{className:Jt.content,ref:S,children:[d.jsxs("div",{className:ge(Jt.select,{[Jt.borderFocused]:u}),onKeyDown:k,onClick:w=>{w.stopPropagation(),h(V=>!V),b(!1)},ref:A,tabIndex:0,children:[c&&c.length>0&&d.jsx("div",{className:Jt.addon,children:(M=c.find(w=>w.value===o))==null?void 0:M.addon}),d.jsx("div",{className:Jt.input,id:"md",children:T(o,15)}),d.jsx("div",{className:ge(Jt.icon,{[Jt.rotate]:u}),onClick:w=>{w.stopPropagation(),h(V=>!V)},children:d.jsx(ie,{name:"CaretDown",width:16,height:16,fill:"var(--text-primary)"})})]}),d.jsxs("div",{className:ge(Jt.options,{[Jt.open]:u}),style:{top:((B=A.current)==null?void 0:B.clientHeight)+10},children:[i.length>6&&d.jsx(Ro,{type:"text",value:f,placeholder:"Search...",onChange:w=>{g(w),b(!0)},isSearch:!0}),d.jsxs("div",{className:Jt.filteredOptions,children:[E.map((w,V)=>{var H;return d.jsxs("div",{className:ge(Jt.option,{[Jt.focused]:V===m}),onClick:()=>{y(w),h(!1)},id:"md",children:[c&&c.length>0&&d.jsx("div",{className:Jt.leftAddon,children:(H=c.find(X=>X.value===w))==null?void 0:H.addon}),d.jsx("span",{className:Jt.value,id:"md",children:T(w,20)}),l&&d.jsx("span",{className:Jt.postfix,id:"md",children:l[V]})]},w)}),E.length===0&&d.jsx("div",{children:"No results found."})]})]})]})]})},mE="_wrapper_2vleg_1",gE="_label_2vleg_9",IE="_options_2vleg_17",CE="_radioLabel_2vleg_23",bE="_radio_2vleg_23",SE="_custom_2vleg_38",yE="_option_2vleg_17",mo={wrapper:mE,label:gE,options:IE,radioLabel:CE,radio:bE,custom:SE,option:yE},EE=e=>{const{defaultValue:t,options:n,onChange:o,label:i,flexDirection:a="row"}=e,[s,l]=_.useState(t),c=u=>{const h=u.target.value;l(h),o(h)};return d.jsxs("div",{className:mo.wrapper,children:[d.jsx("span",{className:mo.label,children:i}),d.jsx("div",{className:mo.options,style:{flexDirection:a},children:n.map(u=>d.jsxs("label",{className:mo.radioLabel,children:[d.jsx("input",{type:"radio",value:u.value,checked:s===u.value,onChange:c,className:mo.radio}),d.jsx("span",{className:mo.custom}),d.jsx("span",{className:mo.option,children:u.label})]},u.value))})]})},TE="_content_eonwv_1",xE="_main_eonwv_12",_E="_block_eonwv_16",wE="_active_eonwv_22",vE="_name_eonwv_32",AE="_addSection_eonwv_109",kE="_addSectionTop_eonwv_117",Yr={content:TE,main:xE,block:_E,active:wE,name:vE,addSection:AE,addSectionTop:kE},LE="_sidebar_xhqpt_1",NE="_content_xhqpt_14",PE="_button_xhqpt_24",RE="_moveButton_xhqpt_40",DE="_deleteButton_xhqpt_49",br={sidebar:LE,content:NE,button:PE,moveButton:RE,deleteButton:DE},OE=()=>{var A;const{activeBlock:e,setActiveBlock:t}=Xs(),{blocks:n,removeBlock:o,moveBlock:i,duplicateBlock:a,setCurrentBlock:s}=Hr(),{currentPage:l,pages:c}=zr(),{setTitle:u,setDescription:h,setOnConfirm:f}=Qf(),{setActiveBlock:g}=Lo(),m=(A=c==null?void 0:c[l])==null?void 0:A.path,C=m?n[m]:null,I=(C==null?void 0:C.order)||[],b=I.indexOf(e.id),S=P=>{P.stopPropagation(),b>0&&m&&(i(m,b,b-1),t({id:e.id,neededScroll:!0}),setTimeout(()=>{t({id:e.id,neededScroll:!1})},100))},y=P=>{P.stopPropagation(),b<I.length-1&&m&&(i(m,b,b+1),t({id:e.id,neededScroll:!0}),setTimeout(()=>{t({id:e.id,neededScroll:!1})},100))},T=P=>{P.stopPropagation(),m&&a(m,e.id)},k=()=>{m&&(o(m,e.id),s(null),g(null),t({id:null,neededScroll:!1}))};return d.jsx("div",{className:br.sidebar,children:d.jsxs("div",{className:br.content,children:[d.jsx("button",{onClick:S,className:ge(br.button,br.moveButton),disabled:b===0,children:d.jsx(ie,{name:"ArrowUp"})}),d.jsx("button",{onClick:y,className:ge(br.button,br.moveButton),disabled:b===I.length-1,children:d.jsx(ie,{name:"ArrowDown"})}),d.jsx("button",{onClick:T,className:ge(br.button,br.moveButton),children:d.jsx(ie,{name:"Copy"})}),d.jsx("button",{className:ge(br.button,br.deleteButton),onClick:P=>{P.stopPropagation(),u("Remove Block"),h(`Are you sure you want to delete ${(C==null?void 0:C.data[e.id].name)||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),f(k)},children:d.jsx(ie,{name:"Trash",hoverable:!0,fill:"#C12A2A"})})]})})};function $i(e,t){if(!t||!t[e])return"unknown name";const n=new t[e];return!n.blockSettings||!n.blockSettings.displayName?"unknown name":n.blockSettings.displayName}const ME=_.memo(({scrollableRef:e})=>{const{setActiveBlock:t,activeBlock:n,zoomLevel:o}=Xs(),{blocks:i,sourceBlocks:a}=Lo(),{blocks:s,setCurrentBlock:l,currentBlock:c,setPositionBlock:u,announcement:h}=Hr(),{settings:f}=ya(),{currentPage:g,pages:m,pageContext:C}=zr(),{activeBlock:I,setActiveBlock:b}=No(),{setError:S}=Kf(),{setActiveBlock:y}=Lo(),T=_.useRef(n.id),k=_.useRef({});_.useEffect(()=>{if(n.id&&n.neededScroll&&k.current[n.id]){const E=k.current[n.id];if(E&&e.current){const M=E.offsetTop;e.current.scrollTo({top:M-30,behavior:"smooth"})}}},[n,e]);const A=Vr();_.useEffect(()=>{T.current=n.id},[n.id]);const P=E=>{if(!E||!E.name)return S({message:"Block or block.name is undefined.",failedSettings:!1,failedThemeSettings:!1,failedPageIds:m&&m[g].id?[m[g].id]:[]}),d.jsx(Wc,{error:"Block or block.name is undefined."});if(!i||!i[E.name])return S({message:'Block "${block.name}" does not exist in blocks.',failedSettings:!1,failedThemeSettings:!1,failedPageIds:m&&m[g].id?[m[g].id]:[]}),d.jsx(Wc,{error:`Block "${E.name}" does not exist in blocks.`});const M=new i[E.name];return E.value&&Object.assign(M,E.value),M.renderBlock(f,C)};return d.jsxs("div",{onClick:E=>{E.stopPropagation()},className:Yr.content,style:{width:"100%",height:"100%",zoom:`${o}`},ref:e,children:[h&&d.jsx(C0,{}),d.jsx(I0,{}),d.jsx("div",{className:Yr.main,children:m&&m[g]&&s[m[g].path]&&s[m[g].path].data&&s[m[g].path].order.map(E=>d.jsxs("div",{ref:M=>k.current[E]=M,onClick:M=>{M.stopPropagation(),y(null),I&&b(null),t({id:E,neededScroll:!0}),setTimeout(()=>{t({id:E,neededScroll:!1})},100),l(null),c?setTimeout(()=>{l(n.id)},100):l(n.id)},onMouseEnter:M=>{M.stopPropagation(),n.neededScroll||t({id:E,neededScroll:!1})},onMouseLeave:M=>{M.stopPropagation(),n.neededScroll||t({id:null,neededScroll:!1})},className:ge(Yr.block),children:[(n.id===E||c===E)&&d.jsx("div",{className:Yr.active}),(n.id===E||c===E)&&d.jsx("div",{className:Yr.name,children:$i(s[m[g].path].data[E].name,a)}),(n.id===E||c===E)&&$i(s[m[g].path].data[E].name,a)!=="unknown name"&&d.jsx(OE,{}),(n.id===E||c===E)&&$i(s[m[g].path].data[E].name,a)!=="unknown name"&&d.jsx("div",{className:Yr.addSection,children:d.jsx(ti,{onClick:M=>{M.stopPropagation(),u(E,!0),l(null),t({id:null,neededScroll:!1}),y(null),A("/admin/builder/add")},children:"Add Section"})}),(n.id===E||c===E)&&$i(s[m[g].path].data[E].name,a)!=="unknown name"&&d.jsx("div",{className:ge(Yr.addSection,Yr.addSectionTop),children:d.jsx(ti,{onClick:M=>{M.stopPropagation(),u(E,!1),l(null),t({id:null,neededScroll:!1}),y(null),A("/admin/builder/add")},children:"Add Section"})}),i&&d.jsx(m0,{render:P,block:s[m[g].path].data[E]})]},E))}),d.jsx(g0,{})]})}),BE="_statItem_fzeec_1",FE="_content_fzeec_44",HE="_withChildren_fzeec_50",jE="_info_fzeec_56",UE="_iconWrapper_fzeec_68",VE="_text_fzeec_78",zE="_title_fzeec_84",$E="_value_fzeec_88",WE="_emptyImage_fzeec_94",qE="_image_fzeec_11",GE="_imageTitle_fzeec_112",YE="_emptyImageText_fzeec_122",ZE="_hoverable_fzeec_147",Wt={statItem:BE,content:FE,withChildren:HE,info:jE,iconWrapper:UE,text:VE,title:zE,value:$E,emptyImage:WE,image:qE,imageTitle:GE,emptyImageText:YE,hoverable:ZE},Zn=({iconName:e,title:t,value:n,image:o,imageName:i,children:a,className:s,logo:l,customLogo:c,productSlug:u})=>{const h=Vr();return d.jsxs("div",{className:`${Wt.statItem} ${s}`,children:[o&&o!=="empty"&&d.jsxs("div",{style:{position:"relative"},onClick:()=>{u&&h(`/${u}`)},children:[d.jsx("div",{style:{background:"#000000"},children:d.jsx("img",{src:o,alt:i,className:ge(Wt.image,Wt.emptyImage,{[Wt.hoverable]:u})})}),d.jsx("div",{className:Wt.emptyImageText,children:d.jsx("div",{className:ge(Wt.title,Wt.imageTitle),id:"h5",children:i})})]}),o==="empty"&&d.jsx("div",{style:{background:"#000000"},children:d.jsxs("div",{className:ge(Wt.emptyImage,{[Wt.hoverable]:u}),onClick:()=>{u&&h(`/${u}`)},children:[d.jsx(ie,{name:"Image",width:64,height:64,fill:"var(--text-secondary)"}),d.jsx("div",{className:Wt.emptyImageText,children:d.jsx("div",{className:Wt.title,id:"h5",children:i||"No Product"})})]})}),d.jsxs("div",{className:`${Wt.content} ${a?Wt.withChildren:""}`,children:[d.jsxs("div",{className:Wt.info,children:[c?d.jsx("div",{style:{color:"var(--text-action)"},children:c}):l?d.jsx("div",{className:Wt.iconWrapper,children:d.jsx("img",{src:l,width:28,height:28,style:{objectFit:"contain"}})}):d.jsx(ie,{name:e||"File",className:Wt.iconWrapper,width:28,height:28,fill:"var(--text-action)"}),d.jsxs("div",{className:Wt.text,children:[d.jsx("div",{className:Wt.title,id:"h5",children:t}),d.jsx("div",{className:Wt.value,id:"h5-bold",children:n})]})]}),a]})]})},XE="_card_8m277_2",KE="_mobile_8m277_15",QE="_email_8m277_19",JE="_balance_8m277_25",eT="_sidebar_8m277_32",tT="_sidebarAntistock_8m277_33",nT="_navList_8m277_68",rT="_navListAntistock_8m277_86",oT="_navItem_8m277_91",iT="_antistockNavItem_8m277_92",aT="_activeNavItem_8m277_116",sT="_antistockActiveNavItem_8m277_121",lT="_antistockInactiveNavItem_8m277_139",cT="_inactiveNavItem_8m277_140",uT="_logoutNavItem_8m277_150",dT="_logoutNavItemAntistock_8m277_159",hT="_logoutNavItemContentAntistock_8m277_173",fT="_iconWrapper_8m277_185",pT="_skeleton_8m277_190",yt={card:XE,mobile:KE,email:QE,balance:JE,sidebar:eT,sidebarAntistock:tT,navList:nT,navListAntistock:rT,navItem:oT,antistockNavItem:iT,activeNavItem:aT,antistockActiveNavItem:sT,antistockInactiveNavItem:lT,inactiveNavItem:cT,logoutNavItem:uT,logoutNavItemAntistock:dT,logoutNavItemContentAntistock:hT,iconWrapper:fT,skeleton:pT},mT=({email:e,balance:t,adaptiveStyles:n})=>d.jsxs("div",{className:ge(yt.card,{[yt.mobile]:n!=="desktop"}),children:[d.jsx("div",{className:yt.email,id:"h5",children:e}),d.jsxs("div",{className:yt.balance,id:"md",children:["Balance: ",t]})]}),gT=[[Ut.Home,"House"],[Ut.Orders,"CurrencyCircleDollar"],[Ut.Rewards,"Medal"],[Ut.Balance,"Wallet"],[Ut.Subscriptions,"CalendarCheck"],[Ut.Tickets,"Question"]],IT=[[ji.Home,"House"],[ji.Orders,"CurrencyCircleDollar"],[ji.Balance,"Wallet"],[ji.Tickets,"Question"]],$1=({children:e,className:t="",onClick:n})=>{const{isAntistock:o}=mt();return d.jsx("button",{type:"button",className:ge(o?yt.antistockNavItem:yt.navItem,t),onClick:n,children:e})},CT=({adaptiveStyles:e})=>{const{route:t,setRoute:n}=rr(),{isAntistock:o}=mt(),i=o?IT:gT;return d.jsxs("div",{className:ge(yt.navList,{[yt.mobile]:e!=="desktop",[yt.navListAntistock]:o}),children:[i.map(([a,s])=>{const l=a===t;return d.jsxs($1,{onClick:()=>n(a),className:ge(l?o?yt.antistockActiveNavItem:yt.activeNavItem:o?yt.antistockInactiveNavItem:yt.inactiveNavItem),children:[o?null:d.jsx("div",{className:yt.iconWrapper,children:d.jsx(ie,{name:s})}),d.jsx("div",{children:a})]},a)}),d.jsx($1,{className:ge(yt.logoutNavItem,{[yt.logoutNavItemAntistock]:o}),onClick:()=>{o||Gc()},children:o?d.jsxs("div",{className:ge({[yt.logoutNavItemContentAntistock]:o}),onClick:()=>{Gc()},children:[d.jsx("div",{className:yt.iconWrapper,children:d.jsx(ie,{name:"SignOut"})}),d.jsx("div",{children:"Sign Out"})]}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:yt.iconWrapper,children:d.jsx(ie,{name:"SignOut"})}),d.jsx("div",{children:"Sign Out"})]})})]})};var Ge=(e=>(e.New="NEW",e.Pending="PENDING",e.Completed="COMPLETED",e.Cancelled="CANCELLED",e.Expired="EXPIRED",e.FullDeliveryFailure="FULL_DELIVERY_FAILURE",e.PartiallyDelivered="PARTIALLY_DELIVERED",e.Refunded="REFUNDED",e.Failed="FAILED",e))(Ge||{}),at=(e=>(e.Text="TEXT",e.Serial="SERIALS",e.Ebook="EBOOK",e.Link="LINK",e.Download="DOWNLOAD",e.Discord="DISCORD",e.Custom="CUSTOM",e))(at||{}),Or=(e=>(e.RIAL="RIAL",e.AWAITING_PAYMENT="AWAITING_PAYMENT",e.ACTIVE="ACTIVE",e.PAST_DUE="PAST_DUE",e.CANCELLED="CANCELLED",e.EXPIRED="EXPIRED",e.CHANGED_GATEWAY="CHANGED_GATEWAY",e.REPLACED="REPLACED",e))(Or||{});const ka=async e=>(await b0(e)).data,v0=async()=>{var n;const t=(await ky()).data;if(t.isEnabled){const o=(n=t==null?void 0:t.topUpSettings)==null?void 0:n.gateways;o&&ka(o)}return t},qu=async()=>{const t=(await Ay()).data;return{amount:t.realBalance+t.manualBalance,currency:t.currency}};var Wi=(e=>(e.ADDED="ADDED",e.REMOVED="REMOVED",e))(Wi||{}),it=(e=>(e.NotPaid="NOT_PAID",e.Pending="PENDING",e.Paid="PAID",e.Expired="EXPIRED",e.Cancelled="CANCELLED",e))(it||{}),fa=(e=>(e.Balance="BALANCE",e.Product="PRODUCT",e))(fa||{}),$n=(e=>(e.Spend="SPEND_AMOUNT",e.Order="ORDER_COUNT",e.Referral="REFER_FRIEND",e.Review="LEAVE_REVIEW",e))($n||{});const bT=async()=>(await vy()).data;/*! *****************************************************************************
|
|
74
74
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
75
75
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
76
76
|
this file except in compliance with the License. You may obtain a copy of the
|