@commandkit/devtools 1.2.0-rc.10 → 1.2.0-rc.11
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/COPYING.md +684 -0
- package/package.json +4 -3
- package/ui/assets/{commands-IE8coIjN.js → commands-BYwnvG1y.js} +1 -1
- package/ui/assets/{events-mcYM4bcV.js → events-BmjTzG1Z.js} +1 -1
- package/ui/assets/{feature-flags-BV5G4Fku.js → feature-flags-BJ88OHjN.js} +1 -1
- package/ui/assets/{guilds-DxKiii_g.js → guilds-DkAmhNQJ.js} +1 -1
- package/ui/assets/{index-yV0hKx_G.js → index-8z-A9hKc.js} +1 -1
- package/ui/assets/index-Bbq0nFeq.css +1 -0
- package/ui/assets/{index-CyODypjh.js → index-C4juxjoK.js} +1 -1
- package/ui/assets/{plugins-2z5p-Tu8.js → plugins-CMkwPWHf.js} +1 -1
- package/ui/index.html +2 -2
- package/LICENSE +0 -5
- package/ui/assets/index-B_iMxRPI.css +0 -1
|
@@ -172,4 +172,4 @@ For more information, see https://radix-ui.com/primitives/docs/components/${a.do
|
|
|
172
172
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(a){return a instanceof this?a:new this(a)}static concat(a,...r){const s=new this(a);return r.forEach(l=>s.set(l)),s}static accessor(a){const s=(this[Vy]=this[Vy]={accessors:{}}).accessors,l=this.prototype;function c(f){const h=Gs(f);s[h]||(nM(l,f),s[h]=!0)}return F.isArray(a)?a.forEach(c):c(a),this}};Ue.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);F.reduceDescriptors(Ue.prototype,({value:e},a)=>{let r=a[0].toUpperCase()+a.slice(1);return{get:()=>e,set(s){this[r]=s}}});F.freezeMethods(Ue);function hd(e,a){const r=this||fo,s=a||r,l=Ue.from(s.headers);let c=s.data;return F.forEach(e,function(h){c=h.call(r,c,l.normalize(),a?a.status:void 0)}),l.normalize(),c}function B1(e){return!!(e&&e.__CANCEL__)}function Ui(e,a,r){xt.call(this,e??"canceled",xt.ERR_CANCELED,a,r),this.name="CanceledError"}F.inherits(Ui,xt,{__CANCEL__:!0});function H1(e,a,r){const s=r.config.validateStatus;!r.status||!s||s(r.status)?e(r):a(new xt("Request failed with status code "+r.status,[xt.ERR_BAD_REQUEST,xt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function aM(e){const a=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return a&&a[1]||""}function rM(e,a){e=e||10;const r=new Array(e),s=new Array(e);let l=0,c=0,f;return a=a!==void 0?a:1e3,function(p){const m=Date.now(),v=s[c];f||(f=m),r[l]=p,s[l]=m;let g=c,y=0;for(;g!==l;)y+=r[g++],g=g%e;if(l=(l+1)%e,l===c&&(c=(c+1)%e),m-f<a)return;const x=v&&m-v;return x?Math.round(y*1e3/x):void 0}}function iM(e,a){let r=0,s=1e3/a,l,c;const f=(m,v=Date.now())=>{r=v,l=null,c&&(clearTimeout(c),c=null),e(...m)};return[(...m)=>{const v=Date.now(),g=v-r;g>=s?f(m,v):(l=m,c||(c=setTimeout(()=>{c=null,f(l)},s-g)))},()=>l&&f(l)]}const cc=(e,a,r=3)=>{let s=0;const l=rM(50,250);return iM(c=>{const f=c.loaded,h=c.lengthComputable?c.total:void 0,p=f-s,m=l(p),v=f<=h;s=f;const g={loaded:f,total:h,progress:h?f/h:void 0,bytes:p,rate:m||void 0,estimated:m&&h&&v?(h-f)/m:void 0,event:c,lengthComputable:h!=null,[a?"download":"upload"]:!0};e(g)},r)},Gy=(e,a)=>{const r=e!=null;return[s=>a[0]({lengthComputable:r,total:e,loaded:s}),a[1]]},Fy=e=>(...a)=>F.asap(()=>e(...a)),sM=_e.hasStandardBrowserEnv?((e,a)=>r=>(r=new URL(r,_e.origin),e.protocol===r.protocol&&e.host===r.host&&(a||e.port===r.port)))(new URL(_e.origin),_e.navigator&&/(msie|trident)/i.test(_e.navigator.userAgent)):()=>!0,oM=_e.hasStandardBrowserEnv?{write(e,a,r,s,l,c){const f=[e+"="+encodeURIComponent(a)];F.isNumber(r)&&f.push("expires="+new Date(r).toGMTString()),F.isString(s)&&f.push("path="+s),F.isString(l)&&f.push("domain="+l),c===!0&&f.push("secure"),document.cookie=f.join("; ")},read(e){const a=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return a?decodeURIComponent(a[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function lM(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function cM(e,a){return a?e.replace(/\/?\/$/,"")+"/"+a.replace(/^\/+/,""):e}function q1(e,a,r){let s=!lM(a);return e&&(s||r==!1)?cM(e,a):a}const Yy=e=>e instanceof Ue?{...e}:e;function Sr(e,a){a=a||{};const r={};function s(m,v,g,y){return F.isPlainObject(m)&&F.isPlainObject(v)?F.merge.call({caseless:y},m,v):F.isPlainObject(v)?F.merge({},v):F.isArray(v)?v.slice():v}function l(m,v,g,y){if(F.isUndefined(v)){if(!F.isUndefined(m))return s(void 0,m,g,y)}else return s(m,v,g,y)}function c(m,v){if(!F.isUndefined(v))return s(void 0,v)}function f(m,v){if(F.isUndefined(v)){if(!F.isUndefined(m))return s(void 0,m)}else return s(void 0,v)}function h(m,v,g){if(g in a)return s(m,v);if(g in e)return s(void 0,m)}const p={url:c,method:c,data:c,baseURL:f,transformRequest:f,transformResponse:f,paramsSerializer:f,timeout:f,timeoutMessage:f,withCredentials:f,withXSRFToken:f,adapter:f,responseType:f,xsrfCookieName:f,xsrfHeaderName:f,onUploadProgress:f,onDownloadProgress:f,decompress:f,maxContentLength:f,maxBodyLength:f,beforeRedirect:f,transport:f,httpAgent:f,httpsAgent:f,cancelToken:f,socketPath:f,responseEncoding:f,validateStatus:h,headers:(m,v,g)=>l(Yy(m),Yy(v),g,!0)};return F.forEach(Object.keys({...e,...a}),function(v){const g=p[v]||l,y=g(e[v],a[v],v);F.isUndefined(y)&&g!==h||(r[v]=y)}),r}const V1=e=>{const a=Sr({},e);let{data:r,withXSRFToken:s,xsrfHeaderName:l,xsrfCookieName:c,headers:f,auth:h}=a;if(a.headers=f=Ue.from(f),a.url=P1(q1(a.baseURL,a.url,a.allowAbsoluteUrls),e.params,e.paramsSerializer),h&&f.set("Authorization","Basic "+btoa((h.username||"")+":"+(h.password?unescape(encodeURIComponent(h.password)):""))),F.isFormData(r)){if(_e.hasStandardBrowserEnv||_e.hasStandardBrowserWebWorkerEnv)f.setContentType(void 0);else if(F.isFunction(r.getHeaders)){const p=r.getHeaders(),m=["content-type","content-length"];Object.entries(p).forEach(([v,g])=>{m.includes(v.toLowerCase())&&f.set(v,g)})}}if(_e.hasStandardBrowserEnv&&(s&&F.isFunction(s)&&(s=s(a)),s||s!==!1&&sM(a.url))){const p=l&&c&&oM.read(c);p&&f.set(l,p)}return a},uM=typeof XMLHttpRequest<"u",fM=uM&&function(e){return new Promise(function(r,s){const l=V1(e);let c=l.data;const f=Ue.from(l.headers).normalize();let{responseType:h,onUploadProgress:p,onDownloadProgress:m}=l,v,g,y,x,S;function w(){x&&x(),S&&S(),l.cancelToken&&l.cancelToken.unsubscribe(v),l.signal&&l.signal.removeEventListener("abort",v)}let T=new XMLHttpRequest;T.open(l.method.toUpperCase(),l.url,!0),T.timeout=l.timeout;function C(){if(!T)return;const N=Ue.from("getAllResponseHeaders"in T&&T.getAllResponseHeaders()),L={data:!h||h==="text"||h==="json"?T.responseText:T.response,status:T.status,statusText:T.statusText,headers:N,config:e,request:T};H1(function(V){r(V),w()},function(V){s(V),w()},L),T=null}"onloadend"in T?T.onloadend=C:T.onreadystatechange=function(){!T||T.readyState!==4||T.status===0&&!(T.responseURL&&T.responseURL.indexOf("file:")===0)||setTimeout(C)},T.onabort=function(){T&&(s(new xt("Request aborted",xt.ECONNABORTED,e,T)),T=null)},T.onerror=function(P){const L=P&&P.message?P.message:"Network Error",K=new xt(L,xt.ERR_NETWORK,e,T);K.event=P||null,s(K),T=null},T.ontimeout=function(){let P=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded";const L=l.transitional||U1;l.timeoutErrorMessage&&(P=l.timeoutErrorMessage),s(new xt(P,L.clarifyTimeoutError?xt.ETIMEDOUT:xt.ECONNABORTED,e,T)),T=null},c===void 0&&f.setContentType(null),"setRequestHeader"in T&&F.forEach(f.toJSON(),function(P,L){T.setRequestHeader(L,P)}),F.isUndefined(l.withCredentials)||(T.withCredentials=!!l.withCredentials),h&&h!=="json"&&(T.responseType=l.responseType),m&&([y,S]=cc(m,!0),T.addEventListener("progress",y)),p&&T.upload&&([g,x]=cc(p),T.upload.addEventListener("progress",g),T.upload.addEventListener("loadend",x)),(l.cancelToken||l.signal)&&(v=N=>{T&&(s(!N||N.type?new Ui(null,e,T):N),T.abort(),T=null)},l.cancelToken&&l.cancelToken.subscribe(v),l.signal&&(l.signal.aborted?v():l.signal.addEventListener("abort",v)));const z=aM(l.url);if(z&&_e.protocols.indexOf(z)===-1){s(new xt("Unsupported protocol "+z+":",xt.ERR_BAD_REQUEST,e));return}T.send(c||null)})},dM=(e,a)=>{const{length:r}=e=e?e.filter(Boolean):[];if(a||r){let s=new AbortController,l;const c=function(m){if(!l){l=!0,h();const v=m instanceof Error?m:this.reason;s.abort(v instanceof xt?v:new Ui(v instanceof Error?v.message:v))}};let f=a&&setTimeout(()=>{f=null,c(new xt(`timeout ${a} of ms exceeded`,xt.ETIMEDOUT))},a);const h=()=>{e&&(f&&clearTimeout(f),f=null,e.forEach(m=>{m.unsubscribe?m.unsubscribe(c):m.removeEventListener("abort",c)}),e=null)};e.forEach(m=>m.addEventListener("abort",c));const{signal:p}=s;return p.unsubscribe=()=>F.asap(h),p}},hM=function*(e,a){let r=e.byteLength;if(r<a){yield e;return}let s=0,l;for(;s<r;)l=s+a,yield e.slice(s,l),s=l},mM=async function*(e,a){for await(const r of pM(e))yield*hM(r,a)},pM=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const a=e.getReader();try{for(;;){const{done:r,value:s}=await a.read();if(r)break;yield s}}finally{await a.cancel()}},Qy=(e,a,r,s)=>{const l=mM(e,a);let c=0,f,h=p=>{f||(f=!0,s&&s(p))};return new ReadableStream({async pull(p){try{const{done:m,value:v}=await l.next();if(m){h(),p.close();return}let g=v.byteLength;if(r){let y=c+=g;r(y)}p.enqueue(new Uint8Array(v))}catch(m){throw h(m),m}},cancel(p){return h(p),l.return()}},{highWaterMark:2})},Ky=64*1024,{isFunction:Bl}=F,G1=(({fetch:e,Request:a,Response:r})=>({fetch:e,Request:a,Response:r}))(F.global),{ReadableStream:Xy,TextEncoder:$y}=F.global,Zy=(e,...a)=>{try{return!!e(...a)}catch{return!1}},gM=e=>{const{fetch:a,Request:r,Response:s}=Object.assign({},G1,e),l=Bl(a),c=Bl(r),f=Bl(s);if(!l)return!1;const h=l&&Bl(Xy),p=l&&(typeof $y=="function"?(S=>w=>S.encode(w))(new $y):async S=>new Uint8Array(await new r(S).arrayBuffer())),m=c&&h&&Zy(()=>{let S=!1;const w=new r(_e.origin,{body:new Xy,method:"POST",get duplex(){return S=!0,"half"}}).headers.has("Content-Type");return S&&!w}),v=f&&h&&Zy(()=>F.isReadableStream(new s("").body)),g={stream:v&&(S=>S.body)};l&&["text","arrayBuffer","blob","formData","stream"].forEach(S=>{!g[S]&&(g[S]=(w,T)=>{let C=w&&w[S];if(C)return C.call(w);throw new xt(`Response type '${S}' is not supported`,xt.ERR_NOT_SUPPORT,T)})});const y=async S=>{if(S==null)return 0;if(F.isBlob(S))return S.size;if(F.isSpecCompliantForm(S))return(await new r(_e.origin,{method:"POST",body:S}).arrayBuffer()).byteLength;if(F.isArrayBufferView(S)||F.isArrayBuffer(S))return S.byteLength;if(F.isURLSearchParams(S)&&(S=S+""),F.isString(S))return(await p(S)).byteLength},x=async(S,w)=>{const T=F.toFiniteNumber(S.getContentLength());return T??y(w)};return async S=>{let{url:w,method:T,data:C,signal:z,cancelToken:N,timeout:P,onDownloadProgress:L,onUploadProgress:K,responseType:V,headers:G,withCredentials:et="same-origin",fetchOptions:W}=V1(S);V=V?(V+"").toLowerCase():"text";let at=dM([z,N&&N.toAbortSignal()],P),rt=null;const ft=at&&at.unsubscribe&&(()=>{at.unsubscribe()});let mt;try{if(K&&m&&T!=="get"&&T!=="head"&&(mt=await x(G,C))!==0){let O=new r(w,{method:"POST",body:C,duplex:"half"}),X;if(F.isFormData(C)&&(X=O.headers.get("content-type"))&&G.setContentType(X),O.body){const[nt,Q]=Gy(mt,cc(Fy(K)));C=Qy(O.body,Ky,nt,Q)}}F.isString(et)||(et=et?"include":"omit");const dt=c&&"credentials"in r.prototype,D={...W,signal:at,method:T.toUpperCase(),headers:G.normalize().toJSON(),body:C,duplex:"half",credentials:dt?et:void 0};rt=c&&new r(w,D);let Y=await(c?a(rt,W):a(w,D));const q=v&&(V==="stream"||V==="response");if(v&&(L||q&&ft)){const O={};["status","statusText","headers"].forEach(tt=>{O[tt]=Y[tt]});const X=F.toFiniteNumber(Y.headers.get("content-length")),[nt,Q]=L&&Gy(X,cc(Fy(L),!0))||[];Y=new s(Qy(Y.body,Ky,nt,()=>{Q&&Q(),ft&&ft()}),O)}V=V||"text";let ht=await g[F.findKey(g,V)||"text"](Y,S);return!q&&ft&&ft(),await new Promise((O,X)=>{H1(O,X,{data:ht,headers:Ue.from(Y.headers),status:Y.status,statusText:Y.statusText,config:S,request:rt})})}catch(dt){throw ft&&ft(),dt&&dt.name==="TypeError"&&/Load failed|fetch/i.test(dt.message)?Object.assign(new xt("Network Error",xt.ERR_NETWORK,S,rt),{cause:dt.cause||dt}):xt.from(dt,dt&&dt.code,S,rt)}}},vM=new Map,F1=e=>{let a=F.merge.call({skipUndefined:!0},G1,e?e.env:null);const{fetch:r,Request:s,Response:l}=a,c=[s,l,r];let f=c.length,h=f,p,m,v=vM;for(;h--;)p=c[h],m=v.get(p),m===void 0&&v.set(p,m=h?new Map:gM(a)),v=m;return m};F1();const kd={http:zA,xhr:fM,fetch:{get:F1}};F.forEach(kd,(e,a)=>{if(e){try{Object.defineProperty(e,"name",{value:a})}catch{}Object.defineProperty(e,"adapterName",{value:a})}});const Iy=e=>`- ${e}`,yM=e=>F.isFunction(e)||e===null||e===!1,Y1={getAdapter:(e,a)=>{e=F.isArray(e)?e:[e];const{length:r}=e;let s,l;const c={};for(let f=0;f<r;f++){s=e[f];let h;if(l=s,!yM(s)&&(l=kd[(h=String(s)).toLowerCase()],l===void 0))throw new xt(`Unknown adapter '${h}'`);if(l&&(F.isFunction(l)||(l=l.get(a))))break;c[h||"#"+f]=l}if(!l){const f=Object.entries(c).map(([p,m])=>`adapter ${p} `+(m===!1?"is not supported by the environment":"is not available in the build"));let h=r?f.length>1?`since :
|
|
173
173
|
`+f.map(Iy).join(`
|
|
174
174
|
`):" "+Iy(f[0]):"as no adapter specified";throw new xt("There is no suitable adapter to dispatch the request "+h,"ERR_NOT_SUPPORT")}return l},adapters:kd};function md(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ui(null,e)}function Wy(e){return md(e),e.headers=Ue.from(e.headers),e.data=hd.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Y1.getAdapter(e.adapter||fo.adapter,e)(e).then(function(s){return md(e),s.data=hd.call(e,e.transformResponse,s),s.headers=Ue.from(s.headers),s},function(s){return B1(s)||(md(e),s&&s.response&&(s.response.data=hd.call(e,e.transformResponse,s.response),s.response.headers=Ue.from(s.response.headers))),Promise.reject(s)})}const Q1="1.12.0",Oc={};["object","boolean","number","function","string","symbol"].forEach((e,a)=>{Oc[e]=function(s){return typeof s===e||"a"+(a<1?"n ":" ")+e}});const Jy={};Oc.transitional=function(a,r,s){function l(c,f){return"[Axios v"+Q1+"] Transitional option '"+c+"'"+f+(s?". "+s:"")}return(c,f,h)=>{if(a===!1)throw new xt(l(f," has been removed"+(r?" in "+r:"")),xt.ERR_DEPRECATED);return r&&!Jy[f]&&(Jy[f]=!0,console.warn(l(f," has been deprecated since v"+r+" and will be removed in the near future"))),a?a(c,f,h):!0}};Oc.spelling=function(a){return(r,s)=>(console.warn(`${s} is likely a misspelling of ${a}`),!0)};function bM(e,a,r){if(typeof e!="object")throw new xt("options must be an object",xt.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let l=s.length;for(;l-- >0;){const c=s[l],f=a[c];if(f){const h=e[c],p=h===void 0||f(h,c,e);if(p!==!0)throw new xt("option "+c+" must be "+p,xt.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new xt("Unknown option "+c,xt.ERR_BAD_OPTION)}}const $l={assertOptions:bM,validators:Oc},An=$l.validators;let mr=class{constructor(a){this.defaults=a||{},this.interceptors={request:new qy,response:new qy}}async request(a,r){try{return await this._request(a,r)}catch(s){if(s instanceof Error){let l={};Error.captureStackTrace?Error.captureStackTrace(l):l=new Error;const c=l.stack?l.stack.replace(/^.+\n/,""):"";try{s.stack?c&&!String(s.stack).endsWith(c.replace(/^.+\n.+\n/,""))&&(s.stack+=`
|
|
175
|
-
`+c):s.stack=c}catch{}}throw s}}_request(a,r){typeof a=="string"?(r=r||{},r.url=a):r=a||{},r=Sr(this.defaults,r);const{transitional:s,paramsSerializer:l,headers:c}=r;s!==void 0&&$l.assertOptions(s,{silentJSONParsing:An.transitional(An.boolean),forcedJSONParsing:An.transitional(An.boolean),clarifyTimeoutError:An.transitional(An.boolean)},!1),l!=null&&(F.isFunction(l)?r.paramsSerializer={serialize:l}:$l.assertOptions(l,{encode:An.function,serialize:An.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),$l.assertOptions(r,{baseUrl:An.spelling("baseURL"),withXsrfToken:An.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let f=c&&F.merge(c.common,c[r.method]);c&&F.forEach(["delete","get","head","post","put","patch","common"],S=>{delete c[S]}),r.headers=Ue.concat(f,c);const h=[];let p=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(r)===!1||(p=p&&w.synchronous,h.unshift(w.fulfilled,w.rejected))});const m=[];this.interceptors.response.forEach(function(w){m.push(w.fulfilled,w.rejected)});let v,g=0,y;if(!p){const S=[Wy.bind(this),void 0];for(S.unshift(...h),S.push(...m),y=S.length,v=Promise.resolve(r);g<y;)v=v.then(S[g++],S[g++]);return v}y=h.length;let x=r;for(g=0;g<y;){const S=h[g++],w=h[g++];try{x=S(x)}catch(T){w.call(this,T);break}}try{v=Wy.call(this,x)}catch(S){return Promise.reject(S)}for(g=0,y=m.length;g<y;)v=v.then(m[g++],m[g++]);return v}getUri(a){a=Sr(this.defaults,a);const r=q1(a.baseURL,a.url,a.allowAbsoluteUrls);return P1(r,a.params,a.paramsSerializer)}};F.forEach(["delete","get","head","options"],function(a){mr.prototype[a]=function(r,s){return this.request(Sr(s||{},{method:a,url:r,data:(s||{}).data}))}});F.forEach(["post","put","patch"],function(a){function r(s){return function(c,f,h){return this.request(Sr(h||{},{method:a,headers:s?{"Content-Type":"multipart/form-data"}:{},url:c,data:f}))}}mr.prototype[a]=r(),mr.prototype[a+"Form"]=r(!0)});let SM=class K1{constructor(a){if(typeof a!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(c){r=c});const s=this;this.promise.then(l=>{if(!s._listeners)return;let c=s._listeners.length;for(;c-- >0;)s._listeners[c](l);s._listeners=null}),this.promise.then=l=>{let c;const f=new Promise(h=>{s.subscribe(h),c=h}).then(l);return f.cancel=function(){s.unsubscribe(c)},f},a(function(c,f,h){s.reason||(s.reason=new Ui(c,f,h),r(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(a){if(this.reason){a(this.reason);return}this._listeners?this._listeners.push(a):this._listeners=[a]}unsubscribe(a){if(!this._listeners)return;const r=this._listeners.indexOf(a);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const a=new AbortController,r=s=>{a.abort(s)};return this.subscribe(r),a.signal.unsubscribe=()=>this.unsubscribe(r),a.signal}static source(){let a;return{token:new K1(function(l){a=l}),cancel:a}}};function xM(e){return function(r){return e.apply(null,r)}}function wM(e){return F.isObject(e)&&e.isAxiosError===!0}const Bd={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(Bd).forEach(([e,a])=>{Bd[a]=e});function X1(e){const a=new mr(e),r=R1(mr.prototype.request,a);return F.extend(r,mr.prototype,a,{allOwnKeys:!0}),F.extend(r,a,null,{allOwnKeys:!0}),r.create=function(l){return X1(Sr(e,l))},r}const te=X1(fo);te.Axios=mr;te.CanceledError=Ui;te.CancelToken=SM;te.isCancel=B1;te.VERSION=Q1;te.toFormData=Cc;te.AxiosError=xt;te.Cancel=te.CanceledError;te.all=function(a){return Promise.all(a)};te.spread=xM;te.isAxiosError=wM;te.mergeConfig=Sr;te.AxiosHeaders=Ue;te.formToJSON=e=>k1(F.isHTMLForm(e)?new FormData(e):e);te.getAdapter=Y1.getAdapter;te.HttpStatusCode=Bd;te.default=te;const{Axios:F3,AxiosError:Y3,CanceledError:Q3,isCancel:K3,CancelToken:X3,VERSION:$3,all:Z3,Cancel:I3,isAxiosError:W3,spread:J3,toFormData:tD,AxiosHeaders:eD,HttpStatusCode:nD,formToJSON:aD,getAdapter:rD,mergeConfig:iD}=te,Dh=te.create({baseURL:"/api"});Dh.interceptors.request.use(e=>{const a=localStorage.getItem("access_token");return a&&(e.headers.Authorization=`Bearer ${a}`),e});Dh.interceptors.response.use(e=>e,e=>(e.response.status===401&&(localStorage.removeItem("access_token"),window.location.href="/"),Promise.reject(e)));class t0{constructor(a,r){this.client=a,this.data=r}}class EM{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/events");return a.events}}class RM{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/guilds");return a.guilds}}class _M{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/plugins");return a.plugins}}class TM{api=Dh;guilds=new RM(this);plugins=new _M(this);events=new EM(this);_user=null;get user(){return this._user}isReady(){return this._user!==null}logout(){localStorage.removeItem("access_token"),this._user=null}async fetchMe(a=!1){if(this._user&&!a)return this._user;const{data:r}=await this.api.get("/auth/@me");return this._user=new t0(this,r),this._user}async getFeatureFlags(){const{data:a}=await this.api.get("/feature-flags");return a}async login(a,r){const{data:s}=await this.api.post("/auth/login",{username:a,password:r});return s.accessToken&&localStorage.setItem("access_token",s.accessToken),this._user=new t0(this,s.user),s}}const $1=R.createContext(null);function CM({children:e}){const[a,r]=R.useState(()=>new TM);return _.jsx($1.Provider,{value:{client:a,setClient:r},children:e})}function Nh(){const e=R.use($1);if(!e)throw new Error("useClient must be used within a ClientProvider");return e.client}const pd={navMain:[{title:"Commands",url:"/commands",icon:ny,isActive:!1},{title:"Events",url:"/events",icon:ey,isActive:!1},{title:"Plugins",url:"/plugins",icon:wR,isActive:!1},{title:"Guilds",url:"/guilds",icon:iy,isActive:!1},{title:"Feature Flags",url:"/feature-flags",icon:RR,isActive:!1}],navSecondary:[{title:"GitHub",url:"https://github.com/underctrl-io/commandkit",icon:UR},{title:"Discord",url:"https://ctrl.lol/discord",icon:iy}],projects:[{name:"Commands",url:"#",icon:ny},{name:"Middlewares",url:"#",icon:CR},{name:"Events",url:"#",icon:ey}]};function OM({...e}){const a=Nh();return _.jsxs(_O,{className:"top-(--header-height) h-[calc(100svh-var(--header-height))]!",...e,children:[_.jsx(CO,{children:_.jsx(io,{children:_.jsx(so,{children:_.jsx(oo,{size:"lg",asChild:!0,children:_.jsxs(Mi,{to:"/",children:[_.jsx("div",{className:"border-sidebar-primary border text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-lg",children:_.jsx("img",{src:"/logo.webp",alt:"Logo",className:"size-6"})}),_.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[_.jsx("span",{className:"truncate font-medium",children:"CommandKit"}),_.jsx("span",{className:"truncate text-xs",children:"DevTools"})]})]})})})})}),_.jsxs(AO,{children:[_.jsx(NO,{items:pd.navMain}),_.jsx(LO,{projects:pd.projects}),_.jsx(jO,{items:pd.navSecondary,className:"mt-auto"})]}),_.jsx(OO,{children:_.jsx($O,{user:{avatar:a.user.data.displayAvatarURL,name:a.user.data.globalName||a.user?.data.username,username:a.user.data.username}})})]})}function AM({className:e,...a}){return _.jsx("div",{"data-slot":"card",className:Et("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...a})}function MM({className:e,...a}){return _.jsx("div",{"data-slot":"card-header",className:Et("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...a})}function DM({className:e,...a}){return _.jsx("div",{"data-slot":"card-title",className:Et("leading-none font-semibold",e),...a})}function NM({className:e,...a}){return _.jsx("div",{"data-slot":"card-description",className:Et("text-muted-foreground text-sm",e),...a})}function LM({className:e,...a}){return _.jsx("div",{"data-slot":"card-content",className:Et("px-6",e),...a})}function sD({className:e,...a}){return _.jsx("div",{"data-slot":"card-footer",className:Et("flex items-center px-6 [.border-t]:pt-6",e),...a})}var jM="Label",Z1=R.forwardRef((e,a)=>_.jsx(Xt.label,{...e,ref:a,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Z1.displayName=jM;var zM=Z1;function e0({className:e,...a}){return _.jsx(zM,{"data-slot":"label",className:Et("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...a})}const n0=e=>{let a;const r=new Set,s=(m,v)=>{const g=typeof m=="function"?m(a):m;if(!Object.is(g,a)){const y=a;a=v??(typeof g!="object"||g===null)?g:Object.assign({},a,g),r.forEach(x=>x(a,y))}},l=()=>a,h={setState:s,getState:l,getInitialState:()=>p,subscribe:m=>(r.add(m),()=>r.delete(m))},p=a=e(s,l,h);return h},PM=(e=>e?n0(e):n0),UM=e=>e;function kM(e,a=UM){const r=J.useSyncExternalStore(e.subscribe,J.useCallback(()=>a(e.getState()),[e,a]),J.useCallback(()=>a(e.getInitialState()),[e,a]));return J.useDebugValue(r),r}const a0=e=>{const a=PM(e),r=s=>kM(a,s);return Object.assign(r,a),r},BM=(e=>e?a0(e):a0),I1=BM(e=>({authenticated:!1,setAuthenticated:a=>e({authenticated:a})}));function HM(e){if(typeof document>"u")return;let a=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",a.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const qM=e=>{switch(e){case"success":return FM;case"info":return QM;case"warning":return YM;case"error":return KM;default:return null}},VM=Array(12).fill(0),GM=({visible:e,className:a})=>J.createElement("div",{className:["sonner-loading-wrapper",a].filter(Boolean).join(" "),"data-visible":e},J.createElement("div",{className:"sonner-spinner"},VM.map((r,s)=>J.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),FM=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),YM=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),QM=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),KM=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),XM=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},J.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),J.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),$M=()=>{const[e,a]=J.useState(document.hidden);return J.useEffect(()=>{const r=()=>{a(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let Hd=1;class ZM{constructor(){this.subscribe=a=>(this.subscribers.push(a),()=>{const r=this.subscribers.indexOf(a);this.subscribers.splice(r,1)}),this.publish=a=>{this.subscribers.forEach(r=>r(a))},this.addToast=a=>{this.publish(a),this.toasts=[...this.toasts,a]},this.create=a=>{var r;const{message:s,...l}=a,c=typeof a?.id=="number"||((r=a.id)==null?void 0:r.length)>0?a.id:Hd++,f=this.toasts.find(p=>p.id===c),h=a.dismissible===void 0?!0:a.dismissible;return this.dismissedToasts.has(c)&&this.dismissedToasts.delete(c),f?this.toasts=this.toasts.map(p=>p.id===c?(this.publish({...p,...a,id:c,title:s}),{...p,...a,id:c,dismissible:h,title:s}):p):this.addToast({title:s,...l,dismissible:h,id:c}),c},this.dismiss=a=>(a?(this.dismissedToasts.add(a),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:a,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),a),this.message=(a,r)=>this.create({...r,message:a}),this.error=(a,r)=>this.create({...r,message:a,type:"error"}),this.success=(a,r)=>this.create({...r,type:"success",message:a}),this.info=(a,r)=>this.create({...r,type:"info",message:a}),this.warning=(a,r)=>this.create({...r,type:"warning",message:a}),this.loading=(a,r)=>this.create({...r,type:"loading",message:a}),this.promise=(a,r)=>{if(!r)return;let s;r.loading!==void 0&&(s=this.create({...r,promise:a,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const l=Promise.resolve(a instanceof Function?a():a);let c=s!==void 0,f;const h=l.then(async m=>{if(f=["resolve",m],J.isValidElement(m))c=!1,this.create({id:s,type:"default",message:m});else if(WM(m)&&!m.ok){c=!1;const g=typeof r.error=="function"?await r.error(`HTTP error! status: ${m.status}`):r.error,y=typeof r.description=="function"?await r.description(`HTTP error! status: ${m.status}`):r.description,S=typeof g=="object"&&!J.isValidElement(g)?g:{message:g};this.create({id:s,type:"error",description:y,...S})}else if(m instanceof Error){c=!1;const g=typeof r.error=="function"?await r.error(m):r.error,y=typeof r.description=="function"?await r.description(m):r.description,S=typeof g=="object"&&!J.isValidElement(g)?g:{message:g};this.create({id:s,type:"error",description:y,...S})}else if(r.success!==void 0){c=!1;const g=typeof r.success=="function"?await r.success(m):r.success,y=typeof r.description=="function"?await r.description(m):r.description,S=typeof g=="object"&&!J.isValidElement(g)?g:{message:g};this.create({id:s,type:"success",description:y,...S})}}).catch(async m=>{if(f=["reject",m],r.error!==void 0){c=!1;const v=typeof r.error=="function"?await r.error(m):r.error,g=typeof r.description=="function"?await r.description(m):r.description,x=typeof v=="object"&&!J.isValidElement(v)?v:{message:v};this.create({id:s,type:"error",description:g,...x})}}).finally(()=>{c&&(this.dismiss(s),s=void 0),r.finally==null||r.finally.call(r)}),p=()=>new Promise((m,v)=>h.then(()=>f[0]==="reject"?v(f[1]):m(f[1])).catch(v));return typeof s!="string"&&typeof s!="number"?{unwrap:p}:Object.assign(s,{unwrap:p})},this.custom=(a,r)=>{const s=r?.id||Hd++;return this.create({jsx:a(s),id:s,...r}),s},this.getActiveToasts=()=>this.toasts.filter(a=>!this.dismissedToasts.has(a.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const je=new ZM,IM=(e,a)=>{const r=a?.id||Hd++;return je.addToast({title:e,...a,id:r}),r},WM=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",JM=IM,t4=()=>je.toasts,e4=()=>je.getActiveToasts(),r0=Object.assign(JM,{success:je.success,info:je.info,warning:je.warning,error:je.error,custom:je.custom,message:je.message,promise:je.promise,dismiss:je.dismiss,loading:je.loading},{getHistory:t4,getToasts:e4});HM("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Hl(e){return e.label!==void 0}const n4=3,a4="24px",r4="16px",i0=4e3,i4=356,s4=14,o4=45,l4=200;function Mn(...e){return e.filter(Boolean).join(" ")}function c4(e){const[a,r]=e.split("-"),s=[];return a&&s.push(a),r&&s.push(r),s}const u4=e=>{var a,r,s,l,c,f,h,p,m;const{invert:v,toast:g,unstyled:y,interacting:x,setHeights:S,visibleToasts:w,heights:T,index:C,toasts:z,expanded:N,removeToast:P,defaultRichColors:L,closeButton:K,style:V,cancelButtonStyle:G,actionButtonStyle:et,className:W="",descriptionClassName:at="",duration:rt,position:ft,gap:mt,expandByDefault:dt,classNames:D,icons:Y,closeButtonAriaLabel:q="Close toast"}=e,[ht,O]=J.useState(null),[X,nt]=J.useState(null),[Q,tt]=J.useState(!1),[st,it]=J.useState(!1),[yt,ut]=J.useState(!1),[Bt,re]=J.useState(!1),[Ft,ie]=J.useState(!1),[Ke,xn]=J.useState(0),[Hi,_r]=J.useState(0),fe=J.useRef(g.duration||rt||i0),kn=J.useRef(null),ve=J.useRef(null),Ga=C===0,Bn=C+1<=w,Rt=g.type,Vt=g.dismissible!==!1,Xe=g.className||"",ho=g.descriptionClassName||"",wn=J.useMemo(()=>T.findIndex(St=>St.toastId===g.id)||0,[T,g.id]),Te=J.useMemo(()=>{var St;return(St=g.closeButton)!=null?St:K},[g.closeButton,K]),dn=J.useMemo(()=>g.duration||rt||i0,[g.duration,rt]),ye=J.useRef(0),la=J.useRef(0),mo=J.useRef(0),ca=J.useRef(null),[Tr,Cr]=ft.split("-"),En=J.useMemo(()=>T.reduce((St,$t,ee)=>ee>=wn?St:St+$t.height,0),[T,wn]),Fa=$M(),Ya=g.invert||v,qi=Rt==="loading";la.current=J.useMemo(()=>wn*mt+En,[wn,En]),J.useEffect(()=>{fe.current=dn},[dn]),J.useEffect(()=>{tt(!0)},[]),J.useEffect(()=>{const St=ve.current;if(St){const $t=St.getBoundingClientRect().height;return _r($t),S(ee=>[{toastId:g.id,height:$t,position:g.position},...ee]),()=>S(ee=>ee.filter(be=>be.toastId!==g.id))}},[S,g.id]),J.useLayoutEffect(()=>{if(!Q)return;const St=ve.current,$t=St.style.height;St.style.height="auto";const ee=St.getBoundingClientRect().height;St.style.height=$t,_r(ee),S(be=>be.find(se=>se.toastId===g.id)?be.map(se=>se.toastId===g.id?{...se,height:ee}:se):[{toastId:g.id,height:ee,position:g.position},...be])},[Q,g.title,g.description,S,g.id,g.jsx,g.action,g.cancel]);const hn=J.useCallback(()=>{it(!0),xn(la.current),S(St=>St.filter($t=>$t.toastId!==g.id)),setTimeout(()=>{P(g)},l4)},[g,P,S,la]);J.useEffect(()=>{if(g.promise&&Rt==="loading"||g.duration===1/0||g.type==="loading")return;let St;return N||x||Fa?(()=>{if(mo.current<ye.current){const be=new Date().getTime()-ye.current;fe.current=fe.current-be}mo.current=new Date().getTime()})():(()=>{fe.current!==1/0&&(ye.current=new Date().getTime(),St=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),hn()},fe.current))})(),()=>clearTimeout(St)},[N,x,g,Rt,Fa,hn]),J.useEffect(()=>{g.delete&&(hn(),g.onDismiss==null||g.onDismiss.call(g,g))},[hn,g.delete]);function po(){var St;if(Y?.loading){var $t;return J.createElement("div",{className:Mn(D?.loader,g==null||($t=g.classNames)==null?void 0:$t.loader,"sonner-loader"),"data-visible":Rt==="loading"},Y.loading)}return J.createElement(GM,{className:Mn(D?.loader,g==null||(St=g.classNames)==null?void 0:St.loader),visible:Rt==="loading"})}const Vi=g.icon||Y?.[Rt]||qM(Rt);var ua,go;return J.createElement("li",{tabIndex:0,ref:ve,className:Mn(W,Xe,D?.toast,g==null||(a=g.classNames)==null?void 0:a.toast,D?.default,D?.[Rt],g==null||(r=g.classNames)==null?void 0:r[Rt]),"data-sonner-toast":"","data-rich-colors":(ua=g.richColors)!=null?ua:L,"data-styled":!(g.jsx||g.unstyled||y),"data-mounted":Q,"data-promise":!!g.promise,"data-swiped":Ft,"data-removed":st,"data-visible":Bn,"data-y-position":Tr,"data-x-position":Cr,"data-index":C,"data-front":Ga,"data-swiping":yt,"data-dismissible":Vt,"data-type":Rt,"data-invert":Ya,"data-swipe-out":Bt,"data-swipe-direction":X,"data-expanded":!!(N||dt&&Q),"data-testid":g.testId,style:{"--index":C,"--toasts-before":C,"--z-index":z.length-C,"--offset":`${st?Ke:la.current}px`,"--initial-height":dt?"auto":`${Hi}px`,...V,...g.style},onDragEnd:()=>{ut(!1),O(null),ca.current=null},onPointerDown:St=>{St.button!==2&&(qi||!Vt||(kn.current=new Date,xn(la.current),St.target.setPointerCapture(St.pointerId),St.target.tagName!=="BUTTON"&&(ut(!0),ca.current={x:St.clientX,y:St.clientY})))},onPointerUp:()=>{var St,$t,ee;if(Bt||!Vt)return;ca.current=null;const be=Number(((St=ve.current)==null?void 0:St.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Qa=Number((($t=ve.current)==null?void 0:$t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),se=new Date().getTime()-((ee=kn.current)==null?void 0:ee.getTime()),Zt=ht==="x"?be:Qa,It=Math.abs(Zt)/se;if(Math.abs(Zt)>=o4||It>.11){xn(la.current),g.onDismiss==null||g.onDismiss.call(g,g),nt(ht==="x"?be>0?"right":"left":Qa>0?"down":"up"),hn(),re(!0);return}else{var Ht,de;(Ht=ve.current)==null||Ht.style.setProperty("--swipe-amount-x","0px"),(de=ve.current)==null||de.style.setProperty("--swipe-amount-y","0px")}ie(!1),ut(!1),O(null)},onPointerMove:St=>{var $t,ee,be;if(!ca.current||!Vt||(($t=window.getSelection())==null?void 0:$t.toString().length)>0)return;const se=St.clientY-ca.current.y,Zt=St.clientX-ca.current.x;var It;const Ht=(It=e.swipeDirections)!=null?It:c4(ft);!ht&&(Math.abs(Zt)>1||Math.abs(se)>1)&&O(Math.abs(Zt)>Math.abs(se)?"x":"y");let de={x:0,y:0};const Or=Hn=>1/(1.5+Math.abs(Hn)/20);if(ht==="y"){if(Ht.includes("top")||Ht.includes("bottom"))if(Ht.includes("top")&&se<0||Ht.includes("bottom")&&se>0)de.y=se;else{const Hn=se*Or(se);de.y=Math.abs(Hn)<Math.abs(se)?Hn:se}}else if(ht==="x"&&(Ht.includes("left")||Ht.includes("right")))if(Ht.includes("left")&&Zt<0||Ht.includes("right")&&Zt>0)de.x=Zt;else{const Hn=Zt*Or(Zt);de.x=Math.abs(Hn)<Math.abs(Zt)?Hn:Zt}(Math.abs(de.x)>0||Math.abs(de.y)>0)&&ie(!0),(ee=ve.current)==null||ee.style.setProperty("--swipe-amount-x",`${de.x}px`),(be=ve.current)==null||be.style.setProperty("--swipe-amount-y",`${de.y}px`)}},Te&&!g.jsx&&Rt!=="loading"?J.createElement("button",{"aria-label":q,"data-disabled":qi,"data-close-button":!0,onClick:qi||!Vt?()=>{}:()=>{hn(),g.onDismiss==null||g.onDismiss.call(g,g)},className:Mn(D?.closeButton,g==null||(s=g.classNames)==null?void 0:s.closeButton)},(go=Y?.close)!=null?go:XM):null,(Rt||g.icon||g.promise)&&g.icon!==null&&(Y?.[Rt]!==null||g.icon)?J.createElement("div",{"data-icon":"",className:Mn(D?.icon,g==null||(l=g.classNames)==null?void 0:l.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||po():null,g.type!=="loading"?Vi:null):null,J.createElement("div",{"data-content":"",className:Mn(D?.content,g==null||(c=g.classNames)==null?void 0:c.content)},J.createElement("div",{"data-title":"",className:Mn(D?.title,g==null||(f=g.classNames)==null?void 0:f.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?J.createElement("div",{"data-description":"",className:Mn(at,ho,D?.description,g==null||(h=g.classNames)==null?void 0:h.description)},typeof g.description=="function"?g.description():g.description):null),J.isValidElement(g.cancel)?g.cancel:g.cancel&&Hl(g.cancel)?J.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||G,onClick:St=>{Hl(g.cancel)&&Vt&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,St),hn())},className:Mn(D?.cancelButton,g==null||(p=g.classNames)==null?void 0:p.cancelButton)},g.cancel.label):null,J.isValidElement(g.action)?g.action:g.action&&Hl(g.action)?J.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||et,onClick:St=>{Hl(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,St),!St.defaultPrevented&&hn())},className:Mn(D?.actionButton,g==null||(m=g.classNames)==null?void 0:m.actionButton)},g.action.label):null)};function s0(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function f4(e,a){const r={};return[e,a].forEach((s,l)=>{const c=l===1,f=c?"--mobile-offset":"--offset",h=c?r4:a4;function p(m){["top","right","bottom","left"].forEach(v=>{r[`${f}-${v}`]=typeof m=="number"?`${m}px`:m})}typeof s=="number"||typeof s=="string"?p(s):typeof s=="object"?["top","right","bottom","left"].forEach(m=>{s[m]===void 0?r[`${f}-${m}`]=h:r[`${f}-${m}`]=typeof s[m]=="number"?`${s[m]}px`:s[m]}):p(h)}),r}const d4=J.forwardRef(function(a,r){const{id:s,invert:l,position:c="bottom-right",hotkey:f=["altKey","KeyT"],expand:h,closeButton:p,className:m,offset:v,mobileOffset:g,theme:y="light",richColors:x,duration:S,style:w,visibleToasts:T=n4,toastOptions:C,dir:z=s0(),gap:N=s4,icons:P,containerAriaLabel:L="Notifications"}=a,[K,V]=J.useState([]),G=J.useMemo(()=>s?K.filter(Q=>Q.toasterId===s):K.filter(Q=>!Q.toasterId),[K,s]),et=J.useMemo(()=>Array.from(new Set([c].concat(G.filter(Q=>Q.position).map(Q=>Q.position)))),[G,c]),[W,at]=J.useState([]),[rt,ft]=J.useState(!1),[mt,dt]=J.useState(!1),[D,Y]=J.useState(y!=="system"?y:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=J.useRef(null),ht=f.join("+").replace(/Key/g,"").replace(/Digit/g,""),O=J.useRef(null),X=J.useRef(!1),nt=J.useCallback(Q=>{V(tt=>{var st;return(st=tt.find(it=>it.id===Q.id))!=null&&st.delete||je.dismiss(Q.id),tt.filter(({id:it})=>it!==Q.id)})},[]);return J.useEffect(()=>je.subscribe(Q=>{if(Q.dismiss){requestAnimationFrame(()=>{V(tt=>tt.map(st=>st.id===Q.id?{...st,delete:!0}:st))});return}setTimeout(()=>{U0.flushSync(()=>{V(tt=>{const st=tt.findIndex(it=>it.id===Q.id);return st!==-1?[...tt.slice(0,st),{...tt[st],...Q},...tt.slice(st+1)]:[Q,...tt]})})})}),[K]),J.useEffect(()=>{if(y!=="system"){Y(y);return}if(y==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window>"u")return;const Q=window.matchMedia("(prefers-color-scheme: dark)");try{Q.addEventListener("change",({matches:tt})=>{Y(tt?"dark":"light")})}catch{Q.addListener(({matches:st})=>{try{Y(st?"dark":"light")}catch(it){console.error(it)}})}},[y]),J.useEffect(()=>{K.length<=1&&ft(!1)},[K]),J.useEffect(()=>{const Q=tt=>{var st;if(f.every(ut=>tt[ut]||tt.code===ut)){var yt;ft(!0),(yt=q.current)==null||yt.focus()}tt.code==="Escape"&&(document.activeElement===q.current||(st=q.current)!=null&&st.contains(document.activeElement))&&ft(!1)};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[f]),J.useEffect(()=>{if(q.current)return()=>{O.current&&(O.current.focus({preventScroll:!0}),O.current=null,X.current=!1)}},[q.current]),J.createElement("section",{ref:r,"aria-label":`${L} ${ht}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},et.map((Q,tt)=>{var st;const[it,yt]=Q.split("-");return G.length?J.createElement("ol",{key:Q,dir:z==="auto"?s0():z,tabIndex:-1,ref:q,className:m,"data-sonner-toaster":!0,"data-sonner-theme":D,"data-y-position":it,"data-x-position":yt,style:{"--front-toast-height":`${((st=W[0])==null?void 0:st.height)||0}px`,"--width":`${i4}px`,"--gap":`${N}px`,...w,...f4(v,g)},onBlur:ut=>{X.current&&!ut.currentTarget.contains(ut.relatedTarget)&&(X.current=!1,O.current&&(O.current.focus({preventScroll:!0}),O.current=null))},onFocus:ut=>{ut.target instanceof HTMLElement&&ut.target.dataset.dismissible==="false"||X.current||(X.current=!0,O.current=ut.relatedTarget)},onMouseEnter:()=>ft(!0),onMouseMove:()=>ft(!0),onMouseLeave:()=>{mt||ft(!1)},onDragEnd:()=>ft(!1),onPointerDown:ut=>{ut.target instanceof HTMLElement&&ut.target.dataset.dismissible==="false"||dt(!0)},onPointerUp:()=>dt(!1)},G.filter(ut=>!ut.position&&tt===0||ut.position===Q).map((ut,Bt)=>{var re,Ft;return J.createElement(u4,{key:ut.id,icons:P,index:Bt,toast:ut,defaultRichColors:x,duration:(re=C?.duration)!=null?re:S,className:C?.className,descriptionClassName:C?.descriptionClassName,invert:l,visibleToasts:T,closeButton:(Ft=C?.closeButton)!=null?Ft:p,interacting:mt,position:Q,style:C?.style,unstyled:C?.unstyled,classNames:C?.classNames,cancelButtonStyle:C?.cancelButtonStyle,actionButtonStyle:C?.actionButtonStyle,closeButtonAriaLabel:C?.closeButtonAriaLabel,removeToast:nt,toasts:G.filter(ie=>ie.position==ut.position),heights:W.filter(ie=>ie.position==ut.position),setHeights:at,expandByDefault:h,gap:N,expanded:rt,swipeDirections:a.swipeDirections})})):null}))});var ki=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},xr=typeof window>"u"||"Deno"in globalThis;function Oe(){}function h4(e,a){return typeof e=="function"?e(a):e}function qd(e){return typeof e=="number"&&e>=0&&e!==1/0}function W1(e,a){return Math.max(e+(a||0)-Date.now(),0)}function ka(e,a){return typeof e=="function"?e(a):e}function on(e,a){return typeof e=="function"?e(a):e}function o0(e,a){const{type:r="all",exact:s,fetchStatus:l,predicate:c,queryKey:f,stale:h}=e;if(f){if(s){if(a.queryHash!==Lh(f,a.options))return!1}else if(!Js(a.queryKey,f))return!1}if(r!=="all"){const p=a.isActive();if(r==="active"&&!p||r==="inactive"&&p)return!1}return!(typeof h=="boolean"&&a.isStale()!==h||l&&l!==a.state.fetchStatus||c&&!c(a))}function l0(e,a){const{exact:r,status:s,predicate:l,mutationKey:c}=e;if(c){if(!a.options.mutationKey)return!1;if(r){if(wr(a.options.mutationKey)!==wr(c))return!1}else if(!Js(a.options.mutationKey,c))return!1}return!(s&&a.state.status!==s||l&&!l(a))}function Lh(e,a){return(a?.queryKeyHashFn||wr)(e)}function wr(e){return JSON.stringify(e,(a,r)=>Vd(r)?Object.keys(r).sort().reduce((s,l)=>(s[l]=r[l],s),{}):r)}function Js(e,a){return e===a?!0:typeof e!=typeof a?!1:e&&a&&typeof e=="object"&&typeof a=="object"?Object.keys(a).every(r=>Js(e[r],a[r])):!1}function J1(e,a){if(e===a)return e;const r=c0(e)&&c0(a);if(r||Vd(e)&&Vd(a)){const s=r?e:Object.keys(e),l=s.length,c=r?a:Object.keys(a),f=c.length,h=r?[]:{},p=new Set(s);let m=0;for(let v=0;v<f;v++){const g=r?v:c[v];(!r&&p.has(g)||r)&&e[g]===void 0&&a[g]===void 0?(h[g]=void 0,m++):(h[g]=J1(e[g],a[g]),h[g]===e[g]&&e[g]!==void 0&&m++)}return l===f&&m===l?e:h}return a}function uc(e,a){if(!a||Object.keys(e).length!==Object.keys(a).length)return!1;for(const r in e)if(e[r]!==a[r])return!1;return!0}function c0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Vd(e){if(!u0(e))return!1;const a=e.constructor;if(a===void 0)return!0;const r=a.prototype;return!(!u0(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function u0(e){return Object.prototype.toString.call(e)==="[object Object]"}function m4(e){return new Promise(a=>{setTimeout(a,e)})}function Gd(e,a,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,a):r.structuralSharing!==!1?J1(e,a):a}function p4(e,a,r=0){const s=[...e,a];return r&&s.length>r?s.slice(1):s}function g4(e,a,r=0){const s=[a,...e];return r&&s.length>r?s.slice(0,-1):s}var jh=Symbol();function tS(e,a){return!e.queryFn&&a?.initialPromise?()=>a.initialPromise:!e.queryFn||e.queryFn===jh?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function eS(e,a){return typeof e=="function"?e(...a):!!e}var v4=class extends ki{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!xr&&window.addEventListener){const a=()=>e();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(a=>{a(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},zh=new v4,y4=class extends ki{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!xr&&window.addEventListener){const a=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},fc=new y4;function Fd(){let e,a;const r=new Promise((l,c)=>{e=l,a=c});r.status="pending",r.catch(()=>{});function s(l){Object.assign(r,l),delete r.resolve,delete r.reject}return r.resolve=l=>{s({status:"fulfilled",value:l}),e(l)},r.reject=l=>{s({status:"rejected",reason:l}),a(l)},r}function b4(e){return Math.min(1e3*2**e,3e4)}function nS(e){return(e??"online")==="online"?fc.isOnline():!0}var aS=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function rS(e){let a=!1,r=0,s;const l=Fd(),c=()=>l.status!=="pending",f=w=>{c()||(y(new aS(w)),e.abort?.())},h=()=>{a=!0},p=()=>{a=!1},m=()=>zh.isFocused()&&(e.networkMode==="always"||fc.isOnline())&&e.canRun(),v=()=>nS(e.networkMode)&&e.canRun(),g=w=>{c()||(s?.(),l.resolve(w))},y=w=>{c()||(s?.(),l.reject(w))},x=()=>new Promise(w=>{s=T=>{(c()||m())&&w(T)},e.onPause?.()}).then(()=>{s=void 0,c()||e.onContinue?.()}),S=()=>{if(c())return;let w;const T=r===0?e.initialPromise:void 0;try{w=T??e.fn()}catch(C){w=Promise.reject(C)}Promise.resolve(w).then(g).catch(C=>{if(c())return;const z=e.retry??(xr?0:3),N=e.retryDelay??b4,P=typeof N=="function"?N(r,C):N,L=z===!0||typeof z=="number"&&r<z||typeof z=="function"&&z(r,C);if(a||!L){y(C);return}r++,e.onFail?.(r,C),m4(P).then(()=>m()?void 0:x()).then(()=>{a?y(C):S()})})};return{promise:l,status:()=>l.status,cancel:f,continue:()=>(s?.(),l),cancelRetry:h,continueRetry:p,canStart:v,start:()=>(v()?S():x().then(S),l)}}var S4=e=>setTimeout(e,0);function x4(){let e=[],a=0,r=h=>{h()},s=h=>{h()},l=S4;const c=h=>{a?e.push(h):l(()=>{r(h)})},f=()=>{const h=e;e=[],h.length&&l(()=>{s(()=>{h.forEach(p=>{r(p)})})})};return{batch:h=>{let p;a++;try{p=h()}finally{a--,a||f()}return p},batchCalls:h=>(...p)=>{c(()=>{h(...p)})},schedule:c,setNotifyFunction:h=>{r=h},setBatchNotifyFunction:h=>{s=h},setScheduler:h=>{l=h}}}var ue=x4(),iS=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),qd(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(xr?1/0:300*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},w4=class extends iS{#e;#t;#n;#a;#r;#s;#o;constructor(e){super(),this.#o=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#a=e.client,this.#n=this.#a.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=E4(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){this.options={...this.#s,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,a){const r=Gd(this.state.data,e,this.options);return this.#i({data:r,type:"success",dataUpdatedAt:a?.updatedAt,manual:a?.manual}),r}setState(e,a){this.#i({type:"setState",state:e,setStateOptions:a})}cancel(e){const a=this.#r?.promise;return this.#r?.cancel(e),a?a.then(Oe).catch(Oe):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>on(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===jh||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ka(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!W1(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(a=>a.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(a=>a.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(a=>a!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,a){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&a?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const r=new AbortController,s=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#o=!0,r.signal)})},l=()=>{const h=tS(this.options,a),m=(()=>{const v={client:this.#a,queryKey:this.queryKey,meta:this.meta};return s(v),v})();return this.#o=!1,this.options.persister?this.options.persister(h,m,this):h(m)},f=(()=>{const h={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:l};return s(h),h})();this.options.behavior?.onFetch(f,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==f.fetchOptions?.meta)&&this.#i({type:"fetch",meta:f.fetchOptions?.meta}),this.#r=rS({initialPromise:a?.initialPromise,fn:f.fetchFn,abort:r.abort.bind(r),onFail:(h,p)=>{this.#i({type:"failed",failureCount:h,error:p})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0});try{const h=await this.#r.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#n.config.onSuccess?.(h,this),this.#n.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof aS){if(h.silent)return this.#r.promise;if(h.revert){if(this.setState({...this.#t,fetchStatus:"idle"}),this.state.data===void 0)throw h;return this.state.data}}throw this.#i({type:"error",error:h}),this.#n.config.onError?.(h,this),this.#n.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#i(e){const a=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...sS(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?s:void 0,s;case"error":const l=e.error;return{...r,error:l,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:l,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=a(this.state),ue.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function sS(e,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:nS(a.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function E4(e){const a=typeof e.initialData=="function"?e.initialData():e.initialData,r=a!==void 0,s=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var R4=class extends ki{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,a,r){const s=a.queryKey,l=a.queryHash??Lh(s,a);let c=this.get(l);return c||(c=new w4({client:e,queryKey:s,queryHash:l,options:e.defaultQueryOptions(a),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(c)),c}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const a=this.#e.get(e.queryHash);a&&(e.destroy(),a===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ue.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const a={exact:!0,...e};return this.getAll().find(r=>o0(a,r))}findAll(e={}){const a=this.getAll();return Object.keys(e).length>0?a.filter(r=>o0(e,r)):a}notify(e){ue.batch(()=>{this.listeners.forEach(a=>{a(e)})})}onFocus(){ue.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ue.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},_4=class extends iS{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||oS(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(a=>a!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){const a=()=>{this.#a({type:"continue"})};this.#n=rS({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(l,c)=>{this.#a({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#a({type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const r=this.state.status==="pending",s=!this.#n.canStart();try{if(r)a();else{this.#a({type:"pending",variables:e,isPaused:s}),await this.#t.config.onMutate?.(e,this);const c=await this.options.onMutate?.(e);c!==this.state.context&&this.#a({type:"pending",context:c,variables:e,isPaused:s})}const l=await this.#n.start();return await this.#t.config.onSuccess?.(l,e,this.state.context,this),await this.options.onSuccess?.(l,e,this.state.context),await this.#t.config.onSettled?.(l,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(l,null,e,this.state.context),this.#a({type:"success",data:l}),l}catch(l){try{throw await this.#t.config.onError?.(l,e,this.state.context,this),await this.options.onError?.(l,e,this.state.context),await this.#t.config.onSettled?.(void 0,l,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,l,e,this.state.context),l}finally{this.#a({type:"error",error:l})}}finally{this.#t.runNext(this)}}#a(e){const a=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=a(this.state),ue.batch(()=>{this.#e.forEach(r=>{r.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function oS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var T4=class extends ki{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,a,r){const s=new _4({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(a),state:r});return this.add(s),s}add(e){this.#e.add(e);const a=ql(e);if(typeof a=="string"){const r=this.#t.get(a);r?r.push(e):this.#t.set(a,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const a=ql(e);if(typeof a=="string"){const r=this.#t.get(a);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&this.#t.delete(a)}}this.notify({type:"removed",mutation:e})}canRun(e){const a=ql(e);if(typeof a=="string"){const s=this.#t.get(a)?.find(l=>l.state.status==="pending");return!s||s===e}else return!0}runNext(e){const a=ql(e);return typeof a=="string"?this.#t.get(a)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ue.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const a={exact:!0,...e};return this.getAll().find(r=>l0(a,r))}findAll(e={}){return this.getAll().filter(a=>l0(e,a))}notify(e){ue.batch(()=>{this.listeners.forEach(a=>{a(e)})})}resumePausedMutations(){const e=this.getAll().filter(a=>a.state.isPaused);return ue.batch(()=>Promise.all(e.map(a=>a.continue().catch(Oe))))}};function ql(e){return e.options.scope?.id}function f0(e){return{onFetch:(a,r)=>{const s=a.options,l=a.fetchOptions?.meta?.fetchMore?.direction,c=a.state.data?.pages||[],f=a.state.data?.pageParams||[];let h={pages:[],pageParams:[]},p=0;const m=async()=>{let v=!1;const g=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(a.signal.aborted?v=!0:a.signal.addEventListener("abort",()=>{v=!0}),a.signal)})},y=tS(a.options,a.fetchOptions),x=async(S,w,T)=>{if(v)return Promise.reject();if(w==null&&S.pages.length)return Promise.resolve(S);const z=(()=>{const K={client:a.client,queryKey:a.queryKey,pageParam:w,direction:T?"backward":"forward",meta:a.options.meta};return g(K),K})(),N=await y(z),{maxPages:P}=a.options,L=T?g4:p4;return{pages:L(S.pages,N,P),pageParams:L(S.pageParams,w,P)}};if(l&&c.length){const S=l==="backward",w=S?C4:d0,T={pages:c,pageParams:f},C=w(s,T);h=await x(T,C,S)}else{const S=e??c.length;do{const w=p===0?f[0]??s.initialPageParam:d0(s,h);if(p>0&&w==null)break;h=await x(h,w),p++}while(p<S)}return h};a.options.persister?a.fetchFn=()=>a.options.persister?.(m,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},r):a.fetchFn=m}}}function d0(e,{pages:a,pageParams:r}){const s=a.length-1;return a.length>0?e.getNextPageParam(a[s],a,r[s],r):void 0}function C4(e,{pages:a,pageParams:r}){return a.length>0?e.getPreviousPageParam?.(a[0],a,r[0],r):void 0}var O4=class{#e;#t;#n;#a;#r;#s;#o;#i;constructor(e={}){this.#e=e.queryCache||new R4,this.#t=e.mutationCache||new T4,this.#n=e.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#o=zh.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=fc.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#o?.(),this.#o=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const a=this.defaultQueryOptions({queryKey:e});return this.#e.get(a.queryHash)?.state.data}ensureQueryData(e){const a=this.defaultQueryOptions(e),r=this.#e.build(this,a),s=r.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(ka(a.staleTime,r))&&this.prefetchQuery(a),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:a,state:r})=>{const s=r.data;return[a,s]})}setQueryData(e,a,r){const s=this.defaultQueryOptions({queryKey:e}),c=this.#e.get(s.queryHash)?.state.data,f=h4(a,c);if(f!==void 0)return this.#e.build(this,s).setData(f,{...r,manual:!0})}setQueriesData(e,a,r){return ue.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,a,r)]))}getQueryState(e){const a=this.defaultQueryOptions({queryKey:e});return this.#e.get(a.queryHash)?.state}removeQueries(e){const a=this.#e;ue.batch(()=>{a.findAll(e).forEach(r=>{a.remove(r)})})}resetQueries(e,a){const r=this.#e;return ue.batch(()=>(r.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},a)))}cancelQueries(e,a={}){const r={revert:!0,...a},s=ue.batch(()=>this.#e.findAll(e).map(l=>l.cancel(r)));return Promise.all(s).then(Oe).catch(Oe)}invalidateQueries(e,a={}){return ue.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},a)))}refetchQueries(e,a={}){const r={...a,cancelRefetch:a.cancelRefetch??!0},s=ue.batch(()=>this.#e.findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let c=l.fetch(void 0,r);return r.throwOnError||(c=c.catch(Oe)),l.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(s).then(Oe)}fetchQuery(e){const a=this.defaultQueryOptions(e);a.retry===void 0&&(a.retry=!1);const r=this.#e.build(this,a);return r.isStaleByTime(ka(a.staleTime,r))?r.fetch(a):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Oe).catch(Oe)}fetchInfiniteQuery(e){return e.behavior=f0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Oe).catch(Oe)}ensureInfiniteQueryData(e){return e.behavior=f0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return fc.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,a){this.#a.set(wr(e),{queryKey:e,defaultOptions:a})}getQueryDefaults(e){const a=[...this.#a.values()],r={};return a.forEach(s=>{Js(e,s.queryKey)&&Object.assign(r,s.defaultOptions)}),r}setMutationDefaults(e,a){this.#r.set(wr(e),{mutationKey:e,defaultOptions:a})}getMutationDefaults(e){const a=[...this.#r.values()],r={};return a.forEach(s=>{Js(e,s.mutationKey)&&Object.assign(r,s.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const a={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return a.queryHash||(a.queryHash=Lh(a.queryKey,a)),a.refetchOnReconnect===void 0&&(a.refetchOnReconnect=a.networkMode!=="always"),a.throwOnError===void 0&&(a.throwOnError=!!a.suspense),!a.networkMode&&a.persister&&(a.networkMode="offlineFirst"),a.queryFn===jh&&(a.enabled=!1),a}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},A4=class extends ki{constructor(e,a){super(),this.options=a,this.#e=e,this.#i=null,this.#o=Fd(),this.bindMethods(),this.setOptions(a)}#e;#t=void 0;#n=void 0;#a=void 0;#r;#s;#o;#i;#p;#d;#h;#c;#u;#l;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),h0(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Yd(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Yd(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#S(),this.#x(),this.#t.removeObserver(this)}setOptions(e){const a=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof on(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),a._defaulted&&!uc(this.options,a)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&m0(this.#t,r,this.options,a)&&this.#f(),this.updateResult(),s&&(this.#t!==r||on(this.options.enabled,this.#t)!==on(a.enabled,this.#t)||ka(this.options.staleTime,this.#t)!==ka(a.staleTime,this.#t))&&this.#g();const l=this.#v();s&&(this.#t!==r||on(this.options.enabled,this.#t)!==on(a.enabled,this.#t)||l!==this.#l)&&this.#y(l)}getOptimisticResult(e){const a=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(a,e);return D4(this,r)&&(this.#a=r,this.#s=this.options,this.#r=this.#t.state),r}getCurrentResult(){return this.#a}trackResult(e,a){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),a?.(s),s==="promise"&&!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(r,s))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const a=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,a);return r.fetch().then(()=>this.createResult(r,a))}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#a))}#f(e){this.#w();let a=this.#t.fetch(this.options,e);return e?.throwOnError||(a=a.catch(Oe)),a}#g(){this.#S();const e=ka(this.options.staleTime,this.#t);if(xr||this.#a.isStale||!qd(e))return;const r=W1(this.#a.dataUpdatedAt,e)+1;this.#c=setTimeout(()=>{this.#a.isStale||this.updateResult()},r)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#x(),this.#l=e,!(xr||on(this.options.enabled,this.#t)===!1||!qd(this.#l)||this.#l===0)&&(this.#u=setInterval(()=>{(this.options.refetchIntervalInBackground||zh.isFocused())&&this.#f()},this.#l))}#b(){this.#g(),this.#y(this.#v())}#S(){this.#c&&(clearTimeout(this.#c),this.#c=void 0)}#x(){this.#u&&(clearInterval(this.#u),this.#u=void 0)}createResult(e,a){const r=this.#t,s=this.options,l=this.#a,c=this.#r,f=this.#s,p=e!==r?e.state:this.#n,{state:m}=e;let v={...m},g=!1,y;if(a._optimisticResults){const G=this.hasListeners(),et=!G&&h0(e,a),W=G&&m0(e,r,a,s);(et||W)&&(v={...v,...sS(m.data,e.options)}),a._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:x,errorUpdatedAt:S,status:w}=v;y=v.data;let T=!1;if(a.placeholderData!==void 0&&y===void 0&&w==="pending"){let G;l?.isPlaceholderData&&a.placeholderData===f?.placeholderData?(G=l.data,T=!0):G=typeof a.placeholderData=="function"?a.placeholderData(this.#h?.state.data,this.#h):a.placeholderData,G!==void 0&&(w="success",y=Gd(l?.data,G,a),g=!0)}if(a.select&&y!==void 0&&!T)if(l&&y===c?.data&&a.select===this.#p)y=this.#d;else try{this.#p=a.select,y=a.select(y),y=Gd(l?.data,y,a),this.#d=y,this.#i=null}catch(G){this.#i=G}this.#i&&(x=this.#i,y=this.#d,S=Date.now(),w="error");const C=v.fetchStatus==="fetching",z=w==="pending",N=w==="error",P=z&&C,L=y!==void 0,V={status:w,fetchStatus:v.fetchStatus,isPending:z,isSuccess:w==="success",isError:N,isInitialLoading:P,isLoading:P,data:y,dataUpdatedAt:v.dataUpdatedAt,error:x,errorUpdatedAt:S,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>p.dataUpdateCount||v.errorUpdateCount>p.errorUpdateCount,isFetching:C,isRefetching:C&&!z,isLoadingError:N&&!L,isPaused:v.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:N&&L,isStale:Ph(e,a),refetch:this.refetch,promise:this.#o,isEnabled:on(a.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const G=at=>{V.status==="error"?at.reject(V.error):V.data!==void 0&&at.resolve(V.data)},et=()=>{const at=this.#o=V.promise=Fd();G(at)},W=this.#o;switch(W.status){case"pending":e.queryHash===r.queryHash&&G(W);break;case"fulfilled":(V.status==="error"||V.data!==W.value)&&et();break;case"rejected":(V.status!=="error"||V.error!==W.reason)&&et();break}}return V}updateResult(){const e=this.#a,a=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#s=this.options,this.#r.data!==void 0&&(this.#h=this.#t),uc(a,e))return;this.#a=a;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,l=typeof s=="function"?s():s;if(l==="all"||!l&&!this.#m.size)return!0;const c=new Set(l??this.#m);return this.options.throwOnError&&c.add("error"),Object.keys(this.#a).some(f=>{const h=f;return this.#a[h]!==e[h]&&c.has(h)})};this.#E({listeners:r()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const a=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(a?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#E(e){ue.batch(()=>{e.listeners&&this.listeners.forEach(a=>{a(this.#a)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function M4(e,a){return on(a.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&a.retryOnMount===!1)}function h0(e,a){return M4(e,a)||e.state.data!==void 0&&Yd(e,a,a.refetchOnMount)}function Yd(e,a,r){if(on(a.enabled,e)!==!1&&ka(a.staleTime,e)!=="static"){const s=typeof r=="function"?r(e):r;return s==="always"||s!==!1&&Ph(e,a)}return!1}function m0(e,a,r,s){return(e!==a||on(s.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Ph(e,r)}function Ph(e,a){return on(a.enabled,e)!==!1&&e.isStaleByTime(ka(a.staleTime,e))}function D4(e,a){return!uc(e.getCurrentResult(),a)}var N4=class extends ki{#e;#t=void 0;#n;#a;constructor(a,r){super(),this.#e=a,this.setOptions(r),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(a){const r=this.options;this.options=this.#e.defaultMutationOptions(a),uc(this.options,r)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),r?.mutationKey&&this.options.mutationKey&&wr(r.mutationKey)!==wr(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(a){this.#r(),this.#s(a)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#s()}mutate(a,r){return this.#a=r,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(a)}#r(){const a=this.#n?.state??oS();this.#t={...a,isPending:a.status==="pending",isSuccess:a.status==="success",isError:a.status==="error",isIdle:a.status==="idle",mutate:this.mutate,reset:this.reset}}#s(a){ue.batch(()=>{if(this.#a&&this.hasListeners()){const r=this.#t.variables,s=this.#t.context;a?.type==="success"?(this.#a.onSuccess?.(a.data,r,s),this.#a.onSettled?.(a.data,null,r,s)):a?.type==="error"&&(this.#a.onError?.(a.error,r,s),this.#a.onSettled?.(void 0,a.error,r,s))}this.listeners.forEach(r=>{r(this.#t)})})}},lS=R.createContext(void 0),cS=e=>{const a=R.useContext(lS);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},L4=({client:e,children:a})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),_.jsx(lS.Provider,{value:e,children:a})),uS=R.createContext(!1),j4=()=>R.useContext(uS);uS.Provider;function z4(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var P4=R.createContext(z4()),U4=()=>R.useContext(P4),k4=(e,a)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(a.isReset()||(e.retryOnMount=!1))},B4=e=>{R.useEffect(()=>{e.clearReset()},[e])},H4=({result:e,errorResetBoundary:a,throwOnError:r,query:s,suspense:l})=>e.isError&&!a.isReset()&&!e.isFetching&&s&&(l&&e.data===void 0||eS(r,[e.error,s])),q4=e=>{if(e.suspense){const a=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>a(r(...s)):a(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},V4=(e,a)=>e.isLoading&&e.isFetching&&!a,G4=(e,a)=>e?.suspense&&a.isPending,p0=(e,a,r)=>a.fetchOptimistic(e).catch(()=>{r.clearReset()});function F4(e,a,r){const s=j4(),l=U4(),c=cS(),f=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(f),f._optimisticResults=s?"isRestoring":"optimistic",q4(f),k4(f,l),B4(l);const h=!c.getQueryCache().get(f.queryHash),[p]=R.useState(()=>new a(c,f)),m=p.getOptimisticResult(f),v=!s&&e.subscribed!==!1;if(R.useSyncExternalStore(R.useCallback(g=>{const y=v?p.subscribe(ue.batchCalls(g)):Oe;return p.updateResult(),y},[p,v]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),R.useEffect(()=>{p.setOptions(f)},[f,p]),G4(f,m))throw p0(f,p,l);if(H4({result:m,errorResetBoundary:l,throwOnError:f.throwOnError,query:c.getQueryCache().get(f.queryHash),suspense:f.suspense}))throw m.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(f,m),f.experimental_prefetchInRender&&!xr&&V4(m,s)&&(h?p0(f,p,l):c.getQueryCache().get(f.queryHash)?.promise)?.catch(Oe).finally(()=>{p.updateResult()}),f.notifyOnChangeProps?m:p.trackResult(m)}function Y4(e,a){return F4(e,A4)}function Q4(e,a){const r=cS(),[s]=R.useState(()=>new N4(r,e));R.useEffect(()=>{s.setOptions(e)},[s,e]);const l=R.useSyncExternalStore(R.useCallback(f=>s.subscribe(ue.batchCalls(f)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),c=R.useCallback((f,h)=>{s.mutate(f,h).catch(Oe)},[s]);if(l.error&&eS(s.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:c,mutateAsync:l.mutate}}function K4(){return _.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx(F0,{className:"size-8 animate-spin"})})}function X4({className:e,...a}){const{setAuthenticated:r}=I1(),[s,l]=R.useState(""),[c,f]=R.useState(""),h=Nh(),{isPending:p,mutate:m}=Q4({mutationFn:async()=>h.login(s,c),onError(){r0.error("Invalid credentials",{description:"The credentials you provided are invalid."})},onSuccess(){r0.success("Login successful",{description:"You have successfully logged in."}),r(!0)}});return p?_.jsx(K4,{}):_.jsx("div",{className:Et("flex flex-col gap-6 w-[20%]",e),...a,children:_.jsxs(AM,{children:[_.jsxs(MM,{children:[_.jsx(DM,{className:"text-2xl",children:"Login"}),_.jsx(NM,{children:"Enter your credentials below to proceed"})]}),_.jsx(LM,{children:_.jsxs("div",{className:"flex flex-col gap-6",children:[_.jsxs("div",{className:"grid gap-2",children:[_.jsx(e0,{htmlFor:"username",children:"Username"}),_.jsx(hy,{id:"username",type:"username",placeholder:"Enter your username",required:!0,value:s,onChange:v=>l(v.target.value)})]}),_.jsxs("div",{className:"grid gap-2",children:[_.jsx("div",{className:"flex items-center",children:_.jsx(e0,{htmlFor:"password",children:"Password"})}),_.jsx(hy,{id:"password",type:"password",required:!0,value:c,onChange:v=>f(v.target.value)})]}),_.jsx(ob,{type:"button",className:"w-full",onClick:()=>{m()},children:"Login"})]})})]})})}function $4({children:e}){const{authenticated:a,setAuthenticated:r}=I1(),s=Nh(),{isLoading:l,isError:c}=Y4({queryKey:[],enabled:!a,queryFn:async()=>{const f=await s.fetchMe();return r(!!f),f},refetchOnWindowFocus:!0});return l?_.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx(F0,{className:"size-8 animate-spin"})}):c?_.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching user data."})}):a?_.jsx(_.Fragment,{children:e}):_.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx(X4,{})})}function Z4({...e}){return _.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function I4({className:e,...a}){return _.jsx("ol",{"data-slot":"breadcrumb-list",className:Et("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...a})}function gd({className:e,...a}){return _.jsx("li",{"data-slot":"breadcrumb-item",className:Et("inline-flex items-center gap-1.5",e),...a})}function g0({asChild:e,className:a,...r}){const s=e?no:"a";return _.jsx(s,{"data-slot":"breadcrumb-link",className:Et("hover:text-foreground transition-colors",a),...r})}function W4({className:e,...a}){return _.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:Et("text-foreground font-normal",e),...a})}function v0({children:e,className:a,...r}){return _.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:Et("[&>svg]:size-3.5",a),...r,children:e??_.jsx(yR,{})})}function J4(){const{toggleSidebar:e}=_h();return _.jsx("header",{className:"bg-background sticky top-0 z-50 flex w-full items-center border-b",children:_.jsxs("div",{className:"flex h-(--header-height) w-full items-center gap-2 px-4",children:[_.jsx(ob,{className:"h-8 w-8",variant:"ghost",size:"icon",onClick:e,children:_.jsx(SR,{})}),_.jsx(X_,{orientation:"vertical",className:"mr-2 h-4"}),_.jsx(Z4,{className:"hidden sm:block",children:_.jsxs(I4,{children:[_.jsx(gd,{children:_.jsx(g0,{href:"#",children:"/"})}),_.jsx(v0,{}),_.jsx(gd,{children:_.jsx(W4,{children:"CommandKit"})}),_.jsx(v0,{}),_.jsx(gd,{children:_.jsx(g0,{href:"#",children:"DevTools"})})]})})]})})}var t3=(e,a,r,s,l,c,f,h)=>{let p=document.documentElement,m=["light","dark"];function v(x){(Array.isArray(e)?e:[e]).forEach(S=>{let w=S==="class",T=w&&c?l.map(C=>c[C]||C):l;w?(p.classList.remove(...T),p.classList.add(c&&c[x]?c[x]:x)):p.setAttribute(S,x)}),g(x)}function g(x){h&&m.includes(x)&&(p.style.colorScheme=x)}function y(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)v(s);else try{let x=localStorage.getItem(a)||r,S=f&&x==="system"?y():x;v(S)}catch{}},y0=["light","dark"],fS="(prefers-color-scheme: dark)",e3=typeof window>"u",Uh=R.createContext(void 0),n3={setTheme:e=>{},themes:[]},a3=()=>{var e;return(e=R.useContext(Uh))!=null?e:n3},r3=e=>R.useContext(Uh)?R.createElement(R.Fragment,null,e.children):R.createElement(s3,{...e}),i3=["light","dark"],s3=({forcedTheme:e,disableTransitionOnChange:a=!1,enableSystem:r=!0,enableColorScheme:s=!0,storageKey:l="theme",themes:c=i3,defaultTheme:f=r?"system":"light",attribute:h="data-theme",value:p,children:m,nonce:v,scriptProps:g})=>{let[y,x]=R.useState(()=>l3(l,f)),[S,w]=R.useState(()=>y==="system"?vd():y),T=p?Object.values(p):c,C=R.useCallback(L=>{let K=L;if(!K)return;L==="system"&&r&&(K=vd());let V=p?p[K]:K,G=a?c3(v):null,et=document.documentElement,W=at=>{at==="class"?(et.classList.remove(...T),V&&et.classList.add(V)):at.startsWith("data-")&&(V?et.setAttribute(at,V):et.removeAttribute(at))};if(Array.isArray(h)?h.forEach(W):W(h),s){let at=y0.includes(f)?f:null,rt=y0.includes(K)?K:at;et.style.colorScheme=rt}G?.()},[v]),z=R.useCallback(L=>{let K=typeof L=="function"?L(y):L;x(K);try{localStorage.setItem(l,K)}catch{}},[y]),N=R.useCallback(L=>{let K=vd(L);w(K),y==="system"&&r&&!e&&C("system")},[y,e]);R.useEffect(()=>{let L=window.matchMedia(fS);return L.addListener(N),N(L),()=>L.removeListener(N)},[N]),R.useEffect(()=>{let L=K=>{K.key===l&&(K.newValue?x(K.newValue):z(f))};return window.addEventListener("storage",L),()=>window.removeEventListener("storage",L)},[z]),R.useEffect(()=>{C(e??y)},[e,y]);let P=R.useMemo(()=>({theme:y,setTheme:z,forcedTheme:e,resolvedTheme:y==="system"?S:y,themes:r?[...c,"system"]:c,systemTheme:r?S:void 0}),[y,z,e,S,r,c]);return R.createElement(Uh.Provider,{value:P},R.createElement(o3,{forcedTheme:e,storageKey:l,attribute:h,enableSystem:r,enableColorScheme:s,defaultTheme:f,value:p,themes:c,nonce:v,scriptProps:g}),m)},o3=R.memo(({forcedTheme:e,storageKey:a,attribute:r,enableSystem:s,enableColorScheme:l,defaultTheme:c,value:f,themes:h,nonce:p,scriptProps:m})=>{let v=JSON.stringify([r,a,c,e,h,f,s,l]).slice(1,-1);return R.createElement("script",{...m,suppressHydrationWarning:!0,nonce:typeof window>"u"?p:"",dangerouslySetInnerHTML:{__html:`(${t3.toString()})(${v})`}})}),l3=(e,a)=>{if(e3)return;let r;try{r=localStorage.getItem(e)||void 0}catch{}return r||a},c3=e=>{let a=document.createElement("style");return e&&a.setAttribute("nonce",e),a.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(a),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(a)},1)}},vd=e=>(e||(e=window.matchMedia(fS)),e.matches?"dark":"light");const u3=({...e})=>{const{theme:a="system"}=a3();return _.jsx(d4,{theme:a,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...e})},Rr=WE({head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1"},{title:"CommandKit DevTools"}]}),component:f3});function f3(){return _.jsxs(r3,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!1,children:[_.jsx(u3,{}),_.jsx(CM,{children:_.jsx($4,{children:_.jsx("div",{className:"[--header-height:calc(theme(spacing.14))]",children:_.jsxs(RO,{className:"flex flex-col",children:[_.jsx(J4,{}),_.jsxs("div",{className:"flex flex-1",children:[_.jsx(OM,{}),_.jsx(TO,{children:_.jsx(H0,{})})]})]})})})})]})}const d3="modulepreload",h3=function(e){return"/"+e},b0={},Bi=function(a,r,s){let l=Promise.resolve();if(r&&r.length>0){let p=function(m){return Promise.all(m.map(v=>Promise.resolve(v).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),h=f?.nonce||f?.getAttribute("nonce");l=p(r.map(m=>{if(m=h3(m),m in b0)return;b0[m]=!0;const v=m.endsWith(".css"),g=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${g}`))return;const y=document.createElement("link");if(y.rel=v?"stylesheet":d3,v||(y.as="script"),y.crossOrigin="",y.href=m,h&&y.setAttribute("nonce",h),document.head.appendChild(y),v)return new Promise((x,S)=>{y.addEventListener("load",x),y.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${m}`)))})}))}function c(f){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=f,window.dispatchEvent(h),!h.defaultPrevented)throw f}return l.then(f=>{for(const h of f||[])h.status==="rejected"&&c(h.reason);return a().catch(c)})},m3=()=>Bi(()=>import("./plugins-2z5p-Tu8.js"),[]),p3=Ba("/plugins")({component:Di(m3,"component")}),g3=()=>Bi(()=>import("./guilds-DxKiii_g.js"),[]),v3=Ba("/guilds")({component:Di(g3,"component")}),y3=()=>Bi(()=>import("./feature-flags-BV5G4Fku.js"),[]),b3=Ba("/feature-flags")({component:Di(y3,"component")}),S3=()=>Bi(()=>import("./events-mcYM4bcV.js"),[]),x3=Ba("/events")({component:Di(S3,"component")}),w3=()=>Bi(()=>import("./commands-IE8coIjN.js"),[]),E3=Ba("/commands")({component:Di(w3,"component")}),R3=()=>Bi(()=>import("./index-yV0hKx_G.js"),[]),_3=Ba("/")({component:Di(R3,"component")}),T3=p3.update({id:"/plugins",path:"/plugins",getParentRoute:()=>Rr}),C3=v3.update({id:"/guilds",path:"/guilds",getParentRoute:()=>Rr}),O3=b3.update({id:"/feature-flags",path:"/feature-flags",getParentRoute:()=>Rr}),A3=x3.update({id:"/events",path:"/events",getParentRoute:()=>Rr}),M3=E3.update({id:"/commands",path:"/commands",getParentRoute:()=>Rr}),D3=_3.update({id:"/",path:"/",getParentRoute:()=>Rr}),N3={IndexRoute:D3,CommandsRoute:M3,EventsRoute:A3,FeatureFlagsRoute:O3,GuildsRoute:C3,PluginsRoute:T3},L3=Rr._addFileChildren(N3)._addFileTypes(),j3=oR({routeTree:L3,defaultPreload:"intent",defaultStaleTime:5e3,scrollRestoration:!0,defaultViewTransition:!0}),z3=new O4;Aw.createRoot(document.getElementById("root")).render(_.jsx(R.StrictMode,{children:_.jsx(L4,{client:z3,children:_.jsx(uR,{router:j3})})}));export{FO as A,XO as B,AM as C,K4 as L,Y4 as a,MM as b,YO as c,QO as d,LM as e,DM as f,S0 as g,NM as h,Va as i,_ as j,yR as k,sD as l,Mi as m,ob as n,R as r,Nh as u};
|
|
175
|
+
`+c):s.stack=c}catch{}}throw s}}_request(a,r){typeof a=="string"?(r=r||{},r.url=a):r=a||{},r=Sr(this.defaults,r);const{transitional:s,paramsSerializer:l,headers:c}=r;s!==void 0&&$l.assertOptions(s,{silentJSONParsing:An.transitional(An.boolean),forcedJSONParsing:An.transitional(An.boolean),clarifyTimeoutError:An.transitional(An.boolean)},!1),l!=null&&(F.isFunction(l)?r.paramsSerializer={serialize:l}:$l.assertOptions(l,{encode:An.function,serialize:An.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),$l.assertOptions(r,{baseUrl:An.spelling("baseURL"),withXsrfToken:An.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let f=c&&F.merge(c.common,c[r.method]);c&&F.forEach(["delete","get","head","post","put","patch","common"],S=>{delete c[S]}),r.headers=Ue.concat(f,c);const h=[];let p=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(r)===!1||(p=p&&w.synchronous,h.unshift(w.fulfilled,w.rejected))});const m=[];this.interceptors.response.forEach(function(w){m.push(w.fulfilled,w.rejected)});let v,g=0,y;if(!p){const S=[Wy.bind(this),void 0];for(S.unshift(...h),S.push(...m),y=S.length,v=Promise.resolve(r);g<y;)v=v.then(S[g++],S[g++]);return v}y=h.length;let x=r;for(g=0;g<y;){const S=h[g++],w=h[g++];try{x=S(x)}catch(T){w.call(this,T);break}}try{v=Wy.call(this,x)}catch(S){return Promise.reject(S)}for(g=0,y=m.length;g<y;)v=v.then(m[g++],m[g++]);return v}getUri(a){a=Sr(this.defaults,a);const r=q1(a.baseURL,a.url,a.allowAbsoluteUrls);return P1(r,a.params,a.paramsSerializer)}};F.forEach(["delete","get","head","options"],function(a){mr.prototype[a]=function(r,s){return this.request(Sr(s||{},{method:a,url:r,data:(s||{}).data}))}});F.forEach(["post","put","patch"],function(a){function r(s){return function(c,f,h){return this.request(Sr(h||{},{method:a,headers:s?{"Content-Type":"multipart/form-data"}:{},url:c,data:f}))}}mr.prototype[a]=r(),mr.prototype[a+"Form"]=r(!0)});let SM=class K1{constructor(a){if(typeof a!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(c){r=c});const s=this;this.promise.then(l=>{if(!s._listeners)return;let c=s._listeners.length;for(;c-- >0;)s._listeners[c](l);s._listeners=null}),this.promise.then=l=>{let c;const f=new Promise(h=>{s.subscribe(h),c=h}).then(l);return f.cancel=function(){s.unsubscribe(c)},f},a(function(c,f,h){s.reason||(s.reason=new Ui(c,f,h),r(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(a){if(this.reason){a(this.reason);return}this._listeners?this._listeners.push(a):this._listeners=[a]}unsubscribe(a){if(!this._listeners)return;const r=this._listeners.indexOf(a);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const a=new AbortController,r=s=>{a.abort(s)};return this.subscribe(r),a.signal.unsubscribe=()=>this.unsubscribe(r),a.signal}static source(){let a;return{token:new K1(function(l){a=l}),cancel:a}}};function xM(e){return function(r){return e.apply(null,r)}}function wM(e){return F.isObject(e)&&e.isAxiosError===!0}const Bd={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(Bd).forEach(([e,a])=>{Bd[a]=e});function X1(e){const a=new mr(e),r=R1(mr.prototype.request,a);return F.extend(r,mr.prototype,a,{allOwnKeys:!0}),F.extend(r,a,null,{allOwnKeys:!0}),r.create=function(l){return X1(Sr(e,l))},r}const te=X1(fo);te.Axios=mr;te.CanceledError=Ui;te.CancelToken=SM;te.isCancel=B1;te.VERSION=Q1;te.toFormData=Cc;te.AxiosError=xt;te.Cancel=te.CanceledError;te.all=function(a){return Promise.all(a)};te.spread=xM;te.isAxiosError=wM;te.mergeConfig=Sr;te.AxiosHeaders=Ue;te.formToJSON=e=>k1(F.isHTMLForm(e)?new FormData(e):e);te.getAdapter=Y1.getAdapter;te.HttpStatusCode=Bd;te.default=te;const{Axios:F3,AxiosError:Y3,CanceledError:Q3,isCancel:K3,CancelToken:X3,VERSION:$3,all:Z3,Cancel:I3,isAxiosError:W3,spread:J3,toFormData:tD,AxiosHeaders:eD,HttpStatusCode:nD,formToJSON:aD,getAdapter:rD,mergeConfig:iD}=te,Dh=te.create({baseURL:"/api"});Dh.interceptors.request.use(e=>{const a=localStorage.getItem("access_token");return a&&(e.headers.Authorization=`Bearer ${a}`),e});Dh.interceptors.response.use(e=>e,e=>(e.response.status===401&&(localStorage.removeItem("access_token"),window.location.href="/"),Promise.reject(e)));class t0{constructor(a,r){this.client=a,this.data=r}}class EM{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/events");return a.events}}class RM{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/guilds");return a.guilds}}class _M{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/plugins");return a.plugins}}class TM{api=Dh;guilds=new RM(this);plugins=new _M(this);events=new EM(this);_user=null;get user(){return this._user}isReady(){return this._user!==null}logout(){localStorage.removeItem("access_token"),this._user=null}async fetchMe(a=!1){if(this._user&&!a)return this._user;const{data:r}=await this.api.get("/auth/@me");return this._user=new t0(this,r),this._user}async getFeatureFlags(){const{data:a}=await this.api.get("/feature-flags");return a}async login(a,r){const{data:s}=await this.api.post("/auth/login",{username:a,password:r});return s.accessToken&&localStorage.setItem("access_token",s.accessToken),this._user=new t0(this,s.user),s}}const $1=R.createContext(null);function CM({children:e}){const[a,r]=R.useState(()=>new TM);return _.jsx($1.Provider,{value:{client:a,setClient:r},children:e})}function Nh(){const e=R.use($1);if(!e)throw new Error("useClient must be used within a ClientProvider");return e.client}const pd={navMain:[{title:"Commands",url:"/commands",icon:ny,isActive:!1},{title:"Events",url:"/events",icon:ey,isActive:!1},{title:"Plugins",url:"/plugins",icon:wR,isActive:!1},{title:"Guilds",url:"/guilds",icon:iy,isActive:!1},{title:"Feature Flags",url:"/feature-flags",icon:RR,isActive:!1}],navSecondary:[{title:"GitHub",url:"https://github.com/underctrl-io/commandkit",icon:UR},{title:"Discord",url:"https://ctrl.lol/discord",icon:iy}],projects:[{name:"Commands",url:"#",icon:ny},{name:"Middlewares",url:"#",icon:CR},{name:"Events",url:"#",icon:ey}]};function OM({...e}){const a=Nh();return _.jsxs(_O,{className:"top-(--header-height) h-[calc(100svh-var(--header-height))]!",...e,children:[_.jsx(CO,{children:_.jsx(io,{children:_.jsx(so,{children:_.jsx(oo,{size:"lg",asChild:!0,children:_.jsxs(Mi,{to:"/",children:[_.jsx("div",{className:"border-sidebar-primary border text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-lg",children:_.jsx("img",{src:"/logo.webp",alt:"Logo",className:"size-6"})}),_.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[_.jsx("span",{className:"truncate font-medium",children:"CommandKit"}),_.jsx("span",{className:"truncate text-xs",children:"DevTools"})]})]})})})})}),_.jsxs(AO,{children:[_.jsx(NO,{items:pd.navMain}),_.jsx(LO,{projects:pd.projects}),_.jsx(jO,{items:pd.navSecondary,className:"mt-auto"})]}),_.jsx(OO,{children:_.jsx($O,{user:{avatar:a.user.data.displayAvatarURL,name:a.user.data.globalName||a.user?.data.username,username:a.user.data.username}})})]})}function AM({className:e,...a}){return _.jsx("div",{"data-slot":"card",className:Et("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...a})}function MM({className:e,...a}){return _.jsx("div",{"data-slot":"card-header",className:Et("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...a})}function DM({className:e,...a}){return _.jsx("div",{"data-slot":"card-title",className:Et("leading-none font-semibold",e),...a})}function NM({className:e,...a}){return _.jsx("div",{"data-slot":"card-description",className:Et("text-muted-foreground text-sm",e),...a})}function LM({className:e,...a}){return _.jsx("div",{"data-slot":"card-content",className:Et("px-6",e),...a})}function sD({className:e,...a}){return _.jsx("div",{"data-slot":"card-footer",className:Et("flex items-center px-6 [.border-t]:pt-6",e),...a})}var jM="Label",Z1=R.forwardRef((e,a)=>_.jsx(Xt.label,{...e,ref:a,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Z1.displayName=jM;var zM=Z1;function e0({className:e,...a}){return _.jsx(zM,{"data-slot":"label",className:Et("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...a})}const n0=e=>{let a;const r=new Set,s=(m,v)=>{const g=typeof m=="function"?m(a):m;if(!Object.is(g,a)){const y=a;a=v??(typeof g!="object"||g===null)?g:Object.assign({},a,g),r.forEach(x=>x(a,y))}},l=()=>a,h={setState:s,getState:l,getInitialState:()=>p,subscribe:m=>(r.add(m),()=>r.delete(m))},p=a=e(s,l,h);return h},PM=(e=>e?n0(e):n0),UM=e=>e;function kM(e,a=UM){const r=J.useSyncExternalStore(e.subscribe,J.useCallback(()=>a(e.getState()),[e,a]),J.useCallback(()=>a(e.getInitialState()),[e,a]));return J.useDebugValue(r),r}const a0=e=>{const a=PM(e),r=s=>kM(a,s);return Object.assign(r,a),r},BM=(e=>e?a0(e):a0),I1=BM(e=>({authenticated:!1,setAuthenticated:a=>e({authenticated:a})}));function HM(e){if(typeof document>"u")return;let a=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",a.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const qM=e=>{switch(e){case"success":return FM;case"info":return QM;case"warning":return YM;case"error":return KM;default:return null}},VM=Array(12).fill(0),GM=({visible:e,className:a})=>J.createElement("div",{className:["sonner-loading-wrapper",a].filter(Boolean).join(" "),"data-visible":e},J.createElement("div",{className:"sonner-spinner"},VM.map((r,s)=>J.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),FM=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),YM=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),QM=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),KM=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),XM=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},J.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),J.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),$M=()=>{const[e,a]=J.useState(document.hidden);return J.useEffect(()=>{const r=()=>{a(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let Hd=1;class ZM{constructor(){this.subscribe=a=>(this.subscribers.push(a),()=>{const r=this.subscribers.indexOf(a);this.subscribers.splice(r,1)}),this.publish=a=>{this.subscribers.forEach(r=>r(a))},this.addToast=a=>{this.publish(a),this.toasts=[...this.toasts,a]},this.create=a=>{var r;const{message:s,...l}=a,c=typeof a?.id=="number"||((r=a.id)==null?void 0:r.length)>0?a.id:Hd++,f=this.toasts.find(p=>p.id===c),h=a.dismissible===void 0?!0:a.dismissible;return this.dismissedToasts.has(c)&&this.dismissedToasts.delete(c),f?this.toasts=this.toasts.map(p=>p.id===c?(this.publish({...p,...a,id:c,title:s}),{...p,...a,id:c,dismissible:h,title:s}):p):this.addToast({title:s,...l,dismissible:h,id:c}),c},this.dismiss=a=>(a?(this.dismissedToasts.add(a),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:a,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),a),this.message=(a,r)=>this.create({...r,message:a}),this.error=(a,r)=>this.create({...r,message:a,type:"error"}),this.success=(a,r)=>this.create({...r,type:"success",message:a}),this.info=(a,r)=>this.create({...r,type:"info",message:a}),this.warning=(a,r)=>this.create({...r,type:"warning",message:a}),this.loading=(a,r)=>this.create({...r,type:"loading",message:a}),this.promise=(a,r)=>{if(!r)return;let s;r.loading!==void 0&&(s=this.create({...r,promise:a,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const l=Promise.resolve(a instanceof Function?a():a);let c=s!==void 0,f;const h=l.then(async m=>{if(f=["resolve",m],J.isValidElement(m))c=!1,this.create({id:s,type:"default",message:m});else if(WM(m)&&!m.ok){c=!1;const g=typeof r.error=="function"?await r.error(`HTTP error! status: ${m.status}`):r.error,y=typeof r.description=="function"?await r.description(`HTTP error! status: ${m.status}`):r.description,S=typeof g=="object"&&!J.isValidElement(g)?g:{message:g};this.create({id:s,type:"error",description:y,...S})}else if(m instanceof Error){c=!1;const g=typeof r.error=="function"?await r.error(m):r.error,y=typeof r.description=="function"?await r.description(m):r.description,S=typeof g=="object"&&!J.isValidElement(g)?g:{message:g};this.create({id:s,type:"error",description:y,...S})}else if(r.success!==void 0){c=!1;const g=typeof r.success=="function"?await r.success(m):r.success,y=typeof r.description=="function"?await r.description(m):r.description,S=typeof g=="object"&&!J.isValidElement(g)?g:{message:g};this.create({id:s,type:"success",description:y,...S})}}).catch(async m=>{if(f=["reject",m],r.error!==void 0){c=!1;const v=typeof r.error=="function"?await r.error(m):r.error,g=typeof r.description=="function"?await r.description(m):r.description,x=typeof v=="object"&&!J.isValidElement(v)?v:{message:v};this.create({id:s,type:"error",description:g,...x})}}).finally(()=>{c&&(this.dismiss(s),s=void 0),r.finally==null||r.finally.call(r)}),p=()=>new Promise((m,v)=>h.then(()=>f[0]==="reject"?v(f[1]):m(f[1])).catch(v));return typeof s!="string"&&typeof s!="number"?{unwrap:p}:Object.assign(s,{unwrap:p})},this.custom=(a,r)=>{const s=r?.id||Hd++;return this.create({jsx:a(s),id:s,...r}),s},this.getActiveToasts=()=>this.toasts.filter(a=>!this.dismissedToasts.has(a.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const je=new ZM,IM=(e,a)=>{const r=a?.id||Hd++;return je.addToast({title:e,...a,id:r}),r},WM=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",JM=IM,t4=()=>je.toasts,e4=()=>je.getActiveToasts(),r0=Object.assign(JM,{success:je.success,info:je.info,warning:je.warning,error:je.error,custom:je.custom,message:je.message,promise:je.promise,dismiss:je.dismiss,loading:je.loading},{getHistory:t4,getToasts:e4});HM("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Hl(e){return e.label!==void 0}const n4=3,a4="24px",r4="16px",i0=4e3,i4=356,s4=14,o4=45,l4=200;function Mn(...e){return e.filter(Boolean).join(" ")}function c4(e){const[a,r]=e.split("-"),s=[];return a&&s.push(a),r&&s.push(r),s}const u4=e=>{var a,r,s,l,c,f,h,p,m;const{invert:v,toast:g,unstyled:y,interacting:x,setHeights:S,visibleToasts:w,heights:T,index:C,toasts:z,expanded:N,removeToast:P,defaultRichColors:L,closeButton:K,style:V,cancelButtonStyle:G,actionButtonStyle:et,className:W="",descriptionClassName:at="",duration:rt,position:ft,gap:mt,expandByDefault:dt,classNames:D,icons:Y,closeButtonAriaLabel:q="Close toast"}=e,[ht,O]=J.useState(null),[X,nt]=J.useState(null),[Q,tt]=J.useState(!1),[st,it]=J.useState(!1),[yt,ut]=J.useState(!1),[Bt,re]=J.useState(!1),[Ft,ie]=J.useState(!1),[Ke,xn]=J.useState(0),[Hi,_r]=J.useState(0),fe=J.useRef(g.duration||rt||i0),kn=J.useRef(null),ve=J.useRef(null),Ga=C===0,Bn=C+1<=w,Rt=g.type,Vt=g.dismissible!==!1,Xe=g.className||"",ho=g.descriptionClassName||"",wn=J.useMemo(()=>T.findIndex(St=>St.toastId===g.id)||0,[T,g.id]),Te=J.useMemo(()=>{var St;return(St=g.closeButton)!=null?St:K},[g.closeButton,K]),dn=J.useMemo(()=>g.duration||rt||i0,[g.duration,rt]),ye=J.useRef(0),la=J.useRef(0),mo=J.useRef(0),ca=J.useRef(null),[Tr,Cr]=ft.split("-"),En=J.useMemo(()=>T.reduce((St,$t,ee)=>ee>=wn?St:St+$t.height,0),[T,wn]),Fa=$M(),Ya=g.invert||v,qi=Rt==="loading";la.current=J.useMemo(()=>wn*mt+En,[wn,En]),J.useEffect(()=>{fe.current=dn},[dn]),J.useEffect(()=>{tt(!0)},[]),J.useEffect(()=>{const St=ve.current;if(St){const $t=St.getBoundingClientRect().height;return _r($t),S(ee=>[{toastId:g.id,height:$t,position:g.position},...ee]),()=>S(ee=>ee.filter(be=>be.toastId!==g.id))}},[S,g.id]),J.useLayoutEffect(()=>{if(!Q)return;const St=ve.current,$t=St.style.height;St.style.height="auto";const ee=St.getBoundingClientRect().height;St.style.height=$t,_r(ee),S(be=>be.find(se=>se.toastId===g.id)?be.map(se=>se.toastId===g.id?{...se,height:ee}:se):[{toastId:g.id,height:ee,position:g.position},...be])},[Q,g.title,g.description,S,g.id,g.jsx,g.action,g.cancel]);const hn=J.useCallback(()=>{it(!0),xn(la.current),S(St=>St.filter($t=>$t.toastId!==g.id)),setTimeout(()=>{P(g)},l4)},[g,P,S,la]);J.useEffect(()=>{if(g.promise&&Rt==="loading"||g.duration===1/0||g.type==="loading")return;let St;return N||x||Fa?(()=>{if(mo.current<ye.current){const be=new Date().getTime()-ye.current;fe.current=fe.current-be}mo.current=new Date().getTime()})():(()=>{fe.current!==1/0&&(ye.current=new Date().getTime(),St=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),hn()},fe.current))})(),()=>clearTimeout(St)},[N,x,g,Rt,Fa,hn]),J.useEffect(()=>{g.delete&&(hn(),g.onDismiss==null||g.onDismiss.call(g,g))},[hn,g.delete]);function po(){var St;if(Y?.loading){var $t;return J.createElement("div",{className:Mn(D?.loader,g==null||($t=g.classNames)==null?void 0:$t.loader,"sonner-loader"),"data-visible":Rt==="loading"},Y.loading)}return J.createElement(GM,{className:Mn(D?.loader,g==null||(St=g.classNames)==null?void 0:St.loader),visible:Rt==="loading"})}const Vi=g.icon||Y?.[Rt]||qM(Rt);var ua,go;return J.createElement("li",{tabIndex:0,ref:ve,className:Mn(W,Xe,D?.toast,g==null||(a=g.classNames)==null?void 0:a.toast,D?.default,D?.[Rt],g==null||(r=g.classNames)==null?void 0:r[Rt]),"data-sonner-toast":"","data-rich-colors":(ua=g.richColors)!=null?ua:L,"data-styled":!(g.jsx||g.unstyled||y),"data-mounted":Q,"data-promise":!!g.promise,"data-swiped":Ft,"data-removed":st,"data-visible":Bn,"data-y-position":Tr,"data-x-position":Cr,"data-index":C,"data-front":Ga,"data-swiping":yt,"data-dismissible":Vt,"data-type":Rt,"data-invert":Ya,"data-swipe-out":Bt,"data-swipe-direction":X,"data-expanded":!!(N||dt&&Q),"data-testid":g.testId,style:{"--index":C,"--toasts-before":C,"--z-index":z.length-C,"--offset":`${st?Ke:la.current}px`,"--initial-height":dt?"auto":`${Hi}px`,...V,...g.style},onDragEnd:()=>{ut(!1),O(null),ca.current=null},onPointerDown:St=>{St.button!==2&&(qi||!Vt||(kn.current=new Date,xn(la.current),St.target.setPointerCapture(St.pointerId),St.target.tagName!=="BUTTON"&&(ut(!0),ca.current={x:St.clientX,y:St.clientY})))},onPointerUp:()=>{var St,$t,ee;if(Bt||!Vt)return;ca.current=null;const be=Number(((St=ve.current)==null?void 0:St.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Qa=Number((($t=ve.current)==null?void 0:$t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),se=new Date().getTime()-((ee=kn.current)==null?void 0:ee.getTime()),Zt=ht==="x"?be:Qa,It=Math.abs(Zt)/se;if(Math.abs(Zt)>=o4||It>.11){xn(la.current),g.onDismiss==null||g.onDismiss.call(g,g),nt(ht==="x"?be>0?"right":"left":Qa>0?"down":"up"),hn(),re(!0);return}else{var Ht,de;(Ht=ve.current)==null||Ht.style.setProperty("--swipe-amount-x","0px"),(de=ve.current)==null||de.style.setProperty("--swipe-amount-y","0px")}ie(!1),ut(!1),O(null)},onPointerMove:St=>{var $t,ee,be;if(!ca.current||!Vt||(($t=window.getSelection())==null?void 0:$t.toString().length)>0)return;const se=St.clientY-ca.current.y,Zt=St.clientX-ca.current.x;var It;const Ht=(It=e.swipeDirections)!=null?It:c4(ft);!ht&&(Math.abs(Zt)>1||Math.abs(se)>1)&&O(Math.abs(Zt)>Math.abs(se)?"x":"y");let de={x:0,y:0};const Or=Hn=>1/(1.5+Math.abs(Hn)/20);if(ht==="y"){if(Ht.includes("top")||Ht.includes("bottom"))if(Ht.includes("top")&&se<0||Ht.includes("bottom")&&se>0)de.y=se;else{const Hn=se*Or(se);de.y=Math.abs(Hn)<Math.abs(se)?Hn:se}}else if(ht==="x"&&(Ht.includes("left")||Ht.includes("right")))if(Ht.includes("left")&&Zt<0||Ht.includes("right")&&Zt>0)de.x=Zt;else{const Hn=Zt*Or(Zt);de.x=Math.abs(Hn)<Math.abs(Zt)?Hn:Zt}(Math.abs(de.x)>0||Math.abs(de.y)>0)&&ie(!0),(ee=ve.current)==null||ee.style.setProperty("--swipe-amount-x",`${de.x}px`),(be=ve.current)==null||be.style.setProperty("--swipe-amount-y",`${de.y}px`)}},Te&&!g.jsx&&Rt!=="loading"?J.createElement("button",{"aria-label":q,"data-disabled":qi,"data-close-button":!0,onClick:qi||!Vt?()=>{}:()=>{hn(),g.onDismiss==null||g.onDismiss.call(g,g)},className:Mn(D?.closeButton,g==null||(s=g.classNames)==null?void 0:s.closeButton)},(go=Y?.close)!=null?go:XM):null,(Rt||g.icon||g.promise)&&g.icon!==null&&(Y?.[Rt]!==null||g.icon)?J.createElement("div",{"data-icon":"",className:Mn(D?.icon,g==null||(l=g.classNames)==null?void 0:l.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||po():null,g.type!=="loading"?Vi:null):null,J.createElement("div",{"data-content":"",className:Mn(D?.content,g==null||(c=g.classNames)==null?void 0:c.content)},J.createElement("div",{"data-title":"",className:Mn(D?.title,g==null||(f=g.classNames)==null?void 0:f.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?J.createElement("div",{"data-description":"",className:Mn(at,ho,D?.description,g==null||(h=g.classNames)==null?void 0:h.description)},typeof g.description=="function"?g.description():g.description):null),J.isValidElement(g.cancel)?g.cancel:g.cancel&&Hl(g.cancel)?J.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||G,onClick:St=>{Hl(g.cancel)&&Vt&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,St),hn())},className:Mn(D?.cancelButton,g==null||(p=g.classNames)==null?void 0:p.cancelButton)},g.cancel.label):null,J.isValidElement(g.action)?g.action:g.action&&Hl(g.action)?J.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||et,onClick:St=>{Hl(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,St),!St.defaultPrevented&&hn())},className:Mn(D?.actionButton,g==null||(m=g.classNames)==null?void 0:m.actionButton)},g.action.label):null)};function s0(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function f4(e,a){const r={};return[e,a].forEach((s,l)=>{const c=l===1,f=c?"--mobile-offset":"--offset",h=c?r4:a4;function p(m){["top","right","bottom","left"].forEach(v=>{r[`${f}-${v}`]=typeof m=="number"?`${m}px`:m})}typeof s=="number"||typeof s=="string"?p(s):typeof s=="object"?["top","right","bottom","left"].forEach(m=>{s[m]===void 0?r[`${f}-${m}`]=h:r[`${f}-${m}`]=typeof s[m]=="number"?`${s[m]}px`:s[m]}):p(h)}),r}const d4=J.forwardRef(function(a,r){const{id:s,invert:l,position:c="bottom-right",hotkey:f=["altKey","KeyT"],expand:h,closeButton:p,className:m,offset:v,mobileOffset:g,theme:y="light",richColors:x,duration:S,style:w,visibleToasts:T=n4,toastOptions:C,dir:z=s0(),gap:N=s4,icons:P,containerAriaLabel:L="Notifications"}=a,[K,V]=J.useState([]),G=J.useMemo(()=>s?K.filter(Q=>Q.toasterId===s):K.filter(Q=>!Q.toasterId),[K,s]),et=J.useMemo(()=>Array.from(new Set([c].concat(G.filter(Q=>Q.position).map(Q=>Q.position)))),[G,c]),[W,at]=J.useState([]),[rt,ft]=J.useState(!1),[mt,dt]=J.useState(!1),[D,Y]=J.useState(y!=="system"?y:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=J.useRef(null),ht=f.join("+").replace(/Key/g,"").replace(/Digit/g,""),O=J.useRef(null),X=J.useRef(!1),nt=J.useCallback(Q=>{V(tt=>{var st;return(st=tt.find(it=>it.id===Q.id))!=null&&st.delete||je.dismiss(Q.id),tt.filter(({id:it})=>it!==Q.id)})},[]);return J.useEffect(()=>je.subscribe(Q=>{if(Q.dismiss){requestAnimationFrame(()=>{V(tt=>tt.map(st=>st.id===Q.id?{...st,delete:!0}:st))});return}setTimeout(()=>{U0.flushSync(()=>{V(tt=>{const st=tt.findIndex(it=>it.id===Q.id);return st!==-1?[...tt.slice(0,st),{...tt[st],...Q},...tt.slice(st+1)]:[Q,...tt]})})})}),[K]),J.useEffect(()=>{if(y!=="system"){Y(y);return}if(y==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window>"u")return;const Q=window.matchMedia("(prefers-color-scheme: dark)");try{Q.addEventListener("change",({matches:tt})=>{Y(tt?"dark":"light")})}catch{Q.addListener(({matches:st})=>{try{Y(st?"dark":"light")}catch(it){console.error(it)}})}},[y]),J.useEffect(()=>{K.length<=1&&ft(!1)},[K]),J.useEffect(()=>{const Q=tt=>{var st;if(f.every(ut=>tt[ut]||tt.code===ut)){var yt;ft(!0),(yt=q.current)==null||yt.focus()}tt.code==="Escape"&&(document.activeElement===q.current||(st=q.current)!=null&&st.contains(document.activeElement))&&ft(!1)};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[f]),J.useEffect(()=>{if(q.current)return()=>{O.current&&(O.current.focus({preventScroll:!0}),O.current=null,X.current=!1)}},[q.current]),J.createElement("section",{ref:r,"aria-label":`${L} ${ht}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},et.map((Q,tt)=>{var st;const[it,yt]=Q.split("-");return G.length?J.createElement("ol",{key:Q,dir:z==="auto"?s0():z,tabIndex:-1,ref:q,className:m,"data-sonner-toaster":!0,"data-sonner-theme":D,"data-y-position":it,"data-x-position":yt,style:{"--front-toast-height":`${((st=W[0])==null?void 0:st.height)||0}px`,"--width":`${i4}px`,"--gap":`${N}px`,...w,...f4(v,g)},onBlur:ut=>{X.current&&!ut.currentTarget.contains(ut.relatedTarget)&&(X.current=!1,O.current&&(O.current.focus({preventScroll:!0}),O.current=null))},onFocus:ut=>{ut.target instanceof HTMLElement&&ut.target.dataset.dismissible==="false"||X.current||(X.current=!0,O.current=ut.relatedTarget)},onMouseEnter:()=>ft(!0),onMouseMove:()=>ft(!0),onMouseLeave:()=>{mt||ft(!1)},onDragEnd:()=>ft(!1),onPointerDown:ut=>{ut.target instanceof HTMLElement&&ut.target.dataset.dismissible==="false"||dt(!0)},onPointerUp:()=>dt(!1)},G.filter(ut=>!ut.position&&tt===0||ut.position===Q).map((ut,Bt)=>{var re,Ft;return J.createElement(u4,{key:ut.id,icons:P,index:Bt,toast:ut,defaultRichColors:x,duration:(re=C?.duration)!=null?re:S,className:C?.className,descriptionClassName:C?.descriptionClassName,invert:l,visibleToasts:T,closeButton:(Ft=C?.closeButton)!=null?Ft:p,interacting:mt,position:Q,style:C?.style,unstyled:C?.unstyled,classNames:C?.classNames,cancelButtonStyle:C?.cancelButtonStyle,actionButtonStyle:C?.actionButtonStyle,closeButtonAriaLabel:C?.closeButtonAriaLabel,removeToast:nt,toasts:G.filter(ie=>ie.position==ut.position),heights:W.filter(ie=>ie.position==ut.position),setHeights:at,expandByDefault:h,gap:N,expanded:rt,swipeDirections:a.swipeDirections})})):null}))});var ki=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},xr=typeof window>"u"||"Deno"in globalThis;function Oe(){}function h4(e,a){return typeof e=="function"?e(a):e}function qd(e){return typeof e=="number"&&e>=0&&e!==1/0}function W1(e,a){return Math.max(e+(a||0)-Date.now(),0)}function ka(e,a){return typeof e=="function"?e(a):e}function on(e,a){return typeof e=="function"?e(a):e}function o0(e,a){const{type:r="all",exact:s,fetchStatus:l,predicate:c,queryKey:f,stale:h}=e;if(f){if(s){if(a.queryHash!==Lh(f,a.options))return!1}else if(!Js(a.queryKey,f))return!1}if(r!=="all"){const p=a.isActive();if(r==="active"&&!p||r==="inactive"&&p)return!1}return!(typeof h=="boolean"&&a.isStale()!==h||l&&l!==a.state.fetchStatus||c&&!c(a))}function l0(e,a){const{exact:r,status:s,predicate:l,mutationKey:c}=e;if(c){if(!a.options.mutationKey)return!1;if(r){if(wr(a.options.mutationKey)!==wr(c))return!1}else if(!Js(a.options.mutationKey,c))return!1}return!(s&&a.state.status!==s||l&&!l(a))}function Lh(e,a){return(a?.queryKeyHashFn||wr)(e)}function wr(e){return JSON.stringify(e,(a,r)=>Vd(r)?Object.keys(r).sort().reduce((s,l)=>(s[l]=r[l],s),{}):r)}function Js(e,a){return e===a?!0:typeof e!=typeof a?!1:e&&a&&typeof e=="object"&&typeof a=="object"?Object.keys(a).every(r=>Js(e[r],a[r])):!1}function J1(e,a){if(e===a)return e;const r=c0(e)&&c0(a);if(r||Vd(e)&&Vd(a)){const s=r?e:Object.keys(e),l=s.length,c=r?a:Object.keys(a),f=c.length,h=r?[]:{},p=new Set(s);let m=0;for(let v=0;v<f;v++){const g=r?v:c[v];(!r&&p.has(g)||r)&&e[g]===void 0&&a[g]===void 0?(h[g]=void 0,m++):(h[g]=J1(e[g],a[g]),h[g]===e[g]&&e[g]!==void 0&&m++)}return l===f&&m===l?e:h}return a}function uc(e,a){if(!a||Object.keys(e).length!==Object.keys(a).length)return!1;for(const r in e)if(e[r]!==a[r])return!1;return!0}function c0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Vd(e){if(!u0(e))return!1;const a=e.constructor;if(a===void 0)return!0;const r=a.prototype;return!(!u0(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function u0(e){return Object.prototype.toString.call(e)==="[object Object]"}function m4(e){return new Promise(a=>{setTimeout(a,e)})}function Gd(e,a,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,a):r.structuralSharing!==!1?J1(e,a):a}function p4(e,a,r=0){const s=[...e,a];return r&&s.length>r?s.slice(1):s}function g4(e,a,r=0){const s=[a,...e];return r&&s.length>r?s.slice(0,-1):s}var jh=Symbol();function tS(e,a){return!e.queryFn&&a?.initialPromise?()=>a.initialPromise:!e.queryFn||e.queryFn===jh?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function eS(e,a){return typeof e=="function"?e(...a):!!e}var v4=class extends ki{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!xr&&window.addEventListener){const a=()=>e();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(a=>{a(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},zh=new v4,y4=class extends ki{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!xr&&window.addEventListener){const a=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},fc=new y4;function Fd(){let e,a;const r=new Promise((l,c)=>{e=l,a=c});r.status="pending",r.catch(()=>{});function s(l){Object.assign(r,l),delete r.resolve,delete r.reject}return r.resolve=l=>{s({status:"fulfilled",value:l}),e(l)},r.reject=l=>{s({status:"rejected",reason:l}),a(l)},r}function b4(e){return Math.min(1e3*2**e,3e4)}function nS(e){return(e??"online")==="online"?fc.isOnline():!0}var aS=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function rS(e){let a=!1,r=0,s;const l=Fd(),c=()=>l.status!=="pending",f=w=>{c()||(y(new aS(w)),e.abort?.())},h=()=>{a=!0},p=()=>{a=!1},m=()=>zh.isFocused()&&(e.networkMode==="always"||fc.isOnline())&&e.canRun(),v=()=>nS(e.networkMode)&&e.canRun(),g=w=>{c()||(s?.(),l.resolve(w))},y=w=>{c()||(s?.(),l.reject(w))},x=()=>new Promise(w=>{s=T=>{(c()||m())&&w(T)},e.onPause?.()}).then(()=>{s=void 0,c()||e.onContinue?.()}),S=()=>{if(c())return;let w;const T=r===0?e.initialPromise:void 0;try{w=T??e.fn()}catch(C){w=Promise.reject(C)}Promise.resolve(w).then(g).catch(C=>{if(c())return;const z=e.retry??(xr?0:3),N=e.retryDelay??b4,P=typeof N=="function"?N(r,C):N,L=z===!0||typeof z=="number"&&r<z||typeof z=="function"&&z(r,C);if(a||!L){y(C);return}r++,e.onFail?.(r,C),m4(P).then(()=>m()?void 0:x()).then(()=>{a?y(C):S()})})};return{promise:l,status:()=>l.status,cancel:f,continue:()=>(s?.(),l),cancelRetry:h,continueRetry:p,canStart:v,start:()=>(v()?S():x().then(S),l)}}var S4=e=>setTimeout(e,0);function x4(){let e=[],a=0,r=h=>{h()},s=h=>{h()},l=S4;const c=h=>{a?e.push(h):l(()=>{r(h)})},f=()=>{const h=e;e=[],h.length&&l(()=>{s(()=>{h.forEach(p=>{r(p)})})})};return{batch:h=>{let p;a++;try{p=h()}finally{a--,a||f()}return p},batchCalls:h=>(...p)=>{c(()=>{h(...p)})},schedule:c,setNotifyFunction:h=>{r=h},setBatchNotifyFunction:h=>{s=h},setScheduler:h=>{l=h}}}var ue=x4(),iS=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),qd(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(xr?1/0:300*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},w4=class extends iS{#e;#t;#n;#a;#r;#s;#o;constructor(e){super(),this.#o=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#a=e.client,this.#n=this.#a.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=E4(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){this.options={...this.#s,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,a){const r=Gd(this.state.data,e,this.options);return this.#i({data:r,type:"success",dataUpdatedAt:a?.updatedAt,manual:a?.manual}),r}setState(e,a){this.#i({type:"setState",state:e,setStateOptions:a})}cancel(e){const a=this.#r?.promise;return this.#r?.cancel(e),a?a.then(Oe).catch(Oe):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>on(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===jh||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ka(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!W1(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(a=>a.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(a=>a.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(a=>a!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,a){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&a?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const r=new AbortController,s=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#o=!0,r.signal)})},l=()=>{const h=tS(this.options,a),m=(()=>{const v={client:this.#a,queryKey:this.queryKey,meta:this.meta};return s(v),v})();return this.#o=!1,this.options.persister?this.options.persister(h,m,this):h(m)},f=(()=>{const h={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:l};return s(h),h})();this.options.behavior?.onFetch(f,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==f.fetchOptions?.meta)&&this.#i({type:"fetch",meta:f.fetchOptions?.meta}),this.#r=rS({initialPromise:a?.initialPromise,fn:f.fetchFn,abort:r.abort.bind(r),onFail:(h,p)=>{this.#i({type:"failed",failureCount:h,error:p})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0});try{const h=await this.#r.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#n.config.onSuccess?.(h,this),this.#n.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof aS){if(h.silent)return this.#r.promise;if(h.revert){if(this.setState({...this.#t,fetchStatus:"idle"}),this.state.data===void 0)throw h;return this.state.data}}throw this.#i({type:"error",error:h}),this.#n.config.onError?.(h,this),this.#n.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#i(e){const a=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...sS(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?s:void 0,s;case"error":const l=e.error;return{...r,error:l,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:l,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=a(this.state),ue.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function sS(e,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:nS(a.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function E4(e){const a=typeof e.initialData=="function"?e.initialData():e.initialData,r=a!==void 0,s=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var R4=class extends ki{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,a,r){const s=a.queryKey,l=a.queryHash??Lh(s,a);let c=this.get(l);return c||(c=new w4({client:e,queryKey:s,queryHash:l,options:e.defaultQueryOptions(a),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(c)),c}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const a=this.#e.get(e.queryHash);a&&(e.destroy(),a===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ue.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const a={exact:!0,...e};return this.getAll().find(r=>o0(a,r))}findAll(e={}){const a=this.getAll();return Object.keys(e).length>0?a.filter(r=>o0(e,r)):a}notify(e){ue.batch(()=>{this.listeners.forEach(a=>{a(e)})})}onFocus(){ue.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ue.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},_4=class extends iS{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||oS(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(a=>a!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){const a=()=>{this.#a({type:"continue"})};this.#n=rS({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(l,c)=>{this.#a({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#a({type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const r=this.state.status==="pending",s=!this.#n.canStart();try{if(r)a();else{this.#a({type:"pending",variables:e,isPaused:s}),await this.#t.config.onMutate?.(e,this);const c=await this.options.onMutate?.(e);c!==this.state.context&&this.#a({type:"pending",context:c,variables:e,isPaused:s})}const l=await this.#n.start();return await this.#t.config.onSuccess?.(l,e,this.state.context,this),await this.options.onSuccess?.(l,e,this.state.context),await this.#t.config.onSettled?.(l,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(l,null,e,this.state.context),this.#a({type:"success",data:l}),l}catch(l){try{throw await this.#t.config.onError?.(l,e,this.state.context,this),await this.options.onError?.(l,e,this.state.context),await this.#t.config.onSettled?.(void 0,l,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,l,e,this.state.context),l}finally{this.#a({type:"error",error:l})}}finally{this.#t.runNext(this)}}#a(e){const a=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=a(this.state),ue.batch(()=>{this.#e.forEach(r=>{r.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function oS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var T4=class extends ki{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,a,r){const s=new _4({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(a),state:r});return this.add(s),s}add(e){this.#e.add(e);const a=ql(e);if(typeof a=="string"){const r=this.#t.get(a);r?r.push(e):this.#t.set(a,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const a=ql(e);if(typeof a=="string"){const r=this.#t.get(a);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&this.#t.delete(a)}}this.notify({type:"removed",mutation:e})}canRun(e){const a=ql(e);if(typeof a=="string"){const s=this.#t.get(a)?.find(l=>l.state.status==="pending");return!s||s===e}else return!0}runNext(e){const a=ql(e);return typeof a=="string"?this.#t.get(a)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ue.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const a={exact:!0,...e};return this.getAll().find(r=>l0(a,r))}findAll(e={}){return this.getAll().filter(a=>l0(e,a))}notify(e){ue.batch(()=>{this.listeners.forEach(a=>{a(e)})})}resumePausedMutations(){const e=this.getAll().filter(a=>a.state.isPaused);return ue.batch(()=>Promise.all(e.map(a=>a.continue().catch(Oe))))}};function ql(e){return e.options.scope?.id}function f0(e){return{onFetch:(a,r)=>{const s=a.options,l=a.fetchOptions?.meta?.fetchMore?.direction,c=a.state.data?.pages||[],f=a.state.data?.pageParams||[];let h={pages:[],pageParams:[]},p=0;const m=async()=>{let v=!1;const g=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(a.signal.aborted?v=!0:a.signal.addEventListener("abort",()=>{v=!0}),a.signal)})},y=tS(a.options,a.fetchOptions),x=async(S,w,T)=>{if(v)return Promise.reject();if(w==null&&S.pages.length)return Promise.resolve(S);const z=(()=>{const K={client:a.client,queryKey:a.queryKey,pageParam:w,direction:T?"backward":"forward",meta:a.options.meta};return g(K),K})(),N=await y(z),{maxPages:P}=a.options,L=T?g4:p4;return{pages:L(S.pages,N,P),pageParams:L(S.pageParams,w,P)}};if(l&&c.length){const S=l==="backward",w=S?C4:d0,T={pages:c,pageParams:f},C=w(s,T);h=await x(T,C,S)}else{const S=e??c.length;do{const w=p===0?f[0]??s.initialPageParam:d0(s,h);if(p>0&&w==null)break;h=await x(h,w),p++}while(p<S)}return h};a.options.persister?a.fetchFn=()=>a.options.persister?.(m,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},r):a.fetchFn=m}}}function d0(e,{pages:a,pageParams:r}){const s=a.length-1;return a.length>0?e.getNextPageParam(a[s],a,r[s],r):void 0}function C4(e,{pages:a,pageParams:r}){return a.length>0?e.getPreviousPageParam?.(a[0],a,r[0],r):void 0}var O4=class{#e;#t;#n;#a;#r;#s;#o;#i;constructor(e={}){this.#e=e.queryCache||new R4,this.#t=e.mutationCache||new T4,this.#n=e.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#o=zh.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=fc.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#o?.(),this.#o=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const a=this.defaultQueryOptions({queryKey:e});return this.#e.get(a.queryHash)?.state.data}ensureQueryData(e){const a=this.defaultQueryOptions(e),r=this.#e.build(this,a),s=r.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(ka(a.staleTime,r))&&this.prefetchQuery(a),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:a,state:r})=>{const s=r.data;return[a,s]})}setQueryData(e,a,r){const s=this.defaultQueryOptions({queryKey:e}),c=this.#e.get(s.queryHash)?.state.data,f=h4(a,c);if(f!==void 0)return this.#e.build(this,s).setData(f,{...r,manual:!0})}setQueriesData(e,a,r){return ue.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,a,r)]))}getQueryState(e){const a=this.defaultQueryOptions({queryKey:e});return this.#e.get(a.queryHash)?.state}removeQueries(e){const a=this.#e;ue.batch(()=>{a.findAll(e).forEach(r=>{a.remove(r)})})}resetQueries(e,a){const r=this.#e;return ue.batch(()=>(r.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},a)))}cancelQueries(e,a={}){const r={revert:!0,...a},s=ue.batch(()=>this.#e.findAll(e).map(l=>l.cancel(r)));return Promise.all(s).then(Oe).catch(Oe)}invalidateQueries(e,a={}){return ue.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},a)))}refetchQueries(e,a={}){const r={...a,cancelRefetch:a.cancelRefetch??!0},s=ue.batch(()=>this.#e.findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let c=l.fetch(void 0,r);return r.throwOnError||(c=c.catch(Oe)),l.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(s).then(Oe)}fetchQuery(e){const a=this.defaultQueryOptions(e);a.retry===void 0&&(a.retry=!1);const r=this.#e.build(this,a);return r.isStaleByTime(ka(a.staleTime,r))?r.fetch(a):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Oe).catch(Oe)}fetchInfiniteQuery(e){return e.behavior=f0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Oe).catch(Oe)}ensureInfiniteQueryData(e){return e.behavior=f0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return fc.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,a){this.#a.set(wr(e),{queryKey:e,defaultOptions:a})}getQueryDefaults(e){const a=[...this.#a.values()],r={};return a.forEach(s=>{Js(e,s.queryKey)&&Object.assign(r,s.defaultOptions)}),r}setMutationDefaults(e,a){this.#r.set(wr(e),{mutationKey:e,defaultOptions:a})}getMutationDefaults(e){const a=[...this.#r.values()],r={};return a.forEach(s=>{Js(e,s.mutationKey)&&Object.assign(r,s.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const a={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return a.queryHash||(a.queryHash=Lh(a.queryKey,a)),a.refetchOnReconnect===void 0&&(a.refetchOnReconnect=a.networkMode!=="always"),a.throwOnError===void 0&&(a.throwOnError=!!a.suspense),!a.networkMode&&a.persister&&(a.networkMode="offlineFirst"),a.queryFn===jh&&(a.enabled=!1),a}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},A4=class extends ki{constructor(e,a){super(),this.options=a,this.#e=e,this.#i=null,this.#o=Fd(),this.bindMethods(),this.setOptions(a)}#e;#t=void 0;#n=void 0;#a=void 0;#r;#s;#o;#i;#p;#d;#h;#c;#u;#l;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),h0(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Yd(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Yd(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#S(),this.#x(),this.#t.removeObserver(this)}setOptions(e){const a=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof on(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),a._defaulted&&!uc(this.options,a)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&m0(this.#t,r,this.options,a)&&this.#f(),this.updateResult(),s&&(this.#t!==r||on(this.options.enabled,this.#t)!==on(a.enabled,this.#t)||ka(this.options.staleTime,this.#t)!==ka(a.staleTime,this.#t))&&this.#g();const l=this.#v();s&&(this.#t!==r||on(this.options.enabled,this.#t)!==on(a.enabled,this.#t)||l!==this.#l)&&this.#y(l)}getOptimisticResult(e){const a=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(a,e);return D4(this,r)&&(this.#a=r,this.#s=this.options,this.#r=this.#t.state),r}getCurrentResult(){return this.#a}trackResult(e,a){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),a?.(s),s==="promise"&&!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(r,s))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const a=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,a);return r.fetch().then(()=>this.createResult(r,a))}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#a))}#f(e){this.#w();let a=this.#t.fetch(this.options,e);return e?.throwOnError||(a=a.catch(Oe)),a}#g(){this.#S();const e=ka(this.options.staleTime,this.#t);if(xr||this.#a.isStale||!qd(e))return;const r=W1(this.#a.dataUpdatedAt,e)+1;this.#c=setTimeout(()=>{this.#a.isStale||this.updateResult()},r)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#x(),this.#l=e,!(xr||on(this.options.enabled,this.#t)===!1||!qd(this.#l)||this.#l===0)&&(this.#u=setInterval(()=>{(this.options.refetchIntervalInBackground||zh.isFocused())&&this.#f()},this.#l))}#b(){this.#g(),this.#y(this.#v())}#S(){this.#c&&(clearTimeout(this.#c),this.#c=void 0)}#x(){this.#u&&(clearInterval(this.#u),this.#u=void 0)}createResult(e,a){const r=this.#t,s=this.options,l=this.#a,c=this.#r,f=this.#s,p=e!==r?e.state:this.#n,{state:m}=e;let v={...m},g=!1,y;if(a._optimisticResults){const G=this.hasListeners(),et=!G&&h0(e,a),W=G&&m0(e,r,a,s);(et||W)&&(v={...v,...sS(m.data,e.options)}),a._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:x,errorUpdatedAt:S,status:w}=v;y=v.data;let T=!1;if(a.placeholderData!==void 0&&y===void 0&&w==="pending"){let G;l?.isPlaceholderData&&a.placeholderData===f?.placeholderData?(G=l.data,T=!0):G=typeof a.placeholderData=="function"?a.placeholderData(this.#h?.state.data,this.#h):a.placeholderData,G!==void 0&&(w="success",y=Gd(l?.data,G,a),g=!0)}if(a.select&&y!==void 0&&!T)if(l&&y===c?.data&&a.select===this.#p)y=this.#d;else try{this.#p=a.select,y=a.select(y),y=Gd(l?.data,y,a),this.#d=y,this.#i=null}catch(G){this.#i=G}this.#i&&(x=this.#i,y=this.#d,S=Date.now(),w="error");const C=v.fetchStatus==="fetching",z=w==="pending",N=w==="error",P=z&&C,L=y!==void 0,V={status:w,fetchStatus:v.fetchStatus,isPending:z,isSuccess:w==="success",isError:N,isInitialLoading:P,isLoading:P,data:y,dataUpdatedAt:v.dataUpdatedAt,error:x,errorUpdatedAt:S,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>p.dataUpdateCount||v.errorUpdateCount>p.errorUpdateCount,isFetching:C,isRefetching:C&&!z,isLoadingError:N&&!L,isPaused:v.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:N&&L,isStale:Ph(e,a),refetch:this.refetch,promise:this.#o,isEnabled:on(a.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const G=at=>{V.status==="error"?at.reject(V.error):V.data!==void 0&&at.resolve(V.data)},et=()=>{const at=this.#o=V.promise=Fd();G(at)},W=this.#o;switch(W.status){case"pending":e.queryHash===r.queryHash&&G(W);break;case"fulfilled":(V.status==="error"||V.data!==W.value)&&et();break;case"rejected":(V.status!=="error"||V.error!==W.reason)&&et();break}}return V}updateResult(){const e=this.#a,a=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#s=this.options,this.#r.data!==void 0&&(this.#h=this.#t),uc(a,e))return;this.#a=a;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,l=typeof s=="function"?s():s;if(l==="all"||!l&&!this.#m.size)return!0;const c=new Set(l??this.#m);return this.options.throwOnError&&c.add("error"),Object.keys(this.#a).some(f=>{const h=f;return this.#a[h]!==e[h]&&c.has(h)})};this.#E({listeners:r()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const a=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(a?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#E(e){ue.batch(()=>{e.listeners&&this.listeners.forEach(a=>{a(this.#a)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function M4(e,a){return on(a.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&a.retryOnMount===!1)}function h0(e,a){return M4(e,a)||e.state.data!==void 0&&Yd(e,a,a.refetchOnMount)}function Yd(e,a,r){if(on(a.enabled,e)!==!1&&ka(a.staleTime,e)!=="static"){const s=typeof r=="function"?r(e):r;return s==="always"||s!==!1&&Ph(e,a)}return!1}function m0(e,a,r,s){return(e!==a||on(s.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Ph(e,r)}function Ph(e,a){return on(a.enabled,e)!==!1&&e.isStaleByTime(ka(a.staleTime,e))}function D4(e,a){return!uc(e.getCurrentResult(),a)}var N4=class extends ki{#e;#t=void 0;#n;#a;constructor(a,r){super(),this.#e=a,this.setOptions(r),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(a){const r=this.options;this.options=this.#e.defaultMutationOptions(a),uc(this.options,r)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),r?.mutationKey&&this.options.mutationKey&&wr(r.mutationKey)!==wr(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(a){this.#r(),this.#s(a)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#s()}mutate(a,r){return this.#a=r,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(a)}#r(){const a=this.#n?.state??oS();this.#t={...a,isPending:a.status==="pending",isSuccess:a.status==="success",isError:a.status==="error",isIdle:a.status==="idle",mutate:this.mutate,reset:this.reset}}#s(a){ue.batch(()=>{if(this.#a&&this.hasListeners()){const r=this.#t.variables,s=this.#t.context;a?.type==="success"?(this.#a.onSuccess?.(a.data,r,s),this.#a.onSettled?.(a.data,null,r,s)):a?.type==="error"&&(this.#a.onError?.(a.error,r,s),this.#a.onSettled?.(void 0,a.error,r,s))}this.listeners.forEach(r=>{r(this.#t)})})}},lS=R.createContext(void 0),cS=e=>{const a=R.useContext(lS);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},L4=({client:e,children:a})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),_.jsx(lS.Provider,{value:e,children:a})),uS=R.createContext(!1),j4=()=>R.useContext(uS);uS.Provider;function z4(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var P4=R.createContext(z4()),U4=()=>R.useContext(P4),k4=(e,a)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(a.isReset()||(e.retryOnMount=!1))},B4=e=>{R.useEffect(()=>{e.clearReset()},[e])},H4=({result:e,errorResetBoundary:a,throwOnError:r,query:s,suspense:l})=>e.isError&&!a.isReset()&&!e.isFetching&&s&&(l&&e.data===void 0||eS(r,[e.error,s])),q4=e=>{if(e.suspense){const a=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>a(r(...s)):a(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},V4=(e,a)=>e.isLoading&&e.isFetching&&!a,G4=(e,a)=>e?.suspense&&a.isPending,p0=(e,a,r)=>a.fetchOptimistic(e).catch(()=>{r.clearReset()});function F4(e,a,r){const s=j4(),l=U4(),c=cS(),f=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(f),f._optimisticResults=s?"isRestoring":"optimistic",q4(f),k4(f,l),B4(l);const h=!c.getQueryCache().get(f.queryHash),[p]=R.useState(()=>new a(c,f)),m=p.getOptimisticResult(f),v=!s&&e.subscribed!==!1;if(R.useSyncExternalStore(R.useCallback(g=>{const y=v?p.subscribe(ue.batchCalls(g)):Oe;return p.updateResult(),y},[p,v]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),R.useEffect(()=>{p.setOptions(f)},[f,p]),G4(f,m))throw p0(f,p,l);if(H4({result:m,errorResetBoundary:l,throwOnError:f.throwOnError,query:c.getQueryCache().get(f.queryHash),suspense:f.suspense}))throw m.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(f,m),f.experimental_prefetchInRender&&!xr&&V4(m,s)&&(h?p0(f,p,l):c.getQueryCache().get(f.queryHash)?.promise)?.catch(Oe).finally(()=>{p.updateResult()}),f.notifyOnChangeProps?m:p.trackResult(m)}function Y4(e,a){return F4(e,A4)}function Q4(e,a){const r=cS(),[s]=R.useState(()=>new N4(r,e));R.useEffect(()=>{s.setOptions(e)},[s,e]);const l=R.useSyncExternalStore(R.useCallback(f=>s.subscribe(ue.batchCalls(f)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),c=R.useCallback((f,h)=>{s.mutate(f,h).catch(Oe)},[s]);if(l.error&&eS(s.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:c,mutateAsync:l.mutate}}function K4(){return _.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx(F0,{className:"size-8 animate-spin"})})}function X4({className:e,...a}){const{setAuthenticated:r}=I1(),[s,l]=R.useState(""),[c,f]=R.useState(""),h=Nh(),{isPending:p,mutate:m}=Q4({mutationFn:async()=>h.login(s,c),onError(){r0.error("Invalid credentials",{description:"The credentials you provided are invalid."})},onSuccess(){r0.success("Login successful",{description:"You have successfully logged in."}),r(!0)}});return p?_.jsx(K4,{}):_.jsx("div",{className:Et("flex flex-col gap-6 w-[20%]",e),...a,children:_.jsxs(AM,{children:[_.jsxs(MM,{children:[_.jsx(DM,{className:"text-2xl",children:"Login"}),_.jsx(NM,{children:"Enter your credentials below to proceed"})]}),_.jsx(LM,{children:_.jsxs("div",{className:"flex flex-col gap-6",children:[_.jsxs("div",{className:"grid gap-2",children:[_.jsx(e0,{htmlFor:"username",children:"Username"}),_.jsx(hy,{id:"username",type:"username",placeholder:"Enter your username",required:!0,value:s,onChange:v=>l(v.target.value)})]}),_.jsxs("div",{className:"grid gap-2",children:[_.jsx("div",{className:"flex items-center",children:_.jsx(e0,{htmlFor:"password",children:"Password"})}),_.jsx(hy,{id:"password",type:"password",required:!0,value:c,onChange:v=>f(v.target.value)})]}),_.jsx(ob,{type:"button",className:"w-full",onClick:()=>{m()},children:"Login"})]})})]})})}function $4({children:e}){const{authenticated:a,setAuthenticated:r}=I1(),s=Nh(),{isLoading:l,isError:c}=Y4({queryKey:[],enabled:!a,queryFn:async()=>{const f=await s.fetchMe();return r(!!f),f},refetchOnWindowFocus:!0});return l?_.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx(F0,{className:"size-8 animate-spin"})}):c?_.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching user data."})}):a?_.jsx(_.Fragment,{children:e}):_.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx(X4,{})})}function Z4({...e}){return _.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function I4({className:e,...a}){return _.jsx("ol",{"data-slot":"breadcrumb-list",className:Et("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...a})}function gd({className:e,...a}){return _.jsx("li",{"data-slot":"breadcrumb-item",className:Et("inline-flex items-center gap-1.5",e),...a})}function g0({asChild:e,className:a,...r}){const s=e?no:"a";return _.jsx(s,{"data-slot":"breadcrumb-link",className:Et("hover:text-foreground transition-colors",a),...r})}function W4({className:e,...a}){return _.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:Et("text-foreground font-normal",e),...a})}function v0({children:e,className:a,...r}){return _.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:Et("[&>svg]:size-3.5",a),...r,children:e??_.jsx(yR,{})})}function J4(){const{toggleSidebar:e}=_h();return _.jsx("header",{className:"bg-background sticky top-0 z-50 flex w-full items-center border-b",children:_.jsxs("div",{className:"flex h-(--header-height) w-full items-center gap-2 px-4",children:[_.jsx(ob,{className:"h-8 w-8",variant:"ghost",size:"icon",onClick:e,children:_.jsx(SR,{})}),_.jsx(X_,{orientation:"vertical",className:"mr-2 h-4"}),_.jsx(Z4,{className:"hidden sm:block",children:_.jsxs(I4,{children:[_.jsx(gd,{children:_.jsx(g0,{href:"#",children:"/"})}),_.jsx(v0,{}),_.jsx(gd,{children:_.jsx(W4,{children:"CommandKit"})}),_.jsx(v0,{}),_.jsx(gd,{children:_.jsx(g0,{href:"#",children:"DevTools"})})]})})]})})}var t3=(e,a,r,s,l,c,f,h)=>{let p=document.documentElement,m=["light","dark"];function v(x){(Array.isArray(e)?e:[e]).forEach(S=>{let w=S==="class",T=w&&c?l.map(C=>c[C]||C):l;w?(p.classList.remove(...T),p.classList.add(c&&c[x]?c[x]:x)):p.setAttribute(S,x)}),g(x)}function g(x){h&&m.includes(x)&&(p.style.colorScheme=x)}function y(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)v(s);else try{let x=localStorage.getItem(a)||r,S=f&&x==="system"?y():x;v(S)}catch{}},y0=["light","dark"],fS="(prefers-color-scheme: dark)",e3=typeof window>"u",Uh=R.createContext(void 0),n3={setTheme:e=>{},themes:[]},a3=()=>{var e;return(e=R.useContext(Uh))!=null?e:n3},r3=e=>R.useContext(Uh)?R.createElement(R.Fragment,null,e.children):R.createElement(s3,{...e}),i3=["light","dark"],s3=({forcedTheme:e,disableTransitionOnChange:a=!1,enableSystem:r=!0,enableColorScheme:s=!0,storageKey:l="theme",themes:c=i3,defaultTheme:f=r?"system":"light",attribute:h="data-theme",value:p,children:m,nonce:v,scriptProps:g})=>{let[y,x]=R.useState(()=>l3(l,f)),[S,w]=R.useState(()=>y==="system"?vd():y),T=p?Object.values(p):c,C=R.useCallback(L=>{let K=L;if(!K)return;L==="system"&&r&&(K=vd());let V=p?p[K]:K,G=a?c3(v):null,et=document.documentElement,W=at=>{at==="class"?(et.classList.remove(...T),V&&et.classList.add(V)):at.startsWith("data-")&&(V?et.setAttribute(at,V):et.removeAttribute(at))};if(Array.isArray(h)?h.forEach(W):W(h),s){let at=y0.includes(f)?f:null,rt=y0.includes(K)?K:at;et.style.colorScheme=rt}G?.()},[v]),z=R.useCallback(L=>{let K=typeof L=="function"?L(y):L;x(K);try{localStorage.setItem(l,K)}catch{}},[y]),N=R.useCallback(L=>{let K=vd(L);w(K),y==="system"&&r&&!e&&C("system")},[y,e]);R.useEffect(()=>{let L=window.matchMedia(fS);return L.addListener(N),N(L),()=>L.removeListener(N)},[N]),R.useEffect(()=>{let L=K=>{K.key===l&&(K.newValue?x(K.newValue):z(f))};return window.addEventListener("storage",L),()=>window.removeEventListener("storage",L)},[z]),R.useEffect(()=>{C(e??y)},[e,y]);let P=R.useMemo(()=>({theme:y,setTheme:z,forcedTheme:e,resolvedTheme:y==="system"?S:y,themes:r?[...c,"system"]:c,systemTheme:r?S:void 0}),[y,z,e,S,r,c]);return R.createElement(Uh.Provider,{value:P},R.createElement(o3,{forcedTheme:e,storageKey:l,attribute:h,enableSystem:r,enableColorScheme:s,defaultTheme:f,value:p,themes:c,nonce:v,scriptProps:g}),m)},o3=R.memo(({forcedTheme:e,storageKey:a,attribute:r,enableSystem:s,enableColorScheme:l,defaultTheme:c,value:f,themes:h,nonce:p,scriptProps:m})=>{let v=JSON.stringify([r,a,c,e,h,f,s,l]).slice(1,-1);return R.createElement("script",{...m,suppressHydrationWarning:!0,nonce:typeof window>"u"?p:"",dangerouslySetInnerHTML:{__html:`(${t3.toString()})(${v})`}})}),l3=(e,a)=>{if(e3)return;let r;try{r=localStorage.getItem(e)||void 0}catch{}return r||a},c3=e=>{let a=document.createElement("style");return e&&a.setAttribute("nonce",e),a.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(a),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(a)},1)}},vd=e=>(e||(e=window.matchMedia(fS)),e.matches?"dark":"light");const u3=({...e})=>{const{theme:a="system"}=a3();return _.jsx(d4,{theme:a,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...e})},Rr=WE({head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1"},{title:"CommandKit DevTools"}]}),component:f3});function f3(){return _.jsxs(r3,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!1,children:[_.jsx(u3,{}),_.jsx(CM,{children:_.jsx($4,{children:_.jsx("div",{className:"[--header-height:calc(theme(spacing.14))]",children:_.jsxs(RO,{className:"flex flex-col",children:[_.jsx(J4,{}),_.jsxs("div",{className:"flex flex-1",children:[_.jsx(OM,{}),_.jsx(TO,{children:_.jsx(H0,{})})]})]})})})})]})}const d3="modulepreload",h3=function(e){return"/"+e},b0={},Bi=function(a,r,s){let l=Promise.resolve();if(r&&r.length>0){let p=function(m){return Promise.all(m.map(v=>Promise.resolve(v).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),h=f?.nonce||f?.getAttribute("nonce");l=p(r.map(m=>{if(m=h3(m),m in b0)return;b0[m]=!0;const v=m.endsWith(".css"),g=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${g}`))return;const y=document.createElement("link");if(y.rel=v?"stylesheet":d3,v||(y.as="script"),y.crossOrigin="",y.href=m,h&&y.setAttribute("nonce",h),document.head.appendChild(y),v)return new Promise((x,S)=>{y.addEventListener("load",x),y.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${m}`)))})}))}function c(f){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=f,window.dispatchEvent(h),!h.defaultPrevented)throw f}return l.then(f=>{for(const h of f||[])h.status==="rejected"&&c(h.reason);return a().catch(c)})},m3=()=>Bi(()=>import("./plugins-CMkwPWHf.js"),[]),p3=Ba("/plugins")({component:Di(m3,"component")}),g3=()=>Bi(()=>import("./guilds-DkAmhNQJ.js"),[]),v3=Ba("/guilds")({component:Di(g3,"component")}),y3=()=>Bi(()=>import("./feature-flags-BJ88OHjN.js"),[]),b3=Ba("/feature-flags")({component:Di(y3,"component")}),S3=()=>Bi(()=>import("./events-BmjTzG1Z.js"),[]),x3=Ba("/events")({component:Di(S3,"component")}),w3=()=>Bi(()=>import("./commands-BYwnvG1y.js"),[]),E3=Ba("/commands")({component:Di(w3,"component")}),R3=()=>Bi(()=>import("./index-8z-A9hKc.js"),[]),_3=Ba("/")({component:Di(R3,"component")}),T3=p3.update({id:"/plugins",path:"/plugins",getParentRoute:()=>Rr}),C3=v3.update({id:"/guilds",path:"/guilds",getParentRoute:()=>Rr}),O3=b3.update({id:"/feature-flags",path:"/feature-flags",getParentRoute:()=>Rr}),A3=x3.update({id:"/events",path:"/events",getParentRoute:()=>Rr}),M3=E3.update({id:"/commands",path:"/commands",getParentRoute:()=>Rr}),D3=_3.update({id:"/",path:"/",getParentRoute:()=>Rr}),N3={IndexRoute:D3,CommandsRoute:M3,EventsRoute:A3,FeatureFlagsRoute:O3,GuildsRoute:C3,PluginsRoute:T3},L3=Rr._addFileChildren(N3)._addFileTypes(),j3=oR({routeTree:L3,defaultPreload:"intent",defaultStaleTime:5e3,scrollRestoration:!0,defaultViewTransition:!0}),z3=new O4;Aw.createRoot(document.getElementById("root")).render(_.jsx(R.StrictMode,{children:_.jsx(L4,{client:z3,children:_.jsx(uR,{router:j3})})}));export{FO as A,XO as B,AM as C,K4 as L,Y4 as a,MM as b,YO as c,QO as d,LM as e,DM as f,S0 as g,NM as h,Va as i,_ as j,yR as k,sD as l,Mi as m,ob as n,R as r,Nh as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as X,u as tt,a as et,j as y,L as rt,B as nt}from"./index-
|
|
1
|
+
import{g as X,u as tt,a as et,j as y,L as rt,B as nt}from"./index-C4juxjoK.js";var I={exports:{}},st=I.exports,V;function it(){return V||(V=1,(function(k,H){(function(N,D){k.exports=D()})(st,(function(){var N=1e3,D=6e4,g=36e5,U="millisecond",_="second",O="minute",b="hour",v="day",C="week",m="month",J="quarter",M="year",j="date",Z="Invalid Date",P=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,Q=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,K={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(s){var r=["th","st","nd","rd"],t=s%100;return"["+s+(r[(t-20)%10]||r[t]||r[0])+"]"}},q=function(s,r,t){var n=String(s);return!n||n.length>=r?s:""+Array(r+1-n.length).join(t)+s},G={s:q,z:function(s){var r=-s.utcOffset(),t=Math.abs(r),n=Math.floor(t/60),e=t%60;return(r<=0?"+":"-")+q(n,2,"0")+":"+q(e,2,"0")},m:function s(r,t){if(r.date()<t.date())return-s(t,r);var n=12*(t.year()-r.year())+(t.month()-r.month()),e=r.clone().add(n,m),i=t-e<0,a=r.clone().add(n+(i?-1:1),m);return+(-(n+(t-e)/(i?e-a:a-e))||0)},a:function(s){return s<0?Math.ceil(s)||0:Math.floor(s)},p:function(s){return{M:m,y:M,w:C,d:v,D:j,h:b,m:O,s:_,ms:U,Q:J}[s]||String(s||"").toLowerCase().replace(/s$/,"")},u:function(s){return s===void 0}},T="en",x={};x[T]=K;var z="$isDayjsObject",R=function(s){return s instanceof F||!(!s||!s[z])},W=function s(r,t,n){var e;if(!r)return T;if(typeof r=="string"){var i=r.toLowerCase();x[i]&&(e=i),t&&(x[i]=t,e=i);var a=r.split("-");if(!e&&a.length>1)return s(a[0])}else{var o=r.name;x[o]=r,e=o}return!n&&e&&(T=e),e||!n&&T},f=function(s,r){if(R(s))return s.clone();var t=typeof r=="object"?r:{};return t.date=s,t.args=arguments,new F(t)},u=G;u.l=W,u.i=R,u.w=function(s,r){return f(s,{locale:r.$L,utc:r.$u,x:r.$x,$offset:r.$offset})};var F=(function(){function s(t){this.$L=W(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[z]=!0}var r=s.prototype;return r.parse=function(t){this.$d=(function(n){var e=n.date,i=n.utc;if(e===null)return new Date(NaN);if(u.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(P);if(a){var o=a[2]-1||0,c=(a[7]||"0").substring(0,3);return i?new Date(Date.UTC(a[1],o,a[3]||1,a[4]||0,a[5]||0,a[6]||0,c)):new Date(a[1],o,a[3]||1,a[4]||0,a[5]||0,a[6]||0,c)}}return new Date(e)})(t),this.init()},r.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},r.$utils=function(){return u},r.isValid=function(){return this.$d.toString()!==Z},r.isSame=function(t,n){var e=f(t);return this.startOf(n)<=e&&e<=this.endOf(n)},r.isAfter=function(t,n){return f(t)<this.startOf(n)},r.isBefore=function(t,n){return this.endOf(n)<f(t)},r.$g=function(t,n,e){return u.u(t)?this[n]:this.set(e,t)},r.unix=function(){return Math.floor(this.valueOf()/1e3)},r.valueOf=function(){return this.$d.getTime()},r.startOf=function(t,n){var e=this,i=!!u.u(n)||n,a=u.p(t),o=function(w,l){var p=u.w(e.$u?Date.UTC(e.$y,l,w):new Date(e.$y,l,w),e);return i?p:p.endOf(v)},c=function(w,l){return u.w(e.toDate()[w].apply(e.toDate("s"),(i?[0,0,0,0]:[23,59,59,999]).slice(l)),e)},d=this.$W,h=this.$M,$=this.$D,Y="set"+(this.$u?"UTC":"");switch(a){case M:return i?o(1,0):o(31,11);case m:return i?o(1,h):o(0,h+1);case C:var S=this.$locale().weekStart||0,L=(d<S?d+7:d)-S;return o(i?$-L:$+(6-L),h);case v:case j:return c(Y+"Hours",0);case b:return c(Y+"Minutes",1);case O:return c(Y+"Seconds",2);case _:return c(Y+"Milliseconds",3);default:return this.clone()}},r.endOf=function(t){return this.startOf(t,!1)},r.$set=function(t,n){var e,i=u.p(t),a="set"+(this.$u?"UTC":""),o=(e={},e[v]=a+"Date",e[j]=a+"Date",e[m]=a+"Month",e[M]=a+"FullYear",e[b]=a+"Hours",e[O]=a+"Minutes",e[_]=a+"Seconds",e[U]=a+"Milliseconds",e)[i],c=i===v?this.$D+(n-this.$W):n;if(i===m||i===M){var d=this.clone().set(j,1);d.$d[o](c),d.init(),this.$d=d.set(j,Math.min(this.$D,d.daysInMonth())).$d}else o&&this.$d[o](c);return this.init(),this},r.set=function(t,n){return this.clone().$set(t,n)},r.get=function(t){return this[u.p(t)]()},r.add=function(t,n){var e,i=this;t=Number(t);var a=u.p(n),o=function(h){var $=f(i);return u.w($.date($.date()+Math.round(h*t)),i)};if(a===m)return this.set(m,this.$M+t);if(a===M)return this.set(M,this.$y+t);if(a===v)return o(1);if(a===C)return o(7);var c=(e={},e[O]=D,e[b]=g,e[_]=N,e)[a]||1,d=this.$d.getTime()+t*c;return u.w(d,this)},r.subtract=function(t,n){return this.add(-1*t,n)},r.format=function(t){var n=this,e=this.$locale();if(!this.isValid())return e.invalidDate||Z;var i=t||"YYYY-MM-DDTHH:mm:ssZ",a=u.z(this),o=this.$H,c=this.$m,d=this.$M,h=e.weekdays,$=e.months,Y=e.meridiem,S=function(l,p,A,E){return l&&(l[p]||l(n,i))||A[p].slice(0,E)},L=function(l){return u.s(o%12||12,l,"0")},w=Y||function(l,p,A){var E=l<12?"AM":"PM";return A?E.toLowerCase():E};return i.replace(Q,(function(l,p){return p||(function(A){switch(A){case"YY":return String(n.$y).slice(-2);case"YYYY":return u.s(n.$y,4,"0");case"M":return d+1;case"MM":return u.s(d+1,2,"0");case"MMM":return S(e.monthsShort,d,$,3);case"MMMM":return S($,d);case"D":return n.$D;case"DD":return u.s(n.$D,2,"0");case"d":return String(n.$W);case"dd":return S(e.weekdaysMin,n.$W,h,2);case"ddd":return S(e.weekdaysShort,n.$W,h,3);case"dddd":return h[n.$W];case"H":return String(o);case"HH":return u.s(o,2,"0");case"h":return L(1);case"hh":return L(2);case"a":return w(o,c,!0);case"A":return w(o,c,!1);case"m":return String(c);case"mm":return u.s(c,2,"0");case"s":return String(n.$s);case"ss":return u.s(n.$s,2,"0");case"SSS":return u.s(n.$ms,3,"0");case"Z":return a}return null})(l)||a.replace(":","")}))},r.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},r.diff=function(t,n,e){var i,a=this,o=u.p(n),c=f(t),d=(c.utcOffset()-this.utcOffset())*D,h=this-c,$=function(){return u.m(a,c)};switch(o){case M:i=$()/12;break;case m:i=$();break;case J:i=$()/3;break;case C:i=(h-d)/6048e5;break;case v:i=(h-d)/864e5;break;case b:i=h/g;break;case O:i=h/D;break;case _:i=h/N;break;default:i=h}return e?i:u.a(i)},r.daysInMonth=function(){return this.endOf(m).$D},r.$locale=function(){return x[this.$L]},r.locale=function(t,n){if(!t)return this.$L;var e=this.clone(),i=W(t,n,!0);return i&&(e.$L=i),e},r.clone=function(){return u.w(this.$d,this)},r.toDate=function(){return new Date(this.valueOf())},r.toJSON=function(){return this.isValid()?this.toISOString():null},r.toISOString=function(){return this.$d.toISOString()},r.toString=function(){return this.$d.toUTCString()},s})(),B=F.prototype;return f.prototype=B,[["$ms",U],["$s",_],["$m",O],["$H",b],["$W",v],["$M",m],["$y",M],["$D",j]].forEach((function(s){B[s[1]]=function(r){return this.$g(r,s[0],s[1])}})),f.extend=function(s,r){return s.$i||(s(r,F,f),s.$i=!0),f},f.locale=W,f.isDayjs=R,f.unix=function(s){return f(1e3*s)},f.en=x[T],f.Ls=x,f.p={},f}))})(I)),I.exports}var at=it();const ut=X(at),ot="YYYY-MM-DD HH:mm:ss";function ct(k,H=ot){return ut(k).format(H)}function dt(){const k=tt(),{data:H,isLoading:N,isError:D}=et({queryKey:["plugins"],queryFn:async()=>await k.plugins.fetch()});return N||!H?y.jsx(rt,{}):D?y.jsx("div",{className:"h-screen grid place-items-center",children:y.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching plugins data."})}):y.jsxs("div",{className:"p-4",children:[y.jsx("h1",{className:"text-2xl font-bold mb-6",children:"Plugins"}),y.jsx("div",{className:"grid grid-cols-3 gap-4 py-4",children:H.map(g=>y.jsxs("div",{className:"border p-4 rounded",children:[y.jsx("h2",{className:"text-lg font-semibold",children:g.name}),y.jsx(nt,{variant:"outline",className:"text-sm text-gray-500 mt-2 font-mono",children:g.id}),y.jsxs("p",{className:"text-muted-foreground text-xs mt-2 font-medium",children:["Registered at ",ct(g.loadedAt)]})]},g.id))})]})}export{dt as component};
|
package/ui/index.html
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
<style>
|
|
12
12
|
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap');
|
|
13
13
|
</style>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
15
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-C4juxjoK.js"></script>
|
|
15
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Bbq0nFeq.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
|
18
18
|
<div id="root"></div>
|
package/LICENSE
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
Copyright 2025 Avraj Sahota
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so.
|
|
4
|
-
|
|
5
|
-
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|