pulsewatch-frontend 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +38 -40
- package/dist/index.mjs +9565 -21977
- package/dist/pulsewatch-frontend.css +1 -1
- package/dist/router.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react"),ni=require("react-dom");function Kf(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const y=Kf(k),ri=Kf(ni);var Lo={exports:{}},jr={};var Ql;function rv(){if(Ql)return jr;Ql=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var i=null;if(s!==void 0&&(i=""+s),o.key!==void 0&&(i=""+o.key),"key"in o){s={};for(var a in o)a!=="key"&&(s[a]=o[a])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:i,ref:o!==void 0?o:null,props:s}}return jr.Fragment=t,jr.jsx=n,jr.jsxs=n,jr}var Lr={};var Xl;function ov(){return Xl||(Xl=1,process.env.NODE_ENV!=="production"&&(function(){function e(N){if(N==null)return null;if(typeof N=="function")return N.$$typeof===B?null:N.displayName||N.name||null;if(typeof N=="string")return N;switch(N){case v:return"Fragment";case _:return"Profiler";case b:return"StrictMode";case P:return"Suspense";case C:return"SuspenseList";case U:return"Activity"}if(typeof N=="object")switch(typeof N.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),N.$$typeof){case g:return"Portal";case x:return N.displayName||"Context";case w:return(N._context.displayName||"Context")+".Consumer";case S:var Q=N.render;return N=N.displayName,N||(N=Q.displayName||Q.name||"",N=N!==""?"ForwardRef("+N+")":"ForwardRef"),N;case E:return Q=N.displayName||null,Q!==null?Q:e(N.type)||"Memo";case A:Q=N._payload,N=N._init;try{return e(N(Q))}catch{}}return null}function t(N){return""+N}function n(N){try{t(N);var Q=!1}catch{Q=!0}if(Q){Q=console;var W=Q.error,Z=typeof Symbol=="function"&&Symbol.toStringTag&&N[Symbol.toStringTag]||N.constructor.name||"Object";return W.call(Q,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",Z),t(N)}}function r(N){if(N===v)return"<>";if(typeof N=="object"&&N!==null&&N.$$typeof===A)return"<...>";try{var Q=e(N);return Q?"<"+Q+">":"<...>"}catch{return"<...>"}}function o(){var N=M.A;return N===null?null:N.getOwner()}function s(){return Error("react-stack-top-frame")}function i(N){if(j.call(N,"key")){var Q=Object.getOwnPropertyDescriptor(N,"key").get;if(Q&&Q.isReactWarning)return!1}return N.key!==void 0}function a(N,Q){function W(){L||(L=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",Q))}W.isReactWarning=!0,Object.defineProperty(N,"key",{get:W,configurable:!0})}function c(){var N=e(this.type);return K[N]||(K[N]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),N=this.props.ref,N!==void 0?N:null}function l(N,Q,W,Z,ie,fe){var F=W.ref;return N={$$typeof:m,type:N,key:Q,props:W,_owner:Z},(F!==void 0?F:null)!==null?Object.defineProperty(N,"ref",{enumerable:!1,get:c}):Object.defineProperty(N,"ref",{enumerable:!1,value:null}),N._store={},Object.defineProperty(N._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(N,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(N,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ie}),Object.defineProperty(N,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:fe}),Object.freeze&&(Object.freeze(N.props),Object.freeze(N)),N}function d(N,Q,W,Z,ie,fe){var F=Q.children;if(F!==void 0)if(Z)if(V(F)){for(Z=0;Z<F.length;Z++)u(F[Z]);Object.freeze&&Object.freeze(F)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else u(F);if(j.call(Q,"key")){F=e(N);var ee=Object.keys(Q).filter(function(ce){return ce!=="key"});Z=0<ee.length?"{key: someKey, "+ee.join(": ..., ")+": ...}":"{key: someKey}",se[F+Z]||(ee=0<ee.length?"{"+ee.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
2
|
let props = %s;
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
5
5
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,Z,V,ee,V),se[V+Z]=!0)}if(V=null,K!==void 0&&(n(K),V=""+K),i(Y)&&(n(Y.key),V=""+Y.key),"key"in Y){K={};for(var me in Y)me!=="key"&&(K[me]=Y[me])}else K=Y;return V&&a(K,typeof I=="function"?I.displayName||I.name||"Unknown":I),l(I,V,K,s(),oe,ce)}function d(I){f(I)?I._store&&(I._store.validated=1):typeof I=="object"&&I!==null&&I.$$typeof===P&&(I._payload.status==="fulfilled"?f(I._payload.value)&&I._payload.value._store&&(I._payload.value._store.validated=1):I._store&&(I._store.validated=1))}function f(I){return typeof I=="object"&&I!==null&&I.$$typeof===p}var h=T,p=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),w=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),N=Symbol.for("react.client.reference"),A=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=Object.prototype.hasOwnProperty,$=Array.isArray,q=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(I){return I()}};var D,H={},F=h.react_stack_bottom_frame.bind(h,o)(),W=q(r(o)),se={};uo.Fragment=y,uo.jsx=function(I,Y,K){var Z=1e4>A.recentlyCreatedOwnerStacks++;return u(I,Y,K,!1,Z?Error("react-stack-top-frame"):F,Z?q(r(I)):W)},uo.jsxs=function(I,Y,K){var Z=1e4>A.recentlyCreatedOwnerStacks++;return u(I,Y,K,!0,Z?Error("react-stack-top-frame"):F,Z?q(r(I)):W)}})()),uo}var Uh;function aE(){return Uh||(Uh=1,process.env.NODE_ENV==="production"?ji.exports=oE():ji.exports=iE()),ji.exports}var g=aE();const Fu=new WeakMap,cE=new WeakMap,Ua={current:[]};let Il=!1,jo=0;const Co=new Set,Li=new Map;function ub(e){for(const t of e){if(Ua.current.includes(t))continue;Ua.current.push(t),t.recompute();const n=cE.get(t);if(n)for(const r of n){const s=Fu.get(r);s?.length&&ub(s)}}}function lE(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function uE(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function db(e){if(jo>0&&!Li.has(e)&&Li.set(e,e.prevState),Co.add(e),!(jo>0)&&!Il)try{for(Il=!0;Co.size>0;){const t=Array.from(Co);Co.clear();for(const n of t){const r=Li.get(n)??n.prevState;n.prevState=r,lE(n)}for(const n of t){const r=Fu.get(n);r&&(Ua.current.push(n),ub(r))}for(const n of t){const r=Fu.get(n);if(r)for(const s of r)uE(s)}}}finally{Il=!1,Ua.current=[],Li.clear()}}function dE(e){jo++;try{e()}finally{if(jo--,jo===0){const t=Co.values().next().value;t&&db(t)}}}function fE(e){return typeof e=="function"}class hE{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var s,o;this.listeners.add(r);const i=(o=(s=this.options)==null?void 0:s.onSubscribe)==null?void 0:o.call(s,r,this);return()=>{this.listeners.delete(r),i?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,r,s;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):fE(t)?this.state=t(this.prevState):this.state=t,(s=(r=this.options)==null?void 0:r.onUpdate)==null||s.call(r),db(this)}}const ur="__TSR_index",Wh="popstate",Hh="beforeunload";function pE(e){let t=e.getLocation();const n=new Set,r=i=>{t=e.getLocation(),n.forEach(a=>a({location:t,action:i}))},s=i=>{e.notifyOnIndexChange??!0?r(i):t=e.getLocation()},o=async({task:i,navigateOpts:a,...c})=>{if(a?.ignoreBlocker??!1){i();return}const u=e.getBlockers?.()??[],d=c.type==="PUSH"||c.type==="REPLACE";if(typeof document<"u"&&u.length&&d)for(const f of u){const h=Wa(c.path,c.state);if(await f.blockerFn({currentLocation:t,nextLocation:h,action:c.type})){e.onBlocked?.();return}}i()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:i=>(n.add(i),()=>{n.delete(i)}),push:(i,a,c)=>{const l=t.state[ur];a=qh(l+1,a),o({task:()=>{e.pushState(i,a),r({type:"PUSH"})},navigateOpts:c,type:"PUSH",path:i,state:a})},replace:(i,a,c)=>{const l=t.state[ur];a=qh(l,a),o({task:()=>{e.replaceState(i,a),r({type:"REPLACE"})},navigateOpts:c,type:"REPLACE",path:i,state:a})},go:(i,a)=>{o({task:()=>{e.go(i),s({type:"GO",index:i})},navigateOpts:a,type:"GO"})},back:i=>{o({task:()=>{e.back(i?.ignoreBlocker??!1),s({type:"BACK"})},navigateOpts:i,type:"BACK"})},forward:i=>{o({task:()=>{e.forward(i?.ignoreBlocker??!1),s({type:"FORWARD"})},navigateOpts:i,type:"FORWARD"})},canGoBack:()=>t.state[ur]!==0,createHref:i=>e.createHref(i),block:i=>{if(!e.setBlockers)return()=>{};const a=e.getBlockers?.()??[];return e.setBlockers([...a,i]),()=>{const c=e.getBlockers?.()??[];e.setBlockers?.(c.filter(l=>l!==i))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function qh(e,t){t||(t={});const n=Yd();return{...t,key:n,__TSR_key:n,[ur]:e}}function mE(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let s=[];const o=()=>s,i=E=>s=E,a=(E=>E),c=(()=>Wa(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const E=Yd();t.history.replaceState({[ur]:0,key:E,__TSR_key:E},"")}let l=c(),u,d=!1,f=!1,h=!1,p=!1;const m=()=>l;let y,b;const x=()=>{y&&(k._ignoreSubscribers=!0,(y.isPush?t.history.pushState:t.history.replaceState)(y.state,"",y.href),k._ignoreSubscribers=!1,y=void 0,b=void 0,u=void 0)},_=(E,P,O)=>{const N=a(P);b||(u=l),l=Wa(P,O),y={href:N,state:O,isPush:y?.isPush||E==="push"},b||(b=Promise.resolve().then(()=>x()))},w=E=>{l=c(),k.notify({type:E})},S=async()=>{if(f){f=!1;return}const E=c(),P=E.state[ur]-l.state[ur],O=P===1,N=P===-1,A=!O&&!N||d;d=!1;const j=A?"GO":N?"BACK":"FORWARD",$=A?{type:"GO",index:P}:{type:N?"BACK":"FORWARD"};if(h)h=!1;else{const q=o();if(typeof document<"u"&&q.length){for(const D of q)if(await D.blockerFn({currentLocation:l,nextLocation:E,action:j})){f=!0,t.history.go(1),k.notify($);return}}}l=c(),k.notify($)},C=E=>{if(p){p=!1;return}let P=!1;const O=o();if(typeof document<"u"&&O.length)for(const N of O){const A=N.enableBeforeUnload??!0;if(A===!0){P=!0;break}if(typeof A=="function"&&A()===!0){P=!0;break}}if(P)return E.preventDefault(),E.returnValue=""},k=pE({getLocation:m,getLength:()=>t.history.length,pushState:(E,P)=>_("push",E,P),replaceState:(E,P)=>_("replace",E,P),back:E=>(E&&(h=!0),p=!0,t.history.back()),forward:E=>{E&&(h=!0),p=!0,t.history.forward()},go:E=>{d=!0,t.history.go(E)},createHref:E=>a(E),flush:x,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Hh,C,{capture:!0}),t.removeEventListener(Wh,S)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:o,setBlockers:i,notifyOnIndexChange:!1});return t.addEventListener(Hh,C,{capture:!0}),t.addEventListener(Wh,S),t.history.pushState=function(...E){const P=n.apply(t.history,E);return k._ignoreSubscribers||w("PUSH"),P},t.history.replaceState=function(...E){const P=r.apply(t.history,E);return k._ignoreSubscribers||w("REPLACE"),P},k}function gE(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Wa(e,t){const n=gE(e),r=n.indexOf("#"),s=n.indexOf("?"),o=Yd();return{href:n,pathname:n.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:n.length),hash:r>-1?n.substring(r):"",search:s>-1?n.slice(s,r===-1?void 0:r):"",state:t||{[ur]:0,key:o,__TSR_key:o}}}function Yd(){return(Math.random()+1).toString(36).substring(7)}const yE=!1;function Lo(e){let t;return dE(()=>{t=e()}),t}function Ho(e){return e[e.length-1]}function bE(e){return typeof e=="function"}function sr(e,t){return bE(e)?e(t):e}const vE=Object.prototype.hasOwnProperty,Kh=Object.prototype.propertyIsEnumerable;function Ot(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=t,s=Yh(e)&&Yh(r);if(!s&&!(Ha(e)&&Ha(r)))return r;const o=s?e:Zh(e);if(!o)return r;const i=s?r:Zh(r);if(!i)return r;const a=o.length,c=i.length,l=s?new Array(c):{};let u=0;for(let d=0;d<c;d++){const f=s?d:i[d],h=e[f],p=r[f];if(h===p){l[f]=h,(s?d<a:vE.call(e,f))&&u++;continue}if(h===null||p===null||typeof h!="object"||typeof p!="object"){l[f]=p;continue}const m=Ot(h,p,n+1);l[f]=m,m===h&&u++}return a===c&&u===a?e:l}function Zh(e){const t=Object.getOwnPropertyNames(e);for(const s of t)if(!Kh.call(e,s))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const s of n){if(!Kh.call(e,s))return!1;r.push(s)}return r}function Ha(e){if(!Gh(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Gh(n)||!n.hasOwnProperty("isPrototypeOf"))}function Gh(e){return Object.prototype.toString.call(e)==="[object Object]"}function Yh(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Wr(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,s=e.length;r<s;r++)if(!Wr(e[r],t[r],n))return!1;return!0}if(Ha(e)&&Ha(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const i in t)if((!r||t[i]!==void 0)&&!Wr(e[i],t[i],n))return!1;return!0}let s=0;if(!r)s=Object.keys(e).length;else for(const i in e)e[i]!==void 0&&s++;let o=0;for(const i in t)if((!r||t[i]!==void 0)&&(o++,o>s||!Wr(e[i],t[i],n)))return!1;return s===o}return!1}function Us(e){let t,n;const r=new Promise((s,o)=>{t=s,n=o});return r.status="pending",r.resolve=s=>{r.status="resolved",r.value=s,t(s),e?.(s)},r.reject=s=>{r.status="rejected",n(s)},r}function Ms(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function Xh(e,t){for(let n=e.length-1;n>=0;n--){const r=e[n];if(t(r))return r}}function xE(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Jh(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return xE(t)}const fb=["http:","https:","mailto:","tel:"];function qa(e){if(!e)return!1;try{const t=new URL(e);return!fb.includes(t.protocol)}catch{return!1}}function fo(e,t){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return e;const n=/%25|%5C/gi;let r=0,s="",o;for(;(o=n.exec(e))!==null;)s+=Jh(e.slice(r,o.index))+o[0],r=n.lastIndex;return s=s+Jh(r?e.slice(r):e),s.startsWith("//")&&(s="/"+s.replace(/^\/+/,"")),s}function _E(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var wE=process.env.NODE_ENV==="production",jl="Invariant failed";function qn(e,t){if(!e){if(wE)throw new Error(jl);var n=typeof t=="function"?t():t,r=n?"".concat(jl,": ").concat(n):jl;throw new Error(r)}}function Ka(e){const t=new Map;let n,r;const s=o=>{o.next&&(o.prev?(o.prev.next=o.next,o.next.prev=o.prev,o.next=void 0,r&&(r.next=o,o.prev=r)):(o.next.prev=void 0,n=o.next,o.next=void 0,r&&(o.prev=r,r.next=o)),r=o)};return{get(o){const i=t.get(o);if(i)return s(i),i.value},set(o,i){if(t.size>=e&&n){const c=n;t.delete(c.key),c.next&&(n=c.next,c.next.prev=void 0),c===r&&(r=void 0)}const a=t.get(o);if(a)a.value=i,s(a);else{const c={key:o,value:i,prev:r};r&&(r.next=c),r=c,n||(n=c),t.set(o,c)}},clear(){t.clear(),n=void 0,r=void 0}}}const Ws=0,Yr=1,Xr=2,qo=3,Fr=4,hb=5;function SE(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function Xd(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),s=r===-1?e.length:r,o=e.substring(t,s);if(!o||!o.includes("$"))return n[0]=Ws,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n;if(o==="$"){const a=e.length;return n[0]=Xr,n[1]=t,n[2]=t,n[3]=a,n[4]=a,n[5]=a,n}if(o.charCodeAt(0)===36)return n[0]=Yr,n[1]=t,n[2]=t+1,n[3]=s,n[4]=s,n[5]=s,n;const i=SE(o);if(i){const[a,c]=i,l=o.charCodeAt(a+1);if(l===45){if(a+2<o.length&&o.charCodeAt(a+2)===36){const u=a+3,d=c;if(u<d)return n[0]=qo,n[1]=t+a,n[2]=t+u,n[3]=t+d,n[4]=t+c+1,n[5]=s,n}}else if(l===36){const u=a+1,d=a+2;return d===c?(n[0]=Xr,n[1]=t+a,n[2]=t+u,n[3]=t+d,n[4]=t+c+1,n[5]=e.length,n):(n[0]=Yr,n[1]=t+a,n[2]=t+d,n[3]=t+c,n[4]=t+c+1,n[5]=s,n)}}return n[0]=Ws,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n}function jc(e,t,n,r,s,o,i){i?.(n);let a=r;{const c=n.fullPath??n.from,l=c.length,u=n.options?.caseSensitive??e,d=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;a<l;){const h=Xd(c,a,t);let p;const m=a,y=h[5];switch(a=y+1,o++,h[0]){case Ws:{const x=c.substring(h[2],h[3]);if(u){const _=s.static?.get(x);if(_)p=_;else{s.static??=new Map;const w=zr(n.fullPath??n.from);w.parent=s,w.depth=o,p=w,s.static.set(x,w)}}else{const _=x.toLowerCase(),w=s.staticInsensitive?.get(_);if(w)p=w;else{s.staticInsensitive??=new Map;const S=zr(n.fullPath??n.from);S.parent=s,S.depth=o,p=S,s.staticInsensitive.set(_,S)}}break}case Yr:{const x=c.substring(m,h[1]),_=c.substring(h[4],y),w=u&&!!(x||_),S=x?w?x:x.toLowerCase():void 0,C=_?w?_:_.toLowerCase():void 0,k=!d&&s.dynamic?.find(E=>!E.skipOnParamError&&E.caseSensitive===w&&E.prefix===S&&E.suffix===C);if(k)p=k;else{const E=Fl(Yr,n.fullPath??n.from,w,S,C);p=E,E.depth=o,E.parent=s,s.dynamic??=[],s.dynamic.push(E)}break}case qo:{const x=c.substring(m,h[1]),_=c.substring(h[4],y),w=u&&!!(x||_),S=x?w?x:x.toLowerCase():void 0,C=_?w?_:_.toLowerCase():void 0,k=!d&&s.optional?.find(E=>!E.skipOnParamError&&E.caseSensitive===w&&E.prefix===S&&E.suffix===C);if(k)p=k;else{const E=Fl(qo,n.fullPath??n.from,w,S,C);p=E,E.parent=s,E.depth=o,s.optional??=[],s.optional.push(E)}break}case Xr:{const x=c.substring(m,h[1]),_=c.substring(h[4],y),w=u&&!!(x||_),S=x?w?x:x.toLowerCase():void 0,C=_?w?_:_.toLowerCase():void 0,k=Fl(Xr,n.fullPath??n.from,w,S,C);p=k,k.parent=s,k.depth=o,s.wildcard??=[],s.wildcard.push(k)}}s=p}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const h=zr(n.fullPath??n.from);h.kind=hb,h.parent=s,o++,h.depth=o,s.pathless??=[],s.pathless.push(h),s=h}const f=(n.path||!n.children)&&!n.isRoot;if(f&&c.endsWith("/")){const h=zr(n.fullPath??n.from);h.kind=Fr,h.parent=s,o++,h.depth=o,s.index=h,s=h}s.parse=n.options?.params?.parse??null,s.skipOnParamError=d,s.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,f&&!s.route&&(s.route=n,s.fullPath=n.fullPath??n.from)}if(n.children)for(const c of n.children)jc(e,t,c,a,s,o,i)}function Ll(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function rr(e){if(e.pathless)for(const t of e.pathless)rr(t);if(e.static)for(const t of e.static.values())rr(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())rr(t);if(e.dynamic?.length){e.dynamic.sort(Ll);for(const t of e.dynamic)rr(t)}if(e.optional?.length){e.optional.sort(Ll);for(const t of e.optional)rr(t)}if(e.wildcard?.length){e.wildcard.sort(Ll);for(const t of e.wildcard)rr(t)}}function zr(e){return{kind:Ws,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Fl(e,t,n,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:s}}function EE(e,t){const n=zr("/"),r=new Uint16Array(6);for(const s of e)jc(!1,r,s,1,n,0);rr(n),t.masksTree=n,t.flatCache=Ka(1e3)}function kE(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=Jd(e,t.masksTree);return t.flatCache.set(e,r),r}function CE(e,t,n,r,s){e||="/",r||="/";const o=t?`case\0${e}`:e;let i=s.singleCache.get(o);if(!i){i=zr("/");const a=new Uint16Array(6);jc(t,a,{from:e},1,i,0),s.singleCache.set(o,i)}return Jd(r,i,n)}function RE(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,s=t.matchCache.get(r);if(s!==void 0)return s;e||="/";let o;try{o=Jd(e,t.segmentTree,n)}catch(i){if(i instanceof URIError)o=null;else throw i}return o&&(o.branch=TE(o.route)),t.matchCache.set(r,o),o}function PE(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function OE(e,t=!1,n){const r=zr(e.fullPath),s=new Uint16Array(6),o={},i={};let a=0;return jc(t,s,e,1,r,0,l=>{if(n?.(l,a),qn(!(l.id in o),`Duplicate routes found with id: ${String(l.id)}`),o[l.id]=l,a!==0&&l.path){const u=PE(l.fullPath);(!i[u]||l.fullPath.endsWith("/"))&&(i[u]=l)}a++}),rr(r),{processedTree:{segmentTree:r,singleCache:Ka(1e3),matchCache:Ka(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:i}}function Jd(e,t,n=!1){const r=e.split("/"),s=AE(e,r,t,n);if(!s)return null;const[o]=pb(e,r,s);return{route:s.node.route,rawParams:o,parsedParams:s.parsedParams}}function pb(e,t,n){const r=ME(n.node);let s=null;const o={};let i=n.extract?.part??0,a=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;a<r.length;i++,a++,c++,l++){const u=r[a];if(u.kind===Fr)break;if(u.kind===hb){l--,i--,c--;continue}const d=t[i],f=c;if(d&&(c+=d.length),u.kind===Yr){s??=n.node.fullPath.split("/");const h=s[l],p=u.prefix?.length??0;if(h.charCodeAt(p)===123){const y=u.suffix?.length??0,b=h.substring(p+2,h.length-y-1),x=d.substring(p,d.length-y);o[b]=decodeURIComponent(x)}else{const y=h.substring(1);o[y]=decodeURIComponent(d)}}else if(u.kind===qo){if(n.skipped&1<<a){i--,c=f-1;continue}s??=n.node.fullPath.split("/");const h=s[l],p=u.prefix?.length??0,m=u.suffix?.length??0,y=h.substring(p+3,h.length-m-1),b=u.suffix||u.prefix?d.substring(p,d.length-m):d;b&&(o[y]=decodeURIComponent(b))}else if(u.kind===Xr){const h=u,p=e.substring(f+(h.prefix?.length??0),e.length-(h.suffix?.length??0)),m=decodeURIComponent(p);o["*"]=m,o._splat=m;break}}return n.rawParams&&Object.assign(o,n.rawParams),[o,{part:i,node:a,path:c,segment:l}]}function TE(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function ME(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function AE(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const s=!Ho(t),o=s&&e!=="/",i=t.length-(s?1:0),a=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let c=null,l=null,u=null;for(;a.length;){const d=a.pop(),{node:f,index:h,skipped:p,depth:m,statics:y,dynamics:b,optionals:x}=d;let{extract:_,rawParams:w,parsedParams:S}=d;if(f.skipOnParamError){if(!zl(e,t,d))continue;w=d.rawParams,_=d.extract,S=d.parsedParams}r&&f.route&&f.kind!==Fr&&ho(l,d)&&(l=d);const C=h===i;if(C&&(f.route&&!o&&ho(u,d)&&(u=d),!f.optional&&!f.wildcard&&!f.index&&!f.pathless))continue;const k=C?void 0:t[h];let E;if(C&&f.index){const P={node:f.index,index:h,skipped:p,depth:m+1,statics:y,dynamics:b,optionals:x,extract:_,rawParams:w,parsedParams:S};let O=!0;if(f.index.skipOnParamError&&(zl(e,t,P)||(O=!1)),O){if(y===i&&!b&&!x&&!p)return P;ho(u,P)&&(u=P)}}if(f.wildcard&&ho(c,d))for(const P of f.wildcard){const{prefix:O,suffix:N}=P;if(O&&(C||!(P.caseSensitive?k:E??=k.toLowerCase()).startsWith(O)))continue;if(N){if(C)continue;const j=t.slice(h).join("/").slice(-N.length);if((P.caseSensitive?j:j.toLowerCase())!==N)continue}const A={node:P,index:i,skipped:p,depth:m,statics:y,dynamics:b,optionals:x,extract:_,rawParams:w,parsedParams:S};if(!(P.skipOnParamError&&!zl(e,t,A))){c=A;break}}if(f.optional){const P=p|1<<m,O=m+1;for(let N=f.optional.length-1;N>=0;N--){const A=f.optional[N];a.push({node:A,index:h,skipped:P,depth:O,statics:y,dynamics:b,optionals:x,extract:_,rawParams:w,parsedParams:S})}if(!C)for(let N=f.optional.length-1;N>=0;N--){const A=f.optional[N],{prefix:j,suffix:$}=A;if(j||$){const q=A.caseSensitive?k:E??=k.toLowerCase();if(j&&!q.startsWith(j)||$&&!q.endsWith($))continue}a.push({node:A,index:h+1,skipped:p,depth:O,statics:y,dynamics:b,optionals:x+1,extract:_,rawParams:w,parsedParams:S})}}if(!C&&f.dynamic&&k)for(let P=f.dynamic.length-1;P>=0;P--){const O=f.dynamic[P],{prefix:N,suffix:A}=O;if(N||A){const j=O.caseSensitive?k:E??=k.toLowerCase();if(N&&!j.startsWith(N)||A&&!j.endsWith(A))continue}a.push({node:O,index:h+1,skipped:p,depth:m+1,statics:y,dynamics:b+1,optionals:x,extract:_,rawParams:w,parsedParams:S})}if(!C&&f.staticInsensitive){const P=f.staticInsensitive.get(E??=k.toLowerCase());P&&a.push({node:P,index:h+1,skipped:p,depth:m+1,statics:y+1,dynamics:b,optionals:x,extract:_,rawParams:w,parsedParams:S})}if(!C&&f.static){const P=f.static.get(k);P&&a.push({node:P,index:h+1,skipped:p,depth:m+1,statics:y+1,dynamics:b,optionals:x,extract:_,rawParams:w,parsedParams:S})}if(f.pathless){const P=m+1;for(let O=f.pathless.length-1;O>=0;O--){const N=f.pathless[O];a.push({node:N,index:h,skipped:p,depth:P,statics:y,dynamics:b,optionals:x,extract:_,rawParams:w,parsedParams:S})}}}if(u&&c)return ho(c,u)?u:c;if(u)return u;if(c)return c;if(r&&l){let d=l.index;for(let h=0;h<l.index;h++)d+=t[h].length;const f=d===e.length?"/":e.slice(d);return l.rawParams??={},l.rawParams["**"]=decodeURIComponent(f),l}return null}function zl(e,t,n){try{const[r,s]=pb(e,t,n);n.rawParams=r,n.extract=s;const o=n.node.parse(r);return n.parsedParams=Object.assign({},n.parsedParams,o),!0}catch{return null}}function ho(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Fr)>(e.node.kind===Fr)||t.node.kind===Fr==(e.node.kind===Fr)&&t.depth>e.depth))):!0}function Ea(e){return Qd(e.filter(t=>t!==void 0).join("/"))}function Qd(e){return e.replace(/\/{2,}/g,"/")}function mb(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Vn(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function gb(e){return Vn(mb(e))}function Za(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function NE(e,t,n){return Za(e,n)===Za(t,n)}function DE({base:e,to:t,trailingSlash:n="never",cache:r}){const s=t.startsWith("/"),o=!s&&t===".";let i;if(r){i=s?t:o?e:e+"\0"+t;const d=r.get(i);if(d)return d}let a;if(o)a=e.split("/");else if(s)a=t.split("/");else{for(a=e.split("/");a.length>1&&Ho(a)==="";)a.pop();const d=t.split("/");for(let f=0,h=d.length;f<h;f++){const p=d[f];p===""?f?f===h-1&&a.push(p):a=[p]:p===".."?a.pop():p==="."||a.push(p)}}a.length>1&&(Ho(a)===""?n==="never"&&a.pop():n==="always"&&a.push(""));let c,l="";for(let d=0;d<a.length;d++){d>0&&(l+="/");const f=a[d];if(!f)continue;c=Xd(f,0,c);const h=c[0];if(h===Ws){l+=f;continue}const p=c[5],m=f.substring(0,c[1]),y=f.substring(c[4],p),b=f.substring(c[2],c[3]);h===Yr?l+=m||y?`${m}{$${b}}${y}`:`$${b}`:h===Xr?l+=m||y?`${m}{$}${y}`:"$":l+=`${m}{-$${b}}${y}`}l=Qd(l);const u=l||"/";return i&&r&&r.set(i,u),u}function IE(e){const t=new Map(e.map(s=>[encodeURIComponent(s),s])),n=Array.from(t.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return s=>s.replace(r,o=>t.get(o)??o)}function $l(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>Qh(s,n)).join("/"):Qh(r,n)}function Vl({path:e,params:t,decoder:n,server:r}){let s=!1;const o={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:o,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:o,isMissingParams:s};const i=e.length;let a=0,c,l="";for(;a<i;){const d=a;c=Xd(e,d,c);const f=c[5];if(a=f+1,d===f)continue;const h=c[0];if(h===Ws){l+="/"+e.substring(d,f);continue}if(h===Xr){const p=t._splat;o._splat=p,o["*"]=p;const m=e.substring(d,c[1]),y=e.substring(c[4],f);if(!p){s=!0,(m||y)&&(l+="/"+m+y);continue}const b=$l("_splat",t,n);l+="/"+m+b+y;continue}if(h===Yr){const p=e.substring(c[2],c[3]);!s&&!(p in t)&&(s=!0),o[p]=t[p];const m=e.substring(d,c[1]),y=e.substring(c[4],f),b=$l(p,t,n)??"undefined";l+="/"+m+b+y;continue}if(h===qo){const p=e.substring(c[2],c[3]),m=t[p];if(m==null)continue;o[p]=m;const y=e.substring(d,c[1]),b=e.substring(c[4],f),x=$l(p,t,n)??"";l+="/"+y+x+b;continue}}return e.endsWith("/")&&(l+="/"),{usedParams:o,interpolatedPath:l||"/",isMissingParams:s}}function Qh(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function Wt(e){return!!e?.isNotFound}function jE(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const zu="tsr-scroll-restoration-v1_3",LE=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function FE(){const e=jE();if(!e)return null;const t=e.getItem(zu);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=sr(r,n)||n;try{e.setItem(zu,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Fi=FE(),zE=e=>e.state.__TSR_key||e.href;function $E(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let Ga=!1;function VE({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:s,location:o}){let i;try{i=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(l){console.error(l);return}const a=t||window.history.state?.__TSR_key,c=i[a];Ga=!0;e:{if(r&&c&&Object.keys(c).length>0){for(const d in c){const f=c[d];if(d==="window")window.scrollTo({top:f.scrollY,left:f.scrollX,behavior:n});else if(d){const h=document.querySelector(d);h&&(h.scrollLeft=f.scrollX,h.scrollTop=f.scrollY)}}break e}const l=(o??window.location).hash.split("#",2)[1];if(l){const d=window.history.state?.__hashScrollIntoViewOptions??!0;if(d){const f=document.getElementById(l);f&&f.scrollIntoView(d)}break e}const u={top:0,left:0,behavior:n};if(window.scrollTo(u),s)for(const d of s){if(d==="window")continue;const f=typeof d=="function"?d():document.querySelector(d);f&&f.scrollTo(u)}}Ga=!1}function BE(e,t){if(!Fi||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Fi))return;e.isScrollRestorationSetup=!0,Ga=!1;const r=e.options.getScrollRestorationKey||zE;window.history.scrollRestoration="manual";const s=o=>{if(Ga||!e.isScrollRestoring)return;let i="";if(o.target===document||o.target===window)i="window";else{const c=o.target.getAttribute("data-scroll-restoration-id");c?i=`[data-scroll-restoration-id="${c}"]`:i=$E(o.target)}const a=r(e.state.location);Fi.set(c=>{const l=c[a]||={},u=l[i]||={};if(i==="window")u.scrollX=window.scrollX||0,u.scrollY=window.scrollY||0;else if(i){const d=document.querySelector(i);d&&(u.scrollX=d.scrollLeft||0,u.scrollY=d.scrollTop||0)}return c})};typeof document<"u"&&document.addEventListener("scroll",LE(s,100),!0),e.subscribe("onRendered",o=>{const i=r(o.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(VE({storageKey:zu,key:i,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Fi.set(a=>(a[i]||={},a)))})}function UE(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function WE(e,t=String){const n=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&n.set(r,t(s))}return n.toString()}function Bl(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function HE(e){const t=new URLSearchParams(e),n={};for(const[r,s]of t.entries()){const o=n[r];o==null?n[r]=Bl(s):Array.isArray(o)?o.push(Bl(s)):n[r]=[o,Bl(s)]}return n}const qE=ZE(JSON.parse),KE=GE(JSON.stringify,JSON.parse);function ZE(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=HE(t);for(const r in n){const s=n[r];if(typeof s=="string")try{n[r]=e(s)}catch{}}return n}}function GE(e,t){const n=typeof t=="function";function r(s){if(typeof s=="object"&&s!==null)try{return e(s)}catch{}else if(n&&typeof s=="string")try{return t(s),e(s)}catch{}return s}return s=>{const o=WE(s,r);return o?`?${o}`:""}}const Gt="__root__";function yb(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&typeof e.href=="string"&&qa(e.href))throw new Error(`Redirect blocked: unsafe protocol in href "${e.href}". Only ${fb.join(", ")} protocols are allowed.`);if(!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Jt(e){return e instanceof Response&&!!e.options}const ka=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Lc=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),As=(e,t,n=!0)=>{const r={...e.router.options.context??{}},s=n?t:t-1;for(let o=0;o<=s;o++){const i=e.matches[o];if(!i)continue;const a=e.router.getMatch(i.id);a&&Object.assign(r,a.__routeContext,a.__beforeLoadContext)}return r},bb=(e,t)=>{const n=e.router.routesById[t.routeId??""]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),qn(n.options.notFoundComponent,"No notFoundComponent found. Please set a notFoundComponent on your route or provide a defaultNotFoundComponent to the router.");const r=e.matches.find(s=>s.routeId===n.id);qn(r,"Could not find match for route: "+n.id),e.updateMatch(r.id,s=>({...s,status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&n.parentRoute&&(t.routeId=n.parentRoute.id,bb(e,t))},or=(e,t,n)=>{if(!(!Jt(n)&&!Wt(n))){if(Jt(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const r=Jt(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,s=>({...s,status:r,context:As(e,t.index),isFetching:!1,error:n})),Wt(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw Jt(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(bb(e,n),n)}},vb=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,po=(e,t,n,r)=>{const{id:s,routeId:o}=e.matches[t],i=e.router.looseRoutesById[o];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,or(e,e.router.getMatch(s),n);try{i.options.onError?.(n)}catch(a){n=a,or(e,e.router.getMatch(s),n)}e.updateMatch(s,a=>(a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,a._nonReactive.loadPromise?.resolve(),{...a,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},xb=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const s=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!Lc(e,t)&&(n.options.loader||n.options.beforeLoad||Sb(n))&&typeof s=="number"&&s!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const i=setTimeout(()=>{ka(e)},s);r._nonReactive.pendingTimeout=i}},YE=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;xb(e,t,n,r);const s=()=>{const o=e.router.getMatch(t);o.preload&&(o.status==="redirected"||o.status==="notFound")&&or(e,o,o.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(s):s()},XE=(e,t,n,r)=>{const s=e.router.getMatch(t),o=s._nonReactive.loadPromise;s._nonReactive.loadPromise=Us(()=>{o?.resolve()});const{paramsError:i,searchError:a}=s;i&&po(e,n,i,"PARSE_PARAMS"),a&&po(e,n,a,"VALIDATE_SEARCH"),xb(e,t,r,s);const c=new AbortController;let l=!1;const u=()=>{l||(l=!0,e.updateMatch(t,w=>({...w,isFetching:"beforeLoad",fetchCount:w.fetchCount+1,abortController:c})))},d=()=>{s._nonReactive.beforeLoadPromise?.resolve(),s._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,w=>({...w,isFetching:!1}))};if(!r.options.beforeLoad){Lo(()=>{u(),d()});return}s._nonReactive.beforeLoadPromise=Us();const f={...As(e,n,!1),...s.__routeContext},{search:h,params:p,cause:m}=s,y=Lc(e,t),b={search:h,abortController:c,params:p,preload:y,context:f,location:e.location,navigate:w=>e.router.navigate({...w,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:y?"preload":m,matches:e.matches,...e.router.options.additionalContext},x=w=>{if(w===void 0){Lo(()=>{u(),d()});return}(Jt(w)||Wt(w))&&(u(),po(e,n,w,"BEFORE_LOAD")),Lo(()=>{u(),e.updateMatch(t,S=>({...S,__beforeLoadContext:w})),d()})};let _;try{if(_=r.options.beforeLoad(b),Ms(_))return u(),_.catch(w=>{po(e,n,w,"BEFORE_LOAD")}).then(x)}catch(w){u(),po(e,n,w,"BEFORE_LOAD")}x(_)},JE=(e,t)=>{const{id:n,routeId:r}=e.matches[t],s=e.router.looseRoutesById[r],o=()=>a(),i=()=>XE(e,n,t,s),a=()=>{if(vb(e,n))return;const c=YE(e,n,s);return Ms(c)?c.then(i):i()};return o()},QE=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const s={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(s),n.options.scripts?.(s),n.options.headers?.(s)]).then(([o,i,a])=>{const c=o?.meta,l=o?.links,u=o?.scripts,d=o?.styles;return{meta:c,links:l,headScripts:u,headers:a,scripts:i,styles:d}})},_b=(e,t,n,r)=>{const s=e.matchPromises[n-1],{params:o,loaderDeps:i,abortController:a,cause:c}=e.router.getMatch(t),l=As(e,n),u=Lc(e,t);return{params:o,deps:i,preload:!!u,parentMatchPromise:s,abortController:a,context:l,location:e.location,navigate:d=>e.router.navigate({...d,_fromLocation:e.location}),cause:u?"preload":c,route:r,...e.router.options.additionalContext}},ep=async(e,t,n,r)=>{try{const s=e.router.getMatch(t);try{(!(yE??e.router.isServer)||s.ssr===!0)&&wb(r);const o=r.options.loader?.(_b(e,t,n,r)),i=r.options.loader&&Ms(o);if((i||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||s._nonReactive.minPendingPromise)&&e.updateMatch(t,l=>({...l,isFetching:"loader"})),r.options.loader){const l=i?await o:o;or(e,e.router.getMatch(t),l),l!==void 0&&e.updateMatch(t,u=>({...u,loaderData:l}))}r._lazyPromise&&await r._lazyPromise;const c=s._nonReactive.minPendingPromise;c&&await c,r._componentsPromise&&await r._componentsPromise,e.updateMatch(t,l=>({...l,error:void 0,context:As(e,n),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(o){let i=o;if(i?.name==="AbortError"){e.updateMatch(t,c=>({...c,status:c.status==="pending"?"success":c.status,isFetching:!1,context:As(e,n)}));return}const a=s._nonReactive.minPendingPromise;a&&await a,Wt(o)&&await r.options.notFoundComponent?.preload?.(),or(e,e.router.getMatch(t),o);try{r.options.onError?.(o)}catch(c){i=c,or(e,e.router.getMatch(t),c)}e.updateMatch(t,c=>({...c,error:i,context:As(e,n),status:"error",isFetching:!1}))}}catch(s){const o=e.router.getMatch(t);o&&(o._nonReactive.loaderPromise=void 0),or(e,o,s)}},ek=async(e,t)=>{const{id:n,routeId:r}=e.matches[t];let s=!1,o=!1;const i=e.router.looseRoutesById[r];if(!vb(e,n)){const l=e.router.getMatch(n);if(l._nonReactive.loaderPromise){if(l.status==="success"&&!e.sync&&!l.preload)return l;await l._nonReactive.loaderPromise;const u=e.router.getMatch(n),d=u._nonReactive.error||u.error;d&&or(e,u,d)}else{const u=Date.now()-l.updatedAt,d=Lc(e,n),f=d?i.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:i.options.staleTime??e.router.options.defaultStaleTime??0,h=i.options.shouldReload,p=typeof h=="function"?h(_b(e,n,t,i)):h,m=!!d&&!e.router.state.matches.some(_=>_.id===n),y=e.router.getMatch(n);y._nonReactive.loaderPromise=Us(),m!==y.preload&&e.updateMatch(n,_=>({..._,preload:m}));const{status:b,invalid:x}=y;s=b==="success"&&(x||(p??u>f)),d&&i.options.preload===!1||(s&&!e.sync?(o=!0,(async()=>{try{await ep(e,n,t,i);const _=e.router.getMatch(n);_._nonReactive.loaderPromise?.resolve(),_._nonReactive.loadPromise?.resolve(),_._nonReactive.loaderPromise=void 0}catch(_){Jt(_)&&await e.router.navigate(_.options)}})()):(b!=="success"||s&&e.sync)&&await ep(e,n,t,i))}}const a=e.router.getMatch(n);o||(a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loadPromise?.resolve()),clearTimeout(a._nonReactive.pendingTimeout),a._nonReactive.pendingTimeout=void 0,o||(a._nonReactive.loaderPromise=void 0),a._nonReactive.dehydrated=void 0;const c=o?a.isFetching:!1;return c!==a.isFetching||a.invalid!==!1?(e.updateMatch(n,l=>({...l,isFetching:c,invalid:!1})),e.router.getMatch(n)):a};async function tp(e){const t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(n=>n._forcePending)&&ka(t);try{for(let a=0;a<t.matches.length;a++){const c=JE(t,a);Ms(c)&&await c}const n=t.firstBadMatchIndex??t.matches.length;for(let a=0;a<n;a++)t.matchPromises.push(ek(t,a));const s=(await Promise.allSettled(t.matchPromises)).filter(a=>a.status==="rejected").map(a=>a.reason);let o;for(const a of s){if(Jt(a))throw a;!o&&Wt(a)&&(o=a)}for(const a of t.matches){const{id:c,routeId:l}=a,u=t.router.looseRoutesById[l];try{const d=QE(t,c,u);if(d){const f=await d;t.updateMatch(c,h=>({...h,...f}))}}catch(d){console.error(`Error executing head for route ${l}:`,d)}}if(o)throw o;const i=ka(t);Ms(i)&&await i}catch(n){if(Wt(n)&&!t.preload){const r=ka(t);throw Ms(r)&&await r,n}if(Jt(n))throw n}return t.matches}async function wb(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const r of Eb){const s=e.options[r]?.preload;s&&n.push(s())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function Sb(e){for(const t of Eb)if(e.options[t]?.preload)return!0;return!1}const Eb=["component","errorComponent","pendingComponent","notFoundComponent"];function tk(e){return{input:({url:t})=>{for(const n of e)t=$u(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=kb(e[n],t);return t}}}function nk(e){const t=gb(e.basepath),n=`/${t}`,r=`${n}/`,s=e.caseSensitive?n:n.toLowerCase(),o=e.caseSensitive?r:r.toLowerCase();return{input:({url:i})=>{const a=e.caseSensitive?i.pathname:i.pathname.toLowerCase();return a===s?i.pathname="/":a.startsWith(o)&&(i.pathname=i.pathname.slice(n.length)),i},output:({url:i})=>(i.pathname=Ea(["/",t,i.pathname]),i)}}function $u(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function kb(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Hr(e){const t=e.resolvedLocation,n=e.location,r=t?.pathname!==n.pathname,s=t?.href!==n.href,o=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:r,hrefChanged:s,hashChanged:o}}class rk{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const r=this.options,s=this.basepath??r?.basepath??"/",o=this.basepath===void 0,i=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=IE(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=mE()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let f;this.resolvePathCache=Ka(1e3),f=this.buildRouteTree(),this.setRoutes(f)}!this.__store&&this.latestLocation&&(this.__store=new hE(ok(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(f=>!["redirected"].includes(f.status))}}}),BE(this));let a=!1;const c=this.options.basepath??"/",l=this.options.rewrite;if(o||s!==c||i!==l){this.basepath=c;const f=[],h=gb(c);h&&h!=="/"&&f.push(nk({basepath:c})),l&&f.push(l),this.rewrite=f.length===0?void 0:f.length===1?f[0]:tk(f),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=OE(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&EE(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const s={eventType:n,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const s=({pathname:c,search:l,hash:u,href:d,state:f})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const x=this.options.parseSearch(l),_=this.options.stringifySearch(x);return{href:c+_+u,publicHref:d,pathname:fo(c),external:!1,searchStr:_,search:Ot(r?.search,x),hash:fo(u.slice(1)),state:Ot(r?.state,f)}}const h=new URL(d,this.origin),p=$u(this.rewrite,h),m=this.options.parseSearch(p.search),y=this.options.stringifySearch(m);return p.search=y,{href:p.href.replace(p.origin,""),publicHref:d,pathname:fo(p.pathname),external:!!this.rewrite&&p.origin!==this.origin,searchStr:y,search:Ot(r?.search,m),hash:fo(p.hash.slice(1)),state:Ot(r?.state,f)}},o=s(n),{__tempLocation:i,__tempKey:a}=o.state;if(i&&(!a||a===this.tempLocationKey)){const c=s(i);return c.state.key=o.state.key,c.state.__TSR_key=o.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:o}}return o},this.resolvePathWithBase=(n,r)=>DE({base:n,to:Qd(r),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,s)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},s):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>ik({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(o=>o.status==="pending"),r=this.state.matches.filter(o=>o.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...r]).forEach(o=>{this.cancelMatch(o.id)})},this.buildLocation=n=>{const r=(o={})=>{const i=o._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutesLightweight(i);if(o.from&&process.env.NODE_ENV!=="production"&&o._isNavigate){const j=this.getMatchedRoutes(o.from).matchedRoutes,$=Xh(a.matchedRoutes,D=>rp(D.fullPath,o.from)),q=Xh(j,D=>rp(D.fullPath,a.fullPath));!$&&!q&&console.warn(`Could not find match for from: ${o.from}`)}const c=o.unsafeRelative==="path"?i.pathname:o.from??a.fullPath,l=this.resolvePathWithBase(c,"."),u=a.search,d={...a.params},f=o.to?this.resolvePathWithBase(l,`${o.to}`):this.resolvePathWithBase(l,"."),h=o.params===!1||o.params===null?{}:(o.params??!0)===!0?d:Object.assign(d,sr(o.params,d)),p=Vl({path:f,params:h,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,m=this.getMatchedRoutes(p);let y=m.matchedRoutes;(m.foundRoute?m.foundRoute.path!=="/"&&m.routeParams["**"]:Vn(p))&&this.options.notFoundRoute&&(y=[...y,this.options.notFoundRoute]);let x=!1;if(Object.keys(h).length>0)for(const j of y){const $=j.options.params?.stringify??j.options.stringifyParams;$&&(x=!0,Object.assign(h,$(h)))}const _=n.leaveParams?f:fo(x?Vl({path:f,params:h,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:p);let w=u;if(n._includeValidateSearch&&this.options.search?.strict){const j={};y.forEach($=>{if($.options.validateSearch)try{Object.assign(j,Ca($.options.validateSearch,{...j,...w}))}catch{}}),w=j}w=ak({search:w,dest:o,destRoutes:y,_includeValidateSearch:n._includeValidateSearch}),w=Ot(u,w);const S=this.options.stringifySearch(w),C=o.hash===!0?i.hash:o.hash?sr(o.hash,i.hash):void 0,k=C?`#${C}`:"";let E=o.state===!0?i.state:o.state?sr(o.state,i.state):{};E=Ot(i.state,E);const P=`${_}${S}${k}`;let O,N,A=!1;if(this.rewrite){const j=new URL(P,this.origin),$=kb(this.rewrite,j);O=j.href.replace(j.origin,""),$.origin!==this.origin?(N=$.href,A=!0):N=$.pathname+$.search+$.hash}else O=_E(P),N=O;return{publicHref:N,href:O,pathname:_,search:w,searchStr:S,state:E,hash:C??"",external:A,unmaskOnReload:o.unmaskOnReload}},s=(o={},i)=>{const a=r(o);let c=i?r(i):void 0;if(!c){const l={};if(this.options.routeMasks){const u=kE(a.pathname,this.processedTree);if(u){Object.assign(l,u.rawParams);const{from:d,params:f,...h}=u.route,p=f===!1||f===null?{}:(f??!0)===!0?l:Object.assign(l,sr(f,l));i={from:n.from,...h,params:p},c=r(i)}}}return c&&(a.maskedLocation=c),a};return n.mask?s(n,{from:n.from,...n.mask}):s(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...s})=>{const o=()=>{const c=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];c.forEach(u=>{s.state[u]=this.latestLocation.state[u]});const l=Wr(s.state,this.latestLocation.state);return c.forEach(u=>{delete s.state[u]}),l},i=Vn(this.latestLocation.href)===Vn(s.href),a=this.commitLocationPromise;if(this.commitLocationPromise=Us(()=>{a?.resolve()}),i&&o())this.load();else{let{maskedLocation:c,hashScrollIntoView:l,...u}=s;c&&(u={...c,state:{...c.state,__tempKey:void 0,__tempLocation:{...u,search:u.searchStr,state:{...u.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(u.unmaskOnReload??this.options.unmaskOnReload??!1)&&(u.state.__tempKey=this.tempLocationKey)),u.state.__hashScrollIntoViewOptions=l??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[s.replace?"replace":"push"](u.publicHref,u.state,{ignoreBlocker:r})}return this.resetNextScroll=s.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:s,viewTransition:o,ignoreBlocker:i,href:a,...c}={})=>{if(a){const d=this.history.location.state.__TSR_index,f=Wa(a,{__TSR_index:n?d:d+1}),h=new URL(f.pathname,this.origin),p=$u(this.rewrite,h);c.to=p.pathname,c.search=this.options.parseSearch(f.search),c.hash=f.hash.slice(1)}const l=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=l;const u=this.commitLocation({...l,viewTransition:o,replace:n,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===l&&(this.pendingBuiltLocation=void 0)}),u},this.navigate=async({to:n,reloadDocument:r,href:s,publicHref:o,...i})=>{let a=!1;if(s)try{new URL(`${s}`),a=!0}catch{}if(a&&!r&&(r=!0),r){if(n!==void 0||!s){const l=this.buildLocation({to:n,...i});s=s??l.publicHref,o=o??l.publicHref}const c=!a&&o?o:s;if(qa(c))return process.env.NODE_ENV!=="production"&&console.warn(`Blocked navigation to dangerous protocol: ${c}`),Promise.resolve();if(!i.ignoreBlocker){const u=this.history.getBlockers?.()??[];for(const d of u)if(d?.blockerFn&&await d.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return i.replace?window.location.replace(c):window.location.href=c,Promise.resolve()}return this.buildAndCommitLocation({...i,href:s,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:r.cachedMatches.filter(s=>!n.some(o=>o.id===s.id))}))},this.load=async n=>{let r,s,o;for(o=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();const c=this.latestLocation,l=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Hr({resolvedLocation:l,location:c})}),this.emit({type:"onBeforeLoad",...Hr({resolvedLocation:l,location:c})}),await tp({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:c,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let u=[],d=[],f=[];Lo(()=>{this.__store.setState(h=>{const p=h.matches,m=h.pendingMatches||h.matches;return u=p.filter(y=>!m.some(b=>b.id===y.id)),d=m.filter(y=>!p.some(b=>b.id===y.id)),f=m.filter(y=>p.some(b=>b.id===y.id)),{...h,isLoading:!1,loadedAt:Date.now(),matches:m,pendingMatches:void 0,cachedMatches:[...h.cachedMatches,...u.filter(y=>y.status!=="error"&&y.status!=="notFound")]}}),this.clearExpiredCache()}),[[u,"onLeave"],[d,"onEnter"],[f,"onStay"]].forEach(([h,p])=>{h.forEach(m=>{this.looseRoutesById[m.routeId].options[p]?.(m)})})})})}})}catch(c){Jt(c)?(r=c,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):Wt(c)&&(s=c),this.__store.setState(l=>({...l,statusCode:r?r.status:s?404:l.matches.some(u=>u.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===o&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==this.latestLoadPromise;)await this.latestLoadPromise;let i;this.hasNotFoundMatch()?i=404:this.__store.state.matches.some(a=>a.status==="error")&&(i=500),i!==void 0&&this.__store.setState(a=>({...a,statusCode:i}))},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let s;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const o=this.latestLocation,i=this.state.resolvedLocation,a=typeof r.types=="function"?r.types(Hr({resolvedLocation:i,location:o})):r.types;if(a===!1){n();return}s={update:n,types:a}}else s=n;document.startViewTransition(s)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const s=this.state.pendingMatches?.some(o=>o.id===n)?"pendingMatches":this.state.matches.some(o=>o.id===n)?"matches":this.state.cachedMatches.some(o=>o.id===n)?"cachedMatches":"";s&&this.__store.setState(o=>({...o,[s]:o[s]?.map(i=>i.id===n?r(i):i)}))})},this.getMatch=n=>{const r=s=>s.id===n;return this.state.cachedMatches.find(r)??this.state.pendingMatches?.find(r)??this.state.matches.find(r)},this.invalidate=n=>{const r=s=>n?.filter?.(s)??!0?{...s,invalid:!0,...n?.forcePending||s.status==="error"||s.status==="notFound"?{status:"pending",error:void 0}:void 0}:s;return this.__store.setState(s=>({...s,matches:s.matches.map(r),cachedMatches:s.cachedMatches.map(r),pendingMatches:s.pendingMatches?.map(r)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const s=n.options._builtLocation??this.buildLocation(n.options),o=this.getParsedLocationHref(s);n.options.href=o,n.headers.set("Location",o)}else if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const o=s.pathname+s.search+s.hash;n.options.href=o,n.headers.set("Location",o)}}catch{}return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.__store.setState(s=>({...s,cachedMatches:s.cachedMatches.filter(o=>!r(o))})):this.__store.setState(s=>({...s,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=r=>{const s=this.looseRoutesById[r.routeId];if(!s.options.loader)return!0;const o=(r.preload?s.options.preloadGcTime??this.options.defaultPreloadGcTime:s.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=o};this.clearCache({filter:n})},this.loadRouteChunk=wb,this.preloadRoute=async n=>{const r=this.buildLocation(n);let s=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const o=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(a=>a.id)),i=new Set([...o,...this.state.cachedMatches.map(a=>a.id)]);Lo(()=>{s.forEach(a=>{i.has(a.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,a]}))})});try{return s=await tp({router:this,matches:s,location:r,preload:!0,updateMatch:(a,c)=>{o.has(a)?s=s.map(l=>l.id===a?c(l):l):this.updateMatch(a,c)}}),s}catch(a){if(Jt(a))return a.options.reloadDocument?void 0:await this.preloadRoute({...a.options,_fromLocation:r});Wt(a)||console.error(a);return}},this.matchRoute=(n,r)=>{const s={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},o=this.buildLocation(s);if(r?.pending&&this.state.status!=="pending")return!1;const a=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,c=CE(o.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,a.pathname,this.processedTree);return!c||n.params&&!Wr(c.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?Wr(a.search,o.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??KE,parseSearch:t.parseSearch??qE}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:n,processedTree:r}){this.routesById=t,this.routesByPath=n,this.processedTree=r;const s=this.options.notFoundRoute;s&&(s.init({originalIndex:99999999999}),this.routesById[s.id]=s)}get looseRoutesById(){return this.routesById}matchRoutesInternal(t,n){const r=this.getMatchedRoutes(t.pathname),{foundRoute:s,routeParams:o,parsedParams:i}=r;let{matchedRoutes:a}=r,c=!1;(s?s.path!=="/"&&o["**"]:Vn(t.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:c=!0);const l=c?lk(this.options.notFoundMode,a):void 0,u=[],d=f=>f?.id?f.context??this.options.context??void 0:this.options.context??void 0;return a.forEach((f,h)=>{const p=u[h-1],[m,y,b]=(()=>{const $=p?.search??t.search,q=p?._strictSearch??void 0;try{const D=Ca(f.options.validateSearch,{...$})??void 0;return[{...$,...D},{...q,...D},void 0]}catch(D){let H=D;if(D instanceof Ya||(H=new Ya(D.message,{cause:D})),n?.throwOnError)throw H;return[$,{},H]}})(),x=f.options.loaderDeps?.({search:m})??"",_=x?JSON.stringify(x):"",{interpolatedPath:w,usedParams:S}=Vl({path:f.fullPath,params:o,decoder:this.pathParamsDecoder,server:this.isServer}),C=f.id+w+_,k=this.getMatch(C),E=this.state.matches.find($=>$.routeId===f.id),P=k?._strictParams??S;let O;if(!k)try{sp(f,S,i,P)}catch($){if(Wt($)||Jt($)?O=$:O=new sk($.message,{cause:$}),n?.throwOnError)throw O}Object.assign(o,P);const N=E?"stay":"enter";let A;if(k)A={...k,cause:N,params:E?Ot(E.params,o):o,_strictParams:P,search:Ot(E?E.search:k.search,m),_strictSearch:y};else{const $=f.options.loader||f.options.beforeLoad||f.lazyFn||Sb(f)?"pending":"success";A={id:C,ssr:f.options.ssr,index:h,routeId:f.id,params:E?Ot(E.params,o):o,_strictParams:P,pathname:w,updatedAt:Date.now(),search:E?Ot(E.search,m):m,_strictSearch:y,searchError:void 0,status:$,isFetching:!1,error:void 0,paramsError:O,__routeContext:void 0,_nonReactive:{loadPromise:Us()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:N,loaderDeps:E?Ot(E.loaderDeps,x):x,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:f.options.staticData||{},fullPath:f.fullPath}}n?.preload||(A.globalNotFound=l===f.id),A.searchError=b;const j=d(p);A.context={...j,...A.__routeContext,...A.__beforeLoadContext},u.push(A)}),u.forEach((f,h)=>{const p=this.looseRoutesById[f.routeId];if(!this.getMatch(f.id)){const y=u[h-1],b=d(y);if(p.options.context){const x={deps:f.loaderDeps,params:f.params,context:b??{},location:t,navigate:_=>this.navigate({..._,_fromLocation:t}),buildLocation:this.buildLocation,cause:f.cause,abortController:f.abortController,preload:!!f.preload,matches:u};f.__routeContext=p.options.context(x)??void 0}f.context={...b,...f.__routeContext,...f.__beforeLoadContext}}}),u}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:r,parsedParams:s}=this.getMatchedRoutes(t.pathname),o=Ho(n),i={...t.search};for(const u of n)try{Object.assign(i,Ca(u.options.validateSearch,i))}catch{}const a=Ho(this.state.matches),c=a&&a.routeId===o.id&&t.pathname===this.state.location.pathname;let l;if(c)l=a.params;else{const u={...r};for(const d of n)try{sp(d,r,s??{},u)}catch{}l=u}return{matchedRoutes:n,fullPath:o.fullPath,search:i,params:l}}}class Ya extends Error{}class sk extends Error{}const np=e=>e.endsWith("/")&&e.length>1?e.slice(0,-1):e;function rp(e,t){return np(e)===np(t)}function ok(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Ca(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Ya("Async validation not supported");if(n.issues)throw new Ya(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function ik({pathname:e,routesById:t,processedTree:n}){const r={},s=Vn(e);let o,i;const a=RE(s,n,!0);return a&&(o=a.route,Object.assign(r,a.rawParams),i=Object.assign({},a.parsedParams)),{matchedRoutes:a?.branch||[t[Gt]],routeParams:r,foundRoute:o,parsedParams:i}}function ak({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return ck(n)(e,t,r??!1)}function ck(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const s of e){if("search"in s.options)s.options.search?.middlewares&&t.middlewares.push(...s.options.search.middlewares);else if(s.options.preSearchFilters||s.options.postSearchFilters){const o=({search:i,next:a})=>{let c=i;"preSearchFilters"in s.options&&s.options.preSearchFilters&&(c=s.options.preSearchFilters.reduce((u,d)=>d(u),i));const l=a(c);return"postSearchFilters"in s.options&&s.options.postSearchFilters?s.options.postSearchFilters.reduce((u,d)=>d(u),l):l};t.middlewares.push(o)}if(s.options.validateSearch){const o=({search:i,next:a})=>{const c=a(i);if(!t._includeValidateSearch)return c;try{return{...c,...Ca(s.options.validateSearch,c)??void 0}}catch{return c}};t.middlewares.push(o)}}const n=({search:s})=>{const o=t.dest;return o.search?o.search===!0?s:sr(o.search,s):{}};t.middlewares.push(n);const r=(s,o,i)=>{if(s>=i.length)return o;const a=i[s];return a({search:o,next:l=>r(s+1,l,i)})};return function(o,i,a){return t.dest=i,t._includeValidateSearch=a,r(0,o,t.middlewares)}}function lk(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return Gt}function sp(e,t,n,r){const s=e.options.params?.parse??e.options.parseParams;if(s)if(e.options.skipRouteOnParseError)for(const o in t)o in n&&(r[o]=n[o]);else{const o=s(r);Object.assign(r,o)}}const uk="Error preloading route! ☝️";class Cb{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const r=this.options,s=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),s?this._path=Gt:this.parentRoute||qn(!1,"Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.");let o=s?Gt:r?.path;o&&o!=="/"&&(o=mb(o));const i=r?.id||o;let a=s?Gt:Ea([this.parentRoute.id===Gt?"":this.parentRoute.id,i]);o===Gt&&(o="/"),a!==Gt&&(a=Ea(["/",a]));const c=a===Gt?"/":Ea([this.parentRoute.fullPath,o]);this._path=o,this._id=a,this._fullPath=c,this._to=Vn(c)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>yb({from:this.fullPath,...n}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class dk extends Cb{constructor(t){super(t)}}const zi=typeof window<"u"?v.useLayoutEffect:v.useEffect;function Ul(e){const t=v.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function fk(e,t,n={},r={}){v.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const s=new IntersectionObserver(([o])=>{t(o)},n);return s.observe(e.current),()=>{s.disconnect()}},[t,n,r.disabled,e])}function hk(e){const t=v.useRef(null);return v.useImperativeHandle(e,()=>t.current,[]),t}function ef(e){const t=e.errorComponent??tf;return g.jsx(pk,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?v.createElement(t,{error:n,reset:r}):e.children})}class pk extends v.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function tf({error:e}){const[t,n]=v.useState(process.env.NODE_ENV!=="production");return g.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[g.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),g.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),g.jsx("div",{style:{height:".25rem"}}),t?g.jsx("div",{children:g.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?g.jsx("code",{children:e.message}):null})}):null]})}function mk({children:e,fallback:t=null}){return Rb()?g.jsx(T.Fragment,{children:e}):g.jsx(T.Fragment,{children:t})}function Rb(){return T.useSyncExternalStore(gk,()=>!0,()=>!1)}function gk(){return()=>{}}var yk=process.env.NODE_ENV==="production";function Hs(e,t){if(!yk){if(e)return;var n="Warning: "+t;typeof console<"u"&&console.warn(n);try{throw Error(n)}catch{}}}var $i={exports:{}},Wl={},Vi={exports:{}},Hl={};var op;function bk(){if(op)return Hl;op=1;var e=T;function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,o=e.useLayoutEffect,i=e.useDebugValue;function a(d,f){var h=f(),p=r({inst:{value:h,getSnapshot:f}}),m=p[0].inst,y=p[1];return o(function(){m.value=h,m.getSnapshot=f,c(m)&&y({inst:m})},[d,h,f]),s(function(){return c(m)&&y({inst:m}),d(function(){c(m)&&y({inst:m})})},[d]),i(h),h}function c(d){var f=d.getSnapshot;d=d.value;try{var h=f();return!n(d,h)}catch{return!0}}function l(d,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:a;return Hl.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Hl}var ql={};var ip;function vk(){return ip||(ip=1,process.env.NODE_ENV!=="production"&&(function(){function e(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}function t(h,p){u||s.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var m=p();if(!d){var y=p();o(m,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}y=i({inst:{value:m,getSnapshot:p}});var b=y[0].inst,x=y[1];return c(function(){b.value=m,b.getSnapshot=p,n(b)&&x({inst:b})},[h,m,p]),a(function(){return n(b)&&x({inst:b}),h(function(){n(b)&&x({inst:b})})},[h]),l(m),m}function n(h){var p=h.getSnapshot;h=h.value;try{var m=p();return!o(h,m)}catch{return!0}}function r(h,p){return p()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var s=T,o=typeof Object.is=="function"?Object.is:e,i=s.useState,a=s.useEffect,c=s.useLayoutEffect,l=s.useDebugValue,u=!1,d=!1,f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;ql.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:f,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),ql}var ap;function Pb(){return ap||(ap=1,process.env.NODE_ENV==="production"?Vi.exports=bk():Vi.exports=vk()),Vi.exports}var cp;function xk(){if(cp)return Wl;cp=1;var e=T,t=Pb();function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,o=e.useRef,i=e.useEffect,a=e.useMemo,c=e.useDebugValue;return Wl.useSyncExternalStoreWithSelector=function(l,u,d,f,h){var p=o(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=a(function(){function b(C){if(!x){if(x=!0,_=C,C=f(C),h!==void 0&&m.hasValue){var k=m.value;if(h(k,C))return w=k}return w=C}if(k=w,r(_,C))return k;var E=f(C);return h!==void 0&&h(k,E)?(_=C,k):(_=C,w=E)}var x=!1,_,w,S=d===void 0?null:d;return[function(){return b(u())},S===null?void 0:function(){return b(S())}]},[u,d,f,h]);var y=s(l,p[0],p[1]);return i(function(){m.hasValue=!0,m.value=y},[y]),c(y),y},Wl}var Kl={};var lp;function _k(){return lp||(lp=1,process.env.NODE_ENV!=="production"&&(function(){function e(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=T,n=Pb(),r=typeof Object.is=="function"?Object.is:e,s=n.useSyncExternalStore,o=t.useRef,i=t.useEffect,a=t.useMemo,c=t.useDebugValue;Kl.useSyncExternalStoreWithSelector=function(l,u,d,f,h){var p=o(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=a(function(){function b(C){if(!x){if(x=!0,_=C,C=f(C),h!==void 0&&m.hasValue){var k=m.value;if(h(k,C))return w=k}return w=C}if(k=w,r(_,C))return k;var E=f(C);return h!==void 0&&h(k,E)?(_=C,k):(_=C,w=E)}var x=!1,_,w,S=d===void 0?null:d;return[function(){return b(u())},S===null?void 0:function(){return b(S())}]},[u,d,f,h]);var y=s(l,p[0],p[1]);return i(function(){m.hasValue=!0,m.value=y},[y]),c(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Kl}var up;function wk(){return up||(up=1,process.env.NODE_ENV==="production"?$i.exports=xk():$i.exports=_k()),$i.exports}var Sk=wk();function Ek(e,t=r=>r,n={}){const r=n.equal??kk;return Sk.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,r)}function kk(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,s]of e)if(!t.has(r)||!Object.is(s,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=dp(e);if(n.length!==dp(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function dp(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const Zl=v.createContext(null);function Ob(){return typeof document>"u"?Zl:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Zl,Zl)}function tn(e){const t=v.useContext(Ob());return Hs(!((e?.warn??!0)&&!t),"useRouter must be used inside a <RouterProvider> component!"),t}function Qt(e){const t=tn({warn:e?.router===void 0}),n=e?.router||t,r=T.useRef(void 0);return Ek(n.__store,s=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const o=Ot(r.current,e.select(s));return r.current=o,o}return e.select(s)}return s})}const Fc=v.createContext(void 0),Ck=v.createContext(void 0);function Pn(e){const t=v.useContext(e.from?Ck:Fc);return Qt({select:r=>{const s=r.matches.find(o=>e.from?e.from===o.routeId:o.id===t);if(qn(!((e.shouldThrow??!0)&&!s),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),s!==void 0)return e.select?e.select(s):s},structuralSharing:e.structuralSharing})}function nf(e){return Pn({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function rf(e){const{select:t,...n}=e;return Pn({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function pi(e){return Pn({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function sf(e){return Pn({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function ls(e){const t=tn();return v.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Rk(e,t){const n=tn(),r=hk(t),{activeProps:s,inactiveProps:o,activeOptions:i,to:a,preload:c,preloadDelay:l,hashScrollIntoView:u,replace:d,startTransition:f,resetScroll:h,viewTransition:p,children:m,target:y,disabled:b,style:x,className:_,onClick:w,onFocus:S,onMouseEnter:C,onMouseLeave:k,onTouchStart:E,ignoreBlocker:P,params:O,search:N,hash:A,state:j,mask:$,reloadDocument:q,unsafeRelative:D,from:H,_fromLocation:F,...W}=e,se=Rb(),I=Qt({select:B=>B.location.search,structuralSharing:!0}),Y=e.from,K=v.useMemo(()=>({...e,from:Y}),[n,I,Y,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),Z=v.useMemo(()=>n.buildLocation({...K}),[n,K]),oe=Z.maskedLocation?Z.maskedLocation.publicHref:Z.publicHref,ce=Z.maskedLocation?Z.maskedLocation.external:Z.external,V=v.useMemo(()=>Nk(oe,ce,n.history,b),[b,ce,oe,n.history]),ee=v.useMemo(()=>{if(V?.external){if(qa(V.href)){process.env.NODE_ENV!=="production"&&console.warn(`Blocked Link with dangerous protocol: ${V.href}`);return}return V.href}if(!Dk(a)&&!(typeof a!="string"||a.indexOf(":")===-1))try{if(new URL(a),qa(a)){process.env.NODE_ENV!=="production"&&console.warn(`Blocked Link with dangerous protocol: ${a}`);return}return a}catch{}},[a,V]),me=Qt({select:B=>{if(ee)return!1;if(i?.exact){if(!NE(B.location.pathname,Z.pathname,n.basepath))return!1}else{const Q=Za(B.location.pathname,n.basepath),ue=Za(Z.pathname,n.basepath);if(!(Q.startsWith(ue)&&(Q.length===ue.length||Q[ue.length]==="/")))return!1}return(i?.includeSearch??!0)&&!Wr(B.location.search,Z.search,{partial:!i?.exact,ignoreUndefined:!i?.explicitUndefined})?!1:i?.includeHash?se&&B.location.hash===Z.hash:!0}}),le=me?sr(s,{})??Pk:Gl,fe=me?Gl:sr(o,{})??Gl,ge=[_,le.className,fe.className].filter(Boolean).join(" "),Ze=(x||le.style||fe.style)&&{...x,...le.style,...fe.style},[_t,rn]=v.useState(!1),qt=v.useRef(!1),st=e.reloadDocument||ee?!1:c??n.options.defaultPreload,Qn=l??n.options.defaultPreloadDelay??0,ot=v.useCallback(()=>{n.preloadRoute({...K}).catch(B=>{console.warn(B),console.warn(uk)})},[n,K]),ps=v.useCallback(B=>{B?.isIntersecting&&ot()},[ot]);fk(r,ps,Ak,{disabled:!!b||st!=="viewport"}),v.useEffect(()=>{qt.current||!b&&st==="render"&&(ot(),qt.current=!0)},[b,ot,st]);const R=B=>{const Q=B.currentTarget.getAttribute("target"),ue=y!==void 0?y:Q;if(!b&&!Ik(B)&&!B.defaultPrevented&&(!ue||ue==="_self")&&B.button===0){B.preventDefault(),Dc.flushSync(()=>{rn(!0)});const ve=n.subscribe("onResolved",()=>{ve(),rn(!1)});n.navigate({...K,replace:d,resetScroll:h,hashScrollIntoView:u,startTransition:f,viewTransition:p,ignoreBlocker:P})}};if(ee)return{...W,ref:r,href:ee,...m&&{children:m},...y&&{target:y},...b&&{disabled:b},...x&&{style:x},..._&&{className:_},...w&&{onClick:w},...S&&{onFocus:S},...C&&{onMouseEnter:C},...k&&{onMouseLeave:k},...E&&{onTouchStart:E}};const M=B=>{b||st&&ot()},z=M,J=B=>{if(!(b||!st))if(!Qn)ot();else{const Q=B.target;if(mo.has(Q))return;const ue=setTimeout(()=>{mo.delete(Q),ot()},Qn);mo.set(Q,ue)}},G=B=>{if(b||!st||!Qn)return;const Q=B.target,ue=mo.get(Q);ue&&(clearTimeout(ue),mo.delete(Q))};return{...W,...le,...fe,href:V?.href,ref:r,onClick:go([w,R]),onFocus:go([S,M]),onMouseEnter:go([C,J]),onMouseLeave:go([k,G]),onTouchStart:go([E,z]),disabled:!!b,target:y,...Ze&&{style:Ze},...ge&&{className:ge},...b&&Ok,...me&&Tk,...se&&_t&&Mk}}const Gl={},Pk={className:"active"},Ok={role:"link","aria-disabled":!0},Tk={"data-status":"active","aria-current":"page"},Mk={"data-transitioning":"transitioning"},mo=new WeakMap,Ak={rootMargin:"100px"},go=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Nk(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function Dk(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const Tb=v.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:s,...o}=Rk(r,t),i=typeof r.children=="function"?r.children({isActive:o["data-status"]==="active"}):r.children;if(!n){const{disabled:a,...c}=o;return v.createElement("a",c,i)}return v.createElement(n,o,i)});function Ik(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class jk extends Cb{constructor(t){super(t),this.useMatch=n=>Pn({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Pn({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>sf({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>pi({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>rf({...n,from:this.id}),this.useLoaderData=n=>nf({...n,from:this.id}),this.useNavigate=()=>ls({from:this.fullPath}),this.Link=T.forwardRef((n,r)=>g.jsx(Tb,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function jn(e){return new jk(e)}class Lk extends dk{constructor(t){super(t),this.useMatch=n=>Pn({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Pn({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>sf({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>pi({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>rf({...n,from:this.id}),this.useLoaderData=n=>nf({...n,from:this.id}),this.useNavigate=()=>ls({from:this.fullPath}),this.Link=T.forwardRef((n,r)=>g.jsx(Tb,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function Fk(e){return new Lk(e)}function fp(e){return typeof e=="object"?new hp(e,{silent:!0}).createRoute(e):new hp(e,{silent:!0}).createRoute}class hp{constructor(t,n){this.path=t,this.createRoute=r=>{Hs(this.silent,"FileRoute is deprecated and will be removed in the next major version. Use the createFileRoute(path)(options) function instead.");const s=jn(r);return s.isRoot=!1,s},this.silent=n?.silent}}class pp{constructor(t){this.useMatch=n=>Pn({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Pn({from:this.options.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>sf({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>pi({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>rf({...n,from:this.options.id}),this.useLoaderData=n=>nf({...n,from:this.options.id}),this.useNavigate=()=>{const n=tn();return ls({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function mp(e){return typeof e=="object"?new pp(e):t=>new pp({id:e,...t})}function zk(){const e=tn(),t=v.useRef({router:e,mounted:!1}),[n,r]=v.useState(!1),{hasPendingMatches:s,isLoading:o}=Qt({select:d=>({isLoading:d.isLoading,hasPendingMatches:d.matches.some(f=>f.status==="pending")}),structuralSharing:!0}),i=Ul(o),a=o||n||s,c=Ul(a),l=o||s,u=Ul(l);return e.startTransition=d=>{r(!0),v.startTransition(()=>{d(),r(!1)})},v.useEffect(()=>{const d=e.history.subscribe(e.load),f=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Vn(e.latestLocation.publicHref)!==Vn(f.publicHref)&&e.commitLocation({...f,replace:!0}),()=>{d()}},[e,e.history]),zi(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(f){console.error(f)}})()},[e]),zi(()=>{i&&!o&&e.emit({type:"onLoad",...Hr(e.state)})},[i,e,o]),zi(()=>{u&&!l&&e.emit({type:"onBeforeRouteMount",...Hr(e.state)})},[l,u,e]),zi(()=>{if(c&&!a){const d=Hr(e.state);e.emit({type:"onResolved",...d}),e.__store.setState(f=>({...f,status:"idle",resolvedLocation:f.location})),d.hrefChanged&&UE(e)}},[a,c,e]),null}function $k(e){const t=Qt({select:n=>`not-found-${n.location.pathname}-${n.status}`});return g.jsx(ef,{getResetKey:()=>t,onCatch:(n,r)=>{if(Wt(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(Wt(n))return e.fallback?.(n);throw n},children:e.children})}function Vk(){return g.jsx("p",{children:"Not Found"})}function Ss(e){return g.jsx(g.Fragment,{children:e.children})}function Mb(e,t,n){return t.options.notFoundComponent?g.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?g.jsx(e.options.defaultNotFoundComponent,{...n}):(process.env.NODE_ENV==="development"&&Hs(t.options.notFoundComponent,`A notFoundError was encountered on the route with ID "${t.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Not Found</p>)`),g.jsx(Vk,{}))}function Bk(){return tn().isScrollRestoring,null}const Ab=v.memo(function({matchId:t}){const n=tn(),r=Qt({select:m=>{const y=m.matches.findIndex(x=>x.id===t),b=m.matches[y];return qn(b,`Could not find match for matchId "${t}". Please file an issue!`),{routeId:b.routeId,ssr:b.ssr,_displayPending:b._displayPending,resetKey:m.loadedAt,parentRouteId:m.matches[y-1]?.routeId}},structuralSharing:!0}),s=n.routesById[r.routeId],o=s.options.pendingComponent??n.options.defaultPendingComponent,i=o?g.jsx(o,{}):null,a=s.options.errorComponent??n.options.defaultErrorComponent,c=s.options.onCatch??n.options.defaultOnCatch,l=s.isRoot?s.options.notFoundComponent??n.options.notFoundRoute?.options.component:s.options.notFoundComponent,u=r.ssr===!1||r.ssr==="data-only",d=(!s.isRoot||s.options.wrapInSuspense||u)&&(s.options.wrapInSuspense??o??(s.options.errorComponent?.preload||u))?v.Suspense:Ss,f=a?ef:Ss,h=l?$k:Ss,p=s.isRoot?s.options.shellComponent??Ss:Ss;return g.jsxs(p,{children:[g.jsx(Fc.Provider,{value:t,children:g.jsx(d,{fallback:i,children:g.jsx(f,{getResetKey:()=>r.resetKey,errorComponent:a||tf,onCatch:(m,y)=>{if(Wt(m))throw m;Hs(!1,`Error in route match: ${t}`),c?.(m,y)},children:g.jsx(h,{fallback:m=>{if(!l||m.routeId&&m.routeId!==r.routeId||!m.routeId&&!s.isRoot)throw m;return v.createElement(l,m)},children:u||r._displayPending?g.jsx(mk,{fallback:i,children:g.jsx(gp,{matchId:t})}):g.jsx(gp,{matchId:t})})})})}),r.parentRouteId===Gt&&n.options.scrollRestoration?g.jsxs(g.Fragment,{children:[g.jsx(Uk,{}),g.jsx(Bk,{})]}):null]})});function Uk(){const e=tn(),t=v.useRef(void 0);return g.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Hr(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const gp=v.memo(function({matchId:t}){const n=tn(),{match:r,key:s,routeId:o}=Qt({select:c=>{const l=c.matches.find(p=>p.id===t),u=l.routeId,f=(n.routesById[u].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:u,loaderDeps:l.loaderDeps,params:l._strictParams,search:l._strictSearch});return{key:f?JSON.stringify(f):void 0,routeId:u,match:{id:l.id,status:l.status,error:l.error,invalid:l.invalid,_forcePending:l._forcePending,_displayPending:l._displayPending}}},structuralSharing:!0}),i=n.routesById[o],a=v.useMemo(()=>{const c=i.options.component??n.options.defaultComponent;return c?g.jsx(c,{},s):g.jsx(of,{})},[s,i.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const c=i.options.pendingMinMs??n.options.defaultPendingMinMs;if(c){const l=n.getMatch(r.id);if(l&&!l._nonReactive.minPendingPromise){const u=Us();l._nonReactive.minPendingPromise=u,setTimeout(()=>{u.resolve(),l._nonReactive.minPendingPromise=void 0},c)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return qn(Wt(r.error),"Expected a notFound error"),Mb(n,i,r.error);if(r.status==="redirected")throw qn(Jt(r.error),"Expected a redirect error"),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return a}),of=v.memo(function(){const t=tn(),n=v.useContext(Fc),r=Qt({select:l=>l.matches.find(u=>u.id===n)?.routeId}),s=t.routesById[r],o=Qt({select:l=>{const d=l.matches.find(f=>f.id===n);return qn(d,`Could not find parent match for matchId "${n}"`),d.globalNotFound}}),i=Qt({select:l=>{const u=l.matches,d=u.findIndex(f=>f.id===n);return u[d+1]?.id}}),a=t.options.defaultPendingComponent?g.jsx(t.options.defaultPendingComponent,{}):null;if(o)return Mb(t,s,void 0);if(!i)return null;const c=g.jsx(Ab,{matchId:i});return r===Gt?g.jsx(v.Suspense,{fallback:a,children:c}):c});function Wk(){const e=tn(),n=e.routesById[Gt].options.pendingComponent??e.options.defaultPendingComponent,r=n?g.jsx(n,{}):null,s=typeof document<"u"&&e.ssr?Ss:v.Suspense,o=g.jsxs(s,{fallback:r,children:[g.jsx(zk,{}),g.jsx(Hk,{})]});return e.options.InnerWrap?g.jsx(e.options.InnerWrap,{children:o}):o}function Hk(){const e=tn(),t=Qt({select:s=>s.matches[0]?.id}),n=Qt({select:s=>s.loadedAt}),r=t?g.jsx(Ab,{matchId:t}):null;return g.jsx(Fc.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:g.jsx(ef,{getResetKey:()=>n,errorComponent:tf,onCatch:s=>{Hs(!1,"The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!"),Hs(!1,s.message||s.toString())},children:r})})}const af=e=>new qk(e);class qk extends rk{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=fp,globalThis.createLazyFileRoute=mp):typeof window<"u"&&(window.createFileRoute=fp,window.createLazyFileRoute=mp);function Kk({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=Ob(),s=g.jsx(r.Provider,{value:e,children:t});return e.options.Wrap?g.jsx(e.options.Wrap,{children:s}):s}function Nb({router:e,...t}){return g.jsx(Kk,{router:e,...t,children:g.jsx(Wk,{})})}var mi=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(){}},Zk={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Gk=class{#e=Zk;#t=!1;setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&this.#t&&e!==this.#e&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:this.#e,provider:e}),this.#e=e,process.env.NODE_ENV!=="production"&&(this.#t=!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&(this.#t=!0),this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&(this.#t=!0),this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},$r=new Gk;function Yk(e){setTimeout(e,0)}var Jr=typeof window>"u"||"Deno"in globalThis;function Mt(){}function Xk(e,t){return typeof e=="function"?e(t):e}function Vu(e){return typeof e=="number"&&e>=0&&e!==1/0}function Db(e,t){return Math.max(e+(t||0)-Date.now(),0)}function dr(e,t){return typeof e=="function"?e(t):e}function Yt(e,t){return typeof e=="function"?e(t):e}function yp(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:o,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==cf(i,t.options))return!1}else if(!Zo(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||o&&!o(t))}function bp(e,t){const{exact:n,status:r,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Ko(t.options.mutationKey)!==Ko(o))return!1}else if(!Zo(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function cf(e,t){return(t?.queryKeyHashFn||Ko)(e)}function Ko(e){return JSON.stringify(e,(t,n)=>Wu(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Zo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Zo(e[n],t[n])):!1}var Jk=Object.prototype.hasOwnProperty;function Bu(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=vp(e)&&vp(t);if(!r&&!(Wu(e)&&Wu(t)))return t;const o=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),a=i.length,c=r?new Array(a):{};let l=0;for(let u=0;u<a;u++){const d=r?u:i[u],f=e[d],h=t[d];if(f===h){c[d]=f,(r?u<o:Jk.call(e,d))&&l++;continue}if(f===null||h===null||typeof f!="object"||typeof h!="object"){c[d]=h;continue}const p=Bu(f,h,n+1);c[d]=p,p===f&&l++}return o===a&&l===o?e:c}function Uu(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function vp(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Wu(e){if(!xp(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!xp(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function xp(e){return Object.prototype.toString.call(e)==="[object Object]"}function Qk(e){return new Promise(t=>{$r.setTimeout(t,e)})}function Hu(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Bu(e,t)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`),r}return Bu(e,t)}return t}function eC(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function tC(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Xa=Symbol();function Ib(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Xa&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Xa?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function jb(e,t){return typeof e=="function"?e(...t):!!e}function nC(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var rC=class extends mi{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Jr&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}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(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},lf=new rC;function qu(){let e,t;const n=new Promise((s,o)=>{e=s,t=o});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var sC=Yk;function oC(){let e=[],t=0,n=a=>{a()},r=a=>{a()},s=sC;const o=a=>{t?e.push(a):s(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&s(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||i()}return c},batchCalls:a=>(...c)=>{o(()=>{a(...c)})},schedule:o,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{s=a}}}var ut=oC(),iC=class extends mi{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Jr&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}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(n=>{n(e)}))}isOnline(){return this.#e}},Ja=new iC;function aC(e){return Math.min(1e3*2**e,3e4)}function Lb(e){return(e??"online")==="online"?Ja.isOnline():!0}var Ku=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Fb(e){let t=!1,n=0,r;const s=qu(),o=()=>s.status!=="pending",i=m=>{if(!o()){const y=new Ku(m);f(y),e.onCancel?.(y)}},a=()=>{t=!0},c=()=>{t=!1},l=()=>lf.isFocused()&&(e.networkMode==="always"||Ja.isOnline())&&e.canRun(),u=()=>Lb(e.networkMode)&&e.canRun(),d=m=>{o()||(r?.(),s.resolve(m))},f=m=>{o()||(r?.(),s.reject(m))},h=()=>new Promise(m=>{r=y=>{(o()||l())&&m(y)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),p=()=>{if(o())return;let m;const y=n===0?e.initialPromise:void 0;try{m=y??e.fn()}catch(b){m=Promise.reject(b)}Promise.resolve(m).then(d).catch(b=>{if(o())return;const x=e.retry??(Jr?0:3),_=e.retryDelay??aC,w=typeof _=="function"?_(n,b):_,S=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,b);if(t||!S){f(b);return}n++,e.onFail?.(n,b),Qk(w).then(()=>l()?void 0:h()).then(()=>{t?f(b):p()})})};return{promise:s,status:()=>s.status,cancel:i,continue:()=>(r?.(),s),cancelRetry:a,continueRetry:c,canStart:u,start:()=>(u()?p():h().then(p),s)}}var zb=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Vu(this.gcTime)&&(this.#e=$r.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Jr?1/0:300*1e3))}clearGcTimeout(){this.#e&&($r.clearTimeout(this.#e),this.#e=void 0)}},cC=class extends zb{#e;#t;#n;#s;#r;#a;#i;constructor(e){super(),this.#i=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#n=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=wp(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=wp(this.options);t.data!==void 0&&(this.setState(_p(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Hu(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Mt).catch(Mt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Yt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Xa||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>dr(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:!Db(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.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(t=>t!==e),this.observers.length||(this.#r&&(this.#i?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.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.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 a=this.observers.find(c=>c.options.queryFn);a&&this.setOptions(a.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,r=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},s=()=>{const a=Ib(this.options,t),l=(()=>{const u={client:this.#s,queryKey:this.queryKey,meta:this.meta};return r(u),u})();return this.#i=!1,this.options.persister?this.options.persister(a,l,this):a(l)},i=(()=>{const a={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:s};return r(a),a})();this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#o({type:"fetch",meta:i.fetchOptions?.meta}),this.#r=Fb({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:a=>{a instanceof Ku&&a.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(a,c)=>{this.#o({type:"failed",failureCount:a,error:c})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const a=await this.#r.start();if(a===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(a),this.#n.config.onSuccess?.(a,this),this.#n.config.onSettled?.(a,this.state.error,this),a}catch(a){if(a instanceof Ku){if(a.silent)return this.#r.promise;if(a.revert){if(this.state.data===void 0)throw a;return this.state.data}}throw this.#o({type:"error",error:a}),this.#n.config.onError?.(a,this),this.#n.config.onSettled?.(this.state.data,a,this),a}finally{this.scheduleGc()}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...$b(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,..._p(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const s=e.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),ut.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function $b(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Lb(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function _p(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function wp(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var lC=class extends mi{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.#i=qu(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#s=void 0;#r;#a;#i;#o;#m;#f;#h;#l;#u;#c;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Sp(this.#t,this.options)?this.#d():this.updateResult(),this.#v())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Zu(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Zu(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#_(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=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 Yt(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),t._defaulted&&!Uu(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&Ep(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#t!==n||Yt(this.options.enabled,this.#t)!==Yt(t.enabled,this.#t)||dr(this.options.staleTime,this.#t)!==dr(t.staleTime,this.#t))&&this.#g();const s=this.#y();r&&(this.#t!==n||Yt(this.options.enabled,this.#t)!==Yt(t.enabled,this.#t)||s!==this.#c)&&this.#b(s)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return dC(this,n)&&(this.#s=n,this.#a=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#d(e){this.#w();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Mt)),t}#g(){this.#x();const e=dr(this.options.staleTime,this.#t);if(Jr||this.#s.isStale||!Vu(e))return;const n=Db(this.#s.dataUpdatedAt,e)+1;this.#l=$r.setTimeout(()=>{this.#s.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#b(e){this.#_(),this.#c=e,!(Jr||Yt(this.options.enabled,this.#t)===!1||!Vu(this.#c)||this.#c===0)&&(this.#u=$r.setInterval(()=>{(this.options.refetchIntervalInBackground||lf.isFocused())&&this.#d()},this.#c))}#v(){this.#g(),this.#b(this.#y())}#x(){this.#l&&($r.clearTimeout(this.#l),this.#l=void 0)}#_(){this.#u&&($r.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,r=this.options,s=this.#s,o=this.#r,i=this.#a,c=e!==n?e.state:this.#n,{state:l}=e;let u={...l},d=!1,f;if(t._optimisticResults){const E=this.hasListeners(),P=!E&&Sp(e,t),O=E&&Ep(e,n,t,r);(P||O)&&(u={...u,...$b(l.data,e.options)}),t._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:h,errorUpdatedAt:p,status:m}=u;f=u.data;let y=!1;if(t.placeholderData!==void 0&&f===void 0&&m==="pending"){let E;s?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(E=s.data,y=!0):E=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,E!==void 0&&(m="success",f=Hu(s?.data,E,t),d=!0)}if(t.select&&f!==void 0&&!y)if(s&&f===o?.data&&t.select===this.#m)f=this.#f;else try{this.#m=t.select,f=t.select(f),f=Hu(s?.data,f,t),this.#f=f,this.#o=null}catch(E){this.#o=E}this.#o&&(h=this.#o,f=this.#f,p=Date.now(),m="error");const b=u.fetchStatus==="fetching",x=m==="pending",_=m==="error",w=x&&b,S=f!==void 0,k={status:m,fetchStatus:u.fetchStatus,isPending:x,isSuccess:m==="success",isError:_,isInitialLoading:w,isLoading:w,data:f,dataUpdatedAt:u.dataUpdatedAt,error:h,errorUpdatedAt:p,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:b,isRefetching:b&&!x,isLoadingError:_&&!S,isPaused:u.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:_&&S,isStale:uf(e,t),refetch:this.refetch,promise:this.#i,isEnabled:Yt(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const E=k.data!==void 0,P=k.status==="error"&&!E,O=j=>{P?j.reject(k.error):E&&j.resolve(k.data)},N=()=>{const j=this.#i=k.promise=qu();O(j)},A=this.#i;switch(A.status){case"pending":e.queryHash===n.queryHash&&O(A);break;case"fulfilled":(P||k.data!==A.value)&&N();break;case"rejected":(!P||k.error!==A.reason)&&N();break}}return k}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#a=this.options,this.#r.data!==void 0&&(this.#h=this.#t),Uu(t,e))return;this.#s=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,s=typeof r=="function"?r():r;if(s==="all"||!s&&!this.#p.size)return!0;const o=new Set(s??this.#p);return this.options.throwOnError&&o.add("error"),Object.keys(this.#s).some(i=>{const a=i;return this.#s[a]!==e[a]&&o.has(a)})};this.#S({listeners:n()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#v()}#S(e){ut.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function uC(e,t){return Yt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Sp(e,t){return uC(e,t)||e.state.data!==void 0&&Zu(e,t,t.refetchOnMount)}function Zu(e,t,n){if(Yt(t.enabled,e)!==!1&&dr(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&uf(e,t)}return!1}function Ep(e,t,n,r){return(e!==t||Yt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&uf(e,n)}function uf(e,t){return Yt(t.enabled,e)!==!1&&e.isStaleByTime(dr(t.staleTime,e))}function dC(e,t){return!Uu(e.getCurrentResult(),t)}function kp(e){return{onFetch:(t,n)=>{const r=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const l=async()=>{let u=!1;const d=p=>{nC(p,()=>t.signal,()=>u=!0)},f=Ib(t.options,t.fetchOptions),h=async(p,m,y)=>{if(u)return Promise.reject();if(m==null&&p.pages.length)return Promise.resolve(p);const x=(()=>{const C={client:t.client,queryKey:t.queryKey,pageParam:m,direction:y?"backward":"forward",meta:t.options.meta};return d(C),C})(),_=await f(x),{maxPages:w}=t.options,S=y?tC:eC;return{pages:S(p.pages,_,w),pageParams:S(p.pageParams,m,w)}};if(s&&o.length){const p=s==="backward",m=p?fC:Cp,y={pages:o,pageParams:i},b=m(r,y);a=await h(y,b,p)}else{const p=e??o.length;do{const m=c===0?i[0]??r.initialPageParam:Cp(r,a);if(c>0&&m==null)break;a=await h(a,m),c++}while(c<p)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Cp(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function fC(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var hC=class extends zb{#e;#t;#n;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||pC(),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.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=Fb({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(o,i)=>{this.#r({type:"failed",failureCount:o,error:i})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",s=!this.#s.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:s}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const i=await this.options.onMutate?.(e,n);i!==this.state.context&&this.#r({type:"pending",context:i,variables:e,isPaused:s})}const o=await this.#s.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#r({type:"success",data:o}),o}catch(o){try{await this.#n.config.onError?.(o,e,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onError?.(o,e,this.state.context,n)}catch(i){Promise.reject(i)}try{await this.#n.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onSettled?.(void 0,o,e,this.state.context,n)}catch(i){Promise.reject(i)}throw this.#r({type:"error",error:o}),o}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,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{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),ut.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function pC(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var mC=class extends mi{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new hC({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Bi(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Bi(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Bi(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(s=>s.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Bi(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ut.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 t={exact:!0,...e};return this.getAll().find(n=>bp(t,n))}findAll(e={}){return this.getAll().filter(t=>bp(e,t))}notify(e){ut.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return ut.batch(()=>Promise.all(e.map(t=>t.continue().catch(Mt))))}};function Bi(e){return e.options.scope?.id}var gC=class extends mi{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,s=t.queryHash??cf(r,t);let o=this.get(s);return o||(o=new cC({client:e,queryKey:r,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ut.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>yp(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>yp(e,n)):t}notify(e){ut.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ut.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ut.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Vb=class{#e;#t;#n;#s;#r;#a;#i;#o;constructor(e={}){this.#e=e.queryCache||new gC,this.#t=e.mutationCache||new mC,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#i=lf.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=Ja.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#i?.(),this.#i=void 0,this.#o?.(),this.#o=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 t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(dr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(r.queryHash)?.state.data,i=Xk(t,o);if(i!==void 0)return this.#e.build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return ut.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;ut.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return ut.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ut.batch(()=>this.#e.findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Mt).catch(Mt)}invalidateQueries(e,t={}){return ut.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ut.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(Mt)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Mt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(dr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Mt).catch(Mt)}fetchInfiniteQuery(e){return e.behavior=kp(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Mt).catch(Mt)}ensureInfiniteQueryData(e){return e.behavior=kp(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ja.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,t){this.#s.set(Ko(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(r=>{Zo(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Ko(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Zo(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=cf(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Xa&&(t.enabled=!1),t}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()}},Bb=v.createContext(void 0),yC=e=>{const t=v.useContext(Bb);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Ub=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),g.jsx(Bb.Provider,{value:e,children:t})),Wb=v.createContext(!1),bC=()=>v.useContext(Wb);Wb.Provider;function vC(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var xC=v.createContext(vC()),_C=()=>v.useContext(xC),wC=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?jb(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},SC=e=>{v.useEffect(()=>{e.clearReset()},[e])},EC=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||jb(n,[e.error,r])),kC=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},CC=(e,t)=>e.isLoading&&e.isFetching&&!t,RC=(e,t)=>e?.suspense&&t.isPending,Rp=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function PC(e,t,n){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=bC(),s=_C(),o=yC(),i=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const a=o.getQueryCache().get(i.queryHash);process.env.NODE_ENV!=="production"&&(i.queryFn||console.error(`[${i.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),i._optimisticResults=r?"isRestoring":"optimistic",kC(i),wC(i,s,a),SC(s);const c=!o.getQueryCache().get(i.queryHash),[l]=v.useState(()=>new t(o,i)),u=l.getOptimisticResult(i),d=!r&&e.subscribed!==!1;if(v.useSyncExternalStore(v.useCallback(f=>{const h=d?l.subscribe(ut.batchCalls(f)):Mt;return l.updateResult(),h},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),v.useEffect(()=>{l.setOptions(i)},[i,l]),RC(i,u))throw Rp(i,l,s);if(EC({result:u,errorResetBoundary:s,throwOnError:i.throwOnError,query:a,suspense:i.suspense}))throw u.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(i,u),i.experimental_prefetchInRender&&!Jr&&CC(u,r)&&(c?Rp(i,l,s):a?.promise)?.catch(Mt).finally(()=>{l.updateResult()}),i.notifyOnChangeProps?u:l.trackResult(u)}function Go(e,t){return PC(e,lC)}var Ui={exports:{}},Yl={};var Pp;function OC(){if(Pp)return Yl;Pp=1;var e=T;function t(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,s=e.useRef,o=e.useEffect,i=e.useMemo,a=e.useDebugValue;return Yl.useSyncExternalStoreWithSelector=function(c,l,u,d,f){var h=s(null);if(h.current===null){var p={hasValue:!1,value:null};h.current=p}else p=h.current;h=i(function(){function y(S){if(!b){if(b=!0,x=S,S=d(S),f!==void 0&&p.hasValue){var C=p.value;if(f(C,S))return _=C}return _=S}if(C=_,n(x,S))return C;var k=d(S);return f!==void 0&&f(C,k)?(x=S,C):(x=S,_=k)}var b=!1,x,_,w=u===void 0?null:u;return[function(){return y(l())},w===null?void 0:function(){return y(w())}]},[l,u,d,f]);var m=r(c,h[0],h[1]);return o(function(){p.hasValue=!0,p.value=m},[m]),a(m),m},Yl}var Xl={};var Op;function TC(){return Op||(Op=1,process.env.NODE_ENV!=="production"&&(function(){function e(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=T,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,s=t.useRef,o=t.useEffect,i=t.useMemo,a=t.useDebugValue;Xl.useSyncExternalStoreWithSelector=function(c,l,u,d,f){var h=s(null);if(h.current===null){var p={hasValue:!1,value:null};h.current=p}else p=h.current;h=i(function(){function y(S){if(!b){if(b=!0,x=S,S=d(S),f!==void 0&&p.hasValue){var C=p.value;if(f(C,S))return _=C}return _=S}if(C=_,n(x,S))return C;var k=d(S);return f!==void 0&&f(C,k)?(x=S,C):(x=S,_=k)}var b=!1,x,_,w=u===void 0?null:u;return[function(){return y(l())},w===null?void 0:function(){return y(w())}]},[l,u,d,f]);var m=r(c,h[0],h[1]);return o(function(){p.hasValue=!0,p.value=m},[m]),a(m),m},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Xl}var Tp;function MC(){return Tp||(Tp=1,process.env.NODE_ENV==="production"?Ui.exports=OC():Ui.exports=TC()),Ui.exports}var AC=MC();function NC(e){e()}function DC(){let e=null,t=null;return{clear(){e=null,t=null},notify(){NC(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const s=t={callback:n,next:null,prev:t};return s.prev?s.prev.next=s:e=s,function(){!r||e===null||(r=!1,s.next?s.next.prev=s.prev:t=s.prev,s.prev?s.prev.next=s.next:e=s.next)}}}}var Mp={notify(){},get:()=>[]};function IC(e,t){let n,r=Mp,s=0,o=!1;function i(m){u();const y=r.subscribe(m);let b=!1;return()=>{b||(b=!0,y(),d())}}function a(){r.notify()}function c(){p.onStateChange&&p.onStateChange()}function l(){return o}function u(){s++,n||(n=e.subscribe(c),r=DC())}function d(){s--,n&&s===0&&(n(),n=void 0,r.clear(),r=Mp)}function f(){o||(o=!0,u())}function h(){o&&(o=!1,d())}const p={addNestedSub:i,notifyNestedSubs:a,handleChangeWrapper:c,isSubscribed:l,trySubscribe:f,tryUnsubscribe:h,getListeners:()=>r};return p}var jC=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",LC=jC(),FC=()=>typeof navigator<"u"&&navigator.product==="ReactNative",zC=FC(),$C=()=>LC||zC?v.useLayoutEffect:v.useEffect,VC=$C(),BC=Symbol.for("react-redux-context"),UC=typeof globalThis<"u"?globalThis:{};function WC(){if(!v.createContext)return{};const e=UC[BC]??=new Map;let t=e.get(v.createContext);return t||(t=v.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(v.createContext,t)),t}var mr=WC();function HC(e){const{children:t,context:n,serverState:r,store:s}=e,o=v.useMemo(()=>{const c=IC(s),l={store:s,subscription:c,getServerState:r?()=>r:void 0};if(process.env.NODE_ENV==="production")return l;{const{identityFunctionCheck:u="once",stabilityCheck:d="once"}=e;return Object.assign(l,{stabilityCheck:d,identityFunctionCheck:u})}},[s,r]),i=v.useMemo(()=>s.getState(),[s]);VC(()=>{const{subscription:c}=o;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),i!==s.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[o,i]);const a=n||mr;return v.createElement(a.Provider,{value:o},t)}var Hb=HC;function df(e=mr){return function(){const n=v.useContext(e);if(process.env.NODE_ENV!=="production"&&!n)throw new Error("could not find react-redux context value; please ensure the component is wrapped in a <Provider>");return n}}var qb=df();function Kb(e=mr){const t=e===mr?qb:df(e),n=()=>{const{store:r}=t();return r};return Object.assign(n,{withTypes:()=>n}),n}var qC=Kb();function KC(e=mr){const t=e===mr?qC:Kb(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var ZC=KC(),GC=(e,t)=>e===t;function YC(e=mr){const t=e===mr?qb:df(e),n=(r,s={})=>{const{equalityFn:o=GC}=typeof s=="function"?{equalityFn:s}:s;if(process.env.NODE_ENV!=="production"){if(!r)throw new Error("You must pass a selector to useSelector");if(typeof r!="function")throw new Error("You must pass a function as a selector to useSelector");if(typeof o!="function")throw new Error("You must pass a function as an equality function to useSelector")}const i=t(),{store:a,subscription:c,getServerState:l}=i,u=v.useRef(!0),d=v.useCallback({[r.name](h){const p=r(h);if(process.env.NODE_ENV!=="production"){const{devModeChecks:m={}}=typeof s=="function"?{}:s,{identityFunctionCheck:y,stabilityCheck:b}=i,{identityFunctionCheck:x,stabilityCheck:_}={stabilityCheck:b,identityFunctionCheck:y,...m};if(_==="always"||_==="once"&&u.current){const w=r(h);if(!o(p,w)){let S;try{throw new Error}catch(C){({stack:S}=C)}console.warn("Selector "+(r.name||"unknown")+` returned a different result when called with the same parameters. This can lead to unnecessary rerenders.
|
|
7
|
-
Selectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization`,{state:h,selected:
|
|
8
|
-
Selectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.`,{stack:w})}u.current&&(u.current=!1)}return p}}[r.name],[r]),f=AC.useSyncExternalStoreWithSelector(c.addNestedSub,a.getState,l||a.getState,d,o);return v.useDebugValue(f),f};return Object.assign(n,{withTypes:()=>n}),n}var XC=YC();function JC(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const QC=e=>{switch(e){case"success":return nR;case"info":return sR;case"warning":return rR;case"error":return oR;default:return null}},eR=Array(12).fill(0),tR=({visible:e,className:t})=>T.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},T.createElement("div",{className:"sonner-spinner"},eR.map((n,r)=>T.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),nR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),rR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},T.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"})),sR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),oR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),iR=T.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"},T.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),T.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),aR=()=>{const[e,t]=T.useState(document.hidden);return T.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Gu=1;class cR{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...s}=t,o=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Gu++,i=this.toasts.find(c=>c.id===o),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),i?this.toasts=this.toasts.map(c=>c.id===o?(this.publish({...c,...t,id:o,title:r}),{...c,...t,id:o,dismissible:a,title:r}):c):this.addToast({title:r,...s,dismissible:a,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,i;const a=s.then(async l=>{if(i=["resolve",l],T.isValidElement(l))o=!1,this.create({id:r,type:"default",message:l});else if(uR(l)&&!l.ok){o=!1;const d=typeof n.error=="function"?await n.error(`HTTP error! status: ${l.status}`):n.error,f=typeof n.description=="function"?await n.description(`HTTP error! status: ${l.status}`):n.description,p=typeof d=="object"&&!T.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:f,...p})}else if(l instanceof Error){o=!1;const d=typeof n.error=="function"?await n.error(l):n.error,f=typeof n.description=="function"?await n.description(l):n.description,p=typeof d=="object"&&!T.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:f,...p})}else if(n.success!==void 0){o=!1;const d=typeof n.success=="function"?await n.success(l):n.success,f=typeof n.description=="function"?await n.description(l):n.description,p=typeof d=="object"&&!T.isValidElement(d)?d:{message:d};this.create({id:r,type:"success",description:f,...p})}}).catch(async l=>{if(i=["reject",l],n.error!==void 0){o=!1;const u=typeof n.error=="function"?await n.error(l):n.error,d=typeof n.description=="function"?await n.description(l):n.description,h=typeof u=="object"&&!T.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:d,...h})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((l,u)=>a.then(()=>i[0]==="reject"?u(i[1]):l(i[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{const r=n?.id||Gu++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Tt=new cR,lR=(e,t)=>{const n=t?.id||Gu++;return Tt.addToast({title:e,...t,id:n}),n},uR=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",dR=lR,fR=()=>Tt.toasts,hR=()=>Tt.getActiveToasts(),Ee=Object.assign(dR,{success:Tt.success,info:Tt.info,warning:Tt.warning,error:Tt.error,custom:Tt.custom,message:Tt.message,promise:Tt.promise,dismiss:Tt.dismiss,loading:Tt.loading},{getHistory:fR,getToasts:hR});JC("[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 Wi(e){return e.label!==void 0}const pR=3,mR="24px",gR="16px",Ap=4e3,yR=356,bR=14,vR=45,xR=200;function vn(...e){return e.filter(Boolean).join(" ")}function _R(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const wR=e=>{var t,n,r,s,o,i,a,c,l;const{invert:u,toast:d,unstyled:f,interacting:h,setHeights:p,visibleToasts:m,heights:y,index:b,toasts:x,expanded:_,removeToast:w,defaultRichColors:S,closeButton:C,style:k,cancelButtonStyle:E,actionButtonStyle:P,className:O="",descriptionClassName:N="",duration:A,position:j,gap:$,expandByDefault:q,classNames:D,icons:H,closeButtonAriaLabel:F="Close toast"}=e,[W,se]=T.useState(null),[I,Y]=T.useState(null),[K,Z]=T.useState(!1),[oe,ce]=T.useState(!1),[V,ee]=T.useState(!1),[me,le]=T.useState(!1),[fe,ge]=T.useState(!1),[Ze,_t]=T.useState(0),[rn,qt]=T.useState(0),st=T.useRef(d.duration||A||Ap),Qn=T.useRef(null),ot=T.useRef(null),ps=b===0,R=b+1<=m,M=d.type,z=d.dismissible!==!1,J=d.className||"",G=d.descriptionClassName||"",B=T.useMemo(()=>y.findIndex(he=>he.toastId===d.id)||0,[y,d.id]),Q=T.useMemo(()=>{var he;return(he=d.closeButton)!=null?he:C},[d.closeButton,C]),ue=T.useMemo(()=>d.duration||A||Ap,[d.duration,A]),ve=T.useRef(0),Ue=T.useRef(0),bn=T.useRef(0),wt=T.useRef(null),[Dl,ao]=j.split("-"),ms=T.useMemo(()=>y.reduce((he,it,ft)=>ft>=B?he:he+it.height,0),[y,B]),Ai=aR(),Ni=d.invert||u,co=M==="loading";Ue.current=T.useMemo(()=>B*$+ms,[B,ms]),T.useEffect(()=>{st.current=ue},[ue]),T.useEffect(()=>{Z(!0)},[]),T.useEffect(()=>{const he=ot.current;if(he){const it=he.getBoundingClientRect().height;return qt(it),p(ft=>[{toastId:d.id,height:it,position:d.position},...ft]),()=>p(ft=>ft.filter(Lt=>Lt.toastId!==d.id))}},[p,d.id]),T.useLayoutEffect(()=>{if(!K)return;const he=ot.current,it=he.style.height;he.style.height="auto";const ft=he.getBoundingClientRect().height;he.style.height=it,qt(ft),p(Lt=>Lt.find(ct=>ct.toastId===d.id)?Lt.map(ct=>ct.toastId===d.id?{...ct,height:ft}:ct):[{toastId:d.id,height:ft,position:d.position},...Lt])},[K,d.title,d.description,p,d.id,d.jsx,d.action,d.cancel]);const sn=T.useCallback(()=>{ce(!0),_t(Ue.current),p(he=>he.filter(it=>it.toastId!==d.id)),setTimeout(()=>{w(d)},xR)},[d,w,p,Ue]);T.useEffect(()=>{if(d.promise&&M==="loading"||d.duration===1/0||d.type==="loading")return;let he;return _||h||Ai?(()=>{if(bn.current<ve.current){const Lt=new Date().getTime()-ve.current;st.current=st.current-Lt}bn.current=new Date().getTime()})():st.current!==1/0&&(ve.current=new Date().getTime(),he=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),sn()},st.current)),()=>clearTimeout(he)},[_,h,d,M,Ai,sn]),T.useEffect(()=>{d.delete&&(sn(),d.onDismiss==null||d.onDismiss.call(d,d))},[sn,d.delete]);function rE(){var he;if(H?.loading){var it;return T.createElement("div",{className:vn(D?.loader,d==null||(it=d.classNames)==null?void 0:it.loader,"sonner-loader"),"data-visible":M==="loading"},H.loading)}return T.createElement(tR,{className:vn(D?.loader,d==null||(he=d.classNames)==null?void 0:he.loader),visible:M==="loading"})}const sE=d.icon||H?.[M]||QC(M);var Fh,zh;return T.createElement("li",{tabIndex:0,ref:ot,className:vn(O,J,D?.toast,d==null||(t=d.classNames)==null?void 0:t.toast,D?.default,D?.[M],d==null||(n=d.classNames)==null?void 0:n[M]),"data-sonner-toast":"","data-rich-colors":(Fh=d.richColors)!=null?Fh:S,"data-styled":!(d.jsx||d.unstyled||f),"data-mounted":K,"data-promise":!!d.promise,"data-swiped":fe,"data-removed":oe,"data-visible":R,"data-y-position":Dl,"data-x-position":ao,"data-index":b,"data-front":ps,"data-swiping":V,"data-dismissible":z,"data-type":M,"data-invert":Ni,"data-swipe-out":me,"data-swipe-direction":I,"data-expanded":!!(_||q&&K),"data-testid":d.testId,style:{"--index":b,"--toasts-before":b,"--z-index":x.length-b,"--offset":`${oe?Ze:Ue.current}px`,"--initial-height":q?"auto":`${rn}px`,...k,...d.style},onDragEnd:()=>{ee(!1),se(null),wt.current=null},onPointerDown:he=>{he.button!==2&&(co||!z||(Qn.current=new Date,_t(Ue.current),he.target.setPointerCapture(he.pointerId),he.target.tagName!=="BUTTON"&&(ee(!0),wt.current={x:he.clientX,y:he.clientY})))},onPointerUp:()=>{var he,it,ft;if(me||!z)return;wt.current=null;const Lt=Number(((he=ot.current)==null?void 0:he.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Di=Number(((it=ot.current)==null?void 0:it.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ct=new Date().getTime()-((ft=Qn.current)==null?void 0:ft.getTime()),Kt=W==="x"?Lt:Di,Ii=Math.abs(Kt)/ct;if(Math.abs(Kt)>=vR||Ii>.11){_t(Ue.current),d.onDismiss==null||d.onDismiss.call(d,d),Y(W==="x"?Lt>0?"right":"left":Di>0?"down":"up"),sn(),le(!0);return}else{var on,an;(on=ot.current)==null||on.style.setProperty("--swipe-amount-x","0px"),(an=ot.current)==null||an.style.setProperty("--swipe-amount-y","0px")}ge(!1),ee(!1),se(null)},onPointerMove:he=>{var it,ft,Lt;if(!wt.current||!z||((it=window.getSelection())==null?void 0:it.toString().length)>0)return;const ct=he.clientY-wt.current.y,Kt=he.clientX-wt.current.x;var Ii;const on=(Ii=e.swipeDirections)!=null?Ii:_R(j);!W&&(Math.abs(Kt)>1||Math.abs(ct)>1)&&se(Math.abs(Kt)>Math.abs(ct)?"x":"y");let an={x:0,y:0};const $h=Or=>1/(1.5+Math.abs(Or)/20);if(W==="y"){if(on.includes("top")||on.includes("bottom"))if(on.includes("top")&&ct<0||on.includes("bottom")&&ct>0)an.y=ct;else{const Or=ct*$h(ct);an.y=Math.abs(Or)<Math.abs(ct)?Or:ct}}else if(W==="x"&&(on.includes("left")||on.includes("right")))if(on.includes("left")&&Kt<0||on.includes("right")&&Kt>0)an.x=Kt;else{const Or=Kt*$h(Kt);an.x=Math.abs(Or)<Math.abs(Kt)?Or:Kt}(Math.abs(an.x)>0||Math.abs(an.y)>0)&&ge(!0),(ft=ot.current)==null||ft.style.setProperty("--swipe-amount-x",`${an.x}px`),(Lt=ot.current)==null||Lt.style.setProperty("--swipe-amount-y",`${an.y}px`)}},Q&&!d.jsx&&M!=="loading"?T.createElement("button",{"aria-label":F,"data-disabled":co,"data-close-button":!0,onClick:co||!z?()=>{}:()=>{sn(),d.onDismiss==null||d.onDismiss.call(d,d)},className:vn(D?.closeButton,d==null||(r=d.classNames)==null?void 0:r.closeButton)},(zh=H?.close)!=null?zh:iR):null,(M||d.icon||d.promise)&&d.icon!==null&&(H?.[M]!==null||d.icon)?T.createElement("div",{"data-icon":"",className:vn(D?.icon,d==null||(s=d.classNames)==null?void 0:s.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||rE():null,d.type!=="loading"?sE:null):null,T.createElement("div",{"data-content":"",className:vn(D?.content,d==null||(o=d.classNames)==null?void 0:o.content)},T.createElement("div",{"data-title":"",className:vn(D?.title,d==null||(i=d.classNames)==null?void 0:i.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?T.createElement("div",{"data-description":"",className:vn(N,G,D?.description,d==null||(a=d.classNames)==null?void 0:a.description)},typeof d.description=="function"?d.description():d.description):null),T.isValidElement(d.cancel)?d.cancel:d.cancel&&Wi(d.cancel)?T.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||E,onClick:he=>{Wi(d.cancel)&&z&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,he),sn())},className:vn(D?.cancelButton,d==null||(c=d.classNames)==null?void 0:c.cancelButton)},d.cancel.label):null,T.isValidElement(d.action)?d.action:d.action&&Wi(d.action)?T.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||P,onClick:he=>{Wi(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,he),!he.defaultPrevented&&sn())},className:vn(D?.actionButton,d==null||(l=d.classNames)==null?void 0:l.actionButton)},d.action.label):null)};function Np(){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 SR(e,t){const n={};return[e,t].forEach((r,s)=>{const o=s===1,i=o?"--mobile-offset":"--offset",a=o?gR:mR;function c(l){["top","right","bottom","left"].forEach(u=>{n[`${i}-${u}`]=typeof l=="number"?`${l}px`:l})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(l=>{r[l]===void 0?n[`${i}-${l}`]=a:n[`${i}-${l}`]=typeof r[l]=="number"?`${r[l]}px`:r[l]}):c(a)}),n}const ER=T.forwardRef(function(t,n){const{id:r,invert:s,position:o="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:c,className:l,offset:u,mobileOffset:d,theme:f="light",richColors:h,duration:p,style:m,visibleToasts:y=pR,toastOptions:b,dir:x=Np(),gap:_=bR,icons:w,containerAriaLabel:S="Notifications"}=t,[C,k]=T.useState([]),E=T.useMemo(()=>r?C.filter(K=>K.toasterId===r):C.filter(K=>!K.toasterId),[C,r]),P=T.useMemo(()=>Array.from(new Set([o].concat(E.filter(K=>K.position).map(K=>K.position)))),[E,o]),[O,N]=T.useState([]),[A,j]=T.useState(!1),[$,q]=T.useState(!1),[D,H]=T.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),F=T.useRef(null),W=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),se=T.useRef(null),I=T.useRef(!1),Y=T.useCallback(K=>{k(Z=>{var oe;return(oe=Z.find(ce=>ce.id===K.id))!=null&&oe.delete||Tt.dismiss(K.id),Z.filter(({id:ce})=>ce!==K.id)})},[]);return T.useEffect(()=>Tt.subscribe(K=>{if(K.dismiss){requestAnimationFrame(()=>{k(Z=>Z.map(oe=>oe.id===K.id?{...oe,delete:!0}:oe))});return}setTimeout(()=>{Dc.flushSync(()=>{k(Z=>{const oe=Z.findIndex(ce=>ce.id===K.id);return oe!==-1?[...Z.slice(0,oe),{...Z[oe],...K},...Z.slice(oe+1)]:[K,...Z]})})})}),[C]),T.useEffect(()=>{if(f!=="system"){H(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window>"u")return;const K=window.matchMedia("(prefers-color-scheme: dark)");try{K.addEventListener("change",({matches:Z})=>{H(Z?"dark":"light")})}catch{K.addListener(({matches:oe})=>{try{H(oe?"dark":"light")}catch(ce){console.error(ce)}})}},[f]),T.useEffect(()=>{C.length<=1&&j(!1)},[C]),T.useEffect(()=>{const K=Z=>{var oe;if(i.every(ee=>Z[ee]||Z.code===ee)){var V;j(!0),(V=F.current)==null||V.focus()}Z.code==="Escape"&&(document.activeElement===F.current||(oe=F.current)!=null&&oe.contains(document.activeElement))&&j(!1)};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[i]),T.useEffect(()=>{if(F.current)return()=>{se.current&&(se.current.focus({preventScroll:!0}),se.current=null,I.current=!1)}},[F.current]),T.createElement("section",{ref:n,"aria-label":`${S} ${W}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},P.map((K,Z)=>{var oe;const[ce,V]=K.split("-");return E.length?T.createElement("ol",{key:K,dir:x==="auto"?Np():x,tabIndex:-1,ref:F,className:l,"data-sonner-toaster":!0,"data-sonner-theme":D,"data-y-position":ce,"data-x-position":V,style:{"--front-toast-height":`${((oe=O[0])==null?void 0:oe.height)||0}px`,"--width":`${yR}px`,"--gap":`${_}px`,...m,...SR(u,d)},onBlur:ee=>{I.current&&!ee.currentTarget.contains(ee.relatedTarget)&&(I.current=!1,se.current&&(se.current.focus({preventScroll:!0}),se.current=null))},onFocus:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||I.current||(I.current=!0,se.current=ee.relatedTarget)},onMouseEnter:()=>j(!0),onMouseMove:()=>j(!0),onMouseLeave:()=>{$||j(!1)},onDragEnd:()=>j(!1),onPointerDown:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||q(!0)},onPointerUp:()=>q(!1)},E.filter(ee=>!ee.position&&Z===0||ee.position===K).map((ee,me)=>{var le,fe;return T.createElement(wR,{key:ee.id,icons:w,index:me,toast:ee,defaultRichColors:h,duration:(le=b?.duration)!=null?le:p,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:s,visibleToasts:y,closeButton:(fe=b?.closeButton)!=null?fe:c,interacting:$,position:K,style:b?.style,unstyled:b?.unstyled,classNames:b?.classNames,cancelButtonStyle:b?.cancelButtonStyle,actionButtonStyle:b?.actionButtonStyle,closeButtonAriaLabel:b?.closeButtonAriaLabel,removeToast:Y,toasts:E.filter(ge=>ge.position==ee.position),heights:O.filter(ge=>ge.position==ee.position),setHeights:N,expandByDefault:a,gap:_,expanded:A,swipeDirections:t.swipeDirections})})):null}))}),Dp=e=>{let t;const n=new Set,r=(l,u)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const f=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(h=>h(t,f))}},s=()=>t,a={setState:r,getState:s,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l))},c=t=e(r,s,a);return a},kR=(e=>e?Dp(e):Dp),CR=e=>e;function RR(e,t=CR){const n=T.useSyncExternalStore(e.subscribe,T.useCallback(()=>t(e.getState()),[e,t]),T.useCallback(()=>t(e.getInitialState()),[e,t]));return T.useDebugValue(n),n}const Ip=e=>{const t=kR(e),n=r=>RR(t,r);return Object.assign(n,t),n},Zb=(e=>e?Ip(e):Ip);function PR(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var o;const i=c=>c===null?null:JSON.parse(c,void 0),a=(o=n.getItem(s))!=null?o:null;return a instanceof Promise?a.then(i):i(a)},setItem:(s,o)=>n.setItem(s,JSON.stringify(o,void 0)),removeItem:s=>n.removeItem(s)}}const Yu=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Yu(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Yu(r)(n)}}}},OR=(e,t)=>(n,r,s)=>{let o={storage:PR(()=>localStorage),partialize:y=>y,version:0,merge:(y,b)=>({...b,...y}),...t},i=!1,a=0;const c=new Set,l=new Set;let u=o.storage;if(!u)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...y)},r,s);const d=()=>{const y=o.partialize({...r()});return u.setItem(o.name,{state:y,version:o.version})},f=s.setState;s.setState=(y,b)=>(f(y,b),d());const h=e((...y)=>(n(...y),d()),r,s);s.getInitialState=()=>h;let p;const m=()=>{var y,b;if(!u)return;const x=++a;i=!1,c.forEach(w=>{var S;return w((S=r())!=null?S:h)});const _=((b=o.onRehydrateStorage)==null?void 0:b.call(o,(y=r())!=null?y:h))||void 0;return Yu(u.getItem.bind(u))(o.name).then(w=>{if(w)if(typeof w.version=="number"&&w.version!==o.version){if(o.migrate){const S=o.migrate(w.state,w.version);return S instanceof Promise?S.then(C=>[!0,C]):[!0,S]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,w.state];return[!1,void 0]}).then(w=>{var S;if(x!==a)return;const[C,k]=w;if(p=o.merge(k,(S=r())!=null?S:h),n(p,!0),C)return d()}).then(()=>{x===a&&(_?.(p,void 0),p=r(),i=!0,l.forEach(w=>w(p)))}).catch(w=>{x===a&&_?.(void 0,w)})};return s.persist={setOptions:y=>{o={...o,...y},y.storage&&(u=y.storage)},clearStorage:()=>{u?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>i,onHydrate:y=>(c.add(y),()=>{c.delete(y)}),onFinishHydration:y=>(l.add(y),()=>{l.delete(y)})},o.skipHydration||m(),p||h},TR=OR;function Gb(e,t){return function(){return e.apply(t,arguments)}}const{toString:MR}=Object.prototype,{getPrototypeOf:ff}=Object,{iterator:zc,toStringTag:Yb}=Symbol,$c=(e=>t=>{const n=MR.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),gn=e=>(e=e.toLowerCase(),t=>$c(t)===e),Vc=e=>t=>typeof t===e,{isArray:Qs}=Array,qs=Vc("undefined");function gi(e){return e!==null&&!qs(e)&&e.constructor!==null&&!qs(e.constructor)&&Dt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Xb=gn("ArrayBuffer");function AR(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Xb(e.buffer),t}const NR=Vc("string"),Dt=Vc("function"),Jb=Vc("number"),yi=e=>e!==null&&typeof e=="object",DR=e=>e===!0||e===!1,Ra=e=>{if($c(e)!=="object")return!1;const t=ff(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Yb in e)&&!(zc in e)},IR=e=>{if(!yi(e)||gi(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},jR=gn("Date"),LR=gn("File"),FR=gn("Blob"),zR=gn("FileList"),$R=e=>yi(e)&&Dt(e.pipe),VR=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Dt(e.append)&&((t=$c(e))==="formdata"||t==="object"&&Dt(e.toString)&&e.toString()==="[object FormData]"))},BR=gn("URLSearchParams"),[UR,WR,HR,qR]=["ReadableStream","Request","Response","Headers"].map(gn),KR=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function bi(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),Qs(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(gi(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let a;for(r=0;r<i;r++)a=o[r],t.call(null,e[a],a,e)}}function Qb(e,t){if(gi(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const Vr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ev=e=>!qs(e)&&e!==Vr;function Xu(){const{caseless:e,skipUndefined:t}=ev(this)&&this||{},n={},r=(s,o)=>{const i=e&&Qb(n,o)||o;Ra(n[i])&&Ra(s)?n[i]=Xu(n[i],s):Ra(s)?n[i]=Xu({},s):Qs(s)?n[i]=s.slice():(!t||!qs(s))&&(n[i]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&bi(arguments[s],r);return n}const ZR=(e,t,n,{allOwnKeys:r}={})=>(bi(t,(s,o)=>{n&&Dt(s)?Object.defineProperty(e,o,{value:Gb(s,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),GR=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),YR=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},XR=(e,t,n,r)=>{let s,o,i;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&ff(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},JR=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},QR=e=>{if(!e)return null;if(Qs(e))return e;let t=e.length;if(!Jb(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},eP=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ff(Uint8Array)),tP=(e,t)=>{const r=(e&&e[zc]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},nP=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},rP=gn("HTMLFormElement"),sP=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),jp=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),oP=gn("RegExp"),tv=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};bi(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},iP=e=>{tv(e,(t,n)=>{if(Dt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Dt(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},aP=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return Qs(e)?r(e):r(String(e).split(t)),n},cP=()=>{},lP=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function uP(e){return!!(e&&Dt(e.append)&&e[Yb]==="FormData"&&e[zc])}const dP=e=>{const t=new Array(10),n=(r,s)=>{if(yi(r)){if(t.indexOf(r)>=0)return;if(gi(r))return r;if(!("toJSON"in r)){t[s]=r;const o=Qs(r)?[]:{};return bi(r,(i,a)=>{const c=n(i,s+1);!qs(c)&&(o[a]=c)}),t[s]=void 0,o}}return r};return n(e,0)},fP=gn("AsyncFunction"),hP=e=>e&&(yi(e)||Dt(e))&&Dt(e.then)&&Dt(e.catch),nv=((e,t)=>e?setImmediate:t?((n,r)=>(Vr.addEventListener("message",({source:s,data:o})=>{s===Vr&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),Vr.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Dt(Vr.postMessage)),pP=typeof queueMicrotask<"u"?queueMicrotask.bind(Vr):typeof process<"u"&&process.nextTick||nv,mP=e=>e!=null&&Dt(e[zc]),L={isArray:Qs,isArrayBuffer:Xb,isBuffer:gi,isFormData:VR,isArrayBufferView:AR,isString:NR,isNumber:Jb,isBoolean:DR,isObject:yi,isPlainObject:Ra,isEmptyObject:IR,isReadableStream:UR,isRequest:WR,isResponse:HR,isHeaders:qR,isUndefined:qs,isDate:jR,isFile:LR,isBlob:FR,isRegExp:oP,isFunction:Dt,isStream:$R,isURLSearchParams:BR,isTypedArray:eP,isFileList:zR,forEach:bi,merge:Xu,extend:ZR,trim:KR,stripBOM:GR,inherits:YR,toFlatObject:XR,kindOf:$c,kindOfTest:gn,endsWith:JR,toArray:QR,forEachEntry:tP,matchAll:nP,isHTMLForm:rP,hasOwnProperty:jp,hasOwnProp:jp,reduceDescriptors:tv,freezeMethods:iP,toObjectSet:aP,toCamelCase:sP,noop:cP,toFiniteNumber:lP,findKey:Qb,global:Vr,isContextDefined:ev,isSpecCompliantForm:uP,toJSONObject:dP,isAsyncFn:fP,isThenable:hP,setImmediate:nv,asap:pP,isIterable:mP};let ae=class rv extends Error{static from(t,n,r,s,o,i){const a=new rv(t.message,n||t.code,r,s,o);return a.cause=t,a.name=t.name,i&&Object.assign(a,i),a}constructor(t,n,r,s,o){super(t),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),s&&(this.request=s),o&&(this.response=o,this.status=o.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:L.toJSONObject(this.config),code:this.code,status:this.status}}};ae.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";ae.ERR_BAD_OPTION="ERR_BAD_OPTION";ae.ECONNABORTED="ECONNABORTED";ae.ETIMEDOUT="ETIMEDOUT";ae.ERR_NETWORK="ERR_NETWORK";ae.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";ae.ERR_DEPRECATED="ERR_DEPRECATED";ae.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";ae.ERR_BAD_REQUEST="ERR_BAD_REQUEST";ae.ERR_CANCELED="ERR_CANCELED";ae.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";ae.ERR_INVALID_URL="ERR_INVALID_URL";const gP=null;function Ju(e){return L.isPlainObject(e)||L.isArray(e)}function sv(e){return L.endsWith(e,"[]")?e.slice(0,-2):e}function Lp(e,t,n){return e?e.concat(t).map(function(s,o){return s=sv(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function yP(e){return L.isArray(e)&&!e.some(Ju)}const bP=L.toFlatObject(L,{},null,function(t){return/^is[A-Z]/.test(t)});function Bc(e,t,n){if(!L.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=L.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!L.isUndefined(y[m])});const r=n.metaTokens,s=n.visitor||u,o=n.dots,i=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&L.isSpecCompliantForm(t);if(!L.isFunction(s))throw new TypeError("visitor must be a function");function l(p){if(p===null)return"";if(L.isDate(p))return p.toISOString();if(L.isBoolean(p))return p.toString();if(!c&&L.isBlob(p))throw new ae("Blob is not supported. Use a Buffer instead.");return L.isArrayBuffer(p)||L.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,m,y){let b=p;if(p&&!y&&typeof p=="object"){if(L.endsWith(m,"{}"))m=r?m:m.slice(0,-2),p=JSON.stringify(p);else if(L.isArray(p)&&yP(p)||(L.isFileList(p)||L.endsWith(m,"[]"))&&(b=L.toArray(p)))return m=sv(m),b.forEach(function(_,w){!(L.isUndefined(_)||_===null)&&t.append(i===!0?Lp([m],w,o):i===null?m:m+"[]",l(_))}),!1}return Ju(p)?!0:(t.append(Lp(y,m,o),l(p)),!1)}const d=[],f=Object.assign(bP,{defaultVisitor:u,convertValue:l,isVisitable:Ju});function h(p,m){if(!L.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(p),L.forEach(p,function(b,x){(!(L.isUndefined(b)||b===null)&&s.call(t,b,L.isString(x)?x.trim():x,m,f))===!0&&h(b,m?m.concat(x):[x])}),d.pop()}}if(!L.isObject(e))throw new TypeError("data must be an object");return h(e),t}function Fp(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function hf(e,t){this._pairs=[],e&&Bc(e,this,t)}const ov=hf.prototype;ov.append=function(t,n){this._pairs.push([t,n])};ov.toString=function(t){const n=t?function(r){return t.call(this,r,Fp)}:Fp;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function vP(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function iv(e,t,n){if(!t)return e;const r=n&&n.encode||vP,s=L.isFunction(n)?{serialize:n}:n,o=s&&s.serialize;let i;if(o?i=o(t,s):i=L.isURLSearchParams(t)?t.toString():new hf(t,s).toString(r),i){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class zp{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){L.forEach(this.handlers,function(r){r!==null&&t(r)})}}const av={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},xP=typeof URLSearchParams<"u"?URLSearchParams:hf,_P=typeof FormData<"u"?FormData:null,wP=typeof Blob<"u"?Blob:null,SP={isBrowser:!0,classes:{URLSearchParams:xP,FormData:_P,Blob:wP},protocols:["http","https","file","blob","url","data"]},pf=typeof window<"u"&&typeof document<"u",Qu=typeof navigator=="object"&&navigator||void 0,EP=pf&&(!Qu||["ReactNative","NativeScript","NS"].indexOf(Qu.product)<0),kP=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",CP=pf&&window.location.href||"http://localhost",RP=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:pf,hasStandardBrowserEnv:EP,hasStandardBrowserWebWorkerEnv:kP,navigator:Qu,origin:CP},Symbol.toStringTag,{value:"Module"})),yt={...RP,...SP};function PP(e,t){return Bc(e,new yt.classes.URLSearchParams,{visitor:function(n,r,s,o){return yt.isNode&&L.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function OP(e){return L.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function TP(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function cv(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),c=o>=n.length;return i=!i&&L.isArray(s)?s.length:i,c?(L.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!a):((!s[i]||!L.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&L.isArray(s[i])&&(s[i]=TP(s[i])),!a)}if(L.isFormData(e)&&L.isFunction(e.entries)){const n={};return L.forEachEntry(e,(r,s)=>{t(OP(r),s,n,0)}),n}return null}function MP(e,t,n){if(L.isString(e))try{return(t||JSON.parse)(e),L.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const vi={transitional:av,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=L.isObject(t);if(o&&L.isHTMLForm(t)&&(t=new FormData(t)),L.isFormData(t))return s?JSON.stringify(cv(t)):t;if(L.isArrayBuffer(t)||L.isBuffer(t)||L.isStream(t)||L.isFile(t)||L.isBlob(t)||L.isReadableStream(t))return t;if(L.isArrayBufferView(t))return t.buffer;if(L.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return PP(t,this.formSerializer).toString();if((a=L.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Bc(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),MP(t)):t}],transformResponse:[function(t){const n=this.transitional||vi.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(L.isResponse(t)||L.isReadableStream(t))return t;if(t&&L.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(a){if(i)throw a.name==="SyntaxError"?ae.from(a,ae.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:yt.classes.FormData,Blob:yt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};L.forEach(["delete","get","head","post","put","patch"],e=>{vi.headers[e]={}});const AP=L.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),NP=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
9
|
-
`).forEach(function(i){
|
|
10
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[$p]=this[$p]={accessors:{}}).accessors,s=this.prototype;function o(i){const a=yo(i);r[a]||(LP(s,i),r[a]=!0)}return L.isArray(t)?t.forEach(o):o(t),this}};It.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);L.reduceDescriptors(It.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});L.freezeMethods(It);function Ql(e,t){const n=this||vi,r=t||n,s=It.from(r.headers);let o=r.data;return L.forEach(e,function(a){o=a.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function lv(e){return!!(e&&e.__CANCEL__)}let xi=class extends ae{constructor(t,n,r){super(t??"canceled",ae.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function uv(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ae("Request failed with status code "+n.status,[ae.ERR_BAD_REQUEST,ae.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function FP(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function zP(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(c){const l=Date.now(),u=r[o];i||(i=l),n[s]=c,r[s]=l;let d=o,f=0;for(;d!==s;)f+=n[d++],d=d%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),l-i<t)return;const h=u&&l-u;return h?Math.round(f*1e3/h):void 0}}function $P(e,t){let n=0,r=1e3/t,s,o;const i=(l,u=Date.now())=>{n=u,s=null,o&&(clearTimeout(o),o=null),e(...l)};return[(...l)=>{const u=Date.now(),d=u-n;d>=r?i(l,u):(s=l,o||(o=setTimeout(()=>{o=null,i(s)},r-d)))},()=>s&&i(s)]}const Qa=(e,t,n=3)=>{let r=0;const s=zP(50,250);return $P(o=>{const i=o.loaded,a=o.lengthComputable?o.total:void 0,c=i-r,l=s(c),u=i<=a;r=i;const d={loaded:i,total:a,progress:a?i/a:void 0,bytes:c,rate:l||void 0,estimated:l&&a&&u?(a-i)/l:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},Vp=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Bp=e=>(...t)=>L.asap(()=>e(...t)),VP=yt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,yt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(yt.origin),yt.navigator&&/(msie|trident)/i.test(yt.navigator.userAgent)):()=>!0,BP=yt.hasStandardBrowserEnv?{write(e,t,n,r,s,o,i){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];L.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),L.isString(r)&&a.push(`path=${r}`),L.isString(s)&&a.push(`domain=${s}`),o===!0&&a.push("secure"),L.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function UP(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function WP(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function dv(e,t,n){let r=!UP(t);return e&&(r||n==!1)?WP(e,t):t}const Up=e=>e instanceof It?{...e}:e;function Qr(e,t){t=t||{};const n={};function r(l,u,d,f){return L.isPlainObject(l)&&L.isPlainObject(u)?L.merge.call({caseless:f},l,u):L.isPlainObject(u)?L.merge({},u):L.isArray(u)?u.slice():u}function s(l,u,d,f){if(L.isUndefined(u)){if(!L.isUndefined(l))return r(void 0,l,d,f)}else return r(l,u,d,f)}function o(l,u){if(!L.isUndefined(u))return r(void 0,u)}function i(l,u){if(L.isUndefined(u)){if(!L.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function a(l,u,d){if(d in t)return r(l,u);if(d in e)return r(void 0,l)}const c={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(l,u,d)=>s(Up(l),Up(u),d,!0)};return L.forEach(Object.keys({...e,...t}),function(u){const d=c[u]||s,f=d(e[u],t[u],u);L.isUndefined(f)&&d!==a||(n[u]=f)}),n}const fv=e=>{const t=Qr({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:a}=t;if(t.headers=i=It.from(i),t.url=iv(dv(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),L.isFormData(n)){if(yt.hasStandardBrowserEnv||yt.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(L.isFunction(n.getHeaders)){const c=n.getHeaders(),l=["content-type","content-length"];Object.entries(c).forEach(([u,d])=>{l.includes(u.toLowerCase())&&i.set(u,d)})}}if(yt.hasStandardBrowserEnv&&(r&&L.isFunction(r)&&(r=r(t)),r||r!==!1&&VP(t.url))){const c=s&&o&&BP.read(o);c&&i.set(s,c)}return t},HP=typeof XMLHttpRequest<"u",qP=HP&&function(e){return new Promise(function(n,r){const s=fv(e);let o=s.data;const i=It.from(s.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:l}=s,u,d,f,h,p;function m(){h&&h(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let y=new XMLHttpRequest;y.open(s.method.toUpperCase(),s.url,!0),y.timeout=s.timeout;function b(){if(!y)return;const _=It.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),S={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:_,config:e,request:y};uv(function(k){n(k),m()},function(k){r(k),m()},S),y=null}"onloadend"in y?y.onloadend=b:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(b)},y.onabort=function(){y&&(r(new ae("Request aborted",ae.ECONNABORTED,e,y)),y=null)},y.onerror=function(w){const S=w&&w.message?w.message:"Network Error",C=new ae(S,ae.ERR_NETWORK,e,y);C.event=w||null,r(C),y=null},y.ontimeout=function(){let w=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const S=s.transitional||av;s.timeoutErrorMessage&&(w=s.timeoutErrorMessage),r(new ae(w,S.clarifyTimeoutError?ae.ETIMEDOUT:ae.ECONNABORTED,e,y)),y=null},o===void 0&&i.setContentType(null),"setRequestHeader"in y&&L.forEach(i.toJSON(),function(w,S){y.setRequestHeader(S,w)}),L.isUndefined(s.withCredentials)||(y.withCredentials=!!s.withCredentials),a&&a!=="json"&&(y.responseType=s.responseType),l&&([f,p]=Qa(l,!0),y.addEventListener("progress",f)),c&&y.upload&&([d,h]=Qa(c),y.upload.addEventListener("progress",d),y.upload.addEventListener("loadend",h)),(s.cancelToken||s.signal)&&(u=_=>{y&&(r(!_||_.type?new xi(null,e,y):_),y.abort(),y=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const x=FP(s.url);if(x&&yt.protocols.indexOf(x)===-1){r(new ae("Unsupported protocol "+x+":",ae.ERR_BAD_REQUEST,e));return}y.send(o||null)})},KP=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(l){if(!s){s=!0,a();const u=l instanceof Error?l:this.reason;r.abort(u instanceof ae?u:new xi(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,o(new ae(`timeout of ${t}ms exceeded`,ae.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(o):l.removeEventListener("abort",o)}),e=null)};e.forEach(l=>l.addEventListener("abort",o));const{signal:c}=r;return c.unsubscribe=()=>L.asap(a),c}},ZP=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},GP=async function*(e,t){for await(const n of YP(e))yield*ZP(n,t)},YP=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Wp=(e,t,n,r)=>{const s=GP(e,t);let o=0,i,a=c=>{i||(i=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:l,value:u}=await s.next();if(l){a(),c.close();return}let d=u.byteLength;if(n){let f=o+=d;n(f)}c.enqueue(new Uint8Array(u))}catch(l){throw a(l),l}},cancel(c){return a(c),s.return()}},{highWaterMark:2})},Hp=64*1024,{isFunction:Hi}=L,XP=(({Request:e,Response:t})=>({Request:e,Response:t}))(L.global),{ReadableStream:qp,TextEncoder:Kp}=L.global,Zp=(e,...t)=>{try{return!!e(...t)}catch{return!1}},JP=e=>{e=L.merge.call({skipUndefined:!0},XP,e);const{fetch:t,Request:n,Response:r}=e,s=t?Hi(t):typeof fetch=="function",o=Hi(n),i=Hi(r);if(!s)return!1;const a=s&&Hi(qp),c=s&&(typeof Kp=="function"?(p=>m=>p.encode(m))(new Kp):async p=>new Uint8Array(await new n(p).arrayBuffer())),l=o&&a&&Zp(()=>{let p=!1;const m=new n(yt.origin,{body:new qp,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!m}),u=i&&a&&Zp(()=>L.isReadableStream(new r("").body)),d={stream:u&&(p=>p.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!d[p]&&(d[p]=(m,y)=>{let b=m&&m[p];if(b)return b.call(m);throw new ae(`Response type '${p}' is not supported`,ae.ERR_NOT_SUPPORT,y)})});const f=async p=>{if(p==null)return 0;if(L.isBlob(p))return p.size;if(L.isSpecCompliantForm(p))return(await new n(yt.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(L.isArrayBufferView(p)||L.isArrayBuffer(p))return p.byteLength;if(L.isURLSearchParams(p)&&(p=p+""),L.isString(p))return(await c(p)).byteLength},h=async(p,m)=>{const y=L.toFiniteNumber(p.getContentLength());return y??f(m)};return async p=>{let{url:m,method:y,data:b,signal:x,cancelToken:_,timeout:w,onDownloadProgress:S,onUploadProgress:C,responseType:k,headers:E,withCredentials:P="same-origin",fetchOptions:O}=fv(p),N=t||fetch;k=k?(k+"").toLowerCase():"text";let A=KP([x,_&&_.toAbortSignal()],w),j=null;const $=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let q;try{if(C&&l&&y!=="get"&&y!=="head"&&(q=await h(E,b))!==0){let I=new n(m,{method:"POST",body:b,duplex:"half"}),Y;if(L.isFormData(b)&&(Y=I.headers.get("content-type"))&&E.setContentType(Y),I.body){const[K,Z]=Vp(q,Qa(Bp(C)));b=Wp(I.body,Hp,K,Z)}}L.isString(P)||(P=P?"include":"omit");const D=o&&"credentials"in n.prototype,H={...O,signal:A,method:y.toUpperCase(),headers:E.normalize().toJSON(),body:b,duplex:"half",credentials:D?P:void 0};j=o&&new n(m,H);let F=await(o?N(j,O):N(m,H));const W=u&&(k==="stream"||k==="response");if(u&&(S||W&&$)){const I={};["status","statusText","headers"].forEach(oe=>{I[oe]=F[oe]});const Y=L.toFiniteNumber(F.headers.get("content-length")),[K,Z]=S&&Vp(Y,Qa(Bp(S),!0))||[];F=new r(Wp(F.body,Hp,K,()=>{Z&&Z(),$&&$()}),I)}k=k||"text";let se=await d[L.findKey(d,k)||"text"](F,p);return!W&&$&&$(),await new Promise((I,Y)=>{uv(I,Y,{data:se,headers:It.from(F.headers),status:F.status,statusText:F.statusText,config:p,request:j})})}catch(D){throw $&&$(),D&&D.name==="TypeError"&&/Load failed|fetch/i.test(D.message)?Object.assign(new ae("Network Error",ae.ERR_NETWORK,p,j),{cause:D.cause||D}):ae.from(D,D&&D.code,p,j)}}},QP=new Map,hv=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,o=[r,s,n];let i=o.length,a=i,c,l,u=QP;for(;a--;)c=o[a],l=u.get(c),l===void 0&&u.set(c,l=a?new Map:JP(t)),u=l;return l};hv();const mf={http:gP,xhr:qP,fetch:{get:hv}};L.forEach(mf,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Gp=e=>`- ${e}`,eO=e=>L.isFunction(e)||e===null||e===!1;function tO(e,t){e=L.isArray(e)?e:[e];const{length:n}=e;let r,s;const o={};for(let i=0;i<n;i++){r=e[i];let a;if(s=r,!eO(r)&&(s=mf[(a=String(r)).toLowerCase()],s===void 0))throw new ae(`Unknown adapter '${a}'`);if(s&&(L.isFunction(s)||(s=s.get(t))))break;o[a||"#"+i]=s}if(!s){const i=Object.entries(o).map(([c,l])=>`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build"));let a=n?i.length>1?`since :
|
|
11
|
-
`+i.map(
|
|
12
|
-
`):" "+
|
|
13
|
-
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Qr(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&Oa.assertOptions(r,{silentJSONParsing:xn.transitional(xn.boolean),forcedJSONParsing:xn.transitional(xn.boolean),clarifyTimeoutError:xn.transitional(xn.boolean)},!1),s!=null&&(L.isFunction(s)?n.paramsSerializer={serialize:s}:Oa.assertOptions(s,{encode:xn.function,serialize:xn.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Oa.assertOptions(n,{baseUrl:xn.spelling("baseURL"),withXsrfToken:xn.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&L.merge(o.common,o[n.method]);o&&L.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),n.headers=It.concat(i,o);const a=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(c=c&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const l=[];this.interceptors.response.forEach(function(m){l.push(m.fulfilled,m.rejected)});let u,d=0,f;if(!c){const p=[Yp.bind(this),void 0];for(p.unshift(...a),p.push(...l),f=p.length,u=Promise.resolve(n);d<f;)u=u.then(p[d++],p[d++]);return u}f=a.length;let h=n;for(;d<f;){const p=a[d++],m=a[d++];try{h=p(h)}catch(y){m.call(this,y);break}}try{u=Yp.call(this,h)}catch(p){return Promise.reject(p)}for(d=0,f=l.length;d<f;)u=u.then(l[d++],l[d++]);return u}getUri(t){t=Qr(this.defaults,t);const n=dv(t.baseURL,t.url,t.allowAbsoluteUrls);return iv(n,t.params,t.paramsSerializer)}};L.forEach(["delete","get","head","options"],function(t){qr.prototype[t]=function(n,r){return this.request(Qr(r||{},{method:t,url:n,data:(r||{}).data}))}});L.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,a){return this.request(Qr(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}qr.prototype[t]=n(),qr.prototype[t+"Form"]=n(!0)});let rO=class gv{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(a=>{r.subscribe(a),o=a}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,a){r.reason||(r.reason=new xi(o,i,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new gv(function(s){t=s}),cancel:t}}};function sO(e){return function(n){return e.apply(null,n)}}function oO(e){return L.isObject(e)&&e.isAxiosError===!0}const ed={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ed).forEach(([e,t])=>{ed[t]=e});function yv(e){const t=new qr(e),n=Gb(qr.prototype.request,t);return L.extend(n,qr.prototype,t,{allOwnKeys:!0}),L.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return yv(Qr(e,s))},n}const qe=yv(vi);qe.Axios=qr;qe.CanceledError=xi;qe.CancelToken=rO;qe.isCancel=lv;qe.VERSION=mv;qe.toFormData=Bc;qe.AxiosError=ae;qe.Cancel=qe.CanceledError;qe.all=function(t){return Promise.all(t)};qe.spread=sO;qe.isAxiosError=oO;qe.mergeConfig=Qr;qe.AxiosHeaders=It;qe.formToJSON=e=>cv(L.isHTMLForm(e)?new FormData(e):e);qe.getAdapter=pv.getAdapter;qe.HttpStatusCode=ed;qe.default=qe;const{Axios:TH,AxiosError:MH,CanceledError:AH,isCancel:NH,CancelToken:DH,VERSION:IH,all:jH,Cancel:LH,isAxiosError:FH,spread:zH,toFormData:$H,AxiosHeaders:VH,HttpStatusCode:BH,formToJSON:UH,getAdapter:WH,mergeConfig:HH}=qe,td={apiBase:"http://localhost:3000/api",wsPath:"/ws"},Te=qe.create({baseURL:td.apiBase});function iO(e,t){Te.defaults.baseURL=e,t&&(Te.defaults.headers.common.Authorization=`Bearer ${t}`)}function nd(e){e?Te.defaults.headers.common.Authorization=`Bearer ${e}`:delete Te.defaults.headers.common.Authorization}const Wc=Zb()(TR(e=>({token:null,email:null,setAuth:(t,n)=>{nd(t),e({token:t,email:n})},logout:()=>{nd(null),e({token:null,email:null})}}),{name:"kuma_clone_auth"})),Jp=Wc.getState();Jp.token&&nd(Jp.token);const bv="pulsewatch.theme";function rd(e){const t=document.documentElement;e==="dark"?t.classList.add("dark"):t.classList.remove("dark"),t.style.colorScheme=e,localStorage.setItem(bv,e)}const vv=Zb((e,t)=>({mode:"light",setMode:n=>{rd(n),e({mode:n})},toggle:()=>{const n=t().mode==="dark"?"light":"dark";rd(n),e({mode:n})}}));function aO(){const t=localStorage.getItem(bv)==="dark"?"dark":"light";rd(t),vv.setState({mode:t})}var _i=e=>e.type==="checkbox",Br=e=>e instanceof Date,At=e=>e==null;const xv=e=>typeof e=="object";var Je=e=>!At(e)&&!Array.isArray(e)&&xv(e)&&!Br(e),_v=e=>Je(e)&&e.target?_i(e.target)?e.target.checked:e.target.value:e,cO=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,wv=(e,t)=>e.has(cO(t)),lO=e=>{const t=e.constructor&&e.constructor.prototype;return Je(t)&&t.hasOwnProperty("isPrototypeOf")},gf=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ge(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(gf&&(e instanceof Blob||t))return e;const n=Array.isArray(e);if(!n&&!(Je(e)&&lO(e)))return e;const r=n?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=Ge(e[s]));return r}var Hc=e=>/^\w*$/.test(e),Fe=e=>e===void 0,yf=e=>Array.isArray(e)?e.filter(Boolean):[],bf=e=>yf(e.replace(/["|']|\]/g,"").split(/\.|\[/)),X=(e,t,n)=>{if(!t||!Je(e))return n;const r=(Hc(t)?[t]:bf(t)).reduce((s,o)=>At(s)?s:s[o],e);return Fe(r)||r===e?Fe(e[t])?n:e[t]:r},zt=e=>typeof e=="boolean",kt=e=>typeof e=="function",ke=(e,t,n)=>{let r=-1;const s=Hc(t)?[t]:bf(t),o=s.length,i=o-1;for(;++r<o;){const a=s[r];let c=n;if(r!==i){const l=e[a];c=Je(l)||Array.isArray(l)?l:isNaN(+s[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=c,e=e[a]}};const ec={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},un={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Nn={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},vf=T.createContext(null);vf.displayName="HookFormControlContext";const xf=()=>T.useContext(vf);var Sv=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const i=o;return t._proxyFormState[i]!==un.all&&(t._proxyFormState[i]=!r||un.all),n&&(n[i]=!0),e[i]}});return s};const _f=typeof window<"u"?T.useLayoutEffect:T.useEffect;function Ev(e){const t=xf(),{control:n=t,disabled:r,name:s,exact:o}=e||{},[i,a]=T.useState(n._formState),c=T.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return _f(()=>n._subscribe({name:s,formState:c.current,exact:o,callback:l=>{!r&&a({...n._formState,...l})}}),[s,r,o]),T.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),T.useMemo(()=>Sv(i,n,c.current,!1),[i,n])}var Vt=e=>typeof e=="string",sd=(e,t,n,r,s)=>Vt(e)?(r&&t.watch.add(e),X(n,e,s)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),X(n,o))):(r&&(t.watchAll=!0),n),od=e=>At(e)||!xv(e);function dn(e,t,n=new WeakSet){if(od(e)||od(t))return Object.is(e,t);if(Br(e)&&Br(t))return Object.is(e.getTime(),t.getTime());const r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const o of r){const i=e[o];if(!s.includes(o))return!1;if(o!=="ref"){const a=t[o];if(Br(i)&&Br(a)||Je(i)&&Je(a)||Array.isArray(i)&&Array.isArray(a)?!dn(i,a,n):!Object.is(i,a))return!1}}return!0}function uO(e){const t=xf(),{control:n=t,name:r,defaultValue:s,disabled:o,exact:i,compute:a}=e||{},c=T.useRef(s),l=T.useRef(a),u=T.useRef(void 0),d=T.useRef(n),f=T.useRef(r);l.current=a;const[h,p]=T.useState(()=>{const w=n._getWatch(r,c.current);return l.current?l.current(w):w}),m=T.useCallback(w=>{const S=sd(r,n._names,w||n._formValues,!1,c.current);return l.current?l.current(S):S},[n._formValues,n._names,r]),y=T.useCallback(w=>{if(!o){const S=sd(r,n._names,w||n._formValues,!1,c.current);if(l.current){const C=l.current(S);dn(C,u.current)||(p(C),u.current=C)}else p(S)}},[n._formValues,n._names,o,r]);_f(()=>((d.current!==n||!dn(f.current,r))&&(d.current=n,f.current=r,y()),n._subscribe({name:r,formState:{values:!0},exact:i,callback:w=>{y(w.values)}})),[n,i,r,y]),T.useEffect(()=>n._removeUnmounted());const b=d.current!==n,x=f.current,_=T.useMemo(()=>{if(o)return null;const w=!b&&!dn(x,r);return b||w?m():null},[o,b,r,x,m]);return _!==null?_:h}function dO(e){const t=xf(),{name:n,disabled:r,control:s=t,shouldUnregister:o,defaultValue:i,exact:a=!0}=e,c=wv(s._names.array,n),l=T.useMemo(()=>X(s._formValues,n,X(s._defaultValues,n,i)),[s,n,i]),u=uO({control:s,name:n,defaultValue:l,exact:a}),d=Ev({control:s,name:n,exact:a}),f=T.useRef(e),h=T.useRef(void 0),p=T.useRef(s.register(n,{...e.rules,value:u,...zt(e.disabled)?{disabled:e.disabled}:{}}));f.current=e;const m=T.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!X(d.errors,n)},isDirty:{enumerable:!0,get:()=>!!X(d.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!X(d.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!X(d.validatingFields,n)},error:{enumerable:!0,get:()=>X(d.errors,n)}}),[d,n]),y=T.useCallback(w=>p.current.onChange({target:{value:_v(w),name:n},type:ec.CHANGE}),[n]),b=T.useCallback(()=>p.current.onBlur({target:{value:X(s._formValues,n),name:n},type:ec.BLUR}),[n,s._formValues]),x=T.useCallback(w=>{const S=X(s._fields,n);S&&S._f&&w&&(S._f.ref={focus:()=>kt(w.focus)&&w.focus(),select:()=>kt(w.select)&&w.select(),setCustomValidity:C=>kt(w.setCustomValidity)&&w.setCustomValidity(C),reportValidity:()=>kt(w.reportValidity)&&w.reportValidity()})},[s._fields,n]),_=T.useMemo(()=>({name:n,value:u,...zt(r)||d.disabled?{disabled:d.disabled||r}:{},onChange:y,onBlur:b,ref:x}),[n,r,d.disabled,y,b,x,u]);return T.useEffect(()=>{const w=s._options.shouldUnregister||o,S=h.current;S&&S!==n&&!c&&s.unregister(S),s.register(n,{...f.current.rules,...zt(f.current.disabled)?{disabled:f.current.disabled}:{}});const C=(k,E)=>{const P=X(s._fields,k);P&&P._f&&(P._f.mount=E)};if(C(n,!0),w){const k=Ge(X(s._options.defaultValues,n,f.current.defaultValue));ke(s._defaultValues,n,k),Fe(X(s._formValues,n))&&ke(s._formValues,n,k)}return!c&&s.register(n),h.current=n,()=>{(c?w&&!s._state.action:w)?s.unregister(n):C(n,!1)}},[n,s,c,o]),T.useEffect(()=>{s._setDisabledField({disabled:r,name:n})},[r,n,s]),T.useMemo(()=>({field:_,formState:d,fieldState:m}),[_,d,m])}const fO=e=>e.render(dO(e)),wf=T.createContext(null);wf.displayName="HookFormContext";const hO=()=>T.useContext(wf),pO=e=>{const{children:t,watch:n,getValues:r,getFieldState:s,setError:o,clearErrors:i,setValue:a,trigger:c,formState:l,resetField:u,reset:d,handleSubmit:f,unregister:h,control:p,register:m,setFocus:y,subscribe:b}=e;return T.createElement(wf.Provider,{value:T.useMemo(()=>({watch:n,getValues:r,getFieldState:s,setError:o,clearErrors:i,setValue:a,trigger:c,formState:l,resetField:u,reset:d,handleSubmit:f,unregister:h,control:p,register:m,setFocus:y,subscribe:b}),[i,p,l,s,r,f,m,d,u,o,y,a,b,c,h,n])},T.createElement(vf.Provider,{value:p},t))};var Sf=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},Fo=e=>Array.isArray(e)?e:[e],Qp=()=>{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}};function kv(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const s=e[r],o=t[r];if(s&&Je(s)&&o){const i=kv(s,o);Je(i)&&(n[r]=i)}else e[r]&&(n[r]=o)}return n}var Et=e=>Je(e)&&!Object.keys(e).length,Ef=e=>e.type==="file",tc=e=>{if(!gf)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Cv=e=>e.type==="select-multiple",kf=e=>e.type==="radio",mO=e=>kf(e)||_i(e),tu=e=>tc(e)&&e.isConnected;function gO(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Fe(e)?r++:e[t[r++]];return e}function yO(e){for(const t in e)if(e.hasOwnProperty(t)&&!Fe(e[t]))return!1;return!0}function Ye(e,t){const n=Array.isArray(t)?t:Hc(t)?[t]:bf(t),r=n.length===1?e:gO(e,n),s=n.length-1,o=n[s];return r&&delete r[o],s!==0&&(Je(r)&&Et(r)||Array.isArray(r)&&yO(r))&&Ye(e,n.slice(0,-1)),e}var bO=e=>{for(const t in e)if(kt(e[t]))return!0;return!1};function Rv(e){return Array.isArray(e)||Je(e)&&!bO(e)}function id(e,t={}){for(const n in e){const r=e[n];Rv(r)?(t[n]=Array.isArray(r)?[]:{},id(r,t[n])):Fe(r)||(t[n]=!0)}return t}function Es(e,t,n){n||(n=id(t));for(const r in e){const s=e[r];if(Rv(s))Fe(t)||od(n[r])?n[r]=id(s,Array.isArray(s)?[]:{}):Es(s,At(t)?{}:t[r],n[r]);else{const o=t[r];n[r]=!dn(s,o)}}return n}const em={value:!1,isValid:!1},tm={value:!0,isValid:!0};var Pv=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Fe(e[0].attributes.value)?Fe(e[0].value)||e[0].value===""?tm:{value:e[0].value,isValid:!0}:tm:em}return em},Ov=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Fe(e)?e:t?e===""?NaN:e&&+e:n&&Vt(e)?new Date(e):r?r(e):e;const nm={isValid:!1,value:null};var Tv=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,nm):nm;function rm(e){const t=e.ref;return Ef(t)?t.files:kf(t)?Tv(e.refs).value:Cv(t)?[...t.selectedOptions].map(({value:n})=>n):_i(t)?Pv(e.refs).value:Ov(Fe(t.value)?e.ref.value:t.value,e)}var vO=(e,t,n,r)=>{const s={};for(const o of e){const i=X(t,o);i&&ke(s,o,i._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},nc=e=>e instanceof RegExp,bo=e=>Fe(e)?e:nc(e)?e.source:Je(e)?nc(e.value)?e.value.source:e.value:e,sm=e=>({isOnSubmit:!e||e===un.onSubmit,isOnBlur:e===un.onBlur,isOnChange:e===un.onChange,isOnAll:e===un.all,isOnTouch:e===un.onTouched});const om="AsyncFunction";var xO=e=>!!e&&!!e.validate&&!!(kt(e.validate)&&e.validate.constructor.name===om||Je(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===om)),_O=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),im=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const zo=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const o=X(e,s);if(o){const{_f:i,...a}=o;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],s)&&!r)return!0;if(i.ref&&t(i.ref,i.name)&&!r)return!0;if(zo(a,t))break}else if(Je(a)&&zo(a,t))break}}};function am(e,t,n){const r=X(e,n);if(r||Hc(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const o=s.join("."),i=X(t,o),a=X(e,o);if(i&&!Array.isArray(i)&&n!==o)return{name:n};if(a&&a.type)return{name:o,error:a};if(a&&a.root&&a.root.type)return{name:`${o}.root`,error:a.root};s.pop()}return{name:n}}var wO=(e,t,n,r)=>{n(e);const{name:s,...o}=e;return Et(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(i=>t[i]===(!r||un.all))},SO=(e,t,n)=>!e||!t||e===t||Fo(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),EO=(e,t,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(t||e):(n?r.isOnBlur:s.isOnBlur)?!e:(n?r.isOnChange:s.isOnChange)?e:!0,kO=(e,t)=>!yf(X(e,t)).length&&Ye(e,t),CO=(e,t,n)=>{const r=Fo(X(e,n));return ke(r,"root",t[n]),ke(e,n,r),e};function cm(e,t,n="validate"){if(Vt(e)||Array.isArray(e)&&e.every(Vt)||zt(e)&&!e)return{type:n,message:Vt(e)?e:"",ref:t}}var gs=e=>Je(e)&&!nc(e)?e:{value:e,message:""},lm=async(e,t,n,r,s,o)=>{const{ref:i,refs:a,required:c,maxLength:l,minLength:u,min:d,max:f,pattern:h,validate:p,name:m,valueAsNumber:y,mount:b}=e._f,x=X(n,m);if(!b||t.has(m))return{};const _=a?a[0]:i,w=A=>{s&&_.reportValidity&&(_.setCustomValidity(zt(A)?"":A||""),_.reportValidity())},S={},C=kf(i),k=_i(i),E=C||k,P=(y||Ef(i))&&Fe(i.value)&&Fe(x)||tc(i)&&i.value===""||x===""||Array.isArray(x)&&!x.length,O=Sf.bind(null,m,r,S),N=(A,j,$,q=Nn.maxLength,D=Nn.minLength)=>{const H=A?j:$;S[m]={type:A?q:D,message:H,ref:i,...O(A?q:D,H)}};if(o?!Array.isArray(x)||!x.length:c&&(!E&&(P||At(x))||zt(x)&&!x||k&&!Pv(a).isValid||C&&!Tv(a).isValid)){const{value:A,message:j}=Vt(c)?{value:!!c,message:c}:gs(c);if(A&&(S[m]={type:Nn.required,message:j,ref:_,...O(Nn.required,j)},!r))return w(j),S}if(!P&&(!At(d)||!At(f))){let A,j;const $=gs(f),q=gs(d);if(!At(x)&&!isNaN(x)){const D=i.valueAsNumber||x&&+x;At($.value)||(A=D>$.value),At(q.value)||(j=D<q.value)}else{const D=i.valueAsDate||new Date(x),H=se=>new Date(new Date().toDateString()+" "+se),F=i.type=="time",W=i.type=="week";Vt($.value)&&x&&(A=F?H(x)>H($.value):W?x>$.value:D>new Date($.value)),Vt(q.value)&&x&&(j=F?H(x)<H(q.value):W?x<q.value:D<new Date(q.value))}if((A||j)&&(N(!!A,$.message,q.message,Nn.max,Nn.min),!r))return w(S[m].message),S}if((l||u)&&!P&&(Vt(x)||o&&Array.isArray(x))){const A=gs(l),j=gs(u),$=!At(A.value)&&x.length>+A.value,q=!At(j.value)&&x.length<+j.value;if(($||q)&&(N($,A.message,j.message),!r))return w(S[m].message),S}if(h&&!P&&Vt(x)){const{value:A,message:j}=gs(h);if(nc(A)&&!x.match(A)&&(S[m]={type:Nn.pattern,message:j,ref:i,...O(Nn.pattern,j)},!r))return w(j),S}if(p){if(kt(p)){const A=await p(x,n),j=cm(A,_);if(j&&(S[m]={...j,...O(Nn.validate,j.message)},!r))return w(j.message),S}else if(Je(p)){let A={};for(const j in p){if(!Et(A)&&!r)break;const $=cm(await p[j](x,n),_,j);$&&(A={...$,...O(j,$.message)},w($.message),r&&(S[m]=A))}if(!Et(A)&&(S[m]={ref:_,...A},!r))return S}}return w(!0),S};const RO={mode:un.onSubmit,reValidateMode:un.onChange,shouldFocusError:!0};function PO(e={}){let t={...RO,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:kt(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},s=Je(t.defaultValues)||Je(t.values)?Ge(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:Ge(s),i={action:!1,mount:!1,watch:!1,keepIsValid:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,l=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...u};let f={...d};const h={array:Qp(),state:Qp()},p=t.criteriaMode===un.all,m=R=>M=>{clearTimeout(l),l=setTimeout(R,M)},y=async R=>{if(!i.keepIsValid&&!t.disabled&&(d.isValid||f.isValid||R)){let M;t.resolver?(M=Et((await E()).errors),b()):M=await O(r,!0),M!==n.isValid&&h.state.next({isValid:M})}},b=(R,M)=>{!t.disabled&&(d.isValidating||d.validatingFields||f.isValidating||f.validatingFields)&&((R||Array.from(a.mount)).forEach(z=>{z&&(M?ke(n.validatingFields,z,M):Ye(n.validatingFields,z))}),h.state.next({validatingFields:n.validatingFields,isValidating:!Et(n.validatingFields)}))},x=(R,M=[],z,J,G=!0,B=!0)=>{if(J&&z&&!t.disabled){if(i.action=!0,B&&Array.isArray(X(r,R))){const Q=z(X(r,R),J.argA,J.argB);G&&ke(r,R,Q)}if(B&&Array.isArray(X(n.errors,R))){const Q=z(X(n.errors,R),J.argA,J.argB);G&&ke(n.errors,R,Q),kO(n.errors,R)}if((d.touchedFields||f.touchedFields)&&B&&Array.isArray(X(n.touchedFields,R))){const Q=z(X(n.touchedFields,R),J.argA,J.argB);G&&ke(n.touchedFields,R,Q)}(d.dirtyFields||f.dirtyFields)&&(n.dirtyFields=Es(s,o)),h.state.next({name:R,isDirty:A(R,M),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else ke(o,R,M)},_=(R,M)=>{ke(n.errors,R,M),h.state.next({errors:n.errors})},w=R=>{n.errors=R,h.state.next({errors:n.errors,isValid:!1})},S=(R,M,z,J)=>{const G=X(r,R);if(G){const B=X(o,R,Fe(z)?X(s,R):z);Fe(B)||J&&J.defaultChecked||M?ke(o,R,M?B:rm(G._f)):q(R,B),i.mount&&!i.action&&y()}},C=(R,M,z,J,G)=>{let B=!1,Q=!1;const ue={name:R};if(!t.disabled){if(!z||J){(d.isDirty||f.isDirty)&&(Q=n.isDirty,n.isDirty=ue.isDirty=A(),B=Q!==ue.isDirty);const ve=dn(X(s,R),M);Q=!!X(n.dirtyFields,R),ve?Ye(n.dirtyFields,R):ke(n.dirtyFields,R,!0),ue.dirtyFields=n.dirtyFields,B=B||(d.dirtyFields||f.dirtyFields)&&Q!==!ve}if(z){const ve=X(n.touchedFields,R);ve||(ke(n.touchedFields,R,z),ue.touchedFields=n.touchedFields,B=B||(d.touchedFields||f.touchedFields)&&ve!==z)}B&&G&&h.state.next(ue)}return B?ue:{}},k=(R,M,z,J)=>{const G=X(n.errors,R),B=(d.isValid||f.isValid)&&zt(M)&&n.isValid!==M;if(t.delayError&&z?(c=m(()=>_(R,z)),c(t.delayError)):(clearTimeout(l),c=null,z?ke(n.errors,R,z):Ye(n.errors,R)),(z?!dn(G,z):G)||!Et(J)||B){const Q={...J,...B&&zt(M)?{isValid:M}:{},errors:n.errors,name:R};n={...n,...Q},h.state.next(Q)}},E=async R=>(b(R,!0),await t.resolver(o,t.context,vO(R||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),P=async R=>{const{errors:M}=await E(R);if(b(R),R)for(const z of R){const J=X(M,z);J?ke(n.errors,z,J):Ye(n.errors,z)}else n.errors=M;return M},O=async(R,M,z={valid:!0})=>{for(const J in R){const G=R[J];if(G){const{_f:B,...Q}=G;if(B){const ue=a.array.has(B.name),ve=G._f&&xO(G._f);ve&&d.validatingFields&&b([B.name],!0);const Ue=await lm(G,a.disabled,o,p,t.shouldUseNativeValidation&&!M,ue);if(ve&&d.validatingFields&&b([B.name]),Ue[B.name]&&(z.valid=!1,M||e.shouldUseNativeValidation))break;!M&&(X(Ue,B.name)?ue?CO(n.errors,Ue,B.name):ke(n.errors,B.name,Ue[B.name]):Ye(n.errors,B.name))}!Et(Q)&&await O(Q,M,z)}}return z.valid},N=()=>{for(const R of a.unMount){const M=X(r,R);M&&(M._f.refs?M._f.refs.every(z=>!tu(z)):!tu(M._f.ref))&&ee(R)}a.unMount=new Set},A=(R,M)=>!t.disabled&&(R&&M&&ke(o,R,M),!dn(I(),s)),j=(R,M,z)=>sd(R,a,{...i.mount?o:Fe(M)?s:Vt(R)?{[R]:M}:M},z,M),$=R=>yf(X(i.mount?o:s,R,t.shouldUnregister?X(s,R,[]):[])),q=(R,M,z={})=>{const J=X(r,R);let G=M;if(J){const B=J._f;B&&(!B.disabled&&ke(o,R,Ov(M,B)),G=tc(B.ref)&&At(M)?"":M,Cv(B.ref)?[...B.ref.options].forEach(Q=>Q.selected=G.includes(Q.value)):B.refs?_i(B.ref)?B.refs.forEach(Q=>{(!Q.defaultChecked||!Q.disabled)&&(Array.isArray(G)?Q.checked=!!G.find(ue=>ue===Q.value):Q.checked=G===Q.value||!!G)}):B.refs.forEach(Q=>Q.checked=Q.value===G):Ef(B.ref)?B.ref.value="":(B.ref.value=G,B.ref.type||h.state.next({name:R,values:Ge(o)})))}(z.shouldDirty||z.shouldTouch)&&C(R,G,z.shouldTouch,z.shouldDirty,!0),z.shouldValidate&&se(R)},D=(R,M,z)=>{for(const J in M){if(!M.hasOwnProperty(J))return;const G=M[J],B=R+"."+J,Q=X(r,B);(a.array.has(R)||Je(G)||Q&&!Q._f)&&!Br(G)?D(B,G,z):q(B,G,z)}},H=(R,M,z={})=>{const J=X(r,R),G=a.array.has(R),B=Ge(M);ke(o,R,B),G?(h.array.next({name:R,values:Ge(o)}),(d.isDirty||d.dirtyFields||f.isDirty||f.dirtyFields)&&z.shouldDirty&&h.state.next({name:R,dirtyFields:Es(s,o),isDirty:A(R,B)})):J&&!J._f&&!At(B)?D(R,B,z):q(R,B,z),im(R,a)?h.state.next({...n,name:R,values:Ge(o)}):h.state.next({name:i.mount?R:void 0,values:Ge(o)})},F=async R=>{i.mount=!0;const M=R.target;let z=M.name,J=!0;const G=X(r,z),B=ve=>{J=Number.isNaN(ve)||Br(ve)&&isNaN(ve.getTime())||dn(ve,X(o,z,ve))},Q=sm(t.mode),ue=sm(t.reValidateMode);if(G){let ve,Ue;const bn=M.type?rm(G._f):_v(R),wt=R.type===ec.BLUR||R.type===ec.FOCUS_OUT,Dl=!_O(G._f)&&!t.resolver&&!X(n.errors,z)&&!G._f.deps||EO(wt,X(n.touchedFields,z),n.isSubmitted,ue,Q),ao=im(z,a,wt);ke(o,z,bn),wt?(!M||!M.readOnly)&&(G._f.onBlur&&G._f.onBlur(R),c&&c(0)):G._f.onChange&&G._f.onChange(R);const ms=C(z,bn,wt),Ai=!Et(ms)||ao;if(!wt&&h.state.next({name:z,type:R.type,values:Ge(o)}),Dl)return(d.isValid||f.isValid)&&(t.mode==="onBlur"?wt&&y():wt||y()),Ai&&h.state.next({name:z,...ao?{}:ms});if(!wt&&ao&&h.state.next({...n}),t.resolver){const{errors:Ni}=await E([z]);if(b([z]),B(bn),J){const co=am(n.errors,r,z),sn=am(Ni,r,co.name||z);ve=sn.error,z=sn.name,Ue=Et(Ni)}}else b([z],!0),ve=(await lm(G,a.disabled,o,p,t.shouldUseNativeValidation))[z],b([z]),B(bn),J&&(ve?Ue=!1:(d.isValid||f.isValid)&&(Ue=await O(r,!0)));J&&(G._f.deps&&(!Array.isArray(G._f.deps)||G._f.deps.length>0)&&se(G._f.deps),k(z,Ue,ve,ms))}},W=(R,M)=>{if(X(n.errors,M)&&R.focus)return R.focus(),1},se=async(R,M={})=>{let z,J;const G=Fo(R);if(t.resolver){const B=await P(Fe(R)?R:G);z=Et(B),J=R?!G.some(Q=>X(B,Q)):z}else R?(J=(await Promise.all(G.map(async B=>{const Q=X(r,B);return await O(Q&&Q._f?{[B]:Q}:Q)}))).every(Boolean),!(!J&&!n.isValid)&&y()):J=z=await O(r);return h.state.next({...!Vt(R)||(d.isValid||f.isValid)&&z!==n.isValid?{}:{name:R},...t.resolver||!R?{isValid:z}:{},errors:n.errors}),M.shouldFocus&&!J&&zo(r,W,R?G:a.mount),J},I=(R,M)=>{let z={...i.mount?o:s};return M&&(z=kv(M.dirtyFields?n.dirtyFields:n.touchedFields,z)),Fe(R)?z:Vt(R)?X(z,R):R.map(J=>X(z,J))},Y=(R,M)=>({invalid:!!X((M||n).errors,R),isDirty:!!X((M||n).dirtyFields,R),error:X((M||n).errors,R),isValidating:!!X(n.validatingFields,R),isTouched:!!X((M||n).touchedFields,R)}),K=R=>{R&&Fo(R).forEach(M=>Ye(n.errors,M)),h.state.next({errors:R?n.errors:{}})},Z=(R,M,z)=>{const J=(X(r,R,{_f:{}})._f||{}).ref,G=X(n.errors,R)||{},{ref:B,message:Q,type:ue,...ve}=G;ke(n.errors,R,{...ve,...M,ref:J}),h.state.next({name:R,errors:n.errors,isValid:!1}),z&&z.shouldFocus&&J&&J.focus&&J.focus()},oe=(R,M)=>kt(R)?h.state.subscribe({next:z=>"values"in z&&R(j(void 0,M),z)}):j(R,M,!0),ce=R=>h.state.subscribe({next:M=>{SO(R.name,M.name,R.exact)&&wO(M,R.formState||d,Qn,R.reRenderRoot)&&R.callback({values:{...o},...n,...M,defaultValues:s})}}).unsubscribe,V=R=>(i.mount=!0,f={...f,...R.formState},ce({...R,formState:{...u,...R.formState}})),ee=(R,M={})=>{for(const z of R?Fo(R):a.mount)a.mount.delete(z),a.array.delete(z),M.keepValue||(Ye(r,z),Ye(o,z)),!M.keepError&&Ye(n.errors,z),!M.keepDirty&&Ye(n.dirtyFields,z),!M.keepTouched&&Ye(n.touchedFields,z),!M.keepIsValidating&&Ye(n.validatingFields,z),!t.shouldUnregister&&!M.keepDefaultValue&&Ye(s,z);h.state.next({values:Ge(o)}),h.state.next({...n,...M.keepDirty?{isDirty:A()}:{}}),!M.keepIsValid&&y()},me=({disabled:R,name:M})=>{if(zt(R)&&i.mount||R||a.disabled.has(M)){const G=a.disabled.has(M)!==!!R;R?a.disabled.add(M):a.disabled.delete(M),G&&i.mount&&!i.action&&y()}},le=(R,M={})=>{let z=X(r,R);const J=zt(M.disabled)||zt(t.disabled);return ke(r,R,{...z||{},_f:{...z&&z._f?z._f:{ref:{name:R}},name:R,mount:!0,...M}}),a.mount.add(R),z?me({disabled:zt(M.disabled)?M.disabled:t.disabled,name:R}):S(R,!0,M.value),{...J?{disabled:M.disabled||t.disabled}:{},...t.progressive?{required:!!M.required,min:bo(M.min),max:bo(M.max),minLength:bo(M.minLength),maxLength:bo(M.maxLength),pattern:bo(M.pattern)}:{},name:R,onChange:F,onBlur:F,ref:G=>{if(G){le(R,M),z=X(r,R);const B=Fe(G.value)&&G.querySelectorAll&&G.querySelectorAll("input,select,textarea")[0]||G,Q=mO(B),ue=z._f.refs||[];if(Q?ue.find(ve=>ve===B):B===z._f.ref)return;ke(r,R,{_f:{...z._f,...Q?{refs:[...ue.filter(tu),B,...Array.isArray(X(s,R))?[{}]:[]],ref:{type:B.type,name:R}}:{ref:B}}}),S(R,!1,void 0,B)}else z=X(r,R,{}),z._f&&(z._f.mount=!1),(t.shouldUnregister||M.shouldUnregister)&&!(wv(a.array,R)&&i.action)&&a.unMount.add(R)}}},fe=()=>t.shouldFocusError&&zo(r,W,a.mount),ge=R=>{zt(R)&&(h.state.next({disabled:R}),zo(r,(M,z)=>{const J=X(r,z);J&&(M.disabled=J._f.disabled||R,Array.isArray(J._f.refs)&&J._f.refs.forEach(G=>{G.disabled=J._f.disabled||R}))},0,!1))},Ze=(R,M)=>async z=>{let J;z&&(z.preventDefault&&z.preventDefault(),z.persist&&z.persist());let G=Ge(o);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:B,values:Q}=await E();b(),n.errors=B,G=Ge(Q)}else await O(r);if(a.disabled.size)for(const B of a.disabled)Ye(G,B);if(Ye(n.errors,"root"),Et(n.errors)){h.state.next({errors:{}});try{await R(G,z)}catch(B){J=B}}else M&&await M({...n.errors},z),fe(),setTimeout(fe);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Et(n.errors)&&!J,submitCount:n.submitCount+1,errors:n.errors}),J)throw J},_t=(R,M={})=>{X(r,R)&&(Fe(M.defaultValue)?H(R,Ge(X(s,R))):(H(R,M.defaultValue),ke(s,R,Ge(M.defaultValue))),M.keepTouched||Ye(n.touchedFields,R),M.keepDirty||(Ye(n.dirtyFields,R),n.isDirty=M.defaultValue?A(R,Ge(X(s,R))):A()),M.keepError||(Ye(n.errors,R),d.isValid&&y()),h.state.next({...n}))},rn=(R,M={})=>{const z=R?Ge(R):s,J=Ge(z),G=Et(R),B=G?s:J;if(M.keepDefaultValues||(s=z),!M.keepValues){if(M.keepDirtyValues){const Q=new Set([...a.mount,...Object.keys(Es(s,o))]);for(const ue of Array.from(Q)){const ve=X(n.dirtyFields,ue),Ue=X(o,ue),bn=X(B,ue);ve&&!Fe(Ue)?ke(B,ue,Ue):!ve&&!Fe(bn)&&H(ue,bn)}}else{if(gf&&Fe(R))for(const Q of a.mount){const ue=X(r,Q);if(ue&&ue._f){const ve=Array.isArray(ue._f.refs)?ue._f.refs[0]:ue._f.ref;if(tc(ve)){const Ue=ve.closest("form");if(Ue){Ue.reset();break}}}}if(M.keepFieldsRef)for(const Q of a.mount)H(Q,X(B,Q));else r={}}o=t.shouldUnregister?M.keepDefaultValues?Ge(s):{}:Ge(B),h.array.next({values:{...B}}),h.state.next({values:{...B}})}a={mount:M.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!d.isValid||!!M.keepIsValid||!!M.keepDirtyValues||!t.shouldUnregister&&!Et(B),i.watch=!!t.shouldUnregister,i.keepIsValid=!!M.keepIsValid,i.action=!1,M.keepErrors||(n.errors={}),h.state.next({submitCount:M.keepSubmitCount?n.submitCount:0,isDirty:G?!1:M.keepDirty?n.isDirty:!!(M.keepDefaultValues&&!dn(R,s)),isSubmitted:M.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:G?{}:M.keepDirtyValues?M.keepDefaultValues&&o?Es(s,o):n.dirtyFields:M.keepDefaultValues&&R?Es(s,R):M.keepDirty?n.dirtyFields:{},touchedFields:M.keepTouched?n.touchedFields:{},errors:M.keepErrors?n.errors:{},isSubmitSuccessful:M.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},qt=(R,M)=>rn(kt(R)?R(o):R,{...t.resetOptions,...M}),st=(R,M={})=>{const z=X(r,R),J=z&&z._f;if(J){const G=J.refs?J.refs[0]:J.ref;G.focus&&setTimeout(()=>{G.focus(),M.shouldSelect&&kt(G.select)&&G.select()})}},Qn=R=>{n={...n,...R}},ps={control:{register:le,unregister:ee,getFieldState:Y,handleSubmit:Ze,setError:Z,_subscribe:ce,_runSchema:E,_updateIsValidating:b,_focusError:fe,_getWatch:j,_getDirty:A,_setValid:y,_setFieldArray:x,_setDisabledField:me,_setErrors:w,_getFieldArray:$,_reset:rn,_resetDefaultValues:()=>kt(t.defaultValues)&&t.defaultValues().then(R=>{qt(R,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:N,_disableForm:ge,_subjects:h,_proxyFormState:d,get _fields(){return r},get _formValues(){return o},get _state(){return i},set _state(R){i=R},get _defaultValues(){return s},get _names(){return a},set _names(R){a=R},get _formState(){return n},get _options(){return t},set _options(R){t={...t,...R}}},subscribe:V,trigger:se,register:le,handleSubmit:Ze,watch:oe,setValue:H,getValues:I,reset:qt,resetField:_t,clearErrors:K,unregister:ee,setError:Z,setFocus:st,getFieldState:Y};return{...ps,formControl:ps}}function Cf(e={}){const t=T.useRef(void 0),n=T.useRef(void 0),[r,s]=T.useState({isDirty:!1,isValidating:!1,isLoading:kt(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:kt(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!kt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:i,...a}=PO(e);t.current={...a,formState:r}}const o=t.current.control;return o._options=e,_f(()=>{const i=o._subscribe({formState:o._proxyFormState,callback:()=>s({...o._formState}),reRenderRoot:!0});return s(a=>({...a,isReady:!0})),o._formState.isReady=!0,i},[o]),T.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),T.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),T.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),T.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),T.useEffect(()=>{if(o._proxyFormState.isDirty){const i=o._getDirty();i!==r.isDirty&&o._subjects.state.next({isDirty:i})}},[o,r.isDirty]),T.useEffect(()=>{var i;e.values&&!dn(e.values,n.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),!((i=o._options.resetOptions)===null||i===void 0)&&i.keepIsValid||o._setValid(),n.current=e.values,s(a=>({...a}))):o._resetDefaultValues()},[o,e.values]),T.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=T.useMemo(()=>Sv(r,o),[o,r]),t.current}function Mv(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Mv(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Rf(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Mv(e))&&(r&&(r+=" "),r+=t);return r}const OO=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},TO=(e,t)=>({classGroupId:e,validator:t}),Av=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),rc="-",um=[],MO="arbitrary..",AO=e=>{const t=DO(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return NO(i);const a=i.split(rc),c=a[0]===""&&a.length>1?1:0;return Nv(a,c,t)},getConflictingClassGroupIds:(i,a)=>{if(a){const c=r[i],l=n[i];return c?l?OO(l,c):c:l||um}return n[i]||um}}},Nv=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],o=n.nextPart.get(s);if(o){const l=Nv(e,t+1,o);if(l)return l}const i=n.validators;if(i===null)return;const a=t===0?e.join(rc):e.slice(t).join(rc),c=i.length;for(let l=0;l<c;l++){const u=i[l];if(u.validator(a))return u.classGroupId}},NO=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?MO+r:void 0})(),DO=e=>{const{theme:t,classGroups:n}=e;return IO(n,t)},IO=(e,t)=>{const n=Av();for(const r in e){const s=e[r];Pf(s,n,r,t)}return n},Pf=(e,t,n,r)=>{const s=e.length;for(let o=0;o<s;o++){const i=e[o];jO(i,t,n,r)}},jO=(e,t,n,r)=>{if(typeof e=="string"){LO(e,t,n);return}if(typeof e=="function"){FO(e,t,n,r);return}zO(e,t,n,r)},LO=(e,t,n)=>{const r=e===""?t:Dv(t,e);r.classGroupId=n},FO=(e,t,n,r)=>{if($O(e)){Pf(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(TO(n,e))},zO=(e,t,n,r)=>{const s=Object.entries(e),o=s.length;for(let i=0;i<o;i++){const[a,c]=s[i];Pf(c,Dv(t,a),n,r)}},Dv=(e,t)=>{let n=e;const r=t.split(rc),s=r.length;for(let o=0;o<s;o++){const i=r[o];let a=n.nextPart.get(i);a||(a=Av(),n.nextPart.set(i,a)),n=a}return n},$O=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,VO=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(o,i)=>{n[o]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let i=n[o];if(i!==void 0)return i;if((i=r[o])!==void 0)return s(o,i),i},set(o,i){o in n?n[o]=i:s(o,i)}}},ad="!",dm=":",BO=[],fm=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),UO=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const o=[];let i=0,a=0,c=0,l;const u=s.length;for(let m=0;m<u;m++){const y=s[m];if(i===0&&a===0){if(y===dm){o.push(s.slice(c,m)),c=m+1;continue}if(y==="/"){l=m;continue}}y==="["?i++:y==="]"?i--:y==="("?a++:y===")"&&a--}const d=o.length===0?s:s.slice(c);let f=d,h=!1;d.endsWith(ad)?(f=d.slice(0,-1),h=!0):d.startsWith(ad)&&(f=d.slice(1),h=!0);const p=l&&l>c?l-c:void 0;return fm(o,h,f,p)};if(t){const s=t+dm,o=r;r=i=>i.startsWith(s)?o(i.slice(s.length)):fm(BO,!1,i,void 0,!0)}if(n){const s=r;r=o=>n({className:o,parseClassName:s})}return r},WO=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let o=0;o<n.length;o++){const i=n[o],a=i[0]==="[",c=t.has(i);a||c?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(i)):s.push(i)}return s.length>0&&(s.sort(),r.push(...s)),r}},HO=e=>({cache:VO(e.cacheSize),parseClassName:UO(e),sortModifiers:WO(e),...AO(e)}),qO=/\s+/,KO=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:o}=t,i=[],a=e.trim().split(qO);let c="";for(let l=a.length-1;l>=0;l-=1){const u=a[l],{isExternal:d,modifiers:f,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}=n(u);if(d){c=u+(c.length>0?" "+c:c);continue}let y=!!m,b=r(y?p.substring(0,m):p);if(!b){if(!y){c=u+(c.length>0?" "+c:c);continue}if(b=r(p),!b){c=u+(c.length>0?" "+c:c);continue}y=!1}const x=f.length===0?"":f.length===1?f[0]:o(f).join(":"),_=h?x+ad:x,w=_+b;if(i.indexOf(w)>-1)continue;i.push(w);const S=s(b,y);for(let C=0;C<S.length;++C){const k=S[C];i.push(_+k)}c=u+(c.length>0?" "+c:c)}return c},ZO=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=Iv(n))&&(s&&(s+=" "),s+=r);return s},Iv=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Iv(e[r]))&&(n&&(n+=" "),n+=t);return n},GO=(e,...t)=>{let n,r,s,o;const i=c=>{const l=t.reduce((u,d)=>d(u),e());return n=HO(l),r=n.cache.get,s=n.cache.set,o=a,a(c)},a=c=>{const l=r(c);if(l)return l;const u=KO(c,n);return s(c,u),u};return o=i,(...c)=>o(ZO(...c))},YO=[],tt=e=>{const t=n=>n[e]||YO;return t.isThemeGetter=!0,t},jv=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Lv=/^\((?:(\w[\w-]*):)?(.+)\)$/i,XO=/^\d+\/\d+$/,JO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,QO=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,eT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,tT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,nT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ys=e=>XO.test(e),pe=e=>!!e&&!Number.isNaN(Number(e)),er=e=>!!e&&Number.isInteger(Number(e)),nu=e=>e.endsWith("%")&&pe(e.slice(0,-1)),Dn=e=>JO.test(e),rT=()=>!0,sT=e=>QO.test(e)&&!eT.test(e),Fv=()=>!1,oT=e=>tT.test(e),iT=e=>nT.test(e),aT=e=>!te(e)&&!ne(e),cT=e=>eo(e,Vv,Fv),te=e=>jv.test(e),Tr=e=>eo(e,Bv,sT),ru=e=>eo(e,hT,pe),hm=e=>eo(e,zv,Fv),lT=e=>eo(e,$v,iT),qi=e=>eo(e,Uv,oT),ne=e=>Lv.test(e),vo=e=>to(e,Bv),uT=e=>to(e,pT),pm=e=>to(e,zv),dT=e=>to(e,Vv),fT=e=>to(e,$v),Ki=e=>to(e,Uv,!0),eo=(e,t,n)=>{const r=jv.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},to=(e,t,n=!1)=>{const r=Lv.exec(e);return r?r[1]?t(r[1]):n:!1},zv=e=>e==="position"||e==="percentage",$v=e=>e==="image"||e==="url",Vv=e=>e==="length"||e==="size"||e==="bg-size",Bv=e=>e==="length",hT=e=>e==="number",pT=e=>e==="family-name",Uv=e=>e==="shadow",mT=()=>{const e=tt("color"),t=tt("font"),n=tt("text"),r=tt("font-weight"),s=tt("tracking"),o=tt("leading"),i=tt("breakpoint"),a=tt("container"),c=tt("spacing"),l=tt("radius"),u=tt("shadow"),d=tt("inset-shadow"),f=tt("text-shadow"),h=tt("drop-shadow"),p=tt("blur"),m=tt("perspective"),y=tt("aspect"),b=tt("ease"),x=tt("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...w(),ne,te],C=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],E=()=>[ne,te,c],P=()=>[ys,"full","auto",...E()],O=()=>[er,"none","subgrid",ne,te],N=()=>["auto",{span:["full",er,ne,te]},er,ne,te],A=()=>[er,"auto",ne,te],j=()=>["auto","min","max","fr",ne,te],$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...E()],H=()=>[ys,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...E()],F=()=>[e,ne,te],W=()=>[...w(),pm,hm,{position:[ne,te]}],se=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",dT,cT,{size:[ne,te]}],Y=()=>[nu,vo,Tr],K=()=>["","none","full",l,ne,te],Z=()=>["",pe,vo,Tr],oe=()=>["solid","dashed","dotted","double"],ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],V=()=>[pe,nu,pm,hm],ee=()=>["","none",p,ne,te],me=()=>["none",pe,ne,te],le=()=>["none",pe,ne,te],fe=()=>[pe,ne,te],ge=()=>[ys,"full",...E()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Dn],breakpoint:[Dn],color:[rT],container:[Dn],"drop-shadow":[Dn],ease:["in","out","in-out"],font:[aT],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Dn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Dn],shadow:[Dn],spacing:["px",pe],text:[Dn],"text-shadow":[Dn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ys,te,ne,y]}],container:["container"],columns:[{columns:[pe,te,ne,a]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{start:P()}],end:[{end:P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[er,"auto",ne,te]}],basis:[{basis:[ys,"full","auto",a,...E()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[pe,ys,"auto","initial","none",te]}],grow:[{grow:["",pe,ne,te]}],shrink:[{shrink:["",pe,ne,te]}],order:[{order:[er,"first","last","none",ne,te]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":j()}],"auto-rows":[{"auto-rows":j()}],gap:[{gap:E()}],"gap-x":[{"gap-x":E()}],"gap-y":[{"gap-y":E()}],"justify-content":[{justify:[...$(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...$()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":$()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:E()}],px:[{px:E()}],py:[{py:E()}],ps:[{ps:E()}],pe:[{pe:E()}],pt:[{pt:E()}],pr:[{pr:E()}],pb:[{pb:E()}],pl:[{pl:E()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":E()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":E()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],w:[{w:[a,"screen",...H()]}],"min-w":[{"min-w":[a,"screen","none",...H()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",n,vo,Tr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ne,ru]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",nu,te]}],"font-family":[{font:[uT,te,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,ne,te]}],"line-clamp":[{"line-clamp":[pe,"none",ne,ru]}],leading:[{leading:[o,...E()]}],"list-image":[{"list-image":["none",ne,te]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ne,te]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:[pe,"from-font","auto",ne,Tr]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[pe,"auto",ne,te]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ne,te]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ne,te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:W()}],"bg-repeat":[{bg:se()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},er,ne,te],radial:["",ne,te],conic:[er,ne,te]},fT,lT]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:K()}],"rounded-s":[{"rounded-s":K()}],"rounded-e":[{"rounded-e":K()}],"rounded-t":[{"rounded-t":K()}],"rounded-r":[{"rounded-r":K()}],"rounded-b":[{"rounded-b":K()}],"rounded-l":[{"rounded-l":K()}],"rounded-ss":[{"rounded-ss":K()}],"rounded-se":[{"rounded-se":K()}],"rounded-ee":[{"rounded-ee":K()}],"rounded-es":[{"rounded-es":K()}],"rounded-tl":[{"rounded-tl":K()}],"rounded-tr":[{"rounded-tr":K()}],"rounded-br":[{"rounded-br":K()}],"rounded-bl":[{"rounded-bl":K()}],"border-w":[{border:Z()}],"border-w-x":[{"border-x":Z()}],"border-w-y":[{"border-y":Z()}],"border-w-s":[{"border-s":Z()}],"border-w-e":[{"border-e":Z()}],"border-w-t":[{"border-t":Z()}],"border-w-r":[{"border-r":Z()}],"border-w-b":[{"border-b":Z()}],"border-w-l":[{"border-l":Z()}],"divide-x":[{"divide-x":Z()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Z()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...oe(),"hidden","none"]}],"divide-style":[{divide:[...oe(),"hidden","none"]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...oe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[pe,ne,te]}],"outline-w":[{outline:["",pe,vo,Tr]}],"outline-color":[{outline:F()}],shadow:[{shadow:["","none",u,Ki,qi]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":["none",d,Ki,qi]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[pe,Tr]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":Z()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":["none",f,Ki,qi]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[pe,ne,te]}],"mix-blend":[{"mix-blend":[...ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ce()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[pe]}],"mask-image-linear-from-pos":[{"mask-linear-from":V()}],"mask-image-linear-to-pos":[{"mask-linear-to":V()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":V()}],"mask-image-t-to-pos":[{"mask-t-to":V()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":V()}],"mask-image-r-to-pos":[{"mask-r-to":V()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":V()}],"mask-image-b-to-pos":[{"mask-b-to":V()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":V()}],"mask-image-l-to-pos":[{"mask-l-to":V()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":V()}],"mask-image-x-to-pos":[{"mask-x-to":V()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":V()}],"mask-image-y-to-pos":[{"mask-y-to":V()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[ne,te]}],"mask-image-radial-from-pos":[{"mask-radial-from":V()}],"mask-image-radial-to-pos":[{"mask-radial-to":V()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[pe]}],"mask-image-conic-from-pos":[{"mask-conic-from":V()}],"mask-image-conic-to-pos":[{"mask-conic-to":V()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:W()}],"mask-repeat":[{mask:se()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ne,te]}],filter:[{filter:["","none",ne,te]}],blur:[{blur:ee()}],brightness:[{brightness:[pe,ne,te]}],contrast:[{contrast:[pe,ne,te]}],"drop-shadow":[{"drop-shadow":["","none",h,Ki,qi]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:["",pe,ne,te]}],"hue-rotate":[{"hue-rotate":[pe,ne,te]}],invert:[{invert:["",pe,ne,te]}],saturate:[{saturate:[pe,ne,te]}],sepia:[{sepia:["",pe,ne,te]}],"backdrop-filter":[{"backdrop-filter":["","none",ne,te]}],"backdrop-blur":[{"backdrop-blur":ee()}],"backdrop-brightness":[{"backdrop-brightness":[pe,ne,te]}],"backdrop-contrast":[{"backdrop-contrast":[pe,ne,te]}],"backdrop-grayscale":[{"backdrop-grayscale":["",pe,ne,te]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[pe,ne,te]}],"backdrop-invert":[{"backdrop-invert":["",pe,ne,te]}],"backdrop-opacity":[{"backdrop-opacity":[pe,ne,te]}],"backdrop-saturate":[{"backdrop-saturate":[pe,ne,te]}],"backdrop-sepia":[{"backdrop-sepia":["",pe,ne,te]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":E()}],"border-spacing-x":[{"border-spacing-x":E()}],"border-spacing-y":[{"border-spacing-y":E()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ne,te]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[pe,"initial",ne,te]}],ease:[{ease:["linear","initial",b,ne,te]}],delay:[{delay:[pe,ne,te]}],animate:[{animate:["none",x,ne,te]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,ne,te]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:me()}],"rotate-x":[{"rotate-x":me()}],"rotate-y":[{"rotate-y":me()}],"rotate-z":[{"rotate-z":me()}],scale:[{scale:le()}],"scale-x":[{"scale-x":le()}],"scale-y":[{"scale-y":le()}],"scale-z":[{"scale-z":le()}],"scale-3d":["scale-3d"],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[ne,te,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ge()}],"translate-x":[{"translate-x":ge()}],"translate-y":[{"translate-y":ge()}],"translate-z":[{"translate-z":ge()}],"translate-none":["translate-none"],accent:[{accent:F()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:F()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ne,te]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ne,te]}],fill:[{fill:["none",...F()]}],"stroke-w":[{stroke:[pe,vo,Tr,ru]}],stroke:[{stroke:["none",...F()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Wv=GO(mT);function Of(...e){return Wv(Rf(e))}function Yo(e){return g.jsx("div",{...e,className:Of("rounded-2xl border bg-white shadow-sm",e.className)})}function Xo(e){return g.jsx("div",{...e,className:Of("border-b px-4 py-3",e.className)})}function Jo(e){return g.jsx("div",{...e,className:Of("px-4 py-3",e.className)})}function gT(){const e=ls(),t=Wc(),{register:n,handleSubmit:r,formState:s}=Cf({defaultValues:{email:"admin@example.com",password:"ChangeMe123!"}}),o=r(async i=>{try{const a=await Te.post("/auth/login",i);t.setAuth(a.data.token,a.data.user.email),Ee.success("Logged in"),e({to:"/"})}catch(a){Ee.error(a?.response?.data?.detail??"Login failed")}});return g.jsx("div",{className:"mx-auto max-w-md",children:g.jsxs(Yo,{children:[g.jsxs(Xo,{children:[g.jsx("div",{className:"text-lg font-semibold",children:"Login"}),g.jsx("div",{className:"text-sm text-neutral-600",children:"Use the admin credentials from your backend env."})]}),g.jsx(Jo,{children:g.jsxs("form",{onSubmit:o,className:"space-y-3",children:[g.jsxs("div",{children:[g.jsx("label",{className:"text-sm text-neutral-700",children:"Email"}),g.jsx("input",{className:"mt-1 w-full rounded-xl border px-3 py-2",...n("email",{required:!0})})]}),g.jsxs("div",{children:[g.jsx("label",{className:"text-sm text-neutral-700",children:"Password"}),g.jsx("input",{type:"password",className:"mt-1 w-full rounded-xl border px-3 py-2",...n("password",{required:!0})})]}),g.jsx("button",{disabled:s.isSubmitting,className:"w-full rounded-xl bg-neutral-900 px-3 py-2 text-white hover:bg-neutral-800 disabled:opacity-60",children:s.isSubmitting?"Signing in...":"Sign in"})]})})]})})}function yT(){return g.jsx("div",{className:"flex-1 bg-neutral-50 p-6 dark:bg-neutral-900/40",children:g.jsx(of,{})})}const Hv=()=>ZC(),qv=XC;function lt(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var bT=typeof Symbol=="function"&&Symbol.observable||"@@observable",mm=bT,su=()=>Math.random().toString(36).substring(7).split("").join("."),vT={INIT:`@@redux/INIT${su()}`,REPLACE:`@@redux/REPLACE${su()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${su()}`},Kr=vT;function wi(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function xT(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(ST(e))return"date";if(wT(e))return"error";const n=_T(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function _T(e){return typeof e.constructor=="function"?e.constructor.name:null}function wT(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function ST(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function tr(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=xT(e)),t}function Kv(e,t,n){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?lt(2):`Expected the root reducer to be a function. Instead, received: '${tr(e)}'`);if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?lt(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?lt(1):`Expected the enhancer to be a function. Instead, received: '${tr(n)}'`);return n(Kv)(e,t)}let r=e,s=t,o=new Map,i=o,a=0,c=!1;function l(){i===o&&(i=new Map,o.forEach((y,b)=>{i.set(b,y)}))}function u(){if(c)throw new Error(process.env.NODE_ENV==="production"?lt(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return s}function d(y){if(typeof y!="function")throw new Error(process.env.NODE_ENV==="production"?lt(4):`Expected the listener to be a function. Instead, received: '${tr(y)}'`);if(c)throw new Error(process.env.NODE_ENV==="production"?lt(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let b=!0;l();const x=a++;return i.set(x,y),function(){if(b){if(c)throw new Error(process.env.NODE_ENV==="production"?lt(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");b=!1,l(),i.delete(x),o=null}}}function f(y){if(!wi(y))throw new Error(process.env.NODE_ENV==="production"?lt(7):`Actions must be plain objects. Instead, the actual type was: '${tr(y)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof y.type>"u")throw new Error(process.env.NODE_ENV==="production"?lt(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof y.type!="string")throw new Error(process.env.NODE_ENV==="production"?lt(17):`Action "type" property must be a string. Instead, the actual type was: '${tr(y.type)}'. Value was: '${y.type}' (stringified)`);if(c)throw new Error(process.env.NODE_ENV==="production"?lt(9):"Reducers may not dispatch actions.");try{c=!0,s=r(s,y)}finally{c=!1}return(o=i).forEach(x=>{x()}),y}function h(y){if(typeof y!="function")throw new Error(process.env.NODE_ENV==="production"?lt(10):`Expected the nextReducer to be a function. Instead, received: '${tr(y)}`);r=y,f({type:Kr.REPLACE})}function p(){const y=d;return{subscribe(b){if(typeof b!="object"||b===null)throw new Error(process.env.NODE_ENV==="production"?lt(11):`Expected the observer to be an object. Instead, received: '${tr(b)}'`);function x(){const w=b;w.next&&w.next(u())}return x(),{unsubscribe:y(x)}},[mm](){return this}}}return f({type:Kr.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:h,[mm]:p}}function gm(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function ET(e,t,n,r){const s=Object.keys(t),o=n&&n.type===Kr.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(s.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!wi(e))return`The ${o} has unexpected type of "${tr(e)}". Expected argument to be an object with the following keys: "${s.join('", "')}"`;const i=Object.keys(e).filter(a=>!t.hasOwnProperty(a)&&!r[a]);if(i.forEach(a=>{r[a]=!0}),!(n&&n.type===Kr.REPLACE)&&i.length>0)return`Unexpected ${i.length>1?"keys":"key"} "${i.join('", "')}" found in ${o}. Expected to find one of the known reducer keys instead: "${s.join('", "')}". Unexpected keys will be ignored.`}function kT(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Kr.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?lt(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof n(void 0,{type:Kr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?lt(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${Kr.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}function CT(e){const t=Object.keys(e),n={};for(let i=0;i<t.length;i++){const a=t[i];process.env.NODE_ENV!=="production"&&typeof e[a]>"u"&&gm(`No reducer provided for key "${a}"`),typeof e[a]=="function"&&(n[a]=e[a])}const r=Object.keys(n);let s;process.env.NODE_ENV!=="production"&&(s={});let o;try{kT(n)}catch(i){o=i}return function(a={},c){if(o)throw o;if(process.env.NODE_ENV!=="production"){const d=ET(a,n,c,s);d&&gm(d)}let l=!1;const u={};for(let d=0;d<r.length;d++){const f=r[d],h=n[f],p=a[f],m=h(p,c);if(typeof m>"u"){const y=c&&c.type;throw new Error(process.env.NODE_ENV==="production"?lt(14):`When called with an action of type ${y?`"${String(y)}"`:"(unknown type)"}, the slice reducer for key "${f}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}u[f]=m,l=l||m!==p}return l=l||r.length!==Object.keys(a).length,l?u:a}}function sc(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function RT(...e){return t=>(n,r)=>{const s=t(n,r);let o=()=>{throw new Error(process.env.NODE_ENV==="production"?lt(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const i={getState:s.getState,dispatch:(c,...l)=>o(c,...l)},a=e.map(c=>c(i));return o=sc(...a)(s.dispatch),{...s,dispatch:o}}}function Zv(e){return wi(e)&&"type"in e&&typeof e.type=="string"}var Gv=Symbol.for("immer-nothing"),ym=Symbol.for("immer-draftable"),Ct=Symbol.for("immer-state"),PT=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function Bt(e,...t){if(process.env.NODE_ENV!=="production"){const n=PT[e],r=Lr(n)?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ut=Object,Ks=Ut.getPrototypeOf,oc="constructor",qc="prototype",cd="configurable",ic="enumerable",Ta="writable",Qo="value",Kn=e=>!!e&&!!e[Ct];function hn(e){return e?Yv(e)||Zc(e)||!!e[ym]||!!e[oc]?.[ym]||Gc(e)||Yc(e):!1}var OT=Ut[qc][oc].toString(),bm=new WeakMap;function Yv(e){if(!e||!Tf(e))return!1;const t=Ks(e);if(t===null||t===Ut[qc])return!0;const n=Ut.hasOwnProperty.call(t,oc)&&t[oc];if(n===Object)return!0;if(!Lr(n))return!1;let r=bm.get(n);return r===void 0&&(r=Function.toString.call(n),bm.set(n,r)),r===OT}function Kc(e,t,n=!0){Si(e)===0?(n?Reflect.ownKeys(e):Ut.keys(e)).forEach(s=>{t(s,e[s],e)}):e.forEach((r,s)=>t(s,r,e))}function Si(e){const t=e[Ct];return t?t.type_:Zc(e)?1:Gc(e)?2:Yc(e)?3:0}var vm=(e,t,n=Si(e))=>n===2?e.has(t):Ut[qc].hasOwnProperty.call(e,t),ld=(e,t,n=Si(e))=>n===2?e.get(t):e[t],ac=(e,t,n,r=Si(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function TT(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Zc=Array.isArray,Gc=e=>e instanceof Map,Yc=e=>e instanceof Set,Tf=e=>typeof e=="object",Lr=e=>typeof e=="function",ou=e=>typeof e=="boolean";function MT(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var zn=e=>e.copy_||e.base_,Mf=e=>e.modified_?e.copy_:e.base_;function ud(e,t){if(Gc(e))return new Map(e);if(Yc(e))return new Set(e);if(Zc(e))return Array[qc].slice.call(e);const n=Yv(e);if(t===!0||t==="class_only"&&!n){const r=Ut.getOwnPropertyDescriptors(e);delete r[Ct];let s=Reflect.ownKeys(r);for(let o=0;o<s.length;o++){const i=s[o],a=r[i];a[Ta]===!1&&(a[Ta]=!0,a[cd]=!0),(a.get||a.set)&&(r[i]={[cd]:!0,[Ta]:!0,[ic]:a[ic],[Qo]:e[i]})}return Ut.create(Ks(e),r)}else{const r=Ks(e);if(r!==null&&n)return{...e};const s=Ut.create(r);return Ut.assign(s,e)}}function Af(e,t=!1){return Xc(e)||Kn(e)||!hn(e)||(Si(e)>1&&Ut.defineProperties(e,{set:Zi,add:Zi,clear:Zi,delete:Zi}),Ut.freeze(e),t&&Kc(e,(n,r)=>{Af(r,!0)},!1)),e}function AT(){Bt(2)}var Zi={[Qo]:AT};function Xc(e){return e===null||!Tf(e)?!0:Ut.isFrozen(e)}var cc="MapSet",dd="Patches",xm="ArrayMethods",Xv={};function es(e){const t=Xv[e];return t||Bt(0,e),t}var _m=e=>!!Xv[e],ei,Jv=()=>ei,NT=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:_m(cc)?es(cc):void 0,arrayMethodsPlugin_:_m(xm)?es(xm):void 0});function wm(e,t){t&&(e.patchPlugin_=es(dd),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function fd(e){hd(e),e.drafts_.forEach(DT),e.drafts_=null}function hd(e){e===ei&&(ei=e.parent_)}var Sm=e=>ei=NT(ei,e);function DT(e){const t=e[Ct];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Em(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Ct].modified_&&(fd(t),Bt(4)),hn(e)&&(e=km(t,e));const{patchPlugin_:s}=t;s&&s.generateReplacementPatches_(n[Ct].base_,e,t)}else e=km(t,n);return IT(t,e,!0),fd(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Gv?e:void 0}function km(e,t){if(Xc(t))return t;const n=t[Ct];if(!n)return lc(t,e.handledSet_,e);if(!Jc(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);tx(n,e)}return n.copy_}function IT(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Af(t,n)}function Qv(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Jc=(e,t)=>e.scope_===t,jT=[];function ex(e,t,n,r){const s=zn(e),o=e.type_;if(r!==void 0&&ld(s,r,o)===t){ac(s,r,n,o);return}if(!e.draftLocations_){const a=e.draftLocations_=new Map;Kc(s,(c,l)=>{if(Kn(l)){const u=a.get(l)||[];u.push(c),a.set(l,u)}})}const i=e.draftLocations_.get(t)??jT;for(const a of i)ac(s,a,n,o)}function LT(e,t,n){e.callbacks_.push(function(s){const o=t;if(!o||!Jc(o,s))return;s.mapSetPlugin_?.fixSetContents(o);const i=Mf(o);ex(e,o.draft_??o,i,n),tx(o,s)})}function tx(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:r}=t;if(r){const s=r.getPath(e);s&&r.generatePatches_(e,s,t)}Qv(e)}}function FT(e,t,n){const{scope_:r}=e;if(Kn(n)){const s=n[Ct];Jc(s,r)&&s.callbacks_.push(function(){Ma(e);const i=Mf(s);ex(e,n,i,t)})}else hn(n)&&e.callbacks_.push(function(){const o=zn(e);e.type_===3?o.has(n)&&lc(n,r.handledSet_,r):ld(o,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&lc(ld(e.copy_,t,e.type_),r.handledSet_,r)})}function lc(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Kn(e)||t.has(e)||!hn(e)||Xc(e)||(t.add(e),Kc(e,(r,s)=>{if(Kn(s)){const o=s[Ct];if(Jc(o,n)){const i=Mf(o);ac(e,r,i,e.type_),Qv(o)}}else hn(s)&&lc(s,t,n)})),e}function zT(e,t){const n=Zc(e),r={type_:n?1:0,scope_:t?t.scope_:Jv(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let s=r,o=uc;n&&(s=[r],o=ti);const{revoke:i,proxy:a}=Proxy.revocable(s,o);return r.draft_=a,r.revoke_=i,[a,r]}var uc={get(e,t){if(t===Ct)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const s=zn(e);if(!vm(s,t,e.type_))return $T(e,s,t);const o=s[t];if(e.finalized_||!hn(o)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&MT(t))return o;if(o===iu(e.base_,t)){Ma(e);const i=e.type_===1?+t:t,a=md(e.scope_,o,e,i);return e.copy_[i]=a}return o},has(e,t){return t in zn(e)},ownKeys(e){return Reflect.ownKeys(zn(e))},set(e,t,n){const r=nx(zn(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const s=iu(zn(e),t),o=s?.[Ct];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(TT(n,s)&&(n!==void 0||vm(e.base_,t,e.type_)))return!0;Ma(e),pd(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),FT(e,t,n)),!0},deleteProperty(e,t){return Ma(e),iu(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),pd(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=zn(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Ta]:!0,[cd]:e.type_!==1||t!=="length",[ic]:r[ic],[Qo]:n[t]}},defineProperty(){Bt(11)},getPrototypeOf(e){return Ks(e.base_)},setPrototypeOf(){Bt(12)}},ti={};for(let e in uc){let t=uc[e];ti[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}ti.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Bt(13),ti.set.call(this,e,t,void 0)};ti.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Bt(14),uc.set.call(this,e[0],t,n,e[0])};function iu(e,t){const n=e[Ct];return(n?zn(n):e)[t]}function $T(e,t,n){const r=nx(t,n);return r?Qo in r?r[Qo]:r.get?.call(e.draft_):void 0}function nx(e,t){if(!(t in e))return;let n=Ks(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Ks(n)}}function pd(e){e.modified_||(e.modified_=!0,e.parent_&&pd(e.parent_))}function Ma(e){e.copy_||(e.assigned_=new Map,e.copy_=ud(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var VT=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,r)=>{if(Lr(t)&&!Lr(n)){const o=n;n=t;const i=this;return function(c=o,...l){return i.produce(c,u=>n.call(this,u,...l))}}Lr(n)||Bt(6),r!==void 0&&!Lr(r)&&Bt(7);let s;if(hn(t)){const o=Sm(this),i=md(o,t,void 0);let a=!0;try{s=n(i),a=!1}finally{a?fd(o):hd(o)}return wm(o,r),Em(s,o)}else if(!t||!Tf(t)){if(s=n(t),s===void 0&&(s=t),s===Gv&&(s=void 0),this.autoFreeze_&&Af(s,!0),r){const o=[],i=[];es(dd).generateReplacementPatches_(t,s,{patches_:o,inversePatches_:i}),r(o,i)}return s}else Bt(1,t)},this.produceWithPatches=(t,n)=>{if(Lr(t))return(i,...a)=>this.produceWithPatches(i,c=>t(c,...a));let r,s;return[this.produce(t,n,(i,a)=>{r=i,s=a}),r,s]},ou(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),ou(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),ou(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){hn(e)||Bt(8),Kn(e)&&(e=BT(e));const t=Sm(this),n=md(t,e,void 0);return n[Ct].isManual_=!0,hd(t),n}finishDraft(e,t){const n=e&&e[Ct];(!n||!n.isManual_)&&Bt(9);const{scope_:r}=n;return wm(r,t),Em(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const s=t[n];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}n>-1&&(t=t.slice(n+1));const r=es(dd).applyPatches_;return Kn(e)?r(e,t):this.produce(e,s=>r(s,t))}};function md(e,t,n,r){const[s,o]=Gc(t)?es(cc).proxyMap_(t,n):Yc(t)?es(cc).proxySet_(t,n):zT(t,n);return(n?.scope_??Jv()).drafts_.push(s),o.callbacks_=n?.callbacks_??[],o.key_=r,n&&r!==void 0?LT(n,o,r):o.callbacks_.push(function(c){c.mapSetPlugin_?.fixSetContents(o);const{patchPlugin_:l}=c;o.modified_&&l&&l.generatePatches_(o,[],c)}),s}function BT(e){return Kn(e)||Bt(10,e),rx(e)}function rx(e){if(!hn(e)||Xc(e))return e;const t=e[Ct];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=ud(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=ud(e,!0);return Kc(n,(s,o)=>{ac(n,s,rx(o))},r),t&&(t.finalized_=!1),n}var UT=new VT,sx=UT.produce;function ox(e){return({dispatch:n,getState:r})=>s=>o=>typeof o=="function"?o(n,r,e):s(o)}var WT=ox(),HT=ox,qT=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?sc:sc.apply(null,arguments)},ix=e=>e&&typeof e.match=="function";function $o(e,t){function n(...r){if(t){let s=t(...r);if(!s)throw new Error(process.env.NODE_ENV==="production"?Oe(0):"prepareAction did not return an object");return{type:e,payload:s.payload,..."meta"in s&&{meta:s.meta},..."error"in s&&{error:s.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>Zv(r)&&r.type===e,n}function KT(e){return typeof e=="function"&&"type"in e&&ix(e)}function ZT(e){const t=e?`${e}`.split("/"):[],n=t[t.length-1]||"actionCreator";return`Detected an action creator with type "${e||"unknown"}" being dispatched.
|
|
14
|
-
Make sure you're calling the action creator before dispatching, i.e. \`dispatch(${n}())\` instead of \`dispatch(${n})\`. This is necessary even if the action has no payload.`}function
|
|
6
|
+
<%s key={someKey} {...props} />`,Z,F,ee,F),se[F+Z]=!0)}if(F=null,W!==void 0&&(n(W),F=""+W),i(Q)&&(n(Q.key),F=""+Q.key),"key"in Q){W={};for(var pe in Q)pe!=="key"&&(W[pe]=Q[pe])}else W=Q;return F&&a(W,typeof N=="function"?N.displayName||N.name||"Unknown":N),l(N,F,W,o(),ie,fe)}function u(N){f(N)?N._store&&(N._store.validated=1):typeof N=="object"&&N!==null&&N.$$typeof===A&&(N._payload.status==="fulfilled"?f(N._payload.value)&&N._payload.value._store&&(N._payload.value._store.validated=1):N._store&&(N._store.validated=1))}function f(N){return typeof N=="object"&&N!==null&&N.$$typeof===m}var h=k,m=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),x=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),B=Symbol.for("react.client.reference"),M=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=Object.prototype.hasOwnProperty,V=Array.isArray,Y=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(N){return N()}};var L,K={},D=h.react_stack_bottom_frame.bind(h,s)(),H=Y(r(s)),se={};Lr.Fragment=v,Lr.jsx=function(N,Q,W){var Z=1e4>M.recentlyCreatedOwnerStacks++;return d(N,Q,W,!1,Z?Error("react-stack-top-frame"):D,Z?Y(r(N)):H)},Lr.jsxs=function(N,Q,W){var Z=1e4>M.recentlyCreatedOwnerStacks++;return d(N,Q,W,!0,Z?Error("react-stack-top-frame"):D,Z?Y(r(N)):H)}})()),Lr}var eu;function sv(){return eu||(eu=1,process.env.NODE_ENV==="production"?Lo.exports=rv():Lo.exports=ov()),Lo.exports}var p=sv();const za=new WeakMap,iv=new WeakMap,xs={current:[]};let Ki=!1,Jr=0;const Zr=new Set,Fo=new Map;function qf(e){for(const t of e){if(xs.current.includes(t))continue;xs.current.push(t),t.recompute();const n=iv.get(t);if(n)for(const r of n){const o=za.get(r);o?.length&&qf(o)}}}function av(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function cv(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Gf(e){if(Jr>0&&!Fo.has(e)&&Fo.set(e,e.prevState),Zr.add(e),!(Jr>0)&&!Ki)try{for(Ki=!0;Zr.size>0;){const t=Array.from(Zr);Zr.clear();for(const n of t){const r=Fo.get(n)??n.prevState;n.prevState=r,av(n)}for(const n of t){const r=za.get(n);r&&(xs.current.push(n),qf(r))}for(const n of t){const r=za.get(n);if(r)for(const o of r)cv(o)}}}finally{Ki=!1,xs.current=[],Fo.clear()}}function lv(e){Jr++;try{e()}finally{if(Jr--,Jr===0){const t=Zr.values().next().value;t&&Gf(t)}}}function uv(e){return typeof e=="function"}class dv{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var o,s;this.listeners.add(r);const i=(s=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:s.call(o,r,this);return()=>{this.listeners.delete(r),i?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,r,o;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):uv(t)?this.state=t(this.prevState):this.state=t,(o=(r=this.options)==null?void 0:r.onUpdate)==null||o.call(r),Gf(this)}}const vn="__TSR_index",tu="popstate",nu="beforeunload";function fv(e){let t=e.getLocation();const n=new Set,r=i=>{t=e.getLocation(),n.forEach(a=>a({location:t,action:i}))},o=i=>{e.notifyOnIndexChange??!0?r(i):t=e.getLocation()},s=async({task:i,navigateOpts:a,...c})=>{if(a?.ignoreBlocker??!1){i();return}const d=e.getBlockers?.()??[],u=c.type==="PUSH"||c.type==="REPLACE";if(typeof document<"u"&&d.length&&u)for(const f of d){const h=_s(c.path,c.state);if(await f.blockerFn({currentLocation:t,nextLocation:h,action:c.type})){e.onBlocked?.();return}}i()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:i=>(n.add(i),()=>{n.delete(i)}),push:(i,a,c)=>{const l=t.state[vn];a=ru(l+1,a),s({task:()=>{e.pushState(i,a),r({type:"PUSH"})},navigateOpts:c,type:"PUSH",path:i,state:a})},replace:(i,a,c)=>{const l=t.state[vn];a=ru(l,a),s({task:()=>{e.replaceState(i,a),r({type:"REPLACE"})},navigateOpts:c,type:"REPLACE",path:i,state:a})},go:(i,a)=>{s({task:()=>{e.go(i),o({type:"GO",index:i})},navigateOpts:a,type:"GO"})},back:i=>{s({task:()=>{e.back(i?.ignoreBlocker??!1),o({type:"BACK"})},navigateOpts:i,type:"BACK"})},forward:i=>{s({task:()=>{e.forward(i?.ignoreBlocker??!1),o({type:"FORWARD"})},navigateOpts:i,type:"FORWARD"})},canGoBack:()=>t.state[vn]!==0,createHref:i=>e.createHref(i),block:i=>{if(!e.setBlockers)return()=>{};const a=e.getBlockers?.()??[];return e.setBlockers([...a,i]),()=>{const c=e.getBlockers?.()??[];e.setBlockers?.(c.filter(l=>l!==i))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function ru(e,t){t||(t={});const n=jc();return{...t,key:n,__TSR_key:n,[vn]:e}}function hv(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let o=[];const s=()=>o,i=E=>o=E,a=(E=>E),c=(()=>_s(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const E=jc();t.history.replaceState({[vn]:0,key:E,__TSR_key:E},"")}let l=c(),d,u=!1,f=!1,h=!1,m=!1;const g=()=>l;let v,b;const _=()=>{v&&(C._ignoreSubscribers=!0,(v.isPush?t.history.pushState:t.history.replaceState)(v.state,"",v.href),C._ignoreSubscribers=!1,v=void 0,b=void 0,d=void 0)},w=(E,A,U)=>{const B=a(A);b||(d=l),l=_s(A,U),v={href:B,state:U,isPush:v?.isPush||E==="push"},b||(b=Promise.resolve().then(()=>_()))},x=E=>{l=c(),C.notify({type:E})},S=async()=>{if(f){f=!1;return}const E=c(),A=E.state[vn]-l.state[vn],U=A===1,B=A===-1,M=!U&&!B||u;u=!1;const j=M?"GO":B?"BACK":"FORWARD",V=M?{type:"GO",index:A}:{type:B?"BACK":"FORWARD"};if(h)h=!1;else{const Y=s();if(typeof document<"u"&&Y.length){for(const L of Y)if(await L.blockerFn({currentLocation:l,nextLocation:E,action:j})){f=!0,t.history.go(1),C.notify(V);return}}}l=c(),C.notify(V)},P=E=>{if(m){m=!1;return}let A=!1;const U=s();if(typeof document<"u"&&U.length)for(const B of U){const M=B.enableBeforeUnload??!0;if(M===!0){A=!0;break}if(typeof M=="function"&&M()===!0){A=!0;break}}if(A)return E.preventDefault(),E.returnValue=""},C=fv({getLocation:g,getLength:()=>t.history.length,pushState:(E,A)=>w("push",E,A),replaceState:(E,A)=>w("replace",E,A),back:E=>(E&&(h=!0),m=!0,t.history.back()),forward:E=>{E&&(h=!0),m=!0,t.history.forward()},go:E=>{u=!0,t.history.go(E)},createHref:E=>a(E),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(nu,P,{capture:!0}),t.removeEventListener(tu,S)},onBlocked:()=>{d&&l!==d&&(l=d)},getBlockers:s,setBlockers:i,notifyOnIndexChange:!1});return t.addEventListener(nu,P,{capture:!0}),t.addEventListener(tu,S),t.history.pushState=function(...E){const A=n.apply(t.history,E);return C._ignoreSubscribers||x("PUSH"),A},t.history.replaceState=function(...E){const A=r.apply(t.history,E);return C._ignoreSubscribers||x("REPLACE"),A},C}function pv(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function _s(e,t){const n=pv(e),r=n.indexOf("#"),o=n.indexOf("?"),s=jc();return{href:n,pathname:n.substring(0,r>0?o>0?Math.min(r,o):r:o>0?o:n.length),hash:r>-1?n.substring(r):"",search:o>-1?n.slice(o,r===-1?void 0:r):"",state:t||{[vn]:0,key:s,__TSR_key:s}}}function jc(){return(Math.random()+1).toString(36).substring(7)}const mv=!1;function Qr(e){let t;return lv(()=>{t=e()}),t}function no(e){return e[e.length-1]}function gv(e){return typeof e=="function"}function gn(e,t){return gv(e)?e(t):e}const yv=Object.prototype.hasOwnProperty,ou=Object.prototype.propertyIsEnumerable;function tt(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=t,o=au(e)&&au(r);if(!o&&!(Ss(e)&&Ss(r)))return r;const s=o?e:su(e);if(!s)return r;const i=o?r:su(r);if(!i)return r;const a=s.length,c=i.length,l=o?new Array(c):{};let d=0;for(let u=0;u<c;u++){const f=o?u:i[u],h=e[f],m=r[f];if(h===m){l[f]=h,(o?u<a:yv.call(e,f))&&d++;continue}if(h===null||m===null||typeof h!="object"||typeof m!="object"){l[f]=m;continue}const g=tt(h,m,n+1);l[f]=g,g===h&&d++}return a===c&&d===a?e:l}function su(e){const t=Object.getOwnPropertyNames(e);for(const o of t)if(!ou.call(e,o))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const o of n){if(!ou.call(e,o))return!1;r.push(o)}return r}function Ss(e){if(!iu(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!iu(n)||!n.hasOwnProperty("isPrototypeOf"))}function iu(e){return Object.prototype.toString.call(e)==="[object Object]"}function au(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function $n(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,o=e.length;r<o;r++)if(!$n(e[r],t[r],n))return!1;return!0}if(Ss(e)&&Ss(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const i in t)if((!r||t[i]!==void 0)&&!$n(e[i],t[i],n))return!1;return!0}let o=0;if(!r)o=Object.keys(e).length;else for(const i in e)e[i]!==void 0&&o++;let s=0;for(const i in t)if((!r||t[i]!==void 0)&&(s++,s>o||!$n(e[i],t[i],n)))return!1;return o===s}return!1}function xr(e){let t,n;const r=new Promise((o,s)=>{t=o,n=s});return r.status="pending",r.resolve=o=>{r.status="resolved",r.value=o,t(o),e?.(o)},r.reject=o=>{r.status="rejected",n(o)},r}function gr(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function cu(e,t){for(let n=e.length-1;n>=0;n--){const r=e[n];if(t(r))return r}}function vv(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function lu(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return vv(t)}const Yf=["http:","https:","mailto:","tel:"];function Es(e){if(!e)return!1;try{const t=new URL(e);return!Yf.includes(t.protocol)}catch{return!1}}function Fr(e,t){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return e;const n=/%25|%5C/gi;let r=0,o="",s;for(;(s=n.exec(e))!==null;)o+=lu(e.slice(r,s.index))+s[0],r=n.lastIndex;return o=o+lu(r?e.slice(r):e),o.startsWith("//")&&(o="/"+o.replace(/^\/+/,"")),o}function bv(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var wv=process.env.NODE_ENV==="production",qi="Invariant failed";function on(e,t){if(!e){if(wv)throw new Error(qi);var n=typeof t=="function"?t():t,r=n?"".concat(qi,": ").concat(n):qi;throw new Error(r)}}function Cs(e){const t=new Map;let n,r;const o=s=>{s.next&&(s.prev?(s.prev.next=s.next,s.next.prev=s.prev,s.next=void 0,r&&(r.next=s,s.prev=r)):(s.next.prev=void 0,n=s.next,s.next=void 0,r&&(s.prev=r,r.next=s)),r=s)};return{get(s){const i=t.get(s);if(i)return o(i),i.value},set(s,i){if(t.size>=e&&n){const c=n;t.delete(c.key),c.next&&(n=c.next,c.next.prev=void 0),c===r&&(r=void 0)}const a=t.get(s);if(a)a.value=i,o(a);else{const c={key:s,value:i,prev:r};r&&(r.next=c),r=c,n||(n=c),t.set(s,c)}},clear(){t.clear(),n=void 0,r=void 0}}}const _r=0,Bn=1,Wn=2,ro=3,In=4,Jf=5;function xv(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function Lc(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),o=r===-1?e.length:r,s=e.substring(t,o);if(!s||!s.includes("$"))return n[0]=_r,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n;if(s==="$"){const a=e.length;return n[0]=Wn,n[1]=t,n[2]=t,n[3]=a,n[4]=a,n[5]=a,n}if(s.charCodeAt(0)===36)return n[0]=Bn,n[1]=t,n[2]=t+1,n[3]=o,n[4]=o,n[5]=o,n;const i=xv(s);if(i){const[a,c]=i,l=s.charCodeAt(a+1);if(l===45){if(a+2<s.length&&s.charCodeAt(a+2)===36){const d=a+3,u=c;if(d<u)return n[0]=ro,n[1]=t+a,n[2]=t+d,n[3]=t+u,n[4]=t+c+1,n[5]=o,n}}else if(l===36){const d=a+1,u=a+2;return u===c?(n[0]=Wn,n[1]=t+a,n[2]=t+d,n[3]=t+u,n[4]=t+c+1,n[5]=e.length,n):(n[0]=Bn,n[1]=t+a,n[2]=t+u,n[3]=t+c,n[4]=t+c+1,n[5]=o,n)}}return n[0]=_r,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n}function oi(e,t,n,r,o,s,i){i?.(n);let a=r;{const c=n.fullPath??n.from,l=c.length,d=n.options?.caseSensitive??e,u=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;a<l;){const h=Lc(c,a,t);let m;const g=a,v=h[5];switch(a=v+1,s++,h[0]){case _r:{const _=c.substring(h[2],h[3]);if(d){const w=o.static?.get(_);if(w)m=w;else{o.static??=new Map;const x=Mn(n.fullPath??n.from);x.parent=o,x.depth=s,m=x,o.static.set(_,x)}}else{const w=_.toLowerCase(),x=o.staticInsensitive?.get(w);if(x)m=x;else{o.staticInsensitive??=new Map;const S=Mn(n.fullPath??n.from);S.parent=o,S.depth=s,m=S,o.staticInsensitive.set(w,S)}}break}case Bn:{const _=c.substring(g,h[1]),w=c.substring(h[4],v),x=d&&!!(_||w),S=_?x?_:_.toLowerCase():void 0,P=w?x?w:w.toLowerCase():void 0,C=!u&&o.dynamic?.find(E=>!E.skipOnParamError&&E.caseSensitive===x&&E.prefix===S&&E.suffix===P);if(C)m=C;else{const E=Yi(Bn,n.fullPath??n.from,x,S,P);m=E,E.depth=s,E.parent=o,o.dynamic??=[],o.dynamic.push(E)}break}case ro:{const _=c.substring(g,h[1]),w=c.substring(h[4],v),x=d&&!!(_||w),S=_?x?_:_.toLowerCase():void 0,P=w?x?w:w.toLowerCase():void 0,C=!u&&o.optional?.find(E=>!E.skipOnParamError&&E.caseSensitive===x&&E.prefix===S&&E.suffix===P);if(C)m=C;else{const E=Yi(ro,n.fullPath??n.from,x,S,P);m=E,E.parent=o,E.depth=s,o.optional??=[],o.optional.push(E)}break}case Wn:{const _=c.substring(g,h[1]),w=c.substring(h[4],v),x=d&&!!(_||w),S=_?x?_:_.toLowerCase():void 0,P=w?x?w:w.toLowerCase():void 0,C=Yi(Wn,n.fullPath??n.from,x,S,P);m=C,C.parent=o,C.depth=s,o.wildcard??=[],o.wildcard.push(C)}}o=m}if(u&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const h=Mn(n.fullPath??n.from);h.kind=Jf,h.parent=o,s++,h.depth=s,o.pathless??=[],o.pathless.push(h),o=h}const f=(n.path||!n.children)&&!n.isRoot;if(f&&c.endsWith("/")){const h=Mn(n.fullPath??n.from);h.kind=In,h.parent=o,s++,h.depth=s,o.index=h,o=h}o.parse=n.options?.params?.parse??null,o.skipOnParamError=u,o.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,f&&!o.route&&(o.route=n,o.fullPath=n.fullPath??n.from)}if(n.children)for(const c of n.children)oi(e,t,c,a,o,s,i)}function Gi(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function mn(e){if(e.pathless)for(const t of e.pathless)mn(t);if(e.static)for(const t of e.static.values())mn(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())mn(t);if(e.dynamic?.length){e.dynamic.sort(Gi);for(const t of e.dynamic)mn(t)}if(e.optional?.length){e.optional.sort(Gi);for(const t of e.optional)mn(t)}if(e.wildcard?.length){e.wildcard.sort(Gi);for(const t of e.wildcard)mn(t)}}function Mn(e){return{kind:_r,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Yi(e,t,n,r,o){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:o}}function _v(e,t){const n=Mn("/"),r=new Uint16Array(6);for(const o of e)oi(!1,r,o,1,n,0);mn(n),t.masksTree=n,t.flatCache=Cs(1e3)}function Sv(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=Fc(e,t.masksTree);return t.flatCache.set(e,r),r}function Ev(e,t,n,r,o){e||="/",r||="/";const s=t?`case\0${e}`:e;let i=o.singleCache.get(s);if(!i){i=Mn("/");const a=new Uint16Array(6);oi(t,a,{from:e},1,i,0),o.singleCache.set(s,i)}return Fc(r,i,n)}function Cv(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,o=t.matchCache.get(r);if(o!==void 0)return o;e||="/";let s;try{s=Fc(e,t.segmentTree,n)}catch(i){if(i instanceof URIError)s=null;else throw i}return s&&(s.branch=Ov(s.route)),t.matchCache.set(r,s),s}function Rv(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Pv(e,t=!1,n){const r=Mn(e.fullPath),o=new Uint16Array(6),s={},i={};let a=0;return oi(t,o,e,1,r,0,l=>{if(n?.(l,a),on(!(l.id in s),`Duplicate routes found with id: ${String(l.id)}`),s[l.id]=l,a!==0&&l.path){const d=Rv(l.fullPath);(!i[d]||l.fullPath.endsWith("/"))&&(i[d]=l)}a++}),mn(r),{processedTree:{segmentTree:r,singleCache:Cs(1e3),matchCache:Cs(1e3),flatCache:null,masksTree:null},routesById:s,routesByPath:i}}function Fc(e,t,n=!1){const r=e.split("/"),o=Nv(e,r,t,n);if(!o)return null;const[s]=Qf(e,r,o);return{route:o.node.route,rawParams:s,parsedParams:o.parsedParams}}function Qf(e,t,n){const r=kv(n.node);let o=null;const s={};let i=n.extract?.part??0,a=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;a<r.length;i++,a++,c++,l++){const d=r[a];if(d.kind===In)break;if(d.kind===Jf){l--,i--,c--;continue}const u=t[i],f=c;if(u&&(c+=u.length),d.kind===Bn){o??=n.node.fullPath.split("/");const h=o[l],m=d.prefix?.length??0;if(h.charCodeAt(m)===123){const v=d.suffix?.length??0,b=h.substring(m+2,h.length-v-1),_=u.substring(m,u.length-v);s[b]=decodeURIComponent(_)}else{const v=h.substring(1);s[v]=decodeURIComponent(u)}}else if(d.kind===ro){if(n.skipped&1<<a){i--,c=f-1;continue}o??=n.node.fullPath.split("/");const h=o[l],m=d.prefix?.length??0,g=d.suffix?.length??0,v=h.substring(m+3,h.length-g-1),b=d.suffix||d.prefix?u.substring(m,u.length-g):u;b&&(s[v]=decodeURIComponent(b))}else if(d.kind===Wn){const h=d,m=e.substring(f+(h.prefix?.length??0),e.length-(h.suffix?.length??0)),g=decodeURIComponent(m);s["*"]=g,s._splat=g;break}}return n.rawParams&&Object.assign(s,n.rawParams),[s,{part:i,node:a,path:c,segment:l}]}function Ov(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function kv(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Nv(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const o=!no(t),s=o&&e!=="/",i=t.length-(o?1:0),a=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let c=null,l=null,d=null;for(;a.length;){const u=a.pop(),{node:f,index:h,skipped:m,depth:g,statics:v,dynamics:b,optionals:_}=u;let{extract:w,rawParams:x,parsedParams:S}=u;if(f.skipOnParamError){if(!Ji(e,t,u))continue;x=u.rawParams,w=u.extract,S=u.parsedParams}r&&f.route&&f.kind!==In&&$r(l,u)&&(l=u);const P=h===i;if(P&&(f.route&&!s&&$r(d,u)&&(d=u),!f.optional&&!f.wildcard&&!f.index&&!f.pathless))continue;const C=P?void 0:t[h];let E;if(P&&f.index){const A={node:f.index,index:h,skipped:m,depth:g+1,statics:v,dynamics:b,optionals:_,extract:w,rawParams:x,parsedParams:S};let U=!0;if(f.index.skipOnParamError&&(Ji(e,t,A)||(U=!1)),U){if(v===i&&!b&&!_&&!m)return A;$r(d,A)&&(d=A)}}if(f.wildcard&&$r(c,u))for(const A of f.wildcard){const{prefix:U,suffix:B}=A;if(U&&(P||!(A.caseSensitive?C:E??=C.toLowerCase()).startsWith(U)))continue;if(B){if(P)continue;const j=t.slice(h).join("/").slice(-B.length);if((A.caseSensitive?j:j.toLowerCase())!==B)continue}const M={node:A,index:i,skipped:m,depth:g,statics:v,dynamics:b,optionals:_,extract:w,rawParams:x,parsedParams:S};if(!(A.skipOnParamError&&!Ji(e,t,M))){c=M;break}}if(f.optional){const A=m|1<<g,U=g+1;for(let B=f.optional.length-1;B>=0;B--){const M=f.optional[B];a.push({node:M,index:h,skipped:A,depth:U,statics:v,dynamics:b,optionals:_,extract:w,rawParams:x,parsedParams:S})}if(!P)for(let B=f.optional.length-1;B>=0;B--){const M=f.optional[B],{prefix:j,suffix:V}=M;if(j||V){const Y=M.caseSensitive?C:E??=C.toLowerCase();if(j&&!Y.startsWith(j)||V&&!Y.endsWith(V))continue}a.push({node:M,index:h+1,skipped:m,depth:U,statics:v,dynamics:b,optionals:_+1,extract:w,rawParams:x,parsedParams:S})}}if(!P&&f.dynamic&&C)for(let A=f.dynamic.length-1;A>=0;A--){const U=f.dynamic[A],{prefix:B,suffix:M}=U;if(B||M){const j=U.caseSensitive?C:E??=C.toLowerCase();if(B&&!j.startsWith(B)||M&&!j.endsWith(M))continue}a.push({node:U,index:h+1,skipped:m,depth:g+1,statics:v,dynamics:b+1,optionals:_,extract:w,rawParams:x,parsedParams:S})}if(!P&&f.staticInsensitive){const A=f.staticInsensitive.get(E??=C.toLowerCase());A&&a.push({node:A,index:h+1,skipped:m,depth:g+1,statics:v+1,dynamics:b,optionals:_,extract:w,rawParams:x,parsedParams:S})}if(!P&&f.static){const A=f.static.get(C);A&&a.push({node:A,index:h+1,skipped:m,depth:g+1,statics:v+1,dynamics:b,optionals:_,extract:w,rawParams:x,parsedParams:S})}if(f.pathless){const A=g+1;for(let U=f.pathless.length-1;U>=0;U--){const B=f.pathless[U];a.push({node:B,index:h,skipped:m,depth:A,statics:v,dynamics:b,optionals:_,extract:w,rawParams:x,parsedParams:S})}}}if(d&&c)return $r(c,d)?d:c;if(d)return d;if(c)return c;if(r&&l){let u=l.index;for(let h=0;h<l.index;h++)u+=t[h].length;const f=u===e.length?"/":e.slice(u);return l.rawParams??={},l.rawParams["**"]=decodeURIComponent(f),l}return null}function Ji(e,t,n){try{const[r,o]=Qf(e,t,n);n.rawParams=r,n.extract=o;const s=n.node.parse(r);return n.parsedParams=Object.assign({},n.parsedParams,s),!0}catch{return null}}function $r(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===In)>(e.node.kind===In)||t.node.kind===In==(e.node.kind===In)&&t.depth>e.depth))):!0}function us(e){return $c(e.filter(t=>t!==void 0).join("/"))}function $c(e){return e.replace(/\/{2,}/g,"/")}function Xf(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function nn(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function eh(e){return nn(Xf(e))}function Rs(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function Tv(e,t,n){return Rs(e,n)===Rs(t,n)}function Av({base:e,to:t,trailingSlash:n="never",cache:r}){const o=t.startsWith("/"),s=!o&&t===".";let i;if(r){i=o?t:s?e:e+"\0"+t;const u=r.get(i);if(u)return u}let a;if(s)a=e.split("/");else if(o)a=t.split("/");else{for(a=e.split("/");a.length>1&&no(a)==="";)a.pop();const u=t.split("/");for(let f=0,h=u.length;f<h;f++){const m=u[f];m===""?f?f===h-1&&a.push(m):a=[m]:m===".."?a.pop():m==="."||a.push(m)}}a.length>1&&(no(a)===""?n==="never"&&a.pop():n==="always"&&a.push(""));let c,l="";for(let u=0;u<a.length;u++){u>0&&(l+="/");const f=a[u];if(!f)continue;c=Lc(f,0,c);const h=c[0];if(h===_r){l+=f;continue}const m=c[5],g=f.substring(0,c[1]),v=f.substring(c[4],m),b=f.substring(c[2],c[3]);h===Bn?l+=g||v?`${g}{$${b}}${v}`:`$${b}`:h===Wn?l+=g||v?`${g}{$}${v}`:"$":l+=`${g}{-$${b}}${v}`}l=$c(l);const d=l||"/";return i&&r&&r.set(i,d),d}function Iv(e){const t=new Map(e.map(o=>[encodeURIComponent(o),o])),n=Array.from(t.keys()).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return o=>o.replace(r,s=>t.get(s)??s)}function Qi(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(o=>uu(o,n)).join("/"):uu(r,n)}function Xi({path:e,params:t,decoder:n,server:r}){let o=!1;const s={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:s,isMissingParams:o};if(!e.includes("$"))return{interpolatedPath:e,usedParams:s,isMissingParams:o};const i=e.length;let a=0,c,l="";for(;a<i;){const u=a;c=Lc(e,u,c);const f=c[5];if(a=f+1,u===f)continue;const h=c[0];if(h===_r){l+="/"+e.substring(u,f);continue}if(h===Wn){const m=t._splat;s._splat=m,s["*"]=m;const g=e.substring(u,c[1]),v=e.substring(c[4],f);if(!m){o=!0,(g||v)&&(l+="/"+g+v);continue}const b=Qi("_splat",t,n);l+="/"+g+b+v;continue}if(h===Bn){const m=e.substring(c[2],c[3]);!o&&!(m in t)&&(o=!0),s[m]=t[m];const g=e.substring(u,c[1]),v=e.substring(c[4],f),b=Qi(m,t,n)??"undefined";l+="/"+g+b+v;continue}if(h===ro){const m=e.substring(c[2],c[3]),g=t[m];if(g==null)continue;s[m]=g;const v=e.substring(u,c[1]),b=e.substring(c[4],f),_=Qi(m,t,n)??"";l+="/"+v+_+b;continue}}return e.endsWith("/")&&(l+="/"),{usedParams:s,interpolatedPath:l||"/",isMissingParams:o}}function uu(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function pt(e){return!!e?.isNotFound}function Mv(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Va="tsr-scroll-restoration-v1_3",Dv=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function jv(){const e=Mv();if(!e)return null;const t=e.getItem(Va);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=gn(r,n)||n;try{e.setItem(Va,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const $o=jv(),Lv=e=>e.state.__TSR_key||e.href;function Fv(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let Ps=!1;function $v({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:o,location:s}){let i;try{i=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(l){console.error(l);return}const a=t||window.history.state?.__TSR_key,c=i[a];Ps=!0;e:{if(r&&c&&Object.keys(c).length>0){for(const u in c){const f=c[u];if(u==="window")window.scrollTo({top:f.scrollY,left:f.scrollX,behavior:n});else if(u){const h=document.querySelector(u);h&&(h.scrollLeft=f.scrollX,h.scrollTop=f.scrollY)}}break e}const l=(s??window.location).hash.split("#",2)[1];if(l){const u=window.history.state?.__hashScrollIntoViewOptions??!0;if(u){const f=document.getElementById(l);f&&f.scrollIntoView(u)}break e}const d={top:0,left:0,behavior:n};if(window.scrollTo(d),o)for(const u of o){if(u==="window")continue;const f=typeof u=="function"?u():document.querySelector(u);f&&f.scrollTo(d)}}Ps=!1}function zv(e,t){if(!$o||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!$o))return;e.isScrollRestorationSetup=!0,Ps=!1;const r=e.options.getScrollRestorationKey||Lv;window.history.scrollRestoration="manual";const o=s=>{if(Ps||!e.isScrollRestoring)return;let i="";if(s.target===document||s.target===window)i="window";else{const c=s.target.getAttribute("data-scroll-restoration-id");c?i=`[data-scroll-restoration-id="${c}"]`:i=Fv(s.target)}const a=r(e.state.location);$o.set(c=>{const l=c[a]||={},d=l[i]||={};if(i==="window")d.scrollX=window.scrollX||0,d.scrollY=window.scrollY||0;else if(i){const u=document.querySelector(i);u&&(d.scrollX=u.scrollLeft||0,d.scrollY=u.scrollTop||0)}return c})};typeof document<"u"&&document.addEventListener("scroll",Dv(o,100),!0),e.subscribe("onRendered",s=>{const i=r(s.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||($v({storageKey:Va,key:i,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&$o.set(a=>(a[i]||={},a)))})}function Vv(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function Uv(e,t=String){const n=new URLSearchParams;for(const r in e){const o=e[r];o!==void 0&&n.set(r,t(o))}return n.toString()}function ea(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function Bv(e){const t=new URLSearchParams(e),n={};for(const[r,o]of t.entries()){const s=n[r];s==null?n[r]=ea(o):Array.isArray(s)?s.push(ea(o)):n[r]=[s,ea(o)]}return n}const Wv=Zv(JSON.parse),Hv=Kv(JSON.stringify,JSON.parse);function Zv(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=Bv(t);for(const r in n){const o=n[r];if(typeof o=="string")try{n[r]=e(o)}catch{}}return n}}function Kv(e,t){const n=typeof t=="function";function r(o){if(typeof o=="object"&&o!==null)try{return e(o)}catch{}else if(n&&typeof o=="string")try{return t(o),e(o)}catch{}return o}return o=>{const s=Uv(o,r);return s?`?${s}`:""}}const St="__root__";function th(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&typeof e.href=="string"&&Es(e.href))throw new Error(`Redirect blocked: unsafe protocol in href "${e.href}". Only ${Yf.join(", ")} protocols are allowed.`);if(!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Ct(e){return e instanceof Response&&!!e.options}const ds=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},si=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),yr=(e,t,n=!0)=>{const r={...e.router.options.context??{}},o=n?t:t-1;for(let s=0;s<=o;s++){const i=e.matches[s];if(!i)continue;const a=e.router.getMatch(i.id);a&&Object.assign(r,a.__routeContext,a.__beforeLoadContext)}return r},nh=(e,t)=>{const n=e.router.routesById[t.routeId??""]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),on(n.options.notFoundComponent,"No notFoundComponent found. Please set a notFoundComponent on your route or provide a defaultNotFoundComponent to the router.");const r=e.matches.find(o=>o.routeId===n.id);on(r,"Could not find match for route: "+n.id),e.updateMatch(r.id,o=>({...o,status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&n.parentRoute&&(t.routeId=n.parentRoute.id,nh(e,t))},yn=(e,t,n)=>{if(!(!Ct(n)&&!pt(n))){if(Ct(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const r=Ct(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,o=>({...o,status:r,context:yr(e,t.index),isFetching:!1,error:n})),pt(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw Ct(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(nh(e,n),n)}},rh=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,zr=(e,t,n,r)=>{const{id:o,routeId:s}=e.matches[t],i=e.router.looseRoutesById[s];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,yn(e,e.router.getMatch(o),n);try{i.options.onError?.(n)}catch(a){n=a,yn(e,e.router.getMatch(o),n)}e.updateMatch(o,a=>(a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,a._nonReactive.loadPromise?.resolve(),{...a,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},oh=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const o=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!si(e,t)&&(n.options.loader||n.options.beforeLoad||ah(n))&&typeof o=="number"&&o!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const i=setTimeout(()=>{ds(e)},o);r._nonReactive.pendingTimeout=i}},qv=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;oh(e,t,n,r);const o=()=>{const s=e.router.getMatch(t);s.preload&&(s.status==="redirected"||s.status==="notFound")&&yn(e,s,s.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(o):o()},Gv=(e,t,n,r)=>{const o=e.router.getMatch(t),s=o._nonReactive.loadPromise;o._nonReactive.loadPromise=xr(()=>{s?.resolve()});const{paramsError:i,searchError:a}=o;i&&zr(e,n,i,"PARSE_PARAMS"),a&&zr(e,n,a,"VALIDATE_SEARCH"),oh(e,t,r,o);const c=new AbortController;let l=!1;const d=()=>{l||(l=!0,e.updateMatch(t,x=>({...x,isFetching:"beforeLoad",fetchCount:x.fetchCount+1,abortController:c})))},u=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,x=>({...x,isFetching:!1}))};if(!r.options.beforeLoad){Qr(()=>{d(),u()});return}o._nonReactive.beforeLoadPromise=xr();const f={...yr(e,n,!1),...o.__routeContext},{search:h,params:m,cause:g}=o,v=si(e,t),b={search:h,abortController:c,params:m,preload:v,context:f,location:e.location,navigate:x=>e.router.navigate({...x,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?"preload":g,matches:e.matches,...e.router.options.additionalContext},_=x=>{if(x===void 0){Qr(()=>{d(),u()});return}(Ct(x)||pt(x))&&(d(),zr(e,n,x,"BEFORE_LOAD")),Qr(()=>{d(),e.updateMatch(t,S=>({...S,__beforeLoadContext:x})),u()})};let w;try{if(w=r.options.beforeLoad(b),gr(w))return d(),w.catch(x=>{zr(e,n,x,"BEFORE_LOAD")}).then(_)}catch(x){d(),zr(e,n,x,"BEFORE_LOAD")}_(w)},Yv=(e,t)=>{const{id:n,routeId:r}=e.matches[t],o=e.router.looseRoutesById[r],s=()=>a(),i=()=>Gv(e,n,t,o),a=()=>{if(rh(e,n))return;const c=qv(e,n,o);return gr(c)?c.then(i):i()};return s()},Jv=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const o={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(o),n.options.scripts?.(o),n.options.headers?.(o)]).then(([s,i,a])=>{const c=s?.meta,l=s?.links,d=s?.scripts,u=s?.styles;return{meta:c,links:l,headScripts:d,headers:a,scripts:i,styles:u}})},sh=(e,t,n,r)=>{const o=e.matchPromises[n-1],{params:s,loaderDeps:i,abortController:a,cause:c}=e.router.getMatch(t),l=yr(e,n),d=si(e,t);return{params:s,deps:i,preload:!!d,parentMatchPromise:o,abortController:a,context:l,location:e.location,navigate:u=>e.router.navigate({...u,_fromLocation:e.location}),cause:d?"preload":c,route:r,...e.router.options.additionalContext}},du=async(e,t,n,r)=>{try{const o=e.router.getMatch(t);try{(!(mv??e.router.isServer)||o.ssr===!0)&&ih(r);const s=r.options.loader?.(sh(e,t,n,r)),i=r.options.loader&&gr(s);if((i||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||o._nonReactive.minPendingPromise)&&e.updateMatch(t,l=>({...l,isFetching:"loader"})),r.options.loader){const l=i?await s:s;yn(e,e.router.getMatch(t),l),l!==void 0&&e.updateMatch(t,d=>({...d,loaderData:l}))}r._lazyPromise&&await r._lazyPromise;const c=o._nonReactive.minPendingPromise;c&&await c,r._componentsPromise&&await r._componentsPromise,e.updateMatch(t,l=>({...l,error:void 0,context:yr(e,n),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(s){let i=s;if(i?.name==="AbortError"){e.updateMatch(t,c=>({...c,status:c.status==="pending"?"success":c.status,isFetching:!1,context:yr(e,n)}));return}const a=o._nonReactive.minPendingPromise;a&&await a,pt(s)&&await r.options.notFoundComponent?.preload?.(),yn(e,e.router.getMatch(t),s);try{r.options.onError?.(s)}catch(c){i=c,yn(e,e.router.getMatch(t),c)}e.updateMatch(t,c=>({...c,error:i,context:yr(e,n),status:"error",isFetching:!1}))}}catch(o){const s=e.router.getMatch(t);s&&(s._nonReactive.loaderPromise=void 0),yn(e,s,o)}},Qv=async(e,t)=>{const{id:n,routeId:r}=e.matches[t];let o=!1,s=!1;const i=e.router.looseRoutesById[r];if(!rh(e,n)){const l=e.router.getMatch(n);if(l._nonReactive.loaderPromise){if(l.status==="success"&&!e.sync&&!l.preload)return l;await l._nonReactive.loaderPromise;const d=e.router.getMatch(n),u=d._nonReactive.error||d.error;u&&yn(e,d,u)}else{const d=Date.now()-l.updatedAt,u=si(e,n),f=u?i.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:i.options.staleTime??e.router.options.defaultStaleTime??0,h=i.options.shouldReload,m=typeof h=="function"?h(sh(e,n,t,i)):h,g=!!u&&!e.router.state.matches.some(w=>w.id===n),v=e.router.getMatch(n);v._nonReactive.loaderPromise=xr(),g!==v.preload&&e.updateMatch(n,w=>({...w,preload:g}));const{status:b,invalid:_}=v;o=b==="success"&&(_||(m??d>f)),u&&i.options.preload===!1||(o&&!e.sync?(s=!0,(async()=>{try{await du(e,n,t,i);const w=e.router.getMatch(n);w._nonReactive.loaderPromise?.resolve(),w._nonReactive.loadPromise?.resolve(),w._nonReactive.loaderPromise=void 0}catch(w){Ct(w)&&await e.router.navigate(w.options)}})()):(b!=="success"||o&&e.sync)&&await du(e,n,t,i))}}const a=e.router.getMatch(n);s||(a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loadPromise?.resolve()),clearTimeout(a._nonReactive.pendingTimeout),a._nonReactive.pendingTimeout=void 0,s||(a._nonReactive.loaderPromise=void 0),a._nonReactive.dehydrated=void 0;const c=s?a.isFetching:!1;return c!==a.isFetching||a.invalid!==!1?(e.updateMatch(n,l=>({...l,isFetching:c,invalid:!1})),e.router.getMatch(n)):a};async function fu(e){const t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(n=>n._forcePending)&&ds(t);try{for(let a=0;a<t.matches.length;a++){const c=Yv(t,a);gr(c)&&await c}const n=t.firstBadMatchIndex??t.matches.length;for(let a=0;a<n;a++)t.matchPromises.push(Qv(t,a));const o=(await Promise.allSettled(t.matchPromises)).filter(a=>a.status==="rejected").map(a=>a.reason);let s;for(const a of o){if(Ct(a))throw a;!s&&pt(a)&&(s=a)}for(const a of t.matches){const{id:c,routeId:l}=a,d=t.router.looseRoutesById[l];try{const u=Jv(t,c,d);if(u){const f=await u;t.updateMatch(c,h=>({...h,...f}))}}catch(u){console.error(`Error executing head for route ${l}:`,u)}}if(s)throw s;const i=ds(t);gr(i)&&await i}catch(n){if(pt(n)&&!t.preload){const r=ds(t);throw gr(r)&&await r,n}if(Ct(n))throw n}return t.matches}async function ih(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const r of ch){const o=e.options[r]?.preload;o&&n.push(o())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function ah(e){for(const t of ch)if(e.options[t]?.preload)return!0;return!1}const ch=["component","errorComponent","pendingComponent","notFoundComponent"];function Xv(e){return{input:({url:t})=>{for(const n of e)t=Ua(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=lh(e[n],t);return t}}}function eb(e){const t=eh(e.basepath),n=`/${t}`,r=`${n}/`,o=e.caseSensitive?n:n.toLowerCase(),s=e.caseSensitive?r:r.toLowerCase();return{input:({url:i})=>{const a=e.caseSensitive?i.pathname:i.pathname.toLowerCase();return a===o?i.pathname="/":a.startsWith(s)&&(i.pathname=i.pathname.slice(n.length)),i},output:({url:i})=>(i.pathname=us(["/",t,i.pathname]),i)}}function Ua(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function lh(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function zn(e){const t=e.resolvedLocation,n=e.location,r=t?.pathname!==n.pathname,o=t?.href!==n.href,s=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:r,hrefChanged:o,hashChanged:s}}class tb{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const r=this.options,o=this.basepath??r?.basepath??"/",s=this.basepath===void 0,i=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Iv(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=hv()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let f;this.resolvePathCache=Cs(1e3),f=this.buildRouteTree(),this.setRoutes(f)}!this.__store&&this.latestLocation&&(this.__store=new dv(rb(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(f=>!["redirected"].includes(f.status))}}}),zv(this));let a=!1;const c=this.options.basepath??"/",l=this.options.rewrite;if(s||o!==c||i!==l){this.basepath=c;const f=[],h=eh(c);h&&h!=="/"&&f.push(eb({basepath:c})),l&&f.push(l),this.rewrite=f.length===0?void 0:f.length===1?f[0]:Xv(f),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=Pv(this.routeTree,this.options.caseSensitive,(r,o)=>{r.init({originalIndex:o})});return this.options.routeMasks&&_v(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const o={eventType:n,fn:r};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const o=({pathname:c,search:l,hash:d,href:u,state:f})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const _=this.options.parseSearch(l),w=this.options.stringifySearch(_);return{href:c+w+d,publicHref:u,pathname:Fr(c),external:!1,searchStr:w,search:tt(r?.search,_),hash:Fr(d.slice(1)),state:tt(r?.state,f)}}const h=new URL(u,this.origin),m=Ua(this.rewrite,h),g=this.options.parseSearch(m.search),v=this.options.stringifySearch(g);return m.search=v,{href:m.href.replace(m.origin,""),publicHref:u,pathname:Fr(m.pathname),external:!!this.rewrite&&m.origin!==this.origin,searchStr:v,search:tt(r?.search,g),hash:Fr(m.hash.slice(1)),state:tt(r?.state,f)}},s=o(n),{__tempLocation:i,__tempKey:a}=s.state;if(i&&(!a||a===this.tempLocationKey)){const c=o(i);return c.state.key=s.state.key,c.state.__TSR_key=s.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:s}}return s},this.resolvePathWithBase=(n,r)=>Av({base:n,to:$c(r),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,o)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},o):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>ob({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(s=>s.status==="pending"),r=this.state.matches.filter(s=>s.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...r]).forEach(s=>{this.cancelMatch(s.id)})},this.buildLocation=n=>{const r=(s={})=>{const i=s._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutesLightweight(i);if(s.from&&process.env.NODE_ENV!=="production"&&s._isNavigate){const j=this.getMatchedRoutes(s.from).matchedRoutes,V=cu(a.matchedRoutes,L=>pu(L.fullPath,s.from)),Y=cu(j,L=>pu(L.fullPath,a.fullPath));!V&&!Y&&console.warn(`Could not find match for from: ${s.from}`)}const c=s.unsafeRelative==="path"?i.pathname:s.from??a.fullPath,l=this.resolvePathWithBase(c,"."),d=a.search,u={...a.params},f=s.to?this.resolvePathWithBase(l,`${s.to}`):this.resolvePathWithBase(l,"."),h=s.params===!1||s.params===null?{}:(s.params??!0)===!0?u:Object.assign(u,gn(s.params,u)),m=Xi({path:f,params:h,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,g=this.getMatchedRoutes(m);let v=g.matchedRoutes;(g.foundRoute?g.foundRoute.path!=="/"&&g.routeParams["**"]:nn(m))&&this.options.notFoundRoute&&(v=[...v,this.options.notFoundRoute]);let _=!1;if(Object.keys(h).length>0)for(const j of v){const V=j.options.params?.stringify??j.options.stringifyParams;V&&(_=!0,Object.assign(h,V(h)))}const w=n.leaveParams?f:Fr(_?Xi({path:f,params:h,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:m);let x=d;if(n._includeValidateSearch&&this.options.search?.strict){const j={};v.forEach(V=>{if(V.options.validateSearch)try{Object.assign(j,fs(V.options.validateSearch,{...j,...x}))}catch{}}),x=j}x=sb({search:x,dest:s,destRoutes:v,_includeValidateSearch:n._includeValidateSearch}),x=tt(d,x);const S=this.options.stringifySearch(x),P=s.hash===!0?i.hash:s.hash?gn(s.hash,i.hash):void 0,C=P?`#${P}`:"";let E=s.state===!0?i.state:s.state?gn(s.state,i.state):{};E=tt(i.state,E);const A=`${w}${S}${C}`;let U,B,M=!1;if(this.rewrite){const j=new URL(A,this.origin),V=lh(this.rewrite,j);U=j.href.replace(j.origin,""),V.origin!==this.origin?(B=V.href,M=!0):B=V.pathname+V.search+V.hash}else U=bv(A),B=U;return{publicHref:B,href:U,pathname:w,search:x,searchStr:S,state:E,hash:P??"",external:M,unmaskOnReload:s.unmaskOnReload}},o=(s={},i)=>{const a=r(s);let c=i?r(i):void 0;if(!c){const l={};if(this.options.routeMasks){const d=Sv(a.pathname,this.processedTree);if(d){Object.assign(l,d.rawParams);const{from:u,params:f,...h}=d.route,m=f===!1||f===null?{}:(f??!0)===!0?l:Object.assign(l,gn(f,l));i={from:n.from,...h,params:m},c=r(i)}}}return c&&(a.maskedLocation=c),a};return n.mask?o(n,{from:n.from,...n.mask}):o(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...o})=>{const s=()=>{const c=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];c.forEach(d=>{o.state[d]=this.latestLocation.state[d]});const l=$n(o.state,this.latestLocation.state);return c.forEach(d=>{delete o.state[d]}),l},i=nn(this.latestLocation.href)===nn(o.href),a=this.commitLocationPromise;if(this.commitLocationPromise=xr(()=>{a?.resolve()}),i&&s())this.load();else{let{maskedLocation:c,hashScrollIntoView:l,...d}=o;c&&(d={...c,state:{...c.state,__tempKey:void 0,__tempLocation:{...d,search:d.searchStr,state:{...d.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(d.unmaskOnReload??this.options.unmaskOnReload??!1)&&(d.state.__tempKey=this.tempLocationKey)),d.state.__hashScrollIntoViewOptions=l??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[o.replace?"replace":"push"](d.publicHref,d.state,{ignoreBlocker:r})}return this.resetNextScroll=o.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:o,viewTransition:s,ignoreBlocker:i,href:a,...c}={})=>{if(a){const u=this.history.location.state.__TSR_index,f=_s(a,{__TSR_index:n?u:u+1}),h=new URL(f.pathname,this.origin),m=Ua(this.rewrite,h);c.to=m.pathname,c.search=this.options.parseSearch(f.search),c.hash=f.hash.slice(1)}const l=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=l;const d=this.commitLocation({...l,viewTransition:s,replace:n,resetScroll:r,hashScrollIntoView:o,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===l&&(this.pendingBuiltLocation=void 0)}),d},this.navigate=async({to:n,reloadDocument:r,href:o,publicHref:s,...i})=>{let a=!1;if(o)try{new URL(`${o}`),a=!0}catch{}if(a&&!r&&(r=!0),r){if(n!==void 0||!o){const l=this.buildLocation({to:n,...i});o=o??l.publicHref,s=s??l.publicHref}const c=!a&&s?s:o;if(Es(c))return process.env.NODE_ENV!=="production"&&console.warn(`Blocked navigation to dangerous protocol: ${c}`),Promise.resolve();if(!i.ignoreBlocker){const d=this.history.getBlockers?.()??[];for(const u of d)if(u?.blockerFn&&await u.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return i.replace?window.location.replace(c):window.location.href=c,Promise.resolve()}return this.buildAndCommitLocation({...i,href:o,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:r.cachedMatches.filter(o=>!n.some(s=>s.id===o.id))}))},this.load=async n=>{let r,o,s;for(s=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();const c=this.latestLocation,l=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...zn({resolvedLocation:l,location:c})}),this.emit({type:"onBeforeLoad",...zn({resolvedLocation:l,location:c})}),await fu({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:c,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let d=[],u=[],f=[];Qr(()=>{this.__store.setState(h=>{const m=h.matches,g=h.pendingMatches||h.matches;return d=m.filter(v=>!g.some(b=>b.id===v.id)),u=g.filter(v=>!m.some(b=>b.id===v.id)),f=g.filter(v=>m.some(b=>b.id===v.id)),{...h,isLoading:!1,loadedAt:Date.now(),matches:g,pendingMatches:void 0,cachedMatches:[...h.cachedMatches,...d.filter(v=>v.status!=="error"&&v.status!=="notFound")]}}),this.clearExpiredCache()}),[[d,"onLeave"],[u,"onEnter"],[f,"onStay"]].forEach(([h,m])=>{h.forEach(g=>{this.looseRoutesById[g.routeId].options[m]?.(g)})})})})}})}catch(c){Ct(c)?(r=c,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):pt(c)&&(o=c),this.__store.setState(l=>({...l,statusCode:r?r.status:o?404:l.matches.some(d=>d.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===s&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=s,await s;this.latestLoadPromise&&s!==this.latestLoadPromise;)await this.latestLoadPromise;let i;this.hasNotFoundMatch()?i=404:this.__store.state.matches.some(a=>a.status==="error")&&(i=500),i!==void 0&&this.__store.setState(a=>({...a,statusCode:i}))},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let o;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const s=this.latestLocation,i=this.state.resolvedLocation,a=typeof r.types=="function"?r.types(zn({resolvedLocation:i,location:s})):r.types;if(a===!1){n();return}o={update:n,types:a}}else o=n;document.startViewTransition(o)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const o=this.state.pendingMatches?.some(s=>s.id===n)?"pendingMatches":this.state.matches.some(s=>s.id===n)?"matches":this.state.cachedMatches.some(s=>s.id===n)?"cachedMatches":"";o&&this.__store.setState(s=>({...s,[o]:s[o]?.map(i=>i.id===n?r(i):i)}))})},this.getMatch=n=>{const r=o=>o.id===n;return this.state.cachedMatches.find(r)??this.state.pendingMatches?.find(r)??this.state.matches.find(r)},this.invalidate=n=>{const r=o=>n?.filter?.(o)??!0?{...o,invalid:!0,...n?.forcePending||o.status==="error"||o.status==="notFound"?{status:"pending",error:void 0}:void 0}:o;return this.__store.setState(o=>({...o,matches:o.matches.map(r),cachedMatches:o.cachedMatches.map(r),pendingMatches:o.pendingMatches?.map(r)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const o=n.options._builtLocation??this.buildLocation(n.options),s=this.getParsedLocationHref(o);n.options.href=s,n.headers.set("Location",s)}else if(r)try{const o=new URL(r);if(this.origin&&o.origin===this.origin){const s=o.pathname+o.search+o.hash;n.options.href=s,n.headers.set("Location",s)}}catch{}return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.__store.setState(o=>({...o,cachedMatches:o.cachedMatches.filter(s=>!r(s))})):this.__store.setState(o=>({...o,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=r=>{const o=this.looseRoutesById[r.routeId];if(!o.options.loader)return!0;const s=(r.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=s};this.clearCache({filter:n})},this.loadRouteChunk=ih,this.preloadRoute=async n=>{const r=this.buildLocation(n);let o=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const s=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(a=>a.id)),i=new Set([...s,...this.state.cachedMatches.map(a=>a.id)]);Qr(()=>{o.forEach(a=>{i.has(a.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,a]}))})});try{return o=await fu({router:this,matches:o,location:r,preload:!0,updateMatch:(a,c)=>{s.has(a)?o=o.map(l=>l.id===a?c(l):l):this.updateMatch(a,c)}}),o}catch(a){if(Ct(a))return a.options.reloadDocument?void 0:await this.preloadRoute({...a.options,_fromLocation:r});pt(a)||console.error(a);return}},this.matchRoute=(n,r)=>{const o={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},s=this.buildLocation(o);if(r?.pending&&this.state.status!=="pending")return!1;const a=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,c=Ev(s.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,a.pathname,this.processedTree);return!c||n.params&&!$n(c.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?$n(a.search,s.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??Hv,parseSearch:t.parseSearch??Wv}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:n,processedTree:r}){this.routesById=t,this.routesByPath=n,this.processedTree=r;const o=this.options.notFoundRoute;o&&(o.init({originalIndex:99999999999}),this.routesById[o.id]=o)}get looseRoutesById(){return this.routesById}matchRoutesInternal(t,n){const r=this.getMatchedRoutes(t.pathname),{foundRoute:o,routeParams:s,parsedParams:i}=r;let{matchedRoutes:a}=r,c=!1;(o?o.path!=="/"&&s["**"]:nn(t.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:c=!0);const l=c?ab(this.options.notFoundMode,a):void 0,d=[],u=f=>f?.id?f.context??this.options.context??void 0:this.options.context??void 0;return a.forEach((f,h)=>{const m=d[h-1],[g,v,b]=(()=>{const V=m?.search??t.search,Y=m?._strictSearch??void 0;try{const L=fs(f.options.validateSearch,{...V})??void 0;return[{...V,...L},{...Y,...L},void 0]}catch(L){let K=L;if(L instanceof Os||(K=new Os(L.message,{cause:L})),n?.throwOnError)throw K;return[V,{},K]}})(),_=f.options.loaderDeps?.({search:g})??"",w=_?JSON.stringify(_):"",{interpolatedPath:x,usedParams:S}=Xi({path:f.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),P=f.id+x+w,C=this.getMatch(P),E=this.state.matches.find(V=>V.routeId===f.id),A=C?._strictParams??S;let U;if(!C)try{mu(f,S,i,A)}catch(V){if(pt(V)||Ct(V)?U=V:U=new nb(V.message,{cause:V}),n?.throwOnError)throw U}Object.assign(s,A);const B=E?"stay":"enter";let M;if(C)M={...C,cause:B,params:E?tt(E.params,s):s,_strictParams:A,search:tt(E?E.search:C.search,g),_strictSearch:v};else{const V=f.options.loader||f.options.beforeLoad||f.lazyFn||ah(f)?"pending":"success";M={id:P,ssr:f.options.ssr,index:h,routeId:f.id,params:E?tt(E.params,s):s,_strictParams:A,pathname:x,updatedAt:Date.now(),search:E?tt(E.search,g):g,_strictSearch:v,searchError:void 0,status:V,isFetching:!1,error:void 0,paramsError:U,__routeContext:void 0,_nonReactive:{loadPromise:xr()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:B,loaderDeps:E?tt(E.loaderDeps,_):_,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:f.options.staticData||{},fullPath:f.fullPath}}n?.preload||(M.globalNotFound=l===f.id),M.searchError=b;const j=u(m);M.context={...j,...M.__routeContext,...M.__beforeLoadContext},d.push(M)}),d.forEach((f,h)=>{const m=this.looseRoutesById[f.routeId];if(!this.getMatch(f.id)){const v=d[h-1],b=u(v);if(m.options.context){const _={deps:f.loaderDeps,params:f.params,context:b??{},location:t,navigate:w=>this.navigate({...w,_fromLocation:t}),buildLocation:this.buildLocation,cause:f.cause,abortController:f.abortController,preload:!!f.preload,matches:d};f.__routeContext=m.options.context(_)??void 0}f.context={...b,...f.__routeContext,...f.__beforeLoadContext}}}),d}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:r,parsedParams:o}=this.getMatchedRoutes(t.pathname),s=no(n),i={...t.search};for(const d of n)try{Object.assign(i,fs(d.options.validateSearch,i))}catch{}const a=no(this.state.matches),c=a&&a.routeId===s.id&&t.pathname===this.state.location.pathname;let l;if(c)l=a.params;else{const d={...r};for(const u of n)try{mu(u,r,o??{},d)}catch{}l=d}return{matchedRoutes:n,fullPath:s.fullPath,search:i,params:l}}}class Os extends Error{}class nb extends Error{}const hu=e=>e.endsWith("/")&&e.length>1?e.slice(0,-1):e;function pu(e,t){return hu(e)===hu(t)}function rb(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function fs(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Os("Async validation not supported");if(n.issues)throw new Os(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function ob({pathname:e,routesById:t,processedTree:n}){const r={},o=nn(e);let s,i;const a=Cv(o,n,!0);return a&&(s=a.route,Object.assign(r,a.rawParams),i=Object.assign({},a.parsedParams)),{matchedRoutes:a?.branch||[t[St]],routeParams:r,foundRoute:s,parsedParams:i}}function sb({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return ib(n)(e,t,r??!1)}function ib(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const o of e){if("search"in o.options)o.options.search?.middlewares&&t.middlewares.push(...o.options.search.middlewares);else if(o.options.preSearchFilters||o.options.postSearchFilters){const s=({search:i,next:a})=>{let c=i;"preSearchFilters"in o.options&&o.options.preSearchFilters&&(c=o.options.preSearchFilters.reduce((d,u)=>u(d),i));const l=a(c);return"postSearchFilters"in o.options&&o.options.postSearchFilters?o.options.postSearchFilters.reduce((d,u)=>u(d),l):l};t.middlewares.push(s)}if(o.options.validateSearch){const s=({search:i,next:a})=>{const c=a(i);if(!t._includeValidateSearch)return c;try{return{...c,...fs(o.options.validateSearch,c)??void 0}}catch{return c}};t.middlewares.push(s)}}const n=({search:o})=>{const s=t.dest;return s.search?s.search===!0?o:gn(s.search,o):{}};t.middlewares.push(n);const r=(o,s,i)=>{if(o>=i.length)return s;const a=i[o];return a({search:s,next:l=>r(o+1,l,i)})};return function(s,i,a){return t.dest=i,t._includeValidateSearch=a,r(0,s,t.middlewares)}}function ab(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return St}function mu(e,t,n,r){const o=e.options.params?.parse??e.options.parseParams;if(o)if(e.options.skipRouteOnParseError)for(const s in t)s in n&&(r[s]=n[s]);else{const s=o(r);Object.assign(r,s)}}const cb="Error preloading route! ☝️";class uh{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const r=this.options,o=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),o?this._path=St:this.parentRoute||on(!1,"Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.");let s=o?St:r?.path;s&&s!=="/"&&(s=Xf(s));const i=r?.id||s;let a=o?St:us([this.parentRoute.id===St?"":this.parentRoute.id,i]);s===St&&(s="/"),a!==St&&(a=us(["/",a]));const c=a===St?"/":us([this.parentRoute.fullPath,s]);this._path=s,this._id=a,this._fullPath=c,this._to=nn(c)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>th({from:this.fullPath,...n}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class lb extends uh{constructor(t){super(t)}}const zo=typeof window<"u"?y.useLayoutEffect:y.useEffect;function ta(e){const t=y.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function ub(e,t,n={},r={}){y.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([s])=>{t(s)},n);return o.observe(e.current),()=>{o.disconnect()}},[t,n,r.disabled,e])}function db(e){const t=y.useRef(null);return y.useImperativeHandle(e,()=>t.current,[]),t}function zc(e){const t=e.errorComponent??Vc;return p.jsx(fb,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?y.createElement(t,{error:n,reset:r}):e.children})}class fb extends y.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Vc({error:e}){const[t,n]=y.useState(process.env.NODE_ENV!=="production");return p.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[p.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),p.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),p.jsx("div",{style:{height:".25rem"}}),t?p.jsx("div",{children:p.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?p.jsx("code",{children:e.message}):null})}):null]})}function hb({children:e,fallback:t=null}){return dh()?p.jsx(k.Fragment,{children:e}):p.jsx(k.Fragment,{children:t})}function dh(){return k.useSyncExternalStore(pb,()=>!0,()=>!1)}function pb(){return()=>{}}var mb=process.env.NODE_ENV==="production";function Sr(e,t){if(!mb){if(e)return;var n="Warning: "+t;typeof console<"u"&&console.warn(n);try{throw Error(n)}catch{}}}var Vo={exports:{}},na={},Uo={exports:{}},ra={};var gu;function gb(){if(gu)return ra;gu=1;var e=k;function t(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(u,f){var h=f(),m=r({inst:{value:h,getSnapshot:f}}),g=m[0].inst,v=m[1];return s(function(){g.value=h,g.getSnapshot=f,c(g)&&v({inst:g})},[u,h,f]),o(function(){return c(g)&&v({inst:g}),u(function(){c(g)&&v({inst:g})})},[u]),i(h),h}function c(u){var f=u.getSnapshot;u=u.value;try{var h=f();return!n(u,h)}catch{return!0}}function l(u,f){return f()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:a;return ra.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,ra}var oa={};var yu;function yb(){return yu||(yu=1,process.env.NODE_ENV!=="production"&&(function(){function e(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}function t(h,m){d||o.startTransition===void 0||(d=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var g=m();if(!u){var v=m();s(g,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),u=!0)}v=i({inst:{value:g,getSnapshot:m}});var b=v[0].inst,_=v[1];return c(function(){b.value=g,b.getSnapshot=m,n(b)&&_({inst:b})},[h,g,m]),a(function(){return n(b)&&_({inst:b}),h(function(){n(b)&&_({inst:b})})},[h]),l(g),g}function n(h){var m=h.getSnapshot;h=h.value;try{var g=m();return!s(h,g)}catch{return!0}}function r(h,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=k,s=typeof Object.is=="function"?Object.is:e,i=o.useState,a=o.useEffect,c=o.useLayoutEffect,l=o.useDebugValue,d=!1,u=!1,f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;oa.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:f,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),oa}var vu;function fh(){return vu||(vu=1,process.env.NODE_ENV==="production"?Uo.exports=gb():Uo.exports=yb()),Uo.exports}var bu;function vb(){if(bu)return na;bu=1;var e=k,t=fh();function n(l,d){return l===d&&(l!==0||1/l===1/d)||l!==l&&d!==d}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,c=e.useDebugValue;return na.useSyncExternalStoreWithSelector=function(l,d,u,f,h){var m=s(null);if(m.current===null){var g={hasValue:!1,value:null};m.current=g}else g=m.current;m=a(function(){function b(P){if(!_){if(_=!0,w=P,P=f(P),h!==void 0&&g.hasValue){var C=g.value;if(h(C,P))return x=C}return x=P}if(C=x,r(w,P))return C;var E=f(P);return h!==void 0&&h(C,E)?(w=P,C):(w=P,x=E)}var _=!1,w,x,S=u===void 0?null:u;return[function(){return b(d())},S===null?void 0:function(){return b(S())}]},[d,u,f,h]);var v=o(l,m[0],m[1]);return i(function(){g.hasValue=!0,g.value=v},[v]),c(v),v},na}var sa={};var wu;function bb(){return wu||(wu=1,process.env.NODE_ENV!=="production"&&(function(){function e(l,d){return l===d&&(l!==0||1/l===1/d)||l!==l&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=k,n=fh(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,s=t.useRef,i=t.useEffect,a=t.useMemo,c=t.useDebugValue;sa.useSyncExternalStoreWithSelector=function(l,d,u,f,h){var m=s(null);if(m.current===null){var g={hasValue:!1,value:null};m.current=g}else g=m.current;m=a(function(){function b(P){if(!_){if(_=!0,w=P,P=f(P),h!==void 0&&g.hasValue){var C=g.value;if(h(C,P))return x=C}return x=P}if(C=x,r(w,P))return C;var E=f(P);return h!==void 0&&h(C,E)?(w=P,C):(w=P,x=E)}var _=!1,w,x,S=u===void 0?null:u;return[function(){return b(d())},S===null?void 0:function(){return b(S())}]},[d,u,f,h]);var v=o(l,m[0],m[1]);return i(function(){g.hasValue=!0,g.value=v},[v]),c(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),sa}var xu;function wb(){return xu||(xu=1,process.env.NODE_ENV==="production"?Vo.exports=vb():Vo.exports=bb()),Vo.exports}var xb=wb();function _b(e,t=r=>r,n={}){const r=n.equal??Sb;return xb.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,r)}function Sb(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!t.has(r)||!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=_u(e);if(n.length!==_u(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function _u(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const ia=y.createContext(null);function hh(){return typeof document>"u"?ia:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=ia,ia)}function Ot(e){const t=y.useContext(hh());return Sr(!((e?.warn??!0)&&!t),"useRouter must be used inside a <RouterProvider> component!"),t}function Rt(e){const t=Ot({warn:e?.router===void 0}),n=e?.router||t,r=k.useRef(void 0);return _b(n.__store,o=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const s=tt(r.current,e.select(o));return r.current=s,s}return e.select(o)}return o})}const ii=y.createContext(void 0),Eb=y.createContext(void 0);function Gt(e){const t=y.useContext(e.from?Eb:ii);return Rt({select:r=>{const o=r.matches.find(s=>e.from?e.from===s.routeId:s.id===t);if(on(!((e.shouldThrow??!0)&&!o),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),o!==void 0)return e.select?e.select(o):o},structuralSharing:e.structuralSharing})}function Uc(e){return Gt({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Bc(e){const{select:t,...n}=e;return Gt({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Wc(e){return Gt({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Hc(e){return Gt({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function bo(e){const t=Ot();return y.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Cb(e,t){const n=Ot(),r=db(t),{activeProps:o,inactiveProps:s,activeOptions:i,to:a,preload:c,preloadDelay:l,hashScrollIntoView:d,replace:u,startTransition:f,resetScroll:h,viewTransition:m,children:g,target:v,disabled:b,style:_,className:w,onClick:x,onFocus:S,onMouseEnter:P,onMouseLeave:C,onTouchStart:E,ignoreBlocker:A,params:U,search:B,hash:M,state:j,mask:V,reloadDocument:Y,unsafeRelative:L,from:K,_fromLocation:D,...H}=e,se=dh(),N=Rt({select:$=>$.location.search,structuralSharing:!0}),Q=e.from,W=y.useMemo(()=>({...e,from:Q}),[n,N,Q,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),Z=y.useMemo(()=>n.buildLocation({...W}),[n,W]),ie=Z.maskedLocation?Z.maskedLocation.publicHref:Z.publicHref,fe=Z.maskedLocation?Z.maskedLocation.external:Z.external,F=y.useMemo(()=>Tb(ie,fe,n.history,b),[b,fe,ie,n.history]),ee=y.useMemo(()=>{if(F?.external){if(Es(F.href)){process.env.NODE_ENV!=="production"&&console.warn(`Blocked Link with dangerous protocol: ${F.href}`);return}return F.href}if(!Ab(a)&&!(typeof a!="string"||a.indexOf(":")===-1))try{if(new URL(a),Es(a)){process.env.NODE_ENV!=="production"&&console.warn(`Blocked Link with dangerous protocol: ${a}`);return}return a}catch{}},[a,F]),pe=Rt({select:$=>{if(ee)return!1;if(i?.exact){if(!Tv($.location.pathname,Z.pathname,n.basepath))return!1}else{const X=Rs($.location.pathname,n.basepath),le=Rs(Z.pathname,n.basepath);if(!(X.startsWith(le)&&(X.length===le.length||X[le.length]==="/")))return!1}return(i?.includeSearch??!0)&&!$n($.location.search,Z.search,{partial:!i?.exact,ignoreUndefined:!i?.explicitUndefined})?!1:i?.includeHash?se&&$.location.hash===Z.hash:!0}}),ce=pe?gn(o,{})??Rb:aa,ue=pe?aa:gn(s,{})??aa,me=[w,ce.className,ue.className].filter(Boolean).join(" "),Oe=(_||ce.style||ue.style)&&{..._,...ce.style,...ue.style},[qe,Nt]=y.useState(!1),gt=y.useRef(!1),Le=e.reloadDocument||ee?!1:c??n.options.defaultPreload,un=l??n.options.defaultPreloadDelay??0,Fe=y.useCallback(()=>{n.preloadRoute({...W}).catch($=>{console.warn($),console.warn(cb)})},[n,W]),sr=y.useCallback($=>{$?.isIntersecting&&Fe()},[Fe]);ub(r,sr,Nb,{disabled:!!b||Le!=="viewport"}),y.useEffect(()=>{gt.current||!b&&Le==="render"&&(Fe(),gt.current=!0)},[b,Fe,Le]);const R=$=>{const X=$.currentTarget.getAttribute("target"),le=v!==void 0?v:X;if(!b&&!Ib($)&&!$.defaultPrevented&&(!le||le==="_self")&&$.button===0){$.preventDefault(),ni.flushSync(()=>{Nt(!0)});const ge=n.subscribe("onResolved",()=>{ge(),Nt(!1)});n.navigate({...W,replace:u,resetScroll:h,hashScrollIntoView:d,startTransition:f,viewTransition:m,ignoreBlocker:A})}};if(ee)return{...H,ref:r,href:ee,...g&&{children:g},...v&&{target:v},...b&&{disabled:b},..._&&{style:_},...w&&{className:w},...x&&{onClick:x},...S&&{onFocus:S},...P&&{onMouseEnter:P},...C&&{onMouseLeave:C},...E&&{onTouchStart:E}};const O=$=>{b||Le&&Fe()},I=O,J=$=>{if(!(b||!Le))if(!un)Fe();else{const X=$.target;if(Vr.has(X))return;const le=setTimeout(()=>{Vr.delete(X),Fe()},un);Vr.set(X,le)}},q=$=>{if(b||!Le||!un)return;const X=$.target,le=Vr.get(X);le&&(clearTimeout(le),Vr.delete(X))};return{...H,...ce,...ue,href:F?.href,ref:r,onClick:Ur([x,R]),onFocus:Ur([S,O]),onMouseEnter:Ur([P,J]),onMouseLeave:Ur([C,q]),onTouchStart:Ur([E,I]),disabled:!!b,target:v,...Oe&&{style:Oe},...me&&{className:me},...b&&Pb,...pe&&Ob,...se&&qe&&kb}}const aa={},Rb={className:"active"},Pb={role:"link","aria-disabled":!0},Ob={"data-status":"active","aria-current":"page"},kb={"data-transitioning":"transitioning"},Vr=new WeakMap,Nb={rootMargin:"100px"},Ur=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Tb(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function Ab(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const ph=y.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:o,...s}=Cb(r,t),i=typeof r.children=="function"?r.children({isActive:s["data-status"]==="active"}):r.children;if(!n){const{disabled:a,...c}=s;return y.createElement("a",c,i)}return y.createElement(n,s,i)});function Ib(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class Mb extends uh{constructor(t){super(t),this.useMatch=n=>Gt({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Gt({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>Hc({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Wc({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Bc({...n,from:this.id}),this.useLoaderData=n=>Uc({...n,from:this.id}),this.useNavigate=()=>bo({from:this.fullPath}),this.Link=k.forwardRef((n,r)=>p.jsx(ph,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function fr(e){return new Mb(e)}class Db extends lb{constructor(t){super(t),this.useMatch=n=>Gt({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Gt({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>Hc({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Wc({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Bc({...n,from:this.id}),this.useLoaderData=n=>Uc({...n,from:this.id}),this.useNavigate=()=>bo({from:this.fullPath}),this.Link=k.forwardRef((n,r)=>p.jsx(ph,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function jb(e){return new Db(e)}function Su(e){return typeof e=="object"?new Eu(e,{silent:!0}).createRoute(e):new Eu(e,{silent:!0}).createRoute}class Eu{constructor(t,n){this.path=t,this.createRoute=r=>{Sr(this.silent,"FileRoute is deprecated and will be removed in the next major version. Use the createFileRoute(path)(options) function instead.");const o=fr(r);return o.isRoot=!1,o},this.silent=n?.silent}}class Cu{constructor(t){this.useMatch=n=>Gt({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Gt({from:this.options.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>Hc({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>Wc({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>Bc({...n,from:this.options.id}),this.useLoaderData=n=>Uc({...n,from:this.options.id}),this.useNavigate=()=>{const n=Ot();return bo({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function Ru(e){return typeof e=="object"?new Cu(e):t=>new Cu({id:e,...t})}function Lb(){const e=Ot(),t=y.useRef({router:e,mounted:!1}),[n,r]=y.useState(!1),{hasPendingMatches:o,isLoading:s}=Rt({select:u=>({isLoading:u.isLoading,hasPendingMatches:u.matches.some(f=>f.status==="pending")}),structuralSharing:!0}),i=ta(s),a=s||n||o,c=ta(a),l=s||o,d=ta(l);return e.startTransition=u=>{r(!0),y.startTransition(()=>{u(),r(!1)})},y.useEffect(()=>{const u=e.history.subscribe(e.load),f=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return nn(e.latestLocation.publicHref)!==nn(f.publicHref)&&e.commitLocation({...f,replace:!0}),()=>{u()}},[e,e.history]),zo(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(f){console.error(f)}})()},[e]),zo(()=>{i&&!s&&e.emit({type:"onLoad",...zn(e.state)})},[i,e,s]),zo(()=>{d&&!l&&e.emit({type:"onBeforeRouteMount",...zn(e.state)})},[l,d,e]),zo(()=>{if(c&&!a){const u=zn(e.state);e.emit({type:"onResolved",...u}),e.__store.setState(f=>({...f,status:"idle",resolvedLocation:f.location})),u.hrefChanged&&Vv(e)}},[a,c,e]),null}function Fb(e){const t=Rt({select:n=>`not-found-${n.location.pathname}-${n.status}`});return p.jsx(zc,{getResetKey:()=>t,onCatch:(n,r)=>{if(pt(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(pt(n))return e.fallback?.(n);throw n},children:e.children})}function $b(){return p.jsx("p",{children:"Not Found"})}function hr(e){return p.jsx(p.Fragment,{children:e.children})}function mh(e,t,n){return t.options.notFoundComponent?p.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?p.jsx(e.options.defaultNotFoundComponent,{...n}):(process.env.NODE_ENV==="development"&&Sr(t.options.notFoundComponent,`A notFoundError was encountered on the route with ID "${t.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Not Found</p>)`),p.jsx($b,{}))}function zb(){return Ot().isScrollRestoring,null}const gh=y.memo(function({matchId:t}){const n=Ot(),r=Rt({select:g=>{const v=g.matches.findIndex(_=>_.id===t),b=g.matches[v];return on(b,`Could not find match for matchId "${t}". Please file an issue!`),{routeId:b.routeId,ssr:b.ssr,_displayPending:b._displayPending,resetKey:g.loadedAt,parentRouteId:g.matches[v-1]?.routeId}},structuralSharing:!0}),o=n.routesById[r.routeId],s=o.options.pendingComponent??n.options.defaultPendingComponent,i=s?p.jsx(s,{}):null,a=o.options.errorComponent??n.options.defaultErrorComponent,c=o.options.onCatch??n.options.defaultOnCatch,l=o.isRoot?o.options.notFoundComponent??n.options.notFoundRoute?.options.component:o.options.notFoundComponent,d=r.ssr===!1||r.ssr==="data-only",u=(!o.isRoot||o.options.wrapInSuspense||d)&&(o.options.wrapInSuspense??s??(o.options.errorComponent?.preload||d))?y.Suspense:hr,f=a?zc:hr,h=l?Fb:hr,m=o.isRoot?o.options.shellComponent??hr:hr;return p.jsxs(m,{children:[p.jsx(ii.Provider,{value:t,children:p.jsx(u,{fallback:i,children:p.jsx(f,{getResetKey:()=>r.resetKey,errorComponent:a||Vc,onCatch:(g,v)=>{if(pt(g))throw g;Sr(!1,`Error in route match: ${t}`),c?.(g,v)},children:p.jsx(h,{fallback:g=>{if(!l||g.routeId&&g.routeId!==r.routeId||!g.routeId&&!o.isRoot)throw g;return y.createElement(l,g)},children:d||r._displayPending?p.jsx(hb,{fallback:i,children:p.jsx(Pu,{matchId:t})}):p.jsx(Pu,{matchId:t})})})})}),r.parentRouteId===St&&n.options.scrollRestoration?p.jsxs(p.Fragment,{children:[p.jsx(Vb,{}),p.jsx(zb,{})]}):null]})});function Vb(){const e=Ot(),t=y.useRef(void 0);return p.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...zn(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const Pu=y.memo(function({matchId:t}){const n=Ot(),{match:r,key:o,routeId:s}=Rt({select:c=>{const l=c.matches.find(m=>m.id===t),d=l.routeId,f=(n.routesById[d].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:d,loaderDeps:l.loaderDeps,params:l._strictParams,search:l._strictSearch});return{key:f?JSON.stringify(f):void 0,routeId:d,match:{id:l.id,status:l.status,error:l.error,invalid:l.invalid,_forcePending:l._forcePending,_displayPending:l._displayPending}}},structuralSharing:!0}),i=n.routesById[s],a=y.useMemo(()=>{const c=i.options.component??n.options.defaultComponent;return c?p.jsx(c,{},o):p.jsx(Zc,{})},[o,i.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const c=i.options.pendingMinMs??n.options.defaultPendingMinMs;if(c){const l=n.getMatch(r.id);if(l&&!l._nonReactive.minPendingPromise){const d=xr();l._nonReactive.minPendingPromise=d,setTimeout(()=>{d.resolve(),l._nonReactive.minPendingPromise=void 0},c)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return on(pt(r.error),"Expected a notFound error"),mh(n,i,r.error);if(r.status==="redirected")throw on(Ct(r.error),"Expected a redirect error"),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return a}),Zc=y.memo(function(){const t=Ot(),n=y.useContext(ii),r=Rt({select:l=>l.matches.find(d=>d.id===n)?.routeId}),o=t.routesById[r],s=Rt({select:l=>{const u=l.matches.find(f=>f.id===n);return on(u,`Could not find parent match for matchId "${n}"`),u.globalNotFound}}),i=Rt({select:l=>{const d=l.matches,u=d.findIndex(f=>f.id===n);return d[u+1]?.id}}),a=t.options.defaultPendingComponent?p.jsx(t.options.defaultPendingComponent,{}):null;if(s)return mh(t,o,void 0);if(!i)return null;const c=p.jsx(gh,{matchId:i});return r===St?p.jsx(y.Suspense,{fallback:a,children:c}):c});function Ub(){const e=Ot(),n=e.routesById[St].options.pendingComponent??e.options.defaultPendingComponent,r=n?p.jsx(n,{}):null,o=typeof document<"u"&&e.ssr?hr:y.Suspense,s=p.jsxs(o,{fallback:r,children:[p.jsx(Lb,{}),p.jsx(Bb,{})]});return e.options.InnerWrap?p.jsx(e.options.InnerWrap,{children:s}):s}function Bb(){const e=Ot(),t=Rt({select:o=>o.matches[0]?.id}),n=Rt({select:o=>o.loadedAt}),r=t?p.jsx(gh,{matchId:t}):null;return p.jsx(ii.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:p.jsx(zc,{getResetKey:()=>n,errorComponent:Vc,onCatch:o=>{Sr(!1,"The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!"),Sr(!1,o.message||o.toString())},children:r})})}const Kc=e=>new Wb(e);class Wb extends tb{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=Su,globalThis.createLazyFileRoute=Ru):typeof window<"u"&&(window.createFileRoute=Su,window.createLazyFileRoute=Ru);function Hb({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=hh(),o=p.jsx(r.Provider,{value:e,children:t});return e.options.Wrap?p.jsx(e.options.Wrap,{children:o}):o}function yh({router:e,...t}){return p.jsx(Hb,{router:e,...t,children:p.jsx(Ub,{})})}var wo=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(){}},Zb={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Kb=class{#e=Zb;#t=!1;setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&this.#t&&e!==this.#e&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:this.#e,provider:e}),this.#e=e,process.env.NODE_ENV!=="production"&&(this.#t=!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&(this.#t=!0),this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&(this.#t=!0),this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Dn=new Kb;function qb(e){setTimeout(e,0)}var Hn=typeof window>"u"||"Deno"in globalThis;function rt(){}function Gb(e,t){return typeof e=="function"?e(t):e}function Ba(e){return typeof e=="number"&&e>=0&&e!==1/0}function vh(e,t){return Math.max(e+(t||0)-Date.now(),0)}function bn(e,t){return typeof e=="function"?e(t):e}function Et(e,t){return typeof e=="function"?e(t):e}function Ou(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==qc(i,t.options))return!1}else if(!so(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function ku(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(oo(t.options.mutationKey)!==oo(s))return!1}else if(!so(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function qc(e,t){return(t?.queryKeyHashFn||oo)(e)}function oo(e){return JSON.stringify(e,(t,n)=>Za(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function so(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>so(e[n],t[n])):!1}var Yb=Object.prototype.hasOwnProperty;function Wa(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Nu(e)&&Nu(t);if(!r&&!(Za(e)&&Za(t)))return t;const s=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),a=i.length,c=r?new Array(a):{};let l=0;for(let d=0;d<a;d++){const u=r?d:i[d],f=e[u],h=t[u];if(f===h){c[u]=f,(r?d<s:Yb.call(e,u))&&l++;continue}if(f===null||h===null||typeof f!="object"||typeof h!="object"){c[u]=h;continue}const m=Wa(f,h,n+1);c[u]=m,m===f&&l++}return s===a&&l===s?e:c}function Ha(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Nu(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Za(e){if(!Tu(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Tu(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Tu(e){return Object.prototype.toString.call(e)==="[object Object]"}function Jb(e){return new Promise(t=>{Dn.setTimeout(t,e)})}function Ka(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Wa(e,t)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`),r}return Wa(e,t)}return t}function Qb(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Xb(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ks=Symbol();function bh(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===ks&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ks?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function wh(e,t){return typeof e=="function"?e(...t):!!e}function ew(e,t,n){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t(),r||(r=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}var tw=class extends wo{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Hn&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}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(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Gc=new tw;function qa(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}var nw=qb;function rw(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=nw;const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||i()}return c},batchCalls:a=>(...c)=>{s(()=>{a(...c)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var Be=rw(),ow=class extends wo{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Hn&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}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(n=>{n(e)}))}isOnline(){return this.#e}},Ns=new ow;function sw(e){return Math.min(1e3*2**e,3e4)}function xh(e){return(e??"online")==="online"?Ns.isOnline():!0}var Ga=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function _h(e){let t=!1,n=0,r;const o=qa(),s=()=>o.status!=="pending",i=g=>{if(!s()){const v=new Ga(g);f(v),e.onCancel?.(v)}},a=()=>{t=!0},c=()=>{t=!1},l=()=>Gc.isFocused()&&(e.networkMode==="always"||Ns.isOnline())&&e.canRun(),d=()=>xh(e.networkMode)&&e.canRun(),u=g=>{s()||(r?.(),o.resolve(g))},f=g=>{s()||(r?.(),o.reject(g))},h=()=>new Promise(g=>{r=v=>{(s()||l())&&g(v)},e.onPause?.()}).then(()=>{r=void 0,s()||e.onContinue?.()}),m=()=>{if(s())return;let g;const v=n===0?e.initialPromise:void 0;try{g=v??e.fn()}catch(b){g=Promise.reject(b)}Promise.resolve(g).then(u).catch(b=>{if(s())return;const _=e.retry??(Hn?0:3),w=e.retryDelay??sw,x=typeof w=="function"?w(n,b):w,S=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,b);if(t||!S){f(b);return}n++,e.onFail?.(n,b),Jb(x).then(()=>l()?void 0:h()).then(()=>{t?f(b):m()})})};return{promise:o,status:()=>o.status,cancel:i,continue:()=>(r?.(),o),cancelRetry:a,continueRetry:c,canStart:d,start:()=>(d()?m():h().then(m),o)}}var Sh=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ba(this.gcTime)&&(this.#e=Dn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Hn?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Dn.clearTimeout(this.#e),this.#e=void 0)}},iw=class extends Sh{#e;#t;#n;#o;#r;#a;#i;constructor(e){super(),this.#i=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#o=e.client,this.#n=this.#o.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Iu(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=Iu(this.options);t.data!==void 0&&(this.setState(Au(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Ka(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(rt).catch(rt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Et(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ks||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>bn(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:!vh(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.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(t=>t!==e),this.observers.length||(this.#r&&(this.#i?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.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.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 a=this.observers.find(c=>c.options.queryFn);a&&this.setOptions(a.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,r=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},o=()=>{const a=bh(this.options,t),l=(()=>{const d={client:this.#o,queryKey:this.queryKey,meta:this.meta};return r(d),d})();return this.#i=!1,this.options.persister?this.options.persister(a,l,this):a(l)},i=(()=>{const a={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:o};return r(a),a})();this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#s({type:"fetch",meta:i.fetchOptions?.meta}),this.#r=_h({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:a=>{a instanceof Ga&&a.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(a,c)=>{this.#s({type:"failed",failureCount:a,error:c})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const a=await this.#r.start();if(a===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(a),this.#n.config.onSuccess?.(a,this),this.#n.config.onSettled?.(a,this.state.error,this),a}catch(a){if(a instanceof Ga){if(a.silent)return this.#r.promise;if(a.revert){if(this.state.data===void 0)throw a;return this.state.data}}throw this.#s({type:"error",error:a}),this.#n.config.onError?.(a,this),this.#n.config.onSettled?.(this.state.data,a,this),a}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Eh(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...Au(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const o=e.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Be.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Eh(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:xh(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Au(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Iu(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var aw=class extends wo{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#i=qa(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#o=void 0;#r;#a;#i;#s;#m;#f;#h;#l;#u;#c;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Mu(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ya(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ya(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#w(),this.#x(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=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 Et(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#_(),this.#t.setOptions(this.options),t._defaulted&&!Ha(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&Du(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#t!==n||Et(this.options.enabled,this.#t)!==Et(t.enabled,this.#t)||bn(this.options.staleTime,this.#t)!==bn(t.staleTime,this.#t))&&this.#g();const o=this.#y();r&&(this.#t!==n||Et(this.options.enabled,this.#t)!==Et(t.enabled,this.#t)||o!==this.#c)&&this.#v(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return lw(this,n)&&(this.#o=n,this.#a=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#o}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#o))}#d(e){this.#_();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(rt)),t}#g(){this.#w();const e=bn(this.options.staleTime,this.#t);if(Hn||this.#o.isStale||!Ba(e))return;const n=vh(this.#o.dataUpdatedAt,e)+1;this.#l=Dn.setTimeout(()=>{this.#o.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#c=e,!(Hn||Et(this.options.enabled,this.#t)===!1||!Ba(this.#c)||this.#c===0)&&(this.#u=Dn.setInterval(()=>{(this.options.refetchIntervalInBackground||Gc.isFocused())&&this.#d()},this.#c))}#b(){this.#g(),this.#v(this.#y())}#w(){this.#l&&(Dn.clearTimeout(this.#l),this.#l=void 0)}#x(){this.#u&&(Dn.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,r=this.options,o=this.#o,s=this.#r,i=this.#a,c=e!==n?e.state:this.#n,{state:l}=e;let d={...l},u=!1,f;if(t._optimisticResults){const E=this.hasListeners(),A=!E&&Mu(e,t),U=E&&Du(e,n,t,r);(A||U)&&(d={...d,...Eh(l.data,e.options)}),t._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:h,errorUpdatedAt:m,status:g}=d;f=d.data;let v=!1;if(t.placeholderData!==void 0&&f===void 0&&g==="pending"){let E;o?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(E=o.data,v=!0):E=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,E!==void 0&&(g="success",f=Ka(o?.data,E,t),u=!0)}if(t.select&&f!==void 0&&!v)if(o&&f===s?.data&&t.select===this.#m)f=this.#f;else try{this.#m=t.select,f=t.select(f),f=Ka(o?.data,f,t),this.#f=f,this.#s=null}catch(E){this.#s=E}this.#s&&(h=this.#s,f=this.#f,m=Date.now(),g="error");const b=d.fetchStatus==="fetching",_=g==="pending",w=g==="error",x=_&&b,S=f!==void 0,C={status:g,fetchStatus:d.fetchStatus,isPending:_,isSuccess:g==="success",isError:w,isInitialLoading:x,isLoading:x,data:f,dataUpdatedAt:d.dataUpdatedAt,error:h,errorUpdatedAt:m,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:b,isRefetching:b&&!_,isLoadingError:w&&!S,isPaused:d.fetchStatus==="paused",isPlaceholderData:u,isRefetchError:w&&S,isStale:Yc(e,t),refetch:this.refetch,promise:this.#i,isEnabled:Et(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const E=C.data!==void 0,A=C.status==="error"&&!E,U=j=>{A?j.reject(C.error):E&&j.resolve(C.data)},B=()=>{const j=this.#i=C.promise=qa();U(j)},M=this.#i;switch(M.status){case"pending":e.queryHash===n.queryHash&&U(M);break;case"fulfilled":(A||C.data!==M.value)&&B();break;case"rejected":(!A||C.error!==M.reason)&&B();break}}return C}updateResult(){const e=this.#o,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#a=this.options,this.#r.data!==void 0&&(this.#h=this.#t),Ha(t,e))return;this.#o=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,o=typeof r=="function"?r():r;if(o==="all"||!o&&!this.#p.size)return!0;const s=new Set(o??this.#p);return this.options.throwOnError&&s.add("error"),Object.keys(this.#o).some(i=>{const a=i;return this.#o[a]!==e[a]&&s.has(a)})};this.#S({listeners:n()})}#_(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#S(e){Be.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#o)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function cw(e,t){return Et(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Mu(e,t){return cw(e,t)||e.state.data!==void 0&&Ya(e,t,t.refetchOnMount)}function Ya(e,t,n){if(Et(t.enabled,e)!==!1&&bn(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Yc(e,t)}return!1}function Du(e,t,n,r){return(e!==t||Et(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Yc(e,n)}function Yc(e,t){return Et(t.enabled,e)!==!1&&e.isStaleByTime(bn(t.staleTime,e))}function lw(e,t){return!Ha(e.getCurrentResult(),t)}function ju(e){return{onFetch:(t,n)=>{const r=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const l=async()=>{let d=!1;const u=m=>{ew(m,()=>t.signal,()=>d=!0)},f=bh(t.options,t.fetchOptions),h=async(m,g,v)=>{if(d)return Promise.reject();if(g==null&&m.pages.length)return Promise.resolve(m);const _=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:g,direction:v?"backward":"forward",meta:t.options.meta};return u(P),P})(),w=await f(_),{maxPages:x}=t.options,S=v?Xb:Qb;return{pages:S(m.pages,w,x),pageParams:S(m.pageParams,g,x)}};if(o&&s.length){const m=o==="backward",g=m?uw:Lu,v={pages:s,pageParams:i},b=g(r,v);a=await h(v,b,m)}else{const m=e??s.length;do{const g=c===0?i[0]??r.initialPageParam:Lu(r,a);if(c>0&&g==null)break;a=await h(a,g),c++}while(c<m)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Lu(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function uw(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var dw=class extends Sh{#e;#t;#n;#o;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||fw(),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.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#o?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#o=_h({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(s,i)=>{this.#r({type:"failed",failureCount:s,error:i})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",o=!this.#o.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const i=await this.options.onMutate?.(e,n);i!==this.state.context&&this.#r({type:"pending",context:i,variables:e,isPaused:o})}const s=await this.#o.start();return await this.#n.config.onSuccess?.(s,e,this.state.context,this,n),await this.options.onSuccess?.(s,e,this.state.context,n),await this.#n.config.onSettled?.(s,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(s,null,e,this.state.context,n),this.#r({type:"success",data:s}),s}catch(s){try{await this.#n.config.onError?.(s,e,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onError?.(s,e,this.state.context,n)}catch(i){Promise.reject(i)}try{await this.#n.config.onSettled?.(void 0,s,this.state.variables,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onSettled?.(void 0,s,e,this.state.context,n)}catch(i){Promise.reject(i)}throw this.#r({type:"error",error:s}),s}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,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{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Be.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function fw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var hw=class extends wo{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new dw({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Bo(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Bo(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Bo(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(o=>o.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Bo(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Be.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 t={exact:!0,...e};return this.getAll().find(n=>ku(t,n))}findAll(e={}){return this.getAll().filter(t=>ku(e,t))}notify(e){Be.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Be.batch(()=>Promise.all(e.map(t=>t.continue().catch(rt))))}};function Bo(e){return e.options.scope?.id}var pw=class extends wo{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,o=t.queryHash??qc(r,t);let s=this.get(o);return s||(s=new iw({client:e,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(s)),s}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Be.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Ou(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Ou(e,n)):t}notify(e){Be.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Be.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Be.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ch=class{#e;#t;#n;#o;#r;#a;#i;#s;constructor(e={}){this.#e=e.queryCache||new pw,this.#t=e.mutationCache||new hw,this.#n=e.defaultOptions||{},this.#o=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#i=Gc.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Ns.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#i?.(),this.#i=void 0,this.#s?.(),this.#s=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 t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(bn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=this.#e.get(r.queryHash)?.state.data,i=Gb(t,s);if(i!==void 0)return this.#e.build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Be.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Be.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Be.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Be.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(rt).catch(rt)}invalidateQueries(e,t={}){return Be.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Be.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(rt)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(rt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(bn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(rt).catch(rt)}fetchInfiniteQuery(e){return e.behavior=ju(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(rt).catch(rt)}ensureInfiniteQueryData(e){return e.behavior=ju(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ns.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,t){this.#o.set(oo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#o.values()],n={};return t.forEach(r=>{so(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(oo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{so(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=qc(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===ks&&(t.enabled=!1),t}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()}},Rh=y.createContext(void 0),mw=e=>{const t=y.useContext(Rh);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Ph=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),p.jsx(Rh.Provider,{value:e,children:t})),Oh=y.createContext(!1),gw=()=>y.useContext(Oh);Oh.Provider;function yw(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var vw=y.createContext(yw()),bw=()=>y.useContext(vw),ww=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?wh(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},xw=e=>{y.useEffect(()=>{e.clearReset()},[e])},_w=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||wh(n,[e.error,r])),Sw=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>n(r(...o)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Ew=(e,t)=>e.isLoading&&e.isFetching&&!t,Cw=(e,t)=>e?.suspense&&t.isPending,Fu=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Rw(e,t,n){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=gw(),o=bw(),s=mw(),i=s.defaultQueryOptions(e);s.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const a=s.getQueryCache().get(i.queryHash);process.env.NODE_ENV!=="production"&&(i.queryFn||console.error(`[${i.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),i._optimisticResults=r?"isRestoring":"optimistic",Sw(i),ww(i,o,a),xw(o);const c=!s.getQueryCache().get(i.queryHash),[l]=y.useState(()=>new t(s,i)),d=l.getOptimisticResult(i),u=!r&&e.subscribed!==!1;if(y.useSyncExternalStore(y.useCallback(f=>{const h=u?l.subscribe(Be.batchCalls(f)):rt;return l.updateResult(),h},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),y.useEffect(()=>{l.setOptions(i)},[i,l]),Cw(i,d))throw Fu(i,l,o);if(_w({result:d,errorResetBoundary:o,throwOnError:i.throwOnError,query:a,suspense:i.suspense}))throw d.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(i,d),i.experimental_prefetchInRender&&!Hn&&Ew(d,r)&&(c?Fu(i,l,o):a?.promise)?.catch(rt).finally(()=>{l.updateResult()}),i.notifyOnChangeProps?d:l.trackResult(d)}function Ja(e,t){return Rw(e,aw)}var Wo={exports:{}},ca={};var $u;function Pw(){if($u)return ca;$u=1;var e=k;function t(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,o=e.useRef,s=e.useEffect,i=e.useMemo,a=e.useDebugValue;return ca.useSyncExternalStoreWithSelector=function(c,l,d,u,f){var h=o(null);if(h.current===null){var m={hasValue:!1,value:null};h.current=m}else m=h.current;h=i(function(){function v(S){if(!b){if(b=!0,_=S,S=u(S),f!==void 0&&m.hasValue){var P=m.value;if(f(P,S))return w=P}return w=S}if(P=w,n(_,S))return P;var C=u(S);return f!==void 0&&f(P,C)?(_=S,P):(_=S,w=C)}var b=!1,_,w,x=d===void 0?null:d;return[function(){return v(l())},x===null?void 0:function(){return v(x())}]},[l,d,u,f]);var g=r(c,h[0],h[1]);return s(function(){m.hasValue=!0,m.value=g},[g]),a(g),g},ca}var la={};var zu;function Ow(){return zu||(zu=1,process.env.NODE_ENV!=="production"&&(function(){function e(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=k,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,s=t.useEffect,i=t.useMemo,a=t.useDebugValue;la.useSyncExternalStoreWithSelector=function(c,l,d,u,f){var h=o(null);if(h.current===null){var m={hasValue:!1,value:null};h.current=m}else m=h.current;h=i(function(){function v(S){if(!b){if(b=!0,_=S,S=u(S),f!==void 0&&m.hasValue){var P=m.value;if(f(P,S))return w=P}return w=S}if(P=w,n(_,S))return P;var C=u(S);return f!==void 0&&f(P,C)?(_=S,P):(_=S,w=C)}var b=!1,_,w,x=d===void 0?null:d;return[function(){return v(l())},x===null?void 0:function(){return v(x())}]},[l,d,u,f]);var g=r(c,h[0],h[1]);return s(function(){m.hasValue=!0,m.value=g},[g]),a(g),g},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),la}var Vu;function kw(){return Vu||(Vu=1,process.env.NODE_ENV==="production"?Wo.exports=Pw():Wo.exports=Ow()),Wo.exports}var Nw=kw();function Tw(e){e()}function Aw(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Tw(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const o=t={callback:n,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){!r||e===null||(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}var Uu={notify(){},get:()=>[]};function Iw(e,t){let n,r=Uu,o=0,s=!1;function i(g){d();const v=r.subscribe(g);let b=!1;return()=>{b||(b=!0,v(),u())}}function a(){r.notify()}function c(){m.onStateChange&&m.onStateChange()}function l(){return s}function d(){o++,n||(n=e.subscribe(c),r=Aw())}function u(){o--,n&&o===0&&(n(),n=void 0,r.clear(),r=Uu)}function f(){s||(s=!0,d())}function h(){s&&(s=!1,u())}const m={addNestedSub:i,notifyNestedSubs:a,handleChangeWrapper:c,isSubscribed:l,trySubscribe:f,tryUnsubscribe:h,getListeners:()=>r};return m}var Mw=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Dw=Mw(),jw=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Lw=jw(),Fw=()=>Dw||Lw?y.useLayoutEffect:y.useEffect,$w=Fw(),zw=Symbol.for("react-redux-context"),Vw=typeof globalThis<"u"?globalThis:{};function Uw(){if(!y.createContext)return{};const e=Vw[zw]??=new Map;let t=e.get(y.createContext);return t||(t=y.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(y.createContext,t)),t}var wn=Uw();function Bw(e){const{children:t,context:n,serverState:r,store:o}=e,s=y.useMemo(()=>{const c=Iw(o),l={store:o,subscription:c,getServerState:r?()=>r:void 0};if(process.env.NODE_ENV==="production")return l;{const{identityFunctionCheck:d="once",stabilityCheck:u="once"}=e;return Object.assign(l,{stabilityCheck:u,identityFunctionCheck:d})}},[o,r]),i=y.useMemo(()=>o.getState(),[o]);$w(()=>{const{subscription:c}=s;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),i!==o.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[s,i]);const a=n||wn;return y.createElement(a.Provider,{value:s},t)}var kh=Bw;function Jc(e=wn){return function(){const n=y.useContext(e);if(process.env.NODE_ENV!=="production"&&!n)throw new Error("could not find react-redux context value; please ensure the component is wrapped in a <Provider>");return n}}var Nh=Jc();function Th(e=wn){const t=e===wn?Nh:Jc(e),n=()=>{const{store:r}=t();return r};return Object.assign(n,{withTypes:()=>n}),n}var Ww=Th();function Hw(e=wn){const t=e===wn?Ww:Th(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var Zw=Hw(),Kw=(e,t)=>e===t;function qw(e=wn){const t=e===wn?Nh:Jc(e),n=(r,o={})=>{const{equalityFn:s=Kw}=typeof o=="function"?{equalityFn:o}:o;if(process.env.NODE_ENV!=="production"){if(!r)throw new Error("You must pass a selector to useSelector");if(typeof r!="function")throw new Error("You must pass a function as a selector to useSelector");if(typeof s!="function")throw new Error("You must pass a function as an equality function to useSelector")}const i=t(),{store:a,subscription:c,getServerState:l}=i,d=y.useRef(!0),u=y.useCallback({[r.name](h){const m=r(h);if(process.env.NODE_ENV!=="production"){const{devModeChecks:g={}}=typeof o=="function"?{}:o,{identityFunctionCheck:v,stabilityCheck:b}=i,{identityFunctionCheck:_,stabilityCheck:w}={stabilityCheck:b,identityFunctionCheck:v,...g};if(w==="always"||w==="once"&&d.current){const x=r(h);if(!s(m,x)){let S;try{throw new Error}catch(P){({stack:S}=P)}console.warn("Selector "+(r.name||"unknown")+` returned a different result when called with the same parameters. This can lead to unnecessary rerenders.
|
|
7
|
+
Selectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization`,{state:h,selected:m,selected2:x,stack:S})}}if((_==="always"||_==="once"&&d.current)&&m===h){let x;try{throw new Error}catch(S){({stack:x}=S)}console.warn("Selector "+(r.name||"unknown")+` returned the root state when called. This can lead to unnecessary rerenders.
|
|
8
|
+
Selectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.`,{stack:x})}d.current&&(d.current=!1)}return m}}[r.name],[r]),f=Nw.useSyncExternalStoreWithSelector(c.addNestedSub,a.getState,l||a.getState,u,s);return y.useDebugValue(f),f};return Object.assign(n,{withTypes:()=>n}),n}var Gw=qw();function Yw(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Jw=e=>{switch(e){case"success":return ex;case"info":return nx;case"warning":return tx;case"error":return rx;default:return null}},Qw=Array(12).fill(0),Xw=({visible:e,className:t})=>k.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},k.createElement("div",{className:"sonner-spinner"},Qw.map((n,r)=>k.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),ex=k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},k.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"})),tx=k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},k.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"})),nx=k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},k.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"})),rx=k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},k.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"})),ox=k.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"},k.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),k.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),sx=()=>{const[e,t]=k.useState(document.hidden);return k.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Qa=1;class ix{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...o}=t,s=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Qa++,i=this.toasts.find(c=>c.id===s),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(c=>c.id===s?(this.publish({...c,...t,id:s,title:r}),{...c,...t,id:s,dismissible:a,title:r}):c):this.addToast({title:r,...o,dismissible:a,id:s}),s},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let s=r!==void 0,i;const a=o.then(async l=>{if(i=["resolve",l],k.isValidElement(l))s=!1,this.create({id:r,type:"default",message:l});else if(cx(l)&&!l.ok){s=!1;const u=typeof n.error=="function"?await n.error(`HTTP error! status: ${l.status}`):n.error,f=typeof n.description=="function"?await n.description(`HTTP error! status: ${l.status}`):n.description,m=typeof u=="object"&&!k.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:f,...m})}else if(l instanceof Error){s=!1;const u=typeof n.error=="function"?await n.error(l):n.error,f=typeof n.description=="function"?await n.description(l):n.description,m=typeof u=="object"&&!k.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:f,...m})}else if(n.success!==void 0){s=!1;const u=typeof n.success=="function"?await n.success(l):n.success,f=typeof n.description=="function"?await n.description(l):n.description,m=typeof u=="object"&&!k.isValidElement(u)?u:{message:u};this.create({id:r,type:"success",description:f,...m})}}).catch(async l=>{if(i=["reject",l],n.error!==void 0){s=!1;const d=typeof n.error=="function"?await n.error(l):n.error,u=typeof n.description=="function"?await n.description(l):n.description,h=typeof d=="object"&&!k.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:u,...h})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((l,d)=>a.then(()=>i[0]==="reject"?d(i[1]):l(i[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{const r=n?.id||Qa++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const nt=new ix,ax=(e,t)=>{const n=t?.id||Qa++;return nt.addToast({title:e,...t,id:n}),n},cx=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",lx=ax,ux=()=>nt.toasts,dx=()=>nt.getActiveToasts(),ze=Object.assign(lx,{success:nt.success,info:nt.info,warning:nt.warning,error:nt.error,custom:nt.custom,message:nt.message,promise:nt.promise,dismiss:nt.dismiss,loading:nt.loading},{getHistory:ux,getToasts:dx});Yw("[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 Ho(e){return e.label!==void 0}const fx=3,hx="24px",px="16px",Bu=4e3,mx=356,gx=14,yx=45,vx=200;function Bt(...e){return e.filter(Boolean).join(" ")}function bx(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const wx=e=>{var t,n,r,o,s,i,a,c,l;const{invert:d,toast:u,unstyled:f,interacting:h,setHeights:m,visibleToasts:g,heights:v,index:b,toasts:_,expanded:w,removeToast:x,defaultRichColors:S,closeButton:P,style:C,cancelButtonStyle:E,actionButtonStyle:A,className:U="",descriptionClassName:B="",duration:M,position:j,gap:V,expandByDefault:Y,classNames:L,icons:K,closeButtonAriaLabel:D="Close toast"}=e,[H,se]=k.useState(null),[N,Q]=k.useState(null),[W,Z]=k.useState(!1),[ie,fe]=k.useState(!1),[F,ee]=k.useState(!1),[pe,ce]=k.useState(!1),[ue,me]=k.useState(!1),[Oe,qe]=k.useState(0),[Nt,gt]=k.useState(0),Le=k.useRef(u.duration||M||Bu),un=k.useRef(null),Fe=k.useRef(null),sr=b===0,R=b+1<=g,O=u.type,I=u.dismissible!==!1,J=u.className||"",q=u.descriptionClassName||"",$=k.useMemo(()=>v.findIndex(de=>de.toastId===u.id)||0,[v,u.id]),X=k.useMemo(()=>{var de;return(de=u.closeButton)!=null?de:P},[u.closeButton,P]),le=k.useMemo(()=>u.duration||M||Bu,[u.duration,M]),ge=k.useRef(0),Re=k.useRef(0),Ut=k.useRef(0),Ge=k.useRef(null),[Zi,Mr]=j.split("-"),ir=k.useMemo(()=>v.reduce((de,$e,He)=>He>=$?de:de+$e.height,0),[v,$]),Io=sx(),Mo=u.invert||d,Dr=O==="loading";Re.current=k.useMemo(()=>$*V+ir,[$,ir]),k.useEffect(()=>{Le.current=le},[le]),k.useEffect(()=>{Z(!0)},[]),k.useEffect(()=>{const de=Fe.current;if(de){const $e=de.getBoundingClientRect().height;return gt($e),m(He=>[{toastId:u.id,height:$e,position:u.position},...He]),()=>m(He=>He.filter(ct=>ct.toastId!==u.id))}},[m,u.id]),k.useLayoutEffect(()=>{if(!W)return;const de=Fe.current,$e=de.style.height;de.style.height="auto";const He=de.getBoundingClientRect().height;de.style.height=$e,gt(He),m(ct=>ct.find(Ve=>Ve.toastId===u.id)?ct.map(Ve=>Ve.toastId===u.id?{...Ve,height:He}:Ve):[{toastId:u.id,height:He,position:u.position},...ct])},[W,u.title,u.description,m,u.id,u.jsx,u.action,u.cancel]);const Tt=k.useCallback(()=>{fe(!0),qe(Re.current),m(de=>de.filter($e=>$e.toastId!==u.id)),setTimeout(()=>{x(u)},vx)},[u,x,m,Re]);k.useEffect(()=>{if(u.promise&&O==="loading"||u.duration===1/0||u.type==="loading")return;let de;return w||h||Io?(()=>{if(Ut.current<ge.current){const ct=new Date().getTime()-ge.current;Le.current=Le.current-ct}Ut.current=new Date().getTime()})():Le.current!==1/0&&(ge.current=new Date().getTime(),de=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),Tt()},Le.current)),()=>clearTimeout(de)},[w,h,u,O,Io,Tt]),k.useEffect(()=>{u.delete&&(Tt(),u.onDismiss==null||u.onDismiss.call(u,u))},[Tt,u.delete]);function tv(){var de;if(K?.loading){var $e;return k.createElement("div",{className:Bt(L?.loader,u==null||($e=u.classNames)==null?void 0:$e.loader,"sonner-loader"),"data-visible":O==="loading"},K.loading)}return k.createElement(Xw,{className:Bt(L?.loader,u==null||(de=u.classNames)==null?void 0:de.loader),visible:O==="loading"})}const nv=u.icon||K?.[O]||Jw(O);var Gl,Yl;return k.createElement("li",{tabIndex:0,ref:Fe,className:Bt(U,J,L?.toast,u==null||(t=u.classNames)==null?void 0:t.toast,L?.default,L?.[O],u==null||(n=u.classNames)==null?void 0:n[O]),"data-sonner-toast":"","data-rich-colors":(Gl=u.richColors)!=null?Gl:S,"data-styled":!(u.jsx||u.unstyled||f),"data-mounted":W,"data-promise":!!u.promise,"data-swiped":ue,"data-removed":ie,"data-visible":R,"data-y-position":Zi,"data-x-position":Mr,"data-index":b,"data-front":sr,"data-swiping":F,"data-dismissible":I,"data-type":O,"data-invert":Mo,"data-swipe-out":pe,"data-swipe-direction":N,"data-expanded":!!(w||Y&&W),"data-testid":u.testId,style:{"--index":b,"--toasts-before":b,"--z-index":_.length-b,"--offset":`${ie?Oe:Re.current}px`,"--initial-height":Y?"auto":`${Nt}px`,...C,...u.style},onDragEnd:()=>{ee(!1),se(null),Ge.current=null},onPointerDown:de=>{de.button!==2&&(Dr||!I||(un.current=new Date,qe(Re.current),de.target.setPointerCapture(de.pointerId),de.target.tagName!=="BUTTON"&&(ee(!0),Ge.current={x:de.clientX,y:de.clientY})))},onPointerUp:()=>{var de,$e,He;if(pe||!I)return;Ge.current=null;const ct=Number(((de=Fe.current)==null?void 0:de.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Do=Number((($e=Fe.current)==null?void 0:$e.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ve=new Date().getTime()-((He=un.current)==null?void 0:He.getTime()),yt=H==="x"?ct:Do,jo=Math.abs(yt)/Ve;if(Math.abs(yt)>=yx||jo>.11){qe(Re.current),u.onDismiss==null||u.onDismiss.call(u,u),Q(H==="x"?ct>0?"right":"left":Do>0?"down":"up"),Tt(),ce(!0);return}else{var At,It;(At=Fe.current)==null||At.style.setProperty("--swipe-amount-x","0px"),(It=Fe.current)==null||It.style.setProperty("--swipe-amount-y","0px")}me(!1),ee(!1),se(null)},onPointerMove:de=>{var $e,He,ct;if(!Ge.current||!I||(($e=window.getSelection())==null?void 0:$e.toString().length)>0)return;const Ve=de.clientY-Ge.current.y,yt=de.clientX-Ge.current.x;var jo;const At=(jo=e.swipeDirections)!=null?jo:bx(j);!H&&(Math.abs(yt)>1||Math.abs(Ve)>1)&&se(Math.abs(yt)>Math.abs(Ve)?"x":"y");let It={x:0,y:0};const Jl=Nn=>1/(1.5+Math.abs(Nn)/20);if(H==="y"){if(At.includes("top")||At.includes("bottom"))if(At.includes("top")&&Ve<0||At.includes("bottom")&&Ve>0)It.y=Ve;else{const Nn=Ve*Jl(Ve);It.y=Math.abs(Nn)<Math.abs(Ve)?Nn:Ve}}else if(H==="x"&&(At.includes("left")||At.includes("right")))if(At.includes("left")&&yt<0||At.includes("right")&&yt>0)It.x=yt;else{const Nn=yt*Jl(yt);It.x=Math.abs(Nn)<Math.abs(yt)?Nn:yt}(Math.abs(It.x)>0||Math.abs(It.y)>0)&&me(!0),(He=Fe.current)==null||He.style.setProperty("--swipe-amount-x",`${It.x}px`),(ct=Fe.current)==null||ct.style.setProperty("--swipe-amount-y",`${It.y}px`)}},X&&!u.jsx&&O!=="loading"?k.createElement("button",{"aria-label":D,"data-disabled":Dr,"data-close-button":!0,onClick:Dr||!I?()=>{}:()=>{Tt(),u.onDismiss==null||u.onDismiss.call(u,u)},className:Bt(L?.closeButton,u==null||(r=u.classNames)==null?void 0:r.closeButton)},(Yl=K?.close)!=null?Yl:ox):null,(O||u.icon||u.promise)&&u.icon!==null&&(K?.[O]!==null||u.icon)?k.createElement("div",{"data-icon":"",className:Bt(L?.icon,u==null||(o=u.classNames)==null?void 0:o.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||tv():null,u.type!=="loading"?nv:null):null,k.createElement("div",{"data-content":"",className:Bt(L?.content,u==null||(s=u.classNames)==null?void 0:s.content)},k.createElement("div",{"data-title":"",className:Bt(L?.title,u==null||(i=u.classNames)==null?void 0:i.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?k.createElement("div",{"data-description":"",className:Bt(B,q,L?.description,u==null||(a=u.classNames)==null?void 0:a.description)},typeof u.description=="function"?u.description():u.description):null),k.isValidElement(u.cancel)?u.cancel:u.cancel&&Ho(u.cancel)?k.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||E,onClick:de=>{Ho(u.cancel)&&I&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,de),Tt())},className:Bt(L?.cancelButton,u==null||(c=u.classNames)==null?void 0:c.cancelButton)},u.cancel.label):null,k.isValidElement(u.action)?u.action:u.action&&Ho(u.action)?k.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||A,onClick:de=>{Ho(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,de),!de.defaultPrevented&&Tt())},className:Bt(L?.actionButton,u==null||(l=u.classNames)==null?void 0:l.actionButton)},u.action.label):null)};function Wu(){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 xx(e,t){const n={};return[e,t].forEach((r,o)=>{const s=o===1,i=s?"--mobile-offset":"--offset",a=s?px:hx;function c(l){["top","right","bottom","left"].forEach(d=>{n[`${i}-${d}`]=typeof l=="number"?`${l}px`:l})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(l=>{r[l]===void 0?n[`${i}-${l}`]=a:n[`${i}-${l}`]=typeof r[l]=="number"?`${r[l]}px`:r[l]}):c(a)}),n}const _x=k.forwardRef(function(t,n){const{id:r,invert:o,position:s="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:c,className:l,offset:d,mobileOffset:u,theme:f="light",richColors:h,duration:m,style:g,visibleToasts:v=fx,toastOptions:b,dir:_=Wu(),gap:w=gx,icons:x,containerAriaLabel:S="Notifications"}=t,[P,C]=k.useState([]),E=k.useMemo(()=>r?P.filter(W=>W.toasterId===r):P.filter(W=>!W.toasterId),[P,r]),A=k.useMemo(()=>Array.from(new Set([s].concat(E.filter(W=>W.position).map(W=>W.position)))),[E,s]),[U,B]=k.useState([]),[M,j]=k.useState(!1),[V,Y]=k.useState(!1),[L,K]=k.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),D=k.useRef(null),H=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),se=k.useRef(null),N=k.useRef(!1),Q=k.useCallback(W=>{C(Z=>{var ie;return(ie=Z.find(fe=>fe.id===W.id))!=null&&ie.delete||nt.dismiss(W.id),Z.filter(({id:fe})=>fe!==W.id)})},[]);return k.useEffect(()=>nt.subscribe(W=>{if(W.dismiss){requestAnimationFrame(()=>{C(Z=>Z.map(ie=>ie.id===W.id?{...ie,delete:!0}:ie))});return}setTimeout(()=>{ni.flushSync(()=>{C(Z=>{const ie=Z.findIndex(fe=>fe.id===W.id);return ie!==-1?[...Z.slice(0,ie),{...Z[ie],...W},...Z.slice(ie+1)]:[W,...Z]})})})}),[P]),k.useEffect(()=>{if(f!=="system"){K(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?K("dark"):K("light")),typeof window>"u")return;const W=window.matchMedia("(prefers-color-scheme: dark)");try{W.addEventListener("change",({matches:Z})=>{K(Z?"dark":"light")})}catch{W.addListener(({matches:ie})=>{try{K(ie?"dark":"light")}catch(fe){console.error(fe)}})}},[f]),k.useEffect(()=>{P.length<=1&&j(!1)},[P]),k.useEffect(()=>{const W=Z=>{var ie;if(i.every(ee=>Z[ee]||Z.code===ee)){var F;j(!0),(F=D.current)==null||F.focus()}Z.code==="Escape"&&(document.activeElement===D.current||(ie=D.current)!=null&&ie.contains(document.activeElement))&&j(!1)};return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[i]),k.useEffect(()=>{if(D.current)return()=>{se.current&&(se.current.focus({preventScroll:!0}),se.current=null,N.current=!1)}},[D.current]),k.createElement("section",{ref:n,"aria-label":`${S} ${H}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},A.map((W,Z)=>{var ie;const[fe,F]=W.split("-");return E.length?k.createElement("ol",{key:W,dir:_==="auto"?Wu():_,tabIndex:-1,ref:D,className:l,"data-sonner-toaster":!0,"data-sonner-theme":L,"data-y-position":fe,"data-x-position":F,style:{"--front-toast-height":`${((ie=U[0])==null?void 0:ie.height)||0}px`,"--width":`${mx}px`,"--gap":`${w}px`,...g,...xx(d,u)},onBlur:ee=>{N.current&&!ee.currentTarget.contains(ee.relatedTarget)&&(N.current=!1,se.current&&(se.current.focus({preventScroll:!0}),se.current=null))},onFocus:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||N.current||(N.current=!0,se.current=ee.relatedTarget)},onMouseEnter:()=>j(!0),onMouseMove:()=>j(!0),onMouseLeave:()=>{V||j(!1)},onDragEnd:()=>j(!1),onPointerDown:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||Y(!0)},onPointerUp:()=>Y(!1)},E.filter(ee=>!ee.position&&Z===0||ee.position===W).map((ee,pe)=>{var ce,ue;return k.createElement(wx,{key:ee.id,icons:x,index:pe,toast:ee,defaultRichColors:h,duration:(ce=b?.duration)!=null?ce:m,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:o,visibleToasts:v,closeButton:(ue=b?.closeButton)!=null?ue:c,interacting:V,position:W,style:b?.style,unstyled:b?.unstyled,classNames:b?.classNames,cancelButtonStyle:b?.cancelButtonStyle,actionButtonStyle:b?.actionButtonStyle,closeButtonAriaLabel:b?.closeButtonAriaLabel,removeToast:Q,toasts:E.filter(me=>me.position==ee.position),heights:U.filter(me=>me.position==ee.position),setHeights:B,expandByDefault:a,gap:w,expanded:M,swipeDirections:t.swipeDirections})})):null}))}),Hu=e=>{let t;const n=new Set,r=(l,d)=>{const u=typeof l=="function"?l(t):l;if(!Object.is(u,t)){const f=t;t=d??(typeof u!="object"||u===null)?u:Object.assign({},t,u),n.forEach(h=>h(t,f))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l))},c=t=e(r,o,a);return a},Sx=(e=>e?Hu(e):Hu),Ex=e=>e;function Cx(e,t=Ex){const n=k.useSyncExternalStore(e.subscribe,k.useCallback(()=>t(e.getState()),[e,t]),k.useCallback(()=>t(e.getInitialState()),[e,t]));return k.useDebugValue(n),n}const Zu=e=>{const t=Sx(e),n=r=>Cx(t,r);return Object.assign(n,t),n},Ah=(e=>e?Zu(e):Zu);function Rx(e,t){let n;try{n=e()}catch{return}return{getItem:o=>{var s;const i=c=>c===null?null:JSON.parse(c,void 0),a=(s=n.getItem(o))!=null?s:null;return a instanceof Promise?a.then(i):i(a)},setItem:(o,s)=>n.setItem(o,JSON.stringify(s,void 0)),removeItem:o=>n.removeItem(o)}}const Xa=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Xa(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Xa(r)(n)}}}},Px=(e,t)=>(n,r,o)=>{let s={storage:Rx(()=>localStorage),partialize:v=>v,version:0,merge:(v,b)=>({...b,...v}),...t},i=!1,a=0;const c=new Set,l=new Set;let d=s.storage;if(!d)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...v)},r,o);const u=()=>{const v=s.partialize({...r()});return d.setItem(s.name,{state:v,version:s.version})},f=o.setState;o.setState=(v,b)=>(f(v,b),u());const h=e((...v)=>(n(...v),u()),r,o);o.getInitialState=()=>h;let m;const g=()=>{var v,b;if(!d)return;const _=++a;i=!1,c.forEach(x=>{var S;return x((S=r())!=null?S:h)});const w=((b=s.onRehydrateStorage)==null?void 0:b.call(s,(v=r())!=null?v:h))||void 0;return Xa(d.getItem.bind(d))(s.name).then(x=>{if(x)if(typeof x.version=="number"&&x.version!==s.version){if(s.migrate){const S=s.migrate(x.state,x.version);return S instanceof Promise?S.then(P=>[!0,P]):[!0,S]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,x.state];return[!1,void 0]}).then(x=>{var S;if(_!==a)return;const[P,C]=x;if(m=s.merge(C,(S=r())!=null?S:h),n(m,!0),P)return u()}).then(()=>{_===a&&(w?.(m,void 0),m=r(),i=!0,l.forEach(x=>x(m)))}).catch(x=>{_===a&&w?.(void 0,x)})};return o.persist={setOptions:v=>{s={...s,...v},v.storage&&(d=v.storage)},clearStorage:()=>{d?.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>g(),hasHydrated:()=>i,onHydrate:v=>(c.add(v),()=>{c.delete(v)}),onFinishHydration:v=>(l.add(v),()=>{l.delete(v)})},s.skipHydration||g(),m||h},Ox=Px;function Ih(e,t){return function(){return e.apply(t,arguments)}}const{toString:kx}=Object.prototype,{getPrototypeOf:Qc}=Object,{iterator:ai,toStringTag:Mh}=Symbol,ci=(e=>t=>{const n=kx.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),zt=e=>(e=e.toLowerCase(),t=>ci(t)===e),li=e=>t=>typeof t===e,{isArray:Pr}=Array,Er=li("undefined");function xo(e){return e!==null&&!Er(e)&&e.constructor!==null&&!Er(e.constructor)&&st(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Dh=zt("ArrayBuffer");function Nx(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Dh(e.buffer),t}const Tx=li("string"),st=li("function"),jh=li("number"),_o=e=>e!==null&&typeof e=="object",Ax=e=>e===!0||e===!1,hs=e=>{if(ci(e)!=="object")return!1;const t=Qc(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Mh in e)&&!(ai in e)},Ix=e=>{if(!_o(e)||xo(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Mx=zt("Date"),Dx=zt("File"),jx=zt("Blob"),Lx=zt("FileList"),Fx=e=>_o(e)&&st(e.pipe),$x=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||st(e.append)&&((t=ci(e))==="formdata"||t==="object"&&st(e.toString)&&e.toString()==="[object FormData]"))},zx=zt("URLSearchParams"),[Vx,Ux,Bx,Wx]=["ReadableStream","Request","Response","Headers"].map(zt),Hx=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function So(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),Pr(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(xo(e))return;const s=n?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length;let a;for(r=0;r<i;r++)a=s[r],t.call(null,e[a],a,e)}}function Lh(e,t){if(xo(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,o;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const jn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Fh=e=>!Er(e)&&e!==jn;function ec(){const{caseless:e,skipUndefined:t}=Fh(this)&&this||{},n={},r=(o,s)=>{const i=e&&Lh(n,s)||s;hs(n[i])&&hs(o)?n[i]=ec(n[i],o):hs(o)?n[i]=ec({},o):Pr(o)?n[i]=o.slice():(!t||!Er(o))&&(n[i]=o)};for(let o=0,s=arguments.length;o<s;o++)arguments[o]&&So(arguments[o],r);return n}const Zx=(e,t,n,{allOwnKeys:r}={})=>(So(t,(o,s)=>{n&&st(o)?Object.defineProperty(e,s,{value:Ih(o,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),Kx=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),qx=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Gx=(e,t,n,r)=>{let o,s,i;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],(!r||r(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&Qc(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Yx=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Jx=e=>{if(!e)return null;if(Pr(e))return e;let t=e.length;if(!jh(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Qx=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Qc(Uint8Array)),Xx=(e,t)=>{const r=(e&&e[ai]).call(e);let o;for(;(o=r.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},e_=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},t_=zt("HTMLFormElement"),n_=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),Ku=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),r_=zt("RegExp"),$h=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};So(n,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(r[s]=i||o)}),Object.defineProperties(e,r)},o_=e=>{$h(e,(t,n)=>{if(st(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(st(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},s_=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return Pr(e)?r(e):r(String(e).split(t)),n},i_=()=>{},a_=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function c_(e){return!!(e&&st(e.append)&&e[Mh]==="FormData"&&e[ai])}const l_=e=>{const t=new Array(10),n=(r,o)=>{if(_o(r)){if(t.indexOf(r)>=0)return;if(xo(r))return r;if(!("toJSON"in r)){t[o]=r;const s=Pr(r)?[]:{};return So(r,(i,a)=>{const c=n(i,o+1);!Er(c)&&(s[a]=c)}),t[o]=void 0,s}}return r};return n(e,0)},u_=zt("AsyncFunction"),d_=e=>e&&(_o(e)||st(e))&&st(e.then)&&st(e.catch),zh=((e,t)=>e?setImmediate:t?((n,r)=>(jn.addEventListener("message",({source:o,data:s})=>{o===jn&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),jn.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",st(jn.postMessage)),f_=typeof queueMicrotask<"u"?queueMicrotask.bind(jn):typeof process<"u"&&process.nextTick||zh,h_=e=>e!=null&&st(e[ai]),T={isArray:Pr,isArrayBuffer:Dh,isBuffer:xo,isFormData:$x,isArrayBufferView:Nx,isString:Tx,isNumber:jh,isBoolean:Ax,isObject:_o,isPlainObject:hs,isEmptyObject:Ix,isReadableStream:Vx,isRequest:Ux,isResponse:Bx,isHeaders:Wx,isUndefined:Er,isDate:Mx,isFile:Dx,isBlob:jx,isRegExp:r_,isFunction:st,isStream:Fx,isURLSearchParams:zx,isTypedArray:Qx,isFileList:Lx,forEach:So,merge:ec,extend:Zx,trim:Hx,stripBOM:Kx,inherits:qx,toFlatObject:Gx,kindOf:ci,kindOfTest:zt,endsWith:Yx,toArray:Jx,forEachEntry:Xx,matchAll:e_,isHTMLForm:t_,hasOwnProperty:Ku,hasOwnProp:Ku,reduceDescriptors:$h,freezeMethods:o_,toObjectSet:s_,toCamelCase:n_,noop:i_,toFiniteNumber:a_,findKey:Lh,global:jn,isContextDefined:Fh,isSpecCompliantForm:c_,toJSONObject:l_,isAsyncFn:u_,isThenable:d_,setImmediate:zh,asap:f_,isIterable:h_};let ae=class Vh extends Error{static from(t,n,r,o,s,i){const a=new Vh(t.message,n||t.code,r,o,s);return a.cause=t,a.name=t.name,i&&Object.assign(a,i),a}constructor(t,n,r,o,s){super(t),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),o&&(this.request=o),s&&(this.response=s,this.status=s.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:T.toJSONObject(this.config),code:this.code,status:this.status}}};ae.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";ae.ERR_BAD_OPTION="ERR_BAD_OPTION";ae.ECONNABORTED="ECONNABORTED";ae.ETIMEDOUT="ETIMEDOUT";ae.ERR_NETWORK="ERR_NETWORK";ae.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";ae.ERR_DEPRECATED="ERR_DEPRECATED";ae.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";ae.ERR_BAD_REQUEST="ERR_BAD_REQUEST";ae.ERR_CANCELED="ERR_CANCELED";ae.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";ae.ERR_INVALID_URL="ERR_INVALID_URL";const p_=null;function tc(e){return T.isPlainObject(e)||T.isArray(e)}function Uh(e){return T.endsWith(e,"[]")?e.slice(0,-2):e}function qu(e,t,n){return e?e.concat(t).map(function(o,s){return o=Uh(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function m_(e){return T.isArray(e)&&!e.some(tc)}const g_=T.toFlatObject(T,{},null,function(t){return/^is[A-Z]/.test(t)});function ui(e,t,n){if(!T.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=T.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,v){return!T.isUndefined(v[g])});const r=n.metaTokens,o=n.visitor||d,s=n.dots,i=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&T.isSpecCompliantForm(t);if(!T.isFunction(o))throw new TypeError("visitor must be a function");function l(m){if(m===null)return"";if(T.isDate(m))return m.toISOString();if(T.isBoolean(m))return m.toString();if(!c&&T.isBlob(m))throw new ae("Blob is not supported. Use a Buffer instead.");return T.isArrayBuffer(m)||T.isTypedArray(m)?c&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function d(m,g,v){let b=m;if(m&&!v&&typeof m=="object"){if(T.endsWith(g,"{}"))g=r?g:g.slice(0,-2),m=JSON.stringify(m);else if(T.isArray(m)&&m_(m)||(T.isFileList(m)||T.endsWith(g,"[]"))&&(b=T.toArray(m)))return g=Uh(g),b.forEach(function(w,x){!(T.isUndefined(w)||w===null)&&t.append(i===!0?qu([g],x,s):i===null?g:g+"[]",l(w))}),!1}return tc(m)?!0:(t.append(qu(v,g,s),l(m)),!1)}const u=[],f=Object.assign(g_,{defaultVisitor:d,convertValue:l,isVisitable:tc});function h(m,g){if(!T.isUndefined(m)){if(u.indexOf(m)!==-1)throw Error("Circular reference detected in "+g.join("."));u.push(m),T.forEach(m,function(b,_){(!(T.isUndefined(b)||b===null)&&o.call(t,b,T.isString(_)?_.trim():_,g,f))===!0&&h(b,g?g.concat(_):[_])}),u.pop()}}if(!T.isObject(e))throw new TypeError("data must be an object");return h(e),t}function Gu(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Xc(e,t){this._pairs=[],e&&ui(e,this,t)}const Bh=Xc.prototype;Bh.append=function(t,n){this._pairs.push([t,n])};Bh.toString=function(t){const n=t?function(r){return t.call(this,r,Gu)}:Gu;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function y_(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Wh(e,t,n){if(!t)return e;const r=n&&n.encode||y_,o=T.isFunction(n)?{serialize:n}:n,s=o&&o.serialize;let i;if(s?i=s(t,o):i=T.isURLSearchParams(t)?t.toString():new Xc(t,o).toString(r),i){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Yu{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){T.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Hh={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},v_=typeof URLSearchParams<"u"?URLSearchParams:Xc,b_=typeof FormData<"u"?FormData:null,w_=typeof Blob<"u"?Blob:null,x_={isBrowser:!0,classes:{URLSearchParams:v_,FormData:b_,Blob:w_},protocols:["http","https","file","blob","url","data"]},el=typeof window<"u"&&typeof document<"u",nc=typeof navigator=="object"&&navigator||void 0,__=el&&(!nc||["ReactNative","NativeScript","NS"].indexOf(nc.product)<0),S_=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",E_=el&&window.location.href||"http://localhost",C_=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:el,hasStandardBrowserEnv:__,hasStandardBrowserWebWorkerEnv:S_,navigator:nc,origin:E_},Symbol.toStringTag,{value:"Module"})),Ze={...C_,...x_};function R_(e,t){return ui(e,new Ze.classes.URLSearchParams,{visitor:function(n,r,o,s){return Ze.isNode&&T.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function P_(e){return T.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function O_(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}function Zh(e){function t(n,r,o,s){let i=n[s++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),c=s>=n.length;return i=!i&&T.isArray(o)?o.length:i,c?(T.hasOwnProp(o,i)?o[i]=[o[i],r]:o[i]=r,!a):((!o[i]||!T.isObject(o[i]))&&(o[i]=[]),t(n,r,o[i],s)&&T.isArray(o[i])&&(o[i]=O_(o[i])),!a)}if(T.isFormData(e)&&T.isFunction(e.entries)){const n={};return T.forEachEntry(e,(r,o)=>{t(P_(r),o,n,0)}),n}return null}function k_(e,t,n){if(T.isString(e))try{return(t||JSON.parse)(e),T.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Eo={transitional:Hh,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=T.isObject(t);if(s&&T.isHTMLForm(t)&&(t=new FormData(t)),T.isFormData(t))return o?JSON.stringify(Zh(t)):t;if(T.isArrayBuffer(t)||T.isBuffer(t)||T.isStream(t)||T.isFile(t)||T.isBlob(t)||T.isReadableStream(t))return t;if(T.isArrayBufferView(t))return t.buffer;if(T.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return R_(t,this.formSerializer).toString();if((a=T.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return ui(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),k_(t)):t}],transformResponse:[function(t){const n=this.transitional||Eo.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(T.isResponse(t)||T.isReadableStream(t))return t;if(t&&T.isString(t)&&(r&&!this.responseType||o)){const i=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(a){if(i)throw a.name==="SyntaxError"?ae.from(a,ae.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ze.classes.FormData,Blob:Ze.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};T.forEach(["delete","get","head","post","put","patch"],e=>{Eo.headers[e]={}});const N_=T.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),T_=e=>{const t={};let n,r,o;return e&&e.split(`
|
|
9
|
+
`).forEach(function(i){o=i.indexOf(":"),n=i.substring(0,o).trim().toLowerCase(),r=i.substring(o+1).trim(),!(!n||t[n]&&N_[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Ju=Symbol("internals");function Br(e){return e&&String(e).trim().toLowerCase()}function ps(e){return e===!1||e==null?e:T.isArray(e)?e.map(ps):String(e)}function A_(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const I_=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ua(e,t,n,r,o){if(T.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!T.isString(t)){if(T.isString(r))return t.indexOf(r)!==-1;if(T.isRegExp(r))return r.test(t)}}function M_(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function D_(e,t){const n=T.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,s,i){return this[r].call(this,t,o,s,i)},configurable:!0})})}let it=class{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function s(a,c,l){const d=Br(c);if(!d)throw new Error("header name must be a non-empty string");const u=T.findKey(o,d);(!u||o[u]===void 0||l===!0||l===void 0&&o[u]!==!1)&&(o[u||c]=ps(a))}const i=(a,c)=>T.forEach(a,(l,d)=>s(l,d,c));if(T.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(T.isString(t)&&(t=t.trim())&&!I_(t))i(T_(t),n);else if(T.isObject(t)&&T.isIterable(t)){let a={},c,l;for(const d of t){if(!T.isArray(d))throw TypeError("Object iterator must return a key-value pair");a[l=d[0]]=(c=a[l])?T.isArray(c)?[...c,d[1]]:[c,d[1]]:d[1]}i(a,n)}else t!=null&&s(n,t,r);return this}get(t,n){if(t=Br(t),t){const r=T.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return A_(o);if(T.isFunction(n))return n.call(this,o,r);if(T.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Br(t),t){const r=T.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ua(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function s(i){if(i=Br(i),i){const a=T.findKey(r,i);a&&(!n||ua(r,r[a],a,n))&&(delete r[a],o=!0)}}return T.isArray(t)?t.forEach(s):s(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const s=n[r];(!t||ua(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const n=this,r={};return T.forEach(this,(o,s)=>{const i=T.findKey(r,s);if(i){n[i]=ps(o),delete n[s];return}const a=t?M_(s):String(s).trim();a!==s&&delete n[s],n[a]=ps(o),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return T.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&T.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
10
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[Ju]=this[Ju]={accessors:{}}).accessors,o=this.prototype;function s(i){const a=Br(i);r[a]||(D_(o,i),r[a]=!0)}return T.isArray(t)?t.forEach(s):s(t),this}};it.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);T.reduceDescriptors(it.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});T.freezeMethods(it);function da(e,t){const n=this||Eo,r=t||n,o=it.from(r.headers);let s=r.data;return T.forEach(e,function(a){s=a.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Kh(e){return!!(e&&e.__CANCEL__)}let Co=class extends ae{constructor(t,n,r){super(t??"canceled",ae.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function qh(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ae("Request failed with status code "+n.status,[ae.ERR_BAD_REQUEST,ae.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function j_(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function L_(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,s=0,i;return t=t!==void 0?t:1e3,function(c){const l=Date.now(),d=r[s];i||(i=l),n[o]=c,r[o]=l;let u=s,f=0;for(;u!==o;)f+=n[u++],u=u%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),l-i<t)return;const h=d&&l-d;return h?Math.round(f*1e3/h):void 0}}function F_(e,t){let n=0,r=1e3/t,o,s;const i=(l,d=Date.now())=>{n=d,o=null,s&&(clearTimeout(s),s=null),e(...l)};return[(...l)=>{const d=Date.now(),u=d-n;u>=r?i(l,d):(o=l,s||(s=setTimeout(()=>{s=null,i(o)},r-u)))},()=>o&&i(o)]}const Ts=(e,t,n=3)=>{let r=0;const o=L_(50,250);return F_(s=>{const i=s.loaded,a=s.lengthComputable?s.total:void 0,c=i-r,l=o(c),d=i<=a;r=i;const u={loaded:i,total:a,progress:a?i/a:void 0,bytes:c,rate:l||void 0,estimated:l&&a&&d?(a-i)/l:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(u)},n)},Qu=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Xu=e=>(...t)=>T.asap(()=>e(...t)),$_=Ze.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ze.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ze.origin),Ze.navigator&&/(msie|trident)/i.test(Ze.navigator.userAgent)):()=>!0,z_=Ze.hasStandardBrowserEnv?{write(e,t,n,r,o,s,i){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];T.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),T.isString(r)&&a.push(`path=${r}`),T.isString(o)&&a.push(`domain=${o}`),s===!0&&a.push("secure"),T.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function V_(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function U_(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Gh(e,t,n){let r=!V_(t);return e&&(r||n==!1)?U_(e,t):t}const ed=e=>e instanceof it?{...e}:e;function Zn(e,t){t=t||{};const n={};function r(l,d,u,f){return T.isPlainObject(l)&&T.isPlainObject(d)?T.merge.call({caseless:f},l,d):T.isPlainObject(d)?T.merge({},d):T.isArray(d)?d.slice():d}function o(l,d,u,f){if(T.isUndefined(d)){if(!T.isUndefined(l))return r(void 0,l,u,f)}else return r(l,d,u,f)}function s(l,d){if(!T.isUndefined(d))return r(void 0,d)}function i(l,d){if(T.isUndefined(d)){if(!T.isUndefined(l))return r(void 0,l)}else return r(void 0,d)}function a(l,d,u){if(u in t)return r(l,d);if(u in e)return r(void 0,l)}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(l,d,u)=>o(ed(l),ed(d),u,!0)};return T.forEach(Object.keys({...e,...t}),function(d){const u=c[d]||o,f=u(e[d],t[d],d);T.isUndefined(f)&&u!==a||(n[d]=f)}),n}const Yh=e=>{const t=Zn({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;if(t.headers=i=it.from(i),t.url=Wh(Gh(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),T.isFormData(n)){if(Ze.hasStandardBrowserEnv||Ze.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(T.isFunction(n.getHeaders)){const c=n.getHeaders(),l=["content-type","content-length"];Object.entries(c).forEach(([d,u])=>{l.includes(d.toLowerCase())&&i.set(d,u)})}}if(Ze.hasStandardBrowserEnv&&(r&&T.isFunction(r)&&(r=r(t)),r||r!==!1&&$_(t.url))){const c=o&&s&&z_.read(s);c&&i.set(o,c)}return t},B_=typeof XMLHttpRequest<"u",W_=B_&&function(e){return new Promise(function(n,r){const o=Yh(e);let s=o.data;const i=it.from(o.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:l}=o,d,u,f,h,m;function g(){h&&h(),m&&m(),o.cancelToken&&o.cancelToken.unsubscribe(d),o.signal&&o.signal.removeEventListener("abort",d)}let v=new XMLHttpRequest;v.open(o.method.toUpperCase(),o.url,!0),v.timeout=o.timeout;function b(){if(!v)return;const w=it.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),S={data:!a||a==="text"||a==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:w,config:e,request:v};qh(function(C){n(C),g()},function(C){r(C),g()},S),v=null}"onloadend"in v?v.onloadend=b:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(b)},v.onabort=function(){v&&(r(new ae("Request aborted",ae.ECONNABORTED,e,v)),v=null)},v.onerror=function(x){const S=x&&x.message?x.message:"Network Error",P=new ae(S,ae.ERR_NETWORK,e,v);P.event=x||null,r(P),v=null},v.ontimeout=function(){let x=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const S=o.transitional||Hh;o.timeoutErrorMessage&&(x=o.timeoutErrorMessage),r(new ae(x,S.clarifyTimeoutError?ae.ETIMEDOUT:ae.ECONNABORTED,e,v)),v=null},s===void 0&&i.setContentType(null),"setRequestHeader"in v&&T.forEach(i.toJSON(),function(x,S){v.setRequestHeader(S,x)}),T.isUndefined(o.withCredentials)||(v.withCredentials=!!o.withCredentials),a&&a!=="json"&&(v.responseType=o.responseType),l&&([f,m]=Ts(l,!0),v.addEventListener("progress",f)),c&&v.upload&&([u,h]=Ts(c),v.upload.addEventListener("progress",u),v.upload.addEventListener("loadend",h)),(o.cancelToken||o.signal)&&(d=w=>{v&&(r(!w||w.type?new Co(null,e,v):w),v.abort(),v=null)},o.cancelToken&&o.cancelToken.subscribe(d),o.signal&&(o.signal.aborted?d():o.signal.addEventListener("abort",d)));const _=j_(o.url);if(_&&Ze.protocols.indexOf(_)===-1){r(new ae("Unsupported protocol "+_+":",ae.ERR_BAD_REQUEST,e));return}v.send(s||null)})},H_=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const s=function(l){if(!o){o=!0,a();const d=l instanceof Error?l:this.reason;r.abort(d instanceof ae?d:new Co(d instanceof Error?d.message:d))}};let i=t&&setTimeout(()=>{i=null,s(new ae(`timeout of ${t}ms exceeded`,ae.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(s):l.removeEventListener("abort",s)}),e=null)};e.forEach(l=>l.addEventListener("abort",s));const{signal:c}=r;return c.unsubscribe=()=>T.asap(a),c}},Z_=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},K_=async function*(e,t){for await(const n of q_(e))yield*Z_(n,t)},q_=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},td=(e,t,n,r)=>{const o=K_(e,t);let s=0,i,a=c=>{i||(i=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:l,value:d}=await o.next();if(l){a(),c.close();return}let u=d.byteLength;if(n){let f=s+=u;n(f)}c.enqueue(new Uint8Array(d))}catch(l){throw a(l),l}},cancel(c){return a(c),o.return()}},{highWaterMark:2})},nd=64*1024,{isFunction:Zo}=T,G_=(({Request:e,Response:t})=>({Request:e,Response:t}))(T.global),{ReadableStream:rd,TextEncoder:od}=T.global,sd=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Y_=e=>{e=T.merge.call({skipUndefined:!0},G_,e);const{fetch:t,Request:n,Response:r}=e,o=t?Zo(t):typeof fetch=="function",s=Zo(n),i=Zo(r);if(!o)return!1;const a=o&&Zo(rd),c=o&&(typeof od=="function"?(m=>g=>m.encode(g))(new od):async m=>new Uint8Array(await new n(m).arrayBuffer())),l=s&&a&&sd(()=>{let m=!1;const g=new n(Ze.origin,{body:new rd,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return m&&!g}),d=i&&a&&sd(()=>T.isReadableStream(new r("").body)),u={stream:d&&(m=>m.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!u[m]&&(u[m]=(g,v)=>{let b=g&&g[m];if(b)return b.call(g);throw new ae(`Response type '${m}' is not supported`,ae.ERR_NOT_SUPPORT,v)})});const f=async m=>{if(m==null)return 0;if(T.isBlob(m))return m.size;if(T.isSpecCompliantForm(m))return(await new n(Ze.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(T.isArrayBufferView(m)||T.isArrayBuffer(m))return m.byteLength;if(T.isURLSearchParams(m)&&(m=m+""),T.isString(m))return(await c(m)).byteLength},h=async(m,g)=>{const v=T.toFiniteNumber(m.getContentLength());return v??f(g)};return async m=>{let{url:g,method:v,data:b,signal:_,cancelToken:w,timeout:x,onDownloadProgress:S,onUploadProgress:P,responseType:C,headers:E,withCredentials:A="same-origin",fetchOptions:U}=Yh(m),B=t||fetch;C=C?(C+"").toLowerCase():"text";let M=H_([_,w&&w.toAbortSignal()],x),j=null;const V=M&&M.unsubscribe&&(()=>{M.unsubscribe()});let Y;try{if(P&&l&&v!=="get"&&v!=="head"&&(Y=await h(E,b))!==0){let N=new n(g,{method:"POST",body:b,duplex:"half"}),Q;if(T.isFormData(b)&&(Q=N.headers.get("content-type"))&&E.setContentType(Q),N.body){const[W,Z]=Qu(Y,Ts(Xu(P)));b=td(N.body,nd,W,Z)}}T.isString(A)||(A=A?"include":"omit");const L=s&&"credentials"in n.prototype,K={...U,signal:M,method:v.toUpperCase(),headers:E.normalize().toJSON(),body:b,duplex:"half",credentials:L?A:void 0};j=s&&new n(g,K);let D=await(s?B(j,U):B(g,K));const H=d&&(C==="stream"||C==="response");if(d&&(S||H&&V)){const N={};["status","statusText","headers"].forEach(ie=>{N[ie]=D[ie]});const Q=T.toFiniteNumber(D.headers.get("content-length")),[W,Z]=S&&Qu(Q,Ts(Xu(S),!0))||[];D=new r(td(D.body,nd,W,()=>{Z&&Z(),V&&V()}),N)}C=C||"text";let se=await u[T.findKey(u,C)||"text"](D,m);return!H&&V&&V(),await new Promise((N,Q)=>{qh(N,Q,{data:se,headers:it.from(D.headers),status:D.status,statusText:D.statusText,config:m,request:j})})}catch(L){throw V&&V(),L&&L.name==="TypeError"&&/Load failed|fetch/i.test(L.message)?Object.assign(new ae("Network Error",ae.ERR_NETWORK,m,j),{cause:L.cause||L}):ae.from(L,L&&L.code,m,j)}}},J_=new Map,Jh=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,s=[r,o,n];let i=s.length,a=i,c,l,d=J_;for(;a--;)c=s[a],l=d.get(c),l===void 0&&d.set(c,l=a?new Map:Y_(t)),d=l;return l};Jh();const tl={http:p_,xhr:W_,fetch:{get:Jh}};T.forEach(tl,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const id=e=>`- ${e}`,Q_=e=>T.isFunction(e)||e===null||e===!1;function X_(e,t){e=T.isArray(e)?e:[e];const{length:n}=e;let r,o;const s={};for(let i=0;i<n;i++){r=e[i];let a;if(o=r,!Q_(r)&&(o=tl[(a=String(r)).toLowerCase()],o===void 0))throw new ae(`Unknown adapter '${a}'`);if(o&&(T.isFunction(o)||(o=o.get(t))))break;s[a||"#"+i]=o}if(!o){const i=Object.entries(s).map(([c,l])=>`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build"));let a=n?i.length>1?`since :
|
|
11
|
+
`+i.map(id).join(`
|
|
12
|
+
`):" "+id(i[0]):"as no adapter specified";throw new ae("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}const Qh={getAdapter:X_,adapters:tl};function fa(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Co(null,e)}function ad(e){return fa(e),e.headers=it.from(e.headers),e.data=da.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Qh.getAdapter(e.adapter||Eo.adapter,e)(e).then(function(r){return fa(e),r.data=da.call(e,e.transformResponse,r),r.headers=it.from(r.headers),r},function(r){return Kh(r)||(fa(e),r&&r.response&&(r.response.data=da.call(e,e.transformResponse,r.response),r.response.headers=it.from(r.response.headers))),Promise.reject(r)})}const Xh="1.13.4",di={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{di[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const cd={};di.transitional=function(t,n,r){function o(s,i){return"[Axios v"+Xh+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,a)=>{if(t===!1)throw new ae(o(i," has been removed"+(n?" in "+n:"")),ae.ERR_DEPRECATED);return n&&!cd[i]&&(cd[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,i,a):!0}};di.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function eS(e,t,n){if(typeof e!="object")throw new ae("options must be an object",ae.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const a=e[s],c=a===void 0||i(a,s,e);if(c!==!0)throw new ae("option "+s+" must be "+c,ae.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ae("Unknown option "+s,ae.ERR_BAD_OPTION)}}const ms={assertOptions:eS,validators:di},Wt=ms.validators;let Vn=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Yu,response:new Yu}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
13
|
+
`+s):r.stack=s}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Zn(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&ms.assertOptions(r,{silentJSONParsing:Wt.transitional(Wt.boolean),forcedJSONParsing:Wt.transitional(Wt.boolean),clarifyTimeoutError:Wt.transitional(Wt.boolean)},!1),o!=null&&(T.isFunction(o)?n.paramsSerializer={serialize:o}:ms.assertOptions(o,{encode:Wt.function,serialize:Wt.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ms.assertOptions(n,{baseUrl:Wt.spelling("baseURL"),withXsrfToken:Wt.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=s&&T.merge(s.common,s[n.method]);s&&T.forEach(["delete","get","head","post","put","patch","common"],m=>{delete s[m]}),n.headers=it.concat(i,s);const a=[];let c=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(c=c&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const l=[];this.interceptors.response.forEach(function(g){l.push(g.fulfilled,g.rejected)});let d,u=0,f;if(!c){const m=[ad.bind(this),void 0];for(m.unshift(...a),m.push(...l),f=m.length,d=Promise.resolve(n);u<f;)d=d.then(m[u++],m[u++]);return d}f=a.length;let h=n;for(;u<f;){const m=a[u++],g=a[u++];try{h=m(h)}catch(v){g.call(this,v);break}}try{d=ad.call(this,h)}catch(m){return Promise.reject(m)}for(u=0,f=l.length;u<f;)d=d.then(l[u++],l[u++]);return d}getUri(t){t=Zn(this.defaults,t);const n=Gh(t.baseURL,t.url,t.allowAbsoluteUrls);return Wh(n,t.params,t.paramsSerializer)}};T.forEach(["delete","get","head","options"],function(t){Vn.prototype[t]=function(n,r){return this.request(Zn(r||{},{method:t,url:n,data:(r||{}).data}))}});T.forEach(["post","put","patch"],function(t){function n(r){return function(s,i,a){return this.request(Zn(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}Vn.prototype[t]=n(),Vn.prototype[t+"Form"]=n(!0)});let tS=class ep{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(a=>{r.subscribe(a),s=a}).then(o);return i.cancel=function(){r.unsubscribe(s)},i},t(function(s,i,a){r.reason||(r.reason=new Co(s,i,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new ep(function(o){t=o}),cancel:t}}};function nS(e){return function(n){return e.apply(null,n)}}function rS(e){return T.isObject(e)&&e.isAxiosError===!0}const rc={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(rc).forEach(([e,t])=>{rc[t]=e});function tp(e){const t=new Vn(e),n=Ih(Vn.prototype.request,t);return T.extend(n,Vn.prototype,t,{allOwnKeys:!0}),T.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return tp(Zn(e,o))},n}const Pe=tp(Eo);Pe.Axios=Vn;Pe.CanceledError=Co;Pe.CancelToken=tS;Pe.isCancel=Kh;Pe.VERSION=Xh;Pe.toFormData=ui;Pe.AxiosError=ae;Pe.Cancel=Pe.CanceledError;Pe.all=function(t){return Promise.all(t)};Pe.spread=nS;Pe.isAxiosError=rS;Pe.mergeConfig=Zn;Pe.AxiosHeaders=it;Pe.formToJSON=e=>Zh(T.isHTMLForm(e)?new FormData(e):e);Pe.getAdapter=Qh.getAdapter;Pe.HttpStatusCode=rc;Pe.default=Pe;const{Axios:bD,AxiosError:wD,CanceledError:xD,isCancel:_D,CancelToken:SD,VERSION:ED,all:CD,Cancel:RD,isAxiosError:PD,spread:OD,toFormData:kD,AxiosHeaders:ND,HttpStatusCode:TD,formToJSON:AD,getAdapter:ID,mergeConfig:MD}=Pe,oS={apiBase:"http://localhost:3000/api"},Te=Pe.create({baseURL:oS.apiBase});function sS(e,t){Te.defaults.baseURL=e,t&&(Te.defaults.headers.common.Authorization=`Bearer ${t}`)}function oc(e){e?Te.defaults.headers.common.Authorization=`Bearer ${e}`:delete Te.defaults.headers.common.Authorization}const fi=Ah()(Ox(e=>({token:null,email:null,setAuth:(t,n)=>{oc(t),e({token:t,email:n})},logout:()=>{oc(null),e({token:null,email:null})}}),{name:"kuma_clone_auth"})),ld=fi.getState();ld.token&&oc(ld.token);const np="pulsewatch.theme";function sc(e){const t=document.documentElement;e==="dark"?t.classList.add("dark"):t.classList.remove("dark"),t.style.colorScheme=e,localStorage.setItem(np,e)}const rp=Ah((e,t)=>({mode:"light",setMode:n=>{sc(n),e({mode:n})},toggle:()=>{const n=t().mode==="dark"?"light":"dark";sc(n),e({mode:n})}}));function iS(){const t=localStorage.getItem(np)==="dark"?"dark":"light";sc(t),rp.setState({mode:t})}var Ro=e=>e.type==="checkbox",Ln=e=>e instanceof Date,ot=e=>e==null;const op=e=>typeof e=="object";var Ae=e=>!ot(e)&&!Array.isArray(e)&&op(e)&&!Ln(e),sp=e=>Ae(e)&&e.target?Ro(e.target)?e.target.checked:e.target.value:e,aS=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,ip=(e,t)=>e.has(aS(t)),cS=e=>{const t=e.constructor&&e.constructor.prototype;return Ae(t)&&t.hasOwnProperty("isPrototypeOf")},nl=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ke(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(nl&&(e instanceof Blob||t))return e;const n=Array.isArray(e);if(!n&&!(Ae(e)&&cS(e)))return e;const r=n?[]:Object.create(Object.getPrototypeOf(e));for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=ke(e[o]));return r}var hi=e=>/^\w*$/.test(e),_e=e=>e===void 0,rl=e=>Array.isArray(e)?e.filter(Boolean):[],ol=e=>rl(e.replace(/["|']|\]/g,"").split(/\.|\[/)),G=(e,t,n)=>{if(!t||!Ae(e))return n;const r=(hi(t)?[t]:ol(t)).reduce((o,s)=>ot(o)?o:o[s],e);return _e(r)||r===e?_e(e[t])?n:e[t]:r},lt=e=>typeof e=="boolean",Qe=e=>typeof e=="function",ve=(e,t,n)=>{let r=-1;const o=hi(t)?[t]:ol(t),s=o.length,i=s-1;for(;++r<s;){const a=o[r];let c=n;if(r!==i){const l=e[a];c=Ae(l)||Array.isArray(l)?l:isNaN(+o[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=c,e=e[a]}};const As={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Dt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Xt={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},sl=k.createContext(null);sl.displayName="HookFormControlContext";const il=()=>k.useContext(sl);var ap=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const i=s;return t._proxyFormState[i]!==Dt.all&&(t._proxyFormState[i]=!r||Dt.all),n&&(n[i]=!0),e[i]}});return o};const al=typeof window<"u"?k.useLayoutEffect:k.useEffect;function cp(e){const t=il(),{control:n=t,disabled:r,name:o,exact:s}=e||{},[i,a]=k.useState(n._formState),c=k.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return al(()=>n._subscribe({name:o,formState:c.current,exact:s,callback:l=>{!r&&a({...n._formState,...l})}}),[o,r,s]),k.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),k.useMemo(()=>ap(i,n,c.current,!1),[i,n])}var dt=e=>typeof e=="string",ic=(e,t,n,r,o)=>dt(e)?(r&&t.watch.add(e),G(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),G(n,s))):(r&&(t.watchAll=!0),n),ac=e=>ot(e)||!op(e);function jt(e,t,n=new WeakSet){if(ac(e)||ac(t))return Object.is(e,t);if(Ln(e)&&Ln(t))return Object.is(e.getTime(),t.getTime());const r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const s of r){const i=e[s];if(!o.includes(s))return!1;if(s!=="ref"){const a=t[s];if(Ln(i)&&Ln(a)||Ae(i)&&Ae(a)||Array.isArray(i)&&Array.isArray(a)?!jt(i,a,n):!Object.is(i,a))return!1}}return!0}function lS(e){const t=il(),{control:n=t,name:r,defaultValue:o,disabled:s,exact:i,compute:a}=e||{},c=k.useRef(o),l=k.useRef(a),d=k.useRef(void 0),u=k.useRef(n),f=k.useRef(r);l.current=a;const[h,m]=k.useState(()=>{const x=n._getWatch(r,c.current);return l.current?l.current(x):x}),g=k.useCallback(x=>{const S=ic(r,n._names,x||n._formValues,!1,c.current);return l.current?l.current(S):S},[n._formValues,n._names,r]),v=k.useCallback(x=>{if(!s){const S=ic(r,n._names,x||n._formValues,!1,c.current);if(l.current){const P=l.current(S);jt(P,d.current)||(m(P),d.current=P)}else m(S)}},[n._formValues,n._names,s,r]);al(()=>((u.current!==n||!jt(f.current,r))&&(u.current=n,f.current=r,v()),n._subscribe({name:r,formState:{values:!0},exact:i,callback:x=>{v(x.values)}})),[n,i,r,v]),k.useEffect(()=>n._removeUnmounted());const b=u.current!==n,_=f.current,w=k.useMemo(()=>{if(s)return null;const x=!b&&!jt(_,r);return b||x?g():null},[s,b,r,_,g]);return w!==null?w:h}function uS(e){const t=il(),{name:n,disabled:r,control:o=t,shouldUnregister:s,defaultValue:i,exact:a=!0}=e,c=ip(o._names.array,n),l=k.useMemo(()=>G(o._formValues,n,G(o._defaultValues,n,i)),[o,n,i]),d=lS({control:o,name:n,defaultValue:l,exact:a}),u=cp({control:o,name:n,exact:a}),f=k.useRef(e),h=k.useRef(void 0),m=k.useRef(o.register(n,{...e.rules,value:d,...lt(e.disabled)?{disabled:e.disabled}:{}}));f.current=e;const g=k.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!G(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!G(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!G(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!G(u.validatingFields,n)},error:{enumerable:!0,get:()=>G(u.errors,n)}}),[u,n]),v=k.useCallback(x=>m.current.onChange({target:{value:sp(x),name:n},type:As.CHANGE}),[n]),b=k.useCallback(()=>m.current.onBlur({target:{value:G(o._formValues,n),name:n},type:As.BLUR}),[n,o._formValues]),_=k.useCallback(x=>{const S=G(o._fields,n);S&&S._f&&x&&(S._f.ref={focus:()=>Qe(x.focus)&&x.focus(),select:()=>Qe(x.select)&&x.select(),setCustomValidity:P=>Qe(x.setCustomValidity)&&x.setCustomValidity(P),reportValidity:()=>Qe(x.reportValidity)&&x.reportValidity()})},[o._fields,n]),w=k.useMemo(()=>({name:n,value:d,...lt(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:v,onBlur:b,ref:_}),[n,r,u.disabled,v,b,_,d]);return k.useEffect(()=>{const x=o._options.shouldUnregister||s,S=h.current;S&&S!==n&&!c&&o.unregister(S),o.register(n,{...f.current.rules,...lt(f.current.disabled)?{disabled:f.current.disabled}:{}});const P=(C,E)=>{const A=G(o._fields,C);A&&A._f&&(A._f.mount=E)};if(P(n,!0),x){const C=ke(G(o._options.defaultValues,n,f.current.defaultValue));ve(o._defaultValues,n,C),_e(G(o._formValues,n))&&ve(o._formValues,n,C)}return!c&&o.register(n),h.current=n,()=>{(c?x&&!o._state.action:x)?o.unregister(n):P(n,!1)}},[n,o,c,s]),k.useEffect(()=>{o._setDisabledField({disabled:r,name:n})},[r,n,o]),k.useMemo(()=>({field:w,formState:u,fieldState:g}),[w,u,g])}const dS=e=>e.render(uS(e)),cl=k.createContext(null);cl.displayName="HookFormContext";const fS=()=>k.useContext(cl),hS=e=>{const{children:t,watch:n,getValues:r,getFieldState:o,setError:s,clearErrors:i,setValue:a,trigger:c,formState:l,resetField:d,reset:u,handleSubmit:f,unregister:h,control:m,register:g,setFocus:v,subscribe:b}=e;return k.createElement(cl.Provider,{value:k.useMemo(()=>({watch:n,getValues:r,getFieldState:o,setError:s,clearErrors:i,setValue:a,trigger:c,formState:l,resetField:d,reset:u,handleSubmit:f,unregister:h,control:m,register:g,setFocus:v,subscribe:b}),[i,m,l,o,r,f,g,u,d,s,v,a,b,c,h,n])},k.createElement(sl.Provider,{value:m},t))};var ll=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},Xr=e=>Array.isArray(e)?e:[e],ud=()=>{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}};function lp(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const o=e[r],s=t[r];if(o&&Ae(o)&&s){const i=lp(o,s);Ae(i)&&(n[r]=i)}else e[r]&&(n[r]=s)}return n}var Je=e=>Ae(e)&&!Object.keys(e).length,ul=e=>e.type==="file",Is=e=>{if(!nl)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},up=e=>e.type==="select-multiple",dl=e=>e.type==="radio",pS=e=>dl(e)||Ro(e),ha=e=>Is(e)&&e.isConnected;function mS(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=_e(e)?r++:e[t[r++]];return e}function gS(e){for(const t in e)if(e.hasOwnProperty(t)&&!_e(e[t]))return!1;return!0}function Ne(e,t){const n=Array.isArray(t)?t:hi(t)?[t]:ol(t),r=n.length===1?e:mS(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(Ae(r)&&Je(r)||Array.isArray(r)&&gS(r))&&Ne(e,n.slice(0,-1)),e}var yS=e=>{for(const t in e)if(Qe(e[t]))return!0;return!1};function dp(e){return Array.isArray(e)||Ae(e)&&!yS(e)}function cc(e,t={}){for(const n in e){const r=e[n];dp(r)?(t[n]=Array.isArray(r)?[]:{},cc(r,t[n])):_e(r)||(t[n]=!0)}return t}function pr(e,t,n){n||(n=cc(t));for(const r in e){const o=e[r];if(dp(o))_e(t)||ac(n[r])?n[r]=cc(o,Array.isArray(o)?[]:{}):pr(o,ot(t)?{}:t[r],n[r]);else{const s=t[r];n[r]=!jt(o,s)}}return n}const dd={value:!1,isValid:!1},fd={value:!0,isValid:!0};var fp=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!_e(e[0].attributes.value)?_e(e[0].value)||e[0].value===""?fd:{value:e[0].value,isValid:!0}:fd:dd}return dd},hp=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>_e(e)?e:t?e===""?NaN:e&&+e:n&&dt(e)?new Date(e):r?r(e):e;const hd={isValid:!1,value:null};var pp=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,hd):hd;function pd(e){const t=e.ref;return ul(t)?t.files:dl(t)?pp(e.refs).value:up(t)?[...t.selectedOptions].map(({value:n})=>n):Ro(t)?fp(e.refs).value:hp(_e(t.value)?e.ref.value:t.value,e)}var vS=(e,t,n,r)=>{const o={};for(const s of e){const i=G(t,s);i&&ve(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Ms=e=>e instanceof RegExp,Wr=e=>_e(e)?e:Ms(e)?e.source:Ae(e)?Ms(e.value)?e.value.source:e.value:e,md=e=>({isOnSubmit:!e||e===Dt.onSubmit,isOnBlur:e===Dt.onBlur,isOnChange:e===Dt.onChange,isOnAll:e===Dt.all,isOnTouch:e===Dt.onTouched});const gd="AsyncFunction";var bS=e=>!!e&&!!e.validate&&!!(Qe(e.validate)&&e.validate.constructor.name===gd||Ae(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===gd)),wS=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),yd=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const eo=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const s=G(e,o);if(s){const{_f:i,...a}=s;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],o)&&!r)return!0;if(i.ref&&t(i.ref,i.name)&&!r)return!0;if(eo(a,t))break}else if(Ae(a)&&eo(a,t))break}}};function vd(e,t,n){const r=G(e,n);if(r||hi(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),i=G(t,s),a=G(e,s);if(i&&!Array.isArray(i)&&n!==s)return{name:n};if(a&&a.type)return{name:s,error:a};if(a&&a.root&&a.root.type)return{name:`${s}.root`,error:a.root};o.pop()}return{name:n}}var xS=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return Je(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===(!r||Dt.all))},_S=(e,t,n)=>!e||!t||e===t||Xr(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),SS=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,ES=(e,t)=>!rl(G(e,t)).length&&Ne(e,t),CS=(e,t,n)=>{const r=Xr(G(e,n));return ve(r,"root",t[n]),ve(e,n,r),e};function bd(e,t,n="validate"){if(dt(e)||Array.isArray(e)&&e.every(dt)||lt(e)&&!e)return{type:n,message:dt(e)?e:"",ref:t}}var ar=e=>Ae(e)&&!Ms(e)?e:{value:e,message:""},wd=async(e,t,n,r,o,s)=>{const{ref:i,refs:a,required:c,maxLength:l,minLength:d,min:u,max:f,pattern:h,validate:m,name:g,valueAsNumber:v,mount:b}=e._f,_=G(n,g);if(!b||t.has(g))return{};const w=a?a[0]:i,x=M=>{o&&w.reportValidity&&(w.setCustomValidity(lt(M)?"":M||""),w.reportValidity())},S={},P=dl(i),C=Ro(i),E=P||C,A=(v||ul(i))&&_e(i.value)&&_e(_)||Is(i)&&i.value===""||_===""||Array.isArray(_)&&!_.length,U=ll.bind(null,g,r,S),B=(M,j,V,Y=Xt.maxLength,L=Xt.minLength)=>{const K=M?j:V;S[g]={type:M?Y:L,message:K,ref:i,...U(M?Y:L,K)}};if(s?!Array.isArray(_)||!_.length:c&&(!E&&(A||ot(_))||lt(_)&&!_||C&&!fp(a).isValid||P&&!pp(a).isValid)){const{value:M,message:j}=dt(c)?{value:!!c,message:c}:ar(c);if(M&&(S[g]={type:Xt.required,message:j,ref:w,...U(Xt.required,j)},!r))return x(j),S}if(!A&&(!ot(u)||!ot(f))){let M,j;const V=ar(f),Y=ar(u);if(!ot(_)&&!isNaN(_)){const L=i.valueAsNumber||_&&+_;ot(V.value)||(M=L>V.value),ot(Y.value)||(j=L<Y.value)}else{const L=i.valueAsDate||new Date(_),K=se=>new Date(new Date().toDateString()+" "+se),D=i.type=="time",H=i.type=="week";dt(V.value)&&_&&(M=D?K(_)>K(V.value):H?_>V.value:L>new Date(V.value)),dt(Y.value)&&_&&(j=D?K(_)<K(Y.value):H?_<Y.value:L<new Date(Y.value))}if((M||j)&&(B(!!M,V.message,Y.message,Xt.max,Xt.min),!r))return x(S[g].message),S}if((l||d)&&!A&&(dt(_)||s&&Array.isArray(_))){const M=ar(l),j=ar(d),V=!ot(M.value)&&_.length>+M.value,Y=!ot(j.value)&&_.length<+j.value;if((V||Y)&&(B(V,M.message,j.message),!r))return x(S[g].message),S}if(h&&!A&&dt(_)){const{value:M,message:j}=ar(h);if(Ms(M)&&!_.match(M)&&(S[g]={type:Xt.pattern,message:j,ref:i,...U(Xt.pattern,j)},!r))return x(j),S}if(m){if(Qe(m)){const M=await m(_,n),j=bd(M,w);if(j&&(S[g]={...j,...U(Xt.validate,j.message)},!r))return x(j.message),S}else if(Ae(m)){let M={};for(const j in m){if(!Je(M)&&!r)break;const V=bd(await m[j](_,n),w,j);V&&(M={...V,...U(j,V.message)},x(V.message),r&&(S[g]=M))}if(!Je(M)&&(S[g]={ref:w,...M},!r))return S}}return x(!0),S};const RS={mode:Dt.onSubmit,reValidateMode:Dt.onChange,shouldFocusError:!0};function PS(e={}){let t={...RS,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Qe(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=Ae(t.defaultValues)||Ae(t.values)?ke(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:ke(o),i={action:!1,mount:!1,watch:!1,keepIsValid:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,l=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},u={...d};let f={...u};const h={array:ud(),state:ud()},m=t.criteriaMode===Dt.all,g=R=>O=>{clearTimeout(l),l=setTimeout(R,O)},v=async R=>{if(!i.keepIsValid&&!t.disabled&&(u.isValid||f.isValid||R)){let O;t.resolver?(O=Je((await E()).errors),b()):O=await U(r,!0),O!==n.isValid&&h.state.next({isValid:O})}},b=(R,O)=>{!t.disabled&&(u.isValidating||u.validatingFields||f.isValidating||f.validatingFields)&&((R||Array.from(a.mount)).forEach(I=>{I&&(O?ve(n.validatingFields,I,O):Ne(n.validatingFields,I))}),h.state.next({validatingFields:n.validatingFields,isValidating:!Je(n.validatingFields)}))},_=(R,O=[],I,J,q=!0,$=!0)=>{if(J&&I&&!t.disabled){if(i.action=!0,$&&Array.isArray(G(r,R))){const X=I(G(r,R),J.argA,J.argB);q&&ve(r,R,X)}if($&&Array.isArray(G(n.errors,R))){const X=I(G(n.errors,R),J.argA,J.argB);q&&ve(n.errors,R,X),ES(n.errors,R)}if((u.touchedFields||f.touchedFields)&&$&&Array.isArray(G(n.touchedFields,R))){const X=I(G(n.touchedFields,R),J.argA,J.argB);q&&ve(n.touchedFields,R,X)}(u.dirtyFields||f.dirtyFields)&&(n.dirtyFields=pr(o,s)),h.state.next({name:R,isDirty:M(R,O),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else ve(s,R,O)},w=(R,O)=>{ve(n.errors,R,O),h.state.next({errors:n.errors})},x=R=>{n.errors=R,h.state.next({errors:n.errors,isValid:!1})},S=(R,O,I,J)=>{const q=G(r,R);if(q){const $=G(s,R,_e(I)?G(o,R):I);_e($)||J&&J.defaultChecked||O?ve(s,R,O?$:pd(q._f)):Y(R,$),i.mount&&!i.action&&v()}},P=(R,O,I,J,q)=>{let $=!1,X=!1;const le={name:R};if(!t.disabled){if(!I||J){(u.isDirty||f.isDirty)&&(X=n.isDirty,n.isDirty=le.isDirty=M(),$=X!==le.isDirty);const ge=jt(G(o,R),O);X=!!G(n.dirtyFields,R),ge?Ne(n.dirtyFields,R):ve(n.dirtyFields,R,!0),le.dirtyFields=n.dirtyFields,$=$||(u.dirtyFields||f.dirtyFields)&&X!==!ge}if(I){const ge=G(n.touchedFields,R);ge||(ve(n.touchedFields,R,I),le.touchedFields=n.touchedFields,$=$||(u.touchedFields||f.touchedFields)&&ge!==I)}$&&q&&h.state.next(le)}return $?le:{}},C=(R,O,I,J)=>{const q=G(n.errors,R),$=(u.isValid||f.isValid)&<(O)&&n.isValid!==O;if(t.delayError&&I?(c=g(()=>w(R,I)),c(t.delayError)):(clearTimeout(l),c=null,I?ve(n.errors,R,I):Ne(n.errors,R)),(I?!jt(q,I):q)||!Je(J)||$){const X={...J,...$&<(O)?{isValid:O}:{},errors:n.errors,name:R};n={...n,...X},h.state.next(X)}},E=async R=>(b(R,!0),await t.resolver(s,t.context,vS(R||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),A=async R=>{const{errors:O}=await E(R);if(b(R),R)for(const I of R){const J=G(O,I);J?ve(n.errors,I,J):Ne(n.errors,I)}else n.errors=O;return O},U=async(R,O,I={valid:!0})=>{for(const J in R){const q=R[J];if(q){const{_f:$,...X}=q;if($){const le=a.array.has($.name),ge=q._f&&bS(q._f);ge&&u.validatingFields&&b([$.name],!0);const Re=await wd(q,a.disabled,s,m,t.shouldUseNativeValidation&&!O,le);if(ge&&u.validatingFields&&b([$.name]),Re[$.name]&&(I.valid=!1,O||e.shouldUseNativeValidation))break;!O&&(G(Re,$.name)?le?CS(n.errors,Re,$.name):ve(n.errors,$.name,Re[$.name]):Ne(n.errors,$.name))}!Je(X)&&await U(X,O,I)}}return I.valid},B=()=>{for(const R of a.unMount){const O=G(r,R);O&&(O._f.refs?O._f.refs.every(I=>!ha(I)):!ha(O._f.ref))&&ee(R)}a.unMount=new Set},M=(R,O)=>!t.disabled&&(R&&O&&ve(s,R,O),!jt(N(),o)),j=(R,O,I)=>ic(R,a,{...i.mount?s:_e(O)?o:dt(R)?{[R]:O}:O},I,O),V=R=>rl(G(i.mount?s:o,R,t.shouldUnregister?G(o,R,[]):[])),Y=(R,O,I={})=>{const J=G(r,R);let q=O;if(J){const $=J._f;$&&(!$.disabled&&ve(s,R,hp(O,$)),q=Is($.ref)&&ot(O)?"":O,up($.ref)?[...$.ref.options].forEach(X=>X.selected=q.includes(X.value)):$.refs?Ro($.ref)?$.refs.forEach(X=>{(!X.defaultChecked||!X.disabled)&&(Array.isArray(q)?X.checked=!!q.find(le=>le===X.value):X.checked=q===X.value||!!q)}):$.refs.forEach(X=>X.checked=X.value===q):ul($.ref)?$.ref.value="":($.ref.value=q,$.ref.type||h.state.next({name:R,values:ke(s)})))}(I.shouldDirty||I.shouldTouch)&&P(R,q,I.shouldTouch,I.shouldDirty,!0),I.shouldValidate&&se(R)},L=(R,O,I)=>{for(const J in O){if(!O.hasOwnProperty(J))return;const q=O[J],$=R+"."+J,X=G(r,$);(a.array.has(R)||Ae(q)||X&&!X._f)&&!Ln(q)?L($,q,I):Y($,q,I)}},K=(R,O,I={})=>{const J=G(r,R),q=a.array.has(R),$=ke(O);ve(s,R,$),q?(h.array.next({name:R,values:ke(s)}),(u.isDirty||u.dirtyFields||f.isDirty||f.dirtyFields)&&I.shouldDirty&&h.state.next({name:R,dirtyFields:pr(o,s),isDirty:M(R,$)})):J&&!J._f&&!ot($)?L(R,$,I):Y(R,$,I),yd(R,a)?h.state.next({...n,name:R,values:ke(s)}):h.state.next({name:i.mount?R:void 0,values:ke(s)})},D=async R=>{i.mount=!0;const O=R.target;let I=O.name,J=!0;const q=G(r,I),$=ge=>{J=Number.isNaN(ge)||Ln(ge)&&isNaN(ge.getTime())||jt(ge,G(s,I,ge))},X=md(t.mode),le=md(t.reValidateMode);if(q){let ge,Re;const Ut=O.type?pd(q._f):sp(R),Ge=R.type===As.BLUR||R.type===As.FOCUS_OUT,Zi=!wS(q._f)&&!t.resolver&&!G(n.errors,I)&&!q._f.deps||SS(Ge,G(n.touchedFields,I),n.isSubmitted,le,X),Mr=yd(I,a,Ge);ve(s,I,Ut),Ge?(!O||!O.readOnly)&&(q._f.onBlur&&q._f.onBlur(R),c&&c(0)):q._f.onChange&&q._f.onChange(R);const ir=P(I,Ut,Ge),Io=!Je(ir)||Mr;if(!Ge&&h.state.next({name:I,type:R.type,values:ke(s)}),Zi)return(u.isValid||f.isValid)&&(t.mode==="onBlur"?Ge&&v():Ge||v()),Io&&h.state.next({name:I,...Mr?{}:ir});if(!Ge&&Mr&&h.state.next({...n}),t.resolver){const{errors:Mo}=await E([I]);if(b([I]),$(Ut),J){const Dr=vd(n.errors,r,I),Tt=vd(Mo,r,Dr.name||I);ge=Tt.error,I=Tt.name,Re=Je(Mo)}}else b([I],!0),ge=(await wd(q,a.disabled,s,m,t.shouldUseNativeValidation))[I],b([I]),$(Ut),J&&(ge?Re=!1:(u.isValid||f.isValid)&&(Re=await U(r,!0)));J&&(q._f.deps&&(!Array.isArray(q._f.deps)||q._f.deps.length>0)&&se(q._f.deps),C(I,Re,ge,ir))}},H=(R,O)=>{if(G(n.errors,O)&&R.focus)return R.focus(),1},se=async(R,O={})=>{let I,J;const q=Xr(R);if(t.resolver){const $=await A(_e(R)?R:q);I=Je($),J=R?!q.some(X=>G($,X)):I}else R?(J=(await Promise.all(q.map(async $=>{const X=G(r,$);return await U(X&&X._f?{[$]:X}:X)}))).every(Boolean),!(!J&&!n.isValid)&&v()):J=I=await U(r);return h.state.next({...!dt(R)||(u.isValid||f.isValid)&&I!==n.isValid?{}:{name:R},...t.resolver||!R?{isValid:I}:{},errors:n.errors}),O.shouldFocus&&!J&&eo(r,H,R?q:a.mount),J},N=(R,O)=>{let I={...i.mount?s:o};return O&&(I=lp(O.dirtyFields?n.dirtyFields:n.touchedFields,I)),_e(R)?I:dt(R)?G(I,R):R.map(J=>G(I,J))},Q=(R,O)=>({invalid:!!G((O||n).errors,R),isDirty:!!G((O||n).dirtyFields,R),error:G((O||n).errors,R),isValidating:!!G(n.validatingFields,R),isTouched:!!G((O||n).touchedFields,R)}),W=R=>{R&&Xr(R).forEach(O=>Ne(n.errors,O)),h.state.next({errors:R?n.errors:{}})},Z=(R,O,I)=>{const J=(G(r,R,{_f:{}})._f||{}).ref,q=G(n.errors,R)||{},{ref:$,message:X,type:le,...ge}=q;ve(n.errors,R,{...ge,...O,ref:J}),h.state.next({name:R,errors:n.errors,isValid:!1}),I&&I.shouldFocus&&J&&J.focus&&J.focus()},ie=(R,O)=>Qe(R)?h.state.subscribe({next:I=>"values"in I&&R(j(void 0,O),I)}):j(R,O,!0),fe=R=>h.state.subscribe({next:O=>{_S(R.name,O.name,R.exact)&&xS(O,R.formState||u,un,R.reRenderRoot)&&R.callback({values:{...s},...n,...O,defaultValues:o})}}).unsubscribe,F=R=>(i.mount=!0,f={...f,...R.formState},fe({...R,formState:{...d,...R.formState}})),ee=(R,O={})=>{for(const I of R?Xr(R):a.mount)a.mount.delete(I),a.array.delete(I),O.keepValue||(Ne(r,I),Ne(s,I)),!O.keepError&&Ne(n.errors,I),!O.keepDirty&&Ne(n.dirtyFields,I),!O.keepTouched&&Ne(n.touchedFields,I),!O.keepIsValidating&&Ne(n.validatingFields,I),!t.shouldUnregister&&!O.keepDefaultValue&&Ne(o,I);h.state.next({values:ke(s)}),h.state.next({...n,...O.keepDirty?{isDirty:M()}:{}}),!O.keepIsValid&&v()},pe=({disabled:R,name:O})=>{if(lt(R)&&i.mount||R||a.disabled.has(O)){const q=a.disabled.has(O)!==!!R;R?a.disabled.add(O):a.disabled.delete(O),q&&i.mount&&!i.action&&v()}},ce=(R,O={})=>{let I=G(r,R);const J=lt(O.disabled)||lt(t.disabled);return ve(r,R,{...I||{},_f:{...I&&I._f?I._f:{ref:{name:R}},name:R,mount:!0,...O}}),a.mount.add(R),I?pe({disabled:lt(O.disabled)?O.disabled:t.disabled,name:R}):S(R,!0,O.value),{...J?{disabled:O.disabled||t.disabled}:{},...t.progressive?{required:!!O.required,min:Wr(O.min),max:Wr(O.max),minLength:Wr(O.minLength),maxLength:Wr(O.maxLength),pattern:Wr(O.pattern)}:{},name:R,onChange:D,onBlur:D,ref:q=>{if(q){ce(R,O),I=G(r,R);const $=_e(q.value)&&q.querySelectorAll&&q.querySelectorAll("input,select,textarea")[0]||q,X=pS($),le=I._f.refs||[];if(X?le.find(ge=>ge===$):$===I._f.ref)return;ve(r,R,{_f:{...I._f,...X?{refs:[...le.filter(ha),$,...Array.isArray(G(o,R))?[{}]:[]],ref:{type:$.type,name:R}}:{ref:$}}}),S(R,!1,void 0,$)}else I=G(r,R,{}),I._f&&(I._f.mount=!1),(t.shouldUnregister||O.shouldUnregister)&&!(ip(a.array,R)&&i.action)&&a.unMount.add(R)}}},ue=()=>t.shouldFocusError&&eo(r,H,a.mount),me=R=>{lt(R)&&(h.state.next({disabled:R}),eo(r,(O,I)=>{const J=G(r,I);J&&(O.disabled=J._f.disabled||R,Array.isArray(J._f.refs)&&J._f.refs.forEach(q=>{q.disabled=J._f.disabled||R}))},0,!1))},Oe=(R,O)=>async I=>{let J;I&&(I.preventDefault&&I.preventDefault(),I.persist&&I.persist());let q=ke(s);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:$,values:X}=await E();b(),n.errors=$,q=ke(X)}else await U(r);if(a.disabled.size)for(const $ of a.disabled)Ne(q,$);if(Ne(n.errors,"root"),Je(n.errors)){h.state.next({errors:{}});try{await R(q,I)}catch($){J=$}}else O&&await O({...n.errors},I),ue(),setTimeout(ue);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Je(n.errors)&&!J,submitCount:n.submitCount+1,errors:n.errors}),J)throw J},qe=(R,O={})=>{G(r,R)&&(_e(O.defaultValue)?K(R,ke(G(o,R))):(K(R,O.defaultValue),ve(o,R,ke(O.defaultValue))),O.keepTouched||Ne(n.touchedFields,R),O.keepDirty||(Ne(n.dirtyFields,R),n.isDirty=O.defaultValue?M(R,ke(G(o,R))):M()),O.keepError||(Ne(n.errors,R),u.isValid&&v()),h.state.next({...n}))},Nt=(R,O={})=>{const I=R?ke(R):o,J=ke(I),q=Je(R),$=q?o:J;if(O.keepDefaultValues||(o=I),!O.keepValues){if(O.keepDirtyValues){const X=new Set([...a.mount,...Object.keys(pr(o,s))]);for(const le of Array.from(X)){const ge=G(n.dirtyFields,le),Re=G(s,le),Ut=G($,le);ge&&!_e(Re)?ve($,le,Re):!ge&&!_e(Ut)&&K(le,Ut)}}else{if(nl&&_e(R))for(const X of a.mount){const le=G(r,X);if(le&&le._f){const ge=Array.isArray(le._f.refs)?le._f.refs[0]:le._f.ref;if(Is(ge)){const Re=ge.closest("form");if(Re){Re.reset();break}}}}if(O.keepFieldsRef)for(const X of a.mount)K(X,G($,X));else r={}}s=t.shouldUnregister?O.keepDefaultValues?ke(o):{}:ke($),h.array.next({values:{...$}}),h.state.next({values:{...$}})}a={mount:O.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!u.isValid||!!O.keepIsValid||!!O.keepDirtyValues||!t.shouldUnregister&&!Je($),i.watch=!!t.shouldUnregister,i.keepIsValid=!!O.keepIsValid,i.action=!1,O.keepErrors||(n.errors={}),h.state.next({submitCount:O.keepSubmitCount?n.submitCount:0,isDirty:q?!1:O.keepDirty?n.isDirty:!!(O.keepDefaultValues&&!jt(R,o)),isSubmitted:O.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:q?{}:O.keepDirtyValues?O.keepDefaultValues&&s?pr(o,s):n.dirtyFields:O.keepDefaultValues&&R?pr(o,R):O.keepDirty?n.dirtyFields:{},touchedFields:O.keepTouched?n.touchedFields:{},errors:O.keepErrors?n.errors:{},isSubmitSuccessful:O.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},gt=(R,O)=>Nt(Qe(R)?R(s):R,{...t.resetOptions,...O}),Le=(R,O={})=>{const I=G(r,R),J=I&&I._f;if(J){const q=J.refs?J.refs[0]:J.ref;q.focus&&setTimeout(()=>{q.focus(),O.shouldSelect&&Qe(q.select)&&q.select()})}},un=R=>{n={...n,...R}},sr={control:{register:ce,unregister:ee,getFieldState:Q,handleSubmit:Oe,setError:Z,_subscribe:fe,_runSchema:E,_updateIsValidating:b,_focusError:ue,_getWatch:j,_getDirty:M,_setValid:v,_setFieldArray:_,_setDisabledField:pe,_setErrors:x,_getFieldArray:V,_reset:Nt,_resetDefaultValues:()=>Qe(t.defaultValues)&&t.defaultValues().then(R=>{gt(R,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:B,_disableForm:me,_subjects:h,_proxyFormState:u,get _fields(){return r},get _formValues(){return s},get _state(){return i},set _state(R){i=R},get _defaultValues(){return o},get _names(){return a},set _names(R){a=R},get _formState(){return n},get _options(){return t},set _options(R){t={...t,...R}}},subscribe:F,trigger:se,register:ce,handleSubmit:Oe,watch:ie,setValue:K,getValues:N,reset:gt,resetField:qe,clearErrors:W,unregister:ee,setError:Z,setFocus:Le,getFieldState:Q};return{...sr,formControl:sr}}function mp(e={}){const t=k.useRef(void 0),n=k.useRef(void 0),[r,o]=k.useState({isDirty:!1,isValidating:!1,isLoading:Qe(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Qe(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!Qe(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:i,...a}=PS(e);t.current={...a,formState:r}}const s=t.current.control;return s._options=e,al(()=>{const i=s._subscribe({formState:s._proxyFormState,callback:()=>o({...s._formState}),reRenderRoot:!0});return o(a=>({...a,isReady:!0})),s._formState.isReady=!0,i},[s]),k.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),k.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),k.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),k.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),k.useEffect(()=>{if(s._proxyFormState.isDirty){const i=s._getDirty();i!==r.isDirty&&s._subjects.state.next({isDirty:i})}},[s,r.isDirty]),k.useEffect(()=>{var i;e.values&&!jt(e.values,n.current)?(s._reset(e.values,{keepFieldsRef:!0,...s._options.resetOptions}),!((i=s._options.resetOptions)===null||i===void 0)&&i.keepIsValid||s._setValid(),n.current=e.values,o(a=>({...a}))):s._resetDefaultValues()},[s,e.values]),k.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),t.current.formState=k.useMemo(()=>ap(r,s),[s,r]),t.current}function gp(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=gp(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function fl(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=gp(e))&&(r&&(r+=" "),r+=t);return r}const OS=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},kS=(e,t)=>({classGroupId:e,validator:t}),yp=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ds="-",xd=[],NS="arbitrary..",TS=e=>{const t=IS(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return AS(i);const a=i.split(Ds),c=a[0]===""&&a.length>1?1:0;return vp(a,c,t)},getConflictingClassGroupIds:(i,a)=>{if(a){const c=r[i],l=n[i];return c?l?OS(l,c):c:l||xd}return n[i]||xd}}},vp=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const l=vp(e,t+1,s);if(l)return l}const i=n.validators;if(i===null)return;const a=t===0?e.join(Ds):e.slice(t).join(Ds),c=i.length;for(let l=0;l<c;l++){const d=i[l];if(d.validator(a))return d.classGroupId}},AS=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?NS+r:void 0})(),IS=e=>{const{theme:t,classGroups:n}=e;return MS(n,t)},MS=(e,t)=>{const n=yp();for(const r in e){const o=e[r];hl(o,n,r,t)}return n},hl=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const i=e[s];DS(i,t,n,r)}},DS=(e,t,n,r)=>{if(typeof e=="string"){jS(e,t,n);return}if(typeof e=="function"){LS(e,t,n,r);return}FS(e,t,n,r)},jS=(e,t,n)=>{const r=e===""?t:bp(t,e);r.classGroupId=n},LS=(e,t,n,r)=>{if($S(e)){hl(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(kS(n,e))},FS=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let i=0;i<s;i++){const[a,c]=o[i];hl(c,bp(t,a),n,r)}},bp=(e,t)=>{let n=e;const r=t.split(Ds),o=r.length;for(let s=0;s<o;s++){const i=r[s];let a=n.nextPart.get(i);a||(a=yp(),n.nextPart.set(i,a)),n=a}return n},$S=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,zS=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,i)=>{n[s]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return o(s,i),i},set(s,i){s in n?n[s]=i:o(s,i)}}},lc="!",_d=":",VS=[],Sd=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),US=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,a=0,c=0,l;const d=o.length;for(let g=0;g<d;g++){const v=o[g];if(i===0&&a===0){if(v===_d){s.push(o.slice(c,g)),c=g+1;continue}if(v==="/"){l=g;continue}}v==="["?i++:v==="]"?i--:v==="("?a++:v===")"&&a--}const u=s.length===0?o:o.slice(c);let f=u,h=!1;u.endsWith(lc)?(f=u.slice(0,-1),h=!0):u.startsWith(lc)&&(f=u.slice(1),h=!0);const m=l&&l>c?l-c:void 0;return Sd(s,h,f,m)};if(t){const o=t+_d,s=r;r=i=>i.startsWith(o)?s(i.slice(o.length)):Sd(VS,!1,i,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},BS=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const i=n[s],a=i[0]==="[",c=t.has(i);a||c?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(i)):o.push(i)}return o.length>0&&(o.sort(),r.push(...o)),r}},WS=e=>({cache:zS(e.cacheSize),parseClassName:US(e),sortModifiers:BS(e),...TS(e)}),HS=/\s+/,ZS=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],a=e.trim().split(HS);let c="";for(let l=a.length-1;l>=0;l-=1){const d=a[l],{isExternal:u,modifiers:f,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:g}=n(d);if(u){c=d+(c.length>0?" "+c:c);continue}let v=!!g,b=r(v?m.substring(0,g):m);if(!b){if(!v){c=d+(c.length>0?" "+c:c);continue}if(b=r(m),!b){c=d+(c.length>0?" "+c:c);continue}v=!1}const _=f.length===0?"":f.length===1?f[0]:s(f).join(":"),w=h?_+lc:_,x=w+b;if(i.indexOf(x)>-1)continue;i.push(x);const S=o(b,v);for(let P=0;P<S.length;++P){const C=S[P];i.push(w+C)}c=d+(c.length>0?" "+c:c)}return c},KS=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=wp(n))&&(o&&(o+=" "),o+=r);return o},wp=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=wp(e[r]))&&(n&&(n+=" "),n+=t);return n},qS=(e,...t)=>{let n,r,o,s;const i=c=>{const l=t.reduce((d,u)=>u(d),e());return n=WS(l),r=n.cache.get,o=n.cache.set,s=a,a(c)},a=c=>{const l=r(c);if(l)return l;const d=ZS(c,n);return o(c,d),d};return s=i,(...c)=>s(KS(...c))},GS=[],je=e=>{const t=n=>n[e]||GS;return t.isThemeGetter=!0,t},xp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,_p=/^\((?:(\w[\w-]*):)?(.+)\)$/i,YS=/^\d+\/\d+$/,JS=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,QS=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,XS=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,e0=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,t0=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cr=e=>YS.test(e),he=e=>!!e&&!Number.isNaN(Number(e)),dn=e=>!!e&&Number.isInteger(Number(e)),pa=e=>e.endsWith("%")&&he(e.slice(0,-1)),en=e=>JS.test(e),n0=()=>!0,r0=e=>QS.test(e)&&!XS.test(e),Sp=()=>!1,o0=e=>e0.test(e),s0=e=>t0.test(e),i0=e=>!te(e)&&!ne(e),a0=e=>Or(e,Rp,Sp),te=e=>xp.test(e),Tn=e=>Or(e,Pp,r0),ma=e=>Or(e,f0,he),Ed=e=>Or(e,Ep,Sp),c0=e=>Or(e,Cp,s0),Ko=e=>Or(e,Op,o0),ne=e=>_p.test(e),Hr=e=>kr(e,Pp),l0=e=>kr(e,h0),Cd=e=>kr(e,Ep),u0=e=>kr(e,Rp),d0=e=>kr(e,Cp),qo=e=>kr(e,Op,!0),Or=(e,t,n)=>{const r=xp.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},kr=(e,t,n=!1)=>{const r=_p.exec(e);return r?r[1]?t(r[1]):n:!1},Ep=e=>e==="position"||e==="percentage",Cp=e=>e==="image"||e==="url",Rp=e=>e==="length"||e==="size"||e==="bg-size",Pp=e=>e==="length",f0=e=>e==="number",h0=e=>e==="family-name",Op=e=>e==="shadow",p0=()=>{const e=je("color"),t=je("font"),n=je("text"),r=je("font-weight"),o=je("tracking"),s=je("leading"),i=je("breakpoint"),a=je("container"),c=je("spacing"),l=je("radius"),d=je("shadow"),u=je("inset-shadow"),f=je("text-shadow"),h=je("drop-shadow"),m=je("blur"),g=je("perspective"),v=je("aspect"),b=je("ease"),_=je("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...x(),ne,te],P=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],E=()=>[ne,te,c],A=()=>[cr,"full","auto",...E()],U=()=>[dn,"none","subgrid",ne,te],B=()=>["auto",{span:["full",dn,ne,te]},dn,ne,te],M=()=>[dn,"auto",ne,te],j=()=>["auto","min","max","fr",ne,te],V=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...E()],K=()=>[cr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...E()],D=()=>[e,ne,te],H=()=>[...x(),Cd,Ed,{position:[ne,te]}],se=()=>["no-repeat",{repeat:["","x","y","space","round"]}],N=()=>["auto","cover","contain",u0,a0,{size:[ne,te]}],Q=()=>[pa,Hr,Tn],W=()=>["","none","full",l,ne,te],Z=()=>["",he,Hr,Tn],ie=()=>["solid","dashed","dotted","double"],fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],F=()=>[he,pa,Cd,Ed],ee=()=>["","none",m,ne,te],pe=()=>["none",he,ne,te],ce=()=>["none",he,ne,te],ue=()=>[he,ne,te],me=()=>[cr,"full",...E()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[en],breakpoint:[en],color:[n0],container:[en],"drop-shadow":[en],ease:["in","out","in-out"],font:[i0],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[en],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[en],shadow:[en],spacing:["px",he],text:[en],"text-shadow":[en],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",cr,te,ne,v]}],container:["container"],columns:[{columns:[he,te,ne,a]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:A()}],"inset-x":[{"inset-x":A()}],"inset-y":[{"inset-y":A()}],start:[{start:A()}],end:[{end:A()}],top:[{top:A()}],right:[{right:A()}],bottom:[{bottom:A()}],left:[{left:A()}],visibility:["visible","invisible","collapse"],z:[{z:[dn,"auto",ne,te]}],basis:[{basis:[cr,"full","auto",a,...E()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[he,cr,"auto","initial","none",te]}],grow:[{grow:["",he,ne,te]}],shrink:[{shrink:["",he,ne,te]}],order:[{order:[dn,"first","last","none",ne,te]}],"grid-cols":[{"grid-cols":U()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":U()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":j()}],"auto-rows":[{"auto-rows":j()}],gap:[{gap:E()}],"gap-x":[{"gap-x":E()}],"gap-y":[{"gap-y":E()}],"justify-content":[{justify:[...V(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...V()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":V()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:E()}],px:[{px:E()}],py:[{py:E()}],ps:[{ps:E()}],pe:[{pe:E()}],pt:[{pt:E()}],pr:[{pr:E()}],pb:[{pb:E()}],pl:[{pl:E()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":E()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":E()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],w:[{w:[a,"screen",...K()]}],"min-w":[{"min-w":[a,"screen","none",...K()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",n,Hr,Tn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ne,ma]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",pa,te]}],"font-family":[{font:[l0,te,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,ne,te]}],"line-clamp":[{"line-clamp":[he,"none",ne,ma]}],leading:[{leading:[s,...E()]}],"list-image":[{"list-image":["none",ne,te]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ne,te]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ie(),"wavy"]}],"text-decoration-thickness":[{decoration:[he,"from-font","auto",ne,Tn]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[he,"auto",ne,te]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ne,te]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ne,te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:H()}],"bg-repeat":[{bg:se()}],"bg-size":[{bg:N()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},dn,ne,te],radial:["",ne,te],conic:[dn,ne,te]},d0,c0]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:Z()}],"border-w-x":[{"border-x":Z()}],"border-w-y":[{"border-y":Z()}],"border-w-s":[{"border-s":Z()}],"border-w-e":[{"border-e":Z()}],"border-w-t":[{"border-t":Z()}],"border-w-r":[{"border-r":Z()}],"border-w-b":[{"border-b":Z()}],"border-w-l":[{"border-l":Z()}],"divide-x":[{"divide-x":Z()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Z()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ie(),"hidden","none"]}],"divide-style":[{divide:[...ie(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...ie(),"none","hidden"]}],"outline-offset":[{"outline-offset":[he,ne,te]}],"outline-w":[{outline:["",he,Hr,Tn]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",d,qo,Ko]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",u,qo,Ko]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[he,Tn]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":Z()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",f,qo,Ko]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[he,ne,te]}],"mix-blend":[{"mix-blend":[...fe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":fe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[he]}],"mask-image-linear-from-pos":[{"mask-linear-from":F()}],"mask-image-linear-to-pos":[{"mask-linear-to":F()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":F()}],"mask-image-t-to-pos":[{"mask-t-to":F()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":F()}],"mask-image-r-to-pos":[{"mask-r-to":F()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":F()}],"mask-image-b-to-pos":[{"mask-b-to":F()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":F()}],"mask-image-l-to-pos":[{"mask-l-to":F()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":F()}],"mask-image-x-to-pos":[{"mask-x-to":F()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":F()}],"mask-image-y-to-pos":[{"mask-y-to":F()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[ne,te]}],"mask-image-radial-from-pos":[{"mask-radial-from":F()}],"mask-image-radial-to-pos":[{"mask-radial-to":F()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":x()}],"mask-image-conic-pos":[{"mask-conic":[he]}],"mask-image-conic-from-pos":[{"mask-conic-from":F()}],"mask-image-conic-to-pos":[{"mask-conic-to":F()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:H()}],"mask-repeat":[{mask:se()}],"mask-size":[{mask:N()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ne,te]}],filter:[{filter:["","none",ne,te]}],blur:[{blur:ee()}],brightness:[{brightness:[he,ne,te]}],contrast:[{contrast:[he,ne,te]}],"drop-shadow":[{"drop-shadow":["","none",h,qo,Ko]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",he,ne,te]}],"hue-rotate":[{"hue-rotate":[he,ne,te]}],invert:[{invert:["",he,ne,te]}],saturate:[{saturate:[he,ne,te]}],sepia:[{sepia:["",he,ne,te]}],"backdrop-filter":[{"backdrop-filter":["","none",ne,te]}],"backdrop-blur":[{"backdrop-blur":ee()}],"backdrop-brightness":[{"backdrop-brightness":[he,ne,te]}],"backdrop-contrast":[{"backdrop-contrast":[he,ne,te]}],"backdrop-grayscale":[{"backdrop-grayscale":["",he,ne,te]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[he,ne,te]}],"backdrop-invert":[{"backdrop-invert":["",he,ne,te]}],"backdrop-opacity":[{"backdrop-opacity":[he,ne,te]}],"backdrop-saturate":[{"backdrop-saturate":[he,ne,te]}],"backdrop-sepia":[{"backdrop-sepia":["",he,ne,te]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":E()}],"border-spacing-x":[{"border-spacing-x":E()}],"border-spacing-y":[{"border-spacing-y":E()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ne,te]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[he,"initial",ne,te]}],ease:[{ease:["linear","initial",b,ne,te]}],delay:[{delay:[he,ne,te]}],animate:[{animate:["none",_,ne,te]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,ne,te]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:ce()}],"scale-x":[{"scale-x":ce()}],"scale-y":[{"scale-y":ce()}],"scale-z":[{"scale-z":ce()}],"scale-3d":["scale-3d"],skew:[{skew:ue()}],"skew-x":[{"skew-x":ue()}],"skew-y":[{"skew-y":ue()}],transform:[{transform:[ne,te,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:me()}],"translate-x":[{"translate-x":me()}],"translate-y":[{"translate-y":me()}],"translate-z":[{"translate-z":me()}],"translate-none":["translate-none"],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ne,te]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ne,te]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[he,Hr,Tn,ma]}],stroke:[{stroke:["none",...D()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},kp=qS(p0);function pl(...e){return kp(fl(e))}function io(e){return p.jsx("div",{...e,className:pl("rounded-2xl border bg-white shadow-sm",e.className)})}function ao(e){return p.jsx("div",{...e,className:pl("border-b px-4 py-3",e.className)})}function co(e){return p.jsx("div",{...e,className:pl("px-4 py-3",e.className)})}function m0(){const e=bo(),t=fi(),{register:n,handleSubmit:r,formState:o}=mp({defaultValues:{email:"admin@example.com",password:"ChangeMe123!"}}),s=r(async i=>{try{const a=await Te.post("/auth/login",i);t.setAuth(a.data.token,a.data.user.email),ze.success("Logged in"),e({to:"/"})}catch(a){ze.error(a?.response?.data?.detail??"Login failed")}});return p.jsx("div",{className:"mx-auto max-w-md",children:p.jsxs(io,{children:[p.jsxs(ao,{children:[p.jsx("div",{className:"text-lg font-semibold",children:"Login"}),p.jsx("div",{className:"text-sm text-neutral-600",children:"Use the admin credentials from your backend env."})]}),p.jsx(co,{children:p.jsxs("form",{onSubmit:s,className:"space-y-3",children:[p.jsxs("div",{children:[p.jsx("label",{className:"text-sm text-neutral-700",children:"Email"}),p.jsx("input",{className:"mt-1 w-full rounded-xl border px-3 py-2",...n("email",{required:!0})})]}),p.jsxs("div",{children:[p.jsx("label",{className:"text-sm text-neutral-700",children:"Password"}),p.jsx("input",{type:"password",className:"mt-1 w-full rounded-xl border px-3 py-2",...n("password",{required:!0})})]}),p.jsx("button",{disabled:o.isSubmitting,className:"w-full rounded-xl bg-neutral-900 px-3 py-2 text-white hover:bg-neutral-800 disabled:opacity-60",children:o.isSubmitting?"Signing in...":"Sign in"})]})})]})})}function g0(){return p.jsx("div",{className:"flex-1 bg-neutral-50 p-6 dark:bg-neutral-900/40",children:p.jsx(Zc,{})})}const y0=()=>Zw(),v0=Gw;function Ue(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var b0=typeof Symbol=="function"&&Symbol.observable||"@@observable",Rd=b0,ga=()=>Math.random().toString(36).substring(7).split("").join("."),w0={INIT:`@@redux/INIT${ga()}`,REPLACE:`@@redux/REPLACE${ga()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${ga()}`},Un=w0;function Po(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function x0(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(E0(e))return"date";if(S0(e))return"error";const n=_0(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function _0(e){return typeof e.constructor=="function"?e.constructor.name:null}function S0(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function E0(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function hn(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=x0(e)),t}function Np(e,t,n){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Ue(2):`Expected the root reducer to be a function. Instead, received: '${hn(e)}'`);if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Ue(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?Ue(1):`Expected the enhancer to be a function. Instead, received: '${hn(n)}'`);return n(Np)(e,t)}let r=e,o=t,s=new Map,i=s,a=0,c=!1;function l(){i===s&&(i=new Map,s.forEach((v,b)=>{i.set(b,v)}))}function d(){if(c)throw new Error(process.env.NODE_ENV==="production"?Ue(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function u(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Ue(4):`Expected the listener to be a function. Instead, received: '${hn(v)}'`);if(c)throw new Error(process.env.NODE_ENV==="production"?Ue(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let b=!0;l();const _=a++;return i.set(_,v),function(){if(b){if(c)throw new Error(process.env.NODE_ENV==="production"?Ue(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");b=!1,l(),i.delete(_),s=null}}}function f(v){if(!Po(v))throw new Error(process.env.NODE_ENV==="production"?Ue(7):`Actions must be plain objects. Instead, the actual type was: '${hn(v)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof v.type>"u")throw new Error(process.env.NODE_ENV==="production"?Ue(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof v.type!="string")throw new Error(process.env.NODE_ENV==="production"?Ue(17):`Action "type" property must be a string. Instead, the actual type was: '${hn(v.type)}'. Value was: '${v.type}' (stringified)`);if(c)throw new Error(process.env.NODE_ENV==="production"?Ue(9):"Reducers may not dispatch actions.");try{c=!0,o=r(o,v)}finally{c=!1}return(s=i).forEach(_=>{_()}),v}function h(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Ue(10):`Expected the nextReducer to be a function. Instead, received: '${hn(v)}`);r=v,f({type:Un.REPLACE})}function m(){const v=u;return{subscribe(b){if(typeof b!="object"||b===null)throw new Error(process.env.NODE_ENV==="production"?Ue(11):`Expected the observer to be an object. Instead, received: '${hn(b)}'`);function _(){const x=b;x.next&&x.next(d())}return _(),{unsubscribe:v(_)}},[Rd](){return this}}}return f({type:Un.INIT}),{dispatch:f,subscribe:u,getState:d,replaceReducer:h,[Rd]:m}}function Pd(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function C0(e,t,n,r){const o=Object.keys(t),s=n&&n.type===Un.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(o.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!Po(e))return`The ${s} has unexpected type of "${hn(e)}". Expected argument to be an object with the following keys: "${o.join('", "')}"`;const i=Object.keys(e).filter(a=>!t.hasOwnProperty(a)&&!r[a]);if(i.forEach(a=>{r[a]=!0}),!(n&&n.type===Un.REPLACE)&&i.length>0)return`Unexpected ${i.length>1?"keys":"key"} "${i.join('", "')}" found in ${s}. Expected to find one of the known reducer keys instead: "${o.join('", "')}". Unexpected keys will be ignored.`}function R0(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Un.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?Ue(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof n(void 0,{type:Un.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?Ue(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${Un.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}function P0(e){const t=Object.keys(e),n={};for(let i=0;i<t.length;i++){const a=t[i];process.env.NODE_ENV!=="production"&&typeof e[a]>"u"&&Pd(`No reducer provided for key "${a}"`),typeof e[a]=="function"&&(n[a]=e[a])}const r=Object.keys(n);let o;process.env.NODE_ENV!=="production"&&(o={});let s;try{R0(n)}catch(i){s=i}return function(a={},c){if(s)throw s;if(process.env.NODE_ENV!=="production"){const u=C0(a,n,c,o);u&&Pd(u)}let l=!1;const d={};for(let u=0;u<r.length;u++){const f=r[u],h=n[f],m=a[f],g=h(m,c);if(typeof g>"u"){const v=c&&c.type;throw new Error(process.env.NODE_ENV==="production"?Ue(14):`When called with an action of type ${v?`"${String(v)}"`:"(unknown type)"}, the slice reducer for key "${f}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}d[f]=g,l=l||g!==m}return l=l||r.length!==Object.keys(a).length,l?d:a}}function js(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function O0(...e){return t=>(n,r)=>{const o=t(n,r);let s=()=>{throw new Error(process.env.NODE_ENV==="production"?Ue(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const i={getState:o.getState,dispatch:(c,...l)=>s(c,...l)},a=e.map(c=>c(i));return s=js(...a)(o.dispatch),{...o,dispatch:s}}}function Tp(e){return Po(e)&&"type"in e&&typeof e.type=="string"}var Ap=Symbol.for("immer-nothing"),Od=Symbol.for("immer-draftable"),Xe=Symbol.for("immer-state"),k0=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function ft(e,...t){if(process.env.NODE_ENV!=="production"){const n=k0[e],r=An(n)?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ht=Object,Cr=ht.getPrototypeOf,Ls="constructor",pi="prototype",uc="configurable",Fs="enumerable",gs="writable",lo="value",sn=e=>!!e&&!!e[Xe];function Lt(e){return e?Ip(e)||gi(e)||!!e[Od]||!!e[Ls]?.[Od]||yi(e)||vi(e):!1}var N0=ht[pi][Ls].toString(),kd=new WeakMap;function Ip(e){if(!e||!ml(e))return!1;const t=Cr(e);if(t===null||t===ht[pi])return!0;const n=ht.hasOwnProperty.call(t,Ls)&&t[Ls];if(n===Object)return!0;if(!An(n))return!1;let r=kd.get(n);return r===void 0&&(r=Function.toString.call(n),kd.set(n,r)),r===N0}function mi(e,t,n=!0){Oo(e)===0?(n?Reflect.ownKeys(e):ht.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((r,o)=>t(o,r,e))}function Oo(e){const t=e[Xe];return t?t.type_:gi(e)?1:yi(e)?2:vi(e)?3:0}var Nd=(e,t,n=Oo(e))=>n===2?e.has(t):ht[pi].hasOwnProperty.call(e,t),dc=(e,t,n=Oo(e))=>n===2?e.get(t):e[t],$s=(e,t,n,r=Oo(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function T0(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var gi=Array.isArray,yi=e=>e instanceof Map,vi=e=>e instanceof Set,ml=e=>typeof e=="object",An=e=>typeof e=="function",ya=e=>typeof e=="boolean";function A0(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var tn=e=>e.copy_||e.base_,gl=e=>e.modified_?e.copy_:e.base_;function fc(e,t){if(yi(e))return new Map(e);if(vi(e))return new Set(e);if(gi(e))return Array[pi].slice.call(e);const n=Ip(e);if(t===!0||t==="class_only"&&!n){const r=ht.getOwnPropertyDescriptors(e);delete r[Xe];let o=Reflect.ownKeys(r);for(let s=0;s<o.length;s++){const i=o[s],a=r[i];a[gs]===!1&&(a[gs]=!0,a[uc]=!0),(a.get||a.set)&&(r[i]={[uc]:!0,[gs]:!0,[Fs]:a[Fs],[lo]:e[i]})}return ht.create(Cr(e),r)}else{const r=Cr(e);if(r!==null&&n)return{...e};const o=ht.create(r);return ht.assign(o,e)}}function yl(e,t=!1){return bi(e)||sn(e)||!Lt(e)||(Oo(e)>1&&ht.defineProperties(e,{set:Go,add:Go,clear:Go,delete:Go}),ht.freeze(e),t&&mi(e,(n,r)=>{yl(r,!0)},!1)),e}function I0(){ft(2)}var Go={[lo]:I0};function bi(e){return e===null||!ml(e)?!0:ht.isFrozen(e)}var zs="MapSet",hc="Patches",Td="ArrayMethods",Mp={};function Kn(e){const t=Mp[e];return t||ft(0,e),t}var Ad=e=>!!Mp[e],uo,Dp=()=>uo,M0=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Ad(zs)?Kn(zs):void 0,arrayMethodsPlugin_:Ad(Td)?Kn(Td):void 0});function Id(e,t){t&&(e.patchPlugin_=Kn(hc),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function pc(e){mc(e),e.drafts_.forEach(D0),e.drafts_=null}function mc(e){e===uo&&(uo=e.parent_)}var Md=e=>uo=M0(uo,e);function D0(e){const t=e[Xe];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Dd(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Xe].modified_&&(pc(t),ft(4)),Lt(e)&&(e=jd(t,e));const{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(n[Xe].base_,e,t)}else e=jd(t,n);return j0(t,e,!0),pc(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Ap?e:void 0}function jd(e,t){if(bi(t))return t;const n=t[Xe];if(!n)return Vs(t,e.handledSet_,e);if(!wi(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);Fp(n,e)}return n.copy_}function j0(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&yl(t,n)}function jp(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var wi=(e,t)=>e.scope_===t,L0=[];function Lp(e,t,n,r){const o=tn(e),s=e.type_;if(r!==void 0&&dc(o,r,s)===t){$s(o,r,n,s);return}if(!e.draftLocations_){const a=e.draftLocations_=new Map;mi(o,(c,l)=>{if(sn(l)){const d=a.get(l)||[];d.push(c),a.set(l,d)}})}const i=e.draftLocations_.get(t)??L0;for(const a of i)$s(o,a,n,s)}function F0(e,t,n){e.callbacks_.push(function(o){const s=t;if(!s||!wi(s,o))return;o.mapSetPlugin_?.fixSetContents(s);const i=gl(s);Lp(e,s.draft_??s,i,n),Fp(s,o)})}function Fp(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:r}=t;if(r){const o=r.getPath(e);o&&r.generatePatches_(e,o,t)}jp(e)}}function $0(e,t,n){const{scope_:r}=e;if(sn(n)){const o=n[Xe];wi(o,r)&&o.callbacks_.push(function(){ys(e);const i=gl(o);Lp(e,n,i,t)})}else Lt(n)&&e.callbacks_.push(function(){const s=tn(e);e.type_===3?s.has(n)&&Vs(n,r.handledSet_,r):dc(s,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Vs(dc(e.copy_,t,e.type_),r.handledSet_,r)})}function Vs(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||sn(e)||t.has(e)||!Lt(e)||bi(e)||(t.add(e),mi(e,(r,o)=>{if(sn(o)){const s=o[Xe];if(wi(s,n)){const i=gl(s);$s(e,r,i,e.type_),jp(s)}}else Lt(o)&&Vs(o,t,n)})),e}function z0(e,t){const n=gi(e),r={type_:n?1:0,scope_:t?t.scope_:Dp(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let o=r,s=Us;n&&(o=[r],s=fo);const{revoke:i,proxy:a}=Proxy.revocable(o,s);return r.draft_=a,r.revoke_=i,[a,r]}var Us={get(e,t){if(t===Xe)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const o=tn(e);if(!Nd(o,t,e.type_))return V0(e,o,t);const s=o[t];if(e.finalized_||!Lt(s)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&A0(t))return s;if(s===va(e.base_,t)){ys(e);const i=e.type_===1?+t:t,a=yc(e.scope_,s,e,i);return e.copy_[i]=a}return s},has(e,t){return t in tn(e)},ownKeys(e){return Reflect.ownKeys(tn(e))},set(e,t,n){const r=$p(tn(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=va(tn(e),t),s=o?.[Xe];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(T0(n,o)&&(n!==void 0||Nd(e.base_,t,e.type_)))return!0;ys(e),gc(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),$0(e,t,n)),!0},deleteProperty(e,t){return ys(e),va(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),gc(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=tn(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[gs]:!0,[uc]:e.type_!==1||t!=="length",[Fs]:r[Fs],[lo]:n[t]}},defineProperty(){ft(11)},getPrototypeOf(e){return Cr(e.base_)},setPrototypeOf(){ft(12)}},fo={};for(let e in Us){let t=Us[e];fo[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}fo.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&ft(13),fo.set.call(this,e,t,void 0)};fo.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&ft(14),Us.set.call(this,e[0],t,n,e[0])};function va(e,t){const n=e[Xe];return(n?tn(n):e)[t]}function V0(e,t,n){const r=$p(t,n);return r?lo in r?r[lo]:r.get?.call(e.draft_):void 0}function $p(e,t){if(!(t in e))return;let n=Cr(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Cr(n)}}function gc(e){e.modified_||(e.modified_=!0,e.parent_&&gc(e.parent_))}function ys(e){e.copy_||(e.assigned_=new Map,e.copy_=fc(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var U0=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,r)=>{if(An(t)&&!An(n)){const s=n;n=t;const i=this;return function(c=s,...l){return i.produce(c,d=>n.call(this,d,...l))}}An(n)||ft(6),r!==void 0&&!An(r)&&ft(7);let o;if(Lt(t)){const s=Md(this),i=yc(s,t,void 0);let a=!0;try{o=n(i),a=!1}finally{a?pc(s):mc(s)}return Id(s,r),Dd(o,s)}else if(!t||!ml(t)){if(o=n(t),o===void 0&&(o=t),o===Ap&&(o=void 0),this.autoFreeze_&&yl(o,!0),r){const s=[],i=[];Kn(hc).generateReplacementPatches_(t,o,{patches_:s,inversePatches_:i}),r(s,i)}return o}else ft(1,t)},this.produceWithPatches=(t,n)=>{if(An(t))return(i,...a)=>this.produceWithPatches(i,c=>t(c,...a));let r,o;return[this.produce(t,n,(i,a)=>{r=i,o=a}),r,o]},ya(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),ya(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),ya(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Lt(e)||ft(8),sn(e)&&(e=B0(e));const t=Md(this),n=yc(t,e,void 0);return n[Xe].isManual_=!0,mc(t),n}finishDraft(e,t){const n=e&&e[Xe];(!n||!n.isManual_)&&ft(9);const{scope_:r}=n;return Id(r,t),Dd(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));const r=Kn(hc).applyPatches_;return sn(e)?r(e,t):this.produce(e,o=>r(o,t))}};function yc(e,t,n,r){const[o,s]=yi(t)?Kn(zs).proxyMap_(t,n):vi(t)?Kn(zs).proxySet_(t,n):z0(t,n);return(n?.scope_??Dp()).drafts_.push(o),s.callbacks_=n?.callbacks_??[],s.key_=r,n&&r!==void 0?F0(n,s,r):s.callbacks_.push(function(c){c.mapSetPlugin_?.fixSetContents(s);const{patchPlugin_:l}=c;s.modified_&&l&&l.generatePatches_(s,[],c)}),o}function B0(e){return sn(e)||ft(10,e),zp(e)}function zp(e){if(!Lt(e)||bi(e))return e;const t=e[Xe];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=fc(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=fc(e,!0);return mi(n,(o,s)=>{$s(n,o,zp(s))},r),t&&(t.finalized_=!1),n}var W0=new U0,Vp=W0.produce;function Up(e){return({dispatch:n,getState:r})=>o=>s=>typeof s=="function"?s(n,r,e):o(s)}var H0=Up(),Z0=Up,K0=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?js:js.apply(null,arguments)},Bp=e=>e&&typeof e.match=="function";function to(e,t){function n(...r){if(t){let o=t(...r);if(!o)throw new Error(process.env.NODE_ENV==="production"?we(0):"prepareAction did not return an object");return{type:e,payload:o.payload,..."meta"in o&&{meta:o.meta},..."error"in o&&{error:o.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>Tp(r)&&r.type===e,n}function q0(e){return typeof e=="function"&&"type"in e&&Bp(e)}function G0(e){const t=e?`${e}`.split("/"):[],n=t[t.length-1]||"actionCreator";return`Detected an action creator with type "${e||"unknown"}" being dispatched.
|
|
14
|
+
Make sure you're calling the action creator before dispatching, i.e. \`dispatch(${n}())\` instead of \`dispatch(${n})\`. This is necessary even if the action has no payload.`}function Y0(e={}){if(process.env.NODE_ENV==="production")return()=>n=>r=>n(r);const{isActionCreator:t=q0}=e;return()=>n=>r=>(t(r)&&console.warn(G0(r.type)),n(r))}function Wp(e,t){let n=0;return{measureTime(r){const o=Date.now();try{return r()}finally{const s=Date.now();n+=s-o}},warnIfExceeded(){n>e&&console.warn(`${t} took ${n}ms, which is more than the warning threshold of ${e}ms.
|
|
15
15
|
If your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.
|
|
16
|
-
It is disabled in production builds, so you don't need to worry about that.`)}}}var
|
|
16
|
+
It is disabled in production builds, so you don't need to worry about that.`)}}}var Hp=class Kr extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Kr.prototype)}static get[Symbol.species](){return Kr}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Kr(...t[0].concat(this)):new Kr(...t.concat(this))}};function Ld(e){return Lt(e)?Vp(e,()=>{}):e}function Yo(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function J0(e){return typeof e!="object"||e==null||Object.isFrozen(e)}function Q0(e,t,n){const r=Zp(e,t,n);return{detectMutations(){return Kp(e,t,r,n)}}}function Zp(e,t=[],n,r="",o=new Set){const s={value:n};if(!e(n)&&!o.has(n)){o.add(n),s.children={};const i=t.length>0;for(const a in n){const c=r?r+"."+a:a;i&&t.some(d=>d instanceof RegExp?d.test(c):c===d)||(s.children[a]=Zp(e,t,n[a],c))}}return s}function Kp(e,t=[],n,r,o=!1,s=""){const i=n?n.value:void 0,a=i===r;if(o&&!a&&!Number.isNaN(r))return{wasMutated:!0,path:s};if(e(i)||e(r))return{wasMutated:!1};const c={};for(let d in n.children)c[d]=!0;for(let d in r)c[d]=!0;const l=t.length>0;for(let d in c){const u=s?s+"."+d:d;if(l&&t.some(m=>m instanceof RegExp?m.test(u):u===m))continue;const f=Kp(e,t,n.children[d],r[d],a,u);if(f.wasMutated)return f}return{wasMutated:!1}}function X0(e={}){if(process.env.NODE_ENV==="production")return()=>t=>n=>t(n);{let t=function(a,c,l,d){return JSON.stringify(a,n(c,d),l)},n=function(a,c){let l=[],d=[];return c||(c=function(u,f){return l[0]===f?"[Circular ~]":"[Circular ~."+d.slice(0,l.indexOf(f)).join(".")+"]"}),function(u,f){if(l.length>0){var h=l.indexOf(this);~h?l.splice(h+1):l.push(this),~h?d.splice(h,1/0,u):d.push(u),~l.indexOf(f)&&(f=c.call(this,u,f))}else l.push(f);return a==null?f:a.call(this,u,f)}},{isImmutable:r=J0,ignoredPaths:o,warnAfter:s=32}=e;const i=Q0.bind(null,r,o);return({getState:a})=>{let c=a(),l=i(c),d;return u=>f=>{const h=Wp(s,"ImmutableStateInvariantMiddleware");h.measureTime(()=>{if(c=a(),d=l.detectMutations(),l=i(c),d.wasMutated)throw new Error(process.env.NODE_ENV==="production"?we(19):`A state mutation was detected between dispatches, in the path '${d.path||""}'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)});const m=u(f);return h.measureTime(()=>{if(c=a(),d=l.detectMutations(),l=i(c),d.wasMutated)throw new Error(process.env.NODE_ENV==="production"?we(20):`A state mutation was detected inside a dispatch, in the path: ${d.path||""}. Take a look at the reducer(s) handling the action ${t(f)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)}),h.warnIfExceeded(),m}}}}function qp(e){const t=typeof e;return e==null||t==="string"||t==="boolean"||t==="number"||Array.isArray(e)||Po(e)}function vc(e,t="",n=qp,r,o=[],s){let i;if(!n(e))return{keyPath:t||"<root>",value:e};if(typeof e!="object"||e===null||s?.has(e))return!1;const a=r!=null?r(e):Object.entries(e),c=o.length>0;for(const[l,d]of a){const u=t?t+"."+l:l;if(!(c&&o.some(h=>h instanceof RegExp?h.test(u):u===h))){if(!n(d))return{keyPath:u,value:d};if(typeof d=="object"&&(i=vc(d,u,n,r,o,s),i))return i}}return s&&Gp(e)&&s.add(e),!1}function Gp(e){if(!Object.isFrozen(e))return!1;for(const t of Object.values(e))if(!(typeof t!="object"||t===null)&&!Gp(t))return!1;return!0}function eE(e={}){if(process.env.NODE_ENV==="production")return()=>t=>n=>t(n);{const{isSerializable:t=qp,getEntries:n,ignoredActions:r=[],ignoredActionPaths:o=["meta.arg","meta.baseQueryMeta"],ignoredPaths:s=[],warnAfter:i=32,ignoreState:a=!1,ignoreActions:c=!1,disableCache:l=!1}=e,d=!l&&WeakSet?new WeakSet:void 0;return u=>f=>h=>{if(!Tp(h))return f(h);const m=f(h),g=Wp(i,"SerializableStateInvariantMiddleware");return!c&&!(r.length&&r.indexOf(h.type)!==-1)&&g.measureTime(()=>{const v=vc(h,"",t,n,o,d);if(v){const{keyPath:b,value:_}=v;console.error(`A non-serializable value was detected in an action, in the path: \`${b}\`. Value:`,_,`
|
|
17
17
|
Take a look at the logic that dispatched this action: `,h,`
|
|
18
18
|
(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)`,`
|
|
19
|
-
(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)`)}}),a||(
|
|
19
|
+
(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)`)}}),a||(g.measureTime(()=>{const v=u.getState(),b=vc(v,"",t,n,s,d);if(b){const{keyPath:_,value:w}=b;console.error(`A non-serializable value was detected in the state, in the path: \`${_}\`. Value:`,w,`
|
|
20
20
|
Take a look at the reducer(s) handling this action type: ${h.type}.
|
|
21
|
-
(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}}),m.warnIfExceeded()),p}}}function Yi(e){return typeof e=="boolean"}var eM=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:s=!0,actionCreatorCheck:o=!0}=t??{};let i=new cx;if(n&&(Yi(n)?i.push(WT):i.push(HT(n.extraArgument))),process.env.NODE_ENV!=="production"){if(r){let a={};Yi(r)||(a=r),i.unshift(JT(a))}if(s){let a={};Yi(s)||(a=s),i.push(QT(a))}if(o){let a={};Yi(o)||(a=o),i.unshift(GT(a))}}return i},tM="RTK_autoBatch",Rm=e=>t=>{setTimeout(t,e)},nM=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let s=!0,o=!1,i=!1;const a=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Rm(10):e.type==="callback"?e.queueNotification:Rm(e.timeout),l=()=>{i=!1,o&&(o=!1,a.forEach(u=>u()))};return Object.assign({},r,{subscribe(u){const d=()=>s&&u(),f=r.subscribe(d);return a.add(u),()=>{f(),a.delete(u)}},dispatch(u){try{return s=!u?.meta?.[tM],o=!s,o&&(i||(i=!0,c(l))),r.dispatch(u)}finally{s=!0}}})},rM=e=>function(n){const{autoBatch:r=!0}=n??{};let s=new cx(e);return r&&s.push(nM(typeof r=="object"?r:void 0)),s};function sM(e){const t=eM(),{reducer:n=void 0,middleware:r,devTools:s=!0,duplicateMiddlewareCheck:o=!0,preloadedState:i=void 0,enhancers:a=void 0}=e||{};let c;if(typeof n=="function")c=n;else if(wi(n))c=CT(n);else throw new Error(process.env.NODE_ENV==="production"?Oe(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");if(process.env.NODE_ENV!=="production"&&r&&typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?Oe(2):"`middleware` field must be a callback");let l;if(typeof r=="function"){if(l=r(t),process.env.NODE_ENV!=="production"&&!Array.isArray(l))throw new Error(process.env.NODE_ENV==="production"?Oe(3):"when using a middleware builder function, an array of middleware must be returned")}else l=t();if(process.env.NODE_ENV!=="production"&&l.some(m=>typeof m!="function"))throw new Error(process.env.NODE_ENV==="production"?Oe(4):"each middleware provided to configureStore must be a function");if(process.env.NODE_ENV!=="production"&&o){let m=new Set;l.forEach(y=>{if(m.has(y))throw new Error(process.env.NODE_ENV==="production"?Oe(42):"Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.");m.add(y)})}let u=sc;s&&(u=qT({trace:process.env.NODE_ENV!=="production",...typeof s=="object"&&s}));const d=RT(...l),f=rM(d);if(process.env.NODE_ENV!=="production"&&a&&typeof a!="function")throw new Error(process.env.NODE_ENV==="production"?Oe(5):"`enhancers` field must be a callback");let h=typeof a=="function"?a(f):f();if(process.env.NODE_ENV!=="production"&&!Array.isArray(h))throw new Error(process.env.NODE_ENV==="production"?Oe(6):"`enhancers` callback must return an array");if(process.env.NODE_ENV!=="production"&&h.some(m=>typeof m!="function"))throw new Error(process.env.NODE_ENV==="production"?Oe(7):"each enhancer provided to configureStore must be a function");process.env.NODE_ENV!=="production"&&l.length&&!h.includes(d)&&console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");const p=u(...h);return Kv(c,i,p)}function hx(e){const t={},n=[];let r;const s={addCase(o,i){if(process.env.NODE_ENV!=="production"){if(n.length>0)throw new Error(process.env.NODE_ENV==="production"?Oe(26):"`builder.addCase` should only be called before calling `builder.addMatcher`");if(r)throw new Error(process.env.NODE_ENV==="production"?Oe(27):"`builder.addCase` should only be called before calling `builder.addDefaultCase`")}const a=typeof o=="string"?o:o.type;if(!a)throw new Error(process.env.NODE_ENV==="production"?Oe(28):"`builder.addCase` cannot be called with an empty action type");if(a in t)throw new Error(process.env.NODE_ENV==="production"?Oe(29):`\`builder.addCase\` cannot be called with two reducers for the same action type '${a}'`);return t[a]=i,s},addAsyncThunk(o,i){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?Oe(43):"`builder.addAsyncThunk` should only be called before calling `builder.addDefaultCase`");return i.pending&&(t[o.pending.type]=i.pending),i.rejected&&(t[o.rejected.type]=i.rejected),i.fulfilled&&(t[o.fulfilled.type]=i.fulfilled),i.settled&&n.push({matcher:o.settled,reducer:i.settled}),s},addMatcher(o,i){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?Oe(30):"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return n.push({matcher:o,reducer:i}),s},addDefaultCase(o){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?Oe(31):"`builder.addDefaultCase` can only be called once");return r=o,s}};return e(s),[t,n,r]}function oM(e){return typeof e=="function"}function iM(e,t){if(process.env.NODE_ENV!=="production"&&typeof t=="object")throw new Error(process.env.NODE_ENV==="production"?Oe(8):"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");let[n,r,s]=hx(t),o;if(oM(e))o=()=>Cm(e());else{const a=Cm(e);o=()=>a}function i(a=o(),c){let l=[n[c.type],...r.filter(({matcher:u})=>u(c)).map(({reducer:u})=>u)];return l.filter(u=>!!u).length===0&&(l=[s]),l.reduce((u,d)=>{if(d)if(Kn(u)){const h=d(u,c);return h===void 0?u:h}else{if(hn(u))return sx(u,f=>d(f,c));{const f=d(u,c);if(f===void 0){if(u===null)return u;throw Error("A case reducer on a non-draftable value must not return undefined")}return f}}return u},a)}return i.getInitialState=o,i}var aM=(e,t)=>ix(e)?e.match(t):e(t);function cM(...e){return t=>e.some(n=>aM(n,t))}var lM="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",uM=(e=21)=>{let t="",n=e;for(;n--;)t+=lM[Math.random()*64|0];return t},dM=["name","message","stack","code"],au=class{constructor(e,t){this.payload=e,this.meta=t}_type},Pm=class{constructor(e,t){this.payload=e,this.meta=t}_type},fM=e=>{if(typeof e=="object"&&e!==null){const t={};for(const n of dM)typeof e[n]=="string"&&(t[n]=e[n]);return t}return{message:String(e)}},Om="External signal was aborted",xr=(()=>{function e(t,n,r){const s=$o(t+"/fulfilled",(c,l,u,d)=>({payload:c,meta:{...d||{},arg:u,requestId:l,requestStatus:"fulfilled"}})),o=$o(t+"/pending",(c,l,u)=>({payload:void 0,meta:{...u||{},arg:l,requestId:c,requestStatus:"pending"}})),i=$o(t+"/rejected",(c,l,u,d,f)=>({payload:d,error:(r&&r.serializeError||fM)(c||"Rejected"),meta:{...f||{},arg:u,requestId:l,rejectedWithValue:!!d,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function a(c,{signal:l}={}){return(u,d,f)=>{const h=r?.idGenerator?r.idGenerator(c):uM(),p=new AbortController;let m,y;function b(_){y=_,p.abort()}l&&(l.aborted?b(Om):l.addEventListener("abort",()=>b(Om),{once:!0}));const x=(async function(){let _;try{let S=r?.condition?.(c,{getState:d,extra:f});if(pM(S)&&(S=await S),S===!1||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const C=new Promise((k,E)=>{m=()=>{E({name:"AbortError",message:y||"Aborted"})},p.signal.addEventListener("abort",m,{once:!0})});u(o(h,c,r?.getPendingMeta?.({requestId:h,arg:c},{getState:d,extra:f}))),_=await Promise.race([C,Promise.resolve(n(c,{dispatch:u,getState:d,extra:f,requestId:h,signal:p.signal,abort:b,rejectWithValue:(k,E)=>new au(k,E),fulfillWithValue:(k,E)=>new Pm(k,E)})).then(k=>{if(k instanceof au)throw k;return k instanceof Pm?s(k.payload,h,c,k.meta):s(k,h,c)})])}catch(S){_=S instanceof au?i(null,h,c,S.payload,S.meta):i(S,h,c)}finally{m&&p.signal.removeEventListener("abort",m)}return r&&!r.dispatchConditionRejection&&i.match(_)&&_.meta.condition||u(_),_})();return Object.assign(x,{abort:b,requestId:h,arg:c,unwrap(){return x.then(hM)}})}}return Object.assign(a,{pending:o,rejected:i,fulfilled:s,settled:cM(i,s),typePrefix:t})}return e.withTypes=()=>e,e})();function hM(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function pM(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var mM=Symbol.for("rtk-slice-createasyncthunk");function gM(e,t){return`${e}/${t}`}function yM({creators:e}={}){const t=e?.asyncThunk?.[mM];return function(r){const{name:s,reducerPath:o=s}=r;if(!s)throw new Error(process.env.NODE_ENV==="production"?Oe(11):"`name` is a required option for createSlice");typeof process<"u"&&process.env.NODE_ENV==="development"&&r.initialState===void 0&&console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");const i=(typeof r.reducers=="function"?r.reducers(xM()):r.reducers)||{},a=Object.keys(i),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},l={addCase(_,w){const S=typeof _=="string"?_:_.type;if(!S)throw new Error(process.env.NODE_ENV==="production"?Oe(12):"`context.addCase` cannot be called with an empty action type");if(S in c.sliceCaseReducersByType)throw new Error(process.env.NODE_ENV==="production"?Oe(13):"`context.addCase` cannot be called with two reducers for the same action type: "+S);return c.sliceCaseReducersByType[S]=w,l},addMatcher(_,w){return c.sliceMatchers.push({matcher:_,reducer:w}),l},exposeAction(_,w){return c.actionCreators[_]=w,l},exposeCaseReducer(_,w){return c.sliceCaseReducersByName[_]=w,l}};a.forEach(_=>{const w=i[_],S={reducerName:_,type:gM(s,_),createNotation:typeof r.reducers=="function"};wM(w)?EM(S,w,l,t):_M(S,w,l)});function u(){if(process.env.NODE_ENV!=="production"&&typeof r.extraReducers=="object")throw new Error(process.env.NODE_ENV==="production"?Oe(14):"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");const[_={},w=[],S=void 0]=typeof r.extraReducers=="function"?hx(r.extraReducers):[r.extraReducers],C={..._,...c.sliceCaseReducersByType};return iM(r.initialState,k=>{for(let E in C)k.addCase(E,C[E]);for(let E of c.sliceMatchers)k.addMatcher(E.matcher,E.reducer);for(let E of w)k.addMatcher(E.matcher,E.reducer);S&&k.addDefaultCase(S)})}const d=_=>_,f=new Map,h=new WeakMap;let p;function m(_,w){return p||(p=u()),p(_,w)}function y(){return p||(p=u()),p.getInitialState()}function b(_,w=!1){function S(k){let E=k[_];if(typeof E>"u"){if(w)E=Gi(h,S,y);else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?Oe(15):"selectSlice returned undefined for an uninjected slice reducer")}return E}function C(k=d){const E=Gi(f,w,()=>new WeakMap);return Gi(E,k,()=>{const P={};for(const[O,N]of Object.entries(r.selectors??{}))P[O]=bM(N,k,()=>Gi(h,k,y),w);return P})}return{reducerPath:_,getSelectors:C,get selectors(){return C(S)},selectSlice:S}}const x={name:s,reducer:m,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:y,...b(o),injectInto(_,{reducerPath:w,...S}={}){const C=w??o;return _.inject({reducerPath:C,reducer:m},S),{...x,...b(C,!0)}}};return x}}function bM(e,t,n,r){function s(o,...i){let a=t(o);if(typeof a>"u"){if(r)a=n();else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?Oe(16):"selectState returned undefined for an uninjected slice reducer")}return e(a,...i)}return s.unwrapped=e,s}var vM=yM();function xM(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function _M({type:e,reducerName:t,createNotation:n},r,s){let o,i;if("reducer"in r){if(n&&!SM(r))throw new Error(process.env.NODE_ENV==="production"?Oe(17):"Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");o=r.reducer,i=r.prepare}else o=r;s.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,i?$o(e,i):$o(e))}function wM(e){return e._reducerDefinitionType==="asyncThunk"}function SM(e){return e._reducerDefinitionType==="reducerWithPrepare"}function EM({type:e,reducerName:t},n,r,s){if(!s)throw new Error(process.env.NODE_ENV==="production"?Oe(18):"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");const{payloadCreator:o,fulfilled:i,pending:a,rejected:c,settled:l,options:u}=n,d=s(e,o,u);r.exposeAction(t,d),i&&r.addCase(d.fulfilled,i),a&&r.addCase(d.pending,a),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:i||Xi,pending:a||Xi,rejected:c||Xi,settled:l||Xi})}function Xi(){}function Oe(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const _r={getSummary:(e=60)=>Te.get(`/monitors/summary?bars=${e}`).then(t=>t.data.rows),getList:()=>Te.get("/monitors").then(e=>e.data.monitors),getResults:(e,t=180)=>Te.get(`/monitors/${e}/results?limit=${t}`).then(n=>n.data.results),create:e=>Te.post("/monitors",e).then(t=>t.data),update:(e,t)=>Te.put(`/monitors/${e}`,t).then(n=>n.data),delete:e=>Te.delete(`/monitors/${e}`).then(t=>t.data),togglePause:(e,t)=>Te.post(`/monitors/${e}/pause`,{paused:t}).then(n=>n.data)},kM={data:[],list:[],current:null,currentResults:[],loading:!1,error:null,actionLoading:!1},Aa=xr("monitors/fetchResults",async(e,{rejectWithValue:t})=>{try{return await _r.getResults(e)}catch(n){return t(n.response?.data?.message||"Failed to fetch results")}}),Ur=xr("monitors/fetchSummary",async(e=60,{rejectWithValue:t})=>{try{return await _r.getSummary(e)}catch(n){return t(n.response?.data?.message||"Failed to fetch summary")}}),Na=xr("monitors/fetchAll",async(e,{rejectWithValue:t})=>{try{return await _r.getList()}catch(n){return t(n.response?.data?.message||"Failed to fetch monitors")}}),ks=xr("monitors/fetchOne",async(e,{rejectWithValue:t})=>{try{const r=(await _r.getList()).find(s=>s.id===e);if(!r)throw new Error("Monitor not found");return r}catch(n){return t(n.message||n.response?.data?.message||"Failed to fetch monitor")}}),dc=xr("monitors/pause",async({id:e,paused:t},{rejectWithValue:n})=>{try{return await _r.togglePause(e,t),{id:e,paused:t}}catch(r){return n(r.response?.data?.message||"Failed to toggle pause")}}),Nf=xr("monitors/delete",async(e,{rejectWithValue:t})=>{try{return await _r.delete(e),e}catch(n){return t(n.response?.data?.message||"Failed to delete monitor")}}),px=xr("monitors/create",async(e,{rejectWithValue:t})=>{try{return await _r.create(e)}catch(n){return t(n.response?.data?.message||"Failed to create monitor")}}),Df=xr("monitors/update",async({id:e,data:t},{rejectWithValue:n})=>{try{return await _r.update(e,t)}catch(r){return n(r.response?.data?.message||"Failed to update monitor")}}),mx=vM({name:"monitors",initialState:kM,reducers:{clearError:e=>{e.error=null},setCurrentMonitor:(e,t)=>{e.current=t.payload}},extraReducers:e=>{e.addCase(Ur.pending,t=>{t.loading=!0,t.error=null}),e.addCase(Ur.fulfilled,(t,n)=>{t.loading=!1,t.data=n.payload}),e.addCase(Ur.rejected,(t,n)=>{t.loading=!1,t.error=n.payload}),e.addCase(Na.pending,t=>{t.loading=!0}),e.addCase(Na.fulfilled,(t,n)=>{t.loading=!1,t.list=n.payload}),e.addCase(Na.rejected,(t,n)=>{t.loading=!1,t.error=n.payload}),e.addCase(ks.pending,t=>{t.loading=!0}),e.addCase(ks.fulfilled,(t,n)=>{t.loading=!1,t.current=n.payload}),e.addCase(Aa.fulfilled,(t,n)=>{t.currentResults=n.payload}),e.addCase(dc.pending,t=>{t.actionLoading=!0}),e.addCase(dc.fulfilled,(t,n)=>{t.actionLoading=!1;const r=t.data.find(o=>o.monitor.id===n.payload.id);r&&(r.monitor.isPaused=n.payload.paused);const s=t.list.find(o=>o.id===n.payload.id);s&&(s.isPaused=n.payload.paused),t.current?.id===n.payload.id&&(t.current.isPaused=n.payload.paused)}),e.addCase(Nf.fulfilled,(t,n)=>{t.data=t.data.filter(r=>r.monitor.id!==n.payload),t.list=t.list.filter(r=>r.id!==n.payload),t.current?.id===n.payload&&(t.current=null)}),e.addCase(px.fulfilled,(t,n)=>{t.list.push(n.payload.monitor)}),e.addCase(Df.fulfilled,(t,n)=>{const r=t.list.findIndex(o=>o.id===n.payload.monitor.id);r!==-1&&(t.list[r]=n.payload.monitor);const s=t.data.findIndex(o=>o.monitor.id===n.payload.monitor.id);s!==-1&&(t.data[s].monitor=n.payload.monitor),t.current?.id===n.payload.monitor.id&&(t.current=n.payload.monitor)})}}),{clearError:qH,setCurrentMonitor:KH}=mx.actions,CM=mx.reducer;const RM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),PM=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Tm=e=>{const t=PM(e);return t.charAt(0).toUpperCase()+t.slice(1)},gx=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),OM=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var TM={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const MM=T.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:i,...a},c)=>T.createElement("svg",{ref:c,...TM,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:gx("lucide",s),...!o&&!OM(a)&&{"aria-hidden":"true"},...a},[...i.map(([l,u])=>T.createElement(l,u)),...Array.isArray(o)?o:[o]]));const Ke=(e,t)=>{const n=T.forwardRef(({className:r,...s},o)=>T.createElement(MM,{ref:o,iconNode:t,className:gx(`lucide-${RM(Tm(e))}`,`lucide-${e}`,r),...s}));return n.displayName=Tm(e),n};const AM=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],cu=Ke("activity",AM);const NM=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],yx=Ke("arrow-left",NM);const DM=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],bx=Ke("check",DM);const IM=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],vx=Ke("chevron-down",IM);const jM=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],LM=Ke("chevron-up",jM);const FM=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],xx=Ke("copy",FM);const zM=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],$M=Ke("database",zM);const VM=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],BM=Ke("ellipsis",VM);const UM=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],WM=Ke("globe",UM);const HM=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],If=Ke("loader-circle",HM);const qM=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],KM=Ke("package",qM);const ZM=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],_x=Ke("pause",ZM);const GM=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],wx=Ke("pencil",GM);const YM=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Sx=Ke("play",YM);const XM=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Mm=Ke("plus",XM);const JM=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Ex=Ke("search",JM);const QM=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],e1=Ke("send",QM);const t1=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],n1=Ke("server",t1);const r1=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],s1=Ke("terminal",r1);const o1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],jf=Ke("trash-2",o1);const i1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],a1=Ke("x",i1);function Am(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Yn(...e){return t=>{let n=!1;const r=e.map(s=>{const o=Am(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():Am(e[s],null)}}}}function Pe(...e){return v.useCallback(Yn(...e),e)}var c1=Symbol.for("react.lazy"),fc=v[" use ".trim().toString()];function l1(e){return typeof e=="object"&&e!==null&&"then"in e}function kx(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===c1&&"_payload"in e&&l1(e._payload)}function Cx(e){const t=u1(e),n=v.forwardRef((r,s)=>{let{children:o,...i}=r;kx(o)&&typeof fc=="function"&&(o=fc(o._payload));const a=v.Children.toArray(o),c=a.find(f1);if(c){const l=c.props.children,u=a.map(d=>d===c?v.Children.count(l)>1?v.Children.only(null):v.isValidElement(l)?l.props.children:null:d);return g.jsx(t,{...i,ref:s,children:v.isValidElement(l)?v.cloneElement(l,void 0,u):null})}return g.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}var Lf=Cx("Slot");function u1(e){const t=v.forwardRef((n,r)=>{let{children:s,...o}=n;if(kx(s)&&typeof fc=="function"&&(s=fc(s._payload)),v.isValidElement(s)){const i=p1(s),a=h1(o,s.props);return s.type!==v.Fragment&&(a.ref=r?Yn(r,i):i),v.cloneElement(s,a)}return v.Children.count(s)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var d1=Symbol("radix.slottable");function f1(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===d1}function h1(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function p1(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Nm=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Dm=Rf,Rx=(e,t)=>n=>{var r;if(t?.variants==null)return Dm(e,n?.class,n?.className);const{variants:s,defaultVariants:o}=t,i=Object.keys(s).map(l=>{const u=n?.[l],d=o?.[l];if(u===null)return null;const f=Nm(u)||Nm(d);return s[l][f]}),a=n&&Object.entries(n).reduce((l,u)=>{let[d,f]=u;return f===void 0||(l[d]=f),l},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,u)=>{let{class:d,className:f,...h}=u;return Object.entries(h).every(p=>{let[m,y]=p;return Array.isArray(y)?y.includes({...o,...a}[m]):{...o,...a}[m]===y})?[...l,d,f]:l},[]);return Dm(e,i,c,n?.class,n?.className)};function Se(...e){return Wv(Rf(e))}const m1=Rx("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function gt({className:e,variant:t,size:n,asChild:r=!1,...s}){const o=r?Lf:"button";return g.jsx(o,{"data-slot":"button",className:Se(m1({variant:t,size:n,className:e})),...s})}function re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e?.(s),n===!1||!s.defaultPrevented)return t?.(s)}}function g1(e,t){const n=v.createContext(t),r=o=>{const{children:i,...a}=o,c=v.useMemo(()=>a,Object.values(a));return g.jsx(n.Provider,{value:c,children:i})};r.displayName=e+"Provider";function s(o){const i=v.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,s]}function wr(e,t=[]){let n=[];function r(o,i){const a=v.createContext(i),c=n.length;n=[...n,i];const l=d=>{const{scope:f,children:h,...p}=d,m=f?.[e]?.[c]||a,y=v.useMemo(()=>p,Object.values(p));return g.jsx(m.Provider,{value:y,children:h})};l.displayName=o+"Provider";function u(d,f){const h=f?.[e]?.[c]||a,p=v.useContext(h);if(p)return p;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[l,u]}const s=()=>{const o=n.map(i=>v.createContext(i));return function(a){const c=a?.[e]||o;return v.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[r,y1(s,...t)]}function y1(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=r.reduce((a,{useScope:c,scopeName:l})=>{const d=c(o)[`__scope${l}`];return{...a,...d}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var vt=globalThis?.document?v.useLayoutEffect:()=>{},b1=v[" useInsertionEffect ".trim().toString()]||vt;function Zs({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,o,i]=v1({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:s;{const u=v.useRef(e!==void 0);v.useEffect(()=>{const d=u.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,r])}const l=v.useCallback(u=>{if(a){const d=x1(u)?u(e):u;d!==e&&i.current?.(d)}else o(u)},[a,e,o,i]);return[c,l]}function v1({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),s=v.useRef(n),o=v.useRef(t);return b1(()=>{o.current=t},[t]),v.useEffect(()=>{s.current!==n&&(o.current?.(n),s.current=n)},[n,s]),[n,r,o]}function x1(e){return typeof e=="function"}function _1(e){const t=w1(e),n=v.forwardRef((r,s)=>{const{children:o,...i}=r,a=v.Children.toArray(o),c=a.find(E1);if(c){const l=c.props.children,u=a.map(d=>d===c?v.Children.count(l)>1?v.Children.only(null):v.isValidElement(l)?l.props.children:null:d);return g.jsx(t,{...i,ref:s,children:v.isValidElement(l)?v.cloneElement(l,void 0,u):null})}return g.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function w1(e){const t=v.forwardRef((n,r)=>{const{children:s,...o}=n;if(v.isValidElement(s)){const i=C1(s),a=k1(o,s.props);return s.type!==v.Fragment&&(a.ref=r?Yn(r,i):i),v.cloneElement(s,a)}return v.Children.count(s)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var S1=Symbol("radix.slottable");function E1(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===S1}function k1(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function C1(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var R1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],be=R1.reduce((e,t)=>{const n=_1(`Primitive.${t}`),r=v.forwardRef((s,o)=>{const{asChild:i,...a}=s,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Px(e,t){e&&Ic.flushSync(()=>e.dispatchEvent(t))}function Im(e){const t=P1(e),n=v.forwardRef((r,s)=>{const{children:o,...i}=r,a=v.Children.toArray(o),c=a.find(T1);if(c){const l=c.props.children,u=a.map(d=>d===c?v.Children.count(l)>1?v.Children.only(null):v.isValidElement(l)?l.props.children:null:d);return g.jsx(t,{...i,ref:s,children:v.isValidElement(l)?v.cloneElement(l,void 0,u):null})}return g.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function P1(e){const t=v.forwardRef((n,r)=>{const{children:s,...o}=n;if(v.isValidElement(s)){const i=A1(s),a=M1(o,s.props);return s.type!==v.Fragment&&(a.ref=r?Yn(r,i):i),v.cloneElement(s,a)}return v.Children.count(s)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var O1=Symbol("radix.slottable");function T1(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===O1}function M1(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function A1(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Ff(e){const t=e+"CollectionProvider",[n,r]=wr(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:y,children:b}=m,x=T.useRef(null),_=T.useRef(new Map).current;return g.jsx(s,{scope:y,itemMap:_,collectionRef:x,children:b})};i.displayName=t;const a=e+"CollectionSlot",c=Im(a),l=T.forwardRef((m,y)=>{const{scope:b,children:x}=m,_=o(a,b),w=Pe(y,_.collectionRef);return g.jsx(c,{ref:w,children:x})});l.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=Im(u),h=T.forwardRef((m,y)=>{const{scope:b,children:x,..._}=m,w=T.useRef(null),S=Pe(y,w),C=o(u,b);return T.useEffect(()=>(C.itemMap.set(w,{ref:w,..._}),()=>{C.itemMap.delete(w)})),g.jsx(f,{[d]:"",ref:S,children:x})});h.displayName=u;function p(m){const y=o(e+"CollectionConsumer",m);return T.useCallback(()=>{const x=y.collectionRef.current;if(!x)return[];const _=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((C,k)=>_.indexOf(C.ref.current)-_.indexOf(k.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:l,ItemSlot:h},p,r]}var N1=v.createContext(void 0);function zf(e){const t=v.useContext(N1);return e||t||"ltr"}function On(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function D1(e,t=globalThis?.document){const n=On(e);v.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var I1="DismissableLayer",yd="dismissableLayer.update",j1="dismissableLayer.pointerDownOutside",L1="dismissableLayer.focusOutside",jm,Ox=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Qc=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...c}=e,l=v.useContext(Ox),[u,d]=v.useState(null),f=u?.ownerDocument??globalThis?.document,[,h]=v.useState({}),p=Pe(t,k=>d(k)),m=Array.from(l.layers),[y]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(y),x=u?m.indexOf(u):-1,_=l.layersWithOutsidePointerEventsDisabled.size>0,w=x>=b,S=$1(k=>{const E=k.target,P=[...l.branches].some(O=>O.contains(E));!w||P||(s?.(k),i?.(k),k.defaultPrevented||a?.())},f),C=V1(k=>{const E=k.target;[...l.branches].some(O=>O.contains(E))||(o?.(k),i?.(k),k.defaultPrevented||a?.())},f);return D1(k=>{x===l.layers.size-1&&(r?.(k),!k.defaultPrevented&&a&&(k.preventDefault(),a()))},f),v.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(jm=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Lm(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=jm)}},[u,f,n,l]),v.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Lm())},[u,l]),v.useEffect(()=>{const k=()=>h({});return document.addEventListener(yd,k),()=>document.removeEventListener(yd,k)},[]),g.jsx(be.div,{...c,ref:p,style:{pointerEvents:_?w?"auto":"none":void 0,...e.style},onFocusCapture:re(e.onFocusCapture,C.onFocusCapture),onBlurCapture:re(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:re(e.onPointerDownCapture,S.onPointerDownCapture)})});Qc.displayName=I1;var F1="DismissableLayerBranch",z1=v.forwardRef((e,t)=>{const n=v.useContext(Ox),r=v.useRef(null),s=Pe(t,r);return v.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),g.jsx(be.div,{...e,ref:s})});z1.displayName=F1;function $1(e,t=globalThis?.document){const n=On(e),r=v.useRef(!1),s=v.useRef(()=>{});return v.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let c=function(){Tx(j1,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function V1(e,t=globalThis?.document){const n=On(e),r=v.useRef(!1);return v.useEffect(()=>{const s=o=>{o.target&&!r.current&&Tx(L1,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Lm(){const e=new CustomEvent(yd);document.dispatchEvent(e)}function Tx(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?Px(s,o):s.dispatchEvent(o)}var lu=0;function $f(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Fm()),document.body.insertAdjacentElement("beforeend",e[1]??Fm()),lu++,()=>{lu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),lu--}},[])}function Fm(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var uu="focusScope.autoFocusOnMount",du="focusScope.autoFocusOnUnmount",zm={bubbles:!1,cancelable:!0},B1="FocusScope",el=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[a,c]=v.useState(null),l=On(s),u=On(o),d=v.useRef(null),f=Pe(t,m=>c(m)),h=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let m=function(_){if(h.paused||!a)return;const w=_.target;a.contains(w)?d.current=w:nr(d.current,{select:!0})},y=function(_){if(h.paused||!a)return;const w=_.relatedTarget;w!==null&&(a.contains(w)||nr(d.current,{select:!0}))},b=function(_){if(document.activeElement===document.body)for(const S of _)S.removedNodes.length>0&&nr(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const x=new MutationObserver(b);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),x.disconnect()}}},[r,a,h.paused]),v.useEffect(()=>{if(a){Vm.add(h);const m=document.activeElement;if(!a.contains(m)){const b=new CustomEvent(uu,zm);a.addEventListener(uu,l),a.dispatchEvent(b),b.defaultPrevented||(U1(Z1(Mx(a)),{select:!0}),document.activeElement===m&&nr(a))}return()=>{a.removeEventListener(uu,l),setTimeout(()=>{const b=new CustomEvent(du,zm);a.addEventListener(du,u),a.dispatchEvent(b),b.defaultPrevented||nr(m??document.body,{select:!0}),a.removeEventListener(du,u),Vm.remove(h)},0)}}},[a,l,u,h]);const p=v.useCallback(m=>{if(!n&&!r||h.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(y&&b){const x=m.currentTarget,[_,w]=W1(x);_&&w?!m.shiftKey&&b===w?(m.preventDefault(),n&&nr(_,{select:!0})):m.shiftKey&&b===_&&(m.preventDefault(),n&&nr(w,{select:!0})):b===x&&m.preventDefault()}},[n,r,h.paused]);return g.jsx(be.div,{tabIndex:-1,...i,ref:f,onKeyDown:p})});el.displayName=B1;function U1(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(nr(r,{select:t}),document.activeElement!==n)return}function W1(e){const t=Mx(e),n=$m(t,e),r=$m(t.reverse(),e);return[n,r]}function Mx(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function $m(e,t){for(const n of e)if(!H1(n,{upTo:t}))return n}function H1(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function q1(e){return e instanceof HTMLInputElement&&"select"in e}function nr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&q1(e)&&t&&e.select()}}var Vm=K1();function K1(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Bm(e,t),e.unshift(t)},remove(t){e=Bm(e,t),e[0]?.resume()}}}function Bm(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Z1(e){return e.filter(t=>t.tagName!=="A")}var G1=v[" useId ".trim().toString()]||(()=>{}),Y1=0;function Hn(e){const[t,n]=v.useState(G1());return vt(()=>{n(r=>r??String(Y1++))},[e]),e||(t?`radix-${t}`:"")}const X1=["top","right","bottom","left"],gr=Math.min,$t=Math.max,hc=Math.round,Ji=Math.floor,kn=e=>({x:e,y:e}),J1={left:"right",right:"left",bottom:"top",top:"bottom"},Q1={start:"end",end:"start"};function bd(e,t,n){return $t(e,gr(t,n))}function Zn(e,t){return typeof e=="function"?e(t):e}function Gn(e){return e.split("-")[0]}function no(e){return e.split("-")[1]}function Vf(e){return e==="x"?"y":"x"}function Bf(e){return e==="y"?"height":"width"}const eA=new Set(["top","bottom"]);function En(e){return eA.has(Gn(e))?"y":"x"}function Uf(e){return Vf(En(e))}function tA(e,t,n){n===void 0&&(n=!1);const r=no(e),s=Uf(e),o=Bf(s);let i=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=pc(i)),[i,pc(i)]}function nA(e){const t=pc(e);return[vd(e),t,vd(t)]}function vd(e){return e.replace(/start|end/g,t=>Q1[t])}const Um=["left","right"],Wm=["right","left"],rA=["top","bottom"],sA=["bottom","top"];function oA(e,t,n){switch(e){case"top":case"bottom":return n?t?Wm:Um:t?Um:Wm;case"left":case"right":return t?rA:sA;default:return[]}}function iA(e,t,n,r){const s=no(e);let o=oA(Gn(e),n==="start",r);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(vd)))),o}function pc(e){return e.replace(/left|right|bottom|top/g,t=>J1[t])}function aA(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ax(e){return typeof e!="number"?aA(e):{top:e,right:e,bottom:e,left:e}}function mc(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Hm(e,t,n){let{reference:r,floating:s}=e;const o=En(t),i=Uf(t),a=Bf(i),c=Gn(t),l=o==="y",u=r.x+r.width/2-s.width/2,d=r.y+r.height/2-s.height/2,f=r[a]/2-s[a]/2;let h;switch(c){case"top":h={x:u,y:r.y-s.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-s.width,y:d};break;default:h={x:r.x,y:r.y}}switch(no(t)){case"start":h[i]-=f*(n&&l?-1:1);break;case"end":h[i]+=f*(n&&l?-1:1);break}return h}async function cA(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Zn(t,e),p=Ax(h),y=a[f?d==="floating"?"reference":"floating":d],b=mc(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),x=d==="floating"?{x:r,y:s,width:i.floating.width,height:i.floating.height}:i.reference,_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),w=await(o.isElement==null?void 0:o.isElement(_))?await(o.getScale==null?void 0:o.getScale(_))||{x:1,y:1}:{x:1,y:1},S=mc(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:_,strategy:c}):x);return{top:(b.top-S.top+p.top)/w.y,bottom:(S.bottom-b.bottom+p.bottom)/w.y,left:(b.left-S.left+p.left)/w.x,right:(S.right-b.right+p.right)/w.x}}const lA=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:i}=n,a=o.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:d}=Hm(l,r,c),f=r,h={},p=0;for(let y=0;y<a.length;y++){var m;const{name:b,fn:x}=a[y],{x:_,y:w,data:S,reset:C}=await x({x:u,y:d,initialPlacement:r,placement:f,strategy:s,middlewareData:h,rects:l,platform:{...i,detectOverflow:(m=i.detectOverflow)!=null?m:cA},elements:{reference:e,floating:t}});u=_??u,d=w??d,h={...h,[b]:{...h[b],...S}},C&&p<=50&&(p++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(l=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):C.rects),{x:u,y:d}=Hm(l,f,c)),y=-1)}return{x:u,y:d,placement:f,strategy:s,middlewareData:h}},uA=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:o,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=Zn(e,t)||{};if(l==null)return{};const d=Ax(u),f={x:n,y:r},h=Uf(s),p=Bf(h),m=await i.getDimensions(l),y=h==="y",b=y?"top":"left",x=y?"bottom":"right",_=y?"clientHeight":"clientWidth",w=o.reference[p]+o.reference[h]-f[h]-o.floating[p],S=f[h]-o.reference[h],C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let k=C?C[_]:0;(!k||!await(i.isElement==null?void 0:i.isElement(C)))&&(k=a.floating[_]||o.floating[p]);const E=w/2-S/2,P=k/2-m[p]/2-1,O=gr(d[b],P),N=gr(d[x],P),A=O,j=k-m[p]-N,$=k/2-m[p]/2+E,q=bd(A,$,j),D=!c.arrow&&no(s)!=null&&$!==q&&o.reference[p]/2-($<A?O:N)-m[p]/2<0,H=D?$<A?$-A:$-j:0;return{[h]:f[h]+H,data:{[h]:q,centerOffset:$-q-H,...D&&{alignmentOffset:H}},reset:D}}}),dA=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...y}=Zn(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const b=Gn(s),x=En(a),_=Gn(a)===a,w=await(c.isRTL==null?void 0:c.isRTL(l.floating)),S=f||(_||!m?[pc(a)]:nA(a)),C=p!=="none";!f&&C&&S.push(...iA(a,m,p,w));const k=[a,...S],E=await c.detectOverflow(t,y),P=[];let O=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&P.push(E[b]),d){const $=tA(s,i,w);P.push(E[$[0]],E[$[1]])}if(O=[...O,{placement:s,overflows:P}],!P.every($=>$<=0)){var N,A;const $=(((N=o.flip)==null?void 0:N.index)||0)+1,q=k[$];if(q&&(!(d==="alignment"?x!==En(q):!1)||O.every(F=>En(F.placement)===x?F.overflows[0]>0:!0)))return{data:{index:$,overflows:O},reset:{placement:q}};let D=(A=O.filter(H=>H.overflows[0]<=0).sort((H,F)=>H.overflows[1]-F.overflows[1])[0])==null?void 0:A.placement;if(!D)switch(h){case"bestFit":{var j;const H=(j=O.filter(F=>{if(C){const W=En(F.placement);return W===x||W==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(W=>W>0).reduce((W,se)=>W+se,0)]).sort((F,W)=>F[1]-W[1])[0])==null?void 0:j[0];H&&(D=H);break}case"initialPlacement":D=a;break}if(s!==D)return{reset:{placement:D}}}return{}}}};function qm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Km(e){return X1.some(t=>e[t]>=0)}const fA=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...o}=Zn(e,t);switch(s){case"referenceHidden":{const i=await r.detectOverflow(t,{...o,elementContext:"reference"}),a=qm(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Km(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...o,altBoundary:!0}),a=qm(i,n.floating);return{data:{escapedOffsets:a,escaped:Km(a)}}}default:return{}}}}},Nx=new Set(["left","top"]);async function hA(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),i=Gn(n),a=no(n),c=En(n)==="y",l=Nx.has(i)?-1:1,u=o&&c?-1:1,d=Zn(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),c?{x:h*u,y:f*l}:{x:f*l,y:h*u}}const pA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:i,middlewareData:a}=t,c=await hA(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:o+c.y,data:{...c,placement:i}}}}},mA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:b=>{let{x,y:_}=b;return{x,y:_}}},...l}=Zn(e,t),u={x:n,y:r},d=await o.detectOverflow(t,l),f=En(Gn(s)),h=Vf(f);let p=u[h],m=u[f];if(i){const b=h==="y"?"top":"left",x=h==="y"?"bottom":"right",_=p+d[b],w=p-d[x];p=bd(_,p,w)}if(a){const b=f==="y"?"top":"left",x=f==="y"?"bottom":"right",_=m+d[b],w=m-d[x];m=bd(_,m,w)}const y=c.fn({...t,[h]:p,[f]:m});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[h]:i,[f]:a}}}}}},gA=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:o,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=Zn(e,t),u={x:n,y:r},d=En(s),f=Vf(d);let h=u[f],p=u[d];const m=Zn(a,t),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const _=f==="y"?"height":"width",w=o.reference[f]-o.floating[_]+y.mainAxis,S=o.reference[f]+o.reference[_]-y.mainAxis;h<w?h=w:h>S&&(h=S)}if(l){var b,x;const _=f==="y"?"width":"height",w=Nx.has(Gn(s)),S=o.reference[d]-o.floating[_]+(w&&((b=i.offset)==null?void 0:b[d])||0)+(w?0:y.crossAxis),C=o.reference[d]+o.reference[_]+(w?0:((x=i.offset)==null?void 0:x[d])||0)-(w?y.crossAxis:0);p<S?p=S:p>C&&(p=C)}return{[f]:h,[d]:p}}}},yA=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:o,platform:i,elements:a}=t,{apply:c=()=>{},...l}=Zn(e,t),u=await i.detectOverflow(t,l),d=Gn(s),f=no(s),h=En(s)==="y",{width:p,height:m}=o.floating;let y,b;d==="top"||d==="bottom"?(y=d,b=f===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(b=d,y=f==="end"?"top":"bottom");const x=m-u.top-u.bottom,_=p-u.left-u.right,w=gr(m-u[y],x),S=gr(p-u[b],_),C=!t.middlewareData.shift;let k=w,E=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(E=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=x),C&&!f){const O=$t(u.left,0),N=$t(u.right,0),A=$t(u.top,0),j=$t(u.bottom,0);h?E=p-2*(O!==0||N!==0?O+N:$t(u.left,u.right)):k=m-2*(A!==0||j!==0?A+j:$t(u.top,u.bottom))}await c({...t,availableWidth:E,availableHeight:k});const P=await i.getDimensions(a.floating);return p!==P.width||m!==P.height?{reset:{rects:!0}}:{}}}};function tl(){return typeof window<"u"}function ro(e){return Dx(e)?(e.nodeName||"").toLowerCase():"#document"}function Ht(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function An(e){var t;return(t=(Dx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Dx(e){return tl()?e instanceof Node||e instanceof Ht(e).Node:!1}function pn(e){return tl()?e instanceof Element||e instanceof Ht(e).Element:!1}function Tn(e){return tl()?e instanceof HTMLElement||e instanceof Ht(e).HTMLElement:!1}function Zm(e){return!tl()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ht(e).ShadowRoot}const bA=new Set(["inline","contents"]);function Ei(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=mn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!bA.has(s)}const vA=new Set(["table","td","th"]);function xA(e){return vA.has(ro(e))}const _A=[":popover-open",":modal"];function nl(e){return _A.some(t=>{try{return e.matches(t)}catch{return!1}})}const wA=["transform","translate","scale","rotate","perspective"],SA=["transform","translate","scale","rotate","perspective","filter"],EA=["paint","layout","strict","content"];function Wf(e){const t=Hf(),n=pn(e)?mn(e):e;return wA.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||SA.some(r=>(n.willChange||"").includes(r))||EA.some(r=>(n.contain||"").includes(r))}function kA(e){let t=yr(e);for(;Tn(t)&&!Gs(t);){if(Wf(t))return t;if(nl(t))return null;t=yr(t)}return null}function Hf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const CA=new Set(["html","body","#document"]);function Gs(e){return CA.has(ro(e))}function mn(e){return Ht(e).getComputedStyle(e)}function rl(e){return pn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function yr(e){if(ro(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Zm(e)&&e.host||An(e);return Zm(t)?t.host:t}function Ix(e){const t=yr(e);return Gs(t)?e.ownerDocument?e.ownerDocument.body:e.body:Tn(t)&&Ei(t)?t:Ix(t)}function ni(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Ix(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),i=Ht(s);if(o){const a=xd(i);return t.concat(i,i.visualViewport||[],Ei(s)?s:[],a&&n?ni(a):[])}return t.concat(s,ni(s,[],n))}function xd(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function jx(e){const t=mn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Tn(e),o=s?e.offsetWidth:n,i=s?e.offsetHeight:r,a=hc(n)!==o||hc(r)!==i;return a&&(n=o,r=i),{width:n,height:r,$:a}}function qf(e){return pn(e)?e:e.contextElement}function Ns(e){const t=qf(e);if(!Tn(t))return kn(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=jx(t);let i=(o?hc(n.width):n.width)/r,a=(o?hc(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const RA=kn(0);function Lx(e){const t=Ht(e);return!Hf()||!t.visualViewport?RA:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function PA(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ht(e)?!1:t}function ts(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=qf(e);let i=kn(1);t&&(r?pn(r)&&(i=Ns(r)):i=Ns(e));const a=PA(o,n,r)?Lx(o):kn(0);let c=(s.left+a.x)/i.x,l=(s.top+a.y)/i.y,u=s.width/i.x,d=s.height/i.y;if(o){const f=Ht(o),h=r&&pn(r)?Ht(r):r;let p=f,m=xd(p);for(;m&&r&&h!==p;){const y=Ns(m),b=m.getBoundingClientRect(),x=mn(m),_=b.left+(m.clientLeft+parseFloat(x.paddingLeft))*y.x,w=b.top+(m.clientTop+parseFloat(x.paddingTop))*y.y;c*=y.x,l*=y.y,u*=y.x,d*=y.y,c+=_,l+=w,p=Ht(m),m=xd(p)}}return mc({width:u,height:d,x:c,y:l})}function sl(e,t){const n=rl(e).scrollLeft;return t?t.left+n:ts(An(e)).left+n}function Fx(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-sl(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function OA(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",i=An(r),a=t?nl(t.floating):!1;if(r===i||a&&o)return n;let c={scrollLeft:0,scrollTop:0},l=kn(1);const u=kn(0),d=Tn(r);if((d||!d&&!o)&&((ro(r)!=="body"||Ei(i))&&(c=rl(r)),Tn(r))){const h=ts(r);l=Ns(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const f=i&&!d&&!o?Fx(i,c):kn(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function TA(e){return Array.from(e.getClientRects())}function MA(e){const t=An(e),n=rl(e),r=e.ownerDocument.body,s=$t(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=$t(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+sl(e);const a=-n.scrollTop;return mn(r).direction==="rtl"&&(i+=$t(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:i,y:a}}const Gm=25;function AA(e,t){const n=Ht(e),r=An(e),s=n.visualViewport;let o=r.clientWidth,i=r.clientHeight,a=0,c=0;if(s){o=s.width,i=s.height;const u=Hf();(!u||u&&t==="fixed")&&(a=s.offsetLeft,c=s.offsetTop)}const l=sl(r);if(l<=0){const u=r.ownerDocument,d=u.body,f=getComputedStyle(d),h=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,p=Math.abs(r.clientWidth-d.clientWidth-h);p<=Gm&&(o-=p)}else l<=Gm&&(o+=l);return{width:o,height:i,x:a,y:c}}const NA=new Set(["absolute","fixed"]);function DA(e,t){const n=ts(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=Tn(e)?Ns(e):kn(1),i=e.clientWidth*o.x,a=e.clientHeight*o.y,c=s*o.x,l=r*o.y;return{width:i,height:a,x:c,y:l}}function Ym(e,t,n){let r;if(t==="viewport")r=AA(e,n);else if(t==="document")r=MA(An(e));else if(pn(t))r=DA(t,n);else{const s=Lx(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return mc(r)}function zx(e,t){const n=yr(e);return n===t||!pn(n)||Gs(n)?!1:mn(n).position==="fixed"||zx(n,t)}function IA(e,t){const n=t.get(e);if(n)return n;let r=ni(e,[],!1).filter(a=>pn(a)&&ro(a)!=="body"),s=null;const o=mn(e).position==="fixed";let i=o?yr(e):e;for(;pn(i)&&!Gs(i);){const a=mn(i),c=Wf(i);!c&&a.position==="fixed"&&(s=null),(o?!c&&!s:!c&&a.position==="static"&&!!s&&NA.has(s.position)||Ei(i)&&!c&&zx(e,i))?r=r.filter(u=>u!==i):s=a,i=yr(i)}return t.set(e,r),r}function jA(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const i=[...n==="clippingAncestors"?nl(t)?[]:IA(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((l,u)=>{const d=Ym(t,u,s);return l.top=$t(d.top,l.top),l.right=gr(d.right,l.right),l.bottom=gr(d.bottom,l.bottom),l.left=$t(d.left,l.left),l},Ym(t,a,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function LA(e){const{width:t,height:n}=jx(e);return{width:t,height:n}}function FA(e,t,n){const r=Tn(t),s=An(t),o=n==="fixed",i=ts(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const c=kn(0);function l(){c.x=sl(s)}if(r||!r&&!o)if((ro(t)!=="body"||Ei(s))&&(a=rl(t)),r){const h=ts(t,!0,o,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else s&&l();o&&!r&&s&&l();const u=s&&!r&&!o?Fx(s,a):kn(0),d=i.left+a.scrollLeft-c.x-u.x,f=i.top+a.scrollTop-c.y-u.y;return{x:d,y:f,width:i.width,height:i.height}}function fu(e){return mn(e).position==="static"}function Xm(e,t){if(!Tn(e)||mn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return An(e)===n&&(n=n.ownerDocument.body),n}function $x(e,t){const n=Ht(e);if(nl(e))return n;if(!Tn(e)){let s=yr(e);for(;s&&!Gs(s);){if(pn(s)&&!fu(s))return s;s=yr(s)}return n}let r=Xm(e,t);for(;r&&xA(r)&&fu(r);)r=Xm(r,t);return r&&Gs(r)&&fu(r)&&!Wf(r)?n:r||kA(e)||n}const zA=async function(e){const t=this.getOffsetParent||$x,n=this.getDimensions,r=await n(e.floating);return{reference:FA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function $A(e){return mn(e).direction==="rtl"}const VA={convertOffsetParentRelativeRectToViewportRelativeRect:OA,getDocumentElement:An,getClippingRect:jA,getOffsetParent:$x,getElementRects:zA,getClientRects:TA,getDimensions:LA,getScale:Ns,isElement:pn,isRTL:$A};function Vx(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function BA(e,t){let n=null,r;const s=An(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),o();const l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:h}=l;if(a||t(),!f||!h)return;const p=Ji(d),m=Ji(s.clientWidth-(u+f)),y=Ji(s.clientHeight-(d+h)),b=Ji(u),_={rootMargin:-p+"px "+-m+"px "+-y+"px "+-b+"px",threshold:$t(0,gr(1,c))||1};let w=!0;function S(C){const k=C[0].intersectionRatio;if(k!==c){if(!w)return i();k?i(!1,k):r=setTimeout(()=>{i(!1,1e-7)},1e3)}k===1&&!Vx(l,e.getBoundingClientRect())&&i(),w=!1}try{n=new IntersectionObserver(S,{..._,root:s.ownerDocument})}catch{n=new IntersectionObserver(S,_)}n.observe(e)}return i(!0),o}function UA(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=qf(e),u=s||o?[...l?ni(l):[],...ni(t)]:[];u.forEach(b=>{s&&b.addEventListener("scroll",n,{passive:!0}),o&&b.addEventListener("resize",n)});const d=l&&a?BA(l,n):null;let f=-1,h=null;i&&(h=new ResizeObserver(b=>{let[x]=b;x&&x.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var _;(_=h)==null||_.observe(t)})),n()}),l&&!c&&h.observe(l),h.observe(t));let p,m=c?ts(e):null;c&&y();function y(){const b=ts(e);m&&!Vx(m,b)&&n(),m=b,p=requestAnimationFrame(y)}return n(),()=>{var b;u.forEach(x=>{s&&x.removeEventListener("scroll",n),o&&x.removeEventListener("resize",n)}),d?.(),(b=h)==null||b.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const WA=pA,HA=mA,qA=dA,KA=yA,ZA=fA,Jm=uA,GA=gA,YA=(e,t,n)=>{const r=new Map,s={platform:VA,...n},o={...s.platform,_c:r};return lA(e,t,{...s,platform:o})};var XA=typeof document<"u",JA=function(){},Da=XA?T.useLayoutEffect:JA;function gc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!gc(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!gc(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Bx(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Qm(e,t){const n=Bx(e);return Math.round(t*n)/n}function hu(e){const t=v.useRef(e);return Da(()=>{t.current=e}),t}function QA(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:i}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,d]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=v.useState(r);gc(f,r)||h(r);const[p,m]=v.useState(null),[y,b]=v.useState(null),x=v.useCallback(F=>{F!==C.current&&(C.current=F,m(F))},[]),_=v.useCallback(F=>{F!==k.current&&(k.current=F,b(F))},[]),w=o||p,S=i||y,C=v.useRef(null),k=v.useRef(null),E=v.useRef(u),P=c!=null,O=hu(c),N=hu(s),A=hu(l),j=v.useCallback(()=>{if(!C.current||!k.current)return;const F={placement:t,strategy:n,middleware:f};N.current&&(F.platform=N.current),YA(C.current,k.current,F).then(W=>{const se={...W,isPositioned:A.current!==!1};$.current&&!gc(E.current,se)&&(E.current=se,Ic.flushSync(()=>{d(se)}))})},[f,t,n,N,A]);Da(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,d(F=>({...F,isPositioned:!1})))},[l]);const $=v.useRef(!1);Da(()=>($.current=!0,()=>{$.current=!1}),[]),Da(()=>{if(w&&(C.current=w),S&&(k.current=S),w&&S){if(O.current)return O.current(w,S,j);j()}},[w,S,j,O,P]);const q=v.useMemo(()=>({reference:C,floating:k,setReference:x,setFloating:_}),[x,_]),D=v.useMemo(()=>({reference:w,floating:S}),[w,S]),H=v.useMemo(()=>{const F={position:n,left:0,top:0};if(!D.floating)return F;const W=Qm(D.floating,u.x),se=Qm(D.floating,u.y);return a?{...F,transform:"translate("+W+"px, "+se+"px)",...Bx(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:se}},[n,a,D.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:j,refs:q,elements:D,floatingStyles:H}),[u,j,q,D,H])}const eN=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Jm({element:r.current,padding:s}).fn(n):{}:r?Jm({element:r,padding:s}).fn(n):{}}}},tN=(e,t)=>({...WA(e),options:[e,t]}),nN=(e,t)=>({...HA(e),options:[e,t]}),rN=(e,t)=>({...GA(e),options:[e,t]}),sN=(e,t)=>({...qA(e),options:[e,t]}),oN=(e,t)=>({...KA(e),options:[e,t]}),iN=(e,t)=>({...ZA(e),options:[e,t]}),aN=(e,t)=>({...eN(e),options:[e,t]});var cN="Arrow",Ux=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...o}=e;return g.jsx(be.svg,{...o,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ux.displayName=cN;var lN=Ux;function Wx(e){const[t,n]=v.useState(void 0);return vt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let i,a;if("borderBoxSize"in o){const c=o.borderBoxSize,l=Array.isArray(c)?c[0]:c;i=l.inlineSize,a=l.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Kf="Popper",[Hx,ol]=wr(Kf),[uN,qx]=Hx(Kf),Kx=e=>{const{__scopePopper:t,children:n}=e,[r,s]=v.useState(null);return g.jsx(uN,{scope:t,anchor:r,onAnchorChange:s,children:n})};Kx.displayName=Kf;var Zx="PopperAnchor",Gx=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=qx(Zx,n),i=v.useRef(null),a=Pe(t,i),c=v.useRef(null);return v.useEffect(()=>{const l=c.current;c.current=r?.current||i.current,l!==c.current&&o.onAnchorChange(c.current)}),r?null:g.jsx(be.div,{...s,ref:a})});Gx.displayName=Zx;var Zf="PopperContent",[dN,fN]=Hx(Zf),Yx=v.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:p,...m}=e,y=qx(Zf,n),[b,x]=v.useState(null),_=Pe(t,V=>x(V)),[w,S]=v.useState(null),C=Wx(w),k=C?.width??0,E=C?.height??0,P=r+(o!=="center"?"-"+o:""),O=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},N=Array.isArray(l)?l:[l],A=N.length>0,j={padding:O,boundary:N.filter(pN),altBoundary:A},{refs:$,floatingStyles:q,placement:D,isPositioned:H,middlewareData:F}=QA({strategy:"fixed",placement:P,whileElementsMounted:(...V)=>UA(...V,{animationFrame:h==="always"}),elements:{reference:y.anchor},middleware:[tN({mainAxis:s+E,alignmentAxis:i}),c&&nN({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?rN():void 0,...j}),c&&sN({...j}),oN({...j,apply:({elements:V,rects:ee,availableWidth:me,availableHeight:le})=>{const{width:fe,height:ge}=ee.reference,Ze=V.floating.style;Ze.setProperty("--radix-popper-available-width",`${me}px`),Ze.setProperty("--radix-popper-available-height",`${le}px`),Ze.setProperty("--radix-popper-anchor-width",`${fe}px`),Ze.setProperty("--radix-popper-anchor-height",`${ge}px`)}}),w&&aN({element:w,padding:a}),mN({arrowWidth:k,arrowHeight:E}),f&&iN({strategy:"referenceHidden",...j})]}),[W,se]=Qx(D),I=On(p);vt(()=>{H&&I?.()},[H,I]);const Y=F.arrow?.x,K=F.arrow?.y,Z=F.arrow?.centerOffset!==0,[oe,ce]=v.useState();return vt(()=>{b&&ce(window.getComputedStyle(b).zIndex)},[b]),g.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:H?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(" "),...F.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(dN,{scope:n,placedSide:W,onArrowChange:S,arrowX:Y,arrowY:K,shouldHideArrow:Z,children:g.jsx(be.div,{"data-side":W,"data-align":se,...m,ref:_,style:{...m.style,animation:H?void 0:"none"}})})})});Yx.displayName=Zf;var Xx="PopperArrow",hN={top:"bottom",right:"left",bottom:"top",left:"right"},Jx=v.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,o=fN(Xx,r),i=hN[o.placedSide];return g.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:g.jsx(lN,{...s,ref:n,style:{...s.style,display:"block"}})})});Jx.displayName=Xx;function pN(e){return e!==null}var mN=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:s}=t,i=s.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[l,u]=Qx(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(s.arrow?.x??0)+a/2,h=(s.arrow?.y??0)+c/2;let p="",m="";return l==="bottom"?(p=i?d:`${f}px`,m=`${-c}px`):l==="top"?(p=i?d:`${f}px`,m=`${r.floating.height+c}px`):l==="right"?(p=`${-c}px`,m=i?d:`${h}px`):l==="left"&&(p=`${r.floating.width+c}px`,m=i?d:`${h}px`),{data:{x:p,y:m}}}});function Qx(e){const[t,n="center"]=e.split("-");return[t,n]}var e_=Kx,t_=Gx,n_=Yx,r_=Jx,gN="Portal",il=v.forwardRef((e,t)=>{const{container:n,...r}=e,[s,o]=v.useState(!1);vt(()=>o(!0),[]);const i=n||s&&globalThis?.document?.body;return i?Dc.createPortal(g.jsx(be.div,{...r,ref:t}),i):null});il.displayName=gN;function yN(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var Xn=e=>{const{present:t,children:n}=e,r=bN(t),s=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Pe(r.ref,vN(s));return typeof n=="function"||r.isPresent?v.cloneElement(s,{ref:o}):null};Xn.displayName="Presence";function bN(e){const[t,n]=v.useState(),r=v.useRef(null),s=v.useRef(e),o=v.useRef("none"),i=e?"mounted":"unmounted",[a,c]=yN(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=Qi(r.current);o.current=a==="mounted"?l:"none"},[a]),vt(()=>{const l=r.current,u=s.current;if(u!==e){const f=o.current,h=Qi(l);e?c("MOUNT"):h==="none"||l?.display==="none"?c("UNMOUNT"):c(u&&f!==h?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),vt(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,d=h=>{const m=Qi(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&m&&(c("ANIMATION_END"),!s.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},f=h=>{h.target===t&&(o.current=Qi(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:v.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function Qi(e){return e?.animationName||"none"}function vN(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var pu="rovingFocusGroup.onEntryFocus",xN={bubbles:!1,cancelable:!0},ki="RovingFocusGroup",[_d,s_,_N]=Ff(ki),[wN,o_]=wr(ki,[_N]),[SN,EN]=wN(ki),i_=v.forwardRef((e,t)=>g.jsx(_d.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(_d.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(kN,{...e,ref:t})})}));i_.displayName=ki;var kN=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=v.useRef(null),h=Pe(t,f),p=zf(o),[m,y]=Zs({prop:i,defaultProp:a??null,onChange:c,caller:ki}),[b,x]=v.useState(!1),_=On(l),w=s_(n),S=v.useRef(!1),[C,k]=v.useState(0);return v.useEffect(()=>{const E=f.current;if(E)return E.addEventListener(pu,_),()=>E.removeEventListener(pu,_)},[_]),g.jsx(SN,{scope:n,orientation:r,dir:p,loop:s,currentTabStopId:m,onItemFocus:v.useCallback(E=>y(E),[y]),onItemShiftTab:v.useCallback(()=>x(!0),[]),onFocusableItemAdd:v.useCallback(()=>k(E=>E+1),[]),onFocusableItemRemove:v.useCallback(()=>k(E=>E-1),[]),children:g.jsx(be.div,{tabIndex:b||C===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:re(e.onMouseDown,()=>{S.current=!0}),onFocus:re(e.onFocus,E=>{const P=!S.current;if(E.target===E.currentTarget&&P&&!b){const O=new CustomEvent(pu,xN);if(E.currentTarget.dispatchEvent(O),!O.defaultPrevented){const N=w().filter(D=>D.focusable),A=N.find(D=>D.active),j=N.find(D=>D.id===m),q=[A,j,...N].filter(Boolean).map(D=>D.ref.current);l_(q,u)}}S.current=!1}),onBlur:re(e.onBlur,()=>x(!1))})})}),a_="RovingFocusGroupItem",c_=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,children:i,...a}=e,c=Hn(),l=o||c,u=EN(a_,n),d=u.currentTabStopId===l,f=s_(n),{onFocusableItemAdd:h,onFocusableItemRemove:p,currentTabStopId:m}=u;return v.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),g.jsx(_d.ItemSlot,{scope:n,id:l,focusable:r,active:s,children:g.jsx(be.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:re(e.onMouseDown,y=>{r?u.onItemFocus(l):y.preventDefault()}),onFocus:re(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:re(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const b=PN(y,u.orientation,u.dir);if(b!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let _=f().filter(w=>w.focusable).map(w=>w.ref.current);if(b==="last")_.reverse();else if(b==="prev"||b==="next"){b==="prev"&&_.reverse();const w=_.indexOf(y.currentTarget);_=u.loop?ON(_,w+1):_.slice(w+1)}setTimeout(()=>l_(_))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:m!=null}):i})})});c_.displayName=a_;var CN={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function RN(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function PN(e,t,n){const r=RN(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return CN[r]}function l_(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function ON(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var TN=i_,MN=c_;function AN(e){const t=NN(e),n=v.forwardRef((r,s)=>{const{children:o,...i}=r,a=v.Children.toArray(o),c=a.find(IN);if(c){const l=c.props.children,u=a.map(d=>d===c?v.Children.count(l)>1?v.Children.only(null):v.isValidElement(l)?l.props.children:null:d);return g.jsx(t,{...i,ref:s,children:v.isValidElement(l)?v.cloneElement(l,void 0,u):null})}return g.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function NN(e){const t=v.forwardRef((n,r)=>{const{children:s,...o}=n;if(v.isValidElement(s)){const i=LN(s),a=jN(o,s.props);return s.type!==v.Fragment&&(a.ref=r?Yn(r,i):i),v.cloneElement(s,a)}return v.Children.count(s)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var DN=Symbol("radix.slottable");function IN(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===DN}function jN(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function LN(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var FN=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},bs=new WeakMap,ea=new WeakMap,ta={},mu=0,u_=function(e){return e&&(e.host||u_(e.parentNode))},zN=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=u_(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},$N=function(e,t,n,r){var s=zN(t,Array.isArray(e)?e:[e]);ta[n]||(ta[n]=new WeakMap);var o=ta[n],i=[],a=new Set,c=new Set(s),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};s.forEach(l);var u=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else try{var h=f.getAttribute(r),p=h!==null&&h!=="false",m=(bs.get(f)||0)+1,y=(o.get(f)||0)+1;bs.set(f,m),o.set(f,y),i.push(f),m===1&&p&&ea.set(f,!0),y===1&&f.setAttribute(n,"true"),p||f.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",f,b)}})};return u(t),a.clear(),mu++,function(){i.forEach(function(d){var f=bs.get(d)-1,h=o.get(d)-1;bs.set(d,f),o.set(d,h),f||(ea.has(d)||d.removeAttribute(r),ea.delete(d)),h||d.removeAttribute(n)}),mu--,mu||(bs=new WeakMap,bs=new WeakMap,ea=new WeakMap,ta={})}},Gf=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=FN(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),$N(r,s,n,"aria-hidden")):function(){return null}},Sn=function(){return Sn=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Sn.apply(this,arguments)};function d_(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function VN(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,o;r<s;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Ia="right-scroll-bar-position",ja="width-before-scroll-bar",BN="with-scroll-bars-hidden",UN="--removed-body-scroll-bar-size";function gu(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function WN(e,t){var n=T.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var HN=typeof window<"u"?v.useLayoutEffect:v.useEffect,eg=new WeakMap;function qN(e,t){var n=WN(null,function(r){return e.forEach(function(s){return gu(s,r)})});return HN(function(){var r=eg.get(n);if(r){var s=new Set(r),o=new Set(e),i=n.current;s.forEach(function(a){o.has(a)||gu(a,null)}),o.forEach(function(a){s.has(a)||gu(a,i)})}eg.set(n,e)},[e]),n}function KN(e){return e}function ZN(e,t){t===void 0&&(t=KN);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var i=t(o,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(o){for(r=!0;n.length;){var i=n;n=[],i.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(o),i=n}var c=function(){var u=i;i=[],u.forEach(o)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(u){i.push(u),l()},filter:function(u){return i=i.filter(u),n}}}};return s}function GN(e){e===void 0&&(e={});var t=ZN(null);return t.options=Sn({async:!0,ssr:!1},e),t}var f_=function(e){var t=e.sideCar,n=d_(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return v.createElement(r,Sn({},n))};f_.isSideCarExport=!0;function YN(e,t){return e.useMedium(t),f_}var h_=GN(),yu=function(){},al=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:yu,onWheelCapture:yu,onTouchMoveCapture:yu}),s=r[0],o=r[1],i=e.forwardProps,a=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,h=e.noRelative,p=e.noIsolation,m=e.inert,y=e.allowPinchZoom,b=e.as,x=b===void 0?"div":b,_=e.gapMode,w=d_(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,C=qN([n,t]),k=Sn(Sn({},w),s);return v.createElement(v.Fragment,null,u&&v.createElement(S,{sideCar:h_,removeScrollBar:l,shards:d,noRelative:h,noIsolation:p,inert:m,setCallbacks:o,allowPinchZoom:!!y,lockRef:n,gapMode:_}),i?v.cloneElement(v.Children.only(a),Sn(Sn({},k),{ref:C})):v.createElement(x,Sn({},k,{className:c,ref:C}),a))});al.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};al.classNames={fullWidth:ja,zeroRight:Ia};var XN=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function JN(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=XN();return t&&e.setAttribute("nonce",t),e}function QN(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function eD(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var tD=function(){var e=0,t=null;return{add:function(n){e==0&&(t=JN())&&(QN(t,n),eD(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},nD=function(){var e=tD();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},p_=function(){var e=nD(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},rD={left:0,top:0,right:0,gap:0},bu=function(e){return parseInt(e||"",10)||0},sD=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[bu(n),bu(r),bu(s)]},oD=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return rD;var t=sD(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},iD=p_(),Ds="data-scroll-locked",aD=function(e,t,n,r){var s=e.left,o=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
22
|
-
.`.concat(
|
|
21
|
+
(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}}),g.warnIfExceeded()),m}}}function Jo(e){return typeof e=="boolean"}var tE=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:o=!0,actionCreatorCheck:s=!0}=t??{};let i=new Hp;if(n&&(Jo(n)?i.push(H0):i.push(Z0(n.extraArgument))),process.env.NODE_ENV!=="production"){if(r){let a={};Jo(r)||(a=r),i.unshift(X0(a))}if(o){let a={};Jo(o)||(a=o),i.push(eE(a))}if(s){let a={};Jo(s)||(a=s),i.unshift(Y0(a))}}return i},nE="RTK_autoBatch",Fd=e=>t=>{setTimeout(t,e)},rE=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,s=!1,i=!1;const a=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Fd(10):e.type==="callback"?e.queueNotification:Fd(e.timeout),l=()=>{i=!1,s&&(s=!1,a.forEach(d=>d()))};return Object.assign({},r,{subscribe(d){const u=()=>o&&d(),f=r.subscribe(u);return a.add(d),()=>{f(),a.delete(d)}},dispatch(d){try{return o=!d?.meta?.[nE],s=!o,s&&(i||(i=!0,c(l))),r.dispatch(d)}finally{o=!0}}})},oE=e=>function(n){const{autoBatch:r=!0}=n??{};let o=new Hp(e);return r&&o.push(rE(typeof r=="object"?r:void 0)),o};function sE(e){const t=tE(),{reducer:n=void 0,middleware:r,devTools:o=!0,duplicateMiddlewareCheck:s=!0,preloadedState:i=void 0,enhancers:a=void 0}=e||{};let c;if(typeof n=="function")c=n;else if(Po(n))c=P0(n);else throw new Error(process.env.NODE_ENV==="production"?we(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");if(process.env.NODE_ENV!=="production"&&r&&typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?we(2):"`middleware` field must be a callback");let l;if(typeof r=="function"){if(l=r(t),process.env.NODE_ENV!=="production"&&!Array.isArray(l))throw new Error(process.env.NODE_ENV==="production"?we(3):"when using a middleware builder function, an array of middleware must be returned")}else l=t();if(process.env.NODE_ENV!=="production"&&l.some(g=>typeof g!="function"))throw new Error(process.env.NODE_ENV==="production"?we(4):"each middleware provided to configureStore must be a function");if(process.env.NODE_ENV!=="production"&&s){let g=new Set;l.forEach(v=>{if(g.has(v))throw new Error(process.env.NODE_ENV==="production"?we(42):"Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.");g.add(v)})}let d=js;o&&(d=K0({trace:process.env.NODE_ENV!=="production",...typeof o=="object"&&o}));const u=O0(...l),f=oE(u);if(process.env.NODE_ENV!=="production"&&a&&typeof a!="function")throw new Error(process.env.NODE_ENV==="production"?we(5):"`enhancers` field must be a callback");let h=typeof a=="function"?a(f):f();if(process.env.NODE_ENV!=="production"&&!Array.isArray(h))throw new Error(process.env.NODE_ENV==="production"?we(6):"`enhancers` callback must return an array");if(process.env.NODE_ENV!=="production"&&h.some(g=>typeof g!="function"))throw new Error(process.env.NODE_ENV==="production"?we(7):"each enhancer provided to configureStore must be a function");process.env.NODE_ENV!=="production"&&l.length&&!h.includes(u)&&console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");const m=d(...h);return Np(c,i,m)}function Yp(e){const t={},n=[];let r;const o={addCase(s,i){if(process.env.NODE_ENV!=="production"){if(n.length>0)throw new Error(process.env.NODE_ENV==="production"?we(26):"`builder.addCase` should only be called before calling `builder.addMatcher`");if(r)throw new Error(process.env.NODE_ENV==="production"?we(27):"`builder.addCase` should only be called before calling `builder.addDefaultCase`")}const a=typeof s=="string"?s:s.type;if(!a)throw new Error(process.env.NODE_ENV==="production"?we(28):"`builder.addCase` cannot be called with an empty action type");if(a in t)throw new Error(process.env.NODE_ENV==="production"?we(29):`\`builder.addCase\` cannot be called with two reducers for the same action type '${a}'`);return t[a]=i,o},addAsyncThunk(s,i){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?we(43):"`builder.addAsyncThunk` should only be called before calling `builder.addDefaultCase`");return i.pending&&(t[s.pending.type]=i.pending),i.rejected&&(t[s.rejected.type]=i.rejected),i.fulfilled&&(t[s.fulfilled.type]=i.fulfilled),i.settled&&n.push({matcher:s.settled,reducer:i.settled}),o},addMatcher(s,i){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?we(30):"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return n.push({matcher:s,reducer:i}),o},addDefaultCase(s){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?we(31):"`builder.addDefaultCase` can only be called once");return r=s,o}};return e(o),[t,n,r]}function iE(e){return typeof e=="function"}function aE(e,t){if(process.env.NODE_ENV!=="production"&&typeof t=="object")throw new Error(process.env.NODE_ENV==="production"?we(8):"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");let[n,r,o]=Yp(t),s;if(iE(e))s=()=>Ld(e());else{const a=Ld(e);s=()=>a}function i(a=s(),c){let l=[n[c.type],...r.filter(({matcher:d})=>d(c)).map(({reducer:d})=>d)];return l.filter(d=>!!d).length===0&&(l=[o]),l.reduce((d,u)=>{if(u)if(sn(d)){const h=u(d,c);return h===void 0?d:h}else{if(Lt(d))return Vp(d,f=>u(f,c));{const f=u(d,c);if(f===void 0){if(d===null)return d;throw Error("A case reducer on a non-draftable value must not return undefined")}return f}}return d},a)}return i.getInitialState=s,i}var cE=(e,t)=>Bp(e)?e.match(t):e(t);function lE(...e){return t=>e.some(n=>cE(n,t))}var uE="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",dE=(e=21)=>{let t="",n=e;for(;n--;)t+=uE[Math.random()*64|0];return t},fE=["name","message","stack","code"],ba=class{constructor(e,t){this.payload=e,this.meta=t}_type},$d=class{constructor(e,t){this.payload=e,this.meta=t}_type},hE=e=>{if(typeof e=="object"&&e!==null){const t={};for(const n of fE)typeof e[n]=="string"&&(t[n]=e[n]);return t}return{message:String(e)}},zd="External signal was aborted",Sn=(()=>{function e(t,n,r){const o=to(t+"/fulfilled",(c,l,d,u)=>({payload:c,meta:{...u||{},arg:d,requestId:l,requestStatus:"fulfilled"}})),s=to(t+"/pending",(c,l,d)=>({payload:void 0,meta:{...d||{},arg:l,requestId:c,requestStatus:"pending"}})),i=to(t+"/rejected",(c,l,d,u,f)=>({payload:u,error:(r&&r.serializeError||hE)(c||"Rejected"),meta:{...f||{},arg:d,requestId:l,rejectedWithValue:!!u,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function a(c,{signal:l}={}){return(d,u,f)=>{const h=r?.idGenerator?r.idGenerator(c):dE(),m=new AbortController;let g,v;function b(w){v=w,m.abort()}l&&(l.aborted?b(zd):l.addEventListener("abort",()=>b(zd),{once:!0}));const _=(async function(){let w;try{let S=r?.condition?.(c,{getState:u,extra:f});if(mE(S)&&(S=await S),S===!1||m.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const P=new Promise((C,E)=>{g=()=>{E({name:"AbortError",message:v||"Aborted"})},m.signal.addEventListener("abort",g,{once:!0})});d(s(h,c,r?.getPendingMeta?.({requestId:h,arg:c},{getState:u,extra:f}))),w=await Promise.race([P,Promise.resolve(n(c,{dispatch:d,getState:u,extra:f,requestId:h,signal:m.signal,abort:b,rejectWithValue:(C,E)=>new ba(C,E),fulfillWithValue:(C,E)=>new $d(C,E)})).then(C=>{if(C instanceof ba)throw C;return C instanceof $d?o(C.payload,h,c,C.meta):o(C,h,c)})])}catch(S){w=S instanceof ba?i(null,h,c,S.payload,S.meta):i(S,h,c)}finally{g&&m.signal.removeEventListener("abort",g)}return r&&!r.dispatchConditionRejection&&i.match(w)&&w.meta.condition||d(w),w})();return Object.assign(_,{abort:b,requestId:h,arg:c,unwrap(){return _.then(pE)}})}}return Object.assign(a,{pending:s,rejected:i,fulfilled:o,settled:lE(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function pE(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function mE(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var gE=Symbol.for("rtk-slice-createasyncthunk");function yE(e,t){return`${e}/${t}`}function vE({creators:e}={}){const t=e?.asyncThunk?.[gE];return function(r){const{name:o,reducerPath:s=o}=r;if(!o)throw new Error(process.env.NODE_ENV==="production"?we(11):"`name` is a required option for createSlice");typeof process<"u"&&process.env.NODE_ENV==="development"&&r.initialState===void 0&&console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");const i=(typeof r.reducers=="function"?r.reducers(xE()):r.reducers)||{},a=Object.keys(i),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},l={addCase(w,x){const S=typeof w=="string"?w:w.type;if(!S)throw new Error(process.env.NODE_ENV==="production"?we(12):"`context.addCase` cannot be called with an empty action type");if(S in c.sliceCaseReducersByType)throw new Error(process.env.NODE_ENV==="production"?we(13):"`context.addCase` cannot be called with two reducers for the same action type: "+S);return c.sliceCaseReducersByType[S]=x,l},addMatcher(w,x){return c.sliceMatchers.push({matcher:w,reducer:x}),l},exposeAction(w,x){return c.actionCreators[w]=x,l},exposeCaseReducer(w,x){return c.sliceCaseReducersByName[w]=x,l}};a.forEach(w=>{const x=i[w],S={reducerName:w,type:yE(o,w),createNotation:typeof r.reducers=="function"};SE(x)?CE(S,x,l,t):_E(S,x,l)});function d(){if(process.env.NODE_ENV!=="production"&&typeof r.extraReducers=="object")throw new Error(process.env.NODE_ENV==="production"?we(14):"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");const[w={},x=[],S=void 0]=typeof r.extraReducers=="function"?Yp(r.extraReducers):[r.extraReducers],P={...w,...c.sliceCaseReducersByType};return aE(r.initialState,C=>{for(let E in P)C.addCase(E,P[E]);for(let E of c.sliceMatchers)C.addMatcher(E.matcher,E.reducer);for(let E of x)C.addMatcher(E.matcher,E.reducer);S&&C.addDefaultCase(S)})}const u=w=>w,f=new Map,h=new WeakMap;let m;function g(w,x){return m||(m=d()),m(w,x)}function v(){return m||(m=d()),m.getInitialState()}function b(w,x=!1){function S(C){let E=C[w];if(typeof E>"u"){if(x)E=Yo(h,S,v);else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?we(15):"selectSlice returned undefined for an uninjected slice reducer")}return E}function P(C=u){const E=Yo(f,x,()=>new WeakMap);return Yo(E,C,()=>{const A={};for(const[U,B]of Object.entries(r.selectors??{}))A[U]=bE(B,C,()=>Yo(h,C,v),x);return A})}return{reducerPath:w,getSelectors:P,get selectors(){return P(S)},selectSlice:S}}const _={name:o,reducer:g,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:v,...b(s),injectInto(w,{reducerPath:x,...S}={}){const P=x??s;return w.inject({reducerPath:P,reducer:g},S),{..._,...b(P,!0)}}};return _}}function bE(e,t,n,r){function o(s,...i){let a=t(s);if(typeof a>"u"){if(r)a=n();else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?we(16):"selectState returned undefined for an uninjected slice reducer")}return e(a,...i)}return o.unwrapped=e,o}var wE=vE();function xE(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function _E({type:e,reducerName:t,createNotation:n},r,o){let s,i;if("reducer"in r){if(n&&!EE(r))throw new Error(process.env.NODE_ENV==="production"?we(17):"Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");s=r.reducer,i=r.prepare}else s=r;o.addCase(e,s).exposeCaseReducer(t,s).exposeAction(t,i?to(e,i):to(e))}function SE(e){return e._reducerDefinitionType==="asyncThunk"}function EE(e){return e._reducerDefinitionType==="reducerWithPrepare"}function CE({type:e,reducerName:t},n,r,o){if(!o)throw new Error(process.env.NODE_ENV==="production"?we(18):"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");const{payloadCreator:s,fulfilled:i,pending:a,rejected:c,settled:l,options:d}=n,u=o(e,s,d);r.exposeAction(t,u),i&&r.addCase(u.fulfilled,i),a&&r.addCase(u.pending,a),c&&r.addCase(u.rejected,c),l&&r.addMatcher(u.settled,l),r.exposeCaseReducer(t,{fulfilled:i||Qo,pending:a||Qo,rejected:c||Qo,settled:l||Qo})}function Qo(){}function we(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const En={getSummary:(e=60)=>Te.get(`/monitors/summary?bars=${e}`).then(t=>t.data.rows),getList:()=>Te.get("/monitors").then(e=>e.data.monitors),getResults:(e,t=180)=>Te.get(`/monitors/${e}/results?limit=${t}`).then(n=>n.data.results),create:e=>Te.post("/monitors",e).then(t=>t.data),update:(e,t)=>Te.put(`/monitors/${e}`,t).then(n=>n.data),delete:e=>Te.delete(`/monitors/${e}`).then(t=>t.data),togglePause:(e,t)=>Te.post(`/monitors/${e}/pause`,{paused:t}).then(n=>n.data)},RE={data:[],list:[],current:null,currentResults:[],loading:!1,error:null,actionLoading:!1},PE=Sn("monitors/fetchResults",async(e,{rejectWithValue:t})=>{try{return await En.getResults(e)}catch(n){return t(n.response?.data?.message||"Failed to fetch results")}}),Fn=Sn("monitors/fetchSummary",async(e=60,{rejectWithValue:t})=>{try{return await En.getSummary(e)}catch(n){return t(n.response?.data?.message||"Failed to fetch summary")}}),wa=Sn("monitors/fetchAll",async(e,{rejectWithValue:t})=>{try{return await En.getList()}catch(n){return t(n.response?.data?.message||"Failed to fetch monitors")}}),Vd=Sn("monitors/fetchOne",async(e,{rejectWithValue:t})=>{try{const r=(await En.getList()).find(o=>o.id===e);if(!r)throw new Error("Monitor not found");return r}catch(n){return t(n.message||n.response?.data?.message||"Failed to fetch monitor")}}),bc=Sn("monitors/pause",async({id:e,paused:t},{rejectWithValue:n})=>{try{return await En.togglePause(e,t),{id:e,paused:t}}catch(r){return n(r.response?.data?.message||"Failed to toggle pause")}}),Jp=Sn("monitors/delete",async(e,{rejectWithValue:t})=>{try{return await En.delete(e),e}catch(n){return t(n.response?.data?.message||"Failed to delete monitor")}}),Qp=Sn("monitors/create",async(e,{rejectWithValue:t})=>{try{return await En.create(e)}catch(n){return t(n.response?.data?.message||"Failed to create monitor")}}),Xp=Sn("monitors/update",async({id:e,data:t},{rejectWithValue:n})=>{try{return await En.update(e,t)}catch(r){return n(r.response?.data?.message||"Failed to update monitor")}}),em=wE({name:"monitors",initialState:RE,reducers:{clearError:e=>{e.error=null},setCurrentMonitor:(e,t)=>{e.current=t.payload}},extraReducers:e=>{e.addCase(Fn.pending,t=>{t.loading=!0,t.error=null}),e.addCase(Fn.fulfilled,(t,n)=>{t.loading=!1,t.data=n.payload}),e.addCase(Fn.rejected,(t,n)=>{t.loading=!1,t.error=n.payload}),e.addCase(wa.pending,t=>{t.loading=!0}),e.addCase(wa.fulfilled,(t,n)=>{t.loading=!1,t.list=n.payload}),e.addCase(wa.rejected,(t,n)=>{t.loading=!1,t.error=n.payload}),e.addCase(Vd.pending,t=>{t.loading=!0}),e.addCase(Vd.fulfilled,(t,n)=>{t.loading=!1,t.current=n.payload}),e.addCase(PE.fulfilled,(t,n)=>{t.currentResults=n.payload}),e.addCase(bc.pending,t=>{t.actionLoading=!0}),e.addCase(bc.fulfilled,(t,n)=>{t.actionLoading=!1;const r=t.data.find(s=>s.monitor.id===n.payload.id);r&&(r.monitor.isPaused=n.payload.paused);const o=t.list.find(s=>s.id===n.payload.id);o&&(o.isPaused=n.payload.paused),t.current?.id===n.payload.id&&(t.current.isPaused=n.payload.paused)}),e.addCase(Jp.fulfilled,(t,n)=>{t.data=t.data.filter(r=>r.monitor.id!==n.payload),t.list=t.list.filter(r=>r.id!==n.payload),t.current?.id===n.payload&&(t.current=null)}),e.addCase(Qp.fulfilled,(t,n)=>{t.list.push(n.payload.monitor)}),e.addCase(Xp.fulfilled,(t,n)=>{const r=t.list.findIndex(s=>s.id===n.payload.monitor.id);r!==-1&&(t.list[r]=n.payload.monitor);const o=t.data.findIndex(s=>s.monitor.id===n.payload.monitor.id);o!==-1&&(t.data[o].monitor=n.payload.monitor),t.current?.id===n.payload.monitor.id&&(t.current=n.payload.monitor)})}}),{clearError:DD,setCurrentMonitor:jD}=em.actions,OE=em.reducer;const kE=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),NE=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Ud=e=>{const t=NE(e);return t.charAt(0).toUpperCase()+t.slice(1)},tm=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),TE=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var AE={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const IE=k.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},c)=>k.createElement("svg",{ref:c,...AE,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:tm("lucide",o),...!s&&!TE(a)&&{"aria-hidden":"true"},...a},[...i.map(([l,d])=>k.createElement(l,d)),...Array.isArray(s)?s:[s]]));const Ie=(e,t)=>{const n=k.forwardRef(({className:r,...o},s)=>k.createElement(IE,{ref:s,iconNode:t,className:tm(`lucide-${kE(Ud(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Ud(e),n};const ME=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],xa=Ie("activity",ME);const DE=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],jE=Ie("check",DE);const LE=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],nm=Ie("chevron-down",LE);const FE=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],$E=Ie("chevron-up",FE);const zE=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],VE=Ie("copy",zE);const UE=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],BE=Ie("database",UE);const WE=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],HE=Ie("ellipsis",WE);const ZE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],KE=Ie("globe",ZE);const qE=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],vl=Ie("loader-circle",qE);const GE=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],YE=Ie("package",GE);const JE=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],QE=Ie("pause",JE);const XE=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],eC=Ie("pencil",XE);const tC=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],nC=Ie("play",tC);const rC=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Bd=Ie("plus",rC);const oC=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],rm=Ie("search",oC);const sC=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],iC=Ie("send",sC);const aC=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],cC=Ie("server",aC);const lC=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],uC=Ie("terminal",lC);const dC=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],om=Ie("trash-2",dC);const fC=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],hC=Ie("x",fC);function Wd(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ln(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Wd(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Wd(e[o],null)}}}}function xe(...e){return y.useCallback(ln(...e),e)}var pC=Symbol.for("react.lazy"),Bs=y[" use ".trim().toString()];function mC(e){return typeof e=="object"&&e!==null&&"then"in e}function sm(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===pC&&"_payload"in e&&mC(e._payload)}function im(e){const t=gC(e),n=y.forwardRef((r,o)=>{let{children:s,...i}=r;sm(s)&&typeof Bs=="function"&&(s=Bs(s._payload));const a=y.Children.toArray(s),c=a.find(vC);if(c){const l=c.props.children,d=a.map(u=>u===c?y.Children.count(l)>1?y.Children.only(null):y.isValidElement(l)?l.props.children:null:u);return p.jsx(t,{...i,ref:o,children:y.isValidElement(l)?y.cloneElement(l,void 0,d):null})}return p.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var am=im("Slot");function gC(e){const t=y.forwardRef((n,r)=>{let{children:o,...s}=n;if(sm(o)&&typeof Bs=="function"&&(o=Bs(o._payload)),y.isValidElement(o)){const i=wC(o),a=bC(s,o.props);return o.type!==y.Fragment&&(a.ref=r?ln(r,i):i),y.cloneElement(o,a)}return y.Children.count(o)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var yC=Symbol("radix.slottable");function vC(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===yC}function bC(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function wC(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Hd=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Zd=fl,xC=(e,t)=>n=>{var r;if(t?.variants==null)return Zd(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(l=>{const d=n?.[l],u=s?.[l];if(d===null)return null;const f=Hd(d)||Hd(u);return o[l][f]}),a=n&&Object.entries(n).reduce((l,d)=>{let[u,f]=d;return f===void 0||(l[u]=f),l},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,d)=>{let{class:u,className:f,...h}=d;return Object.entries(h).every(m=>{let[g,v]=m;return Array.isArray(v)?v.includes({...s,...a}[g]):{...s,...a}[g]===v})?[...l,u,f]:l},[]);return Zd(e,i,c,n?.class,n?.className)};function Ee(...e){return kp(fl(e))}const _C=xC("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function qn({className:e,variant:t,size:n,asChild:r=!1,...o}){const s=r?am:"button";return p.jsx(s,{"data-slot":"button",className:Ee(_C({variant:t,size:n,className:e})),...o})}function re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function SC(e,t){const n=y.createContext(t),r=s=>{const{children:i,...a}=s,c=y.useMemo(()=>a,Object.values(a));return p.jsx(n.Provider,{value:c,children:i})};r.displayName=e+"Provider";function o(s){const i=y.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function tr(e,t=[]){let n=[];function r(s,i){const a=y.createContext(i),c=n.length;n=[...n,i];const l=u=>{const{scope:f,children:h,...m}=u,g=f?.[e]?.[c]||a,v=y.useMemo(()=>m,Object.values(m));return p.jsx(g.Provider,{value:v,children:h})};l.displayName=s+"Provider";function d(u,f){const h=f?.[e]?.[c]||a,m=y.useContext(h);if(m)return m;if(i!==void 0)return i;throw new Error(`\`${u}\` must be used within \`${s}\``)}return[l,d]}const o=()=>{const s=n.map(i=>y.createContext(i));return function(a){const c=a?.[e]||s;return y.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,EC(o,...t)]}function EC(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:c,scopeName:l})=>{const u=c(s)[`__scope${l}`];return{...a,...u}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var Ke=globalThis?.document?y.useLayoutEffect:()=>{},CC=y[" useInsertionEffect ".trim().toString()]||Ke;function ho({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=RC({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o;{const d=y.useRef(e!==void 0);y.useEffect(()=>{const u=d.current;u!==a&&console.warn(`${r} is changing from ${u?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,r])}const l=y.useCallback(d=>{if(a){const u=PC(d)?d(e):d;u!==e&&i.current?.(u)}else s(d)},[a,e,s,i]);return[c,l]}function RC({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),o=y.useRef(n),s=y.useRef(t);return CC(()=>{s.current=t},[t]),y.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function PC(e){return typeof e=="function"}function OC(e){const t=kC(e),n=y.forwardRef((r,o)=>{const{children:s,...i}=r,a=y.Children.toArray(s),c=a.find(TC);if(c){const l=c.props.children,d=a.map(u=>u===c?y.Children.count(l)>1?y.Children.only(null):y.isValidElement(l)?l.props.children:null:u);return p.jsx(t,{...i,ref:o,children:y.isValidElement(l)?y.cloneElement(l,void 0,d):null})}return p.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function kC(e){const t=y.forwardRef((n,r)=>{const{children:o,...s}=n;if(y.isValidElement(o)){const i=IC(o),a=AC(s,o.props);return o.type!==y.Fragment&&(a.ref=r?ln(r,i):i),y.cloneElement(o,a)}return y.Children.count(o)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var NC=Symbol("radix.slottable");function TC(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===NC}function AC(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function IC(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var MC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ye=MC.reduce((e,t)=>{const n=OC(`Primitive.${t}`),r=y.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function cm(e,t){e&&ri.flushSync(()=>e.dispatchEvent(t))}function Kd(e){const t=DC(e),n=y.forwardRef((r,o)=>{const{children:s,...i}=r,a=y.Children.toArray(s),c=a.find(LC);if(c){const l=c.props.children,d=a.map(u=>u===c?y.Children.count(l)>1?y.Children.only(null):y.isValidElement(l)?l.props.children:null:u);return p.jsx(t,{...i,ref:o,children:y.isValidElement(l)?y.cloneElement(l,void 0,d):null})}return p.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function DC(e){const t=y.forwardRef((n,r)=>{const{children:o,...s}=n;if(y.isValidElement(o)){const i=$C(o),a=FC(s,o.props);return o.type!==y.Fragment&&(a.ref=r?ln(r,i):i),y.cloneElement(o,a)}return y.Children.count(o)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var jC=Symbol("radix.slottable");function LC(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===jC}function FC(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function $C(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function bl(e){const t=e+"CollectionProvider",[n,r]=tr(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=g=>{const{scope:v,children:b}=g,_=k.useRef(null),w=k.useRef(new Map).current;return p.jsx(o,{scope:v,itemMap:w,collectionRef:_,children:b})};i.displayName=t;const a=e+"CollectionSlot",c=Kd(a),l=k.forwardRef((g,v)=>{const{scope:b,children:_}=g,w=s(a,b),x=xe(v,w.collectionRef);return p.jsx(c,{ref:x,children:_})});l.displayName=a;const d=e+"CollectionItemSlot",u="data-radix-collection-item",f=Kd(d),h=k.forwardRef((g,v)=>{const{scope:b,children:_,...w}=g,x=k.useRef(null),S=xe(v,x),P=s(d,b);return k.useEffect(()=>(P.itemMap.set(x,{ref:x,...w}),()=>{P.itemMap.delete(x)})),p.jsx(f,{[u]:"",ref:S,children:_})});h.displayName=d;function m(g){const v=s(e+"CollectionConsumer",g);return k.useCallback(()=>{const _=v.collectionRef.current;if(!_)return[];const w=Array.from(_.querySelectorAll(`[${u}]`));return Array.from(v.itemMap.values()).sort((P,C)=>w.indexOf(P.ref.current)-w.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:l,ItemSlot:h},m,r]}var zC=y.createContext(void 0);function wl(e){const t=y.useContext(zC);return e||t||"ltr"}function Yt(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>t.current?.(...n),[])}function VC(e,t=globalThis?.document){const n=Yt(e);y.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var UC="DismissableLayer",wc="dismissableLayer.update",BC="dismissableLayer.pointerDownOutside",WC="dismissableLayer.focusOutside",qd,lm=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),xi=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,l=y.useContext(lm),[d,u]=y.useState(null),f=d?.ownerDocument??globalThis?.document,[,h]=y.useState({}),m=xe(t,C=>u(C)),g=Array.from(l.layers),[v]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),b=g.indexOf(v),_=d?g.indexOf(d):-1,w=l.layersWithOutsidePointerEventsDisabled.size>0,x=_>=b,S=KC(C=>{const E=C.target,A=[...l.branches].some(U=>U.contains(E));!x||A||(o?.(C),i?.(C),C.defaultPrevented||a?.())},f),P=qC(C=>{const E=C.target;[...l.branches].some(U=>U.contains(E))||(s?.(C),i?.(C),C.defaultPrevented||a?.())},f);return VC(C=>{_===l.layers.size-1&&(r?.(C),!C.defaultPrevented&&a&&(C.preventDefault(),a()))},f),y.useEffect(()=>{if(d)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(qd=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(d)),l.layers.add(d),Gd(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=qd)}},[d,f,n,l]),y.useEffect(()=>()=>{d&&(l.layers.delete(d),l.layersWithOutsidePointerEventsDisabled.delete(d),Gd())},[d,l]),y.useEffect(()=>{const C=()=>h({});return document.addEventListener(wc,C),()=>document.removeEventListener(wc,C)},[]),p.jsx(ye.div,{...c,ref:m,style:{pointerEvents:w?x?"auto":"none":void 0,...e.style},onFocusCapture:re(e.onFocusCapture,P.onFocusCapture),onBlurCapture:re(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:re(e.onPointerDownCapture,S.onPointerDownCapture)})});xi.displayName=UC;var HC="DismissableLayerBranch",ZC=y.forwardRef((e,t)=>{const n=y.useContext(lm),r=y.useRef(null),o=xe(t,r);return y.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),p.jsx(ye.div,{...e,ref:o})});ZC.displayName=HC;function KC(e,t=globalThis?.document){const n=Yt(e),r=y.useRef(!1),o=y.useRef(()=>{});return y.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){um(BC,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function qC(e,t=globalThis?.document){const n=Yt(e),r=y.useRef(!1);return y.useEffect(()=>{const o=s=>{s.target&&!r.current&&um(WC,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Gd(){const e=new CustomEvent(wc);document.dispatchEvent(e)}function um(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?cm(o,s):o.dispatchEvent(s)}var _a=0;function xl(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Yd()),document.body.insertAdjacentElement("beforeend",e[1]??Yd()),_a++,()=>{_a===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),_a--}},[])}function Yd(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Sa="focusScope.autoFocusOnMount",Ea="focusScope.autoFocusOnUnmount",Jd={bubbles:!1,cancelable:!0},GC="FocusScope",_i=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=y.useState(null),l=Yt(o),d=Yt(s),u=y.useRef(null),f=xe(t,g=>c(g)),h=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let g=function(w){if(h.paused||!a)return;const x=w.target;a.contains(x)?u.current=x:pn(u.current,{select:!0})},v=function(w){if(h.paused||!a)return;const x=w.relatedTarget;x!==null&&(a.contains(x)||pn(u.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const S of w)S.removedNodes.length>0&&pn(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",v);const _=new MutationObserver(b);return a&&_.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",v),_.disconnect()}}},[r,a,h.paused]),y.useEffect(()=>{if(a){Xd.add(h);const g=document.activeElement;if(!a.contains(g)){const b=new CustomEvent(Sa,Jd);a.addEventListener(Sa,l),a.dispatchEvent(b),b.defaultPrevented||(YC(tR(dm(a)),{select:!0}),document.activeElement===g&&pn(a))}return()=>{a.removeEventListener(Sa,l),setTimeout(()=>{const b=new CustomEvent(Ea,Jd);a.addEventListener(Ea,d),a.dispatchEvent(b),b.defaultPrevented||pn(g??document.body,{select:!0}),a.removeEventListener(Ea,d),Xd.remove(h)},0)}}},[a,l,d,h]);const m=y.useCallback(g=>{if(!n&&!r||h.paused)return;const v=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,b=document.activeElement;if(v&&b){const _=g.currentTarget,[w,x]=JC(_);w&&x?!g.shiftKey&&b===x?(g.preventDefault(),n&&pn(w,{select:!0})):g.shiftKey&&b===w&&(g.preventDefault(),n&&pn(x,{select:!0})):b===_&&g.preventDefault()}},[n,r,h.paused]);return p.jsx(ye.div,{tabIndex:-1,...i,ref:f,onKeyDown:m})});_i.displayName=GC;function YC(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(pn(r,{select:t}),document.activeElement!==n)return}function JC(e){const t=dm(e),n=Qd(t,e),r=Qd(t.reverse(),e);return[n,r]}function dm(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Qd(e,t){for(const n of e)if(!QC(n,{upTo:t}))return n}function QC(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function XC(e){return e instanceof HTMLInputElement&&"select"in e}function pn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&XC(e)&&t&&e.select()}}var Xd=eR();function eR(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=ef(e,t),e.unshift(t)},remove(t){e=ef(e,t),e[0]?.resume()}}}function ef(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function tR(e){return e.filter(t=>t.tagName!=="A")}var nR=y[" useId ".trim().toString()]||(()=>{}),rR=0;function rn(e){const[t,n]=y.useState(nR());return Ke(()=>{n(r=>r??String(rR++))},[e]),e||(t?`radix-${t}`:"")}const oR=["top","right","bottom","left"],xn=Math.min,ut=Math.max,Ws=Math.round,Xo=Math.floor,qt=e=>({x:e,y:e}),sR={left:"right",right:"left",bottom:"top",top:"bottom"},iR={start:"end",end:"start"};function xc(e,t,n){return ut(e,xn(t,n))}function an(e,t){return typeof e=="function"?e(t):e}function cn(e){return e.split("-")[0]}function Nr(e){return e.split("-")[1]}function _l(e){return e==="x"?"y":"x"}function Sl(e){return e==="y"?"height":"width"}const aR=new Set(["top","bottom"]);function Kt(e){return aR.has(cn(e))?"y":"x"}function El(e){return _l(Kt(e))}function cR(e,t,n){n===void 0&&(n=!1);const r=Nr(e),o=El(e),s=Sl(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Hs(i)),[i,Hs(i)]}function lR(e){const t=Hs(e);return[_c(e),t,_c(t)]}function _c(e){return e.replace(/start|end/g,t=>iR[t])}const tf=["left","right"],nf=["right","left"],uR=["top","bottom"],dR=["bottom","top"];function fR(e,t,n){switch(e){case"top":case"bottom":return n?t?nf:tf:t?tf:nf;case"left":case"right":return t?uR:dR;default:return[]}}function hR(e,t,n,r){const o=Nr(e);let s=fR(cn(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(_c)))),s}function Hs(e){return e.replace(/left|right|bottom|top/g,t=>sR[t])}function pR(e){return{top:0,right:0,bottom:0,left:0,...e}}function fm(e){return typeof e!="number"?pR(e):{top:e,right:e,bottom:e,left:e}}function Zs(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function rf(e,t,n){let{reference:r,floating:o}=e;const s=Kt(t),i=El(t),a=Sl(i),c=cn(t),l=s==="y",d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let h;switch(c){case"top":h={x:d,y:r.y-o.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:u};break;case"left":h={x:r.x-o.width,y:u};break;default:h={x:r.x,y:r.y}}switch(Nr(t)){case"start":h[i]-=f*(n&&l?-1:1);break;case"end":h[i]+=f*(n&&l?-1:1);break}return h}async function mR(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:h=0}=an(t,e),m=fm(h),v=a[f?u==="floating"?"reference":"floating":u],b=Zs(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:d,strategy:c})),_=u==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),x=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},S=Zs(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:_,offsetParent:w,strategy:c}):_);return{top:(b.top-S.top+m.top)/x.y,bottom:(S.bottom-b.bottom+m.bottom)/x.y,left:(b.left-S.left+m.left)/x.x,right:(S.right-b.right+m.right)/x.x}}const gR=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=rf(l,r,c),f=r,h={},m=0;for(let v=0;v<a.length;v++){var g;const{name:b,fn:_}=a[v],{x:w,y:x,data:S,reset:P}=await _({x:d,y:u,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:l,platform:{...i,detectOverflow:(g=i.detectOverflow)!=null?g:mR},elements:{reference:e,floating:t}});d=w??d,u=x??u,h={...h,[b]:{...h[b],...S}},P&&m<=50&&(m++,typeof P=="object"&&(P.placement&&(f=P.placement),P.rects&&(l=P.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):P.rects),{x:d,y:u}=rf(l,f,c)),v=-1)}return{x:d,y:u,placement:f,strategy:o,middlewareData:h}},yR=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:d=0}=an(e,t)||{};if(l==null)return{};const u=fm(d),f={x:n,y:r},h=El(o),m=Sl(h),g=await i.getDimensions(l),v=h==="y",b=v?"top":"left",_=v?"bottom":"right",w=v?"clientHeight":"clientWidth",x=s.reference[m]+s.reference[h]-f[h]-s.floating[m],S=f[h]-s.reference[h],P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let C=P?P[w]:0;(!C||!await(i.isElement==null?void 0:i.isElement(P)))&&(C=a.floating[w]||s.floating[m]);const E=x/2-S/2,A=C/2-g[m]/2-1,U=xn(u[b],A),B=xn(u[_],A),M=U,j=C-g[m]-B,V=C/2-g[m]/2+E,Y=xc(M,V,j),L=!c.arrow&&Nr(o)!=null&&V!==Y&&s.reference[m]/2-(V<M?U:B)-g[m]/2<0,K=L?V<M?V-M:V-j:0;return{[h]:f[h]+K,data:{[h]:Y,centerOffset:V-Y-K,...L&&{alignmentOffset:K}},reset:L}}}),vR=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...v}=an(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=cn(o),_=Kt(a),w=cn(a)===a,x=await(c.isRTL==null?void 0:c.isRTL(l.floating)),S=f||(w||!g?[Hs(a)]:lR(a)),P=m!=="none";!f&&P&&S.push(...hR(a,g,m,x));const C=[a,...S],E=await c.detectOverflow(t,v),A=[];let U=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&A.push(E[b]),u){const V=cR(o,i,x);A.push(E[V[0]],E[V[1]])}if(U=[...U,{placement:o,overflows:A}],!A.every(V=>V<=0)){var B,M;const V=(((B=s.flip)==null?void 0:B.index)||0)+1,Y=C[V];if(Y&&(!(u==="alignment"?_!==Kt(Y):!1)||U.every(D=>Kt(D.placement)===_?D.overflows[0]>0:!0)))return{data:{index:V,overflows:U},reset:{placement:Y}};let L=(M=U.filter(K=>K.overflows[0]<=0).sort((K,D)=>K.overflows[1]-D.overflows[1])[0])==null?void 0:M.placement;if(!L)switch(h){case"bestFit":{var j;const K=(j=U.filter(D=>{if(P){const H=Kt(D.placement);return H===_||H==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(H=>H>0).reduce((H,se)=>H+se,0)]).sort((D,H)=>D[1]-H[1])[0])==null?void 0:j[0];K&&(L=K);break}case"initialPlacement":L=a;break}if(o!==L)return{reset:{placement:L}}}return{}}}};function of(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function sf(e){return oR.some(t=>e[t]>=0)}const bR=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=an(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=of(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:sf(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=of(i,n.floating);return{data:{escapedOffsets:a,escaped:sf(a)}}}default:return{}}}}},hm=new Set(["left","top"]);async function wR(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=cn(n),a=Nr(n),c=Kt(n)==="y",l=hm.has(i)?-1:1,d=s&&c?-1:1,u=an(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:m}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),c?{x:h*d,y:f*l}:{x:f*l,y:h*d}}const xR=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await wR(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},_R=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:b=>{let{x:_,y:w}=b;return{x:_,y:w}}},...l}=an(e,t),d={x:n,y:r},u=await s.detectOverflow(t,l),f=Kt(cn(o)),h=_l(f);let m=d[h],g=d[f];if(i){const b=h==="y"?"top":"left",_=h==="y"?"bottom":"right",w=m+u[b],x=m-u[_];m=xc(w,m,x)}if(a){const b=f==="y"?"top":"left",_=f==="y"?"bottom":"right",w=g+u[b],x=g-u[_];g=xc(w,g,x)}const v=c.fn({...t,[h]:m,[f]:g});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[h]:i,[f]:a}}}}}},SR=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=an(e,t),d={x:n,y:r},u=Kt(o),f=_l(u);let h=d[f],m=d[u];const g=an(a,t),v=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const w=f==="y"?"height":"width",x=s.reference[f]-s.floating[w]+v.mainAxis,S=s.reference[f]+s.reference[w]-v.mainAxis;h<x?h=x:h>S&&(h=S)}if(l){var b,_;const w=f==="y"?"width":"height",x=hm.has(cn(o)),S=s.reference[u]-s.floating[w]+(x&&((b=i.offset)==null?void 0:b[u])||0)+(x?0:v.crossAxis),P=s.reference[u]+s.reference[w]+(x?0:((_=i.offset)==null?void 0:_[u])||0)-(x?v.crossAxis:0);m<S?m=S:m>P&&(m=P)}return{[f]:h,[u]:m}}}},ER=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...l}=an(e,t),d=await i.detectOverflow(t,l),u=cn(o),f=Nr(o),h=Kt(o)==="y",{width:m,height:g}=s.floating;let v,b;u==="top"||u==="bottom"?(v=u,b=f===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(b=u,v=f==="end"?"top":"bottom");const _=g-d.top-d.bottom,w=m-d.left-d.right,x=xn(g-d[v],_),S=xn(m-d[b],w),P=!t.middlewareData.shift;let C=x,E=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(E=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=_),P&&!f){const U=ut(d.left,0),B=ut(d.right,0),M=ut(d.top,0),j=ut(d.bottom,0);h?E=m-2*(U!==0||B!==0?U+B:ut(d.left,d.right)):C=g-2*(M!==0||j!==0?M+j:ut(d.top,d.bottom))}await c({...t,availableWidth:E,availableHeight:C});const A=await i.getDimensions(a.floating);return m!==A.width||g!==A.height?{reset:{rects:!0}}:{}}}};function Si(){return typeof window<"u"}function Tr(e){return pm(e)?(e.nodeName||"").toLowerCase():"#document"}function mt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Qt(e){var t;return(t=(pm(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function pm(e){return Si()?e instanceof Node||e instanceof mt(e).Node:!1}function Ft(e){return Si()?e instanceof Element||e instanceof mt(e).Element:!1}function Jt(e){return Si()?e instanceof HTMLElement||e instanceof mt(e).HTMLElement:!1}function af(e){return!Si()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof mt(e).ShadowRoot}const CR=new Set(["inline","contents"]);function ko(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=$t(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!CR.has(o)}const RR=new Set(["table","td","th"]);function PR(e){return RR.has(Tr(e))}const OR=[":popover-open",":modal"];function Ei(e){return OR.some(t=>{try{return e.matches(t)}catch{return!1}})}const kR=["transform","translate","scale","rotate","perspective"],NR=["transform","translate","scale","rotate","perspective","filter"],TR=["paint","layout","strict","content"];function Cl(e){const t=Rl(),n=Ft(e)?$t(e):e;return kR.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||NR.some(r=>(n.willChange||"").includes(r))||TR.some(r=>(n.contain||"").includes(r))}function AR(e){let t=_n(e);for(;Jt(t)&&!Rr(t);){if(Cl(t))return t;if(Ei(t))return null;t=_n(t)}return null}function Rl(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const IR=new Set(["html","body","#document"]);function Rr(e){return IR.has(Tr(e))}function $t(e){return mt(e).getComputedStyle(e)}function Ci(e){return Ft(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _n(e){if(Tr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||af(e)&&e.host||Qt(e);return af(t)?t.host:t}function mm(e){const t=_n(e);return Rr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Jt(t)&&ko(t)?t:mm(t)}function po(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=mm(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=mt(o);if(s){const a=Sc(i);return t.concat(i,i.visualViewport||[],ko(o)?o:[],a&&n?po(a):[])}return t.concat(o,po(o,[],n))}function Sc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gm(e){const t=$t(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Jt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Ws(n)!==s||Ws(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Pl(e){return Ft(e)?e:e.contextElement}function vr(e){const t=Pl(e);if(!Jt(t))return qt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=gm(t);let i=(s?Ws(n.width):n.width)/r,a=(s?Ws(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const MR=qt(0);function ym(e){const t=mt(e);return!Rl()||!t.visualViewport?MR:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function DR(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==mt(e)?!1:t}function Gn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Pl(e);let i=qt(1);t&&(r?Ft(r)&&(i=vr(r)):i=vr(e));const a=DR(s,n,r)?ym(s):qt(0);let c=(o.left+a.x)/i.x,l=(o.top+a.y)/i.y,d=o.width/i.x,u=o.height/i.y;if(s){const f=mt(s),h=r&&Ft(r)?mt(r):r;let m=f,g=Sc(m);for(;g&&r&&h!==m;){const v=vr(g),b=g.getBoundingClientRect(),_=$t(g),w=b.left+(g.clientLeft+parseFloat(_.paddingLeft))*v.x,x=b.top+(g.clientTop+parseFloat(_.paddingTop))*v.y;c*=v.x,l*=v.y,d*=v.x,u*=v.y,c+=w,l+=x,m=mt(g),g=Sc(m)}}return Zs({width:d,height:u,x:c,y:l})}function Ri(e,t){const n=Ci(e).scrollLeft;return t?t.left+n:Gn(Qt(e)).left+n}function vm(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Ri(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function jR(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Qt(r),a=t?Ei(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=qt(1);const d=qt(0),u=Jt(r);if((u||!u&&!s)&&((Tr(r)!=="body"||ko(i))&&(c=Ci(r)),Jt(r))){const h=Gn(r);l=vr(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}const f=i&&!u&&!s?vm(i,c):qt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+d.x+f.x,y:n.y*l.y-c.scrollTop*l.y+d.y+f.y}}function LR(e){return Array.from(e.getClientRects())}function FR(e){const t=Qt(e),n=Ci(e),r=e.ownerDocument.body,o=ut(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=ut(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Ri(e);const a=-n.scrollTop;return $t(r).direction==="rtl"&&(i+=ut(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const cf=25;function $R(e,t){const n=mt(e),r=Qt(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const d=Rl();(!d||d&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const l=Ri(r);if(l<=0){const d=r.ownerDocument,u=d.body,f=getComputedStyle(u),h=d.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,m=Math.abs(r.clientWidth-u.clientWidth-h);m<=cf&&(s-=m)}else l<=cf&&(s+=l);return{width:s,height:i,x:a,y:c}}const zR=new Set(["absolute","fixed"]);function VR(e,t){const n=Gn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Jt(e)?vr(e):qt(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,l=r*s.y;return{width:i,height:a,x:c,y:l}}function lf(e,t,n){let r;if(t==="viewport")r=$R(e,n);else if(t==="document")r=FR(Qt(e));else if(Ft(t))r=VR(t,n);else{const o=ym(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Zs(r)}function bm(e,t){const n=_n(e);return n===t||!Ft(n)||Rr(n)?!1:$t(n).position==="fixed"||bm(n,t)}function UR(e,t){const n=t.get(e);if(n)return n;let r=po(e,[],!1).filter(a=>Ft(a)&&Tr(a)!=="body"),o=null;const s=$t(e).position==="fixed";let i=s?_n(e):e;for(;Ft(i)&&!Rr(i);){const a=$t(i),c=Cl(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&zR.has(o.position)||ko(i)&&!c&&bm(e,i))?r=r.filter(d=>d!==i):o=a,i=_n(i)}return t.set(e,r),r}function BR(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Ei(t)?[]:UR(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((l,d)=>{const u=lf(t,d,o);return l.top=ut(u.top,l.top),l.right=xn(u.right,l.right),l.bottom=xn(u.bottom,l.bottom),l.left=ut(u.left,l.left),l},lf(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function WR(e){const{width:t,height:n}=gm(e);return{width:t,height:n}}function HR(e,t,n){const r=Jt(t),o=Qt(t),s=n==="fixed",i=Gn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=qt(0);function l(){c.x=Ri(o)}if(r||!r&&!s)if((Tr(t)!=="body"||ko(o))&&(a=Ci(t)),r){const h=Gn(t,!0,s,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&l();s&&!r&&o&&l();const d=o&&!r&&!s?vm(o,a):qt(0),u=i.left+a.scrollLeft-c.x-d.x,f=i.top+a.scrollTop-c.y-d.y;return{x:u,y:f,width:i.width,height:i.height}}function Ca(e){return $t(e).position==="static"}function uf(e,t){if(!Jt(e)||$t(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Qt(e)===n&&(n=n.ownerDocument.body),n}function wm(e,t){const n=mt(e);if(Ei(e))return n;if(!Jt(e)){let o=_n(e);for(;o&&!Rr(o);){if(Ft(o)&&!Ca(o))return o;o=_n(o)}return n}let r=uf(e,t);for(;r&&PR(r)&&Ca(r);)r=uf(r,t);return r&&Rr(r)&&Ca(r)&&!Cl(r)?n:r||AR(e)||n}const ZR=async function(e){const t=this.getOffsetParent||wm,n=this.getDimensions,r=await n(e.floating);return{reference:HR(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function KR(e){return $t(e).direction==="rtl"}const qR={convertOffsetParentRelativeRectToViewportRelativeRect:jR,getDocumentElement:Qt,getClippingRect:BR,getOffsetParent:wm,getElementRects:ZR,getClientRects:LR,getDimensions:WR,getScale:vr,isElement:Ft,isRTL:KR};function xm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function GR(e,t){let n=null,r;const o=Qt(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=e.getBoundingClientRect(),{left:d,top:u,width:f,height:h}=l;if(a||t(),!f||!h)return;const m=Xo(u),g=Xo(o.clientWidth-(d+f)),v=Xo(o.clientHeight-(u+h)),b=Xo(d),w={rootMargin:-m+"px "+-g+"px "+-v+"px "+-b+"px",threshold:ut(0,xn(1,c))||1};let x=!0;function S(P){const C=P[0].intersectionRatio;if(C!==c){if(!x)return i();C?i(!1,C):r=setTimeout(()=>{i(!1,1e-7)},1e3)}C===1&&!xm(l,e.getBoundingClientRect())&&i(),x=!1}try{n=new IntersectionObserver(S,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(S,w)}n.observe(e)}return i(!0),s}function YR(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=Pl(e),d=o||s?[...l?po(l):[],...po(t)]:[];d.forEach(b=>{o&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const u=l&&a?GR(l,n):null;let f=-1,h=null;i&&(h=new ResizeObserver(b=>{let[_]=b;_&&_.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),n()}),l&&!c&&h.observe(l),h.observe(t));let m,g=c?Gn(e):null;c&&v();function v(){const b=Gn(e);g&&!xm(g,b)&&n(),g=b,m=requestAnimationFrame(v)}return n(),()=>{var b;d.forEach(_=>{o&&_.removeEventListener("scroll",n),s&&_.removeEventListener("resize",n)}),u?.(),(b=h)==null||b.disconnect(),h=null,c&&cancelAnimationFrame(m)}}const JR=xR,QR=_R,XR=vR,eP=ER,tP=bR,df=yR,nP=SR,rP=(e,t,n)=>{const r=new Map,o={platform:qR,...n},s={...o.platform,_c:r};return gR(e,t,{...o,platform:s})};var oP=typeof document<"u",sP=function(){},vs=oP?k.useLayoutEffect:sP;function Ks(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ks(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Ks(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function _m(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ff(e,t){const n=_m(e);return Math.round(t*n)/n}function Ra(e){const t=y.useRef(e);return vs(()=>{t.current=e}),t}function iP(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[d,u]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=y.useState(r);Ks(f,r)||h(r);const[m,g]=y.useState(null),[v,b]=y.useState(null),_=y.useCallback(D=>{D!==P.current&&(P.current=D,g(D))},[]),w=y.useCallback(D=>{D!==C.current&&(C.current=D,b(D))},[]),x=s||m,S=i||v,P=y.useRef(null),C=y.useRef(null),E=y.useRef(d),A=c!=null,U=Ra(c),B=Ra(o),M=Ra(l),j=y.useCallback(()=>{if(!P.current||!C.current)return;const D={placement:t,strategy:n,middleware:f};B.current&&(D.platform=B.current),rP(P.current,C.current,D).then(H=>{const se={...H,isPositioned:M.current!==!1};V.current&&!Ks(E.current,se)&&(E.current=se,ri.flushSync(()=>{u(se)}))})},[f,t,n,B,M]);vs(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,u(D=>({...D,isPositioned:!1})))},[l]);const V=y.useRef(!1);vs(()=>(V.current=!0,()=>{V.current=!1}),[]),vs(()=>{if(x&&(P.current=x),S&&(C.current=S),x&&S){if(U.current)return U.current(x,S,j);j()}},[x,S,j,U,A]);const Y=y.useMemo(()=>({reference:P,floating:C,setReference:_,setFloating:w}),[_,w]),L=y.useMemo(()=>({reference:x,floating:S}),[x,S]),K=y.useMemo(()=>{const D={position:n,left:0,top:0};if(!L.floating)return D;const H=ff(L.floating,d.x),se=ff(L.floating,d.y);return a?{...D,transform:"translate("+H+"px, "+se+"px)",..._m(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:se}},[n,a,L.floating,d.x,d.y]);return y.useMemo(()=>({...d,update:j,refs:Y,elements:L,floatingStyles:K}),[d,j,Y,L,K])}const aP=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?df({element:r.current,padding:o}).fn(n):{}:r?df({element:r,padding:o}).fn(n):{}}}},cP=(e,t)=>({...JR(e),options:[e,t]}),lP=(e,t)=>({...QR(e),options:[e,t]}),uP=(e,t)=>({...nP(e),options:[e,t]}),dP=(e,t)=>({...XR(e),options:[e,t]}),fP=(e,t)=>({...eP(e),options:[e,t]}),hP=(e,t)=>({...tP(e),options:[e,t]}),pP=(e,t)=>({...aP(e),options:[e,t]});var mP="Arrow",Sm=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return p.jsx(ye.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});Sm.displayName=mP;var gP=Sm;function yP(e){const[t,n]=y.useState(void 0);return Ke(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;i=l.inlineSize,a=l.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Ol="Popper",[Em,Pi]=tr(Ol),[vP,Cm]=Em(Ol),Rm=e=>{const{__scopePopper:t,children:n}=e,[r,o]=y.useState(null);return p.jsx(vP,{scope:t,anchor:r,onAnchorChange:o,children:n})};Rm.displayName=Ol;var Pm="PopperAnchor",Om=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Cm(Pm,n),i=y.useRef(null),a=xe(t,i),c=y.useRef(null);return y.useEffect(()=>{const l=c.current;c.current=r?.current||i.current,l!==c.current&&s.onAnchorChange(c.current)}),r?null:p.jsx(ye.div,{...o,ref:a})});Om.displayName=Pm;var kl="PopperContent",[bP,wP]=Em(kl),km=y.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:d=0,sticky:u="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:m,...g}=e,v=Cm(kl,n),[b,_]=y.useState(null),w=xe(t,F=>_(F)),[x,S]=y.useState(null),P=yP(x),C=P?.width??0,E=P?.height??0,A=r+(s!=="center"?"-"+s:""),U=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},B=Array.isArray(l)?l:[l],M=B.length>0,j={padding:U,boundary:B.filter(_P),altBoundary:M},{refs:V,floatingStyles:Y,placement:L,isPositioned:K,middlewareData:D}=iP({strategy:"fixed",placement:A,whileElementsMounted:(...F)=>YR(...F,{animationFrame:h==="always"}),elements:{reference:v.anchor},middleware:[cP({mainAxis:o+E,alignmentAxis:i}),c&&lP({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?uP():void 0,...j}),c&&dP({...j}),fP({...j,apply:({elements:F,rects:ee,availableWidth:pe,availableHeight:ce})=>{const{width:ue,height:me}=ee.reference,Oe=F.floating.style;Oe.setProperty("--radix-popper-available-width",`${pe}px`),Oe.setProperty("--radix-popper-available-height",`${ce}px`),Oe.setProperty("--radix-popper-anchor-width",`${ue}px`),Oe.setProperty("--radix-popper-anchor-height",`${me}px`)}}),x&&pP({element:x,padding:a}),SP({arrowWidth:C,arrowHeight:E}),f&&hP({strategy:"referenceHidden",...j})]}),[H,se]=Am(L),N=Yt(m);Ke(()=>{K&&N?.()},[K,N]);const Q=D.arrow?.x,W=D.arrow?.y,Z=D.arrow?.centerOffset!==0,[ie,fe]=y.useState();return Ke(()=>{b&&fe(window.getComputedStyle(b).zIndex)},[b]),p.jsx("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:K?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ie,"--radix-popper-transform-origin":[D.transformOrigin?.x,D.transformOrigin?.y].join(" "),...D.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(bP,{scope:n,placedSide:H,onArrowChange:S,arrowX:Q,arrowY:W,shouldHideArrow:Z,children:p.jsx(ye.div,{"data-side":H,"data-align":se,...g,ref:w,style:{...g.style,animation:K?void 0:"none"}})})})});km.displayName=kl;var Nm="PopperArrow",xP={top:"bottom",right:"left",bottom:"top",left:"right"},Tm=y.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=wP(Nm,r),i=xP[s.placedSide];return p.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:p.jsx(gP,{...o,ref:n,style:{...o.style,display:"block"}})})});Tm.displayName=Nm;function _P(e){return e!==null}var SP=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[l,d]=Am(n),u={start:"0%",center:"50%",end:"100%"}[d],f=(o.arrow?.x??0)+a/2,h=(o.arrow?.y??0)+c/2;let m="",g="";return l==="bottom"?(m=i?u:`${f}px`,g=`${-c}px`):l==="top"?(m=i?u:`${f}px`,g=`${r.floating.height+c}px`):l==="right"?(m=`${-c}px`,g=i?u:`${h}px`):l==="left"&&(m=`${r.floating.width+c}px`,g=i?u:`${h}px`),{data:{x:m,y:g}}}});function Am(e){const[t,n="center"]=e.split("-");return[t,n]}var Im=Rm,Mm=Om,Dm=km,jm=Tm,EP="Portal",Oi=y.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=y.useState(!1);Ke(()=>s(!0),[]);const i=n||o&&globalThis?.document?.body;return i?ni.createPortal(p.jsx(ye.div,{...r,ref:t}),i):null});Oi.displayName=EP;function CP(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var Cn=e=>{const{present:t,children:n}=e,r=RP(t),o=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),s=xe(r.ref,PP(o));return typeof n=="function"||r.isPresent?y.cloneElement(o,{ref:s}):null};Cn.displayName="Presence";function RP(e){const[t,n]=y.useState(),r=y.useRef(null),o=y.useRef(e),s=y.useRef("none"),i=e?"mounted":"unmounted",[a,c]=CP(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const l=es(r.current);s.current=a==="mounted"?l:"none"},[a]),Ke(()=>{const l=r.current,d=o.current;if(d!==e){const f=s.current,h=es(l);e?c("MOUNT"):h==="none"||l?.display==="none"?c("UNMOUNT"):c(d&&f!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Ke(()=>{if(t){let l;const d=t.ownerDocument.defaultView??window,u=h=>{const g=es(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&g&&(c("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",l=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},f=h=>{h.target===t&&(s.current=es(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{d.clearTimeout(l),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:y.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function es(e){return e?.animationName||"none"}function PP(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Pa="rovingFocusGroup.onEntryFocus",OP={bubbles:!1,cancelable:!0},No="RovingFocusGroup",[Ec,Lm,kP]=bl(No),[NP,Fm]=tr(No,[kP]),[TP,AP]=NP(No),$m=y.forwardRef((e,t)=>p.jsx(Ec.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(Ec.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(IP,{...e,ref:t})})}));$m.displayName=No;var IP=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:d=!1,...u}=e,f=y.useRef(null),h=xe(t,f),m=wl(s),[g,v]=ho({prop:i,defaultProp:a??null,onChange:c,caller:No}),[b,_]=y.useState(!1),w=Yt(l),x=Lm(n),S=y.useRef(!1),[P,C]=y.useState(0);return y.useEffect(()=>{const E=f.current;if(E)return E.addEventListener(Pa,w),()=>E.removeEventListener(Pa,w)},[w]),p.jsx(TP,{scope:n,orientation:r,dir:m,loop:o,currentTabStopId:g,onItemFocus:y.useCallback(E=>v(E),[v]),onItemShiftTab:y.useCallback(()=>_(!0),[]),onFocusableItemAdd:y.useCallback(()=>C(E=>E+1),[]),onFocusableItemRemove:y.useCallback(()=>C(E=>E-1),[]),children:p.jsx(ye.div,{tabIndex:b||P===0?-1:0,"data-orientation":r,...u,ref:h,style:{outline:"none",...e.style},onMouseDown:re(e.onMouseDown,()=>{S.current=!0}),onFocus:re(e.onFocus,E=>{const A=!S.current;if(E.target===E.currentTarget&&A&&!b){const U=new CustomEvent(Pa,OP);if(E.currentTarget.dispatchEvent(U),!U.defaultPrevented){const B=x().filter(L=>L.focusable),M=B.find(L=>L.active),j=B.find(L=>L.id===g),Y=[M,j,...B].filter(Boolean).map(L=>L.ref.current);Um(Y,d)}}S.current=!1}),onBlur:re(e.onBlur,()=>_(!1))})})}),zm="RovingFocusGroupItem",Vm=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...a}=e,c=rn(),l=s||c,d=AP(zm,n),u=d.currentTabStopId===l,f=Lm(n),{onFocusableItemAdd:h,onFocusableItemRemove:m,currentTabStopId:g}=d;return y.useEffect(()=>{if(r)return h(),()=>m()},[r,h,m]),p.jsx(Ec.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:p.jsx(ye.span,{tabIndex:u?0:-1,"data-orientation":d.orientation,...a,ref:t,onMouseDown:re(e.onMouseDown,v=>{r?d.onItemFocus(l):v.preventDefault()}),onFocus:re(e.onFocus,()=>d.onItemFocus(l)),onKeyDown:re(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){d.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const b=jP(v,d.orientation,d.dir);if(b!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let w=f().filter(x=>x.focusable).map(x=>x.ref.current);if(b==="last")w.reverse();else if(b==="prev"||b==="next"){b==="prev"&&w.reverse();const x=w.indexOf(v.currentTarget);w=d.loop?LP(w,x+1):w.slice(x+1)}setTimeout(()=>Um(w))}}),children:typeof i=="function"?i({isCurrentTabStop:u,hasTabStop:g!=null}):i})})});Vm.displayName=zm;var MP={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function DP(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function jP(e,t,n){const r=DP(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return MP[r]}function Um(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function LP(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var FP=$m,$P=Vm;function zP(e){const t=VP(e),n=y.forwardRef((r,o)=>{const{children:s,...i}=r,a=y.Children.toArray(s),c=a.find(BP);if(c){const l=c.props.children,d=a.map(u=>u===c?y.Children.count(l)>1?y.Children.only(null):y.isValidElement(l)?l.props.children:null:u);return p.jsx(t,{...i,ref:o,children:y.isValidElement(l)?y.cloneElement(l,void 0,d):null})}return p.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function VP(e){const t=y.forwardRef((n,r)=>{const{children:o,...s}=n;if(y.isValidElement(o)){const i=HP(o),a=WP(s,o.props);return o.type!==y.Fragment&&(a.ref=r?ln(r,i):i),y.cloneElement(o,a)}return y.Children.count(o)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var UP=Symbol("radix.slottable");function BP(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===UP}function WP(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function HP(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ZP=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},lr=new WeakMap,ts=new WeakMap,ns={},Oa=0,Bm=function(e){return e&&(e.host||Bm(e.parentNode))},KP=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Bm(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},qP=function(e,t,n,r){var o=KP(t,Array.isArray(e)?e:[e]);ns[n]||(ns[n]=new WeakMap);var s=ns[n],i=[],a=new Set,c=new Set(o),l=function(u){!u||a.has(u)||(a.add(u),l(u.parentNode))};o.forEach(l);var d=function(u){!u||c.has(u)||Array.prototype.forEach.call(u.children,function(f){if(a.has(f))d(f);else try{var h=f.getAttribute(r),m=h!==null&&h!=="false",g=(lr.get(f)||0)+1,v=(s.get(f)||0)+1;lr.set(f,g),s.set(f,v),i.push(f),g===1&&m&&ts.set(f,!0),v===1&&f.setAttribute(n,"true"),m||f.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",f,b)}})};return d(t),a.clear(),Oa++,function(){i.forEach(function(u){var f=lr.get(u)-1,h=s.get(u)-1;lr.set(u,f),s.set(u,h),f||(ts.has(u)||u.removeAttribute(r),ts.delete(u)),h||u.removeAttribute(n)}),Oa--,Oa||(lr=new WeakMap,lr=new WeakMap,ts=new WeakMap,ns={})}},Nl=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=ZP(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),qP(r,o,n,"aria-hidden")):function(){return null}},Zt=function(){return Zt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Zt.apply(this,arguments)};function Wm(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function GP(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var bs="right-scroll-bar-position",ws="width-before-scroll-bar",YP="with-scroll-bars-hidden",JP="--removed-body-scroll-bar-size";function ka(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function QP(e,t){var n=k.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var XP=typeof window<"u"?y.useLayoutEffect:y.useEffect,hf=new WeakMap;function eO(e,t){var n=QP(null,function(r){return e.forEach(function(o){return ka(o,r)})});return XP(function(){var r=hf.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||ka(a,null)}),s.forEach(function(a){o.has(a)||ka(a,i)})}hf.set(n,e)},[e]),n}function tO(e){return e}function nO(e,t){t===void 0&&(t=tO);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var d=i;i=[],d.forEach(s)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(d){i.push(d),l()},filter:function(d){return i=i.filter(d),n}}}};return o}function rO(e){e===void 0&&(e={});var t=nO(null);return t.options=Zt({async:!0,ssr:!1},e),t}var Hm=function(e){var t=e.sideCar,n=Wm(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return y.createElement(r,Zt({},n))};Hm.isSideCarExport=!0;function oO(e,t){return e.useMedium(t),Hm}var Zm=rO(),Na=function(){},ki=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:Na,onWheelCapture:Na,onTouchMoveCapture:Na}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,l=e.removeScrollBar,d=e.enabled,u=e.shards,f=e.sideCar,h=e.noRelative,m=e.noIsolation,g=e.inert,v=e.allowPinchZoom,b=e.as,_=b===void 0?"div":b,w=e.gapMode,x=Wm(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,P=eO([n,t]),C=Zt(Zt({},x),o);return y.createElement(y.Fragment,null,d&&y.createElement(S,{sideCar:Zm,removeScrollBar:l,shards:u,noRelative:h,noIsolation:m,inert:g,setCallbacks:s,allowPinchZoom:!!v,lockRef:n,gapMode:w}),i?y.cloneElement(y.Children.only(a),Zt(Zt({},C),{ref:P})):y.createElement(_,Zt({},C,{className:c,ref:P}),a))});ki.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ki.classNames={fullWidth:ws,zeroRight:bs};var sO=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function iO(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=sO();return t&&e.setAttribute("nonce",t),e}function aO(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function cO(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var lO=function(){var e=0,t=null;return{add:function(n){e==0&&(t=iO())&&(aO(t,n),cO(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},uO=function(){var e=lO();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Km=function(){var e=uO(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},dO={left:0,top:0,right:0,gap:0},Ta=function(e){return parseInt(e||"",10)||0},fO=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Ta(n),Ta(r),Ta(o)]},hO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return dO;var t=fO(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},pO=Km(),br="data-scroll-locked",mO=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
22
|
+
.`.concat(YP,` {
|
|
23
23
|
overflow: hidden `).concat(r,`;
|
|
24
24
|
padding-right: `).concat(a,"px ").concat(r,`;
|
|
25
25
|
}
|
|
26
|
-
body[`).concat(
|
|
26
|
+
body[`).concat(br,`] {
|
|
27
27
|
overflow: hidden `).concat(r,`;
|
|
28
28
|
overscroll-behavior: contain;
|
|
29
29
|
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
30
|
-
padding-left: `.concat(
|
|
31
|
-
padding-top: `).concat(
|
|
30
|
+
padding-left: `.concat(o,`px;
|
|
31
|
+
padding-top: `).concat(s,`px;
|
|
32
32
|
padding-right: `).concat(i,`px;
|
|
33
33
|
margin-left:0;
|
|
34
34
|
margin-top:0;
|
|
@@ -36,70 +36,68 @@ Take a look at the reducer(s) handling this action type: ${h.type}.
|
|
|
36
36
|
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
.`).concat(
|
|
39
|
+
.`).concat(bs,` {
|
|
40
40
|
right: `).concat(a,"px ").concat(r,`;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
.`).concat(
|
|
43
|
+
.`).concat(ws,` {
|
|
44
44
|
margin-right: `).concat(a,"px ").concat(r,`;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
.`).concat(
|
|
47
|
+
.`).concat(bs," .").concat(bs,` {
|
|
48
48
|
right: 0 `).concat(r,`;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
.`).concat(
|
|
51
|
+
.`).concat(ws," .").concat(ws,` {
|
|
52
52
|
margin-right: 0 `).concat(r,`;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
body[`).concat(
|
|
56
|
-
`).concat(
|
|
55
|
+
body[`).concat(br,`] {
|
|
56
|
+
`).concat(JP,": ").concat(a,`px;
|
|
57
57
|
}
|
|
58
|
-
`)},
|
|
58
|
+
`)},pf=function(){var e=parseInt(document.body.getAttribute(br)||"0",10);return isFinite(e)?e:0},gO=function(){y.useEffect(function(){return document.body.setAttribute(br,(pf()+1).toString()),function(){var e=pf()-1;e<=0?document.body.removeAttribute(br):document.body.setAttribute(br,e.toString())}},[])},yO=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;gO();var s=y.useMemo(function(){return hO(o)},[o]);return y.createElement(pO,{styles:mO(s,!t,o,n?"":"!important")})},Cc=!1;if(typeof window<"u")try{var rs=Object.defineProperty({},"passive",{get:function(){return Cc=!0,!0}});window.addEventListener("test",rs,rs),window.removeEventListener("test",rs,rs)}catch{Cc=!1}var ur=Cc?{passive:!1}:!1,vO=function(e){return e.tagName==="TEXTAREA"},qm=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!vO(e)&&n[t]==="visible")},bO=function(e){return qm(e,"overflowY")},wO=function(e){return qm(e,"overflowX")},mf=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Gm(e,r);if(o){var s=Ym(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},xO=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},_O=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Gm=function(e,t){return e==="v"?bO(t):wO(t)},Ym=function(e,t){return e==="v"?xO(t):_O(t)},SO=function(e,t){return e==="h"&&t==="rtl"?-1:1},EO=function(e,t,n,r,o){var s=SO(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,c=t.contains(a),l=!1,d=i>0,u=0,f=0;do{if(!a)break;var h=Ym(e,a),m=h[0],g=h[1],v=h[2],b=g-v-s*m;(m||b)&&Gm(e,a)&&(u+=b,f+=m);var _=a.parentNode;a=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(d&&Math.abs(u)<1||!d&&Math.abs(f)<1)&&(l=!0),l},os=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},gf=function(e){return[e.deltaX,e.deltaY]},yf=function(e){return e&&"current"in e?e.current:e},CO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},RO=function(e){return`
|
|
59
59
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
60
60
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
61
|
-
`)},vD=0,xs=[];function xD(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),s=v.useState(vD++)[0],o=v.useState(p_)[0],i=v.useRef(e);v.useEffect(function(){i.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var m=VN([e.lockRef.current],(e.shards||[]).map(sg),!0).filter(Boolean);return m.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=v.useCallback(function(m,y){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!i.current.allowPinchZoom;var b=ra(m),x=n.current,_="deltaX"in m?m.deltaX:x[0]-b[0],w="deltaY"in m?m.deltaY:x[1]-b[1],S,C=m.target,k=Math.abs(_)>Math.abs(w)?"h":"v";if("touches"in m&&k==="h"&&C.type==="range")return!1;var E=window.getSelection(),P=E&&E.anchorNode,O=P?P===C||P.contains(C):!1;if(O)return!1;var N=ng(k,C);if(!N)return!0;if(N?S=k:(S=k==="v"?"h":"v",N=ng(k,C)),!N)return!1;if(!r.current&&"changedTouches"in m&&(_||w)&&(r.current=S),!S)return!0;var A=r.current||S;return gD(A,y,m,A==="h"?_:w)},[]),c=v.useCallback(function(m){var y=m;if(!(!xs.length||xs[xs.length-1]!==o)){var b="deltaY"in y?rg(y):ra(y),x=t.current.filter(function(S){return S.name===y.type&&(S.target===y.target||y.target===S.shadowParent)&&yD(S.delta,b)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var _=(i.current.shards||[]).map(sg).filter(Boolean).filter(function(S){return S.contains(y.target)}),w=_.length>0?a(y,_[0]):!i.current.noIsolation;w&&y.cancelable&&y.preventDefault()}}},[]),l=v.useCallback(function(m,y,b,x){var _={name:m,delta:y,target:b,should:x,shadowParent:_D(b)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(w){return w!==_})},1)},[]),u=v.useCallback(function(m){n.current=ra(m),r.current=void 0},[]),d=v.useCallback(function(m){l(m.type,rg(m),m.target,a(m,e.lockRef.current))},[]),f=v.useCallback(function(m){l(m.type,ra(m),m.target,a(m,e.lockRef.current))},[]);v.useEffect(function(){return xs.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,vs),document.addEventListener("touchmove",c,vs),document.addEventListener("touchstart",u,vs),function(){xs=xs.filter(function(m){return m!==o}),document.removeEventListener("wheel",c,vs),document.removeEventListener("touchmove",c,vs),document.removeEventListener("touchstart",u,vs)}},[]);var h=e.removeScrollBar,p=e.inert;return v.createElement(v.Fragment,null,p?v.createElement(o,{styles:bD(s)}):null,h?v.createElement(lD,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function _D(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const wD=YN(h_,xD);var cl=v.forwardRef(function(e,t){return v.createElement(al,Sn({},e,{ref:t,sideCar:wD}))});cl.classNames=al.classNames;var Sd=["Enter"," "],SD=["ArrowDown","PageUp","Home"],b_=["ArrowUp","PageDown","End"],ED=[...SD,...b_],kD={ltr:[...Sd,"ArrowRight"],rtl:[...Sd,"ArrowLeft"]},CD={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ci="Menu",[ri,RD,PD]=Ff(Ci),[us,v_]=wr(Ci,[PD,ol,o_]),ll=ol(),x_=o_(),[OD,ds]=us(Ci),[TD,Ri]=us(Ci),__=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:o,modal:i=!0}=e,a=ll(t),[c,l]=v.useState(null),u=v.useRef(!1),d=On(o),f=zf(s);return v.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},p=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),g.jsx(e_,{...a,children:g.jsx(OD,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:g.jsx(TD,{scope:t,onClose:v.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:i,children:r})})})};__.displayName=Ci;var MD="MenuAnchor",Yf=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=ll(n);return g.jsx(t_,{...s,...r,ref:t})});Yf.displayName=MD;var Xf="MenuPortal",[AD,w_]=us(Xf,{forceMount:void 0}),S_=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,o=ds(Xf,t);return g.jsx(AD,{scope:t,forceMount:n,children:g.jsx(Xn,{present:n||o.open,children:g.jsx(il,{asChild:!0,container:s,children:r})})})};S_.displayName=Xf;var en="MenuContent",[ND,Jf]=us(en),E_=v.forwardRef((e,t)=>{const n=w_(en,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=ds(en,e.__scopeMenu),i=Ri(en,e.__scopeMenu);return g.jsx(ri.Provider,{scope:e.__scopeMenu,children:g.jsx(Xn,{present:r||o.open,children:g.jsx(ri.Slot,{scope:e.__scopeMenu,children:i.modal?g.jsx(DD,{...s,ref:t}):g.jsx(ID,{...s,ref:t})})})})}),DD=v.forwardRef((e,t)=>{const n=ds(en,e.__scopeMenu),r=v.useRef(null),s=Pe(t,r);return v.useEffect(()=>{const o=r.current;if(o)return Gf(o)},[]),g.jsx(Qf,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:re(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),ID=v.forwardRef((e,t)=>{const n=ds(en,e.__scopeMenu);return g.jsx(Qf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),jD=AN("MenuContent.ScrollLock"),Qf=v.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,disableOutsideScroll:p,...m}=e,y=ds(en,n),b=Ri(en,n),x=ll(n),_=x_(n),w=RD(n),[S,C]=v.useState(null),k=v.useRef(null),E=Pe(t,k,y.onContentChange),P=v.useRef(0),O=v.useRef(""),N=v.useRef(0),A=v.useRef(null),j=v.useRef("right"),$=v.useRef(0),q=p?cl:v.Fragment,D=p?{as:jD,allowPinchZoom:!0}:void 0,H=W=>{const se=O.current+W,I=w().filter(V=>!V.disabled),Y=document.activeElement,K=I.find(V=>V.ref.current===Y)?.textValue,Z=I.map(V=>V.textValue),oe=ZD(Z,se,K),ce=I.find(V=>V.textValue===oe)?.ref.current;(function V(ee){O.current=ee,window.clearTimeout(P.current),ee!==""&&(P.current=window.setTimeout(()=>V(""),1e3))})(se),ce&&setTimeout(()=>ce.focus())};v.useEffect(()=>()=>window.clearTimeout(P.current),[]),$f();const F=v.useCallback(W=>j.current===A.current?.side&&YD(W,A.current?.area),[]);return g.jsx(ND,{scope:n,searchRef:O,onItemEnter:v.useCallback(W=>{F(W)&&W.preventDefault()},[F]),onItemLeave:v.useCallback(W=>{F(W)||(k.current?.focus(),C(null))},[F]),onTriggerLeave:v.useCallback(W=>{F(W)&&W.preventDefault()},[F]),pointerGraceTimerRef:N,onPointerGraceIntentChange:v.useCallback(W=>{A.current=W},[]),children:g.jsx(q,{...D,children:g.jsx(el,{asChild:!0,trapped:s,onMountAutoFocus:re(o,W=>{W.preventDefault(),k.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:g.jsx(Qc,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,children:g.jsx(TN,{asChild:!0,..._,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:re(c,W=>{b.isUsingKeyboardRef.current||W.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(n_,{role:"menu","aria-orientation":"vertical","data-state":$_(y.open),"data-radix-menu-content":"",dir:b.dir,...x,...m,ref:E,style:{outline:"none",...m.style},onKeyDown:re(m.onKeyDown,W=>{const I=W.target.closest("[data-radix-menu-content]")===W.currentTarget,Y=W.ctrlKey||W.altKey||W.metaKey,K=W.key.length===1;I&&(W.key==="Tab"&&W.preventDefault(),!Y&&K&&H(W.key));const Z=k.current;if(W.target!==Z||!ED.includes(W.key))return;W.preventDefault();const ce=w().filter(V=>!V.disabled).map(V=>V.ref.current);b_.includes(W.key)&&ce.reverse(),qD(ce)}),onBlur:re(e.onBlur,W=>{W.currentTarget.contains(W.target)||(window.clearTimeout(P.current),O.current="")}),onPointerMove:re(e.onPointerMove,si(W=>{const se=W.target,I=$.current!==W.clientX;if(W.currentTarget.contains(se)&&I){const Y=W.clientX>$.current?"right":"left";j.current=Y,$.current=W.clientX}}))})})})})})})});E_.displayName=en;var LD="MenuGroup",eh=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(be.div,{role:"group",...r,ref:t})});eh.displayName=LD;var FD="MenuLabel",k_=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(be.div,{...r,ref:t})});k_.displayName=FD;var yc="MenuItem",og="menu.itemSelect",ul=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,o=v.useRef(null),i=Ri(yc,e.__scopeMenu),a=Jf(yc,e.__scopeMenu),c=Pe(t,o),l=v.useRef(!1),u=()=>{const d=o.current;if(!n&&d){const f=new CustomEvent(og,{bubbles:!0,cancelable:!0});d.addEventListener(og,h=>r?.(h),{once:!0}),Px(d,f),f.defaultPrevented?l.current=!1:i.onClose()}};return g.jsx(C_,{...s,ref:c,disabled:n,onClick:re(e.onClick,u),onPointerDown:d=>{e.onPointerDown?.(d),l.current=!0},onPointerUp:re(e.onPointerUp,d=>{l.current||d.currentTarget?.click()}),onKeyDown:re(e.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||Sd.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});ul.displayName=yc;var C_=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...o}=e,i=Jf(yc,n),a=x_(n),c=v.useRef(null),l=Pe(t,c),[u,d]=v.useState(!1),[f,h]=v.useState("");return v.useEffect(()=>{const p=c.current;p&&h((p.textContent??"").trim())},[o.children]),g.jsx(ri.ItemSlot,{scope:n,disabled:r,textValue:s??f,children:g.jsx(MN,{asChild:!0,...a,focusable:!r,children:g.jsx(be.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:l,onPointerMove:re(e.onPointerMove,si(p=>{r?i.onItemLeave(p):(i.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:re(e.onPointerLeave,si(p=>i.onItemLeave(p))),onFocus:re(e.onFocus,()=>d(!0)),onBlur:re(e.onBlur,()=>d(!1))})})})}),zD="MenuCheckboxItem",R_=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return g.jsx(A_,{scope:e.__scopeMenu,checked:n,children:g.jsx(ul,{role:"menuitemcheckbox","aria-checked":bc(n)?"mixed":n,...s,ref:t,"data-state":nh(n),onSelect:re(s.onSelect,()=>r?.(bc(n)?!0:!n),{checkForDefaultPrevented:!1})})})});R_.displayName=zD;var P_="MenuRadioGroup",[$D,VD]=us(P_,{value:void 0,onValueChange:()=>{}}),O_=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,o=On(r);return g.jsx($D,{scope:e.__scopeMenu,value:n,onValueChange:o,children:g.jsx(eh,{...s,ref:t})})});O_.displayName=P_;var T_="MenuRadioItem",M_=v.forwardRef((e,t)=>{const{value:n,...r}=e,s=VD(T_,e.__scopeMenu),o=n===s.value;return g.jsx(A_,{scope:e.__scopeMenu,checked:o,children:g.jsx(ul,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":nh(o),onSelect:re(r.onSelect,()=>s.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});M_.displayName=T_;var th="MenuItemIndicator",[A_,BD]=us(th,{checked:!1}),N_=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,o=BD(th,n);return g.jsx(Xn,{present:r||bc(o.checked)||o.checked===!0,children:g.jsx(be.span,{...s,ref:t,"data-state":nh(o.checked)})})});N_.displayName=th;var UD="MenuSeparator",D_=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(be.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});D_.displayName=UD;var WD="MenuArrow",I_=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=ll(n);return g.jsx(r_,{...s,...r,ref:t})});I_.displayName=WD;var HD="MenuSub",[ZH,j_]=us(HD),Po="MenuSubTrigger",L_=v.forwardRef((e,t)=>{const n=ds(Po,e.__scopeMenu),r=Ri(Po,e.__scopeMenu),s=j_(Po,e.__scopeMenu),o=Jf(Po,e.__scopeMenu),i=v.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=o,l={__scopeMenu:e.__scopeMenu},u=v.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return v.useEffect(()=>u,[u]),v.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),c(null)}},[a,c]),g.jsx(Yf,{asChild:!0,...l,children:g.jsx(C_,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":$_(n.open),...e,ref:Yn(t,s.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:re(e.onPointerMove,si(d=>{o.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(o.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:re(e.onPointerLeave,si(d=>{u();const f=n.content?.getBoundingClientRect();if(f){const h=n.content?.dataset.side,p=h==="right",m=p?-5:5,y=f[p?"left":"right"],b=f[p?"right":"left"];o.onPointerGraceIntentChange({area:[{x:d.clientX+m,y:d.clientY},{x:y,y:f.top},{x:b,y:f.top},{x:b,y:f.bottom},{x:y,y:f.bottom}],side:h}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(d),d.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:re(e.onKeyDown,d=>{const f=o.searchRef.current!=="";e.disabled||f&&d.key===" "||kD[r.dir].includes(d.key)&&(n.onOpenChange(!0),n.content?.focus(),d.preventDefault())})})})});L_.displayName=Po;var F_="MenuSubContent",z_=v.forwardRef((e,t)=>{const n=w_(en,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=ds(en,e.__scopeMenu),i=Ri(en,e.__scopeMenu),a=j_(F_,e.__scopeMenu),c=v.useRef(null),l=Pe(t,c);return g.jsx(ri.Provider,{scope:e.__scopeMenu,children:g.jsx(Xn,{present:r||o.open,children:g.jsx(ri.Slot,{scope:e.__scopeMenu,children:g.jsx(Qf,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:l,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{i.isUsingKeyboardRef.current&&c.current?.focus(),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:re(e.onFocusOutside,u=>{u.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:re(e.onEscapeKeyDown,u=>{i.onClose(),u.preventDefault()}),onKeyDown:re(e.onKeyDown,u=>{const d=u.currentTarget.contains(u.target),f=CD[i.dir].includes(u.key);d&&f&&(o.onOpenChange(!1),a.trigger?.focus(),u.preventDefault())})})})})})});z_.displayName=F_;function $_(e){return e?"open":"closed"}function bc(e){return e==="indeterminate"}function nh(e){return bc(e)?"indeterminate":e?"checked":"unchecked"}function qD(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function KD(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ZD(e,t,n){const s=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let i=KD(e,Math.max(o,0));s.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function GD(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,i=t.length-1;o<t.length;i=o++){const a=t[o],c=t[i],l=a.x,u=a.y,d=c.x,f=c.y;u>r!=f>r&&n<(d-l)*(r-u)/(f-u)+l&&(s=!s)}return s}function YD(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return GD(n,t)}function si(e){return t=>t.pointerType==="mouse"?e(t):void 0}var XD=__,JD=Yf,QD=S_,eI=E_,tI=eh,nI=k_,rI=ul,sI=R_,oI=O_,iI=M_,aI=N_,cI=D_,lI=I_,uI=L_,dI=z_,dl="DropdownMenu",[fI]=wr(dl,[v_]),Rt=v_(),[hI,V_]=fI(dl),B_=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,c=Rt(t),l=v.useRef(null),[u,d]=Zs({prop:s,defaultProp:o??!1,onChange:i,caller:dl});return g.jsx(hI,{scope:t,triggerId:Hn(),triggerRef:l,contentId:Hn(),open:u,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(f=>!f),[d]),modal:a,children:g.jsx(XD,{...c,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};B_.displayName=dl;var U_="DropdownMenuTrigger",W_=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,o=V_(U_,n),i=Rt(n);return g.jsx(JD,{asChild:!0,...i,children:g.jsx(be.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:Yn(t,o.triggerRef),onPointerDown:re(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:re(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});W_.displayName=U_;var pI="DropdownMenuPortal",H_=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Rt(t);return g.jsx(QD,{...r,...n})};H_.displayName=pI;var q_="DropdownMenuContent",K_=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=V_(q_,n),o=Rt(n),i=v.useRef(!1);return g.jsx(eI,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...r,ref:t,onCloseAutoFocus:re(e.onCloseAutoFocus,a=>{i.current||s.triggerRef.current?.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:re(e.onInteractOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,u=c.button===2||l;(!s.modal||u)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});K_.displayName=q_;var mI="DropdownMenuGroup",gI=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(tI,{...s,...r,ref:t})});gI.displayName=mI;var yI="DropdownMenuLabel",bI=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(nI,{...s,...r,ref:t})});bI.displayName=yI;var vI="DropdownMenuItem",Z_=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(rI,{...s,...r,ref:t})});Z_.displayName=vI;var xI="DropdownMenuCheckboxItem",_I=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(sI,{...s,...r,ref:t})});_I.displayName=xI;var wI="DropdownMenuRadioGroup",SI=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(oI,{...s,...r,ref:t})});SI.displayName=wI;var EI="DropdownMenuRadioItem",kI=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(iI,{...s,...r,ref:t})});kI.displayName=EI;var CI="DropdownMenuItemIndicator",RI=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(aI,{...s,...r,ref:t})});RI.displayName=CI;var PI="DropdownMenuSeparator",OI=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(cI,{...s,...r,ref:t})});OI.displayName=PI;var TI="DropdownMenuArrow",MI=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(lI,{...s,...r,ref:t})});MI.displayName=TI;var AI="DropdownMenuSubTrigger",NI=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(uI,{...s,...r,ref:t})});NI.displayName=AI;var DI="DropdownMenuSubContent",II=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(dI,{...s,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});II.displayName=DI;var jI=B_,LI=W_,FI=H_,zI=K_,$I=Z_;function VI({...e}){return g.jsx(jI,{"data-slot":"dropdown-menu",...e})}function BI({...e}){return g.jsx(LI,{"data-slot":"dropdown-menu-trigger",...e})}function UI({className:e,sideOffset:t=4,...n}){return g.jsx(FI,{children:g.jsx(zI,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Se("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function sa({className:e,inset:t,variant:n="default",...r}){return g.jsx($I,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Se("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:ps-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}const WI=e=>{switch(e.toLowerCase()){case"http":return g.jsx(WM,{size:20});case"ping":return g.jsx(cu,{size:20});case"tcp":return g.jsx(s1,{size:20});case"dns":return g.jsx(n1,{size:20});case"keyword":return g.jsx(Ex,{size:20});case"json_query":return g.jsx($M,{size:20});case"push":return g.jsx(e1,{size:20});case"steam":return g.jsx(cu,{size:20});default:return g.jsx(cu,{size:20})}},HI=T.memo(function({summary:t,onEdit:n,onDelete:r,onPause:s,onClone:o,onDetails:i}){const{monitor:a,latest:c,bars:l,uptimePct:u}=t,d=c?.status??"unknown",f=d==="up"?"text-emerald-500":d==="down"?"text-red-500":"text-muted-foreground",h=d==="up"?"hover:border-emerald-500/50":d==="down"?"hover:border-red-500/50":"hover:border-neutral-500/50";return g.jsxs("div",{className:Se("bg-card hover:bg-muted/50 relative cursor-pointer rounded-lg border p-4 transition-all duration-200 hover:shadow-sm flex flex-col justify-between",h),onClick:()=>i(a),children:[g.jsxs("div",{className:"flex items-start justify-between mb-4",children:[g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx("div",{className:"bg-muted flex size-10 items-center justify-center rounded-lg p-2 text-muted-foreground",children:WI(a.type)}),g.jsxs("div",{children:[g.jsx("h3",{className:"font-semibold line-clamp-1",children:a.name}),g.jsxs("div",{className:"text-xs text-muted-foreground flex items-center gap-2",children:[g.jsx("span",{className:"uppercase",children:a.type}),g.jsx("span",{children:"•"}),g.jsxs("span",{children:[a.intervalSeconds,"s"]})]})]})]}),g.jsxs(VI,{children:[g.jsx(BI,{asChild:!0,children:g.jsx(gt,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground",onClick:p=>p.stopPropagation(),children:g.jsx(BM,{className:"h-4 w-4"})})}),g.jsxs(UI,{align:"end",children:[g.jsxs(sa,{onClick:p=>{p.stopPropagation(),n(a)},children:[g.jsx(wx,{className:"mr-2 h-4 w-4"})," Edit"]}),g.jsxs(sa,{onClick:p=>{p.stopPropagation(),o(a)},children:[g.jsx(xx,{className:"mr-2 h-4 w-4"})," Clone"]}),g.jsxs(sa,{onClick:p=>{p.stopPropagation(),s(a)},children:[a.isPaused?g.jsx(Sx,{className:"mr-2 h-4 w-4"}):g.jsx(_x,{className:"mr-2 h-4 w-4"}),a.isPaused?"Resume":"Pause"]}),g.jsxs(sa,{className:"text-red-600",onClick:p=>{p.stopPropagation(),r(a)},children:[g.jsx(jf,{className:"mr-2 h-4 w-4"})," Delete"]})]})]})]}),g.jsxs("div",{className:"space-y-4 mb-2",children:[g.jsxs("div",{className:"flex justify-between items-end text-sm",children:[g.jsx("div",{className:"text-muted-foreground",children:"Status"}),g.jsxs("div",{className:Se("font-medium flex items-center gap-2",f),children:[g.jsx("span",{className:Se("h-2 w-2 rounded-full",d==="up"?"bg-emerald-500":d==="down"?"bg-red-500":"bg-neutral-400")}),a.isPaused?"Paused":d.toUpperCase()]})]}),g.jsxs("div",{className:"flex justify-between items-end text-sm",children:[g.jsx("div",{className:"text-muted-foreground",children:"Response"}),g.jsx("div",{className:"font-medium",children:c?.pingMs?`${c.pingMs} ms`:"—"})]}),g.jsxs("div",{className:"space-y-1.5",children:[g.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[g.jsx("span",{children:"Uptime (24h)"}),g.jsxs("span",{className:u>=98?"text-emerald-500":"text-yellow-500",children:[Math.round(u),"%"]})]}),g.jsx("div",{className:"flex gap-[2px] h-6 items-end",children:l.slice(-20).map((p,m)=>g.jsx("div",{className:Se("w-1.5 rounded-sm opacity-80",p==="up"?"bg-emerald-500 h-4":p==="down"?"bg-red-500 h-4":"bg-neutral-300 dark:bg-neutral-700 h-4")},m))})]})]})]})}),ig=(e,t,n)=>{if(e&&"reportValidity"in e){const r=X(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Ed=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?ig(r.ref,n,e):r&&r.refs&&r.refs.forEach(s=>ig(s,n,e))}},ag=(e,t)=>{t.shouldUseNativeValidation&&Ed(e,t);const n={};for(const r in e){const s=X(t.fields,r),o=Object.assign(e[r]||{},{ref:s&&s.ref});if(qI(t.names||Object.keys(e),r)){const i=Object.assign({},X(n,r));ke(i,"root",o),ke(n,r,i)}else ke(n,r,o)}return n},qI=(e,t)=>{const n=cg(t);return e.some(r=>cg(r).match(`^${n}\\.\\d+`))};function cg(e){return e.replace(/\]|\[/g,"")}function U(e,t,n){function r(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const l=i.prototype,u=Object.keys(l);for(let d=0;d<u.length;d++){const f=u[d];f in a||(a[f]=l[f].bind(a))}}const s=n?.Parent??Object;class o extends s{}Object.defineProperty(o,"name",{value:e});function i(a){var c;const l=n?.Parent?new o:this;r(l,a),(c=l._zod).deferred??(c.deferred=[]);for(const u of l._zod.deferred)u();return l}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class Is extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class G_ extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Y_={};function ns(e){return Y_}function X_(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,s])=>t.indexOf(+r)===-1).map(([r,s])=>s)}function kd(e,t){return typeof t=="bigint"?t.toString():t}function rh(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function sh(e){return e==null}function oh(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function KI(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let s=(r.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(r)){const c=r.match(/\d?e-(\d?)/);c?.[1]&&(s=Number.parseInt(c[1]))}const o=n>s?n:s,i=Number.parseInt(e.toFixed(o).replace(".","")),a=Number.parseInt(t.toFixed(o).replace(".",""));return i%a/10**o}const lg=Symbol("evaluating");function Re(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==lg)return r===void 0&&(r=lg,r=n()),r},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function fs(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Sr(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function ug(e){return JSON.stringify(e)}function ZI(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const J_="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function vc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const GI=rh(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function oi(e){if(vc(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(vc(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Q_(e){return oi(e)?{...e}:Array.isArray(e)?[...e]:e}const YI=new Set(["string","number","symbol"]);function fl(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Er(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function ie(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function XI(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const JI={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function QI(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=Sr(e._zod.def,{get shape(){const i={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=n.shape[a])}return fs(this,"shape",i),i},checks:[]});return Er(e,o)}function ej(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=Sr(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return fs(this,"shape",i),i},checks:[]});return Er(e,o)}function tj(e,t){if(!oi(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const o=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Sr(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return fs(this,"shape",o),o}});return Er(e,s)}function nj(e,t){if(!oi(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Sr(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return fs(this,"shape",r),r}});return Er(e,n)}function rj(e,t){const n=Sr(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return fs(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Er(e,n)}function sj(e,t,n){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=Sr(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(n)for(const l in n){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(c[l]=e?new e({type:"optional",innerType:a[l]}):a[l])}else for(const l in a)c[l]=e?new e({type:"optional",innerType:a[l]}):a[l];return fs(this,"shape",c),c},checks:[]});return Er(t,i)}function oj(e,t,n){const r=Sr(t._zod.def,{get shape(){const s=t._zod.def.shape,o={...s};if(n)for(const i in n){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(o[i]=new e({type:"nonoptional",innerType:s[i]}))}else for(const i in s)o[i]=new e({type:"nonoptional",innerType:s[i]});return fs(this,"shape",o),o}});return Er(t,r)}function Cs(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ew(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function oa(e){return typeof e=="string"?e:e?.message}function rs(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const s=oa(e.inst?._zod.def?.error?.(e))??oa(t?.error?.(e))??oa(n.customError?.(e))??oa(n.localeError?.(e))??"Invalid input";r.message=s}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function ih(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ii(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const tw=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,kd,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ah=U("$ZodError",tw),hl=U("$ZodError",tw,{Parent:Error});function ij(e,t=n=>n.message){const n={},r=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}function aj(e,t=n=>n.message){const n={_errors:[]},r=s=>{for(const o of s.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(i=>r({issues:i}));else if(o.code==="invalid_key")r({issues:o.issues});else if(o.code==="invalid_element")r({issues:o.issues});else if(o.path.length===0)n._errors.push(t(o));else{let i=n,a=0;for(;a<o.path.length;){const c=o.path[a];a===o.path.length-1?(i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(o))):i[c]=i[c]||{_errors:[]},i=i[c],a++}}};return r(e),n}const pl=e=>(t,n,r,s)=>{const o=r?Object.assign(r,{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new Is;if(i.issues.length){const a=new(s?.Err??e)(i.issues.map(c=>rs(c,o,ns())));throw J_(a,s?.callee),a}return i.value},cj=pl(hl),ml=e=>async(t,n,r,s)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new(s?.Err??e)(i.issues.map(c=>rs(c,o,ns())));throw J_(a,s?.callee),a}return i.value},lj=ml(hl),gl=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},s);if(o instanceof Promise)throw new Is;return o.issues.length?{success:!1,error:new(e??ah)(o.issues.map(i=>rs(i,s,ns())))}:{success:!0,data:o.value}},uj=gl(hl),yl=e=>async(t,n,r)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},s);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(i=>rs(i,s,ns())))}:{success:!0,data:o.value}},dj=yl(hl),fj=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return pl(e)(t,n,s)},hj=e=>(t,n,r)=>pl(e)(t,n,r),pj=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ml(e)(t,n,s)},mj=e=>async(t,n,r)=>ml(e)(t,n,r),gj=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return gl(e)(t,n,s)},yj=e=>(t,n,r)=>gl(e)(t,n,r),bj=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return yl(e)(t,n,s)},vj=e=>async(t,n,r)=>yl(e)(t,n,r),xj=/^[cC][^\s-]{8,}$/,_j=/^[0-9a-z]+$/,wj=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Sj=/^[0-9a-vA-V]{20}$/,Ej=/^[A-Za-z0-9]{27}$/,kj=/^[a-zA-Z0-9_-]{21}$/,Cj=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Rj=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,dg=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Pj=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Oj="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Tj(){return new RegExp(Oj,"u")}const Mj=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Aj=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Nj=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Dj=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ij=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,nw=/^[A-Za-z0-9_-]*$/,jj=/^\+[1-9]\d{6,14}$/,rw="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Lj=new RegExp(`^${rw}$`);function sw(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Fj(e){return new RegExp(`^${sw(e)}$`)}function zj(e){const t=sw({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${rw}T(?:${r})$`)}const $j=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Vj=/^-?\d+$/,Bj=/^-?\d+(?:\.\d+)?$/,Uj=/^[^A-Z]*$/,Wj=/^[^a-z]*$/,jt=U("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ow={number:"number",bigint:"bigint",object:"date"},iw=U("$ZodCheckLessThan",(e,t)=>{jt.init(e,t);const n=ow[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,o=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),aw=U("$ZodCheckGreaterThan",(e,t)=>{jt.init(e,t);const n=ow[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,o=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Hj=U("$ZodCheckMultipleOf",(e,t)=>{jt.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):KI(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),qj=U("$ZodCheckNumberFormat",(e,t)=>{jt.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[s,o]=JI[t.format];e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,a.minimum=s,a.maximum=o,n&&(a.pattern=Vj)}),e._zod.check=i=>{const a=i.value;if(n){if(!Number.isInteger(a)){i.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}a<s&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),a>o&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Kj=U("$ZodCheckMaxLength",(e,t)=>{var n;jt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!sh(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const s=r.value;if(s.length<=t.maximum)return;const i=ih(s);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Zj=U("$ZodCheckMinLength",(e,t)=>{var n;jt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!sh(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const s=r.value;if(s.length>=t.minimum)return;const i=ih(s);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Gj=U("$ZodCheckLengthEquals",(e,t)=>{var n;jt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!sh(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=r=>{const s=r.value,o=s.length;if(o===t.length)return;const i=ih(s),a=o>t.length;r.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),bl=U("$ZodCheckStringFormat",(e,t)=>{var n,r;jt.init(e,t),e._zod.onattach.push(s=>{const o=s._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Yj=U("$ZodCheckRegex",(e,t)=>{bl.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Xj=U("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Uj),bl.init(e,t)}),Jj=U("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Wj),bl.init(e,t)}),Qj=U("$ZodCheckIncludes",(e,t)=>{jt.init(e,t);const n=fl(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(s=>{const o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),eL=U("$ZodCheckStartsWith",(e,t)=>{jt.init(e,t);const n=new RegExp(`^${fl(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),tL=U("$ZodCheckEndsWith",(e,t)=>{jt.init(e,t);const n=new RegExp(`.*${fl(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),nL=U("$ZodCheckOverwrite",(e,t)=>{jt.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class rL{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
62
|
-
`).filter(i=>i),
|
|
63
|
-
`))}}const
|
|
64
|
-
if (${
|
|
61
|
+
`)},PO=0,dr=[];function OO(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),o=y.useState(PO++)[0],s=y.useState(Km)[0],i=y.useRef(e);y.useEffect(function(){i.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=GP([e.lockRef.current],(e.shards||[]).map(yf),!0).filter(Boolean);return g.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=y.useCallback(function(g,v){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var b=os(g),_=n.current,w="deltaX"in g?g.deltaX:_[0]-b[0],x="deltaY"in g?g.deltaY:_[1]-b[1],S,P=g.target,C=Math.abs(w)>Math.abs(x)?"h":"v";if("touches"in g&&C==="h"&&P.type==="range")return!1;var E=window.getSelection(),A=E&&E.anchorNode,U=A?A===P||A.contains(P):!1;if(U)return!1;var B=mf(C,P);if(!B)return!0;if(B?S=C:(S=C==="v"?"h":"v",B=mf(C,P)),!B)return!1;if(!r.current&&"changedTouches"in g&&(w||x)&&(r.current=S),!S)return!0;var M=r.current||S;return EO(M,v,g,M==="h"?w:x)},[]),c=y.useCallback(function(g){var v=g;if(!(!dr.length||dr[dr.length-1]!==s)){var b="deltaY"in v?gf(v):os(v),_=t.current.filter(function(S){return S.name===v.type&&(S.target===v.target||v.target===S.shadowParent)&&CO(S.delta,b)})[0];if(_&&_.should){v.cancelable&&v.preventDefault();return}if(!_){var w=(i.current.shards||[]).map(yf).filter(Boolean).filter(function(S){return S.contains(v.target)}),x=w.length>0?a(v,w[0]):!i.current.noIsolation;x&&v.cancelable&&v.preventDefault()}}},[]),l=y.useCallback(function(g,v,b,_){var w={name:g,delta:v,target:b,should:_,shadowParent:kO(b)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(x){return x!==w})},1)},[]),d=y.useCallback(function(g){n.current=os(g),r.current=void 0},[]),u=y.useCallback(function(g){l(g.type,gf(g),g.target,a(g,e.lockRef.current))},[]),f=y.useCallback(function(g){l(g.type,os(g),g.target,a(g,e.lockRef.current))},[]);y.useEffect(function(){return dr.push(s),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:f}),document.addEventListener("wheel",c,ur),document.addEventListener("touchmove",c,ur),document.addEventListener("touchstart",d,ur),function(){dr=dr.filter(function(g){return g!==s}),document.removeEventListener("wheel",c,ur),document.removeEventListener("touchmove",c,ur),document.removeEventListener("touchstart",d,ur)}},[]);var h=e.removeScrollBar,m=e.inert;return y.createElement(y.Fragment,null,m?y.createElement(s,{styles:RO(o)}):null,h?y.createElement(yO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function kO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const NO=oO(Zm,OO);var Ni=y.forwardRef(function(e,t){return y.createElement(ki,Zt({},e,{ref:t,sideCar:NO}))});Ni.classNames=ki.classNames;var Rc=["Enter"," "],TO=["ArrowDown","PageUp","Home"],Jm=["ArrowUp","PageDown","End"],AO=[...TO,...Jm],IO={ltr:[...Rc,"ArrowRight"],rtl:[...Rc,"ArrowLeft"]},MO={ltr:["ArrowLeft"],rtl:["ArrowRight"]},To="Menu",[mo,DO,jO]=bl(To),[nr,Qm]=tr(To,[jO,Pi,Fm]),Ti=Pi(),Xm=Fm(),[LO,rr]=nr(To),[FO,Ao]=nr(To),eg=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=Ti(t),[c,l]=y.useState(null),d=y.useRef(!1),u=Yt(s),f=wl(o);return y.useEffect(()=>{const h=()=>{d.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>d.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),p.jsx(Im,{...a,children:p.jsx(LO,{scope:t,open:n,onOpenChange:u,content:c,onContentChange:l,children:p.jsx(FO,{scope:t,onClose:y.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:d,dir:f,modal:i,children:r})})})};eg.displayName=To;var $O="MenuAnchor",Tl=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Ti(n);return p.jsx(Mm,{...o,...r,ref:t})});Tl.displayName=$O;var Al="MenuPortal",[zO,tg]=nr(Al,{forceMount:void 0}),ng=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=rr(Al,t);return p.jsx(zO,{scope:t,forceMount:n,children:p.jsx(Cn,{present:n||s.open,children:p.jsx(Oi,{asChild:!0,container:o,children:r})})})};ng.displayName=Al;var Pt="MenuContent",[VO,Il]=nr(Pt),rg=y.forwardRef((e,t)=>{const n=tg(Pt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=rr(Pt,e.__scopeMenu),i=Ao(Pt,e.__scopeMenu);return p.jsx(mo.Provider,{scope:e.__scopeMenu,children:p.jsx(Cn,{present:r||s.open,children:p.jsx(mo.Slot,{scope:e.__scopeMenu,children:i.modal?p.jsx(UO,{...o,ref:t}):p.jsx(BO,{...o,ref:t})})})})}),UO=y.forwardRef((e,t)=>{const n=rr(Pt,e.__scopeMenu),r=y.useRef(null),o=xe(t,r);return y.useEffect(()=>{const s=r.current;if(s)return Nl(s)},[]),p.jsx(Ml,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:re(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),BO=y.forwardRef((e,t)=>{const n=rr(Pt,e.__scopeMenu);return p.jsx(Ml,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),WO=zP("MenuContent.ScrollLock"),Ml=y.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:f,onDismiss:h,disableOutsideScroll:m,...g}=e,v=rr(Pt,n),b=Ao(Pt,n),_=Ti(n),w=Xm(n),x=DO(n),[S,P]=y.useState(null),C=y.useRef(null),E=xe(t,C,v.onContentChange),A=y.useRef(0),U=y.useRef(""),B=y.useRef(0),M=y.useRef(null),j=y.useRef("right"),V=y.useRef(0),Y=m?Ni:y.Fragment,L=m?{as:WO,allowPinchZoom:!0}:void 0,K=H=>{const se=U.current+H,N=x().filter(F=>!F.disabled),Q=document.activeElement,W=N.find(F=>F.ref.current===Q)?.textValue,Z=N.map(F=>F.textValue),ie=nk(Z,se,W),fe=N.find(F=>F.textValue===ie)?.ref.current;(function F(ee){U.current=ee,window.clearTimeout(A.current),ee!==""&&(A.current=window.setTimeout(()=>F(""),1e3))})(se),fe&&setTimeout(()=>fe.focus())};y.useEffect(()=>()=>window.clearTimeout(A.current),[]),xl();const D=y.useCallback(H=>j.current===M.current?.side&&ok(H,M.current?.area),[]);return p.jsx(VO,{scope:n,searchRef:U,onItemEnter:y.useCallback(H=>{D(H)&&H.preventDefault()},[D]),onItemLeave:y.useCallback(H=>{D(H)||(C.current?.focus(),P(null))},[D]),onTriggerLeave:y.useCallback(H=>{D(H)&&H.preventDefault()},[D]),pointerGraceTimerRef:B,onPointerGraceIntentChange:y.useCallback(H=>{M.current=H},[]),children:p.jsx(Y,{...L,children:p.jsx(_i,{asChild:!0,trapped:o,onMountAutoFocus:re(s,H=>{H.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:p.jsx(xi,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:f,onDismiss:h,children:p.jsx(FP,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:P,onEntryFocus:re(c,H=>{b.isUsingKeyboardRef.current||H.preventDefault()}),preventScrollOnEntryFocus:!0,children:p.jsx(Dm,{role:"menu","aria-orientation":"vertical","data-state":bg(v.open),"data-radix-menu-content":"",dir:b.dir,..._,...g,ref:E,style:{outline:"none",...g.style},onKeyDown:re(g.onKeyDown,H=>{const N=H.target.closest("[data-radix-menu-content]")===H.currentTarget,Q=H.ctrlKey||H.altKey||H.metaKey,W=H.key.length===1;N&&(H.key==="Tab"&&H.preventDefault(),!Q&&W&&K(H.key));const Z=C.current;if(H.target!==Z||!AO.includes(H.key))return;H.preventDefault();const fe=x().filter(F=>!F.disabled).map(F=>F.ref.current);Jm.includes(H.key)&&fe.reverse(),ek(fe)}),onBlur:re(e.onBlur,H=>{H.currentTarget.contains(H.target)||(window.clearTimeout(A.current),U.current="")}),onPointerMove:re(e.onPointerMove,go(H=>{const se=H.target,N=V.current!==H.clientX;if(H.currentTarget.contains(se)&&N){const Q=H.clientX>V.current?"right":"left";j.current=Q,V.current=H.clientX}}))})})})})})})});rg.displayName=Pt;var HO="MenuGroup",Dl=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(ye.div,{role:"group",...r,ref:t})});Dl.displayName=HO;var ZO="MenuLabel",og=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(ye.div,{...r,ref:t})});og.displayName=ZO;var qs="MenuItem",vf="menu.itemSelect",Ai=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=y.useRef(null),i=Ao(qs,e.__scopeMenu),a=Il(qs,e.__scopeMenu),c=xe(t,s),l=y.useRef(!1),d=()=>{const u=s.current;if(!n&&u){const f=new CustomEvent(vf,{bubbles:!0,cancelable:!0});u.addEventListener(vf,h=>r?.(h),{once:!0}),cm(u,f),f.defaultPrevented?l.current=!1:i.onClose()}};return p.jsx(sg,{...o,ref:c,disabled:n,onClick:re(e.onClick,d),onPointerDown:u=>{e.onPointerDown?.(u),l.current=!0},onPointerUp:re(e.onPointerUp,u=>{l.current||u.currentTarget?.click()}),onKeyDown:re(e.onKeyDown,u=>{const f=a.searchRef.current!=="";n||f&&u.key===" "||Rc.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});Ai.displayName=qs;var sg=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=Il(qs,n),a=Xm(n),c=y.useRef(null),l=xe(t,c),[d,u]=y.useState(!1),[f,h]=y.useState("");return y.useEffect(()=>{const m=c.current;m&&h((m.textContent??"").trim())},[s.children]),p.jsx(mo.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:p.jsx($P,{asChild:!0,...a,focusable:!r,children:p.jsx(ye.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:l,onPointerMove:re(e.onPointerMove,go(m=>{r?i.onItemLeave(m):(i.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:re(e.onPointerLeave,go(m=>i.onItemLeave(m))),onFocus:re(e.onFocus,()=>u(!0)),onBlur:re(e.onBlur,()=>u(!1))})})})}),KO="MenuCheckboxItem",ig=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return p.jsx(dg,{scope:e.__scopeMenu,checked:n,children:p.jsx(Ai,{role:"menuitemcheckbox","aria-checked":Gs(n)?"mixed":n,...o,ref:t,"data-state":Ll(n),onSelect:re(o.onSelect,()=>r?.(Gs(n)?!0:!n),{checkForDefaultPrevented:!1})})})});ig.displayName=KO;var ag="MenuRadioGroup",[qO,GO]=nr(ag,{value:void 0,onValueChange:()=>{}}),cg=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=Yt(r);return p.jsx(qO,{scope:e.__scopeMenu,value:n,onValueChange:s,children:p.jsx(Dl,{...o,ref:t})})});cg.displayName=ag;var lg="MenuRadioItem",ug=y.forwardRef((e,t)=>{const{value:n,...r}=e,o=GO(lg,e.__scopeMenu),s=n===o.value;return p.jsx(dg,{scope:e.__scopeMenu,checked:s,children:p.jsx(Ai,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":Ll(s),onSelect:re(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});ug.displayName=lg;var jl="MenuItemIndicator",[dg,YO]=nr(jl,{checked:!1}),fg=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=YO(jl,n);return p.jsx(Cn,{present:r||Gs(s.checked)||s.checked===!0,children:p.jsx(ye.span,{...o,ref:t,"data-state":Ll(s.checked)})})});fg.displayName=jl;var JO="MenuSeparator",hg=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(ye.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});hg.displayName=JO;var QO="MenuArrow",pg=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Ti(n);return p.jsx(jm,{...o,...r,ref:t})});pg.displayName=QO;var XO="MenuSub",[LD,mg]=nr(XO),qr="MenuSubTrigger",gg=y.forwardRef((e,t)=>{const n=rr(qr,e.__scopeMenu),r=Ao(qr,e.__scopeMenu),o=mg(qr,e.__scopeMenu),s=Il(qr,e.__scopeMenu),i=y.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=s,l={__scopeMenu:e.__scopeMenu},d=y.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return y.useEffect(()=>d,[d]),y.useEffect(()=>{const u=a.current;return()=>{window.clearTimeout(u),c(null)}},[a,c]),p.jsx(Tl,{asChild:!0,...l,children:p.jsx(sg,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":bg(n.open),...e,ref:ln(t,o.onTriggerChange),onClick:u=>{e.onClick?.(u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:re(e.onPointerMove,go(u=>{s.onItemEnter(u),!u.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:re(e.onPointerLeave,go(u=>{d();const f=n.content?.getBoundingClientRect();if(f){const h=n.content?.dataset.side,m=h==="right",g=m?-5:5,v=f[m?"left":"right"],b=f[m?"right":"left"];s.onPointerGraceIntentChange({area:[{x:u.clientX+g,y:u.clientY},{x:v,y:f.top},{x:b,y:f.top},{x:b,y:f.bottom},{x:v,y:f.bottom}],side:h}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(u),u.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:re(e.onKeyDown,u=>{const f=s.searchRef.current!=="";e.disabled||f&&u.key===" "||IO[r.dir].includes(u.key)&&(n.onOpenChange(!0),n.content?.focus(),u.preventDefault())})})})});gg.displayName=qr;var yg="MenuSubContent",vg=y.forwardRef((e,t)=>{const n=tg(Pt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=rr(Pt,e.__scopeMenu),i=Ao(Pt,e.__scopeMenu),a=mg(yg,e.__scopeMenu),c=y.useRef(null),l=xe(t,c);return p.jsx(mo.Provider,{scope:e.__scopeMenu,children:p.jsx(Cn,{present:r||s.open,children:p.jsx(mo.Slot,{scope:e.__scopeMenu,children:p.jsx(Ml,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:l,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{i.isUsingKeyboardRef.current&&c.current?.focus(),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:re(e.onFocusOutside,d=>{d.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:re(e.onEscapeKeyDown,d=>{i.onClose(),d.preventDefault()}),onKeyDown:re(e.onKeyDown,d=>{const u=d.currentTarget.contains(d.target),f=MO[i.dir].includes(d.key);u&&f&&(s.onOpenChange(!1),a.trigger?.focus(),d.preventDefault())})})})})})});vg.displayName=yg;function bg(e){return e?"open":"closed"}function Gs(e){return e==="indeterminate"}function Ll(e){return Gs(e)?"indeterminate":e?"checked":"unchecked"}function ek(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function tk(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function nk(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=tk(e,Math.max(s,0));o.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function rk(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],l=a.x,d=a.y,u=c.x,f=c.y;d>r!=f>r&&n<(u-l)*(r-d)/(f-d)+l&&(o=!o)}return o}function ok(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return rk(n,t)}function go(e){return t=>t.pointerType==="mouse"?e(t):void 0}var sk=eg,ik=Tl,ak=ng,ck=rg,lk=Dl,uk=og,dk=Ai,fk=ig,hk=cg,pk=ug,mk=fg,gk=hg,yk=pg,vk=gg,bk=vg,Ii="DropdownMenu",[wk]=tr(Ii,[Qm]),et=Qm(),[xk,wg]=wk(Ii),xg=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,c=et(t),l=y.useRef(null),[d,u]=ho({prop:o,defaultProp:s??!1,onChange:i,caller:Ii});return p.jsx(xk,{scope:t,triggerId:rn(),triggerRef:l,contentId:rn(),open:d,onOpenChange:u,onOpenToggle:y.useCallback(()=>u(f=>!f),[u]),modal:a,children:p.jsx(sk,{...c,open:d,onOpenChange:u,dir:r,modal:a,children:n})})};xg.displayName=Ii;var _g="DropdownMenuTrigger",Sg=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=wg(_g,n),i=et(n);return p.jsx(ik,{asChild:!0,...i,children:p.jsx(ye.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:ln(t,s.triggerRef),onPointerDown:re(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:re(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});Sg.displayName=_g;var _k="DropdownMenuPortal",Eg=e=>{const{__scopeDropdownMenu:t,...n}=e,r=et(t);return p.jsx(ak,{...r,...n})};Eg.displayName=_k;var Cg="DropdownMenuContent",Rg=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=wg(Cg,n),s=et(n),i=y.useRef(!1);return p.jsx(ck,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:re(e.onCloseAutoFocus,a=>{i.current||o.triggerRef.current?.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:re(e.onInteractOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,d=c.button===2||l;(!o.modal||d)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Rg.displayName=Cg;var Sk="DropdownMenuGroup",Ek=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=et(n);return p.jsx(lk,{...o,...r,ref:t})});Ek.displayName=Sk;var Ck="DropdownMenuLabel",Rk=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=et(n);return p.jsx(uk,{...o,...r,ref:t})});Rk.displayName=Ck;var Pk="DropdownMenuItem",Pg=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=et(n);return p.jsx(dk,{...o,...r,ref:t})});Pg.displayName=Pk;var Ok="DropdownMenuCheckboxItem",kk=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=et(n);return p.jsx(fk,{...o,...r,ref:t})});kk.displayName=Ok;var Nk="DropdownMenuRadioGroup",Tk=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=et(n);return p.jsx(hk,{...o,...r,ref:t})});Tk.displayName=Nk;var Ak="DropdownMenuRadioItem",Ik=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=et(n);return p.jsx(pk,{...o,...r,ref:t})});Ik.displayName=Ak;var Mk="DropdownMenuItemIndicator",Dk=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=et(n);return p.jsx(mk,{...o,...r,ref:t})});Dk.displayName=Mk;var jk="DropdownMenuSeparator",Lk=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=et(n);return p.jsx(gk,{...o,...r,ref:t})});Lk.displayName=jk;var Fk="DropdownMenuArrow",$k=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=et(n);return p.jsx(yk,{...o,...r,ref:t})});$k.displayName=Fk;var zk="DropdownMenuSubTrigger",Vk=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=et(n);return p.jsx(vk,{...o,...r,ref:t})});Vk.displayName=zk;var Uk="DropdownMenuSubContent",Bk=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=et(n);return p.jsx(bk,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Bk.displayName=Uk;var Wk=xg,Hk=Sg,Zk=Eg,Kk=Rg,qk=Pg;function Gk({...e}){return p.jsx(Wk,{"data-slot":"dropdown-menu",...e})}function Yk({...e}){return p.jsx(Hk,{"data-slot":"dropdown-menu-trigger",...e})}function Jk({className:e,sideOffset:t=4,...n}){return p.jsx(Zk,{children:p.jsx(Kk,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Ee("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function ss({className:e,inset:t,variant:n="default",...r}){return p.jsx(qk,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Ee("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:ps-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}const Qk=e=>{switch(e.toLowerCase()){case"http":return p.jsx(KE,{size:20});case"ping":return p.jsx(xa,{size:20});case"tcp":return p.jsx(uC,{size:20});case"dns":return p.jsx(cC,{size:20});case"keyword":return p.jsx(rm,{size:20});case"json_query":return p.jsx(BE,{size:20});case"push":return p.jsx(iC,{size:20});case"steam":return p.jsx(xa,{size:20});default:return p.jsx(xa,{size:20})}},Xk=k.memo(function({summary:t,onEdit:n,onDelete:r,onPause:o,onClone:s,onDetails:i}){const{monitor:a,latest:c,bars:l,uptimePct:d}=t,u=c?.status??"unknown",f=u==="up"?"text-emerald-500":u==="down"?"text-red-500":"text-muted-foreground",h=u==="up"?"hover:border-emerald-500/50":u==="down"?"hover:border-red-500/50":"hover:border-neutral-500/50";return p.jsxs("div",{className:Ee("bg-card hover:bg-muted/50 relative cursor-pointer rounded-lg border p-4 transition-all duration-200 hover:shadow-sm flex flex-col justify-between",h),onClick:()=>i(a),children:[p.jsxs("div",{className:"flex items-start justify-between mb-4",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("div",{className:"bg-muted flex size-10 items-center justify-center rounded-lg p-2 text-muted-foreground",children:Qk(a.type)}),p.jsxs("div",{children:[p.jsx("h3",{className:"font-semibold line-clamp-1",children:a.name}),p.jsxs("div",{className:"text-xs text-muted-foreground flex items-center gap-2",children:[p.jsx("span",{className:"uppercase",children:a.type}),p.jsx("span",{children:"•"}),p.jsxs("span",{children:[a.intervalSeconds,"s"]})]})]})]}),p.jsxs(Gk,{children:[p.jsx(Yk,{asChild:!0,children:p.jsx(qn,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground",onClick:m=>m.stopPropagation(),children:p.jsx(HE,{className:"h-4 w-4"})})}),p.jsxs(Jk,{align:"end",children:[p.jsxs(ss,{onClick:m=>{m.stopPropagation(),n(a)},children:[p.jsx(eC,{className:"mr-2 h-4 w-4"})," Edit"]}),p.jsxs(ss,{onClick:m=>{m.stopPropagation(),s(a)},children:[p.jsx(VE,{className:"mr-2 h-4 w-4"})," Clone"]}),p.jsxs(ss,{onClick:m=>{m.stopPropagation(),o(a)},children:[a.isPaused?p.jsx(nC,{className:"mr-2 h-4 w-4"}):p.jsx(QE,{className:"mr-2 h-4 w-4"}),a.isPaused?"Resume":"Pause"]}),p.jsxs(ss,{className:"text-red-600",onClick:m=>{m.stopPropagation(),r(a)},children:[p.jsx(om,{className:"mr-2 h-4 w-4"})," Delete"]})]})]})]}),p.jsxs("div",{className:"space-y-4 mb-2",children:[p.jsxs("div",{className:"flex justify-between items-end text-sm",children:[p.jsx("div",{className:"text-muted-foreground",children:"Status"}),p.jsxs("div",{className:Ee("font-medium flex items-center gap-2",f),children:[p.jsx("span",{className:Ee("h-2 w-2 rounded-full",u==="up"?"bg-emerald-500":u==="down"?"bg-red-500":"bg-neutral-400")}),a.isPaused?"Paused":u.toUpperCase()]})]}),p.jsxs("div",{className:"flex justify-between items-end text-sm",children:[p.jsx("div",{className:"text-muted-foreground",children:"Response"}),p.jsx("div",{className:"font-medium",children:c?.pingMs?`${c.pingMs} ms`:"—"})]}),p.jsxs("div",{className:"space-y-1.5",children:[p.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[p.jsx("span",{children:"Uptime (24h)"}),p.jsxs("span",{className:d>=98?"text-emerald-500":"text-yellow-500",children:[Math.round(d),"%"]})]}),p.jsx("div",{className:"flex gap-[2px] h-6 items-end",children:l.slice(-20).map((m,g)=>p.jsx("div",{className:Ee("w-1.5 rounded-sm opacity-80",m==="up"?"bg-emerald-500 h-4":m==="down"?"bg-red-500 h-4":"bg-neutral-300 dark:bg-neutral-700 h-4")},g))})]})]})]})}),bf=(e,t,n)=>{if(e&&"reportValidity"in e){const r=G(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Pc=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?bf(r.ref,n,e):r&&r.refs&&r.refs.forEach(o=>bf(o,n,e))}},wf=(e,t)=>{t.shouldUseNativeValidation&&Pc(e,t);const n={};for(const r in e){const o=G(t.fields,r),s=Object.assign(e[r]||{},{ref:o&&o.ref});if(eN(t.names||Object.keys(e),r)){const i=Object.assign({},G(n,r));ve(i,"root",s),ve(n,r,i)}else ve(n,r,s)}return n},eN=(e,t)=>{const n=xf(t);return e.some(r=>xf(r).match(`^${n}\\.\\d+`))};function xf(e){return e.replace(/\]|\[/g,"")}function z(e,t,n){function r(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const l=i.prototype,d=Object.keys(l);for(let u=0;u<d.length;u++){const f=d[u];f in a||(a[f]=l[f].bind(a))}}const o=n?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(a){var c;const l=n?.Parent?new s:this;r(l,a),(c=l._zod).deferred??(c.deferred=[]);for(const d of l._zod.deferred)d();return l}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class wr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Og extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const kg={};function Yn(e){return kg}function Ng(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function Oc(e,t){return typeof t=="bigint"?t.toString():t}function Fl(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function $l(e){return e==null}function zl(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function tN(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let o=(r.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(r)){const c=r.match(/\d?e-(\d?)/);c?.[1]&&(o=Number.parseInt(c[1]))}const s=n>o?n:o,i=Number.parseInt(e.toFixed(s).replace(".","")),a=Number.parseInt(t.toFixed(s).replace(".",""));return i%a/10**s}const _f=Symbol("evaluating");function be(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==_f)return r===void 0&&(r=_f,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function or(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Rn(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Sf(e){return JSON.stringify(e)}function nN(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Tg="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ys(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const rN=Fl(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function yo(e){if(Ys(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Ys(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Ag(e){return yo(e)?{...e}:Array.isArray(e)?[...e]:e}const oN=new Set(["string","number","symbol"]);function Mi(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Pn(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function oe(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function sN(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const iN={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function aN(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=Rn(e._zod.def,{get shape(){const i={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=n.shape[a])}return or(this,"shape",i),i},checks:[]});return Pn(e,s)}function cN(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=Rn(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return or(this,"shape",i),i},checks:[]});return Pn(e,s)}function lN(e,t){if(!yo(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Rn(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return or(this,"shape",s),s}});return Pn(e,o)}function uN(e,t){if(!yo(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Rn(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return or(this,"shape",r),r}});return Pn(e,n)}function dN(e,t){const n=Rn(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return or(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Pn(e,n)}function fN(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=Rn(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(n)for(const l in n){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(c[l]=e?new e({type:"optional",innerType:a[l]}):a[l])}else for(const l in a)c[l]=e?new e({type:"optional",innerType:a[l]}):a[l];return or(this,"shape",c),c},checks:[]});return Pn(t,i)}function hN(e,t,n){const r=Rn(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(n)for(const i in n){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(s[i]=new e({type:"nonoptional",innerType:o[i]}))}else for(const i in o)s[i]=new e({type:"nonoptional",innerType:o[i]});return or(this,"shape",s),s}});return Pn(t,r)}function mr(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Ig(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function is(e){return typeof e=="string"?e:e?.message}function Jn(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=is(e.inst?._zod.def?.error?.(e))??is(t?.error?.(e))??is(n.customError?.(e))??is(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Vl(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function vo(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const Mg=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Oc,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ul=z("$ZodError",Mg),Di=z("$ZodError",Mg,{Parent:Error});function pN(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function mN(e,t=n=>n.message){const n={_errors:[]},r=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(i=>r({issues:i}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let i=n,a=0;for(;a<s.path.length;){const c=s.path[a];a===s.path.length-1?(i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(s))):i[c]=i[c]||{_errors:[]},i=i[c],a++}}};return r(e),n}const ji=e=>(t,n,r,o)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new wr;if(i.issues.length){const a=new(o?.Err??e)(i.issues.map(c=>Jn(c,s,Yn())));throw Tg(a,o?.callee),a}return i.value},gN=ji(Di),Li=e=>async(t,n,r,o)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new(o?.Err??e)(i.issues.map(c=>Jn(c,s,Yn())));throw Tg(a,o?.callee),a}return i.value},yN=Li(Di),Fi=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new wr;return s.issues.length?{success:!1,error:new(e??Ul)(s.issues.map(i=>Jn(i,o,Yn())))}:{success:!0,data:s.value}},vN=Fi(Di),$i=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>Jn(i,o,Yn())))}:{success:!0,data:s.value}},bN=$i(Di),wN=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ji(e)(t,n,o)},xN=e=>(t,n,r)=>ji(e)(t,n,r),_N=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Li(e)(t,n,o)},SN=e=>async(t,n,r)=>Li(e)(t,n,r),EN=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Fi(e)(t,n,o)},CN=e=>(t,n,r)=>Fi(e)(t,n,r),RN=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return $i(e)(t,n,o)},PN=e=>async(t,n,r)=>$i(e)(t,n,r),ON=/^[cC][^\s-]{8,}$/,kN=/^[0-9a-z]+$/,NN=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,TN=/^[0-9a-vA-V]{20}$/,AN=/^[A-Za-z0-9]{27}$/,IN=/^[a-zA-Z0-9_-]{21}$/,MN=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,DN=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ef=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,jN=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,LN="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function FN(){return new RegExp(LN,"u")}const $N=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,zN=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,VN=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,UN=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,BN=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Dg=/^[A-Za-z0-9_-]*$/,WN=/^\+[1-9]\d{6,14}$/,jg="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",HN=new RegExp(`^${jg}$`);function Lg(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ZN(e){return new RegExp(`^${Lg(e)}$`)}function KN(e){const t=Lg({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${jg}T(?:${r})$`)}const qN=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},GN=/^-?\d+$/,YN=/^-?\d+(?:\.\d+)?$/,JN=/^[^A-Z]*$/,QN=/^[^a-z]*$/,at=z("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Fg={number:"number",bigint:"bigint",object:"date"},$g=z("$ZodCheckLessThan",(e,t)=>{at.init(e,t);const n=Fg[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),zg=z("$ZodCheckGreaterThan",(e,t)=>{at.init(e,t);const n=Fg[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),XN=z("$ZodCheckMultipleOf",(e,t)=>{at.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):tN(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),eT=z("$ZodCheckNumberFormat",(e,t)=>{at.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,s]=iN[t.format];e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,a.minimum=o,a.maximum=s,n&&(a.pattern=GN)}),e._zod.check=i=>{const a=i.value;if(n){if(!Number.isInteger(a)){i.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),tT=z("$ZodCheckMaxLength",(e,t)=>{var n;at.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!$l(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const i=Vl(o);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),nT=z("$ZodCheckMinLength",(e,t)=>{var n;at.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!$l(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const i=Vl(o);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),rT=z("$ZodCheckLengthEquals",(e,t)=>{var n;at.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!$l(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,s=o.length;if(s===t.length)return;const i=Vl(o),a=s>t.length;r.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),zi=z("$ZodCheckStringFormat",(e,t)=>{var n,r;at.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),oT=z("$ZodCheckRegex",(e,t)=>{zi.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),sT=z("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=JN),zi.init(e,t)}),iT=z("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=QN),zi.init(e,t)}),aT=z("$ZodCheckIncludes",(e,t)=>{at.init(e,t);const n=Mi(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),cT=z("$ZodCheckStartsWith",(e,t)=>{at.init(e,t);const n=new RegExp(`^${Mi(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),lT=z("$ZodCheckEndsWith",(e,t)=>{at.init(e,t);const n=new RegExp(`.*${Mi(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),uT=z("$ZodCheckOverwrite",(e,t)=>{at.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class dT{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
62
|
+
`).filter(i=>i),o=Math.min(...r.map(i=>i.length-i.trimStart().length)),s=r.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(const i of s)this.content.push(i)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...n,o.join(`
|
|
63
|
+
`))}}const fT={major:4,minor:3,patch:6},Me=z("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=fT;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const s of o._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(i,a,c)=>{let l=mr(i),d;for(const u of a){if(u._zod.def.when){if(!u._zod.def.when(i))continue}else if(l)continue;const f=i.issues.length,h=u._zod.check(i);if(h instanceof Promise&&c?.async===!1)throw new wr;if(d||h instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await h,i.issues.length!==f&&(l||(l=mr(i,f)))});else{if(i.issues.length===f)continue;l||(l=mr(i,f))}}return d?d.then(()=>i):i},s=(i,a,c)=>{if(mr(i))return i.aborted=!0,i;const l=o(a,r,c);if(l instanceof Promise){if(c.async===!1)throw new wr;return l.then(d=>e._zod.parse(d,c))}return e._zod.parse(l,c)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction==="backward"){const l=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return l instanceof Promise?l.then(d=>s(d,i,a)):s(l,i,a)}const c=e._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new wr;return c.then(l=>o(l,r,a))}return o(c,r,a)}}be(e,"~standard",()=>({validate:o=>{try{const s=vN(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return bN(e,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),Bl=z("$ZodString",(e,t)=>{Me.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??qN(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Se=z("$ZodStringFormat",(e,t)=>{zi.init(e,t),Bl.init(e,t)}),hT=z("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=DN),Se.init(e,t)}),pT=z("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ef(r))}else t.pattern??(t.pattern=Ef());Se.init(e,t)}),mT=z("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=jN),Se.init(e,t)}),gT=z("$ZodURL",(e,t)=>{Se.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),yT=z("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=FN()),Se.init(e,t)}),vT=z("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=IN),Se.init(e,t)}),bT=z("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ON),Se.init(e,t)}),wT=z("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=kN),Se.init(e,t)}),xT=z("$ZodULID",(e,t)=>{t.pattern??(t.pattern=NN),Se.init(e,t)}),_T=z("$ZodXID",(e,t)=>{t.pattern??(t.pattern=TN),Se.init(e,t)}),ST=z("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=AN),Se.init(e,t)}),ET=z("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=KN(t)),Se.init(e,t)}),CT=z("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=HN),Se.init(e,t)}),RT=z("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=ZN(t)),Se.init(e,t)}),PT=z("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=MN),Se.init(e,t)}),OT=z("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=$N),Se.init(e,t),e._zod.bag.format="ipv4"}),kT=z("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=zN),Se.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),NT=z("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=VN),Se.init(e,t)}),TT=z("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=UN),Se.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[o,s]=r;if(!s)throw new Error;const i=Number(s);if(`${i}`!==s)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Vg(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const AT=z("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=BN),Se.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Vg(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function IT(e){if(!Dg.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Vg(n)}const MT=z("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Dg),Se.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{IT(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),DT=z("$ZodE164",(e,t)=>{t.pattern??(t.pattern=WN),Se.init(e,t)});function jT(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const LT=z("$ZodJWT",(e,t)=>{Se.init(e,t),e._zod.check=n=>{jT(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Ug=z("$ZodNumber",(e,t)=>{Me.init(e,t),e._zod.pattern=e._zod.bag.pattern??YN,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}}),FT=z("$ZodNumberFormat",(e,t)=>{eT.init(e,t),Ug.init(e,t)}),$T=z("$ZodUnknown",(e,t)=>{Me.init(e,t),e._zod.parse=n=>n}),zT=z("$ZodNever",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Cf(e,t,n){e.issues.length&&t.issues.push(...Ig(n,e.issues)),t.value[n]=e.value}const VT=z("$ZodArray",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const s=[];for(let i=0;i<o.length;i++){const a=o[i],c=t.element._zod.run({value:a,issues:[]},r);c instanceof Promise?s.push(c.then(l=>Cf(l,n,i))):Cf(c,n,i)}return s.length?Promise.all(s).then(()=>n):n}});function Js(e,t,n,r,o){if(e.issues.length){if(o&&!(n in r))return;t.issues.push(...Ig(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Bg(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=sN(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Wg(e,t,n,r,o,s){const i=[],a=o.keySet,c=o.catchall._zod,l=c.def.type,d=c.optout==="optional";for(const u in t){if(a.has(u))continue;if(l==="never"){i.push(u);continue}const f=c.run({value:t[u],issues:[]},r);f instanceof Promise?e.push(f.then(h=>Js(h,n,u,t,d))):Js(f,n,u,t,d)}return i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const UT=z("$ZodObject",(e,t)=>{if(Me.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}const r=Fl(()=>Bg(t));be(e._zod,"propValues",()=>{const a=t.shape,c={};for(const l in a){const d=a[l]._zod;if(d.values){c[l]??(c[l]=new Set);for(const u of d.values)c[l].add(u)}}return c});const o=Ys,s=t.catchall;let i;e._zod.parse=(a,c)=>{i??(i=r.value);const l=a.value;if(!o(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),a;a.value={};const d=[],u=i.shape;for(const f of i.keys){const h=u[f],m=h._zod.optout==="optional",g=h._zod.run({value:l[f],issues:[]},c);g instanceof Promise?d.push(g.then(v=>Js(v,a,f,l,m))):Js(g,a,f,l,m)}return s?Wg(d,l,a,c,r.value,e):d.length?Promise.all(d).then(()=>a):a}}),BT=z("$ZodObjectJIT",(e,t)=>{UT.init(e,t);const n=e._zod.parse,r=Fl(()=>Bg(t)),o=f=>{const h=new dT(["shape","payload","ctx"]),m=r.value,g=w=>{const x=Sf(w);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};h.write("const input = payload.value;");const v=Object.create(null);let b=0;for(const w of m.keys)v[w]=`key_${b++}`;h.write("const newResult = {};");for(const w of m.keys){const x=v[w],S=Sf(w),C=f[w]?._zod?.optout==="optional";h.write(`const ${x} = ${g(w)};`),C?h.write(`
|
|
64
|
+
if (${x}.issues.length) {
|
|
65
65
|
if (${S} in input) {
|
|
66
|
-
payload.issues = payload.issues.concat(${
|
|
66
|
+
payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
|
|
67
67
|
...iss,
|
|
68
68
|
path: iss.path ? [${S}, ...iss.path] : [${S}]
|
|
69
69
|
})));
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
if (${
|
|
73
|
+
if (${x}.value === undefined) {
|
|
74
74
|
if (${S} in input) {
|
|
75
75
|
newResult[${S}] = undefined;
|
|
76
76
|
}
|
|
77
77
|
} else {
|
|
78
|
-
newResult[${S}] = ${
|
|
78
|
+
newResult[${S}] = ${x}.value;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
`):h.write(`
|
|
82
|
-
if (${
|
|
83
|
-
payload.issues = payload.issues.concat(${
|
|
82
|
+
if (${x}.issues.length) {
|
|
83
|
+
payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
|
|
84
84
|
...iss,
|
|
85
85
|
path: iss.path ? [${S}, ...iss.path] : [${S}]
|
|
86
86
|
})));
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
if (${
|
|
89
|
+
if (${x}.value === undefined) {
|
|
90
90
|
if (${S} in input) {
|
|
91
91
|
newResult[${S}] = undefined;
|
|
92
92
|
}
|
|
93
93
|
} else {
|
|
94
|
-
newResult[${S}] = ${
|
|
94
|
+
newResult[${S}] = ${x}.value;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
`)}h.write("payload.value = newResult;"),h.write("return payload;");const x=h.compile();return(_,w)=>x(f,_,w)};let o;const i=vc,a=!Y_.jitless,l=a&&GI.value,u=t.catchall;let d;e._zod.parse=(f,h)=>{d??(d=r.value);const p=f.value;return i(p)?a&&l&&h?.async===!1&&h.jitless!==!0?(o||(o=s(t.shape)),f=o(f,h),u?dw([],p,f,h,d,e):f):n(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),f)}});function hg(e,t,n,r){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const s=e.filter(o=>!Cs(o));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(i=>rs(i,r,ns())))}),t)}const jL=U("$ZodUnion",(e,t)=>{Qe.init(e,t),Re(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),Re(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),Re(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),Re(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${s.map(o=>oh(o.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(s,o)=>{if(n)return r(s,o);let i=!1;const a=[];for(const c of t.options){const l=c._zod.run({value:s.value,issues:[]},o);if(l instanceof Promise)a.push(l),i=!0;else{if(l.issues.length===0)return l;a.push(l)}}return i?Promise.all(a).then(c=>hg(c,s,e,o)):hg(a,s,e,o)}}),LL=U("$ZodIntersection",(e,t)=>{Qe.init(e,t),e._zod.parse=(n,r)=>{const s=n.value,o=t.left._zod.run({value:s,issues:[]},r),i=t.right._zod.run({value:s,issues:[]},r);return o instanceof Promise||i instanceof Promise?Promise.all([o,i]).then(([c,l])=>pg(n,c,l)):pg(n,o,i)}});function Cd(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(oi(e)&&oi(t)){const n=Object.keys(t),r=Object.keys(e).filter(o=>n.indexOf(o)!==-1),s={...e,...t};for(const o of r){const i=Cd(e[o],t[o]);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};s[o]=i.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=e[r],o=t[r],i=Cd(s,o);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function pg(e,t,n){const r=new Map;let s;for(const a of t.issues)if(a.code==="unrecognized_keys"){s??(s=a);for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else e.issues.push(a);const o=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&s&&e.issues.push({...s,keys:o}),Cs(e))return e;const i=Cd(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const FL=U("$ZodEnum",(e,t)=>{Qe.init(e,t);const n=X_(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(s=>YI.has(typeof s)).map(s=>typeof s=="string"?fl(s):s.toString()).join("|")})$`),e._zod.parse=(s,o)=>{const i=s.value;return r.has(i)||s.issues.push({code:"invalid_value",values:n,input:i,inst:e}),s}}),zL=U("$ZodTransform",(e,t)=>{Qe.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new G_(e.constructor.name);const s=t.transform(n.value,n);if(r.async)return(s instanceof Promise?s:Promise.resolve(s)).then(i=>(n.value=i,n));if(s instanceof Promise)throw new Is;return n.value=s,n}});function mg(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const fw=U("$ZodOptional",(e,t)=>{Qe.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Re(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Re(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${oh(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(o=>mg(o,n.value)):mg(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),$L=U("$ZodExactOptional",(e,t)=>{fw.init(e,t),Re(e._zod,"values",()=>t.innerType._zod.values),Re(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),VL=U("$ZodNullable",(e,t)=>{Qe.init(e,t),Re(e._zod,"optin",()=>t.innerType._zod.optin),Re(e._zod,"optout",()=>t.innerType._zod.optout),Re(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${oh(n.source)}|null)$`):void 0}),Re(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),BL=U("$ZodDefault",(e,t)=>{Qe.init(e,t),e._zod.optin="optional",Re(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(o=>gg(o,t)):gg(s,t)}});function gg(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const UL=U("$ZodPrefault",(e,t)=>{Qe.init(e,t),e._zod.optin="optional",Re(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),WL=U("$ZodNonOptional",(e,t)=>{Qe.init(e,t),Re(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(o=>yg(o,e)):yg(s,e)}});function yg(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const HL=U("$ZodCatch",(e,t)=>{Qe.init(e,t),Re(e._zod,"optin",()=>t.innerType._zod.optin),Re(e._zod,"optout",()=>t.innerType._zod.optout),Re(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(o=>(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(i=>rs(i,r,ns()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(o=>rs(o,r,ns()))},input:n.value}),n.issues=[]),n)}}),qL=U("$ZodPipe",(e,t)=>{Qe.init(e,t),Re(e._zod,"values",()=>t.in._zod.values),Re(e._zod,"optin",()=>t.in._zod.optin),Re(e._zod,"optout",()=>t.out._zod.optout),Re(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const o=t.out._zod.run(n,r);return o instanceof Promise?o.then(i=>ia(i,t.in,r)):ia(o,t.in,r)}const s=t.in._zod.run(n,r);return s instanceof Promise?s.then(o=>ia(o,t.out,r)):ia(s,t.out,r)}});function ia(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const KL=U("$ZodReadonly",(e,t)=>{Qe.init(e,t),Re(e._zod,"propValues",()=>t.innerType._zod.propValues),Re(e._zod,"values",()=>t.innerType._zod.values),Re(e._zod,"optin",()=>t.innerType?._zod?.optin),Re(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(bg):bg(s)}});function bg(e){return e.value=Object.freeze(e.value),e}const ZL=U("$ZodCustom",(e,t)=>{jt.init(e,t),Qe.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then(o=>vg(o,n,r,e));vg(s,n,r,e)}});function vg(e,t,n,r){if(!e){const s={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(s.params=r._zod.def.params),t.issues.push(ii(s))}}var xg;class GL{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const s={...r,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function YL(){return new GL}(xg=globalThis).__zod_globalRegistry??(xg.__zod_globalRegistry=YL());const Oo=globalThis.__zod_globalRegistry;function XL(e,t){return new e({type:"string",...ie(t)})}function JL(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ie(t)})}function _g(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ie(t)})}function QL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ie(t)})}function eF(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ie(t)})}function tF(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ie(t)})}function nF(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ie(t)})}function rF(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ie(t)})}function sF(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ie(t)})}function oF(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ie(t)})}function iF(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ie(t)})}function aF(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ie(t)})}function cF(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ie(t)})}function lF(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ie(t)})}function uF(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ie(t)})}function dF(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ie(t)})}function fF(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ie(t)})}function hF(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ie(t)})}function pF(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ie(t)})}function mF(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ie(t)})}function gF(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ie(t)})}function yF(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ie(t)})}function bF(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ie(t)})}function vF(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ie(t)})}function xF(e,t){return new e({type:"string",format:"date",check:"string_format",...ie(t)})}function _F(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ie(t)})}function wF(e,t){return new e({type:"string",format:"duration",check:"string_format",...ie(t)})}function SF(e,t){return new e({type:"number",coerce:!0,checks:[],...ie(t)})}function EF(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ie(t)})}function kF(e){return new e({type:"unknown"})}function CF(e,t){return new e({type:"never",...ie(t)})}function wg(e,t){return new iw({check:"less_than",...ie(t),value:e,inclusive:!1})}function vu(e,t){return new iw({check:"less_than",...ie(t),value:e,inclusive:!0})}function Sg(e,t){return new aw({check:"greater_than",...ie(t),value:e,inclusive:!1})}function xu(e,t){return new aw({check:"greater_than",...ie(t),value:e,inclusive:!0})}function Eg(e,t){return new Hj({check:"multiple_of",...ie(t),value:e})}function hw(e,t){return new Kj({check:"max_length",...ie(t),maximum:e})}function _c(e,t){return new Zj({check:"min_length",...ie(t),minimum:e})}function pw(e,t){return new Gj({check:"length_equals",...ie(t),length:e})}function RF(e,t){return new Yj({check:"string_format",format:"regex",...ie(t),pattern:e})}function PF(e){return new Xj({check:"string_format",format:"lowercase",...ie(e)})}function OF(e){return new Jj({check:"string_format",format:"uppercase",...ie(e)})}function TF(e,t){return new Qj({check:"string_format",format:"includes",...ie(t),includes:e})}function MF(e,t){return new eL({check:"string_format",format:"starts_with",...ie(t),prefix:e})}function AF(e,t){return new tL({check:"string_format",format:"ends_with",...ie(t),suffix:e})}function so(e){return new nL({check:"overwrite",tx:e})}function NF(e){return so(t=>t.normalize(e))}function DF(){return so(e=>e.trim())}function IF(){return so(e=>e.toLowerCase())}function jF(){return so(e=>e.toUpperCase())}function LF(){return so(e=>ZI(e))}function FF(e,t,n){return new e({type:"array",element:t,...ie(n)})}function zF(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ie(n)})}function $F(e){const t=VF(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(ii(r,n.value,t._zod.def));else{const s=r;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),n.issues.push(ii(s))}},e(n.value,n)));return t}function VF(e,t){const n=new jt({check:"custom",...ie(t)});return n._zod.check=e,n}function mw(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Oo,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function dt(e,t,n={path:[],schemaPath:[]}){var r;const s=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);const a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{const u={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,u);else{const f=i.schema,h=t.processors[s.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);h(e,t,f,u)}const d=e._zod.parent;d&&(i.ref||(i.ref=d),dt(d,t,u),t.seen.get(d).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&St(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&i.schema._prefault&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function gw(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const i of e.seen.entries()){const a=e.metadataRegistry.get(i[0])?.id;if(a){const c=r.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,i[0])}}const s=i=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const d=e.external.registry.get(i[0])?.id,f=e.external.uri??(p=>p);if(d)return{ref:f(d)};const h=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=h,{defId:h,ref:`${f("__shared")}#/${a}/${h}`}}if(i[1]===n)return{ref:"#"};const l=`#/${a}/`,u=i[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:l+u}},o=i=>{if(i[1].schema.$ref)return;const a=i[1],{ref:c,defId:l}=s(i);a.def={...a.schema},l&&(a.defId=l);const u=a.schema;for(const d in u)delete u[d];u.$ref=c};if(e.cycles==="throw")for(const i of e.seen.entries()){const a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
97
|
+
`)}h.write("payload.value = newResult;"),h.write("return payload;");const _=h.compile();return(w,x)=>_(f,w,x)};let s;const i=Ys,a=!kg.jitless,l=a&&rN.value,d=t.catchall;let u;e._zod.parse=(f,h)=>{u??(u=r.value);const m=f.value;return i(m)?a&&l&&h?.async===!1&&h.jitless!==!0?(s||(s=o(t.shape)),f=s(f,h),d?Wg([],m,f,h,u,e):f):n(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f)}});function Rf(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!mr(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(i=>Jn(i,r,Yn())))}),t)}const WT=z("$ZodUnion",(e,t)=>{Me.init(e,t),be(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),be(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),be(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),be(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>zl(s.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(n)return r(o,s);let i=!1;const a=[];for(const c of t.options){const l=c._zod.run({value:o.value,issues:[]},s);if(l instanceof Promise)a.push(l),i=!0;else{if(l.issues.length===0)return l;a.push(l)}}return i?Promise.all(a).then(c=>Rf(c,o,e,s)):Rf(a,o,e,s)}}),HT=z("$ZodIntersection",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},r),i=t.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,l])=>Pf(n,c,l)):Pf(n,s,i)}});function kc(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(yo(e)&&yo(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of r){const i=kc(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r],i=kc(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Pf(e,t,n){const r=new Map;let o;for(const a of t.issues)if(a.code==="unrecognized_keys"){o??(o=a);for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else e.issues.push(a);const s=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&o&&e.issues.push({...o,keys:s}),mr(e))return e;const i=kc(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const ZT=z("$ZodEnum",(e,t)=>{Me.init(e,t);const n=Ng(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>oN.has(typeof o)).map(o=>typeof o=="string"?Mi(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:n,input:i,inst:e}),o}}),KT=z("$ZodTransform",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Og(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(n.value=i,n));if(o instanceof Promise)throw new wr;return n.value=o,n}});function Of(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Hg=z("$ZodOptional",(e,t)=>{Me.init(e,t),e._zod.optin="optional",e._zod.optout="optional",be(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),be(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${zl(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>Of(s,n.value)):Of(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),qT=z("$ZodExactOptional",(e,t)=>{Hg.init(e,t),be(e._zod,"values",()=>t.innerType._zod.values),be(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),GT=z("$ZodNullable",(e,t)=>{Me.init(e,t),be(e._zod,"optin",()=>t.innerType._zod.optin),be(e._zod,"optout",()=>t.innerType._zod.optout),be(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${zl(n.source)}|null)$`):void 0}),be(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),YT=z("$ZodDefault",(e,t)=>{Me.init(e,t),e._zod.optin="optional",be(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>kf(s,t)):kf(o,t)}});function kf(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const JT=z("$ZodPrefault",(e,t)=>{Me.init(e,t),e._zod.optin="optional",be(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),QT=z("$ZodNonOptional",(e,t)=>{Me.init(e,t),be(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>Nf(s,e)):Nf(o,e)}});function Nf(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const XT=z("$ZodCatch",(e,t)=>{Me.init(e,t),be(e._zod,"optin",()=>t.innerType._zod.optin),be(e._zod,"optout",()=>t.innerType._zod.optout),be(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(i=>Jn(i,r,Yn()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>Jn(s,r,Yn()))},input:n.value}),n.issues=[]),n)}}),eA=z("$ZodPipe",(e,t)=>{Me.init(e,t),be(e._zod,"values",()=>t.in._zod.values),be(e._zod,"optin",()=>t.in._zod.optin),be(e._zod,"optout",()=>t.out._zod.optout),be(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(i=>as(i,t.in,r)):as(s,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>as(s,t.out,r)):as(o,t.out,r)}});function as(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const tA=z("$ZodReadonly",(e,t)=>{Me.init(e,t),be(e._zod,"propValues",()=>t.innerType._zod.propValues),be(e._zod,"values",()=>t.innerType._zod.values),be(e._zod,"optin",()=>t.innerType?._zod?.optin),be(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(Tf):Tf(o)}});function Tf(e){return e.value=Object.freeze(e.value),e}const nA=z("$ZodCustom",(e,t)=>{at.init(e,t),Me.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(s=>Af(s,n,r,e));Af(o,n,r,e)}});function Af(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(vo(o))}}var If;class rA{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function oA(){return new rA}(If=globalThis).__zod_globalRegistry??(If.__zod_globalRegistry=oA());const Gr=globalThis.__zod_globalRegistry;function sA(e,t){return new e({type:"string",...oe(t)})}function iA(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...oe(t)})}function Mf(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...oe(t)})}function aA(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...oe(t)})}function cA(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...oe(t)})}function lA(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...oe(t)})}function uA(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...oe(t)})}function dA(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...oe(t)})}function fA(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...oe(t)})}function hA(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...oe(t)})}function pA(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...oe(t)})}function mA(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...oe(t)})}function gA(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...oe(t)})}function yA(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...oe(t)})}function vA(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...oe(t)})}function bA(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...oe(t)})}function wA(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...oe(t)})}function xA(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...oe(t)})}function _A(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...oe(t)})}function SA(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...oe(t)})}function EA(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...oe(t)})}function CA(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...oe(t)})}function RA(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...oe(t)})}function PA(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...oe(t)})}function OA(e,t){return new e({type:"string",format:"date",check:"string_format",...oe(t)})}function kA(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...oe(t)})}function NA(e,t){return new e({type:"string",format:"duration",check:"string_format",...oe(t)})}function TA(e,t){return new e({type:"number",coerce:!0,checks:[],...oe(t)})}function AA(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...oe(t)})}function IA(e){return new e({type:"unknown"})}function MA(e,t){return new e({type:"never",...oe(t)})}function Df(e,t){return new $g({check:"less_than",...oe(t),value:e,inclusive:!1})}function Aa(e,t){return new $g({check:"less_than",...oe(t),value:e,inclusive:!0})}function jf(e,t){return new zg({check:"greater_than",...oe(t),value:e,inclusive:!1})}function Ia(e,t){return new zg({check:"greater_than",...oe(t),value:e,inclusive:!0})}function Lf(e,t){return new XN({check:"multiple_of",...oe(t),value:e})}function Zg(e,t){return new tT({check:"max_length",...oe(t),maximum:e})}function Qs(e,t){return new nT({check:"min_length",...oe(t),minimum:e})}function Kg(e,t){return new rT({check:"length_equals",...oe(t),length:e})}function DA(e,t){return new oT({check:"string_format",format:"regex",...oe(t),pattern:e})}function jA(e){return new sT({check:"string_format",format:"lowercase",...oe(e)})}function LA(e){return new iT({check:"string_format",format:"uppercase",...oe(e)})}function FA(e,t){return new aT({check:"string_format",format:"includes",...oe(t),includes:e})}function $A(e,t){return new cT({check:"string_format",format:"starts_with",...oe(t),prefix:e})}function zA(e,t){return new lT({check:"string_format",format:"ends_with",...oe(t),suffix:e})}function Ar(e){return new uT({check:"overwrite",tx:e})}function VA(e){return Ar(t=>t.normalize(e))}function UA(){return Ar(e=>e.trim())}function BA(){return Ar(e=>e.toLowerCase())}function WA(){return Ar(e=>e.toUpperCase())}function HA(){return Ar(e=>nN(e))}function ZA(e,t,n){return new e({type:"array",element:t,...oe(n)})}function KA(e,t,n){return new e({type:"custom",check:"custom",fn:t,...oe(n)})}function qA(e){const t=GA(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(vo(r,n.value,t._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(vo(o))}},e(n.value,n)));return t}function GA(e,t){const n=new at({check:"custom",...oe(t)});return n._zod.check=e,n}function qg(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Gr,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function We(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);const a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{const d={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,d);else{const f=i.schema,h=t.processors[o.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,f,d)}const u=e._zod.parent;u&&(i.ref||(i.ref=u),We(u,t,d),t.seen.get(u).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&Ye(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&i.schema._prefault&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function Gg(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const i of e.seen.entries()){const a=e.metadataRegistry.get(i[0])?.id;if(a){const c=r.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,i[0])}}const o=i=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const u=e.external.registry.get(i[0])?.id,f=e.external.uri??(m=>m);if(u)return{ref:f(u)};const h=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=h,{defId:h,ref:`${f("__shared")}#/${a}/${h}`}}if(i[1]===n)return{ref:"#"};const l=`#/${a}/`,d=i[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:l+d}},s=i=>{if(i[1].schema.$ref)return;const a=i[1],{ref:c,defId:l}=o(i);a.def={...a.schema},l&&(a.defId=l);const d=a.schema;for(const u in d)delete d[u];d.$ref=c};if(e.cycles==="throw")for(const i of e.seen.entries()){const a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
98
98
|
|
|
99
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const a=i[1];if(t===i[0]){o(i);continue}if(e.external){const l=e.external.registry.get(i[0])?.id;if(t!==i[0]&&l){o(i);continue}}if(e.metadataRegistry.get(i[0])?.id){o(i);continue}if(a.cycle){o(i);continue}if(a.count>1&&e.reused==="ref"){o(i);continue}}}function yw(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=i=>{const a=e.seen.get(i);if(a.ref===null)return;const c=a.def??a.schema,l={...c},u=a.ref;if(a.ref=null,u){r(u);const f=e.seen.get(u),h=f.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(h)):Object.assign(c,h),Object.assign(c,l),i._zod.parent===u)for(const m in c)m==="$ref"||m==="allOf"||m in l||delete c[m];if(h.$ref&&f.def)for(const m in c)m==="$ref"||m==="allOf"||m in f.def&&JSON.stringify(c[m])===JSON.stringify(f.def[m])&&delete c[m]}const d=i._zod.parent;if(d&&d!==u){r(d);const f=e.seen.get(d);if(f?.schema.$ref&&(c.$ref=f.schema.$ref,f.def))for(const h in c)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(c[h])===JSON.stringify(f.def[h])&&delete c[h]}e.override({zodSchema:i,jsonSchema:c,path:a.path??[]})};for(const i of[...e.seen.entries()].reverse())r(i[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const i=e.external.registry.get(t)?.id;if(!i)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(i)}Object.assign(s,n.def??n.schema);const o=e.external?.defs??{};for(const i of e.seen.entries()){const a=i[1];a.def&&a.defId&&(o[a.defId]=a.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?s.$defs=o:s.definitions=o);try{const i=JSON.parse(JSON.stringify(s));return Object.defineProperty(i,"~standard",{value:{...t["~standard"],jsonSchema:{input:wc(t,"input",e.processors),output:wc(t,"output",e.processors)}},enumerable:!1,writable:!1}),i}catch{throw new Error("Error converting schema to JSON.")}}function St(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return St(r.element,n);if(r.type==="set")return St(r.valueType,n);if(r.type==="lazy")return St(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return St(r.innerType,n);if(r.type==="intersection")return St(r.left,n)||St(r.right,n);if(r.type==="record"||r.type==="map")return St(r.keyType,n)||St(r.valueType,n);if(r.type==="pipe")return St(r.in,n)||St(r.out,n);if(r.type==="object"){for(const s in r.shape)if(St(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(St(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(St(s,n))return!0;return!!(r.rest&&St(r.rest,n))}return!1}const BF=(e,t={})=>n=>{const r=mw({...n,processors:t});return dt(e,r),gw(r,e),yw(r,e)},wc=(e,t,n={})=>r=>{const{libraryOptions:s,target:o}=r??{},i=mw({...s??{},target:o,io:t,processors:n});return dt(e,i),gw(i,e),yw(i,e)},UF={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},WF=(e,t,n,r)=>{const s=n;s.type="string";const{minimum:o,maximum:i,format:a,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof o=="number"&&(s.minLength=o),typeof i=="number"&&(s.maxLength=i),a&&(s.format=UF[a]??a,s.format===""&&delete s.format,a==="time"&&delete s.format),l&&(s.contentEncoding=l),c&&c.size>0){const u=[...c];u.length===1?s.pattern=u[0].source:u.length>1&&(s.allOf=[...u.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},HF=(e,t,n,r)=>{const s=n,{minimum:o,maximum:i,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof a=="string"&&a.includes("int")?s.type="integer":s.type="number",typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.minimum=u,s.exclusiveMinimum=!0):s.exclusiveMinimum=u),typeof o=="number"&&(s.minimum=o,typeof u=="number"&&t.target!=="draft-04"&&(u>=o?delete s.minimum:delete s.exclusiveMinimum)),typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.maximum=l,s.exclusiveMaximum=!0):s.exclusiveMaximum=l),typeof i=="number"&&(s.maximum=i,typeof l=="number"&&t.target!=="draft-04"&&(l<=i?delete s.maximum:delete s.exclusiveMaximum)),typeof c=="number"&&(s.multipleOf=c)},qF=(e,t,n,r)=>{n.not={}},KF=(e,t,n,r)=>{},ZF=(e,t,n,r)=>{const s=e._zod.def,o=X_(s.entries);o.every(i=>typeof i=="number")&&(n.type="number"),o.every(i=>typeof i=="string")&&(n.type="string"),n.enum=o},GF=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},YF=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},XF=(e,t,n,r)=>{const s=n,o=e._zod.def,{minimum:i,maximum:a}=e._zod.bag;typeof i=="number"&&(s.minItems=i),typeof a=="number"&&(s.maxItems=a),s.type="array",s.items=dt(o.element,t,{...r,path:[...r.path,"items"]})},JF=(e,t,n,r)=>{const s=n,o=e._zod.def;s.type="object",s.properties={};const i=o.shape;for(const l in i)s.properties[l]=dt(i[l],t,{...r,path:[...r.path,"properties",l]});const a=new Set(Object.keys(i)),c=new Set([...a].filter(l=>{const u=o.shape[l]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(s.required=Array.from(c)),o.catchall?._zod.def.type==="never"?s.additionalProperties=!1:o.catchall?o.catchall&&(s.additionalProperties=dt(o.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},QF=(e,t,n,r)=>{const s=e._zod.def,o=s.inclusive===!1,i=s.options.map((a,c)=>dt(a,t,{...r,path:[...r.path,o?"oneOf":"anyOf",c]}));o?n.oneOf=i:n.anyOf=i},e2=(e,t,n,r)=>{const s=e._zod.def,o=dt(s.left,t,{...r,path:[...r.path,"allOf",0]}),i=dt(s.right,t,{...r,path:[...r.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(o)?o.allOf:[o],...a(i)?i.allOf:[i]];n.allOf=c},t2=(e,t,n,r)=>{const s=e._zod.def,o=dt(s.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=s.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},n2=(e,t,n,r)=>{const s=e._zod.def;dt(s.innerType,t,r);const o=t.seen.get(e);o.ref=s.innerType},r2=(e,t,n,r)=>{const s=e._zod.def;dt(s.innerType,t,r);const o=t.seen.get(e);o.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},s2=(e,t,n,r)=>{const s=e._zod.def;dt(s.innerType,t,r);const o=t.seen.get(e);o.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},o2=(e,t,n,r)=>{const s=e._zod.def;dt(s.innerType,t,r);const o=t.seen.get(e);o.ref=s.innerType;let i;try{i=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i},i2=(e,t,n,r)=>{const s=e._zod.def,o=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;dt(o,t,r);const i=t.seen.get(e);i.ref=o},a2=(e,t,n,r)=>{const s=e._zod.def;dt(s.innerType,t,r);const o=t.seen.get(e);o.ref=s.innerType,n.readOnly=!0},bw=(e,t,n,r)=>{const s=e._zod.def;dt(s.innerType,t,r);const o=t.seen.get(e);o.ref=s.innerType};function kg(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function c2(e,t){for(var n={};e.length;){var r=e[0],s=r.code,o=r.message,i=r.path.join(".");if(!n[i])if("unionErrors"in r){var a=r.unionErrors[0].errors[0];n[i]={message:a.message,type:a.code}}else n[i]={message:o,type:s};if("unionErrors"in r&&r.unionErrors.forEach(function(u){return u.errors.forEach(function(d){return e.push(d)})}),t){var c=n[i].types,l=c&&c[r.code];n[i]=Sf(i,t,n,s,l?[].concat(l,r.message):r.message)}e.shift()}return n}function l2(e,t){for(var n={};e.length;){var r=e[0],s=r.code,o=r.message,i=r.path.join(".");if(!n[i])if(r.code==="invalid_union"&&r.errors.length>0){var a=r.errors[0][0];n[i]={message:a.message,type:a.code}}else n[i]={message:o,type:s};if(r.code==="invalid_union"&&r.errors.forEach(function(u){return u.forEach(function(d){return e.push(d)})}),t){var c=n[i].types,l=c&&c[r.code];n[i]=Sf(i,t,n,s,l?[].concat(l,r.message):r.message)}e.shift()}return n}function vw(e,t,n){if(n===void 0&&(n={}),(function(r){return"_def"in r&&typeof r._def=="object"&&"typeName"in r._def})(e))return function(r,s,o){try{return Promise.resolve(kg(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(i){return o.shouldUseNativeValidation&&Ed({},o),{errors:{},values:n.raw?Object.assign({},r):i}})},function(i){if((function(a){return Array.isArray(a?.issues)})(i))return{values:{},errors:ag(c2(i.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw i}))}catch(i){return Promise.reject(i)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,s,o){try{return Promise.resolve(kg(function(){return Promise.resolve((n.mode==="sync"?cj:lj)(e,r,t)).then(function(i){return o.shouldUseNativeValidation&&Ed({},o),{errors:{},values:n.raw?Object.assign({},r):i}})},function(i){if((function(a){return a instanceof ah})(i))return{values:{},errors:ag(l2(i.issues,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw i}))}catch(i){return Promise.reject(i)}};throw new Error("Invalid input: not a Zod schema")}const u2=U("ZodISODateTime",(e,t)=>{gL.init(e,t),Be.init(e,t)});function d2(e){return vF(u2,e)}const f2=U("ZodISODate",(e,t)=>{yL.init(e,t),Be.init(e,t)});function h2(e){return xF(f2,e)}const p2=U("ZodISOTime",(e,t)=>{bL.init(e,t),Be.init(e,t)});function m2(e){return _F(p2,e)}const g2=U("ZodISODuration",(e,t)=>{vL.init(e,t),Be.init(e,t)});function y2(e){return wF(g2,e)}const b2=(e,t)=>{ah.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>aj(e,n)},flatten:{value:n=>ij(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,kd,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,kd,2)}},isEmpty:{get(){return e.issues.length===0}}})},nn=U("ZodError",b2,{Parent:Error}),v2=pl(nn),x2=ml(nn),_2=gl(nn),w2=yl(nn),S2=fj(nn),E2=hj(nn),k2=pj(nn),C2=mj(nn),R2=gj(nn),P2=yj(nn),O2=bj(nn),T2=vj(nn),et=U("ZodType",(e,t)=>(Qe.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:wc(e,"input"),output:wc(e,"output")}}),e.toJSONSchema=BF(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Sr(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>Er(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>v2(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>_2(e,n,r),e.parseAsync=async(n,r)=>x2(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>w2(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>S2(e,n,r),e.decode=(n,r)=>E2(e,n,r),e.encodeAsync=async(n,r)=>k2(e,n,r),e.decodeAsync=async(n,r)=>C2(e,n,r),e.safeEncode=(n,r)=>R2(e,n,r),e.safeDecode=(n,r)=>P2(e,n,r),e.safeEncodeAsync=async(n,r)=>O2(e,n,r),e.safeDecodeAsync=async(n,r)=>T2(e,n,r),e.refine=(n,r)=>e.check(wz(n,r)),e.superRefine=n=>e.check(Sz(n)),e.overwrite=n=>e.check(so(n)),e.optional=()=>Og(e),e.exactOptional=()=>lz(e),e.nullable=()=>Tg(e),e.nullish=()=>Og(Tg(e)),e.nonoptional=n=>mz(e,n),e.array=()=>ez(e),e.or=n=>rz([e,n]),e.and=n=>oz(e,n),e.transform=n=>Mg(e,az(n)),e.default=n=>fz(e,n),e.prefault=n=>pz(e,n),e.catch=n=>yz(e,n),e.pipe=n=>Mg(e,n),e.readonly=()=>xz(e),e.describe=n=>{const r=e.clone();return Oo.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return Oo.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Oo.get(e);const r=e.clone();return Oo.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),xw=U("_ZodString",(e,t)=>{ch.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,s,o)=>WF(e,r,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(RF(...r)),e.includes=(...r)=>e.check(TF(...r)),e.startsWith=(...r)=>e.check(MF(...r)),e.endsWith=(...r)=>e.check(AF(...r)),e.min=(...r)=>e.check(_c(...r)),e.max=(...r)=>e.check(hw(...r)),e.length=(...r)=>e.check(pw(...r)),e.nonempty=(...r)=>e.check(_c(1,...r)),e.lowercase=r=>e.check(PF(r)),e.uppercase=r=>e.check(OF(r)),e.trim=()=>e.check(DF()),e.normalize=(...r)=>e.check(NF(...r)),e.toLowerCase=()=>e.check(IF()),e.toUpperCase=()=>e.check(jF()),e.slugify=()=>e.check(LF())}),M2=U("ZodString",(e,t)=>{ch.init(e,t),xw.init(e,t),e.email=n=>e.check(JL(A2,n)),e.url=n=>e.check(rF(N2,n)),e.jwt=n=>e.check(bF(Z2,n)),e.emoji=n=>e.check(sF(D2,n)),e.guid=n=>e.check(_g(Cg,n)),e.uuid=n=>e.check(QL(aa,n)),e.uuidv4=n=>e.check(eF(aa,n)),e.uuidv6=n=>e.check(tF(aa,n)),e.uuidv7=n=>e.check(nF(aa,n)),e.nanoid=n=>e.check(oF(I2,n)),e.guid=n=>e.check(_g(Cg,n)),e.cuid=n=>e.check(iF(j2,n)),e.cuid2=n=>e.check(aF(L2,n)),e.ulid=n=>e.check(cF(F2,n)),e.base64=n=>e.check(mF(H2,n)),e.base64url=n=>e.check(gF(q2,n)),e.xid=n=>e.check(lF(z2,n)),e.ksuid=n=>e.check(uF($2,n)),e.ipv4=n=>e.check(dF(V2,n)),e.ipv6=n=>e.check(fF(B2,n)),e.cidrv4=n=>e.check(hF(U2,n)),e.cidrv6=n=>e.check(pF(W2,n)),e.e164=n=>e.check(yF(K2,n)),e.datetime=n=>e.check(d2(n)),e.date=n=>e.check(h2(n)),e.time=n=>e.check(m2(n)),e.duration=n=>e.check(y2(n))});function pt(e){return XL(M2,e)}const Be=U("ZodStringFormat",(e,t)=>{Ve.init(e,t),xw.init(e,t)}),A2=U("ZodEmail",(e,t)=>{aL.init(e,t),Be.init(e,t)}),Cg=U("ZodGUID",(e,t)=>{oL.init(e,t),Be.init(e,t)}),aa=U("ZodUUID",(e,t)=>{iL.init(e,t),Be.init(e,t)}),N2=U("ZodURL",(e,t)=>{cL.init(e,t),Be.init(e,t)}),D2=U("ZodEmoji",(e,t)=>{lL.init(e,t),Be.init(e,t)}),I2=U("ZodNanoID",(e,t)=>{uL.init(e,t),Be.init(e,t)}),j2=U("ZodCUID",(e,t)=>{dL.init(e,t),Be.init(e,t)}),L2=U("ZodCUID2",(e,t)=>{fL.init(e,t),Be.init(e,t)}),F2=U("ZodULID",(e,t)=>{hL.init(e,t),Be.init(e,t)}),z2=U("ZodXID",(e,t)=>{pL.init(e,t),Be.init(e,t)}),$2=U("ZodKSUID",(e,t)=>{mL.init(e,t),Be.init(e,t)}),V2=U("ZodIPv4",(e,t)=>{xL.init(e,t),Be.init(e,t)}),B2=U("ZodIPv6",(e,t)=>{_L.init(e,t),Be.init(e,t)}),U2=U("ZodCIDRv4",(e,t)=>{wL.init(e,t),Be.init(e,t)}),W2=U("ZodCIDRv6",(e,t)=>{SL.init(e,t),Be.init(e,t)}),H2=U("ZodBase64",(e,t)=>{EL.init(e,t),Be.init(e,t)}),q2=U("ZodBase64URL",(e,t)=>{CL.init(e,t),Be.init(e,t)}),K2=U("ZodE164",(e,t)=>{RL.init(e,t),Be.init(e,t)}),Z2=U("ZodJWT",(e,t)=>{OL.init(e,t),Be.init(e,t)}),_w=U("ZodNumber",(e,t)=>{lw.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,s,o)=>HF(e,r,s),e.gt=(r,s)=>e.check(Sg(r,s)),e.gte=(r,s)=>e.check(xu(r,s)),e.min=(r,s)=>e.check(xu(r,s)),e.lt=(r,s)=>e.check(wg(r,s)),e.lte=(r,s)=>e.check(vu(r,s)),e.max=(r,s)=>e.check(vu(r,s)),e.int=r=>e.check(Rg(r)),e.safe=r=>e.check(Rg(r)),e.positive=r=>e.check(Sg(0,r)),e.nonnegative=r=>e.check(xu(0,r)),e.negative=r=>e.check(wg(0,r)),e.nonpositive=r=>e.check(vu(0,r)),e.multipleOf=(r,s)=>e.check(Eg(r,s)),e.step=(r,s)=>e.check(Eg(r,s)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}),G2=U("ZodNumberFormat",(e,t)=>{TL.init(e,t),_w.init(e,t)});function Rg(e){return EF(G2,e)}const Y2=U("ZodUnknown",(e,t)=>{ML.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>KF()});function Pg(){return kF(Y2)}const X2=U("ZodNever",(e,t)=>{AL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>qF(e,n,r)});function J2(e){return CF(X2,e)}const Q2=U("ZodArray",(e,t)=>{NL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>XF(e,n,r,s),e.element=t.element,e.min=(n,r)=>e.check(_c(n,r)),e.nonempty=n=>e.check(_c(1,n)),e.max=(n,r)=>e.check(hw(n,r)),e.length=(n,r)=>e.check(pw(n,r)),e.unwrap=()=>e.element});function ez(e,t){return FF(Q2,e,t)}const tz=U("ZodObject",(e,t)=>{IL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>JF(e,n,r,s),Re(e,"shape",()=>t.shape),e.keyof=()=>lh(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Pg()}),e.loose=()=>e.clone({...e._zod.def,catchall:Pg()}),e.strict=()=>e.clone({...e._zod.def,catchall:J2()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>tj(e,n),e.safeExtend=n=>nj(e,n),e.merge=n=>rj(e,n),e.pick=n=>QI(e,n),e.omit=n=>ej(e,n),e.partial=(...n)=>sj(Sw,e,n[0]),e.required=(...n)=>oj(Ew,e,n[0])});function ww(e,t){const n={type:"object",shape:e??{},...ie(t)};return new tz(n)}const nz=U("ZodUnion",(e,t)=>{jL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>QF(e,n,r,s),e.options=t.options});function rz(e,t){return new nz({type:"union",options:e,...ie(t)})}const sz=U("ZodIntersection",(e,t)=>{LL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>e2(e,n,r,s)});function oz(e,t){return new sz({type:"intersection",left:e,right:t})}const Rd=U("ZodEnum",(e,t)=>{FL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,s,o)=>ZF(e,r,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,s)=>{const o={};for(const i of r)if(n.has(i))o[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Rd({...t,checks:[],...ie(s),entries:o})},e.exclude=(r,s)=>{const o={...t.entries};for(const i of r)if(n.has(i))delete o[i];else throw new Error(`Key ${i} not found in enum`);return new Rd({...t,checks:[],...ie(s),entries:o})}});function lh(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Rd({type:"enum",entries:n,...ie(t)})}const iz=U("ZodTransform",(e,t)=>{zL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>YF(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new G_(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(ii(o,n.value,t));else{const i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),n.issues.push(ii(i))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(o=>(n.value=o,n)):(n.value=s,n)}});function az(e){return new iz({type:"transform",transform:e})}const Sw=U("ZodOptional",(e,t)=>{fw.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>bw(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Og(e){return new Sw({type:"optional",innerType:e})}const cz=U("ZodExactOptional",(e,t)=>{$L.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>bw(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function lz(e){return new cz({type:"optional",innerType:e})}const uz=U("ZodNullable",(e,t)=>{VL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>t2(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Tg(e){return new uz({type:"nullable",innerType:e})}const dz=U("ZodDefault",(e,t)=>{BL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>r2(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function fz(e,t){return new dz({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Q_(t)}})}const hz=U("ZodPrefault",(e,t)=>{UL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>s2(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function pz(e,t){return new hz({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Q_(t)}})}const Ew=U("ZodNonOptional",(e,t)=>{WL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>n2(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function mz(e,t){return new Ew({type:"nonoptional",innerType:e,...ie(t)})}const gz=U("ZodCatch",(e,t)=>{HL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>o2(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function yz(e,t){return new gz({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const bz=U("ZodPipe",(e,t)=>{qL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>i2(e,n,r,s),e.in=t.in,e.out=t.out});function Mg(e,t){return new bz({type:"pipe",in:e,out:t})}const vz=U("ZodReadonly",(e,t)=>{KL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>a2(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function xz(e){return new vz({type:"readonly",innerType:e})}const _z=U("ZodCustom",(e,t)=>{ZL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>GF(e,n)});function wz(e,t={}){return zF(_z,e,t)}function Sz(e){return $F(e)}function js(e){return SF(_w,e)}function nt({className:e,type:t,...n}){return g.jsx("input",{type:t,"data-slot":"input",className:Se("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm"," focus-visible:ring-ring/50 focus-visible:ring-[1px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}function Ag(e,[t,n]){return Math.min(n,Math.max(t,e))}function Ez(e){const t=kz(e),n=v.forwardRef((r,s)=>{const{children:o,...i}=r,a=v.Children.toArray(o),c=a.find(Rz);if(c){const l=c.props.children,u=a.map(d=>d===c?v.Children.count(l)>1?v.Children.only(null):v.isValidElement(l)?l.props.children:null:d);return g.jsx(t,{...i,ref:s,children:v.isValidElement(l)?v.cloneElement(l,void 0,u):null})}return g.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function kz(e){const t=v.forwardRef((n,r)=>{const{children:s,...o}=n;if(v.isValidElement(s)){const i=Oz(s),a=Pz(o,s.props);return s.type!==v.Fragment&&(a.ref=r?Yn(r,i):i),v.cloneElement(s,a)}return v.Children.count(s)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Cz=Symbol("radix.slottable");function Rz(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Cz}function Pz(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function Oz(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function kw(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Cw=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Tz="VisuallyHidden",Mz=v.forwardRef((e,t)=>g.jsx(be.span,{...e,ref:t,style:{...Cw,...e.style}}));Mz.displayName=Tz;var Az=[" ","Enter","ArrowUp","ArrowDown"],Nz=[" ","Enter"],ss="Select",[vl,xl,Dz]=Ff(ss),[oo]=wr(ss,[Dz,ol]),_l=ol(),[Iz,kr]=oo(ss),[jz,Lz]=oo(ss),Rw=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:o,value:i,defaultValue:a,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:h,form:p}=e,m=_l(t),[y,b]=v.useState(null),[x,_]=v.useState(null),[w,S]=v.useState(!1),C=zf(l),[k,E]=Zs({prop:r,defaultProp:s??!1,onChange:o,caller:ss}),[P,O]=Zs({prop:i,defaultProp:a,onChange:c,caller:ss}),N=v.useRef(null),A=y?p||!!y.closest("form"):!0,[j,$]=v.useState(new Set),q=Array.from(j).map(D=>D.props.value).join(";");return g.jsx(e_,{...m,children:g.jsxs(Iz,{required:h,scope:t,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:_,valueNodeHasChildren:w,onValueNodeHasChildrenChange:S,contentId:Hn(),value:P,onValueChange:O,open:k,onOpenChange:E,dir:C,triggerPointerDownPosRef:N,disabled:f,children:[g.jsx(vl.Provider,{scope:t,children:g.jsx(jz,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(D=>{$(H=>new Set(H).add(D))},[]),onNativeOptionRemove:v.useCallback(D=>{$(H=>{const F=new Set(H);return F.delete(D),F})},[]),children:n})}),A?g.jsxs(Gw,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:d,value:P,onChange:D=>O(D.target.value),disabled:f,form:p,children:[P===void 0?g.jsx("option",{value:""}):null,Array.from(j)]},q):null]})})};Rw.displayName=ss;var Pw="SelectTrigger",Ow=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,o=_l(n),i=kr(Pw,n),a=i.disabled||r,c=Pe(t,i.onTriggerChange),l=xl(n),u=v.useRef("touch"),[d,f,h]=Xw(m=>{const y=l().filter(_=>!_.disabled),b=y.find(_=>_.value===i.value),x=Jw(y,m,b);x!==void 0&&i.onValueChange(x.value)}),p=m=>{a||(i.onOpenChange(!0),h()),m&&(i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return g.jsx(t_,{asChild:!0,...o,children:g.jsx(be.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Yw(i.value)?"":void 0,...s,ref:c,onClick:re(s.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&p(m)}),onPointerDown:re(s.onPointerDown,m=>{u.current=m.pointerType;const y=m.target;y.hasPointerCapture(m.pointerId)&&y.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(p(m),m.preventDefault())}),onKeyDown:re(s.onKeyDown,m=>{const y=d.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&f(m.key),!(y&&m.key===" ")&&Az.includes(m.key)&&(p(),m.preventDefault())})})})});Ow.displayName=Pw;var Tw="SelectValue",Mw=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:o,placeholder:i="",...a}=e,c=kr(Tw,n),{onValueNodeHasChildrenChange:l}=c,u=o!==void 0,d=Pe(t,c.onValueNodeChange);return vt(()=>{l(u)},[l,u]),g.jsx(be.span,{...a,ref:d,style:{pointerEvents:"none"},children:Yw(c.value)?g.jsx(g.Fragment,{children:i}):o})});Mw.displayName=Tw;var Fz="SelectIcon",Aw=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return g.jsx(be.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});Aw.displayName=Fz;var zz="SelectPortal",Nw=e=>g.jsx(il,{asChild:!0,...e});Nw.displayName=zz;var os="SelectContent",Dw=v.forwardRef((e,t)=>{const n=kr(os,e.__scopeSelect),[r,s]=v.useState();if(vt(()=>{s(new DocumentFragment)},[]),!n.open){const o=r;return o?Ic.createPortal(g.jsx(Iw,{scope:e.__scopeSelect,children:g.jsx(vl.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),o):null}return g.jsx(jw,{...e,ref:t})});Dw.displayName=os;var cn=10,[Iw,Cr]=oo(os),$z="SelectContentImpl",Vz=Ez("SelectContent.RemoveScroll"),jw=v.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:i,side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:p,hideWhenDetached:m,avoidCollisions:y,...b}=e,x=kr(os,n),[_,w]=v.useState(null),[S,C]=v.useState(null),k=Pe(t,V=>w(V)),[E,P]=v.useState(null),[O,N]=v.useState(null),A=xl(n),[j,$]=v.useState(!1),q=v.useRef(!1);v.useEffect(()=>{if(_)return Gf(_)},[_]),$f();const D=v.useCallback(V=>{const[ee,...me]=A().map(ge=>ge.ref.current),[le]=me.slice(-1),fe=document.activeElement;for(const ge of V)if(ge===fe||(ge?.scrollIntoView({block:"nearest"}),ge===ee&&S&&(S.scrollTop=0),ge===le&&S&&(S.scrollTop=S.scrollHeight),ge?.focus(),document.activeElement!==fe))return},[A,S]),H=v.useCallback(()=>D([E,_]),[D,E,_]);v.useEffect(()=>{j&&H()},[j,H]);const{onOpenChange:F,triggerPointerDownPosRef:W}=x;v.useEffect(()=>{if(_){let V={x:0,y:0};const ee=le=>{V={x:Math.abs(Math.round(le.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(le.pageY)-(W.current?.y??0))}},me=le=>{V.x<=10&&V.y<=10?le.preventDefault():_.contains(le.target)||F(!1),document.removeEventListener("pointermove",ee),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",me,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",me,{capture:!0})}}},[_,F,W]),v.useEffect(()=>{const V=()=>F(!1);return window.addEventListener("blur",V),window.addEventListener("resize",V),()=>{window.removeEventListener("blur",V),window.removeEventListener("resize",V)}},[F]);const[se,I]=Xw(V=>{const ee=A().filter(fe=>!fe.disabled),me=ee.find(fe=>fe.ref.current===document.activeElement),le=Jw(ee,V,me);le&&setTimeout(()=>le.ref.current.focus())}),Y=v.useCallback((V,ee,me)=>{const le=!q.current&&!me;(x.value!==void 0&&x.value===ee||le)&&(P(V),le&&(q.current=!0))},[x.value]),K=v.useCallback(()=>_?.focus(),[_]),Z=v.useCallback((V,ee,me)=>{const le=!q.current&&!me;(x.value!==void 0&&x.value===ee||le)&&N(V)},[x.value]),oe=r==="popper"?Pd:Lw,ce=oe===Pd?{side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:p,hideWhenDetached:m,avoidCollisions:y}:{};return g.jsx(Iw,{scope:n,content:_,viewport:S,onViewportChange:C,itemRefCallback:Y,selectedItem:E,onItemLeave:K,itemTextRefCallback:Z,focusSelectedItem:H,selectedItemText:O,position:r,isPositioned:j,searchRef:se,children:g.jsx(cl,{as:Vz,allowPinchZoom:!0,children:g.jsx(el,{asChild:!0,trapped:x.open,onMountAutoFocus:V=>{V.preventDefault()},onUnmountAutoFocus:re(s,V=>{x.trigger?.focus({preventScroll:!0}),V.preventDefault()}),children:g.jsx(Qc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:V=>V.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:g.jsx(oe,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:V=>V.preventDefault(),...b,...ce,onPlaced:()=>$(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:re(b.onKeyDown,V=>{const ee=V.ctrlKey||V.altKey||V.metaKey;if(V.key==="Tab"&&V.preventDefault(),!ee&&V.key.length===1&&I(V.key),["ArrowUp","ArrowDown","Home","End"].includes(V.key)){let le=A().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);if(["ArrowUp","End"].includes(V.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(V.key)){const fe=V.target,ge=le.indexOf(fe);le=le.slice(ge+1)}setTimeout(()=>D(le)),V.preventDefault()}})})})})})})});jw.displayName=$z;var Bz="SelectItemAlignedPosition",Lw=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,o=kr(os,n),i=Cr(os,n),[a,c]=v.useState(null),[l,u]=v.useState(null),d=Pe(t,k=>u(k)),f=xl(n),h=v.useRef(!1),p=v.useRef(!0),{viewport:m,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=i,_=v.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&l&&m&&y&&b){const k=o.trigger.getBoundingClientRect(),E=l.getBoundingClientRect(),P=o.valueNode.getBoundingClientRect(),O=b.getBoundingClientRect();if(o.dir!=="rtl"){const fe=O.left-E.left,ge=P.left-fe,Ze=k.left-ge,_t=k.width+Ze,rn=Math.max(_t,E.width),qt=window.innerWidth-cn,st=Ag(ge,[cn,Math.max(cn,qt-rn)]);a.style.minWidth=_t+"px",a.style.left=st+"px"}else{const fe=E.right-O.right,ge=window.innerWidth-P.right-fe,Ze=window.innerWidth-k.right-ge,_t=k.width+Ze,rn=Math.max(_t,E.width),qt=window.innerWidth-cn,st=Ag(ge,[cn,Math.max(cn,qt-rn)]);a.style.minWidth=_t+"px",a.style.right=st+"px"}const N=f(),A=window.innerHeight-cn*2,j=m.scrollHeight,$=window.getComputedStyle(l),q=parseInt($.borderTopWidth,10),D=parseInt($.paddingTop,10),H=parseInt($.borderBottomWidth,10),F=parseInt($.paddingBottom,10),W=q+D+j+F+H,se=Math.min(y.offsetHeight*5,W),I=window.getComputedStyle(m),Y=parseInt(I.paddingTop,10),K=parseInt(I.paddingBottom,10),Z=k.top+k.height/2-cn,oe=A-Z,ce=y.offsetHeight/2,V=y.offsetTop+ce,ee=q+D+V,me=W-ee;if(ee<=Z){const fe=N.length>0&&y===N[N.length-1].ref.current;a.style.bottom="0px";const ge=l.clientHeight-m.offsetTop-m.offsetHeight,Ze=Math.max(oe,ce+(fe?K:0)+ge+H),_t=ee+Ze;a.style.height=_t+"px"}else{const fe=N.length>0&&y===N[0].ref.current;a.style.top="0px";const Ze=Math.max(Z,q+m.offsetTop+(fe?Y:0)+ce)+me;a.style.height=Ze+"px",m.scrollTop=ee-Z+m.offsetTop}a.style.margin=`${cn}px 0`,a.style.minHeight=se+"px",a.style.maxHeight=A+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[f,o.trigger,o.valueNode,a,l,m,y,b,o.dir,r]);vt(()=>_(),[_]);const[w,S]=v.useState();vt(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]);const C=v.useCallback(k=>{k&&p.current===!0&&(_(),x?.(),p.current=!1)},[_,x]);return g.jsx(Wz,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:C,children:g.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:g.jsx(be.div,{...s,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Lw.displayName=Bz;var Uz="SelectPopperPosition",Pd=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=cn,...o}=e,i=_l(n);return g.jsx(n_,{...i,...o,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Pd.displayName=Uz;var[Wz,uh]=oo(os,{}),Od="SelectViewport",Fw=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,o=Cr(Od,n),i=uh(Od,n),a=Pe(t,o.onViewportChange),c=v.useRef(0);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),g.jsx(vl.Slot,{scope:n,children:g.jsx(be.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:re(s.onScroll,l=>{const u=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=i;if(f?.current&&d){const h=Math.abs(c.current-u.scrollTop);if(h>0){const p=window.innerHeight-cn*2,m=parseFloat(d.style.minHeight),y=parseFloat(d.style.height),b=Math.max(m,y);if(b<p){const x=b+h,_=Math.min(p,x),w=x-_;d.style.height=_+"px",d.style.bottom==="0px"&&(u.scrollTop=w>0?w:0,d.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});Fw.displayName=Od;var zw="SelectGroup",[Hz,qz]=oo(zw),Kz=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Hn();return g.jsx(Hz,{scope:n,id:s,children:g.jsx(be.div,{role:"group","aria-labelledby":s,...r,ref:t})})});Kz.displayName=zw;var $w="SelectLabel",Zz=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=qz($w,n);return g.jsx(be.div,{id:s.id,...r,ref:t})});Zz.displayName=$w;var Sc="SelectItem",[Gz,Vw]=oo(Sc),Bw=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:o,...i}=e,a=kr(Sc,n),c=Cr(Sc,n),l=a.value===r,[u,d]=v.useState(o??""),[f,h]=v.useState(!1),p=Pe(t,x=>c.itemRefCallback?.(x,r,s)),m=Hn(),y=v.useRef("touch"),b=()=>{s||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return g.jsx(Gz,{scope:n,value:r,disabled:s,textId:m,isSelected:l,onItemTextChange:v.useCallback(x=>{d(_=>_||(x?.textContent??"").trim())},[]),children:g.jsx(vl.ItemSlot,{scope:n,value:r,disabled:s,textValue:u,children:g.jsx(be.div,{role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":l&&f,"data-state":l?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...i,ref:p,onFocus:re(i.onFocus,()=>h(!0)),onBlur:re(i.onBlur,()=>h(!1)),onClick:re(i.onClick,()=>{y.current!=="mouse"&&b()}),onPointerUp:re(i.onPointerUp,()=>{y.current==="mouse"&&b()}),onPointerDown:re(i.onPointerDown,x=>{y.current=x.pointerType}),onPointerMove:re(i.onPointerMove,x=>{y.current=x.pointerType,s?c.onItemLeave?.():y.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:re(i.onPointerLeave,x=>{x.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:re(i.onKeyDown,x=>{c.searchRef?.current!==""&&x.key===" "||(Nz.includes(x.key)&&b(),x.key===" "&&x.preventDefault())})})})})});Bw.displayName=Sc;var To="SelectItemText",Uw=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...o}=e,i=kr(To,n),a=Cr(To,n),c=Vw(To,n),l=Lz(To,n),[u,d]=v.useState(null),f=Pe(t,b=>d(b),c.onItemTextChange,b=>a.itemTextRefCallback?.(b,c.value,c.disabled)),h=u?.textContent,p=v.useMemo(()=>g.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:y}=l;return vt(()=>(m(p),()=>y(p)),[m,y,p]),g.jsxs(g.Fragment,{children:[g.jsx(be.span,{id:c.textId,...o,ref:f}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Ic.createPortal(o.children,i.valueNode):null]})});Uw.displayName=To;var Ww="SelectItemIndicator",Hw=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Vw(Ww,n).isSelected?g.jsx(be.span,{"aria-hidden":!0,...r,ref:t}):null});Hw.displayName=Ww;var Td="SelectScrollUpButton",qw=v.forwardRef((e,t)=>{const n=Cr(Td,e.__scopeSelect),r=uh(Td,e.__scopeSelect),[s,o]=v.useState(!1),i=Pe(t,r.onScrollButtonChange);return vt(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollTop>0;o(l)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?g.jsx(Zw,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});qw.displayName=Td;var Md="SelectScrollDownButton",Kw=v.forwardRef((e,t)=>{const n=Cr(Md,e.__scopeSelect),r=uh(Md,e.__scopeSelect),[s,o]=v.useState(!1),i=Pe(t,r.onScrollButtonChange);return vt(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<l;o(u)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?g.jsx(Zw,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});Kw.displayName=Md;var Zw=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,o=Cr("SelectScrollButton",n),i=v.useRef(null),a=xl(n),c=v.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return v.useEffect(()=>()=>c(),[c]),vt(()=>{a().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),g.jsx(be.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:re(s.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:re(s.onPointerMove,()=>{o.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:re(s.onPointerLeave,()=>{c()})})}),Yz="SelectSeparator",Xz=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return g.jsx(be.div,{"aria-hidden":!0,...r,ref:t})});Xz.displayName=Yz;var Ad="SelectArrow",Jz=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=_l(n),o=kr(Ad,n),i=Cr(Ad,n);return o.open&&i.position==="popper"?g.jsx(r_,{...s,...r,ref:t}):null});Jz.displayName=Ad;var Qz="SelectBubbleInput",Gw=v.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=v.useRef(null),o=Pe(r,s),i=kw(t);return v.useEffect(()=>{const a=s.current;if(!a)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&u){const d=new Event("change",{bubbles:!0});u.call(a,t),a.dispatchEvent(d)}},[i,t]),g.jsx(be.select,{...n,style:{...Cw,...n.style},ref:o,defaultValue:t})});Gw.displayName=Qz;function Yw(e){return e===""||e===void 0}function Xw(e){const t=On(e),n=v.useRef(""),r=v.useRef(0),s=v.useCallback(i=>{const a=n.current+i;t(a),(function c(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(a)},[t]),o=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,o]}function Jw(e,t,n){const s=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let i=e$(e,Math.max(o,0));s.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function e$(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var t$=Rw,n$=Ow,r$=Mw,s$=Aw,o$=Nw,i$=Dw,a$=Fw,c$=Bw,l$=Uw,u$=Hw,d$=qw,f$=Kw;function Ls({...e}){return g.jsx(t$,{"data-slot":"select",...e})}function Fs({...e}){return g.jsx(r$,{"data-slot":"select-value",...e})}function zs({className:e,size:t="default",children:n,...r}){return g.jsxs(n$,{"data-slot":"select-trigger","data-size":t,className:Se("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,g.jsx(s$,{asChild:!0,children:g.jsx(vx,{className:"size-4 opacity-50"})})]})}function $s({className:e,children:t,position:n="popper",...r}){return g.jsx(o$,{children:g.jsxs(i$,{"data-slot":"select-content",className:Se("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[g.jsx(h$,{}),g.jsx(a$,{className:Se("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),g.jsx(p$,{})]})})}function Vs({className:e,children:t,...n}){return g.jsxs(c$,{"data-slot":"select-item",className:Se("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 ps-2 pe-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[g.jsx("span",{className:"absolute end-2 flex size-3.5 items-center justify-center",children:g.jsx(u$,{children:g.jsx(bx,{className:"size-4"})})}),g.jsx(l$,{children:t})]})}function h$({className:e,...t}){return g.jsx(d$,{"data-slot":"select-scroll-up-button",className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(LM,{className:"size-4"})})}function p$({className:e,...t}){return g.jsx(f$,{"data-slot":"select-scroll-down-button",className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(vx,{className:"size-4"})})}var m$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],g$=m$.reduce((e,t)=>{const n=Cx(`Primitive.${t}`),r=v.forwardRef((s,o)=>{const{asChild:i,...a}=s,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),y$="Label",Qw=v.forwardRef((e,t)=>g.jsx(g$.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Qw.displayName=y$;var b$=Qw;function e0({className:e,...t}){return g.jsx(b$,{"data-slot":"label",className:Se("flex items-center gap-2 text-sm mb-2 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),...t})}const t0=pO,n0=v.createContext({}),Ne=({...e})=>g.jsx(n0.Provider,{value:{name:e.name},children:g.jsx(fO,{...e})}),dh=()=>{const e=v.useContext(n0),t=v.useContext(r0),{getFieldState:n}=hO(),r=Ev({name:e.name}),s=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},r0=v.createContext({});function De({className:e,...t}){const n=v.useId();return g.jsx(r0.Provider,{value:{id:n},children:g.jsx("div",{"data-slot":"form-item",className:Se("grid gap-2",e),...t})})}function Ie({className:e,children:t,required:n,...r}){const{error:s,formItemId:o}=dh();return g.jsxs(e0,{"data-slot":"form-label","data-error":!!s,className:e,htmlFor:o,...r,children:[t,n&&g.jsx("span",{className:"text-destructive",children:"*"})]})}function je({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:s}=dh();return g.jsx(Lf,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${s}`:`${r}`,"aria-invalid":!!t,...e})}function Le({className:e,...t}){const{error:n,formMessageId:r}=dh(),s=n?String(n?.message??""):t.children;return s?g.jsx("p",{"data-slot":"form-message",id:r,className:Se("text-destructive text-sm",e),...t,children:s}):null}function v$(e){const t=x$(e),n=v.forwardRef((r,s)=>{const{children:o,...i}=r,a=v.Children.toArray(o),c=a.find(w$);if(c){const l=c.props.children,u=a.map(d=>d===c?v.Children.count(l)>1?v.Children.only(null):v.isValidElement(l)?l.props.children:null:d);return g.jsx(t,{...i,ref:s,children:v.isValidElement(l)?v.cloneElement(l,void 0,u):null})}return g.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function x$(e){const t=v.forwardRef((n,r)=>{const{children:s,...o}=n;if(v.isValidElement(s)){const i=E$(s),a=S$(o,s.props);return s.type!==v.Fragment&&(a.ref=r?Yn(r,i):i),v.cloneElement(s,a)}return v.Children.count(s)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var _$=Symbol("radix.slottable");function w$(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===_$}function S$(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function E$(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var wl="Dialog",[s0]=wr(wl),[k$,yn]=s0(wl),o0=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,a=v.useRef(null),c=v.useRef(null),[l,u]=Zs({prop:r,defaultProp:s??!1,onChange:o,caller:wl});return g.jsx(k$,{scope:t,triggerRef:a,contentRef:c,contentId:Hn(),titleId:Hn(),descriptionId:Hn(),open:l,onOpenChange:u,onOpenToggle:v.useCallback(()=>u(d=>!d),[u]),modal:i,children:n})};o0.displayName=wl;var i0="DialogTrigger",C$=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=yn(i0,n),o=Pe(t,s.triggerRef);return g.jsx(be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":ph(s.open),...r,ref:o,onClick:re(e.onClick,s.onOpenToggle)})});C$.displayName=i0;var fh="DialogPortal",[R$,a0]=s0(fh,{forceMount:void 0}),c0=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=yn(fh,t);return g.jsx(R$,{scope:t,forceMount:n,children:v.Children.map(r,i=>g.jsx(Xn,{present:n||o.open,children:g.jsx(il,{asChild:!0,container:s,children:i})}))})};c0.displayName=fh;var Ec="DialogOverlay",l0=v.forwardRef((e,t)=>{const n=a0(Ec,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=yn(Ec,e.__scopeDialog);return o.modal?g.jsx(Xn,{present:r||o.open,children:g.jsx(O$,{...s,ref:t})}):null});l0.displayName=Ec;var P$=v$("DialogOverlay.RemoveScroll"),O$=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=yn(Ec,n);return g.jsx(cl,{as:P$,allowPinchZoom:!0,shards:[s.contentRef],children:g.jsx(be.div,{"data-state":ph(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),is="DialogContent",u0=v.forwardRef((e,t)=>{const n=a0(is,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=yn(is,e.__scopeDialog);return g.jsx(Xn,{present:r||o.open,children:o.modal?g.jsx(T$,{...s,ref:t}):g.jsx(M$,{...s,ref:t})})});u0.displayName=is;var T$=v.forwardRef((e,t)=>{const n=yn(is,e.__scopeDialog),r=v.useRef(null),s=Pe(t,n.contentRef,r);return v.useEffect(()=>{const o=r.current;if(o)return Gf(o)},[]),g.jsx(d0,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:re(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:re(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&o.preventDefault()}),onFocusOutside:re(e.onFocusOutside,o=>o.preventDefault())})}),M$=v.forwardRef((e,t)=>{const n=yn(is,e.__scopeDialog),r=v.useRef(!1),s=v.useRef(!1);return g.jsx(d0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;n.triggerRef.current?.contains(i)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),d0=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=e,a=yn(is,n),c=v.useRef(null),l=Pe(t,c);return $f(),g.jsxs(g.Fragment,{children:[g.jsx(el,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:g.jsx(Qc,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ph(a.open),...i,ref:l,onDismiss:()=>a.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(A$,{titleId:a.titleId}),g.jsx(D$,{contentRef:c,descriptionId:a.descriptionId})]})]})}),hh="DialogTitle",f0=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=yn(hh,n);return g.jsx(be.h2,{id:s.titleId,...r,ref:t})});f0.displayName=hh;var h0="DialogDescription",p0=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=yn(h0,n);return g.jsx(be.p,{id:s.descriptionId,...r,ref:t})});p0.displayName=h0;var m0="DialogClose",g0=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=yn(m0,n);return g.jsx(be.button,{type:"button",...r,ref:t,onClick:re(e.onClick,()=>s.onOpenChange(!1))})});g0.displayName=m0;function ph(e){return e?"open":"closed"}var y0="DialogTitleWarning",[GH,b0]=g1(y0,{contentName:is,titleName:hh,docsSlug:"dialog"}),A$=({titleId:e})=>{const t=b0(y0),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
99
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const a=i[1];if(t===i[0]){s(i);continue}if(e.external){const l=e.external.registry.get(i[0])?.id;if(t!==i[0]&&l){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}if(a.count>1&&e.reused==="ref"){s(i);continue}}}function Yg(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=i=>{const a=e.seen.get(i);if(a.ref===null)return;const c=a.def??a.schema,l={...c},d=a.ref;if(a.ref=null,d){r(d);const f=e.seen.get(d),h=f.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(h)):Object.assign(c,h),Object.assign(c,l),i._zod.parent===d)for(const g in c)g==="$ref"||g==="allOf"||g in l||delete c[g];if(h.$ref&&f.def)for(const g in c)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(c[g])===JSON.stringify(f.def[g])&&delete c[g]}const u=i._zod.parent;if(u&&u!==d){r(u);const f=e.seen.get(u);if(f?.schema.$ref&&(c.$ref=f.schema.$ref,f.def))for(const h in c)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(c[h])===JSON.stringify(f.def[h])&&delete c[h]}e.override({zodSchema:i,jsonSchema:c,path:a.path??[]})};for(const i of[...e.seen.entries()].reverse())r(i[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const i=e.external.registry.get(t)?.id;if(!i)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(i)}Object.assign(o,n.def??n.schema);const s=e.external?.defs??{};for(const i of e.seen.entries()){const a=i[1];a.def&&a.defId&&(s[a.defId]=a.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const i=JSON.parse(JSON.stringify(o));return Object.defineProperty(i,"~standard",{value:{...t["~standard"],jsonSchema:{input:Xs(t,"input",e.processors),output:Xs(t,"output",e.processors)}},enumerable:!1,writable:!1}),i}catch{throw new Error("Error converting schema to JSON.")}}function Ye(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Ye(r.element,n);if(r.type==="set")return Ye(r.valueType,n);if(r.type==="lazy")return Ye(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Ye(r.innerType,n);if(r.type==="intersection")return Ye(r.left,n)||Ye(r.right,n);if(r.type==="record"||r.type==="map")return Ye(r.keyType,n)||Ye(r.valueType,n);if(r.type==="pipe")return Ye(r.in,n)||Ye(r.out,n);if(r.type==="object"){for(const o in r.shape)if(Ye(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(Ye(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(Ye(o,n))return!0;return!!(r.rest&&Ye(r.rest,n))}return!1}const YA=(e,t={})=>n=>{const r=qg({...n,processors:t});return We(e,r),Gg(r,e),Yg(r,e)},Xs=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},i=qg({...o??{},target:s,io:t,processors:n});return We(e,i),Gg(i,e),Yg(i,e)},JA={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},QA=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof i=="number"&&(o.maxLength=i),a&&(o.format=JA[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),l&&(o.contentEncoding=l),c&&c.size>0){const d=[...c];d.length===1?o.pattern=d[0].source:d.length>1&&(o.allOf=[...d.map(u=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:u.source}))])}},XA=(e,t,n,r)=>{const o=n,{minimum:s,maximum:i,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:d}=e._zod.bag;typeof a=="string"&&a.includes("int")?o.type="integer":o.type="number",typeof d=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=d,o.exclusiveMinimum=!0):o.exclusiveMinimum=d),typeof s=="number"&&(o.minimum=s,typeof d=="number"&&t.target!=="draft-04"&&(d>=s?delete o.minimum:delete o.exclusiveMinimum)),typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=l,o.exclusiveMaximum=!0):o.exclusiveMaximum=l),typeof i=="number"&&(o.maximum=i,typeof l=="number"&&t.target!=="draft-04"&&(l<=i?delete o.maximum:delete o.exclusiveMaximum)),typeof c=="number"&&(o.multipleOf=c)},e1=(e,t,n,r)=>{n.not={}},t1=(e,t,n,r)=>{},n1=(e,t,n,r)=>{const o=e._zod.def,s=Ng(o.entries);s.every(i=>typeof i=="number")&&(n.type="number"),s.every(i=>typeof i=="string")&&(n.type="string"),n.enum=s},r1=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},o1=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},s1=(e,t,n,r)=>{const o=n,s=e._zod.def,{minimum:i,maximum:a}=e._zod.bag;typeof i=="number"&&(o.minItems=i),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=We(s.element,t,{...r,path:[...r.path,"items"]})},i1=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const i=s.shape;for(const l in i)o.properties[l]=We(i[l],t,{...r,path:[...r.path,"properties",l]});const a=new Set(Object.keys(i)),c=new Set([...a].filter(l=>{const d=s.shape[l]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));c.size>0&&(o.required=Array.from(c)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=We(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},a1=(e,t,n,r)=>{const o=e._zod.def,s=o.inclusive===!1,i=o.options.map((a,c)=>We(a,t,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?n.oneOf=i:n.anyOf=i},c1=(e,t,n,r)=>{const o=e._zod.def,s=We(o.left,t,{...r,path:[...r.path,"allOf",0]}),i=We(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];n.allOf=c},l1=(e,t,n,r)=>{const o=e._zod.def,s=We(o.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},u1=(e,t,n,r)=>{const o=e._zod.def;We(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},d1=(e,t,n,r)=>{const o=e._zod.def;We(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},f1=(e,t,n,r)=>{const o=e._zod.def;We(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},h1=(e,t,n,r)=>{const o=e._zod.def;We(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i},p1=(e,t,n,r)=>{const o=e._zod.def,s=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;We(s,t,r);const i=t.seen.get(e);i.ref=s},m1=(e,t,n,r)=>{const o=e._zod.def;We(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},Jg=(e,t,n,r)=>{const o=e._zod.def;We(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType};function Ff(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function g1(e,t){for(var n={};e.length;){var r=e[0],o=r.code,s=r.message,i=r.path.join(".");if(!n[i])if("unionErrors"in r){var a=r.unionErrors[0].errors[0];n[i]={message:a.message,type:a.code}}else n[i]={message:s,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(d){return d.errors.forEach(function(u){return e.push(u)})}),t){var c=n[i].types,l=c&&c[r.code];n[i]=ll(i,t,n,o,l?[].concat(l,r.message):r.message)}e.shift()}return n}function y1(e,t){for(var n={};e.length;){var r=e[0],o=r.code,s=r.message,i=r.path.join(".");if(!n[i])if(r.code==="invalid_union"&&r.errors.length>0){var a=r.errors[0][0];n[i]={message:a.message,type:a.code}}else n[i]={message:s,type:o};if(r.code==="invalid_union"&&r.errors.forEach(function(d){return d.forEach(function(u){return e.push(u)})}),t){var c=n[i].types,l=c&&c[r.code];n[i]=ll(i,t,n,o,l?[].concat(l,r.message):r.message)}e.shift()}return n}function v1(e,t,n){if(n===void 0&&(n={}),(function(r){return"_def"in r&&typeof r._def=="object"&&"typeName"in r._def})(e))return function(r,o,s){try{return Promise.resolve(Ff(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(i){return s.shouldUseNativeValidation&&Pc({},s),{errors:{},values:n.raw?Object.assign({},r):i}})},function(i){if((function(a){return Array.isArray(a?.issues)})(i))return{values:{},errors:wf(g1(i.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,o,s){try{return Promise.resolve(Ff(function(){return Promise.resolve((n.mode==="sync"?gN:yN)(e,r,t)).then(function(i){return s.shouldUseNativeValidation&&Pc({},s),{errors:{},values:n.raw?Object.assign({},r):i}})},function(i){if((function(a){return a instanceof Ul})(i))return{values:{},errors:wf(y1(i.issues,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}};throw new Error("Invalid input: not a Zod schema")}const b1=z("ZodISODateTime",(e,t)=>{ET.init(e,t),Ce.init(e,t)});function w1(e){return PA(b1,e)}const x1=z("ZodISODate",(e,t)=>{CT.init(e,t),Ce.init(e,t)});function _1(e){return OA(x1,e)}const S1=z("ZodISOTime",(e,t)=>{RT.init(e,t),Ce.init(e,t)});function E1(e){return kA(S1,e)}const C1=z("ZodISODuration",(e,t)=>{PT.init(e,t),Ce.init(e,t)});function R1(e){return NA(C1,e)}const P1=(e,t)=>{Ul.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>mN(e,n)},flatten:{value:n=>pN(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Oc,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Oc,2)}},isEmpty:{get(){return e.issues.length===0}}})},kt=z("ZodError",P1,{Parent:Error}),O1=ji(kt),k1=Li(kt),N1=Fi(kt),T1=$i(kt),A1=wN(kt),I1=xN(kt),M1=_N(kt),D1=SN(kt),j1=EN(kt),L1=CN(kt),F1=RN(kt),$1=PN(kt),De=z("ZodType",(e,t)=>(Me.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Xs(e,"input"),output:Xs(e,"output")}}),e.toJSONSchema=YA(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Rn(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>Pn(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>O1(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>N1(e,n,r),e.parseAsync=async(n,r)=>k1(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>T1(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>A1(e,n,r),e.decode=(n,r)=>I1(e,n,r),e.encodeAsync=async(n,r)=>M1(e,n,r),e.decodeAsync=async(n,r)=>D1(e,n,r),e.safeEncode=(n,r)=>j1(e,n,r),e.safeDecode=(n,r)=>L1(e,n,r),e.safeEncodeAsync=async(n,r)=>F1(e,n,r),e.safeDecodeAsync=async(n,r)=>$1(e,n,r),e.refine=(n,r)=>e.check(AI(n,r)),e.superRefine=n=>e.check(II(n)),e.overwrite=n=>e.check(Ar(n)),e.optional=()=>Uf(e),e.exactOptional=()=>bI(e),e.nullable=()=>Bf(e),e.nullish=()=>Uf(Bf(e)),e.nonoptional=n=>CI(e,n),e.array=()=>lI(e),e.or=n=>hI([e,n]),e.and=n=>mI(e,n),e.transform=n=>Wf(e,yI(n)),e.default=n=>_I(e,n),e.prefault=n=>EI(e,n),e.catch=n=>PI(e,n),e.pipe=n=>Wf(e,n),e.readonly=()=>NI(e),e.describe=n=>{const r=e.clone();return Gr.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return Gr.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Gr.get(e);const r=e.clone();return Gr.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Qg=z("_ZodString",(e,t)=>{Bl.init(e,t),De.init(e,t),e._zod.processJSONSchema=(r,o,s)=>QA(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(DA(...r)),e.includes=(...r)=>e.check(FA(...r)),e.startsWith=(...r)=>e.check($A(...r)),e.endsWith=(...r)=>e.check(zA(...r)),e.min=(...r)=>e.check(Qs(...r)),e.max=(...r)=>e.check(Zg(...r)),e.length=(...r)=>e.check(Kg(...r)),e.nonempty=(...r)=>e.check(Qs(1,...r)),e.lowercase=r=>e.check(jA(r)),e.uppercase=r=>e.check(LA(r)),e.trim=()=>e.check(UA()),e.normalize=(...r)=>e.check(VA(...r)),e.toLowerCase=()=>e.check(BA()),e.toUpperCase=()=>e.check(WA()),e.slugify=()=>e.check(HA())}),z1=z("ZodString",(e,t)=>{Bl.init(e,t),Qg.init(e,t),e.email=n=>e.check(iA(V1,n)),e.url=n=>e.check(dA(U1,n)),e.jwt=n=>e.check(RA(rI,n)),e.emoji=n=>e.check(fA(B1,n)),e.guid=n=>e.check(Mf($f,n)),e.uuid=n=>e.check(aA(cs,n)),e.uuidv4=n=>e.check(cA(cs,n)),e.uuidv6=n=>e.check(lA(cs,n)),e.uuidv7=n=>e.check(uA(cs,n)),e.nanoid=n=>e.check(hA(W1,n)),e.guid=n=>e.check(Mf($f,n)),e.cuid=n=>e.check(pA(H1,n)),e.cuid2=n=>e.check(mA(Z1,n)),e.ulid=n=>e.check(gA(K1,n)),e.base64=n=>e.check(SA(eI,n)),e.base64url=n=>e.check(EA(tI,n)),e.xid=n=>e.check(yA(q1,n)),e.ksuid=n=>e.check(vA(G1,n)),e.ipv4=n=>e.check(bA(Y1,n)),e.ipv6=n=>e.check(wA(J1,n)),e.cidrv4=n=>e.check(xA(Q1,n)),e.cidrv6=n=>e.check(_A(X1,n)),e.e164=n=>e.check(CA(nI,n)),e.datetime=n=>e.check(w1(n)),e.date=n=>e.check(_1(n)),e.time=n=>e.check(E1(n)),e.duration=n=>e.check(R1(n))});function fn(e){return sA(z1,e)}const Ce=z("ZodStringFormat",(e,t)=>{Se.init(e,t),Qg.init(e,t)}),V1=z("ZodEmail",(e,t)=>{mT.init(e,t),Ce.init(e,t)}),$f=z("ZodGUID",(e,t)=>{hT.init(e,t),Ce.init(e,t)}),cs=z("ZodUUID",(e,t)=>{pT.init(e,t),Ce.init(e,t)}),U1=z("ZodURL",(e,t)=>{gT.init(e,t),Ce.init(e,t)}),B1=z("ZodEmoji",(e,t)=>{yT.init(e,t),Ce.init(e,t)}),W1=z("ZodNanoID",(e,t)=>{vT.init(e,t),Ce.init(e,t)}),H1=z("ZodCUID",(e,t)=>{bT.init(e,t),Ce.init(e,t)}),Z1=z("ZodCUID2",(e,t)=>{wT.init(e,t),Ce.init(e,t)}),K1=z("ZodULID",(e,t)=>{xT.init(e,t),Ce.init(e,t)}),q1=z("ZodXID",(e,t)=>{_T.init(e,t),Ce.init(e,t)}),G1=z("ZodKSUID",(e,t)=>{ST.init(e,t),Ce.init(e,t)}),Y1=z("ZodIPv4",(e,t)=>{OT.init(e,t),Ce.init(e,t)}),J1=z("ZodIPv6",(e,t)=>{kT.init(e,t),Ce.init(e,t)}),Q1=z("ZodCIDRv4",(e,t)=>{NT.init(e,t),Ce.init(e,t)}),X1=z("ZodCIDRv6",(e,t)=>{TT.init(e,t),Ce.init(e,t)}),eI=z("ZodBase64",(e,t)=>{AT.init(e,t),Ce.init(e,t)}),tI=z("ZodBase64URL",(e,t)=>{MT.init(e,t),Ce.init(e,t)}),nI=z("ZodE164",(e,t)=>{DT.init(e,t),Ce.init(e,t)}),rI=z("ZodJWT",(e,t)=>{LT.init(e,t),Ce.init(e,t)}),Xg=z("ZodNumber",(e,t)=>{Ug.init(e,t),De.init(e,t),e._zod.processJSONSchema=(r,o,s)=>XA(e,r,o),e.gt=(r,o)=>e.check(jf(r,o)),e.gte=(r,o)=>e.check(Ia(r,o)),e.min=(r,o)=>e.check(Ia(r,o)),e.lt=(r,o)=>e.check(Df(r,o)),e.lte=(r,o)=>e.check(Aa(r,o)),e.max=(r,o)=>e.check(Aa(r,o)),e.int=r=>e.check(zf(r)),e.safe=r=>e.check(zf(r)),e.positive=r=>e.check(jf(0,r)),e.nonnegative=r=>e.check(Ia(0,r)),e.negative=r=>e.check(Df(0,r)),e.nonpositive=r=>e.check(Aa(0,r)),e.multipleOf=(r,o)=>e.check(Lf(r,o)),e.step=(r,o)=>e.check(Lf(r,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}),oI=z("ZodNumberFormat",(e,t)=>{FT.init(e,t),Xg.init(e,t)});function zf(e){return AA(oI,e)}const sI=z("ZodUnknown",(e,t)=>{$T.init(e,t),De.init(e,t),e._zod.processJSONSchema=(n,r,o)=>t1()});function Vf(){return IA(sI)}const iI=z("ZodNever",(e,t)=>{zT.init(e,t),De.init(e,t),e._zod.processJSONSchema=(n,r,o)=>e1(e,n,r)});function aI(e){return MA(iI,e)}const cI=z("ZodArray",(e,t)=>{VT.init(e,t),De.init(e,t),e._zod.processJSONSchema=(n,r,o)=>s1(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(Qs(n,r)),e.nonempty=n=>e.check(Qs(1,n)),e.max=(n,r)=>e.check(Zg(n,r)),e.length=(n,r)=>e.check(Kg(n,r)),e.unwrap=()=>e.element});function lI(e,t){return ZA(cI,e,t)}const uI=z("ZodObject",(e,t)=>{BT.init(e,t),De.init(e,t),e._zod.processJSONSchema=(n,r,o)=>i1(e,n,r,o),be(e,"shape",()=>t.shape),e.keyof=()=>ey(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Vf()}),e.loose=()=>e.clone({...e._zod.def,catchall:Vf()}),e.strict=()=>e.clone({...e._zod.def,catchall:aI()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>lN(e,n),e.safeExtend=n=>uN(e,n),e.merge=n=>dN(e,n),e.pick=n=>aN(e,n),e.omit=n=>cN(e,n),e.partial=(...n)=>fN(ty,e,n[0]),e.required=(...n)=>hN(ny,e,n[0])});function dI(e,t){const n={type:"object",shape:e??{},...oe(t)};return new uI(n)}const fI=z("ZodUnion",(e,t)=>{WT.init(e,t),De.init(e,t),e._zod.processJSONSchema=(n,r,o)=>a1(e,n,r,o),e.options=t.options});function hI(e,t){return new fI({type:"union",options:e,...oe(t)})}const pI=z("ZodIntersection",(e,t)=>{HT.init(e,t),De.init(e,t),e._zod.processJSONSchema=(n,r,o)=>c1(e,n,r,o)});function mI(e,t){return new pI({type:"intersection",left:e,right:t})}const Nc=z("ZodEnum",(e,t)=>{ZT.init(e,t),De.init(e,t),e._zod.processJSONSchema=(r,o,s)=>n1(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const s={};for(const i of r)if(n.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Nc({...t,checks:[],...oe(o),entries:s})},e.exclude=(r,o)=>{const s={...t.entries};for(const i of r)if(n.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Nc({...t,checks:[],...oe(o),entries:s})}});function ey(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Nc({type:"enum",entries:n,...oe(t)})}const gI=z("ZodTransform",(e,t)=>{KT.init(e,t),De.init(e,t),e._zod.processJSONSchema=(n,r,o)=>o1(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Og(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(vo(s,n.value,t));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),n.issues.push(vo(i))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function yI(e){return new gI({type:"transform",transform:e})}const ty=z("ZodOptional",(e,t)=>{Hg.init(e,t),De.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Jg(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Uf(e){return new ty({type:"optional",innerType:e})}const vI=z("ZodExactOptional",(e,t)=>{qT.init(e,t),De.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Jg(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function bI(e){return new vI({type:"optional",innerType:e})}const wI=z("ZodNullable",(e,t)=>{GT.init(e,t),De.init(e,t),e._zod.processJSONSchema=(n,r,o)=>l1(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Bf(e){return new wI({type:"nullable",innerType:e})}const xI=z("ZodDefault",(e,t)=>{YT.init(e,t),De.init(e,t),e._zod.processJSONSchema=(n,r,o)=>d1(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function _I(e,t){return new xI({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Ag(t)}})}const SI=z("ZodPrefault",(e,t)=>{JT.init(e,t),De.init(e,t),e._zod.processJSONSchema=(n,r,o)=>f1(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function EI(e,t){return new SI({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Ag(t)}})}const ny=z("ZodNonOptional",(e,t)=>{QT.init(e,t),De.init(e,t),e._zod.processJSONSchema=(n,r,o)=>u1(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function CI(e,t){return new ny({type:"nonoptional",innerType:e,...oe(t)})}const RI=z("ZodCatch",(e,t)=>{XT.init(e,t),De.init(e,t),e._zod.processJSONSchema=(n,r,o)=>h1(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function PI(e,t){return new RI({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const OI=z("ZodPipe",(e,t)=>{eA.init(e,t),De.init(e,t),e._zod.processJSONSchema=(n,r,o)=>p1(e,n,r,o),e.in=t.in,e.out=t.out});function Wf(e,t){return new OI({type:"pipe",in:e,out:t})}const kI=z("ZodReadonly",(e,t)=>{tA.init(e,t),De.init(e,t),e._zod.processJSONSchema=(n,r,o)=>m1(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function NI(e){return new kI({type:"readonly",innerType:e})}const TI=z("ZodCustom",(e,t)=>{nA.init(e,t),De.init(e,t),e._zod.processJSONSchema=(n,r,o)=>r1(e,n)});function AI(e,t={}){return KA(TI,e,t)}function II(e){return qA(e)}function Ma(e){return TA(Xg,e)}function Ht({className:e,type:t,...n}){return p.jsx("input",{type:t,"data-slot":"input",className:Ee("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm"," focus-visible:ring-ring/50 focus-visible:ring-[1px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}function Hf(e,[t,n]){return Math.min(n,Math.max(t,e))}function MI(e){const t=DI(e),n=y.forwardRef((r,o)=>{const{children:s,...i}=r,a=y.Children.toArray(s),c=a.find(LI);if(c){const l=c.props.children,d=a.map(u=>u===c?y.Children.count(l)>1?y.Children.only(null):y.isValidElement(l)?l.props.children:null:u);return p.jsx(t,{...i,ref:o,children:y.isValidElement(l)?y.cloneElement(l,void 0,d):null})}return p.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function DI(e){const t=y.forwardRef((n,r)=>{const{children:o,...s}=n;if(y.isValidElement(o)){const i=$I(o),a=FI(s,o.props);return o.type!==y.Fragment&&(a.ref=r?ln(r,i):i),y.cloneElement(o,a)}return y.Children.count(o)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var jI=Symbol("radix.slottable");function LI(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===jI}function FI(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function $I(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function zI(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var ry=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),VI="VisuallyHidden",UI=y.forwardRef((e,t)=>p.jsx(ye.span,{...e,ref:t,style:{...ry,...e.style}}));UI.displayName=VI;var BI=[" ","Enter","ArrowUp","ArrowDown"],WI=[" ","Enter"],Qn="Select",[Vi,Ui,HI]=bl(Qn),[Ir]=tr(Qn,[HI,Pi]),Bi=Pi(),[ZI,On]=Ir(Qn),[KI,qI]=Ir(Qn),oy=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:l,name:d,autoComplete:u,disabled:f,required:h,form:m}=e,g=Bi(t),[v,b]=y.useState(null),[_,w]=y.useState(null),[x,S]=y.useState(!1),P=wl(l),[C,E]=ho({prop:r,defaultProp:o??!1,onChange:s,caller:Qn}),[A,U]=ho({prop:i,defaultProp:a,onChange:c,caller:Qn}),B=y.useRef(null),M=v?m||!!v.closest("form"):!0,[j,V]=y.useState(new Set),Y=Array.from(j).map(L=>L.props.value).join(";");return p.jsx(Im,{...g,children:p.jsxs(ZI,{required:h,scope:t,trigger:v,onTriggerChange:b,valueNode:_,onValueNodeChange:w,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:rn(),value:A,onValueChange:U,open:C,onOpenChange:E,dir:P,triggerPointerDownPosRef:B,disabled:f,children:[p.jsx(Vi.Provider,{scope:t,children:p.jsx(KI,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(L=>{V(K=>new Set(K).add(L))},[]),onNativeOptionRemove:y.useCallback(L=>{V(K=>{const D=new Set(K);return D.delete(L),D})},[]),children:n})}),M?p.jsxs(Ry,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:u,value:A,onChange:L=>U(L.target.value),disabled:f,form:m,children:[A===void 0?p.jsx("option",{value:""}):null,Array.from(j)]},Y):null]})})};oy.displayName=Qn;var sy="SelectTrigger",iy=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=Bi(n),i=On(sy,n),a=i.disabled||r,c=xe(t,i.onTriggerChange),l=Ui(n),d=y.useRef("touch"),[u,f,h]=Oy(g=>{const v=l().filter(w=>!w.disabled),b=v.find(w=>w.value===i.value),_=ky(v,g,b);_!==void 0&&i.onValueChange(_.value)}),m=g=>{a||(i.onOpenChange(!0),h()),g&&(i.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return p.jsx(Mm,{asChild:!0,...s,children:p.jsx(ye.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Py(i.value)?"":void 0,...o,ref:c,onClick:re(o.onClick,g=>{g.currentTarget.focus(),d.current!=="mouse"&&m(g)}),onPointerDown:re(o.onPointerDown,g=>{d.current=g.pointerType;const v=g.target;v.hasPointerCapture(g.pointerId)&&v.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(m(g),g.preventDefault())}),onKeyDown:re(o.onKeyDown,g=>{const v=u.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&f(g.key),!(v&&g.key===" ")&&BI.includes(g.key)&&(m(),g.preventDefault())})})})});iy.displayName=sy;var ay="SelectValue",cy=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,c=On(ay,n),{onValueNodeHasChildrenChange:l}=c,d=s!==void 0,u=xe(t,c.onValueNodeChange);return Ke(()=>{l(d)},[l,d]),p.jsx(ye.span,{...a,ref:u,style:{pointerEvents:"none"},children:Py(c.value)?p.jsx(p.Fragment,{children:i}):s})});cy.displayName=ay;var GI="SelectIcon",ly=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return p.jsx(ye.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});ly.displayName=GI;var YI="SelectPortal",uy=e=>p.jsx(Oi,{asChild:!0,...e});uy.displayName=YI;var Xn="SelectContent",dy=y.forwardRef((e,t)=>{const n=On(Xn,e.__scopeSelect),[r,o]=y.useState();if(Ke(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?ri.createPortal(p.jsx(fy,{scope:e.__scopeSelect,children:p.jsx(Vi.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),s):null}return p.jsx(hy,{...e,ref:t})});dy.displayName=Xn;var Mt=10,[fy,kn]=Ir(Xn),JI="SelectContentImpl",QI=MI("SelectContent.RemoveScroll"),hy=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:c,align:l,alignOffset:d,arrowPadding:u,collisionBoundary:f,collisionPadding:h,sticky:m,hideWhenDetached:g,avoidCollisions:v,...b}=e,_=On(Xn,n),[w,x]=y.useState(null),[S,P]=y.useState(null),C=xe(t,F=>x(F)),[E,A]=y.useState(null),[U,B]=y.useState(null),M=Ui(n),[j,V]=y.useState(!1),Y=y.useRef(!1);y.useEffect(()=>{if(w)return Nl(w)},[w]),xl();const L=y.useCallback(F=>{const[ee,...pe]=M().map(me=>me.ref.current),[ce]=pe.slice(-1),ue=document.activeElement;for(const me of F)if(me===ue||(me?.scrollIntoView({block:"nearest"}),me===ee&&S&&(S.scrollTop=0),me===ce&&S&&(S.scrollTop=S.scrollHeight),me?.focus(),document.activeElement!==ue))return},[M,S]),K=y.useCallback(()=>L([E,w]),[L,E,w]);y.useEffect(()=>{j&&K()},[j,K]);const{onOpenChange:D,triggerPointerDownPosRef:H}=_;y.useEffect(()=>{if(w){let F={x:0,y:0};const ee=ce=>{F={x:Math.abs(Math.round(ce.pageX)-(H.current?.x??0)),y:Math.abs(Math.round(ce.pageY)-(H.current?.y??0))}},pe=ce=>{F.x<=10&&F.y<=10?ce.preventDefault():w.contains(ce.target)||D(!1),document.removeEventListener("pointermove",ee),H.current=null};return H.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",pe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",pe,{capture:!0})}}},[w,D,H]),y.useEffect(()=>{const F=()=>D(!1);return window.addEventListener("blur",F),window.addEventListener("resize",F),()=>{window.removeEventListener("blur",F),window.removeEventListener("resize",F)}},[D]);const[se,N]=Oy(F=>{const ee=M().filter(ue=>!ue.disabled),pe=ee.find(ue=>ue.ref.current===document.activeElement),ce=ky(ee,F,pe);ce&&setTimeout(()=>ce.ref.current.focus())}),Q=y.useCallback((F,ee,pe)=>{const ce=!Y.current&&!pe;(_.value!==void 0&&_.value===ee||ce)&&(A(F),ce&&(Y.current=!0))},[_.value]),W=y.useCallback(()=>w?.focus(),[w]),Z=y.useCallback((F,ee,pe)=>{const ce=!Y.current&&!pe;(_.value!==void 0&&_.value===ee||ce)&&B(F)},[_.value]),ie=r==="popper"?Tc:py,fe=ie===Tc?{side:a,sideOffset:c,align:l,alignOffset:d,arrowPadding:u,collisionBoundary:f,collisionPadding:h,sticky:m,hideWhenDetached:g,avoidCollisions:v}:{};return p.jsx(fy,{scope:n,content:w,viewport:S,onViewportChange:P,itemRefCallback:Q,selectedItem:E,onItemLeave:W,itemTextRefCallback:Z,focusSelectedItem:K,selectedItemText:U,position:r,isPositioned:j,searchRef:se,children:p.jsx(Ni,{as:QI,allowPinchZoom:!0,children:p.jsx(_i,{asChild:!0,trapped:_.open,onMountAutoFocus:F=>{F.preventDefault()},onUnmountAutoFocus:re(o,F=>{_.trigger?.focus({preventScroll:!0}),F.preventDefault()}),children:p.jsx(xi,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:F=>F.preventDefault(),onDismiss:()=>_.onOpenChange(!1),children:p.jsx(ie,{role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:F=>F.preventDefault(),...b,...fe,onPlaced:()=>V(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:re(b.onKeyDown,F=>{const ee=F.ctrlKey||F.altKey||F.metaKey;if(F.key==="Tab"&&F.preventDefault(),!ee&&F.key.length===1&&N(F.key),["ArrowUp","ArrowDown","Home","End"].includes(F.key)){let ce=M().filter(ue=>!ue.disabled).map(ue=>ue.ref.current);if(["ArrowUp","End"].includes(F.key)&&(ce=ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(F.key)){const ue=F.target,me=ce.indexOf(ue);ce=ce.slice(me+1)}setTimeout(()=>L(ce)),F.preventDefault()}})})})})})})});hy.displayName=JI;var XI="SelectItemAlignedPosition",py=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=On(Xn,n),i=kn(Xn,n),[a,c]=y.useState(null),[l,d]=y.useState(null),u=xe(t,C=>d(C)),f=Ui(n),h=y.useRef(!1),m=y.useRef(!0),{viewport:g,selectedItem:v,selectedItemText:b,focusSelectedItem:_}=i,w=y.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&l&&g&&v&&b){const C=s.trigger.getBoundingClientRect(),E=l.getBoundingClientRect(),A=s.valueNode.getBoundingClientRect(),U=b.getBoundingClientRect();if(s.dir!=="rtl"){const ue=U.left-E.left,me=A.left-ue,Oe=C.left-me,qe=C.width+Oe,Nt=Math.max(qe,E.width),gt=window.innerWidth-Mt,Le=Hf(me,[Mt,Math.max(Mt,gt-Nt)]);a.style.minWidth=qe+"px",a.style.left=Le+"px"}else{const ue=E.right-U.right,me=window.innerWidth-A.right-ue,Oe=window.innerWidth-C.right-me,qe=C.width+Oe,Nt=Math.max(qe,E.width),gt=window.innerWidth-Mt,Le=Hf(me,[Mt,Math.max(Mt,gt-Nt)]);a.style.minWidth=qe+"px",a.style.right=Le+"px"}const B=f(),M=window.innerHeight-Mt*2,j=g.scrollHeight,V=window.getComputedStyle(l),Y=parseInt(V.borderTopWidth,10),L=parseInt(V.paddingTop,10),K=parseInt(V.borderBottomWidth,10),D=parseInt(V.paddingBottom,10),H=Y+L+j+D+K,se=Math.min(v.offsetHeight*5,H),N=window.getComputedStyle(g),Q=parseInt(N.paddingTop,10),W=parseInt(N.paddingBottom,10),Z=C.top+C.height/2-Mt,ie=M-Z,fe=v.offsetHeight/2,F=v.offsetTop+fe,ee=Y+L+F,pe=H-ee;if(ee<=Z){const ue=B.length>0&&v===B[B.length-1].ref.current;a.style.bottom="0px";const me=l.clientHeight-g.offsetTop-g.offsetHeight,Oe=Math.max(ie,fe+(ue?W:0)+me+K),qe=ee+Oe;a.style.height=qe+"px"}else{const ue=B.length>0&&v===B[0].ref.current;a.style.top="0px";const Oe=Math.max(Z,Y+g.offsetTop+(ue?Q:0)+fe)+pe;a.style.height=Oe+"px",g.scrollTop=ee-Z+g.offsetTop}a.style.margin=`${Mt}px 0`,a.style.minHeight=se+"px",a.style.maxHeight=M+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[f,s.trigger,s.valueNode,a,l,g,v,b,s.dir,r]);Ke(()=>w(),[w]);const[x,S]=y.useState();Ke(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]);const P=y.useCallback(C=>{C&&m.current===!0&&(w(),_?.(),m.current=!1)},[w,_]);return p.jsx(tM,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:P,children:p.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:x},children:p.jsx(ye.div,{...o,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});py.displayName=XI;var eM="SelectPopperPosition",Tc=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Mt,...s}=e,i=Bi(n);return p.jsx(Dm,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Tc.displayName=eM;var[tM,Wl]=Ir(Xn,{}),Ac="SelectViewport",my=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=kn(Ac,n),i=Wl(Ac,n),a=xe(t,s.onViewportChange),c=y.useRef(0);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),p.jsx(Vi.Slot,{scope:n,children:p.jsx(ye.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:re(o.onScroll,l=>{const d=l.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:f}=i;if(f?.current&&u){const h=Math.abs(c.current-d.scrollTop);if(h>0){const m=window.innerHeight-Mt*2,g=parseFloat(u.style.minHeight),v=parseFloat(u.style.height),b=Math.max(g,v);if(b<m){const _=b+h,w=Math.min(m,_),x=_-w;u.style.height=w+"px",u.style.bottom==="0px"&&(d.scrollTop=x>0?x:0,u.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});my.displayName=Ac;var gy="SelectGroup",[nM,rM]=Ir(gy),oM=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=rn();return p.jsx(nM,{scope:n,id:o,children:p.jsx(ye.div,{role:"group","aria-labelledby":o,...r,ref:t})})});oM.displayName=gy;var yy="SelectLabel",sM=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=rM(yy,n);return p.jsx(ye.div,{id:o.id,...r,ref:t})});sM.displayName=yy;var ei="SelectItem",[iM,vy]=Ir(ei),by=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=On(ei,n),c=kn(ei,n),l=a.value===r,[d,u]=y.useState(s??""),[f,h]=y.useState(!1),m=xe(t,_=>c.itemRefCallback?.(_,r,o)),g=rn(),v=y.useRef("touch"),b=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return p.jsx(iM,{scope:n,value:r,disabled:o,textId:g,isSelected:l,onItemTextChange:y.useCallback(_=>{u(w=>w||(_?.textContent??"").trim())},[]),children:p.jsx(Vi.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:p.jsx(ye.div,{role:"option","aria-labelledby":g,"data-highlighted":f?"":void 0,"aria-selected":l&&f,"data-state":l?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:m,onFocus:re(i.onFocus,()=>h(!0)),onBlur:re(i.onBlur,()=>h(!1)),onClick:re(i.onClick,()=>{v.current!=="mouse"&&b()}),onPointerUp:re(i.onPointerUp,()=>{v.current==="mouse"&&b()}),onPointerDown:re(i.onPointerDown,_=>{v.current=_.pointerType}),onPointerMove:re(i.onPointerMove,_=>{v.current=_.pointerType,o?c.onItemLeave?.():v.current==="mouse"&&_.currentTarget.focus({preventScroll:!0})}),onPointerLeave:re(i.onPointerLeave,_=>{_.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:re(i.onKeyDown,_=>{c.searchRef?.current!==""&&_.key===" "||(WI.includes(_.key)&&b(),_.key===" "&&_.preventDefault())})})})})});by.displayName=ei;var Yr="SelectItemText",wy=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=On(Yr,n),a=kn(Yr,n),c=vy(Yr,n),l=qI(Yr,n),[d,u]=y.useState(null),f=xe(t,b=>u(b),c.onItemTextChange,b=>a.itemTextRefCallback?.(b,c.value,c.disabled)),h=d?.textContent,m=y.useMemo(()=>p.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:g,onNativeOptionRemove:v}=l;return Ke(()=>(g(m),()=>v(m)),[g,v,m]),p.jsxs(p.Fragment,{children:[p.jsx(ye.span,{id:c.textId,...s,ref:f}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?ri.createPortal(s.children,i.valueNode):null]})});wy.displayName=Yr;var xy="SelectItemIndicator",_y=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return vy(xy,n).isSelected?p.jsx(ye.span,{"aria-hidden":!0,...r,ref:t}):null});_y.displayName=xy;var Ic="SelectScrollUpButton",Sy=y.forwardRef((e,t)=>{const n=kn(Ic,e.__scopeSelect),r=Wl(Ic,e.__scopeSelect),[o,s]=y.useState(!1),i=xe(t,r.onScrollButtonChange);return Ke(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollTop>0;s(l)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?p.jsx(Cy,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});Sy.displayName=Ic;var Mc="SelectScrollDownButton",Ey=y.forwardRef((e,t)=>{const n=kn(Mc,e.__scopeSelect),r=Wl(Mc,e.__scopeSelect),[o,s]=y.useState(!1),i=xe(t,r.onScrollButtonChange);return Ke(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<l;s(d)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?p.jsx(Cy,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});Ey.displayName=Mc;var Cy=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=kn("SelectScrollButton",n),i=y.useRef(null),a=Ui(n),c=y.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return y.useEffect(()=>()=>c(),[c]),Ke(()=>{a().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),p.jsx(ye.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:re(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:re(o.onPointerMove,()=>{s.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:re(o.onPointerLeave,()=>{c()})})}),aM="SelectSeparator",cM=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return p.jsx(ye.div,{"aria-hidden":!0,...r,ref:t})});cM.displayName=aM;var Dc="SelectArrow",lM=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Bi(n),s=On(Dc,n),i=kn(Dc,n);return s.open&&i.position==="popper"?p.jsx(jm,{...o,...r,ref:t}):null});lM.displayName=Dc;var uM="SelectBubbleInput",Ry=y.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=y.useRef(null),s=xe(r,o),i=zI(t);return y.useEffect(()=>{const a=o.current;if(!a)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&d){const u=new Event("change",{bubbles:!0});d.call(a,t),a.dispatchEvent(u)}},[i,t]),p.jsx(ye.select,{...n,style:{...ry,...n.style},ref:s,defaultValue:t})});Ry.displayName=uM;function Py(e){return e===""||e===void 0}function Oy(e){const t=Yt(e),n=y.useRef(""),r=y.useRef(0),o=y.useCallback(i=>{const a=n.current+i;t(a),(function c(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(a)},[t]),s=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function ky(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=dM(e,Math.max(s,0));o.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function dM(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var fM=oy,hM=iy,pM=cy,mM=ly,gM=uy,yM=dy,vM=my,bM=by,wM=wy,xM=_y,_M=Sy,SM=Ey;function Da({...e}){return p.jsx(fM,{"data-slot":"select",...e})}function ja({...e}){return p.jsx(pM,{"data-slot":"select-value",...e})}function La({className:e,size:t="default",children:n,...r}){return p.jsxs(hM,{"data-slot":"select-trigger","data-size":t,className:Ee("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,p.jsx(mM,{asChild:!0,children:p.jsx(nm,{className:"size-4 opacity-50"})})]})}function Fa({className:e,children:t,position:n="popper",...r}){return p.jsx(gM,{children:p.jsxs(yM,{"data-slot":"select-content",className:Ee("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[p.jsx(EM,{}),p.jsx(vM,{className:Ee("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),p.jsx(CM,{})]})})}function $a({className:e,children:t,...n}){return p.jsxs(bM,{"data-slot":"select-item",className:Ee("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 ps-2 pe-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[p.jsx("span",{className:"absolute end-2 flex size-3.5 items-center justify-center",children:p.jsx(xM,{children:p.jsx(jE,{className:"size-4"})})}),p.jsx(wM,{children:t})]})}function EM({className:e,...t}){return p.jsx(_M,{"data-slot":"select-scroll-up-button",className:Ee("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx($E,{className:"size-4"})})}function CM({className:e,...t}){return p.jsx(SM,{"data-slot":"select-scroll-down-button",className:Ee("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(nm,{className:"size-4"})})}var RM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],PM=RM.reduce((e,t)=>{const n=im(`Primitive.${t}`),r=y.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),OM="Label",Ny=y.forwardRef((e,t)=>p.jsx(PM.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Ny.displayName=OM;var kM=Ny;function NM({className:e,...t}){return p.jsx(kM,{"data-slot":"label",className:Ee("flex items-center gap-2 text-sm mb-2 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),...t})}const TM=hS,Ty=y.createContext({}),vt=({...e})=>p.jsx(Ty.Provider,{value:{name:e.name},children:p.jsx(dS,{...e})}),Hl=()=>{const e=y.useContext(Ty),t=y.useContext(Ay),{getFieldState:n}=fS(),r=cp({name:e.name}),o=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:s}=t;return{id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...o}},Ay=y.createContext({});function bt({className:e,...t}){const n=y.useId();return p.jsx(Ay.Provider,{value:{id:n},children:p.jsx("div",{"data-slot":"form-item",className:Ee("grid gap-2",e),...t})})}function wt({className:e,children:t,required:n,...r}){const{error:o,formItemId:s}=Hl();return p.jsxs(NM,{"data-slot":"form-label","data-error":!!o,className:e,htmlFor:s,...r,children:[t,n&&p.jsx("span",{className:"text-destructive",children:"*"})]})}function xt({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:o}=Hl();return p.jsx(am,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${o}`:`${r}`,"aria-invalid":!!t,...e})}function _t({className:e,...t}){const{error:n,formMessageId:r}=Hl(),o=n?String(n?.message??""):t.children;return o?p.jsx("p",{"data-slot":"form-message",id:r,className:Ee("text-destructive text-sm",e),...t,children:o}):null}function AM(e){const t=IM(e),n=y.forwardRef((r,o)=>{const{children:s,...i}=r,a=y.Children.toArray(s),c=a.find(DM);if(c){const l=c.props.children,d=a.map(u=>u===c?y.Children.count(l)>1?y.Children.only(null):y.isValidElement(l)?l.props.children:null:u);return p.jsx(t,{...i,ref:o,children:y.isValidElement(l)?y.cloneElement(l,void 0,d):null})}return p.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function IM(e){const t=y.forwardRef((n,r)=>{const{children:o,...s}=n;if(y.isValidElement(o)){const i=LM(o),a=jM(s,o.props);return o.type!==y.Fragment&&(a.ref=r?ln(r,i):i),y.cloneElement(o,a)}return y.Children.count(o)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var MM=Symbol("radix.slottable");function DM(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===MM}function jM(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function LM(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Wi="Dialog",[Iy]=tr(Wi),[FM,Vt]=Iy(Wi),My=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=y.useRef(null),c=y.useRef(null),[l,d]=ho({prop:r,defaultProp:o??!1,onChange:s,caller:Wi});return p.jsx(FM,{scope:t,triggerRef:a,contentRef:c,contentId:rn(),titleId:rn(),descriptionId:rn(),open:l,onOpenChange:d,onOpenToggle:y.useCallback(()=>d(u=>!u),[d]),modal:i,children:n})};My.displayName=Wi;var Dy="DialogTrigger",$M=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Vt(Dy,n),s=xe(t,o.triggerRef);return p.jsx(ye.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ql(o.open),...r,ref:s,onClick:re(e.onClick,o.onOpenToggle)})});$M.displayName=Dy;var Zl="DialogPortal",[zM,jy]=Iy(Zl,{forceMount:void 0}),Ly=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=Vt(Zl,t);return p.jsx(zM,{scope:t,forceMount:n,children:y.Children.map(r,i=>p.jsx(Cn,{present:n||s.open,children:p.jsx(Oi,{asChild:!0,container:o,children:i})}))})};Ly.displayName=Zl;var ti="DialogOverlay",Fy=y.forwardRef((e,t)=>{const n=jy(ti,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Vt(ti,e.__scopeDialog);return s.modal?p.jsx(Cn,{present:r||s.open,children:p.jsx(UM,{...o,ref:t})}):null});Fy.displayName=ti;var VM=AM("DialogOverlay.RemoveScroll"),UM=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Vt(ti,n);return p.jsx(Ni,{as:VM,allowPinchZoom:!0,shards:[o.contentRef],children:p.jsx(ye.div,{"data-state":ql(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),er="DialogContent",$y=y.forwardRef((e,t)=>{const n=jy(er,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Vt(er,e.__scopeDialog);return p.jsx(Cn,{present:r||s.open,children:s.modal?p.jsx(BM,{...o,ref:t}):p.jsx(WM,{...o,ref:t})})});$y.displayName=er;var BM=y.forwardRef((e,t)=>{const n=Vt(er,e.__scopeDialog),r=y.useRef(null),o=xe(t,n.contentRef,r);return y.useEffect(()=>{const s=r.current;if(s)return Nl(s)},[]),p.jsx(zy,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:re(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:re(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:re(e.onFocusOutside,s=>s.preventDefault())})}),WM=y.forwardRef((e,t)=>{const n=Vt(er,e.__scopeDialog),r=y.useRef(!1),o=y.useRef(!1);return p.jsx(zy,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;n.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),zy=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=Vt(er,n),c=y.useRef(null),l=xe(t,c);return xl(),p.jsxs(p.Fragment,{children:[p.jsx(_i,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:p.jsx(xi,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ql(a.open),...i,ref:l,onDismiss:()=>a.onOpenChange(!1)})}),p.jsxs(p.Fragment,{children:[p.jsx(HM,{titleId:a.titleId}),p.jsx(KM,{contentRef:c,descriptionId:a.descriptionId})]})]})}),Kl="DialogTitle",Vy=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Vt(Kl,n);return p.jsx(ye.h2,{id:o.titleId,...r,ref:t})});Vy.displayName=Kl;var Uy="DialogDescription",By=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Vt(Uy,n);return p.jsx(ye.p,{id:o.descriptionId,...r,ref:t})});By.displayName=Uy;var Wy="DialogClose",Hy=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Vt(Wy,n);return p.jsx(ye.button,{type:"button",...r,ref:t,onClick:re(e.onClick,()=>o.onOpenChange(!1))})});Hy.displayName=Wy;function ql(e){return e?"open":"closed"}var Zy="DialogTitleWarning",[FD,Ky]=SC(Zy,{contentName:er,titleName:Kl,docsSlug:"dialog"}),HM=({titleId:e})=>{const t=Ky(Zy),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
100
100
|
|
|
101
101
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
102
102
|
|
|
103
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},N$="DialogDescriptionWarning",D$=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${b0(N$).contentName}}.`;return v.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},I$=o0,j$=c0,L$=l0,F$=u0,z$=f0,$$=p0,V$=g0;function v0({...e}){return g.jsx(I$,{"data-slot":"dialog",...e})}function B$({...e}){return g.jsx(j$,{"data-slot":"dialog-portal",...e})}function U$({className:e,...t}){return g.jsx(L$,{"data-slot":"dialog-overlay",className:Se("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function x0({className:e,children:t,showCloseButton:n=!0,...r}){return g.jsxs(B$,{"data-slot":"dialog-portal",children:[g.jsx(U$,{}),g.jsxs(F$,{"data-slot":"dialog-content",className:Se("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,n&&g.jsxs(V$,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[g.jsx(a1,{}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function _0({className:e,...t}){return g.jsx("div",{"data-slot":"dialog-header",className:Se("flex flex-col gap-2 text-center sm:text-start",e),...t})}function w0({className:e,...t}){return g.jsx("div",{"data-slot":"dialog-footer",className:Se("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function S0({className:e,...t}){return g.jsx(z$,{"data-slot":"dialog-title",className:Se("text-lg leading-none font-semibold",e),...t})}function E0({className:e,...t}){return g.jsx($$,{"data-slot":"dialog-description",className:Se("text-muted-foreground text-sm",e),...t})}const W$=ww({name:pt().min(1,"Name is required"),type:lh(["http","tcp","keyword","json_query","websocket","ping","dns","push","steam","docker"]),intervalSeconds:js().min(1,"Interval must be at least 1s"),timeoutMs:js().min(100,"Timeout must be at least 100ms"),url:pt().optional(),host:pt().optional(),port:js().optional(),method:pt().optional(),keyword:pt().optional(),jsonQuery:pt().optional(),expectedValue:pt().optional(),dnsRecordType:pt().optional()});function Nd({open:e,onOpenChange:t,monitor:n,onSubmit:r}){const s=!!n,[o,i]=v.useState(!1),a=Cf({resolver:vw(W$),defaultValues:{name:"",type:"http",intervalSeconds:20,timeoutMs:8e3,method:"GET",url:"",host:"",keyword:"",jsonQuery:"",expectedValue:""}});v.useEffect(()=>{e&&(n?a.reset({name:n.name,type:n.type,intervalSeconds:n.intervalSeconds,timeoutMs:n.timeoutMs,url:n.url??"",host:n.host??"",port:n.port,method:n.method??"GET",keyword:n.keyword??"",jsonQuery:n.jsonQuery??"",expectedValue:n.expectedValue??"",dnsRecordType:n.dnsRecordType??""}):a.reset({name:"",type:"http",intervalSeconds:20,timeoutMs:8e3,method:"GET",url:"",host:"",keyword:"",jsonQuery:"",expectedValue:""}))},[e,n,a]);const c=a.watch("type"),l=async u=>{i(!0);try{await r(u),t(!1)}catch(d){console.error(d)}finally{i(!1)}};return g.jsx(v0,{open:e,onOpenChange:t,children:g.jsxs(x0,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[g.jsxs(_0,{children:[g.jsx(S0,{children:s?"Edit Monitor":"New Monitor"}),g.jsx(E0,{children:s?"Update monitor configuration.":"Configure parameters for a new uptime monitor."})]}),g.jsx(t0,{...a,children:g.jsxs("form",{onSubmit:a.handleSubmit(l),className:"space-y-4",children:[g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:a.control,name:"name",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Name"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"My Website",...u})}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:a.control,name:"type",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Type"}),g.jsxs(Ls,{onValueChange:u.onChange,defaultValue:u.value,value:u.value,children:[g.jsx(je,{children:g.jsx(zs,{children:g.jsx(Fs,{placeholder:"Select type"})})}),g.jsx($s,{children:["http","tcp","keyword","json_query","websocket","ping","dns","push","steam","docker"].map(d=>g.jsx(Vs,{value:d,children:d.toUpperCase()},d))})]}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:a.control,name:"intervalSeconds",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Interval (s)"}),g.jsx(je,{children:g.jsx(nt,{type:"number",...u})}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:a.control,name:"timeoutMs",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Timeout (ms)"}),g.jsx(je,{children:g.jsx(nt,{type:"number",...u})}),g.jsx(Le,{})]})})]}),(c==="http"||c==="keyword"||c==="json_query"||c==="websocket")&&g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:a.control,name:"url",render:({field:u})=>g.jsxs(De,{className:"sm:col-span-2",children:[g.jsx(Ie,{children:"URL"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"https://example.com",...u})}),g.jsx(Le,{})]})}),c!=="websocket"&&g.jsx(Ne,{control:a.control,name:"method",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Method"}),g.jsxs(Ls,{onValueChange:u.onChange,defaultValue:u.value,value:u.value,children:[g.jsx(je,{children:g.jsx(zs,{children:g.jsx(Fs,{placeholder:"Select method"})})}),g.jsx($s,{children:["GET","POST","PUT","DELETE"].map(d=>g.jsx(Vs,{value:d,children:d},d))})]}),g.jsx(Le,{})]})})]}),(c==="tcp"||c==="ping"||c==="dns"||c==="steam")&&g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:a.control,name:"host",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Host"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"example.com",...u})}),g.jsx(Le,{})]})}),(c==="tcp"||c==="steam")&&g.jsx(Ne,{control:a.control,name:"port",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Port"}),g.jsx(je,{children:g.jsx(nt,{type:"number",...u})}),g.jsx(Le,{})]})}),c==="dns"&&g.jsx(Ne,{control:a.control,name:"dnsRecordType",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Record Type"}),g.jsxs(Ls,{onValueChange:u.onChange,defaultValue:u.value,value:u.value,children:[g.jsx(je,{children:g.jsx(zs,{children:g.jsx(Fs,{placeholder:"Select Record Type"})})}),g.jsx($s,{children:["A","AAAA","CNAME","TXT","MX","NS"].map(d=>g.jsx(Vs,{value:d,children:d},d))})]}),g.jsx(Le,{})]})})]}),c==="keyword"&&g.jsx(Ne,{control:a.control,name:"keyword",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Keyword"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"Search string...",...u})}),g.jsx(Le,{})]})}),c==="json_query"&&g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:a.control,name:"jsonQuery",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"JSON Query (jq)"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"$.data.status",...u})}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:a.control,name:"expectedValue",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Expected Value"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"healthy",...u})}),g.jsx(Le,{})]})})]}),c==="push"&&g.jsx("div",{className:"rounded-lg border bg-muted p-4 text-sm text-muted-foreground",children:"Push monitors generate a token on create. You will see the Push URL in the monitor details after saving."}),g.jsxs(w0,{children:[g.jsx(gt,{type:"button",variant:"outline",onClick:()=>t(!1),disabled:o,children:"Cancel"}),g.jsxs(gt,{type:"submit",disabled:o,children:[o&&g.jsx(If,{className:"mr-2 h-4 w-4 animate-spin"}),s?"Update":"Create"]})]})]})})]})})}function k0({open:e,onOpenChange:t,monitor:n,onConfirm:r}){const[s,o]=T.useState(!1);async function i(){o(!0);try{await r(),t(!1)}catch(a){console.error(a)}finally{o(!1)}}return g.jsx(v0,{open:e,onOpenChange:t,children:g.jsxs(x0,{className:"sm:max-w-md",children:[g.jsxs(_0,{children:[g.jsx(S0,{children:"Delete Monitor"}),g.jsxs(E0,{children:["Are you sure you want to delete ",g.jsx("span",{className:"font-semibold text-foreground",children:n?.name}),"? This action cannot be undone and will delete all historical data for this monitor."]})]}),g.jsxs(w0,{children:[g.jsx(gt,{variant:"outline",onClick:()=>t(!1),disabled:s,children:"Cancel"}),g.jsxs(gt,{variant:"destructive",onClick:i,disabled:s,children:[s?g.jsx(If,{className:"mr-2 h-4 w-4 animate-spin"}):g.jsx(jf,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})})}function H$(){const e=Hv(),t=ls(),{data:n,loading:r}=qv(k=>k.monitors),[s,o]=v.useState(""),[i,a]=v.useState(!1),[c,l]=v.useState(!1),[u,d]=v.useState(!1),[f,h]=v.useState(null);v.useEffect(()=>{e(Ur(60));const k=setInterval(()=>e(Ur(60)),3e4);return()=>clearInterval(k)},[e]);const p=v.useMemo(()=>{if(!s)return n;const k=s.toLowerCase();return n.filter(E=>E.monitor.name.toLowerCase().includes(k)||E.monitor.host?.toLowerCase().includes(k))},[n,s]),m=async k=>{try{await e(px(k)).unwrap(),Ee.success("Monitor created"),e(Ur(60))}catch(E){throw Ee.error(E||"Failed to create monitor"),E}},y=async k=>{if(f)try{await e(Df({id:f.id,data:k})).unwrap(),Ee.success("Monitor updated"),e(Ur(60))}catch(E){throw Ee.error(E||"Failed to update monitor"),E}},b=async()=>{if(f)try{await e(Nf(f.id)).unwrap(),Ee.success("Monitor deleted")}catch(k){throw Ee.error(k||"Failed to delete monitor"),k}},x=async k=>{try{await e(dc({id:k.id,paused:!k.isPaused})).unwrap(),Ee.success(k.isPaused?"Resumed":"Paused")}catch(E){Ee.error(E||"Failed to toggle pause")}},_=async k=>{Ee.info("Clone feature coming soon")},w=k=>{h(k),l(!0)},S=k=>{h(k),d(!0)},C=k=>{t({to:"/monitors/$id",params:{id:k.id}})};return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[g.jsxs("div",{children:[g.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Monitors"}),g.jsx("p",{className:"text-muted-foreground",children:"Manage your uptime monitors and status checks."})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs("div",{className:"relative w-full md:w-auto",children:[g.jsx(Ex,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),g.jsx(nt,{placeholder:"Search monitors...",value:s,onChange:k=>o(k.target.value),className:"pl-8 w-full md:w-[250px]"})]}),g.jsxs(gt,{onClick:()=>{h(null),a(!0)},children:[g.jsx(Mm,{className:"mr-2 h-4 w-4"})," Add Monitor"]})]})]}),r&&n.length===0?g.jsx("div",{className:"flex h-64 items-center justify-center",children:g.jsx(If,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):p.length===0?g.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed p-8 text-center animate-in fade-in-50",children:[g.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-muted",children:g.jsx(KM,{className:"h-6 w-6 text-muted-foreground"})}),g.jsx("h3",{className:"mt-4 text-lg font-semibold",children:"No monitors found"}),g.jsx("p",{className:"mb-4 mt-2 text-sm text-muted-foreground",children:s?"Try adjusting your search terms.":"Get started by adding your first monitor."}),!s&&g.jsxs(gt,{onClick:()=>a(!0),children:[g.jsx(Mm,{className:"mr-2 h-4 w-4"})," Add Monitor"]})]}):g.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:p.map(k=>g.jsx(HI,{summary:k,onEdit:w,onDelete:S,onPause:x,onClone:_,onDetails:C},k.monitor.id))}),g.jsx(Nd,{open:i,onOpenChange:a,onSubmit:m}),g.jsx(Nd,{open:c,onOpenChange:l,monitor:f,onSubmit:y}),g.jsx(k0,{open:u,onOpenChange:d,monitor:f,onConfirm:b})]})}function Rs({className:e,...t}){return g.jsx("div",{"data-slot":"card",className:Se("bg-card text-card-foreground flex flex-col gap-4 rounded-xl border py-6 shadow-sm",e),...t})}function Ps({className:e,...t}){return g.jsx("div",{"data-slot":"card-header",className:Se("@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),...t})}function Os({className:e,...t}){return g.jsx("div",{"data-slot":"card-title",className:Se("leading-none font-semibold",e),...t})}function C0({className:e,...t}){return g.jsx("div",{"data-slot":"card-description",className:Se("text-muted-foreground text-sm",e),...t})}function Ts({className:e,...t}){return g.jsx("div",{"data-slot":"card-content",className:Se("px-6",e),...t})}const q$=ww({name:pt().min(1,"Name is required"),type:lh(["http","tcp","keyword","json_query","websocket","ping","dns","push","steam","docker"]),intervalSeconds:js().min(1,"Interval must be at least 1s"),timeoutMs:js().min(100,"Timeout must be at least 100ms"),url:pt().optional(),host:pt().optional(),port:js().optional(),method:pt().optional(),keyword:pt().optional(),jsonQuery:pt().optional(),expectedValue:pt().optional(),dnsRecordType:pt().optional()});function Ng(){const e=ls(),n=pi({strict:!1})?.id,r=Cf({resolver:vw(q$),defaultValues:{name:"",type:"http",intervalSeconds:20,timeoutMs:8e3,method:"GET",url:"",host:"",keyword:"",jsonQuery:"",expectedValue:""}}),{reset:s,watch:o,control:i}=r;v.useEffect(()=>{n&&(async()=>{try{const u=(await Te.get("/monitors")).data.monitors.find(d=>d.id===n);u&&s({...u,intervalSeconds:u.intervalSeconds,timeoutMs:u.timeoutMs})}catch{Ee.error("Failed to load monitor")}})()},[n,s]);const a=o("type"),c=async l=>{try{const u={...l};n?(await Te.put(`/monitors/${n}`,u),Ee.success("Monitor updated")):(await Te.post("/monitors",u),Ee.success("Monitor created")),e({to:"/"})}catch(u){Ee.error(u?.response?.data?.detail??"Save failed")}};return g.jsxs("div",{className:"mx-auto max-w-3xl space-y-6",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(gt,{variant:"ghost",size:"icon",onClick:()=>e({to:"/"}),children:g.jsx(yx,{className:"h-4 w-4"})}),g.jsx("h2",{className:"text-xl font-semibold",children:n?"Edit Monitor":"New Monitor"})]}),g.jsxs(Rs,{children:[g.jsxs(Ps,{children:[g.jsx(Os,{children:"Monitor Configuration"}),g.jsx(C0,{children:"Configure the settings for your uptime monitor."})]}),g.jsx(Ts,{children:g.jsx(t0,{...r,children:g.jsxs("form",{onSubmit:r.handleSubmit(c),className:"space-y-6",children:[g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:i,name:"name",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Name"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"My Website",...l})}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:i,name:"type",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Type"}),g.jsxs(Ls,{onValueChange:l.onChange,defaultValue:l.value,value:l.value,children:[g.jsx(je,{children:g.jsx(zs,{children:g.jsx(Fs,{placeholder:"Select type"})})}),g.jsx($s,{children:["http","tcp","keyword","json_query","websocket","ping","dns","push","steam","docker"].map(u=>g.jsx(Vs,{value:u,children:u.toUpperCase()},u))})]}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:i,name:"intervalSeconds",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Interval (s)"}),g.jsx(je,{children:g.jsx(nt,{type:"number",...l})}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:i,name:"timeoutMs",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Timeout (ms)"}),g.jsx(je,{children:g.jsx(nt,{type:"number",...l})}),g.jsx(Le,{})]})})]}),(a==="http"||a==="keyword"||a==="json_query"||a==="websocket")&&g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:i,name:"url",render:({field:l})=>g.jsxs(De,{className:"sm:col-span-2",children:[g.jsx(Ie,{children:"URL"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"https://example.com",...l})}),g.jsx(Le,{})]})}),a!=="websocket"&&g.jsx(Ne,{control:i,name:"method",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Method"}),g.jsxs(Ls,{onValueChange:l.onChange,defaultValue:l.value,value:l.value,children:[g.jsx(je,{children:g.jsx(zs,{children:g.jsx(Fs,{placeholder:"Select method"})})}),g.jsx($s,{children:["GET","POST","PUT","DELETE"].map(u=>g.jsx(Vs,{value:u,children:u},u))})]}),g.jsx(Le,{})]})})]}),(a==="tcp"||a==="ping"||a==="dns"||a==="steam")&&g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:i,name:"host",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Host"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"example.com",...l})}),g.jsx(Le,{})]})}),(a==="tcp"||a==="steam")&&g.jsx(Ne,{control:i,name:"port",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Port"}),g.jsx(je,{children:g.jsx(nt,{type:"number",...l})}),g.jsx(Le,{})]})}),a==="dns"&&g.jsx(Ne,{control:i,name:"dnsRecordType",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Record Type"}),g.jsxs(Ls,{onValueChange:l.onChange,defaultValue:l.value,value:l.value,children:[g.jsx(je,{children:g.jsx(zs,{children:g.jsx(Fs,{placeholder:"Select Record Type"})})}),g.jsx($s,{children:["A","AAAA","CNAME","TXT","MX","NS"].map(u=>g.jsx(Vs,{value:u,children:u},u))})]}),g.jsx(Le,{})]})})]}),a==="keyword"&&g.jsx(Ne,{control:i,name:"keyword",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Keyword"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"Search string...",...l})}),g.jsx(Le,{})]})}),a==="json_query"&&g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:i,name:"jsonQuery",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"JSON Query (jq)"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"$.data.status",...l})}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:i,name:"expectedValue",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Expected Value"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"healthy",...l})}),g.jsx(Le,{})]})})]}),a==="push"&&g.jsx("div",{className:"rounded-lg border bg-muted p-4 text-sm text-muted-foreground",children:"Push monitors generate a token on create. You will see the Push URL in the monitor details after saving."}),g.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[g.jsx(gt,{type:"button",variant:"outline",onClick:()=>e({to:"/"}),children:"Cancel"}),g.jsx(gt,{type:"submit",disabled:r.formState.isSubmitting,children:r.formState.isSubmitting?"Saving...":"Save Monitor"})]})]})})})]})]})}const Mn=Object.create(null);Mn.open="0";Mn.close="1";Mn.ping="2";Mn.pong="3";Mn.message="4";Mn.upgrade="5";Mn.noop="6";const La=Object.create(null);Object.keys(Mn).forEach(e=>{La[Mn[e]]=e});const Dd={type:"error",data:"parser error"},R0=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",P0=typeof ArrayBuffer=="function",O0=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,mh=({type:e,data:t},n,r)=>R0&&t instanceof Blob?n?r(t):Dg(t,r):P0&&(t instanceof ArrayBuffer||O0(t))?n?r(t):Dg(new Blob([t]),r):r(Mn[e]+(t||"")),Dg=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function Ig(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let _u;function K$(e,t){if(R0&&e.data instanceof Blob)return e.data.arrayBuffer().then(Ig).then(t);if(P0&&(e.data instanceof ArrayBuffer||O0(e.data)))return t(Ig(e.data));mh(e,!1,n=>{_u||(_u=new TextEncoder),t(_u.encode(n))})}const jg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Mo=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<jg.length;e++)Mo[jg.charCodeAt(e)]=e;const Z$=e=>{let t=e.length*.75,n=e.length,r,s=0,o,i,a,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const l=new ArrayBuffer(t),u=new Uint8Array(l);for(r=0;r<n;r+=4)o=Mo[e.charCodeAt(r)],i=Mo[e.charCodeAt(r+1)],a=Mo[e.charCodeAt(r+2)],c=Mo[e.charCodeAt(r+3)],u[s++]=o<<2|i>>4,u[s++]=(i&15)<<4|a>>2,u[s++]=(a&3)<<6|c&63;return l},G$=typeof ArrayBuffer=="function",gh=(e,t)=>{if(typeof e!="string")return{type:"message",data:T0(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:Y$(e.substring(1),t)}:La[n]?e.length>1?{type:La[n],data:e.substring(1)}:{type:La[n]}:Dd},Y$=(e,t)=>{if(G$){const n=Z$(e);return T0(n,t)}else return{base64:!0,data:e}},T0=(e,t)=>t==="blob"?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,M0="",X$=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((o,i)=>{mh(o,!1,a=>{r[i]=a,++s===n&&t(r.join(M0))})})},J$=(e,t)=>{const n=e.split(M0),r=[];for(let s=0;s<n.length;s++){const o=gh(n[s],t);if(r.push(o),o.type==="error")break}return r};function Q$(){return new TransformStream({transform(e,t){K$(e,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const o=new DataView(s.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{s=new Uint8Array(9);const o=new DataView(s.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let wu;function ca(e){return e.reduce((t,n)=>t+n.length,0)}function la(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;s<t;s++)n[s]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function eV(e,t){wu||(wu=new TextDecoder);const n=[];let r=0,s=-1,o=!1;return new TransformStream({transform(i,a){for(n.push(i);;){if(r===0){if(ca(n)<1)break;const c=la(n,1);o=(c[0]&128)===128,s=c[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(ca(n)<2)break;const c=la(n,2);s=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),r=3}else if(r===2){if(ca(n)<8)break;const c=la(n,8),l=new DataView(c.buffer,c.byteOffset,c.length),u=l.getUint32(0);if(u>Math.pow(2,21)-1){a.enqueue(Dd);break}s=u*Math.pow(2,32)+l.getUint32(4),r=3}else{if(ca(n)<s)break;const c=la(n,s);a.enqueue(gh(o?c:wu.decode(c),t)),r=0}if(s===0||s>e){a.enqueue(Dd);break}}}})}const A0=4;function Xe(e){if(e)return tV(e)}function tV(e){for(var t in Xe.prototype)e[t]=Xe.prototype[t];return e}Xe.prototype.on=Xe.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Xe.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Xe.prototype.off=Xe.prototype.removeListener=Xe.prototype.removeAllListeners=Xe.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,s=0;s<n.length;s++)if(r=n[s],r===t||r.fn===t){n.splice(s,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Xe.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,s=n.length;r<s;++r)n[r].apply(this,t)}return this};Xe.prototype.emitReserved=Xe.prototype.emit;Xe.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Xe.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Sl=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Xt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),nV="arraybuffer";function N0(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const rV=Xt.setTimeout,sV=Xt.clearTimeout;function El(e,t){t.useNativeTimers?(e.setTimeoutFn=rV.bind(Xt),e.clearTimeoutFn=sV.bind(Xt)):(e.setTimeoutFn=Xt.setTimeout.bind(Xt),e.clearTimeoutFn=Xt.clearTimeout.bind(Xt))}const oV=1.33;function iV(e){return typeof e=="string"?aV(e):Math.ceil((e.byteLength||e.size)*oV)}function aV(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function D0(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function cV(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function lV(e){let t={},n=e.split("&");for(let r=0,s=n.length;r<s;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class uV extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class yh extends Xe{constructor(t){super(),this.writable=!1,El(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new uV(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=gh(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=cV(t);return n.length?"?"+n:""}}class dV extends yh{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};J$(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,X$(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=D0()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let I0=!1;try{I0=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const fV=I0;function hV(){}class pV extends dV{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(s,o)=>{this.onError("xhr post error",s,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Cn extends Xe{constructor(t,n,r){super(),this.createRequest=t,El(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=N0(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=Cn.requestsCount++,Cn.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=hV,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Cn.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Cn.requestsCount=0;Cn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Lg);else if(typeof addEventListener=="function"){const e="onpagehide"in Xt?"pagehide":"unload";addEventListener(e,Lg,!1)}}function Lg(){for(let e in Cn.requests)Cn.requests.hasOwnProperty(e)&&Cn.requests[e].abort()}const mV=(function(){const e=j0({xdomain:!1});return e&&e.responseType!==null})();class gV extends pV{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=mV&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Cn(j0,this.uri(),t)}}function j0(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||fV))return new XMLHttpRequest}catch{}if(!t)try{return new Xt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const L0=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class yV extends yh{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=L0?{}:N0(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;mh(r,this.supportsBinary,o=>{try{this.doWrite(r,o)}catch{}s&&Sl(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=D0()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Su=Xt.WebSocket||Xt.MozWebSocket;class bV extends yV{createSocket(t,n,r){return L0?new Su(t,n,r):n?new Su(t,n):new Su(t)}doWrite(t,n){this.ws.send(n)}}class vV extends yh{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=eV(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=Q$();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const o=()=>{r.read().then(({done:a,value:c})=>{a||(this.onPacket(c),o())}).catch(a=>{})};o();const i={type:"open"};this.query.sid&&(i.data=`{"sid":"${this.query.sid}"}`),this._writer.write(i).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;this._writer.write(r).then(()=>{s&&Sl(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const xV={websocket:bV,webtransport:vV,polling:gV},_V=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,wV=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Id(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=_V.exec(e||""),o={},i=14;for(;i--;)o[wV[i]]=s[i]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=SV(o,o.path),o.queryKey=EV(o,o.query),o}function SV(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function EV(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,o){s&&(n[s]=o)}),n}const jd=typeof addEventListener=="function"&&typeof removeEventListener=="function",Fa=[];jd&&addEventListener("offline",()=>{Fa.forEach(e=>e())},!1);class fr extends Xe{constructor(t,n){if(super(),this.binaryType=nV,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Id(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Id(n.host).host);El(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const s=r.prototype.name;this.transports.push(s),this._transportsByName[s]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=lV(this.opts.query)),jd&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Fa.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=A0,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&fr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",fr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const s=this.writeBuffer[r].data;if(s&&(n+=iV(s)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Sl(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,s){if(typeof n=="function"&&(s=n,n=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(fr.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),jd&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Fa.indexOf(this._offlineEventListener);r!==-1&&Fa.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}fr.protocol=A0;class kV extends fr{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;fr.priorWebsocketSuccess=!1;const s=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;fr.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function o(){r||(r=!0,u(),n.close(),n=null)}const i=d=>{const f=new Error("probe error: "+d);f.transport=n.name,o(),this.emitReserved("upgradeError",f)};function a(){i("transport closed")}function c(){i("socket closed")}function l(d){n&&d.name!==n.name&&o()}const u=()=>{n.removeListener("open",s),n.removeListener("error",i),n.removeListener("close",a),this.off("close",c),this.off("upgrading",l)};n.once("open",s),n.once("error",i),n.once("close",a),this.once("close",c),this.once("upgrading",l),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let CV=class extends kV{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(s=>xV[s]).filter(s=>!!s)),super(t,r)}};function RV(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Id(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const PV=typeof ArrayBuffer=="function",OV=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,F0=Object.prototype.toString,TV=typeof Blob=="function"||typeof Blob<"u"&&F0.call(Blob)==="[object BlobConstructor]",MV=typeof File=="function"||typeof File<"u"&&F0.call(File)==="[object FileConstructor]";function bh(e){return PV&&(e instanceof ArrayBuffer||OV(e))||TV&&e instanceof Blob||MV&&e instanceof File}function za(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(za(e[n]))return!0;return!1}if(bh(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return za(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&za(e[n]))return!0;return!1}function AV(e){const t=[],n=e.data,r=e;return r.data=Ld(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Ld(e,t){if(!e)return e;if(bh(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Ld(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Ld(e[r],t));return n}return e}function NV(e,t){return e.data=Fd(e.data,t),delete e.attachments,e}function Fd(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Fd(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Fd(e[n],t));return e}const DV=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var _e;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(_e||(_e={}));class IV{constructor(t){this.replacer=t}encode(t){return(t.type===_e.EVENT||t.type===_e.ACK)&&za(t)?this.encodeAsBinary({type:t.type===_e.EVENT?_e.BINARY_EVENT:_e.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===_e.BINARY_EVENT||t.type===_e.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=AV(t),r=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(r),s}}class vh extends Xe{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===_e.BINARY_EVENT;r||n.type===_e.BINARY_ACK?(n.type=r?_e.EVENT:_e.ACK,this.reconstructor=new jV(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(bh(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(_e[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===_e.BINARY_EVENT||r.type===_e.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const i=t.substring(o,n);if(i!=Number(i)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(i)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const s=t.charAt(n+1);if(s!==""&&Number(s)==s){const o=n+1;for(;++n;){const i=t.charAt(n);if(i==null||Number(i)!=i){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(vh.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case _e.CONNECT:return Fg(n);case _e.DISCONNECT:return n===void 0;case _e.CONNECT_ERROR:return typeof n=="string"||Fg(n);case _e.EVENT:case _e.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&DV.indexOf(n[0])===-1);case _e.ACK:case _e.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class jV{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=NV(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function Fg(e){return Object.prototype.toString.call(e)==="[object Object]"}const LV=Object.freeze(Object.defineProperty({__proto__:null,Decoder:vh,Encoder:IV,get PacketType(){return _e}},Symbol.toStringTag,{value:"Module"}));function ln(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const FV=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class z0 extends Xe{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[ln(t,"open",this.onopen.bind(this)),ln(t,"packet",this.onpacket.bind(this)),ln(t,"error",this.onerror.bind(this)),ln(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,s,o;if(FV.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const i={type:_e.EVENT,data:n};if(i.options={},i.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const u=this.ids++,d=n.pop();this._registerAckCallback(u,d),i.id=u}const a=(s=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||s===void 0?void 0:s.writable,c=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!a||(c?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}_registerAckCallback(t,n){var r;const s=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(s===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},s),i=(...a)=>{this.io.clearTimeoutFn(o),n.apply(this,a)};i.withError=!0,this.acks[t]=i}emitWithAck(t,...n){return new Promise((r,s)=>{const o=(i,a)=>i?s(i):r(a);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...o)=>(this._queue[0],s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(s)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:_e.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case _e.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case _e.EVENT:case _e.BINARY_EVENT:this.onevent(t);break;case _e.ACK:case _e.BINARY_ACK:this.onack(t);break;case _e.DISCONNECT:this.ondisconnect();break;case _e.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...s){r||(r=!0,n.packet({type:_e.ACK,id:t,data:s}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:_e.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function io(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}io.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};io.prototype.reset=function(){this.attempts=0};io.prototype.setMin=function(e){this.ms=e};io.prototype.setMax=function(e){this.max=e};io.prototype.setJitter=function(e){this.jitter=e};class zd extends Xe{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,El(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new io({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||LV;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new CV(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=ln(n,"open",function(){r.onopen(),t&&t()}),o=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},i=ln(n,"error",o);if(this._timeout!==!1){const a=this._timeout,c=this.setTimeoutFn(()=>{s(),o(new Error("timeout")),n.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(s),this.subs.push(i),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(ln(t,"ping",this.onping.bind(this)),ln(t,"data",this.ondata.bind(this)),ln(t,"error",this.onerror.bind(this)),ln(t,"close",this.onclose.bind(this)),ln(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Sl(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new z0(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const xo={};function $a(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=RV(e,t.path||"/socket.io"),r=n.source,s=n.id,o=n.path,i=xo[s]&&o in xo[s].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||i;let c;return a?c=new zd(r,t):(xo[s]||(xo[s]=new zd(r,t)),c=xo[s]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign($a,{Manager:zd,Socket:z0,io:$a,connect:$a});function Pi(e){return e+.5|0}const ir=(e,t,n)=>Math.max(Math.min(e,n),t);function Ao(e){return ir(Pi(e*2.55),0,255)}function hr(e){return ir(Pi(e*255),0,255)}function $n(e){return ir(Pi(e/2.55)/100,0,1)}function zg(e){return ir(Pi(e*100),0,100)}const Zt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},$d=[..."0123456789ABCDEF"],zV=e=>$d[e&15],$V=e=>$d[(e&240)>>4]+$d[e&15],ua=e=>(e&240)>>4===(e&15),VV=e=>ua(e.r)&&ua(e.g)&&ua(e.b)&&ua(e.a);function BV(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Zt[e[1]]*17,g:255&Zt[e[2]]*17,b:255&Zt[e[3]]*17,a:t===5?Zt[e[4]]*17:255}:(t===7||t===9)&&(n={r:Zt[e[1]]<<4|Zt[e[2]],g:Zt[e[3]]<<4|Zt[e[4]],b:Zt[e[5]]<<4|Zt[e[6]],a:t===9?Zt[e[7]]<<4|Zt[e[8]]:255})),n}const UV=(e,t)=>e<255?t(e):"";function WV(e){var t=VV(e)?zV:$V;return e?"#"+t(e.r)+t(e.g)+t(e.b)+UV(e.a,t):void 0}const HV=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function $0(e,t,n){const r=t*Math.min(n,1-n),s=(o,i=(o+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[s(0),s(8),s(4)]}function qV(e,t,n){const r=(s,o=(s+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[r(5),r(3),r(1)]}function KV(e,t,n){const r=$0(e,1,.5);let s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)r[s]*=1-t-n,r[s]+=t;return r}function ZV(e,t,n,r,s){return e===s?(t-n)/r+(t<n?6:0):t===s?(n-e)/r+2:(e-t)/r+4}function xh(e){const n=e.r/255,r=e.g/255,s=e.b/255,o=Math.max(n,r,s),i=Math.min(n,r,s),a=(o+i)/2;let c,l,u;return o!==i&&(u=o-i,l=a>.5?u/(2-o-i):u/(o+i),c=ZV(n,r,s,u,o),c=c*60+.5),[c|0,l||0,a]}function _h(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(hr)}function wh(e,t,n){return _h($0,e,t,n)}function GV(e,t,n){return _h(KV,e,t,n)}function YV(e,t,n){return _h(qV,e,t,n)}function V0(e){return(e%360+360)%360}function XV(e){const t=HV.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Ao(+t[5]):hr(+t[5]));const s=V0(+t[2]),o=+t[3]/100,i=+t[4]/100;return t[1]==="hwb"?r=GV(s,o,i):t[1]==="hsv"?r=YV(s,o,i):r=wh(s,o,i),{r:r[0],g:r[1],b:r[2],a:n}}function JV(e,t){var n=xh(e);n[0]=V0(n[0]+t),n=wh(n),e.r=n[0],e.g=n[1],e.b=n[2]}function QV(e){if(!e)return;const t=xh(e),n=t[0],r=zg(t[1]),s=zg(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${s}%, ${$n(e.a)})`:`hsl(${n}, ${r}%, ${s}%)`}const $g={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Vg={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function eB(){const e={},t=Object.keys(Vg),n=Object.keys($g);let r,s,o,i,a;for(r=0;r<t.length;r++){for(i=a=t[r],s=0;s<n.length;s++)o=n[s],a=a.replace(o,$g[o]);o=parseInt(Vg[i],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}let da;function tB(e){da||(da=eB(),da.transparent=[0,0,0,0]);const t=da[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const nB=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function rB(e){const t=nB.exec(e);let n=255,r,s,o;if(t){if(t[7]!==r){const i=+t[7];n=t[8]?Ao(i):ir(i*255,0,255)}return r=+t[1],s=+t[3],o=+t[5],r=255&(t[2]?Ao(r):ir(r,0,255)),s=255&(t[4]?Ao(s):ir(s,0,255)),o=255&(t[6]?Ao(o):ir(o,0,255)),{r,g:s,b:o,a:n}}}function sB(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${$n(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Eu=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,_s=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function oB(e,t,n){const r=_s($n(e.r)),s=_s($n(e.g)),o=_s($n(e.b));return{r:hr(Eu(r+n*(_s($n(t.r))-r))),g:hr(Eu(s+n*(_s($n(t.g))-s))),b:hr(Eu(o+n*(_s($n(t.b))-o))),a:e.a+n*(t.a-e.a)}}function fa(e,t,n){if(e){let r=xh(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=wh(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function B0(e,t){return e&&Object.assign(t||{},e)}function Bg(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=hr(e[3]))):(t=B0(e,{r:0,g:0,b:0,a:1}),t.a=hr(t.a)),t}function iB(e){return e.charAt(0)==="r"?rB(e):XV(e)}class ai{constructor(t){if(t instanceof ai)return t;const n=typeof t;let r;n==="object"?r=Bg(t):n==="string"&&(r=BV(t)||tB(t)||iB(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=B0(this._rgb);return t&&(t.a=$n(t.a)),t}set rgb(t){this._rgb=Bg(t)}rgbString(){return this._valid?sB(this._rgb):void 0}hexString(){return this._valid?WV(this._rgb):void 0}hslString(){return this._valid?QV(this._rgb):void 0}mix(t,n){if(t){const r=this.rgb,s=t.rgb;let o;const i=n===o?.5:n,a=2*i-1,c=r.a-s.a,l=((a*c===-1?a:(a+c)/(1+a*c))+1)/2;o=1-l,r.r=255&l*r.r+o*s.r+.5,r.g=255&l*r.g+o*s.g+.5,r.b=255&l*r.b+o*s.b+.5,r.a=i*r.a+(1-i)*s.a,this.rgb=r}return this}interpolate(t,n){return t&&(this._rgb=oB(this._rgb,t._rgb,n)),this}clone(){return new ai(this.rgb)}alpha(t){return this._rgb.a=hr(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Pi(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return fa(this._rgb,2,t),this}darken(t){return fa(this._rgb,2,-t),this}saturate(t){return fa(this._rgb,1,t),this}desaturate(t){return fa(this._rgb,1,-t),this}rotate(t){return JV(this._rgb,t),this}}function In(){}const aB=(()=>{let e=0;return()=>e++})();function ye(e){return e==null}function ze(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function xe(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function We(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Ft(e,t){return We(e)?e:t}function de(e,t){return typeof e>"u"?t:e}const cB=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,U0=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Me(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Ce(e,t,n,r){let s,o,i;if(ze(e))for(o=e.length,s=0;s<o;s++)t.call(n,e[s],s);else if(xe(e))for(i=Object.keys(e),o=i.length,s=0;s<o;s++)t.call(n,e[i[s]],i[s])}function kc(e,t){let n,r,s,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(s=e[n],o=t[n],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function Cc(e){if(ze(e))return e.map(Cc);if(xe(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let s=0;for(;s<r;++s)t[n[s]]=Cc(e[n[s]]);return t}return e}function W0(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function lB(e,t,n,r){if(!W0(e))return;const s=t[e],o=n[e];xe(s)&&xe(o)?ci(s,o,r):t[e]=Cc(o)}function ci(e,t,n){const r=ze(t)?t:[t],s=r.length;if(!xe(e))return e;n=n||{};const o=n.merger||lB;let i;for(let a=0;a<s;++a){if(i=r[a],!xe(i))continue;const c=Object.keys(i);for(let l=0,u=c.length;l<u;++l)o(c[l],e,i,n)}return e}function Vo(e,t){return ci(e,t,{merger:uB})}function uB(e,t,n){if(!W0(e))return;const r=t[e],s=n[e];xe(r)&&xe(s)?Vo(r,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Cc(s))}const Ug={"":e=>e,x:e=>e.x,y:e=>e.y};function dB(e){const t=e.split("."),n=[];let r="";for(const s of t)r+=s,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function fB(e){const t=dB(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function br(e,t){return(Ug[t]||(Ug[t]=fB(t)))(e)}function Sh(e){return e.charAt(0).toUpperCase()+e.slice(1)}const li=e=>typeof e<"u",vr=e=>typeof e=="function",Wg=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function hB(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const we=Math.PI,Ae=2*we,pB=Ae+we,Rc=Number.POSITIVE_INFINITY,mB=we/180,He=we/2,Mr=we/4,Hg=we*2/3,ar=Math.log10,Rn=Math.sign;function Bo(e,t,n){return Math.abs(e-t)<n}function qg(e){const t=Math.round(e);e=Bo(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(ar(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function gB(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((s,o)=>s-o).pop(),t}function yB(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Ys(e){return!yB(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function bB(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function H0(e,t,n){let r,s,o;for(r=0,s=e.length;r<s;r++)o=e[r][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function fn(e){return e*(we/180)}function Eh(e){return e*(180/we)}function Kg(e){if(!We(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function q0(e,t){const n=t.x-e.x,r=t.y-e.y,s=Math.sqrt(n*n+r*r);let o=Math.atan2(r,n);return o<-.5*we&&(o+=Ae),{angle:o,distance:s}}function Vd(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function vB(e,t){return(e-t+pB)%Ae-we}function mt(e){return(e%Ae+Ae)%Ae}function ui(e,t,n,r){const s=mt(e),o=mt(t),i=mt(n),a=mt(o-s),c=mt(i-s),l=mt(s-o),u=mt(s-i);return s===o||s===i||r&&o===i||a>c&&l<u}function at(e,t,n){return Math.max(t,Math.min(n,e))}function xB(e){return at(e,-32768,32767)}function Bn(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function kh(e,t,n){n=n||(i=>e[i]<t);let r=e.length-1,s=0,o;for(;r-s>1;)o=s+r>>1,n(o)?s=o:r=o;return{lo:s,hi:r}}const Un=(e,t,n,r)=>kh(e,n,r?s=>{const o=e[s][t];return o<n||o===n&&e[s+1][t]===n}:s=>e[s][t]<n),_B=(e,t,n)=>kh(e,n,r=>e[r][t]>=n);function wB(e,t,n){let r=0,s=e.length;for(;r<s&&e[r]<t;)r++;for(;s>r&&e[s-1]>n;)s--;return r>0||s<e.length?e.slice(r,s):e}const K0=["push","pop","shift","splice","unshift"];function SB(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),K0.forEach(n=>{const r="_onData"+Sh(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const i=s.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...o)}),i}})})}function Zg(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,s=r.indexOf(t);s!==-1&&r.splice(s,1),!(r.length>0)&&(K0.forEach(o=>{delete e[o]}),delete e._chartjs)}function Z0(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const G0=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function Y0(e,t){let n=[],r=!1;return function(...s){n=s,r||(r=!0,G0.call(window,()=>{r=!1,e.apply(t,n)}))}}function EB(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const Ch=e=>e==="start"?"left":e==="end"?"right":"center",ht=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,kB=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function X0(e,t,n){const r=t.length;let s=0,o=r;if(e._sorted){const{iScale:i,vScale:a,_parsed:c}=e,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=i.axis,{min:d,max:f,minDefined:h,maxDefined:p}=i.getUserBounds();if(h){if(s=Math.min(Un(c,u,d).lo,n?r:Un(t,u,i.getPixelForValue(d)).lo),l){const m=c.slice(0,s+1).reverse().findIndex(y=>!ye(y[a.axis]));s-=Math.max(0,m)}s=at(s,0,r-1)}if(p){let m=Math.max(Un(c,i.axis,f,!0).hi+1,n?0:Un(t,u,i.getPixelForValue(f),!0).hi+1);if(l){const y=c.slice(m-1).findIndex(b=>!ye(b[a.axis]));m+=Math.max(0,y)}o=at(m,s,r)-s}else o=r-s}return{start:s,count:o}}function J0(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,s={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=s,!0;const o=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,s),o}const ha=e=>e===0||e===1,Gg=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Ae/n)),Yg=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Ae/n)+1,Uo={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*He)+1,easeOutSine:e=>Math.sin(e*He),easeInOutSine:e=>-.5*(Math.cos(we*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>ha(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>ha(e)?e:Gg(e,.075,.3),easeOutElastic:e=>ha(e)?e:Yg(e,.075,.3),easeInOutElastic(e){return ha(e)?e:e<.5?.5*Gg(e*2,.1125,.45):.5+.5*Yg(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Uo.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Uo.easeInBounce(e*2)*.5:Uo.easeOutBounce(e*2-1)*.5+.5};function Rh(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Xg(e){return Rh(e)?e:new ai(e)}function ku(e){return Rh(e)?e:new ai(e).saturate(.5).darken(.1).hexString()}const CB=["x","y","borderWidth","radius","tension"],RB=["color","borderColor","backgroundColor"];function PB(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:RB},numbers:{type:"number",properties:CB}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function OB(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Jg=new Map;function TB(e,t){t=t||{};const n=e+JSON.stringify(t);let r=Jg.get(n);return r||(r=new Intl.NumberFormat(e,t),Jg.set(n,r)),r}function Oi(e,t,n){return TB(t,n).format(e)}const Q0={values(e){return ze(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let s,o=e;if(n.length>1){const l=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(l<1e-4||l>1e15)&&(s="scientific"),o=MB(e,n)}const i=ar(Math.abs(o)),a=isNaN(i)?1:Math.max(Math.min(-1*Math.floor(i),20),0),c={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(c,this.options.ticks.format),Oi(e,r,c)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(ar(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?Q0.numeric.call(this,e,t,n):""}};function MB(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var kl={formatters:Q0};function AB(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:kl.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const as=Object.create(null),Bd=Object.create(null);function Wo(e,t){if(!t)return e;const n=t.split(".");for(let r=0,s=n.length;r<s;++r){const o=n[r];e=e[o]||(e[o]=Object.create(null))}return e}function Cu(e,t,n){return typeof t=="string"?ci(Wo(e,t),n):ci(Wo(e,""),t)}class NB{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,s)=>ku(s.backgroundColor),this.hoverBorderColor=(r,s)=>ku(s.borderColor),this.hoverColor=(r,s)=>ku(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return Cu(this,t,n)}get(t){return Wo(this,t)}describe(t,n){return Cu(Bd,t,n)}override(t,n){return Cu(as,t,n)}route(t,n,r,s){const o=Wo(this,t),i=Wo(this,r),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const c=this[a],l=i[s];return xe(c)?Object.assign({},l,c):de(c,l)},set(c){this[a]=c}}})}apply(t){t.forEach(n=>n(this))}}var $e=new NB({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[PB,OB,AB]);function DB(e){return!e||ye(e.size)||ye(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Pc(e,t,n,r,s){let o=t[s];return o||(o=t[s]=e.measureText(s).width,n.push(s)),o>r&&(r=o),r}function IB(e,t,n,r){r=r||{};let s=r.data=r.data||{},o=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(s=r.data={},o=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let i=0;const a=n.length;let c,l,u,d,f;for(c=0;c<a;c++)if(d=n[c],d!=null&&!ze(d))i=Pc(e,s,o,i,d);else if(ze(d))for(l=0,u=d.length;l<u;l++)f=d[l],f!=null&&!ze(f)&&(i=Pc(e,s,o,i,f));e.restore();const h=o.length/2;if(h>n.length){for(c=0;c<h;c++)delete s[o[c]];o.splice(0,h)}return i}function Ar(e,t,n){const r=e.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((t-s)*r)/r+s}function Qg(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Ud(e,t,n,r){eS(e,t,n,r,null)}function eS(e,t,n,r,s){let o,i,a,c,l,u,d,f;const h=t.pointStyle,p=t.rotation,m=t.radius;let y=(p||0)*mB;if(h&&typeof h=="object"&&(o=h.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(y),e.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),e.restore();return}if(!(isNaN(m)||m<=0)){switch(e.beginPath(),h){default:s?e.ellipse(n,r,s/2,m,0,0,Ae):e.arc(n,r,m,0,Ae),e.closePath();break;case"triangle":u=s?s/2:m,e.moveTo(n+Math.sin(y)*u,r-Math.cos(y)*m),y+=Hg,e.lineTo(n+Math.sin(y)*u,r-Math.cos(y)*m),y+=Hg,e.lineTo(n+Math.sin(y)*u,r-Math.cos(y)*m),e.closePath();break;case"rectRounded":l=m*.516,c=m-l,i=Math.cos(y+Mr)*c,d=Math.cos(y+Mr)*(s?s/2-l:c),a=Math.sin(y+Mr)*c,f=Math.sin(y+Mr)*(s?s/2-l:c),e.arc(n-d,r-a,l,y-we,y-He),e.arc(n+f,r-i,l,y-He,y),e.arc(n+d,r+a,l,y,y+He),e.arc(n-f,r+i,l,y+He,y+we),e.closePath();break;case"rect":if(!p){c=Math.SQRT1_2*m,u=s?s/2:c,e.rect(n-u,r-c,2*u,2*c);break}y+=Mr;case"rectRot":d=Math.cos(y)*(s?s/2:m),i=Math.cos(y)*m,a=Math.sin(y)*m,f=Math.sin(y)*(s?s/2:m),e.moveTo(n-d,r-a),e.lineTo(n+f,r-i),e.lineTo(n+d,r+a),e.lineTo(n-f,r+i),e.closePath();break;case"crossRot":y+=Mr;case"cross":d=Math.cos(y)*(s?s/2:m),i=Math.cos(y)*m,a=Math.sin(y)*m,f=Math.sin(y)*(s?s/2:m),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-i),e.lineTo(n-f,r+i);break;case"star":d=Math.cos(y)*(s?s/2:m),i=Math.cos(y)*m,a=Math.sin(y)*m,f=Math.sin(y)*(s?s/2:m),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-i),e.lineTo(n-f,r+i),y+=Mr,d=Math.cos(y)*(s?s/2:m),i=Math.cos(y)*m,a=Math.sin(y)*m,f=Math.sin(y)*(s?s/2:m),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-i),e.lineTo(n-f,r+i);break;case"line":i=s?s/2:Math.cos(y)*m,a=Math.sin(y)*m,e.moveTo(n-i,r-a),e.lineTo(n+i,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(y)*(s?s/2:m),r+Math.sin(y)*m);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Wn(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function Cl(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Rl(e){e.restore()}function jB(e,t,n,r,s){if(!t)return e.lineTo(n.x,n.y);if(s==="middle"){const o=(t.x+n.x)/2;e.lineTo(o,t.y),e.lineTo(o,n.y)}else s==="after"!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function LB(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function FB(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),ye(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function zB(e,t,n,r,s){if(s.strikethrough||s.underline){const o=e.measureText(r),i=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,c=n-o.actualBoundingBoxAscent,l=n+o.actualBoundingBoxDescent,u=s.strikethrough?(c+l)/2:l;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(i,u),e.lineTo(a,u),e.stroke()}}function $B(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function cs(e,t,n,r,s,o={}){const i=ze(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let c,l;for(e.save(),e.font=s.string,FB(e,o),c=0;c<i.length;++c)l=i[c],o.backdrop&&$B(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),ye(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(l,n,r,o.maxWidth)),e.fillText(l,n,r,o.maxWidth),zB(e,n,r,l,o),r+=Number(s.lineHeight);e.restore()}function di(e,t){const{x:n,y:r,w:s,h:o,radius:i}=t;e.arc(n+i.topLeft,r+i.topLeft,i.topLeft,1.5*we,we,!0),e.lineTo(n,r+o-i.bottomLeft),e.arc(n+i.bottomLeft,r+o-i.bottomLeft,i.bottomLeft,we,He,!0),e.lineTo(n+s-i.bottomRight,r+o),e.arc(n+s-i.bottomRight,r+o-i.bottomRight,i.bottomRight,He,0,!0),e.lineTo(n+s,r+i.topRight),e.arc(n+s-i.topRight,r+i.topRight,i.topRight,0,-He,!0),e.lineTo(n+i.topLeft,r)}const VB=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,BB=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function UB(e,t){const n=(""+e).match(VB);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const WB=e=>+e||0;function Ph(e,t){const n={},r=xe(t),s=r?Object.keys(t):t,o=xe(e)?r?i=>de(e[i],e[t[i]]):i=>e[i]:()=>e;for(const i of s)n[i]=WB(o(i));return n}function tS(e){return Ph(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Zr(e){return Ph(e,["topLeft","topRight","bottomLeft","bottomRight"])}function xt(e){const t=tS(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function rt(e,t){e=e||{},t=t||$e.font;let n=de(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=de(e.style,t.style);r&&!(""+r).match(BB)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const s={family:de(e.family,t.family),lineHeight:UB(de(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:de(e.weight,t.weight),string:""};return s.string=DB(s),s}function No(e,t,n,r){let s,o,i;for(s=0,o=e.length;s<o;++s)if(i=e[s],i!==void 0&&i!==void 0)return i}function HB(e,t,n){const{min:r,max:s}=e,o=U0(t,(s-r)/2),i=(a,c)=>n&&a===0?0:a+c;return{min:i(r,-Math.abs(o)),max:i(s,o)}}function Rr(e,t){return Object.assign(Object.create(e),t)}function Oh(e,t=[""],n,r,s=()=>e[0]){const o=n||e;typeof r>"u"&&(r=oS("_fallback",e));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:r,_getTarget:s,override:a=>Oh([a,...e],t,o,r)};return new Proxy(i,{deleteProperty(a,c){return delete a[c],delete a._keys,delete e[0][c],!0},get(a,c){return rS(a,c,()=>QB(c,t,e,a))},getOwnPropertyDescriptor(a,c){return Reflect.getOwnPropertyDescriptor(a._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,c){return ty(a).includes(c)},ownKeys(a){return ty(a)},set(a,c,l){const u=a._storage||(a._storage=s());return a[c]=u[c]=l,delete a._keys,!0}})}function Xs(e,t,n,r){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:nS(e,r),setContext:o=>Xs(e,o,n,r),override:o=>Xs(e.override(o),t,n,r)};return new Proxy(s,{deleteProperty(o,i){return delete o[i],delete e[i],!0},get(o,i,a){return rS(o,i,()=>KB(o,i,a))},getOwnPropertyDescriptor(o,i){return o._descriptors.allKeys?Reflect.has(e,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,i)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,i){return Reflect.has(e,i)},ownKeys(){return Reflect.ownKeys(e)},set(o,i,a){return e[i]=a,delete o[i],!0}})}function nS(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:r,isScriptable:vr(n)?n:()=>n,isIndexable:vr(r)?r:()=>r}}const qB=(e,t)=>e?e+Sh(t):t,Th=(e,t)=>xe(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function rS(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function KB(e,t,n){const{_proxy:r,_context:s,_subProxy:o,_descriptors:i}=e;let a=r[t];return vr(a)&&i.isScriptable(t)&&(a=ZB(t,a,e,n)),ze(a)&&a.length&&(a=GB(t,a,e,i.isIndexable)),Th(t,a)&&(a=Xs(a,s,o&&o[t],i)),a}function ZB(e,t,n,r){const{_proxy:s,_context:o,_subProxy:i,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let c=t(o,i||r);return a.delete(e),Th(e,c)&&(c=Mh(s._scopes,s,e,c)),c}function GB(e,t,n,r){const{_proxy:s,_context:o,_subProxy:i,_descriptors:a}=n;if(typeof o.index<"u"&&r(e))return t[o.index%t.length];if(xe(t[0])){const c=t,l=s._scopes.filter(u=>u!==c);t=[];for(const u of c){const d=Mh(l,s,e,u);t.push(Xs(d,o,i&&i[e],a))}}return t}function sS(e,t,n){return vr(e)?e(t,n):e}const YB=(e,t)=>e===!0?t:typeof e=="string"?br(t,e):void 0;function XB(e,t,n,r,s){for(const o of t){const i=YB(n,o);if(i){e.add(i);const a=sS(i._fallback,n,s);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(i===!1&&typeof r<"u"&&n!==r)return null}return!1}function Mh(e,t,n,r){const s=t._rootScopes,o=sS(t._fallback,n,r),i=[...e,...s],a=new Set;a.add(r);let c=ey(a,i,n,o||n,r);return c===null||typeof o<"u"&&o!==n&&(c=ey(a,i,o,c,r),c===null)?!1:Oh(Array.from(a),[""],s,o,()=>JB(t,n,r))}function ey(e,t,n,r,s){for(;n;)n=XB(e,t,n,r,s);return n}function JB(e,t,n){const r=e._getTarget();t in r||(r[t]={});const s=r[t];return ze(s)&&xe(n)?n:s||{}}function QB(e,t,n,r){let s;for(const o of t)if(s=oS(qB(o,e),n),typeof s<"u")return Th(e,s)?Mh(n,r,e,s):s}function oS(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function ty(e){let t=e._keys;return t||(t=e._keys=eU(e._scopes)),t}function eU(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(r);return Array.from(t)}function iS(e,t,n,r){const{iScale:s}=e,{key:o="r"}=this._parsing,i=new Array(r);let a,c,l,u;for(a=0,c=r;a<c;++a)l=a+n,u=t[l],i[a]={r:s.parse(br(u,o),l)};return i}const tU=Number.EPSILON||1e-14,Js=(e,t)=>t<e.length&&!e[t].skip&&e[t],aS=e=>e==="x"?"y":"x";function nU(e,t,n,r){const s=e.skip?t:e,o=t,i=n.skip?t:n,a=Vd(o,s),c=Vd(i,o);let l=a/(a+c),u=c/(a+c);l=isNaN(l)?0:l,u=isNaN(u)?0:u;const d=r*l,f=r*u;return{previous:{x:o.x-d*(i.x-s.x),y:o.y-d*(i.y-s.y)},next:{x:o.x+f*(i.x-s.x),y:o.y+f*(i.y-s.y)}}}function rU(e,t,n){const r=e.length;let s,o,i,a,c,l=Js(e,0);for(let u=0;u<r-1;++u)if(c=l,l=Js(e,u+1),!(!c||!l)){if(Bo(t[u],0,tU)){n[u]=n[u+1]=0;continue}s=n[u]/t[u],o=n[u+1]/t[u],a=Math.pow(s,2)+Math.pow(o,2),!(a<=9)&&(i=3/Math.sqrt(a),n[u]=s*i*t[u],n[u+1]=o*i*t[u])}}function sU(e,t,n="x"){const r=aS(n),s=e.length;let o,i,a,c=Js(e,0);for(let l=0;l<s;++l){if(i=a,a=c,c=Js(e,l+1),!a)continue;const u=a[n],d=a[r];i&&(o=(u-i[n])/3,a[`cp1${n}`]=u-o,a[`cp1${r}`]=d-o*t[l]),c&&(o=(c[n]-u)/3,a[`cp2${n}`]=u+o,a[`cp2${r}`]=d+o*t[l])}}function oU(e,t="x"){const n=aS(t),r=e.length,s=Array(r).fill(0),o=Array(r);let i,a,c,l=Js(e,0);for(i=0;i<r;++i)if(a=c,c=l,l=Js(e,i+1),!!c){if(l){const u=l[t]-c[t];s[i]=u!==0?(l[n]-c[n])/u:0}o[i]=a?l?Rn(s[i-1])!==Rn(s[i])?0:(s[i-1]+s[i])/2:s[i-1]:s[i]}rU(e,s,o),sU(e,o,t)}function pa(e,t,n){return Math.max(Math.min(e,n),t)}function iU(e,t){let n,r,s,o,i,a=Wn(e[0],t);for(n=0,r=e.length;n<r;++n)i=o,o=a,a=n<r-1&&Wn(e[n+1],t),o&&(s=e[n],i&&(s.cp1x=pa(s.cp1x,t.left,t.right),s.cp1y=pa(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=pa(s.cp2x,t.left,t.right),s.cp2y=pa(s.cp2y,t.top,t.bottom)))}function aU(e,t,n,r,s){let o,i,a,c;if(t.spanGaps&&(e=e.filter(l=>!l.skip)),t.cubicInterpolationMode==="monotone")oU(e,s);else{let l=r?e[e.length-1]:e[0];for(o=0,i=e.length;o<i;++o)a=e[o],c=nU(l,a,e[Math.min(o+1,i-(r?0:1))%i],t.tension),a.cp1x=c.previous.x,a.cp1y=c.previous.y,a.cp2x=c.next.x,a.cp2y=c.next.y,l=a}t.capBezierPoints&&iU(e,n)}function Ah(){return typeof window<"u"&&typeof document<"u"}function Nh(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Oc(e,t,n){let r;return typeof e=="string"?(r=parseInt(e,10),e.indexOf("%")!==-1&&(r=r/100*t.parentNode[n])):r=e,r}const Pl=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function cU(e,t){return Pl(e).getPropertyValue(t)}const lU=["top","right","bottom","left"];function Gr(e,t,n){const r={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=lU[s];r[o]=parseFloat(e[t+"-"+o+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const uU=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function dU(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:s,offsetY:o}=r;let i=!1,a,c;if(uU(s,o,e.target))a=s,c=o;else{const l=t.getBoundingClientRect();a=r.clientX-l.left,c=r.clientY-l.top,i=!0}return{x:a,y:c,box:i}}function Ir(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,s=Pl(n),o=s.boxSizing==="border-box",i=Gr(s,"padding"),a=Gr(s,"border","width"),{x:c,y:l,box:u}=dU(e,n),d=i.left+(u&&a.left),f=i.top+(u&&a.top);let{width:h,height:p}=t;return o&&(h-=i.width+a.width,p-=i.height+a.height),{x:Math.round((c-d)/h*n.width/r),y:Math.round((l-f)/p*n.height/r)}}function fU(e,t,n){let r,s;if(t===void 0||n===void 0){const o=e&&Nh(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const i=o.getBoundingClientRect(),a=Pl(o),c=Gr(a,"border","width"),l=Gr(a,"padding");t=i.width-l.width-c.width,n=i.height-l.height-c.height,r=Oc(a.maxWidth,o,"clientWidth"),s=Oc(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:r||Rc,maxHeight:s||Rc}}const cr=e=>Math.round(e*10)/10;function hU(e,t,n,r){const s=Pl(e),o=Gr(s,"margin"),i=Oc(s.maxWidth,e,"clientWidth")||Rc,a=Oc(s.maxHeight,e,"clientHeight")||Rc,c=fU(e,t,n);let{width:l,height:u}=c;if(s.boxSizing==="content-box"){const f=Gr(s,"border","width"),h=Gr(s,"padding");l-=h.width+f.width,u-=h.height+f.height}return l=Math.max(0,l-o.width),u=Math.max(0,r?l/r:u-o.height),l=cr(Math.min(l,i,c.maxWidth)),u=cr(Math.min(u,a,c.maxHeight)),l&&!u&&(u=cr(l/2)),(t!==void 0||n!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,l=cr(Math.floor(u*r))),{width:l,height:u}}function ny(e,t,n){const r=t||1,s=cr(e.height*r),o=cr(e.width*r);e.height=cr(e.height),e.width=cr(e.width);const i=e.canvas;return i.style&&(n||!i.style.height&&!i.style.width)&&(i.style.height=`${e.height}px`,i.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||i.height!==s||i.width!==o?(e.currentDevicePixelRatio=r,i.height=s,i.width=o,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const pU=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Ah()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function ry(e,t){const n=cU(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function jr(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function mU(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r==="middle"?n<.5?e.y:t.y:r==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function gU(e,t,n,r){const s={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},i=jr(e,s,n),a=jr(s,o,n),c=jr(o,t,n),l=jr(i,a,n),u=jr(a,c,n);return jr(l,u,n)}const yU=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},bU=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Bs(e,t,n){return e?yU(t,n):bU()}function cS(e,t){let n,r;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function lS(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function uS(e){return e==="angle"?{between:ui,compare:vB,normalize:mt}:{between:Bn,compare:(t,n)=>t-n,normalize:t=>t}}function sy({start:e,end:t,count:n,loop:r,style:s}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:s}}function vU(e,t,n){const{property:r,start:s,end:o}=n,{between:i,normalize:a}=uS(r),c=t.length;let{start:l,end:u,loop:d}=e,f,h;if(d){for(l+=c,u+=c,f=0,h=c;f<h&&i(a(t[l%c][r]),s,o);++f)l--,u--;l%=c,u%=c}return u<l&&(u+=c),{start:l,end:u,loop:d,style:e.style}}function dS(e,t,n){if(!n)return[e];const{property:r,start:s,end:o}=n,i=t.length,{compare:a,between:c,normalize:l}=uS(r),{start:u,end:d,loop:f,style:h}=vU(e,t,n),p=[];let m=!1,y=null,b,x,_;const w=()=>c(s,_,b)&&a(s,_)!==0,S=()=>a(o,b)===0||c(o,_,b),C=()=>m||w(),k=()=>!m||S();for(let E=u,P=u;E<=d;++E)x=t[E%i],!x.skip&&(b=l(x[r]),b!==_&&(m=c(b,s,o),y===null&&C()&&(y=a(b,s)===0?E:P),y!==null&&k()&&(p.push(sy({start:y,end:E,loop:f,count:i,style:h})),y=null),P=E,_=b));return y!==null&&p.push(sy({start:y,end:d,loop:f,count:i,style:h})),p}function fS(e,t){const n=[],r=e.segments;for(let s=0;s<r.length;s++){const o=dS(r[s],e.points,t);o.length&&n.push(...o)}return n}function xU(e,t,n,r){let s=0,o=t-1;if(n&&!r)for(;s<t&&!e[s].skip;)s++;for(;s<t&&e[s].skip;)s++;for(s%=t,n&&(o+=s);o>s&&e[o%t].skip;)o--;return o%=t,{start:s,end:o}}function _U(e,t,n,r){const s=e.length,o=[];let i=t,a=e[t],c;for(c=t+1;c<=n;++c){const l=e[c%s];l.skip||l.stop?a.skip||(r=!1,o.push({start:t%s,end:(c-1)%s,loop:r}),t=i=l.stop?c:null):(i=c,a.skip&&(t=c)),a=l}return i!==null&&o.push({start:t%s,end:i%s,loop:r}),o}function wU(e,t){const n=e.points,r=e.options.spanGaps,s=n.length;if(!s)return[];const o=!!e._loop,{start:i,end:a}=xU(n,s,o,r);if(r===!0)return oy(e,[{start:i,end:a,loop:o}],n,t);const c=a<i?a+s:a,l=!!e._fullLoop&&i===0&&a===s-1;return oy(e,_U(n,i,c,l),n,t)}function oy(e,t,n,r){return!r||!r.setContext||!n?t:SU(e,t,n,r)}function SU(e,t,n,r){const s=e._chart.getContext(),o=iy(e.options),{_datasetIndex:i,options:{spanGaps:a}}=e,c=n.length,l=[];let u=o,d=t[0].start,f=d;function h(p,m,y,b){const x=a?-1:1;if(p!==m){for(p+=c;n[p%c].skip;)p-=x;for(;n[m%c].skip;)m+=x;p%c!==m%c&&(l.push({start:p%c,end:m%c,loop:y,style:b}),u=b,d=m%c)}}for(const p of t){d=a?d:p.start;let m=n[d%c],y;for(f=d+1;f<=p.end;f++){const b=n[f%c];y=iy(r.setContext(Rr(s,{type:"segment",p0:m,p1:b,p0DataIndex:(f-1)%c,p1DataIndex:f%c,datasetIndex:i}))),EU(y,u)&&h(d,f-1,p.loop,u),m=b,u=y}d<f-1&&h(d,f-1,p.loop,u)}return l}function iy(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function EU(e,t){if(!t)return!1;const n=[],r=function(s,o){return Rh(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function ma(e,t,n){return e.options.clip?e[n]:t[n]}function kU(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:ma(n,t,"left"),right:ma(n,t,"right"),top:ma(r,t,"top"),bottom:ma(r,t,"bottom")}:t}function hS(e,t){const n=t._clip;if(n.disabled)return!1;const r=kU(t,e.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:r.bottom+(n.bottom===!0?0:n.bottom)}}class CU{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,s){const o=n.listeners[s],i=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:i,currentStep:Math.min(r-n.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=G0.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,s)=>{if(!r.running||!r.items.length)return;const o=r.items;let i=o.length-1,a=!1,c;for(;i>=0;--i)c=o[i],c._active?(c._total>r.duration&&(r.duration=c._total),c.tick(t),a=!0):(o[i]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,r,t,"progress")),o.length||(r.running=!1,this._notify(s,r,t,"complete"),r.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,s)=>Math.max(r,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let s=r.length-1;for(;s>=0;--s)r[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ln=new CU;const ay="transparent",RU={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=Xg(e||ay),s=r.valid&&Xg(t||ay);return s&&s.valid?s.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class PU{constructor(t,n,r,s){const o=n[r];s=No([t.to,s,o,t.from]);const i=No([t.from,o,s]);this._active=!0,this._fn=t.fn||RU[t.type||typeof i],this._easing=Uo[t.easing]||Uo.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=i,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const s=this._target[this._prop],o=r-this._start,i=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(i,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=No([t.to,n,s,t.from]),this._from=No([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,s=this._prop,o=this._from,i=this._loop,a=this._to;let c;if(this._active=o!==a&&(i||n<r),!this._active){this._target[s]=a,this._notify(!0);return}if(n<0){this._target[s]=o;return}c=n/r%2,c=i&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[s]=this._fn(o,a,c)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let s=0;s<r.length;s++)r[s][n]()}}class pS{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!xe(t))return;const n=Object.keys($e.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!xe(o))return;const i={};for(const a of n)i[a]=o[a];(ze(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!r.has(a))&&r.set(a,i)})})}_animateOptions(t,n){const r=n.options,s=TU(t,r);if(!s)return[];const o=this._createAnimations(s,r);return r.$shared&&OU(t.options.$animations,r).then(()=>{t.options=r},()=>{}),o}_createAnimations(t,n){const r=this._properties,s=[],o=t.$animations||(t.$animations={}),i=Object.keys(n),a=Date.now();let c;for(c=i.length-1;c>=0;--c){const l=i[c];if(l.charAt(0)==="$")continue;if(l==="options"){s.push(...this._animateOptions(t,n));continue}const u=n[l];let d=o[l];const f=r.get(l);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){t[l]=u;continue}o[l]=d=new PU(f,t,l,u),s.push(d)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return Ln.add(this._chart,r),!0}}function OU(e,t){const n=[],r=Object.keys(t);for(let s=0;s<r.length;s++){const o=e[r[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function TU(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function cy(e,t){const n=e&&e.options||{},r=n.reverse,s=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:r?o:s,end:r?s:o}}function MU(e,t,n){if(n===!1)return!1;const r=cy(e,n),s=cy(t,n);return{top:s.end,right:r.end,bottom:s.start,left:r.start}}function AU(e){let t,n,r,s;return xe(e)?(t=e.top,n=e.right,r=e.bottom,s=e.left):t=n=r=s=e,{top:t,right:n,bottom:r,left:s,disabled:e===!1}}function mS(e,t){const n=[],r=e._getSortedDatasetMetas(t);let s,o;for(s=0,o=r.length;s<o;++s)n.push(r[s].index);return n}function ly(e,t,n,r={}){const s=e.keys,o=r.mode==="single";let i,a,c,l;if(t===null)return;let u=!1;for(i=0,a=s.length;i<a;++i){if(c=+s[i],c===n){if(u=!0,r.all)continue;break}l=e.values[c],We(l)&&(o||t===0||Rn(t)===Rn(l))&&(t+=l)}return!u&&!r.all?0:t}function NU(e,t){const{iScale:n,vScale:r}=t,s=n.axis==="x"?"x":"y",o=r.axis==="x"?"x":"y",i=Object.keys(e),a=new Array(i.length);let c,l,u;for(c=0,l=i.length;c<l;++c)u=i[c],a[c]={[s]:u,[o]:e[u]};return a}function Ru(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function DU(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function IU(e){const{min:t,max:n,minDefined:r,maxDefined:s}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function jU(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function uy(e,t,n,r){for(const s of t.getMatchingVisibleMetas(r).reverse()){const o=e[s.index];if(n&&o>0||!n&&o<0)return s.index}return null}function dy(e,t){const{chart:n,_cachedMeta:r}=e,s=n._stacks||(n._stacks={}),{iScale:o,vScale:i,index:a}=r,c=o.axis,l=i.axis,u=DU(o,i,r),d=t.length;let f;for(let h=0;h<d;++h){const p=t[h],{[c]:m,[l]:y}=p,b=p._stacks||(p._stacks={});f=b[l]=jU(s,u,m),f[a]=y,f._top=uy(f,i,!0,r.type),f._bottom=uy(f,i,!1,r.type);const x=f._visualValues||(f._visualValues={});x[a]=y}}function Pu(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function LU(e,t){return Rr(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function FU(e,t,n){return Rr(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function _o(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const s of t){const o=s._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const Ou=e=>e==="reset"||e==="none",fy=(e,t)=>t?e:Object.assign({},e),zU=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:mS(n,!0),values:null};class Pr{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Ru(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&_o(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),s=(d,f,h,p)=>d==="x"?f:d==="r"?p:h,o=n.xAxisID=de(r.xAxisID,Pu(t,"x")),i=n.yAxisID=de(r.yAxisID,Pu(t,"y")),a=n.rAxisID=de(r.rAxisID,Pu(t,"r")),c=n.indexAxis,l=n.iAxisID=s(c,o,i,a),u=n.vAxisID=s(c,i,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(i),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(l),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Zg(this._data,this),t._stacked&&_o(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(xe(n)){const s=this._cachedMeta;this._data=NU(n,s)}else if(r!==n){if(r){Zg(r,this);const s=this._cachedMeta;_o(s),s._parsed=[]}n&&Object.isExtensible(n)&&SB(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let s=!1;this._dataCheck();const o=n._stacked;n._stacked=Ru(n.vScale,n),n.stack!==r.stack&&(s=!0,_o(n),n.stack=r.stack),this._resyncElements(t),(s||o!==n._stacked)&&(dy(this,n._parsed),n._stacked=Ru(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:s}=this,{iScale:o,_stacked:i}=r,a=o.axis;let c=t===0&&n===s.length?!0:r._sorted,l=t>0&&r._parsed[t-1],u,d,f;if(this._parsing===!1)r._parsed=s,r._sorted=!0,f=s;else{ze(s[t])?f=this.parseArrayData(r,s,t,n):xe(s[t])?f=this.parseObjectData(r,s,t,n):f=this.parsePrimitiveData(r,s,t,n);const h=()=>d[a]===null||l&&d[a]<l[a];for(u=0;u<n;++u)r._parsed[u+t]=d=f[u],c&&(h()&&(c=!1),l=d);r._sorted=c}i&&dy(this,f)}parsePrimitiveData(t,n,r,s){const{iScale:o,vScale:i}=t,a=o.axis,c=i.axis,l=o.getLabels(),u=o===i,d=new Array(s);let f,h,p;for(f=0,h=s;f<h;++f)p=f+r,d[f]={[a]:u||o.parse(l[p],p),[c]:i.parse(n[p],p)};return d}parseArrayData(t,n,r,s){const{xScale:o,yScale:i}=t,a=new Array(s);let c,l,u,d;for(c=0,l=s;c<l;++c)u=c+r,d=n[u],a[c]={x:o.parse(d[0],u),y:i.parse(d[1],u)};return a}parseObjectData(t,n,r,s){const{xScale:o,yScale:i}=t,{xAxisKey:a="x",yAxisKey:c="y"}=this._parsing,l=new Array(s);let u,d,f,h;for(u=0,d=s;u<d;++u)f=u+r,h=n[f],l[u]={x:o.parse(br(h,a),f),y:i.parse(br(h,c),f)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const s=this.chart,o=this._cachedMeta,i=n[t.axis],a={keys:mS(s,!0),values:n._stacks[t.axis]._visualValues};return ly(a,i,o.index,{mode:r})}updateRangeFromParsed(t,n,r,s){const o=r[n.axis];let i=o===null?NaN:o;const a=s&&r._stacks[n.axis];s&&a&&(s.values=a,i=ly(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,i),t.max=Math.max(t.max,i)}getMinMax(t,n){const r=this._cachedMeta,s=r._parsed,o=r._sorted&&t===r.iScale,i=s.length,a=this._getOtherScale(t),c=zU(n,r,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=IU(a);let f,h;function p(){h=s[f];const m=h[a.axis];return!We(h[t.axis])||u>m||d<m}for(f=0;f<i&&!(!p()&&(this.updateRangeFromParsed(l,t,h,c),o));++f);if(o){for(f=i-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(l,t,h,c);break}}return l}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let s,o,i;for(s=0,o=n.length;s<o;++s)i=n[s][t.axis],We(i)&&r.push(i);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,s=n.vScale,o=this.getParsed(t);return{label:r?""+r.getLabelForValue(o[r.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=AU(de(this.options.clip,MU(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,s=r.data||[],o=n.chartArea,i=[],a=this._drawStart||0,c=this._drawCount||s.length-a,l=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,o,a,c),u=a;u<a+c;++u){const d=s[u];d.hidden||(d.active&&l?i.push(d):d.draw(t,o))}for(u=0;u<i.length;++u)i[u].draw(t,o)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const i=this._cachedMeta.data[t];o=i.$context||(i.$context=FU(this.getContext(),t,i)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=LU(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=r,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const s=n==="active",o=this._cachedDataOpts,i=t+"-"+n,a=o[i],c=this.enableOptionSharing&&li(r);if(a)return fy(a,c);const l=this.chart.config,u=l.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],f=l.getOptionScopes(this.getDataset(),u),h=Object.keys($e.elements[t]),p=()=>this.getContext(r,s,n),m=l.resolveNamedOptions(f,h,p,d);return m.$shared&&(m.$shared=c,o[i]=Object.freeze(fy(m,c))),m}_resolveAnimations(t,n,r){const s=this.chart,o=this._cachedDataOpts,i=`animation-${n}`,a=o[i];if(a)return a;let c;if(s.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),d);c=u.createResolver(f,this.getContext(t,r,n))}const l=new pS(s,c&&c.animations);return c&&c._cacheable&&(o[i]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Ou(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),s=this._sharedOptions,o=this.getSharedOptions(r),i=this.includeOptions(n,o)||o!==s;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:i}}updateElement(t,n,r,s){Ou(s)?Object.assign(t,r):this._resolveAnimations(n,s).update(t,r)}updateSharedOptions(t,n,r){t&&!Ou(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,s){t.active=s;const o=this.getStyle(n,s);this._resolveAnimations(n,r,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,c,l]of this._syncList)this[a](c,l);this._syncList=[];const s=r.length,o=n.length,i=Math.min(o,s);i&&this.parse(0,i),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,n,r=!0){const s=this._cachedMeta,o=s.data,i=t+n;let a;const c=l=>{for(l.length+=n,a=l.length-1;a>=i;a--)l[a]=l[a-n]};for(c(o),a=t;a<i;++a)o[a]=new this.dataElementType;this._parsing&&c(s._parsed),this.parse(t,n),r&&this.updateElements(o,t,n,"reset")}updateElements(t,n,r,s){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const s=r._parsed.splice(t,n);r._stacked&&_o(r,s)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,s]=t;this[n](r,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function $U(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let s=0,o=n.length;s<o;s++)r=r.concat(n[s].controller.getAllParsedValues(e));e._cache.$bar=Z0(r.sort((s,o)=>s-o))}return e._cache.$bar}function VU(e){const t=e.iScale,n=$U(t,e.type);let r=t._length,s,o,i,a;const c=()=>{i===32767||i===-32768||(li(a)&&(r=Math.min(r,Math.abs(i-a)||r)),a=i)};for(s=0,o=n.length;s<o;++s)i=t.getPixelForValue(n[s]),c();for(a=void 0,s=0,o=t.ticks.length;s<o;++s)i=t.getPixelForTick(s),c();return r}function BU(e,t,n,r){const s=n.barThickness;let o,i;return ye(s)?(o=t.min*n.categoryPercentage,i=n.barPercentage):(o=s*r,i=1),{chunk:o/r,ratio:i,start:t.pixels[e]-o/2}}function UU(e,t,n,r){const s=t.pixels,o=s[e];let i=e>0?s[e-1]:null,a=e<s.length-1?s[e+1]:null;const c=n.categoryPercentage;i===null&&(i=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-i);const l=o-(o-Math.min(i,a))/2*c;return{chunk:Math.abs(a-i)/2*c/r,ratio:n.barPercentage,start:l}}function WU(e,t,n,r){const s=n.parse(e[0],r),o=n.parse(e[1],r),i=Math.min(s,o),a=Math.max(s,o);let c=i,l=a;Math.abs(i)>Math.abs(a)&&(c=a,l=i),t[n.axis]=l,t._custom={barStart:c,barEnd:l,start:s,end:o,min:i,max:a}}function gS(e,t,n,r){return ze(e)?WU(e,t,n,r):t[n.axis]=n.parse(e,r),t}function hy(e,t,n,r){const s=e.iScale,o=e.vScale,i=s.getLabels(),a=s===o,c=[];let l,u,d,f;for(l=n,u=n+r;l<u;++l)f=t[l],d={},d[s.axis]=a||s.parse(i[l],l),c.push(gS(f,d,o,l));return c}function Tu(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function HU(e,t,n){return e!==0?Rn(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function qU(e){let t,n,r,s,o;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(s="end",o="start"):(s="start",o="end"),{start:n,end:r,reverse:t,top:s,bottom:o}}function KU(e,t,n,r){let s=t.borderSkipped;const o={};if(!s){e.borderSkipped=o;return}if(s===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:i,end:a,reverse:c,top:l,bottom:u}=qU(e);s==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?s=l:(n._bottom||0)===r?s=u:(o[py(u,i,a,c)]=!0,s=l)),o[py(s,i,a,c)]=!0,e.borderSkipped=o}function py(e,t,n,r){return r?(e=ZU(e,t,n),e=my(e,n,t)):e=my(e,t,n),e}function ZU(e,t,n){return e===t?n:e===n?t:e}function my(e,t,n){return e==="start"?t:e==="end"?n:e}function GU(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class YU extends Pr{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,n,r,s){return hy(t,n,r,s)}parseArrayData(t,n,r,s){return hy(t,n,r,s)}parseObjectData(t,n,r,s){const{iScale:o,vScale:i}=t,{xAxisKey:a="x",yAxisKey:c="y"}=this._parsing,l=o.axis==="x"?a:c,u=i.axis==="x"?a:c,d=[];let f,h,p,m;for(f=r,h=r+s;f<h;++f)m=n[f],p={},p[o.axis]=o.parse(br(m,l),f),d.push(gS(br(m,u),p,i,f));return d}updateRangeFromParsed(t,n,r,s){super.updateRangeFromParsed(t,n,r,s);const o=r._custom;o&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:s}=n,o=this.getParsed(t),i=o._custom,a=Tu(i)?"["+i.start+", "+i.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+r.getLabelForValue(o[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,s){const o=s==="reset",{index:i,_cachedMeta:{vScale:a}}=this,c=a.getBasePixel(),l=a.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(n,s);for(let h=n;h<n+r;h++){const p=this.getParsed(h),m=o||ye(p[a.axis])?{base:c,head:c}:this._calculateBarValuePixels(h),y=this._calculateBarIndexPixels(h,u),b=(p._stacks||{})[a.axis],x={horizontal:l,base:m.base,enableBorderRadius:!b||Tu(p._custom)||i===b._top||i===b._bottom,x:l?m.head:y.center,y:l?y.center:m.head,height:l?y.size:Math.abs(m.size),width:l?Math.abs(m.size):y.size};f&&(x.options=d||this.resolveDataElementOptions(h,t[h].active?"active":s));const _=x.options||t[h].options;KU(x,_,b,i),GU(x,_,u.ratio),this.updateElement(t[h],h,x,s)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,s=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),o=r.options.stacked,i=[],a=this._cachedMeta.controller.getParsed(n),c=a&&a[r.axis],l=u=>{const d=u._parsed.find(h=>h[r.axis]===c),f=d&&d[u.vScale.axis];if(ye(f)||isNaN(f))return!0};for(const u of s)if(!(n!==void 0&&l(u))&&((o===!1||i.indexOf(u.stack)===-1||o===void 0&&u.stack===void 0)&&i.push(u.stack),u.index===t))break;return i.length||i.push(void 0),i}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(r=>t[r].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)t[de(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,r){const s=this._getStacks(t,r),o=n!==void 0?s.indexOf(n):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,s=[];let o,i;for(o=0,i=n.data.length;o<i;++o)s.push(r.getPixelForValue(this.getParsed(o)[r.axis],o));const a=t.barThickness;return{min:a||VU(n),pixels:s,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:s},options:{base:o,minBarLength:i}}=this,a=o||0,c=this.getParsed(t),l=c._custom,u=Tu(l);let d=c[n.axis],f=0,h=r?this.applyStack(n,c,r):d,p,m;h!==d&&(f=h-d,h=d),u&&(d=l.barStart,h=l.barEnd-l.barStart,d!==0&&Rn(d)!==Rn(l.barEnd)&&(f=0),f+=d);const y=!ye(o)&&!u?o:f;let b=n.getPixelForValue(y);if(this.chart.getDataVisibility(t)?p=n.getPixelForValue(f+h):p=b,m=p-b,Math.abs(m)<i){m=HU(m,n,a)*i,d===a&&(b-=m/2);const x=n.getPixelForDecimal(0),_=n.getPixelForDecimal(1),w=Math.min(x,_),S=Math.max(x,_);b=Math.max(Math.min(b,S),w),p=b+m,r&&!u&&(c._stacks[n.axis]._visualValues[s]=n.getValueForPixel(p)-n.getValueForPixel(b))}if(b===n.getPixelForValue(a)){const x=Rn(m)*n.getLineWidthForValue(a)/2;b+=x,m-=x}return{size:m,base:b,head:p,center:p+m/2}}_calculateBarIndexPixels(t,n){const r=n.scale,s=this.options,o=s.skipNull,i=de(s.maxBarThickness,1/0);let a,c;const l=this._getAxisCount();if(n.grouped){const u=o?this._getStackCount(t):n.stackCount,d=s.barThickness==="flex"?UU(t,n,s,u*l):BU(t,n,s,u*l),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,h=this._getAxis().indexOf(de(f,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+h;a=d.start+d.chunk*p+d.chunk/2,c=Math.min(i,d.chunk*d.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),c=Math.min(i,n.min*n.ratio);return{base:a-c/2,head:a+c/2,center:a,size:c}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,s=r.length;let o=0;for(;o<s;++o)this.getParsed(o)[n.axis]!==null&&!r[o].hidden&&r[o].draw(this._ctx)}}class XU extends Pr{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,s){const o=super.parsePrimitiveData(t,n,r,s);for(let i=0;i<o.length;i++)o[i]._custom=this.resolveDataElementOptions(i+r).radius;return o}parseArrayData(t,n,r,s){const o=super.parseArrayData(t,n,r,s);for(let i=0;i<o.length;i++){const a=n[r+i];o[i]._custom=de(a[2],this.resolveDataElementOptions(i+r).radius)}return o}parseObjectData(t,n,r,s){const o=super.parseObjectData(t,n,r,s);for(let i=0;i<o.length;i++){const a=n[r+i];o[i]._custom=de(a&&a.r&&+a.r,this.resolveDataElementOptions(i+r).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:s,yScale:o}=n,i=this.getParsed(t),a=s.getLabelForValue(i.x),c=o.getLabelForValue(i.y),l=i._custom;return{label:r[t]||"",value:"("+a+", "+c+(l?", "+l:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,s){const o=s==="reset",{iScale:i,vScale:a}=this._cachedMeta,{sharedOptions:c,includeOptions:l}=this._getSharedOptions(n,s),u=i.axis,d=a.axis;for(let f=n;f<n+r;f++){const h=t[f],p=!o&&this.getParsed(f),m={},y=m[u]=o?i.getPixelForDecimal(.5):i.getPixelForValue(p[u]),b=m[d]=o?a.getBasePixel():a.getPixelForValue(p[d]);m.skip=isNaN(y)||isNaN(b),l&&(m.options=c||this.resolveDataElementOptions(f,h.active?"active":s),o&&(m.options.radius=0)),this.updateElement(h,f,m,s)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let s=super.resolveDataElementOptions(t,n);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return n!=="active"&&(s.radius=0),s.radius+=de(r&&r._custom,o),s}}function JU(e,t,n){let r=1,s=1,o=0,i=0;if(t<Ae){const a=e,c=a+t,l=Math.cos(a),u=Math.sin(a),d=Math.cos(c),f=Math.sin(c),h=(_,w,S)=>ui(_,a,c,!0)?1:Math.max(w,w*n,S,S*n),p=(_,w,S)=>ui(_,a,c,!0)?-1:Math.min(w,w*n,S,S*n),m=h(0,l,d),y=h(He,u,f),b=p(we,l,d),x=p(we+He,u,f);r=(m-b)/2,s=(y-x)/2,o=-(m+b)/2,i=-(y+x)/2}return{ratioX:r,ratioY:s,offsetX:o,offsetY:i}}class Dh extends Pr{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data,{labels:{pointStyle:r,textAlign:s,color:o,useBorderRadius:i,borderRadius:a}}=t.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((c,l)=>{const d=t.getDatasetMeta(0).controller.getStyle(l);return{text:c,fillStyle:d.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(l),lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:d.borderWidth,strokeStyle:d.borderColor,textAlign:s,pointStyle:r,borderRadius:i&&(a||d.borderRadius),index:l}}):[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}};constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=r;else{let o=c=>+r[c];if(xe(r[t])){const{key:c="value"}=this._parsing;o=l=>+br(r[l],c)}let i,a;for(i=t,a=t+n;i<a;++i)s._parsed[i]=o(i)}}_getRotation(){return fn(this.options.rotation-90)}_getCircumference(){return fn(this.options.circumference)}_getRotationExtents(){let t=Ae,n=-Ae;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const s=this.chart.getDatasetMeta(r).controller,o=s._getRotation(),i=s._getCircumference();t=Math.min(t,o),n=Math.max(n,o+i)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,s=this._cachedMeta,o=s.data,i=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-i)/2,0),c=Math.min(cB(this.options.cutout,a),1),l=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:h,offsetX:p,offsetY:m}=JU(d,u,c),y=(r.width-i)/f,b=(r.height-i)/h,x=Math.max(Math.min(y,b)/2,0),_=U0(this.options.radius,x),w=Math.max(_*c,0),S=(_-w)/this._getVisibleDatasetWeightTotal();this.offsetX=p*_,this.offsetY=m*_,s.total=this.calculateTotal(),this.outerRadius=_-S*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-S*l,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const r=this.options,s=this._cachedMeta,o=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/Ae)}updateElements(t,n,r,s){const o=s==="reset",i=this.chart,a=i.chartArea,l=i.options.animation,u=(a.left+a.right)/2,d=(a.top+a.bottom)/2,f=o&&l.animateScale,h=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:m,includeOptions:y}=this._getSharedOptions(n,s);let b=this._getRotation(),x;for(x=0;x<n;++x)b+=this._circumference(x,o);for(x=n;x<n+r;++x){const _=this._circumference(x,o),w=t[x],S={x:u+this.offsetX,y:d+this.offsetY,startAngle:b,endAngle:b+_,circumference:_,outerRadius:p,innerRadius:h};y&&(S.options=m||this.resolveDataElementOptions(x,w.active?"active":s)),b+=_,this.updateElement(w,x,S,s)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,s;for(s=0;s<n.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!n[s].hidden&&(r+=Math.abs(o))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Ae*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,s=r.data.labels||[],o=Oi(n._parsed[t],r.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const r=this.chart;let s,o,i,a,c;if(!t){for(s=0,o=r.data.datasets.length;s<o;++s)if(r.isDatasetVisible(s)){i=r.getDatasetMeta(s),t=i.data,a=i.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)c=a.resolveDataElementOptions(s),c.borderAlign!=="inner"&&(n=Math.max(n,c.borderWidth||0,c.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,s=t.length;r<s;++r){const o=this.resolveDataElementOptions(r);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(de(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class yS extends Pr{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:s=[],_dataset:o}=n,i=this.chart._animationsDisabled;let{start:a,count:c}=X0(n,s,i);this._drawStart=a,this._drawCount=c,J0(n)&&(a=0,c=s.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!o._decimated,r.points=s;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(r,void 0,{animated:!i,options:l},t),this.updateElements(s,a,c,t)}updateElements(t,n,r,s){const o=s==="reset",{iScale:i,vScale:a,_stacked:c,_dataset:l}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,s),f=i.axis,h=a.axis,{spanGaps:p,segment:m}=this.options,y=Ys(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||s==="none",x=n+r,_=t.length;let w=n>0&&this.getParsed(n-1);for(let S=0;S<_;++S){const C=t[S],k=b?C:{};if(S<n||S>=x){k.skip=!0;continue}const E=this.getParsed(S),P=ye(E[h]),O=k[f]=i.getPixelForValue(E[f],S),N=k[h]=o||P?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,E,c):E[h],S);k.skip=isNaN(O)||isNaN(N)||P,k.stop=S>0&&Math.abs(E[f]-w[f])>y,m&&(k.parsed=E,k.raw=l.data[S]),d&&(k.options=u||this.resolveDataElementOptions(S,C.active?"active":s)),b||this.updateElement(C,S,k,s),w=E}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return r;const o=s[0].size(this.resolveDataElementOptions(0)),i=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(r,o,i)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class bS extends Pr{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:s}}=t.legend.options;return n.labels.map((o,i)=>{const c=t.getDatasetMeta(0).controller.getStyle(i);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(i),index:i}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,s=r.data.labels||[],o=Oi(n._parsed[t].r,r.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,n,r,s){return iS.bind(this)(t,n,r,s)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(s/2,0),i=Math.max(r.cutoutPercentage?o/100*r.cutoutPercentage:1,0),a=(o-i)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,r,s){const o=s==="reset",i=this.chart,c=i.options.animation,l=this._cachedMeta.rScale,u=l.xCenter,d=l.yCenter,f=l.getIndexAngle(0)-.5*we;let h=f,p;const m=360/this.countVisibleElements();for(p=0;p<n;++p)h+=this._computeAngle(p,s,m);for(p=n;p<n+r;p++){const y=t[p];let b=h,x=h+this._computeAngle(p,s,m),_=i.getDataVisibility(p)?l.getDistanceFromCenterForValue(this.getParsed(p).r):0;h=x,o&&(c.animateScale&&(_=0),c.animateRotate&&(b=x=f));const w={x:u,y:d,innerRadius:0,outerRadius:_,startAngle:b,endAngle:x,options:this.resolveDataElementOptions(p,y.active?"active":s)};this.updateElement(y,p,w,s)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?fn(this.resolveDataElementOptions(t,n).angle||r):0}}class QU extends Dh{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class e5 extends Pr{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,s){return iS.bind(this)(t,n,r,s)}update(t){const n=this._cachedMeta,r=n.dataset,s=n.data||[],o=n.iScale.getLabels();if(r.points=s,t!=="resize"){const i=this.resolveDatasetElementOptions(t);this.options.showLine||(i.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===s.length,options:i};this.updateElement(r,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,n,r,s){const o=this._cachedMeta.rScale,i=s==="reset";for(let a=n;a<n+r;a++){const c=t[a],l=this.resolveDataElementOptions(a,c.active?"active":s),u=o.getPointPositionForValue(a,this.getParsed(a).r),d=i?o.xCenter:u.x,f=i?o.yCenter:u.y,h={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:l};this.updateElement(c,a,h,s)}}}class t5 extends Pr{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:s,yScale:o}=n,i=this.getParsed(t),a=s.getLabelForValue(i.x),c=o.getLabelForValue(i.y);return{label:r[t]||"",value:"("+a+", "+c+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,s=this.chart._animationsDisabled;let{start:o,count:i}=X0(n,r,s);if(this._drawStart=o,this._drawCount=i,J0(n)&&(o=0,i=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:c}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!c._decimated,a.points=r;const l=this.resolveDatasetElementOptions(t);l.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:l},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,o,i,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,s){const o=s==="reset",{iScale:i,vScale:a,_stacked:c,_dataset:l}=this._cachedMeta,u=this.resolveDataElementOptions(n,s),d=this.getSharedOptions(u),f=this.includeOptions(s,d),h=i.axis,p=a.axis,{spanGaps:m,segment:y}=this.options,b=Ys(m)?m:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||s==="none";let _=n>0&&this.getParsed(n-1);for(let w=n;w<n+r;++w){const S=t[w],C=this.getParsed(w),k=x?S:{},E=ye(C[p]),P=k[h]=i.getPixelForValue(C[h],w),O=k[p]=o||E?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,C,c):C[p],w);k.skip=isNaN(P)||isNaN(O)||E,k.stop=w>0&&Math.abs(C[h]-_[h])>b,y&&(k.parsed=C,k.raw=l.data[w]),f&&(k.options=d||this.resolveDataElementOptions(w,S.active?"active":s)),x||this.updateElement(S,w,k,s),_=C}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let c=n.length-1;c>=0;--c)a=Math.max(a,n[c].size(this.resolveDataElementOptions(c))/2);return a>0&&a}const r=t.dataset,s=r.options&&r.options.borderWidth||0;if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),i=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,i)/2}}var n5=Object.freeze({__proto__:null,BarController:YU,BubbleController:XU,DoughnutController:Dh,LineController:yS,PieController:QU,PolarAreaController:bS,RadarController:e5,ScatterController:t5});function Nr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ih{static override(t){Object.assign(Ih.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Nr()}parse(){return Nr()}format(){return Nr()}add(){return Nr()}diff(){return Nr()}startOf(){return Nr()}endOf(){return Nr()}}var r5={_date:Ih};function s5(e,t,n,r){const{controller:s,data:o,_sorted:i}=e,a=s._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&i&&o.length){const l=a._reversePixels?_B:Un;if(r){if(s._sharedOptions){const u=o[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const f=l(o,t,n-d),h=l(o,t,n+d);return{lo:f.lo,hi:h.hi}}}}else{const u=l(o,t,n);if(c){const{vScale:d}=s._cachedMeta,{_parsed:f}=e,h=f.slice(0,u.lo+1).reverse().findIndex(m=>!ye(m[d.axis]));u.lo-=Math.max(0,h);const p=f.slice(u.hi).findIndex(m=>!ye(m[d.axis]));u.hi+=Math.max(0,p)}return u}}return{lo:0,hi:o.length-1}}function Ol(e,t,n,r,s){const o=e.getSortedVisibleDatasetMetas(),i=n[t];for(let a=0,c=o.length;a<c;++a){const{index:l,data:u}=o[a],{lo:d,hi:f}=s5(o[a],t,i,s);for(let h=d;h<=f;++h){const p=u[h];p.skip||r(p,l,h)}}}function o5(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,s){const o=t?Math.abs(r.x-s.x):0,i=n?Math.abs(r.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(i,2))}}function Mu(e,t,n,r,s){const o=[];return!s&&!e.isPointInArea(t)||Ol(e,n,t,function(a,c,l){!s&&!Wn(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&o.push({element:a,datasetIndex:c,index:l})},!0),o}function i5(e,t,n,r){let s=[];function o(i,a,c){const{startAngle:l,endAngle:u}=i.getProps(["startAngle","endAngle"],r),{angle:d}=q0(i,{x:t.x,y:t.y});ui(d,l,u)&&s.push({element:i,datasetIndex:a,index:c})}return Ol(e,n,t,o),s}function a5(e,t,n,r,s,o){let i=[];const a=o5(n);let c=Number.POSITIVE_INFINITY;function l(u,d,f){const h=u.inRange(t.x,t.y,s);if(r&&!h)return;const p=u.getCenterPoint(s);if(!(!!o||e.isPointInArea(p))&&!h)return;const y=a(t,p);y<c?(i=[{element:u,datasetIndex:d,index:f}],c=y):y===c&&i.push({element:u,datasetIndex:d,index:f})}return Ol(e,n,t,l),i}function Au(e,t,n,r,s,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!r?i5(e,t,n,s):a5(e,t,n,r,s,o)}function gy(e,t,n,r,s){const o=[],i=n==="x"?"inXRange":"inYRange";let a=!1;return Ol(e,n,t,(c,l,u)=>{c[i]&&c[i](t[n],s)&&(o.push({element:c,datasetIndex:l,index:u}),a=a||c.inRange(t.x,t.y,s))}),r&&!a?[]:o}var c5={modes:{index(e,t,n,r){const s=Ir(t,e),o=n.axis||"x",i=n.includeInvisible||!1,a=n.intersect?Mu(e,s,o,r,i):Au(e,s,o,!1,r,i),c=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(l=>{const u=a[0].index,d=l.data[u];d&&!d.skip&&c.push({element:d,datasetIndex:l.index,index:u})}),c):[]},dataset(e,t,n,r){const s=Ir(t,e),o=n.axis||"xy",i=n.includeInvisible||!1;let a=n.intersect?Mu(e,s,o,r,i):Au(e,s,o,!1,r,i);if(a.length>0){const c=a[0].datasetIndex,l=e.getDatasetMeta(c).data;a=[];for(let u=0;u<l.length;++u)a.push({element:l[u],datasetIndex:c,index:u})}return a},point(e,t,n,r){const s=Ir(t,e),o=n.axis||"xy",i=n.includeInvisible||!1;return Mu(e,s,o,r,i)},nearest(e,t,n,r){const s=Ir(t,e),o=n.axis||"xy",i=n.includeInvisible||!1;return Au(e,s,o,n.intersect,r,i)},x(e,t,n,r){const s=Ir(t,e);return gy(e,s,"x",n.intersect,r)},y(e,t,n,r){const s=Ir(t,e);return gy(e,s,"y",n.intersect,r)}}};const vS=["left","top","right","bottom"];function wo(e,t){return e.filter(n=>n.pos===t)}function yy(e,t){return e.filter(n=>vS.indexOf(n.pos)===-1&&n.box.axis===t)}function So(e,t){return e.sort((n,r)=>{const s=t?r:n,o=t?n:r;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function l5(e){const t=[];let n,r,s,o,i,a;for(n=0,r=(e||[]).length;n<r;++n)s=e[n],{position:o,options:{stack:i,stackWeight:a=1}}=s,t.push({index:n,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:i&&o+i,stackWeight:a});return t}function u5(e){const t={};for(const n of e){const{stack:r,pos:s,stackWeight:o}=n;if(!r||!vS.includes(s))continue;const i=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=o}return t}function d5(e,t){const n=u5(e),{vBoxMaxWidth:r,hBoxMaxHeight:s}=t;let o,i,a;for(o=0,i=e.length;o<i;++o){a=e[o];const{fullSize:c}=a.box,l=n[a.stack],u=l&&a.stackWeight/l.weight;a.horizontal?(a.width=u?u*r:c&&t.availableWidth,a.height=s):(a.width=r,a.height=u?u*s:c&&t.availableHeight)}return n}function f5(e){const t=l5(e),n=So(t.filter(l=>l.box.fullSize),!0),r=So(wo(t,"left"),!0),s=So(wo(t,"right")),o=So(wo(t,"top"),!0),i=So(wo(t,"bottom")),a=yy(t,"x"),c=yy(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:s.concat(c).concat(i).concat(a),chartArea:wo(t,"chartArea"),vertical:r.concat(s).concat(c),horizontal:o.concat(i).concat(a)}}function by(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function xS(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function h5(e,t,n,r){const{pos:s,box:o}=n,i=e.maxPadding;if(!xe(s)){n.size&&(e[s]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?o.height:o.width),n.size=d.size/d.count,e[s]+=n.size}o.getPadding&&xS(i,o.getPadding());const a=Math.max(0,t.outerWidth-by(i,e,"left","right")),c=Math.max(0,t.outerHeight-by(i,e,"top","bottom")),l=a!==e.w,u=c!==e.h;return e.w=a,e.h=c,n.horizontal?{same:l,other:u}:{same:u,other:l}}function p5(e){const t=e.maxPadding;function n(r){const s=Math.max(t[r]-e[r],0);return e[r]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function m5(e,t){const n=t.maxPadding;function r(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(i=>{o[i]=Math.max(t[i],n[i])}),o}return r(e?["left","right"]:["top","bottom"])}function Do(e,t,n,r){const s=[];let o,i,a,c,l,u;for(o=0,i=e.length,l=0;o<i;++o){a=e[o],c=a.box,c.update(a.width||t.w,a.height||t.h,m5(a.horizontal,t));const{same:d,other:f}=h5(t,n,a,r);l|=d&&s.length,u=u||f,c.fullSize||s.push(a)}return l&&Do(s,t,n,r)||u}function ga(e,t,n,r,s){e.top=n,e.left=t,e.right=t+r,e.bottom=n+s,e.width=r,e.height=s}function vy(e,t,n,r){const s=n.padding;let{x:o,y:i}=t;for(const a of e){const c=a.box,l=r[a.stack]||{placed:0,weight:1},u=a.stackWeight/l.weight||1;if(a.horizontal){const d=t.w*u,f=l.size||c.height;li(l.start)&&(i=l.start),c.fullSize?ga(c,s.left,i,n.outerWidth-s.right-s.left,f):ga(c,t.left+l.placed,i,d,f),l.start=i,l.placed+=d,i=c.bottom}else{const d=t.h*u,f=l.size||c.width;li(l.start)&&(o=l.start),c.fullSize?ga(c,o,s.top,f,n.outerHeight-s.bottom-s.top):ga(c,o,t.top+l.placed,f,d),l.start=o,l.placed+=d,o=c.right}}t.x=o,t.y=i}var bt={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const s=xt(e.options.layout.padding),o=Math.max(t-s.width,0),i=Math.max(n-s.height,0),a=f5(e.boxes),c=a.vertical,l=a.horizontal;Ce(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=c.reduce((m,y)=>y.box.options&&y.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:o,availableHeight:i,vBoxMaxWidth:o/2/u,hBoxMaxHeight:i/2}),f=Object.assign({},s);xS(f,xt(r));const h=Object.assign({maxPadding:f,w:o,h:i,x:s.left,y:s.top},s),p=d5(c.concat(l),d);Do(a.fullSize,h,d,p),Do(c,h,d,p),Do(l,h,d,p)&&Do(c,h,d,p),p5(h),vy(a.leftAndTop,h,d,p),h.x+=h.w,h.y+=h.h,vy(a.rightAndBottom,h,d,p),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Ce(a.chartArea,m=>{const y=m.box;Object.assign(y,e.chartArea),y.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class _S{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,s){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):r)}}isAttached(t){return!0}updateConfig(t){}}class g5 extends _S{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Va="$chartjs",y5={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},xy=e=>e===null||e==="";function b5(e,t){const n=e.style,r=e.getAttribute("height"),s=e.getAttribute("width");if(e[Va]={initial:{height:r,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",xy(s)){const o=ry(e,"width");o!==void 0&&(e.width=o)}if(xy(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=ry(e,"height");o!==void 0&&(e.height=o)}return e}const wS=pU?{passive:!0}:!1;function v5(e,t,n){e&&e.addEventListener(t,n,wS)}function x5(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,wS)}function _5(e,t){const n=y5[e.type]||e.type,{x:r,y:s}=Ir(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:s!==void 0?s:null}}function Tc(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function w5(e,t,n){const r=e.canvas,s=new MutationObserver(o=>{let i=!1;for(const a of o)i=i||Tc(a.addedNodes,r),i=i&&!Tc(a.removedNodes,r);i&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function S5(e,t,n){const r=e.canvas,s=new MutationObserver(o=>{let i=!1;for(const a of o)i=i||Tc(a.removedNodes,r),i=i&&!Tc(a.addedNodes,r);i&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const fi=new Map;let _y=0;function SS(){const e=window.devicePixelRatio;e!==_y&&(_y=e,fi.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function E5(e,t){fi.size||window.addEventListener("resize",SS),fi.set(e,t)}function k5(e){fi.delete(e),fi.size||window.removeEventListener("resize",SS)}function C5(e,t,n){const r=e.canvas,s=r&&Nh(r);if(!s)return;const o=Y0((a,c)=>{const l=s.clientWidth;n(a,c),l<s.clientWidth&&n()},window),i=new ResizeObserver(a=>{const c=a[0],l=c.contentRect.width,u=c.contentRect.height;l===0&&u===0||o(l,u)});return i.observe(s),E5(e,o),i}function Nu(e,t,n){n&&n.disconnect(),t==="resize"&&k5(e)}function R5(e,t,n){const r=e.canvas,s=Y0(o=>{e.ctx!==null&&n(_5(o,e))},e);return v5(r,t,s),s}class P5 extends _S{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(b5(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Va])return!1;const r=n[Va].initial;["height","width"].forEach(o=>{const i=r[o];ye(i)?n.removeAttribute(o):n.setAttribute(o,i)});const s=r.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[Va],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),i={attach:w5,detach:S5,resize:C5}[n]||R5;s[n]=i(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),s=r[n];if(!s)return;({attach:Nu,detach:Nu,resize:Nu}[n]||x5)(t,n,s),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,s){return hU(t,n,r,s)}isAttached(t){const n=t&&Nh(t);return!!(n&&n.isConnected)}}function O5(e){return!Ah()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?g5:P5}let Jn=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return Ys(this.x)&&Ys(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const s={};return t.forEach(o=>{s[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),s}};function T5(e,t){const n=e.options.ticks,r=M5(e),s=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?N5(t):[],i=o.length,a=o[0],c=o[i-1],l=[];if(i>s)return D5(t,l,o,i/s),l;const u=A5(o,t,s);if(i>0){let d,f;const h=i>1?Math.round((c-a)/(i-1)):null;for(ya(t,l,u,ye(h)?0:a-h,a),d=0,f=i-1;d<f;d++)ya(t,l,u,o[d],o[d+1]);return ya(t,l,u,c,ye(h)?t.length:c+h),l}return ya(t,l,u),l}function M5(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),s=e._maxLength/n;return Math.floor(Math.min(r,s))}function A5(e,t,n){const r=I5(e),s=t.length/n;if(!r)return Math.max(s,1);const o=gB(r);for(let i=0,a=o.length-1;i<a;i++){const c=o[i];if(c>s)return c}return Math.max(s,1)}function N5(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function D5(e,t,n,r){let s=0,o=n[0],i;for(r=Math.ceil(r),i=0;i<e.length;i++)i===o&&(t.push(e[i]),s++,o=n[s*r])}function ya(e,t,n,r,s){const o=de(r,0),i=Math.min(de(s,e.length),e.length);let a=0,c,l,u;for(n=Math.ceil(n),s&&(c=s-r,n=c/Math.floor(c/n)),u=o;u<0;)a++,u=Math.round(o+a*n);for(l=Math.max(o,0);l<i;l++)l===u&&(t.push(e[l]),a++,u=Math.round(o+a*n))}function I5(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const j5=e=>e==="left"?"right":e==="right"?"left":e,wy=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Sy=(e,t)=>Math.min(t||e,e);function Ey(e,t){const n=[],r=e.length/t,s=e.length;let o=0;for(;o<s;o+=r)n.push(e[Math.floor(o)]);return n}function L5(e,t,n){const r=e.ticks.length,s=Math.min(t,r-1),o=e._startPixel,i=e._endPixel,a=1e-6;let c=e.getPixelForTick(s),l;if(!(n&&(r===1?l=Math.max(c-o,i-c):t===0?l=(e.getPixelForTick(1)-c)/2:l=(c-e.getPixelForTick(s-1))/2,c+=s<t?l:-l,c<o-a||c>i+a)))return c}function F5(e,t){Ce(e,n=>{const r=n.gc,s=r.length/2;let o;if(s>t){for(o=0;o<s;++o)delete n.data[r[o]];r.splice(0,s)}})}function Eo(e){return e.drawTicks?e.tickLength:0}function ky(e,t){if(!e.display)return 0;const n=rt(e.font,t),r=xt(e.padding);return(ze(e.text)?e.text.length:1)*n.lineHeight+r.height}function z5(e,t){return Rr(e,{scale:t,type:"scale"})}function $5(e,t,n){return Rr(e,{tick:n,index:t,type:"tick"})}function V5(e,t,n){let r=Ch(e);return(n&&t!=="right"||!n&&t==="right")&&(r=j5(r)),r}function B5(e,t,n,r){const{top:s,left:o,bottom:i,right:a,chart:c}=e,{chartArea:l,scales:u}=c;let d=0,f,h,p;const m=i-s,y=a-o;if(e.isHorizontal()){if(h=ht(r,o,a),xe(n)){const b=Object.keys(n)[0],x=n[b];p=u[b].getPixelForValue(x)+m-t}else n==="center"?p=(l.bottom+l.top)/2+m-t:p=wy(e,n,t);f=a-o}else{if(xe(n)){const b=Object.keys(n)[0],x=n[b];h=u[b].getPixelForValue(x)-y+t}else n==="center"?h=(l.left+l.right)/2-y+t:h=wy(e,n,t);p=ht(r,i,s),d=n==="left"?-He:He}return{titleX:h,titleY:p,maxWidth:f,rotation:d}}class hs extends Jn{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:s}=this;return t=Ft(t,Number.POSITIVE_INFINITY),n=Ft(n,Number.NEGATIVE_INFINITY),r=Ft(r,Number.POSITIVE_INFINITY),s=Ft(s,Number.NEGATIVE_INFINITY),{min:Ft(t,r),max:Ft(n,s),minDefined:We(t),maxDefined:We(n)}}getMinMax(t){let{min:n,max:r,minDefined:s,maxDefined:o}=this.getUserBounds(),i;if(s&&o)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let c=0,l=a.length;c<l;++c)i=a[c].controller.getMinMax(this,t),s||(n=Math.min(n,i.min)),o||(r=Math.max(r,i.max));return n=o&&n>r?r:n,r=s&&n>r?n:r,{min:Ft(n,Ft(r,n)),max:Ft(r,Ft(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Me(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:s,grace:o,ticks:i}=this.options,a=i.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=HB(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=a<this.ticks.length;this._convertTicksToLabels(c?Ey(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||i.source==="auto")&&(this.ticks=T5(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Me(this.options.afterUpdate,[this])}beforeSetDimensions(){Me(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Me(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Me(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Me(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,s,o;for(r=0,s=t.length;r<s;r++)o=t[r],o.label=Me(n.callback,[o.value,r,t],this)}afterTickToLabelConversion(){Me(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Me(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Sy(this.ticks.length,t.ticks.maxTicksLimit),s=n.minRotation||0,o=n.maxRotation;let i=s,a,c,l;if(!this._isVisible()||!n.display||s>=o||r<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,h=at(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/r:h/(r-1),d+6>a&&(a=h/(r-(t.offset?.5:1)),c=this.maxHeight-Eo(t.grid)-n.padding-ky(t.title,this.chart.options.font),l=Math.sqrt(d*d+f*f),i=Eh(Math.min(Math.asin(at((u.highest.height+6)/a,-1,1)),Math.asin(at(c/l,-1,1))-Math.asin(at(f/l,-1,1)))),i=Math.max(s,Math.min(o,i))),this.labelRotation=i}afterCalculateLabelRotation(){Me(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Me(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:s,grid:o}}=this,i=this._isVisible(),a=this.isHorizontal();if(i){const c=ky(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=Eo(o)+c):(t.height=this.maxHeight,t.width=Eo(o)+c),r.display&&this.ticks.length){const{first:l,last:u,widest:d,highest:f}=this._getLabelSizes(),h=r.padding*2,p=fn(this.labelRotation),m=Math.cos(p),y=Math.sin(p);if(a){const b=r.mirror?0:y*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+b+h)}else{const b=r.mirror?0:m*d.width+y*f.height;t.width=Math.min(this.maxWidth,t.width+b+h)}this._calculatePadding(l,u,y,m)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,s){const{ticks:{align:o,padding:i},position:a}=this.options,c=this.labelRotation!==0,l=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,h=0;c?l?(f=s*t.width,h=r*n.height):(f=r*t.height,h=s*n.width):o==="start"?h=n.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,h=n.width/2),this.paddingLeft=Math.max((f-u+i)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-d+i)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;o==="start"?(u=0,d=t.height):o==="end"&&(u=n.height,d=0),this.paddingTop=u+i,this.paddingBottom=d+i}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Me(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)ye(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=Ey(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:s,_longestTextCache:o}=this,i=[],a=[],c=Math.floor(n/Sy(n,r));let l=0,u=0,d,f,h,p,m,y,b,x,_,w,S;for(d=0;d<n;d+=c){if(p=t[d].label,m=this._resolveTickFontOptions(d),s.font=y=m.string,b=o[y]=o[y]||{data:{},gc:[]},x=m.lineHeight,_=w=0,!ye(p)&&!ze(p))_=Pc(s,b.data,b.gc,_,p),w=x;else if(ze(p))for(f=0,h=p.length;f<h;++f)S=p[f],!ye(S)&&!ze(S)&&(_=Pc(s,b.data,b.gc,_,S),w+=x);i.push(_),a.push(w),l=Math.max(_,l),u=Math.max(w,u)}F5(o,n);const C=i.indexOf(l),k=a.indexOf(u),E=P=>({width:i[P]||0,height:a[P]||0});return{first:E(0),last:E(n-1),widest:E(C),highest:E(k),widths:i,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return xB(this._alignToPixels?Ar(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=$5(this.getContext(),t,r))}return this.$context||(this.$context=z5(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=fn(this.labelRotation),r=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),o=this._getLabelSizes(),i=t.autoSkipPadding||0,a=o?o.widest.width+i:0,c=o?o.highest.height+i:0;return this.isHorizontal()?c*r>a*s?a/r:c/s:c*s<a*r?c/r:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,s=this.options,{grid:o,position:i,border:a}=s,c=o.offset,l=this.isHorizontal(),d=this.ticks.length+(c?1:0),f=Eo(o),h=[],p=a.setContext(this.getContext()),m=p.display?p.width:0,y=m/2,b=function(D){return Ar(r,D,m)};let x,_,w,S,C,k,E,P,O,N,A,j;if(i==="top")x=b(this.bottom),k=this.bottom-f,P=x-y,N=b(t.top)+y,j=t.bottom;else if(i==="bottom")x=b(this.top),N=t.top,j=b(t.bottom)-y,k=x+y,P=this.top+f;else if(i==="left")x=b(this.right),C=this.right-f,E=x-y,O=b(t.left)+y,A=t.right;else if(i==="right")x=b(this.left),O=t.left,A=b(t.right)-y,C=x+y,E=this.left+f;else if(n==="x"){if(i==="center")x=b((t.top+t.bottom)/2+.5);else if(xe(i)){const D=Object.keys(i)[0],H=i[D];x=b(this.chart.scales[D].getPixelForValue(H))}N=t.top,j=t.bottom,k=x+y,P=k+f}else if(n==="y"){if(i==="center")x=b((t.left+t.right)/2);else if(xe(i)){const D=Object.keys(i)[0],H=i[D];x=b(this.chart.scales[D].getPixelForValue(H))}C=x-y,E=C-f,O=t.left,A=t.right}const $=de(s.ticks.maxTicksLimit,d),q=Math.max(1,Math.ceil(d/$));for(_=0;_<d;_+=q){const D=this.getContext(_),H=o.setContext(D),F=a.setContext(D),W=H.lineWidth,se=H.color,I=F.dash||[],Y=F.dashOffset,K=H.tickWidth,Z=H.tickColor,oe=H.tickBorderDash||[],ce=H.tickBorderDashOffset;w=L5(this,_,c),w!==void 0&&(S=Ar(r,w,W),l?C=E=O=A=S:k=P=N=j=S,h.push({tx1:C,ty1:k,tx2:E,ty2:P,x1:O,y1:N,x2:A,y2:j,width:W,color:se,borderDash:I,borderDashOffset:Y,tickWidth:K,tickColor:Z,tickBorderDash:oe,tickBorderDashOffset:ce}))}return this._ticksLength=d,this._borderValue=x,h}_computeLabelItems(t){const n=this.axis,r=this.options,{position:s,ticks:o}=r,i=this.isHorizontal(),a=this.ticks,{align:c,crossAlign:l,padding:u,mirror:d}=o,f=Eo(r.grid),h=f+u,p=d?-u:h,m=-fn(this.labelRotation),y=[];let b,x,_,w,S,C,k,E,P,O,N,A,j="middle";if(s==="top")C=this.bottom-p,k=this._getXAxisLabelAlignment();else if(s==="bottom")C=this.top+p,k=this._getXAxisLabelAlignment();else if(s==="left"){const q=this._getYAxisLabelAlignment(f);k=q.textAlign,S=q.x}else if(s==="right"){const q=this._getYAxisLabelAlignment(f);k=q.textAlign,S=q.x}else if(n==="x"){if(s==="center")C=(t.top+t.bottom)/2+h;else if(xe(s)){const q=Object.keys(s)[0],D=s[q];C=this.chart.scales[q].getPixelForValue(D)+h}k=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")S=(t.left+t.right)/2-h;else if(xe(s)){const q=Object.keys(s)[0],D=s[q];S=this.chart.scales[q].getPixelForValue(D)}k=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(c==="start"?j="top":c==="end"&&(j="bottom"));const $=this._getLabelSizes();for(b=0,x=a.length;b<x;++b){_=a[b],w=_.label;const q=o.setContext(this.getContext(b));E=this.getPixelForTick(b)+o.labelOffset,P=this._resolveTickFontOptions(b),O=P.lineHeight,N=ze(w)?w.length:1;const D=N/2,H=q.color,F=q.textStrokeColor,W=q.textStrokeWidth;let se=k;i?(S=E,k==="inner"&&(b===x-1?se=this.options.reverse?"left":"right":b===0?se=this.options.reverse?"right":"left":se="center"),s==="top"?l==="near"||m!==0?A=-N*O+O/2:l==="center"?A=-$.highest.height/2-D*O+O:A=-$.highest.height+O/2:l==="near"||m!==0?A=O/2:l==="center"?A=$.highest.height/2-D*O:A=$.highest.height-N*O,d&&(A*=-1),m!==0&&!q.showLabelBackdrop&&(S+=O/2*Math.sin(m))):(C=E,A=(1-N)*O/2);let I;if(q.showLabelBackdrop){const Y=xt(q.backdropPadding),K=$.heights[b],Z=$.widths[b];let oe=A-Y.top,ce=0-Y.left;switch(j){case"middle":oe-=K/2;break;case"bottom":oe-=K;break}switch(k){case"center":ce-=Z/2;break;case"right":ce-=Z;break;case"inner":b===x-1?ce-=Z:b>0&&(ce-=Z/2);break}I={left:ce,top:oe,width:Z+Y.width,height:K+Y.height,color:q.backdropColor}}y.push({label:w,font:P,textOffset:A,options:{rotation:m,color:H,strokeColor:F,strokeWidth:W,textAlign:se,textBaseline:j,translation:[S,C],backdrop:I}})}return y}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-fn(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:s,padding:o}}=this.options,i=this._getLabelSizes(),a=t+o,c=i.widest.width;let l,u;return n==="left"?s?(u=this.right+o,r==="near"?l="left":r==="center"?(l="center",u+=c/2):(l="right",u+=c)):(u=this.right-a,r==="near"?l="right":r==="center"?(l="center",u-=c/2):(l="left",u=this.left)):n==="right"?s?(u=this.left+o,r==="near"?l="right":r==="center"?(l="center",u-=c/2):(l="left",u-=c)):(u=this.left+a,r==="near"?l="left":r==="center"?(l="center",u+=c/2):(l="right",u=this.right)):l="right",{textAlign:l,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:s,width:o,height:i}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,s,o,i),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,i;const a=(c,l,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(c.x,c.y),r.lineTo(l.x,l.y),r.stroke(),r.restore())};if(n.display)for(o=0,i=s.length;o<i;++o){const c=s[o];n.drawOnChartArea&&a({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),n.drawTicks&&a({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:s}}=this,o=r.setContext(this.getContext()),i=r.display?o.width:0;if(!i)return;const a=s.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let l,u,d,f;this.isHorizontal()?(l=Ar(t,this.left,i)-i/2,u=Ar(t,this.right,a)+a/2,d=f=c):(d=Ar(t,this.top,i)-i/2,f=Ar(t,this.bottom,a)+a/2,l=u=c),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(l,d),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,s=this._computeLabelArea();s&&Cl(r,s);const o=this.getLabelItems(t);for(const i of o){const a=i.options,c=i.font,l=i.label,u=i.textOffset;cs(r,l,0,u,c,a)}s&&Rl(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:s}}=this;if(!r.display)return;const o=rt(r.font),i=xt(r.padding),a=r.align;let c=o.lineHeight/2;n==="bottom"||n==="center"||xe(n)?(c+=i.bottom,ze(r.text)&&(c+=o.lineHeight*(r.text.length-1))):c+=i.top;const{titleX:l,titleY:u,maxWidth:d,rotation:f}=B5(this,c,n,a);cs(t,r.text,0,0,o,{color:r.color,maxWidth:d,rotation:f,textAlign:V5(a,n,s),textBaseline:"middle",translation:[l,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=de(t.grid&&t.grid.z,-1),s=de(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==hs.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",s=[];let o,i;for(o=0,i=n.length;o<i;++o){const a=n[o];a[r]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return rt(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class ba{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;H5(n)&&(r=this.register(n));const s=this.items,o=t.id,i=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,U5(t,i,r),this.override&&$e.override(t.id,t.overrides)),i}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,s=this.scope;r in n&&delete n[r],s&&r in $e[s]&&(delete $e[s][r],this.override&&delete as[r])}}function U5(e,t,n){const r=ci(Object.create(null),[n?$e.get(n):{},$e.get(t),e.defaults]);$e.set(t,r),e.defaultRoutes&&W5(t,e.defaultRoutes),e.descriptors&&$e.describe(t,e.descriptors)}function W5(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),s=r.pop(),o=[e].concat(r).join("."),i=t[n].split("."),a=i.pop(),c=i.join(".");$e.route(o,s,c,a)})}function H5(e){return"id"in e&&"defaults"in e}class q5{constructor(){this.controllers=new ba(Pr,"datasets",!0),this.elements=new ba(Jn,"elements"),this.plugins=new ba(Object,"plugins"),this.scales=new ba(hs,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(s=>{const o=r||this._getRegistryForType(s);r||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):Ce(s,i=>{const a=r||this._getRegistryForType(i);this._exec(t,a,i)})})}_exec(t,n,r){const s=Sh(t);Me(r["before"+s],[],r),n[t](r),Me(r["after"+s],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const s=n.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return s}}var wn=new q5;class K5{constructor(){this._init=void 0}notify(t,n,r,s){if(n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const o=s?this._descriptors(t).filter(s):this._descriptors(t),i=this._notify(o,t,n,r);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),i}_notify(t,n,r,s){s=s||{};for(const o of t){const i=o.plugin,a=i[r],c=[n,s,o.options];if(Me(a,c,i)===!1&&s.cancelable)return!1}return!0}invalidate(){ye(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,s=de(r.options&&r.options.plugins,{}),o=Z5(r);return s===!1&&!n?[]:Y5(t,o,s,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,s=(o,i)=>o.filter(a=>!i.some(c=>a.plugin.id===c.plugin.id));this._notify(s(n,r),t,"stop"),this._notify(s(r,n),t,"start")}}function Z5(e){const t={},n=[],r=Object.keys(wn.plugins.items);for(let o=0;o<r.length;o++)n.push(wn.getPlugin(r[o]));const s=e.plugins||[];for(let o=0;o<s.length;o++){const i=s[o];n.indexOf(i)===-1&&(n.push(i),t[i.id]=!0)}return{plugins:n,localIds:t}}function G5(e,t){return!t&&e===!1?null:e===!0?{}:e}function Y5(e,{plugins:t,localIds:n},r,s){const o=[],i=e.getContext();for(const a of t){const c=a.id,l=G5(r[c],s);l!==null&&o.push({plugin:a,options:X5(e.config,{plugin:a,local:n[c]},l,i)})}return o}function X5(e,{plugin:t,local:n},r,s){const o=e.pluginScopeKeys(t),i=e.getOptionScopes(r,o);return n&&t.defaults&&i.push(t.defaults),e.createResolver(i,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Wd(e,t){const n=$e.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function J5(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function Q5(e,t){return e===t?"_index_":"_value_"}function Cy(e){if(e==="x"||e==="y"||e==="r")return e}function eW(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Hd(e,...t){if(Cy(e))return e;for(const n of t){const r=n.axis||eW(n.position)||e.length>1&&Cy(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Ry(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function tW(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return Ry(e,"x",n[0])||Ry(e,"y",n[0])}return{}}function nW(e,t){const n=as[e.type]||{scales:{}},r=t.scales||{},s=Wd(e.type,t),o=Object.create(null);return Object.keys(r).forEach(i=>{const a=r[i];if(!xe(a))return console.error(`Invalid scale configuration for scale: ${i}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${i}`);const c=Hd(i,a,tW(i,e),$e.scales[a.type]),l=Q5(c,s),u=n.scales||{};o[i]=Vo(Object.create(null),[{axis:c},a,u[c],u[l]])}),e.data.datasets.forEach(i=>{const a=i.type||e.type,c=i.indexAxis||Wd(a,t),u=(as[a]||{}).scales||{};Object.keys(u).forEach(d=>{const f=J5(d,c),h=i[f+"AxisID"]||f;o[h]=o[h]||Object.create(null),Vo(o[h],[{axis:f},r[h],u[d]])})}),Object.keys(o).forEach(i=>{const a=o[i];Vo(a,[$e.scales[a.type],$e.scale])}),o}function ES(e){const t=e.options||(e.options={});t.plugins=de(t.plugins,{}),t.scales=nW(e,t)}function kS(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function rW(e){return e=e||{},e.data=kS(e.data),ES(e),e}const Py=new Map,CS=new Set;function va(e,t){let n=Py.get(e);return n||(n=t(),Py.set(e,n),CS.add(n)),n}const ko=(e,t,n)=>{const r=br(t,n);r!==void 0&&e.add(r)};class sW{constructor(t){this._config=rW(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=kS(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),ES(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return va(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return va(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return va(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return va(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let s=r.get(t);return(!s||n)&&(s=new Map,r.set(t,s)),s}getOptionScopes(t,n,r){const{options:s,type:o}=this,i=this._cachedScopes(t,r),a=i.get(n);if(a)return a;const c=new Set;n.forEach(u=>{t&&(c.add(t),u.forEach(d=>ko(c,t,d))),u.forEach(d=>ko(c,s,d)),u.forEach(d=>ko(c,as[o]||{},d)),u.forEach(d=>ko(c,$e,d)),u.forEach(d=>ko(c,Bd,d))});const l=Array.from(c);return l.length===0&&l.push(Object.create(null)),CS.has(n)&&i.set(n,l),l}chartOptionScopes(){const{options:t,type:n}=this;return[t,as[n]||{},$e.datasets[n]||{},{type:n},$e,Bd]}resolveNamedOptions(t,n,r,s=[""]){const o={$shared:!0},{resolver:i,subPrefixes:a}=Oy(this._resolverCache,t,s);let c=i;if(iW(i,n)){o.$shared=!1,r=vr(r)?r():r;const l=this.createResolver(t,r,a);c=Xs(i,r,l)}for(const l of n)o[l]=c[l];return o}createResolver(t,n,r=[""],s){const{resolver:o}=Oy(this._resolverCache,t,r);return xe(n)?Xs(o,n,void 0,s):o}}function Oy(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const s=n.join();let o=r.get(s);return o||(o={resolver:Oh(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(s,o)),o}const oW=e=>xe(e)&&Object.getOwnPropertyNames(e).some(t=>vr(e[t]));function iW(e,t){const{isScriptable:n,isIndexable:r}=nS(e);for(const s of t){const o=n(s),i=r(s),a=(i||o)&&e[s];if(o&&(vr(a)||oW(a))||i&&ze(a))return!0}return!1}var aW="4.5.1";const cW=["top","bottom","left","right","chartArea"];function Ty(e,t){return e==="top"||e==="bottom"||cW.indexOf(e)===-1&&t==="x"}function My(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Ay(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Me(n&&n.onComplete,[e],t)}function lW(e){const t=e.chart,n=t.options.animation;Me(n&&n.onProgress,[e],t)}function RS(e){return Ah()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Ba={},Ny=e=>{const t=RS(e);return Object.values(Ba).filter(n=>n.canvas===t).pop()};function uW(e,t,n){const r=Object.keys(e);for(const s of r){const o=+s;if(o>=t){const i=e[s];delete e[s],(n>0||o>t)&&(e[o+n]=i)}}}function dW(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}let Ti=class{static defaults=$e;static instances=Ba;static overrides=as;static registry=wn;static version=aW;static getChart=Ny;static register(...t){wn.add(...t),Dy()}static unregister(...t){wn.remove(...t),Dy()}constructor(t,n){const r=this.config=new sW(n),s=RS(t),o=Ny(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const i=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||O5(s)),this.platform.updateConfig(r);const a=this.platform.acquireContext(s,i.aspectRatio),c=a&&a.canvas,l=c&&c.height,u=c&&c.width;if(this.id=aB(),this.ctx=a,this.canvas=c,this.width=u,this.height=l,this._options=i,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new K5,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=EB(d=>this.update(d),i.resizeDelay||0),this._dataChanges=[],Ba[this.id]=this,!a||!c){console.error("Failed to create chart: can't acquire context from the given item");return}Ln.listen(this,"complete",Ay),Ln.listen(this,"progress",lW),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:s,_aspectRatio:o}=this;return ye(t)?n&&o?o:s?r/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return wn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ny(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Qg(this.canvas,this.ctx),this}stop(){return Ln.stop(this),this}resize(t,n){Ln.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,s=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(s,t,n,o),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,ny(this,a,!0)&&(this.notifyPlugins("resize",{size:i}),Me(r.onResize,[this,i],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Ce(n,(r,s)=>{r.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,s=Object.keys(r).reduce((i,a)=>(i[a]=!1,i),{});let o=[];n&&(o=o.concat(Object.keys(n).map(i=>{const a=n[i],c=Hd(i,a),l=c==="r",u=c==="x";return{options:a,dposition:l?"chartArea":u?"bottom":"left",dtype:l?"radialLinear":u?"category":"linear"}}))),Ce(o,i=>{const a=i.options,c=a.id,l=Hd(c,a),u=de(a.type,i.dtype);(a.position===void 0||Ty(a.position,l)!==Ty(i.dposition))&&(a.position=i.dposition),s[c]=!0;let d=null;if(c in r&&r[c].type===u)d=r[c];else{const f=wn.getScale(u);d=new f({id:c,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),Ce(s,(i,a)=>{i||delete r[a]}),Ce(r,i=>{bt.configure(this,i,i.options),bt.addBox(this,i)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((s,o)=>s.index-o.index),r>n){for(let s=n;s<r;++s)this._destroyDatasetMeta(s);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(My("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,s)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,s;for(this._removeUnreferencedMetasets(),r=0,s=n.length;r<s;r++){const o=n[r];let i=this.getDatasetMeta(r);const a=o.type||this.config.type;if(i.type&&i.type!==a&&(this._destroyDatasetMeta(r),i=this.getDatasetMeta(r)),i.type=a,i.indexAxis=o.indexAxis||Wd(a,this.options),i.order=o.order||0,i.index=r,i.label=""+o.label,i.visible=this.isDatasetVisible(r),i.controller)i.controller.updateIndex(r),i.controller.linkScales();else{const c=wn.getController(a),{datasetElementType:l,dataElementType:u}=$e.datasets[a];Object.assign(c,{dataElementType:wn.getElement(u),datasetElementType:l&&wn.getElement(l)}),i.controller=new c(this,r),t.push(i.controller)}}return this._updateMetasets(),t}_resetElements(){Ce(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let i=0;for(let l=0,u=this.data.datasets.length;l<u;l++){const{controller:d}=this.getDatasetMeta(l),f=!s&&o.indexOf(d)===-1;d.buildOrUpdateElements(f),i=Math.max(+d.getMaxOverflow(),i)}i=this._minPadding=r.layout.autoPadding?i:0,this._updateLayout(i),s||Ce(o,l=>{l.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(My("z","_idx"));const{_active:a,_lastEvent:c}=this;c?this._eventHandler(c,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Ce(this.scales,t=>{bt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!Wg(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:s,count:o}of n){const i=r==="_removeElements"?-o:o;uW(t,s,i)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(t.filter(i=>i[0]===o).map((i,a)=>a+","+i.splice(1).join(","))),s=r(0);for(let o=1;o<n;o++)if(!Wg(s,r(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;bt.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Ce(this.boxes,s=>{r&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,vr(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),s={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(r.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Ln.has(this)?this.attached&&!Ln.running(this)&&Ln.start(this):(this.draw(),Ay({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let s,o;for(s=0,o=n.length;s<o;++s){const i=n[s];(!t||i.visible)&&r.push(i)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r={meta:t,index:t.index,cancelable:!0},s=hS(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&Cl(n,s),t.controller.draw(),s&&Rl(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Wn(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,s){const o=c5.modes[n];return typeof o=="function"?o(this,t,r,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let s=r.filter(o=>o&&o._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(s)),s}getContext(){return this.$context||(this.$context=Rr(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const s=r?"show":"hide",o=this.getDatasetMeta(t),i=o.controller._resolveAnimations(void 0,s);li(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),i.update(o,{visible:r}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),Ln.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Qg(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Ba[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(o,i)=>{n.addEventListener(this,o,i),t[o]=i},s=(o,i,a)=>{o.offsetX=i,o.offsetY=a,this._eventHandler(o)};Ce(this.options.events,o=>r(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(c,l)=>{n.addEventListener(this,c,l),t[c]=l},s=(c,l)=>{t[c]&&(n.removeEventListener(this,c,l),delete t[c])},o=(c,l)=>{this.canvas&&this.resize(c,l)};let i;const a=()=>{s("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",i)};i=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():i()}unbindEvents(){Ce(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Ce(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const s=r?"set":"remove";let o,i,a,c;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,c=t.length;a<c;++a){i=t[a];const l=i&&this.getDatasetMeta(i.datasetIndex).controller;l&&l[s+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:o,index:i})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[i],index:i}});!kc(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const s=this.options.hover,o=(c,l)=>c.filter(u=>!l.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),i=o(n,t),a=r?t:o(t,n);i.length&&this.updateHoverStyle(i,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=i=>(i.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,s)===!1)return;const o=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,s),(o||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:s=[],options:o}=this,i=n,a=this._getActiveElements(t,s,r,i),c=hB(t),l=dW(t,this._lastEvent,r,c);r&&(this._lastEvent=null,Me(o.onHover,[t,a,this],this),c&&Me(o.onClick,[t,a,this],this));const u=!kc(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=l,u}_getActiveElements(t,n,r,s){if(t.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}};function Dy(){return Ce(Ti.instances,e=>e._plugins.invalidate())}function fW(e,t,n){const{startAngle:r,x:s,y:o,outerRadius:i,innerRadius:a,options:c}=t,{borderWidth:l,borderJoinStyle:u}=c,d=Math.min(l/i,mt(r-n));if(e.beginPath(),e.arc(s,o,i-l/2,r+d/2,n-d/2),a>0){const f=Math.min(l/a,mt(r-n));e.arc(s,o,a+l/2,n-f/2,r+f/2,!0)}else{const f=Math.min(l/2,i*mt(r-n));if(u==="round")e.arc(s,o,f,n-we/2,r+we/2,!0);else if(u==="bevel"){const h=2*f*f,p=-h*Math.cos(n+we/2)+s,m=-h*Math.sin(n+we/2)+o,y=h*Math.cos(r+we/2)+s,b=h*Math.sin(r+we/2)+o;e.lineTo(p,m),e.lineTo(y,b)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function hW(e,t,n){const{startAngle:r,pixelMargin:s,x:o,y:i,outerRadius:a,innerRadius:c}=t;let l=s/a;e.beginPath(),e.arc(o,i,a,r-l,n+l),c>s?(l=s/c,e.arc(o,i,c,n+l,r-l,!0)):e.arc(o,i,s,n+He,r-He),e.closePath(),e.clip()}function pW(e){return Ph(e,["outerStart","outerEnd","innerStart","innerEnd"])}function mW(e,t,n,r){const s=pW(e.options.borderRadius),o=(n-t)/2,i=Math.min(o,r*t/2),a=c=>{const l=(n-Math.min(o,c))*r/2;return at(c,0,Math.min(o,l))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:at(s.innerStart,0,i),innerEnd:at(s.innerEnd,0,i)}}function ws(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Mc(e,t,n,r,s,o){const{x:i,y:a,startAngle:c,pixelMargin:l,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-l,0),f=u>0?u+r+n+l:0;let h=0;const p=s-c;if(r){const q=u>0?u-r:0,D=d>0?d-r:0,H=(q+D)/2,F=H!==0?p*H/(H+r):p;h=(p-F)/2}const m=Math.max(.001,p*d-n/we)/d,y=(p-m)/2,b=c+y+h,x=s-y-h,{outerStart:_,outerEnd:w,innerStart:S,innerEnd:C}=mW(t,f,d,x-b),k=d-_,E=d-w,P=b+_/k,O=x-w/E,N=f+S,A=f+C,j=b+S/N,$=x-C/A;if(e.beginPath(),o){const q=(P+O)/2;if(e.arc(i,a,d,P,q),e.arc(i,a,d,q,O),w>0){const W=ws(E,O,i,a);e.arc(W.x,W.y,w,O,x+He)}const D=ws(A,x,i,a);if(e.lineTo(D.x,D.y),C>0){const W=ws(A,$,i,a);e.arc(W.x,W.y,C,x+He,$+Math.PI)}const H=(x-C/f+(b+S/f))/2;if(e.arc(i,a,f,x-C/f,H,!0),e.arc(i,a,f,H,b+S/f,!0),S>0){const W=ws(N,j,i,a);e.arc(W.x,W.y,S,j+Math.PI,b-He)}const F=ws(k,b,i,a);if(e.lineTo(F.x,F.y),_>0){const W=ws(k,P,i,a);e.arc(W.x,W.y,_,b-He,P)}}else{e.moveTo(i,a);const q=Math.cos(P)*d+i,D=Math.sin(P)*d+a;e.lineTo(q,D);const H=Math.cos(O)*d+i,F=Math.sin(O)*d+a;e.lineTo(H,F)}e.closePath()}function gW(e,t,n,r,s){const{fullCircles:o,startAngle:i,circumference:a}=t;let c=t.endAngle;if(o){Mc(e,t,n,r,c,s);for(let l=0;l<o;++l)e.fill();isNaN(a)||(c=i+(a%Ae||Ae))}return Mc(e,t,n,r,c,s),e.fill(),c}function yW(e,t,n,r,s){const{fullCircles:o,startAngle:i,circumference:a,options:c}=t,{borderWidth:l,borderJoinStyle:u,borderDash:d,borderDashOffset:f,borderRadius:h}=c,p=c.borderAlign==="inner";if(!l)return;e.setLineDash(d||[]),e.lineDashOffset=f,p?(e.lineWidth=l*2,e.lineJoin=u||"round"):(e.lineWidth=l,e.lineJoin=u||"bevel");let m=t.endAngle;if(o){Mc(e,t,n,r,m,s);for(let y=0;y<o;++y)e.stroke();isNaN(a)||(m=i+(a%Ae||Ae))}p&&hW(e,t,m),c.selfJoin&&m-i>=we&&h===0&&u!=="miter"&&fW(e,t,m),o||(Mc(e,t,n,r,m,s),e.stroke())}class bW extends Jn{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,n,r){const s=this.getProps(["x","y"],r),{angle:o,distance:i}=q0(s,{x:t,y:n}),{startAngle:a,endAngle:c,innerRadius:l,outerRadius:u,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),f=(this.options.spacing+this.options.borderWidth)/2,h=de(d,c-a),p=ui(o,a,c)&&a!==c,m=h>=Ae||p,y=Bn(i,l+f,u+f);return m&&y}getCenterPoint(t){const{x:n,y:r,startAngle:s,endAngle:o,innerRadius:i,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:c,spacing:l}=this.options,u=(s+o)/2,d=(i+a+l+c)/2;return{x:n+Math.cos(u)*d,y:r+Math.sin(u)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:n,circumference:r}=this,s=(n.offset||0)/4,o=(n.spacing||0)/2,i=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=r>Ae?Math.floor(r/Ae):0,r===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*s,Math.sin(a)*s);const c=1-Math.sin(Math.min(we,r||0)),l=s*c;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,gW(t,this,l,o,i),yW(t,this,l,o,i),t.restore()}}function PS(e,t,n=t){e.lineCap=de(n.borderCapStyle,t.borderCapStyle),e.setLineDash(de(n.borderDash,t.borderDash)),e.lineDashOffset=de(n.borderDashOffset,t.borderDashOffset),e.lineJoin=de(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=de(n.borderWidth,t.borderWidth),e.strokeStyle=de(n.borderColor,t.borderColor)}function vW(e,t,n){e.lineTo(n.x,n.y)}function xW(e){return e.stepped?jB:e.tension||e.cubicInterpolationMode==="monotone"?LB:vW}function OS(e,t,n={}){const r=e.length,{start:s=0,end:o=r-1}=n,{start:i,end:a}=t,c=Math.max(s,i),l=Math.min(o,a),u=s<i&&o<i||s>a&&o>a;return{count:r,start:c,loop:t.loop,ilen:l<c&&!u?r+l-c:l-c}}function _W(e,t,n,r){const{points:s,options:o}=t,{count:i,start:a,loop:c,ilen:l}=OS(s,n,r),u=xW(o);let{move:d=!0,reverse:f}=r||{},h,p,m;for(h=0;h<=l;++h)p=s[(a+(f?l-h:h))%i],!p.skip&&(d?(e.moveTo(p.x,p.y),d=!1):u(e,m,p,f,o.stepped),m=p);return c&&(p=s[(a+(f?l:0))%i],u(e,m,p,f,o.stepped)),!!c}function wW(e,t,n,r){const s=t.points,{count:o,start:i,ilen:a}=OS(s,n,r),{move:c=!0,reverse:l}=r||{};let u=0,d=0,f,h,p,m,y,b;const x=w=>(i+(l?a-w:w))%o,_=()=>{m!==y&&(e.lineTo(u,y),e.lineTo(u,m),e.lineTo(u,b))};for(c&&(h=s[x(0)],e.moveTo(h.x,h.y)),f=0;f<=a;++f){if(h=s[x(f)],h.skip)continue;const w=h.x,S=h.y,C=w|0;C===p?(S<m?m=S:S>y&&(y=S),u=(d*u+w)/++d):(_(),e.lineTo(w,S),p=C,d=0,m=y=S),b=S}_()}function qd(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?wW:_W}function SW(e){return e.stepped?mU:e.tension||e.cubicInterpolationMode==="monotone"?gU:jr}function EW(e,t,n,r){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,r)&&s.closePath()),PS(e,t.options),e.stroke(s)}function kW(e,t,n,r){const{segments:s,options:o}=t,i=qd(t);for(const a of s)PS(e,o,a.style),e.beginPath(),i(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const CW=typeof Path2D=="function";function RW(e,t,n,r){CW&&!t.options.segment?EW(e,t,n,r):kW(e,t,n,r)}class Mi extends Jn{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const s=r.spanGaps?this._loop:this._fullLoop;aU(this._points,r,t,s,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=wU(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,s=t[n],o=this.points,i=fS(this,{property:n,start:s,end:s});if(!i.length)return;const a=[],c=SW(r);let l,u;for(l=0,u=i.length;l<u;++l){const{start:d,end:f}=i[l],h=o[d],p=o[f];if(h===p){a.push(h);continue}const m=Math.abs((s-h[n])/(p[n]-h[n])),y=c(h,p,m,r.stepped);y[n]=t[n],a.push(y)}return a.length===1?a[0]:a}pathSegment(t,n,r){return qd(this)(t,this,n,r)}path(t,n,r){const s=this.segments,o=qd(this);let i=this._loop;n=n||0,r=r||this.points.length-n;for(const a of s)i&=o(t,this,a,{start:n,end:n+r-1});return!!i}draw(t,n,r,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),RW(t,this,r,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Iy(e,t,n,r){const s=e.options,{[n]:o}=e.getProps([n],r);return Math.abs(t-o)<s.radius+s.hitRadius}class TS extends Jn{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,n,r){const s=this.options,{x:o,y:i}=this.getProps(["x","y"],r);return Math.pow(t-o,2)+Math.pow(n-i,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,n){return Iy(this,t,"x",n)}inYRange(t,n){return Iy(this,t,"y",n)}getCenterPoint(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);const r=n&&t.borderWidth||0;return(n+r)*2}draw(t,n){const r=this.options;this.skip||r.radius<.1||!Wn(this,n,this.size(r)/2)||(t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.fillStyle=r.backgroundColor,Ud(t,r,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function MS(e,t){const{x:n,y:r,base:s,width:o,height:i}=e.getProps(["x","y","base","width","height"],t);let a,c,l,u,d;return e.horizontal?(d=i/2,a=Math.min(n,s),c=Math.max(n,s),l=r-d,u=r+d):(d=o/2,a=n-d,c=n+d,l=Math.min(r,s),u=Math.max(r,s)),{left:a,top:l,right:c,bottom:u}}function lr(e,t,n,r){return e?0:at(t,n,r)}function PW(e,t,n){const r=e.options.borderWidth,s=e.borderSkipped,o=tS(r);return{t:lr(s.top,o.top,0,n),r:lr(s.right,o.right,0,t),b:lr(s.bottom,o.bottom,0,n),l:lr(s.left,o.left,0,t)}}function OW(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),s=e.options.borderRadius,o=Zr(s),i=Math.min(t,n),a=e.borderSkipped,c=r||xe(s);return{topLeft:lr(!c||a.top||a.left,o.topLeft,0,i),topRight:lr(!c||a.top||a.right,o.topRight,0,i),bottomLeft:lr(!c||a.bottom||a.left,o.bottomLeft,0,i),bottomRight:lr(!c||a.bottom||a.right,o.bottomRight,0,i)}}function TW(e){const t=MS(e),n=t.right-t.left,r=t.bottom-t.top,s=PW(e,n/2,r/2),o=OW(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:n-s.l-s.r,h:r-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function Du(e,t,n,r){const s=t===null,o=n===null,a=e&&!(s&&o)&&MS(e,r);return a&&(s||Bn(t,a.left,a.right))&&(o||Bn(n,a.top,a.bottom))}function MW(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function AW(e,t){e.rect(t.x,t.y,t.w,t.h)}function Iu(e,t,n={}){const r=e.x!==n.x?-t:0,s=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-r,i=(e.y+e.h!==n.y+n.h?t:0)-s;return{x:e.x+r,y:e.y+s,w:e.w+o,h:e.h+i,radius:e.radius}}class NW extends Jn{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:s}}=this,{inner:o,outer:i}=TW(this),a=MW(i.radius)?di:AW;t.save(),(i.w!==o.w||i.h!==o.h)&&(t.beginPath(),a(t,Iu(i,n,o)),t.clip(),a(t,Iu(o,-n,i)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,Iu(o,n)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,n,r){return Du(this,t,n,r)}inXRange(t,n){return Du(this,t,null,n)}inYRange(t,n){return Du(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+s)/2:n,y:o?r:(r+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}var DW=Object.freeze({__proto__:null,ArcElement:bW,BarElement:NW,LineElement:Mi,PointElement:TS});const Kd=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],jy=Kd.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function AS(e){return Kd[e%Kd.length]}function NS(e){return jy[e%jy.length]}function IW(e,t){return e.borderColor=AS(t),e.backgroundColor=NS(t),++t}function jW(e,t){return e.backgroundColor=e.data.map(()=>AS(t++)),t}function LW(e,t){return e.backgroundColor=e.data.map(()=>NS(t++)),t}function FW(e){let t=0;return(n,r)=>{const s=e.getDatasetMeta(r).controller;s instanceof Dh?t=jW(n,t):s instanceof bS?t=LW(n,t):s&&(t=IW(n,t))}}function Ly(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function zW(e){return e&&(e.borderColor||e.backgroundColor)}function $W(){return $e.borderColor!=="rgba(0,0,0,0.1)"||$e.backgroundColor!=="rgba(0,0,0,0.1)"}var VW={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:s}=e.config,{elements:o}=s,i=Ly(r)||zW(s)||o&&Ly(o)||$W();if(!n.forceOverride&&i)return;const a=FW(e);r.forEach(a)}};function BW(e,t,n,r,s){const o=s.samples||r;if(o>=n)return e.slice(t,t+n);const i=[],a=(n-2)/(o-2);let c=0;const l=t+n-1;let u=t,d,f,h,p,m;for(i[c++]=e[u],d=0;d<o-2;d++){let y=0,b=0,x;const _=Math.floor((d+1)*a)+1+t,w=Math.min(Math.floor((d+2)*a)+1,n)+t,S=w-_;for(x=_;x<w;x++)y+=e[x].x,b+=e[x].y;y/=S,b/=S;const C=Math.floor(d*a)+1+t,k=Math.min(Math.floor((d+1)*a)+1,n)+t,{x:E,y:P}=e[u];for(h=p=-1,x=C;x<k;x++)p=.5*Math.abs((E-y)*(e[x].y-P)-(E-e[x].x)*(b-P)),p>h&&(h=p,f=e[x],m=x);i[c++]=f,u=m}return i[c++]=e[l],i}function UW(e,t,n,r){let s=0,o=0,i,a,c,l,u,d,f,h,p,m;const y=[],b=t+n-1,x=e[t].x,w=e[b].x-x;for(i=t;i<t+n;++i){a=e[i],c=(a.x-x)/w*r,l=a.y;const S=c|0;if(S===u)l<p?(p=l,d=i):l>m&&(m=l,f=i),s=(o*s+a.x)/++o;else{const C=i-1;if(!ye(d)&&!ye(f)){const k=Math.min(d,f),E=Math.max(d,f);k!==h&&k!==C&&y.push({...e[k],x:s}),E!==h&&E!==C&&y.push({...e[E],x:s})}i>0&&C!==h&&y.push(e[C]),y.push(a),u=S,o=0,p=m=l,d=f=h=i}}return y}function DS(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Fy(e){e.data.datasets.forEach(t=>{DS(t)})}function WW(e,t){const n=t.length;let r=0,s;const{iScale:o}=e,{min:i,max:a,minDefined:c,maxDefined:l}=o.getUserBounds();return c&&(r=at(Un(t,o.axis,i).lo,0,n-1)),l?s=at(Un(t,o.axis,a).hi+1,r,n)-r:s=n-r,{start:r,count:s}}var HW={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Fy(e);return}const r=e.width;e.data.datasets.forEach((s,o)=>{const{_data:i,indexAxis:a}=s,c=e.getDatasetMeta(o),l=i||s.data;if(No([a,e.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;const u=e.scales[c.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:f}=WW(c,l);const h=n.threshold||4*r;if(f<=h){DS(s);return}ye(i)&&(s._data=l,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let p;switch(n.algorithm){case"lttb":p=BW(l,d,f,r,n);break;case"min-max":p=UW(l,d,f,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(e){Fy(e)}};function qW(e,t,n){const r=e.segments,s=e.points,o=t.points,i=[];for(const a of r){let{start:c,end:l}=a;l=Tl(c,l,s);const u=Zd(n,s[c],s[l],a.loop);if(!t.segments){i.push({source:a,target:u,start:s[c],end:s[l]});continue}const d=fS(t,u);for(const f of d){const h=Zd(n,o[f.start],o[f.end],f.loop),p=dS(a,s,h);for(const m of p)i.push({source:m,target:f,start:{[n]:zy(u,h,"start",Math.max)},end:{[n]:zy(u,h,"end",Math.min)}})}}return i}function Zd(e,t,n,r){if(r)return;let s=t[e],o=n[e];return e==="angle"&&(s=mt(s),o=mt(o)),{property:e,start:s,end:o}}function KW(e,t){const{x:n=null,y:r=null}=e||{},s=t.points,o=[];return t.segments.forEach(({start:i,end:a})=>{a=Tl(i,a,s);const c=s[i],l=s[a];r!==null?(o.push({x:c.x,y:r}),o.push({x:l.x,y:r})):n!==null&&(o.push({x:n,y:c.y}),o.push({x:n,y:l.y}))}),o}function Tl(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function zy(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function IS(e,t){let n=[],r=!1;return ze(e)?(r=!0,n=e):n=KW(e,t),n.length?new Mi({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function $y(e){return e&&e.fill!==!1}function ZW(e,t,n){let s=e[t].fill;const o=[t];let i;if(!n)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!We(s))return s;if(i=e[s],!i)return!1;if(i.visible)return s;o.push(s),s=i.fill}return!1}function GW(e,t,n){const r=QW(e);if(xe(r))return isNaN(r.value)?!1:r;let s=parseFloat(r);return We(s)&&Math.floor(s)===s?YW(r[0],t,s,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function YW(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function XW(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:xe(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function JW(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:xe(e)?r=e.value:r=t.getBaseValue(),r}function QW(e){const t=e.options,n=t.fill;let r=de(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function e4(e){const{scale:t,index:n,line:r}=e,s=[],o=r.segments,i=r.points,a=t4(t,n);a.push(IS({x:null,y:t.bottom},r));for(let c=0;c<o.length;c++){const l=o[c];for(let u=l.start;u<=l.end;u++)n4(s,i[u],a)}return new Mi({points:s,options:{}})}function t4(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let s=0;s<r.length;s++){const o=r[s];if(o.index===t)break;o.hidden||n.unshift(o.dataset)}return n}function n4(e,t,n){const r=[];for(let s=0;s<n.length;s++){const o=n[s],{first:i,last:a,point:c}=r4(o,t,"x");if(!(!c||i&&a)){if(i)r.unshift(c);else if(e.push(c),!a)break}}e.push(...r)}function r4(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const s=r[n],o=e.segments,i=e.points;let a=!1,c=!1;for(let l=0;l<o.length;l++){const u=o[l],d=i[u.start][n],f=i[u.end][n];if(Bn(s,d,f)){a=s===d,c=s===f;break}}return{first:a,last:c,point:r}}class jS{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:s,y:o,radius:i}=this;return n=n||{start:0,end:Ae},t.arc(s,o,i,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:s}=this,o=t.angle;return{x:n+Math.cos(o)*s,y:r+Math.sin(o)*s,angle:o}}}function s4(e){const{chart:t,fill:n,line:r}=e;if(We(n))return o4(t,n);if(n==="stack")return e4(e);if(n==="shape")return!0;const s=i4(e);return s instanceof jS?s:IS(s,r)}function o4(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function i4(e){return(e.scale||{}).getPointPositionForValue?c4(e):a4(e)}function a4(e){const{scale:t={},fill:n}=e,r=XW(n,t);if(We(r)){const s=t.isHorizontal();return{x:s?r:null,y:s?null:r}}return null}function c4(e){const{scale:t,fill:n}=e,r=t.options,s=t.getLabels().length,o=r.reverse?t.max:t.min,i=JW(n,t,o),a=[];if(r.grid.circular){const c=t.getPointPositionForValue(0,o);return new jS({x:c.x,y:c.y,radius:t.getDistanceFromCenterForValue(i)})}for(let c=0;c<s;++c)a.push(t.getPointPositionForValue(c,i));return a}function ju(e,t,n){const r=s4(t),{chart:s,index:o,line:i,scale:a,axis:c}=t,l=i.options,u=l.fill,d=l.backgroundColor,{above:f=d,below:h=d}=u||{},p=s.getDatasetMeta(o),m=hS(s,p);r&&i.points.length&&(Cl(e,n),l4(e,{line:i,target:r,above:f,below:h,area:n,scale:a,axis:c,clip:m}),Rl(e))}function l4(e,t){const{line:n,target:r,above:s,below:o,area:i,scale:a,clip:c}=t,l=n._loop?"angle":t.axis;e.save();let u=o;o!==s&&(l==="x"?(Vy(e,r,i.top),Lu(e,{line:n,target:r,color:s,scale:a,property:l,clip:c}),e.restore(),e.save(),Vy(e,r,i.bottom)):l==="y"&&(By(e,r,i.left),Lu(e,{line:n,target:r,color:o,scale:a,property:l,clip:c}),e.restore(),e.save(),By(e,r,i.right),u=s)),Lu(e,{line:n,target:r,color:u,scale:a,property:l,clip:c}),e.restore()}function Vy(e,t,n){const{segments:r,points:s}=t;let o=!0,i=!1;e.beginPath();for(const a of r){const{start:c,end:l}=a,u=s[c],d=s[Tl(c,l,s)];o?(e.moveTo(u.x,u.y),o=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),i=!!t.pathSegment(e,a,{move:i}),i?e.closePath():e.lineTo(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function By(e,t,n){const{segments:r,points:s}=t;let o=!0,i=!1;e.beginPath();for(const a of r){const{start:c,end:l}=a,u=s[c],d=s[Tl(c,l,s)];o?(e.moveTo(u.x,u.y),o=!1):(e.lineTo(n,u.y),e.lineTo(u.x,u.y)),i=!!t.pathSegment(e,a,{move:i}),i?e.closePath():e.lineTo(n,d.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function Lu(e,t){const{line:n,target:r,property:s,color:o,scale:i,clip:a}=t,c=qW(n,r,s);for(const{source:l,target:u,start:d,end:f}of c){const{style:{backgroundColor:h=o}={}}=l,p=r!==!0;e.save(),e.fillStyle=h,u4(e,i,a,p&&Zd(s,d,f)),e.beginPath();const m=!!n.pathSegment(e,l);let y;if(p){m?e.closePath():Uy(e,r,f,s);const b=!!r.pathSegment(e,u,{move:m,reverse:!0});y=m&&b,y||Uy(e,r,d,s)}e.closePath(),e.fill(y?"evenodd":"nonzero"),e.restore()}}function u4(e,t,n,r){const s=t.chart.chartArea,{property:o,start:i,end:a}=r||{};if(o==="x"||o==="y"){let c,l,u,d;o==="x"?(c=i,l=s.top,u=a,d=s.bottom):(c=s.left,l=i,u=s.right,d=a),e.beginPath(),n&&(c=Math.max(c,n.left),u=Math.min(u,n.right),l=Math.max(l,n.top),d=Math.min(d,n.bottom)),e.rect(c,l,u-c,d-l),e.clip()}}function Uy(e,t,n,r){const s=t.interpolate(n,r);s&&e.lineTo(s.x,s.y)}var LS={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,s=[];let o,i,a,c;for(i=0;i<r;++i)o=e.getDatasetMeta(i),a=o.dataset,c=null,a&&a.options&&a instanceof Mi&&(c={visible:e.isDatasetVisible(i),index:i,fill:GW(a,i,r),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=c,s.push(c);for(i=0;i<r;++i)c=s[i],!(!c||c.fill===!1)&&(c.fill=ZW(s,i,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",s=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let i=s.length-1;i>=0;--i){const a=s[i].$filler;a&&(a.line.updateControlPoints(o,a.axis),r&&a.fill&&ju(e.ctx,a,o))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let s=r.length-1;s>=0;--s){const o=r[s].$filler;$y(o)&&ju(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!$y(r)||n.drawTime!=="beforeDatasetDraw"||ju(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Wy=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},d4=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Hy extends Jn{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=Me(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,s)=>t.sort(r,s,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,s=rt(r.font),o=s.size,i=this._computeTitleHeight(),{boxWidth:a,itemHeight:c}=Wy(r,o);let l,u;n.font=s.string,this.isHorizontal()?(l=this.maxWidth,u=this._fitRows(i,o,a,c)+10):(u=this.maxHeight,l=this._fitCols(i,s,a,c)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,s){const{ctx:o,maxWidth:i,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],l=this.lineWidths=[0],u=s+a;let d=t;o.textAlign="left",o.textBaseline="middle";let f=-1,h=-u;return this.legendItems.forEach((p,m)=>{const y=r+n/2+o.measureText(p.text).width;(m===0||l[l.length-1]+y+2*a>i)&&(d+=u,l[l.length-(m>0?0:1)]=0,h+=u,f++),c[m]={left:0,top:h,row:f,width:y,height:s},l[l.length-1]+=y+a}),d}_fitCols(t,n,r,s){const{ctx:o,maxHeight:i,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],l=this.columnSizes=[],u=i-t;let d=a,f=0,h=0,p=0,m=0;return this.legendItems.forEach((y,b)=>{const{itemWidth:x,itemHeight:_}=f4(r,n,o,y,s);b>0&&h+_+2*a>u&&(d+=f+a,l.push({width:f,height:h}),p+=f+a,m++,f=h=0),c[b]={left:p,top:h,col:m,width:x,height:_},f=Math.max(f,x),h+=_+a}),d+=f,l.push({width:f,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:s},rtl:o}}=this,i=Bs(o,this.left,this.width);if(this.isHorizontal()){let a=0,c=ht(r,this.left+s,this.right-this.lineWidths[a]);for(const l of n)a!==l.row&&(a=l.row,c=ht(r,this.left+s,this.right-this.lineWidths[a])),l.top+=this.top+t+s,l.left=i.leftForLtr(i.x(c),l.width),c+=l.width+s}else{let a=0,c=ht(r,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const l of n)l.col!==a&&(a=l.col,c=ht(r,this.top+t+s,this.bottom-this.columnSizes[a].height)),l.top=c,l.left+=this.left+s,l.left=i.leftForLtr(i.x(l.left),l.width),c+=l.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Cl(t,this),this._draw(),Rl(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:s}=this,{align:o,labels:i}=t,a=$e.color,c=Bs(t.rtl,this.left,this.width),l=rt(i.font),{padding:u}=i,d=l.size,f=d/2;let h;this.drawTitle(),s.textAlign=c.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=l.string;const{boxWidth:p,boxHeight:m,itemHeight:y}=Wy(i,d),b=function(C,k,E){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;s.save();const P=de(E.lineWidth,1);if(s.fillStyle=de(E.fillStyle,a),s.lineCap=de(E.lineCap,"butt"),s.lineDashOffset=de(E.lineDashOffset,0),s.lineJoin=de(E.lineJoin,"miter"),s.lineWidth=P,s.strokeStyle=de(E.strokeStyle,a),s.setLineDash(de(E.lineDash,[])),i.usePointStyle){const O={radius:m*Math.SQRT2/2,pointStyle:E.pointStyle,rotation:E.rotation,borderWidth:P},N=c.xPlus(C,p/2),A=k+f;eS(s,O,N,A,i.pointStyleWidth&&p)}else{const O=k+Math.max((d-m)/2,0),N=c.leftForLtr(C,p),A=Zr(E.borderRadius);s.beginPath(),Object.values(A).some(j=>j!==0)?di(s,{x:N,y:O,w:p,h:m,radius:A}):s.rect(N,O,p,m),s.fill(),P!==0&&s.stroke()}s.restore()},x=function(C,k,E){cs(s,E.text,C,k+y/2,l,{strikethrough:E.hidden,textAlign:c.textAlign(E.textAlign)})},_=this.isHorizontal(),w=this._computeTitleHeight();_?h={x:ht(o,this.left+u,this.right-r[0]),y:this.top+u+w,line:0}:h={x:this.left+u,y:ht(o,this.top+w+u,this.bottom-n[0].height),line:0},cS(this.ctx,t.textDirection);const S=y+u;this.legendItems.forEach((C,k)=>{s.strokeStyle=C.fontColor,s.fillStyle=C.fontColor;const E=s.measureText(C.text).width,P=c.textAlign(C.textAlign||(C.textAlign=i.textAlign)),O=p+f+E;let N=h.x,A=h.y;c.setWidth(this.width),_?k>0&&N+O+u>this.right&&(A=h.y+=S,h.line++,N=h.x=ht(o,this.left+u,this.right-r[h.line])):k>0&&A+S>this.bottom&&(N=h.x=N+n[h.line].width+u,h.line++,A=h.y=ht(o,this.top+w+u,this.bottom-n[h.line].height));const j=c.x(N);if(b(j,A,C),N=kB(P,N+p+f,_?N+O:this.right,t.rtl),x(c.x(N),A,C),_)h.x+=O+u;else if(typeof C.text!="string"){const $=l.lineHeight;h.y+=FS(C,$)+u}else h.y+=S}),lS(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=rt(n.font),s=xt(n.padding);if(!n.display)return;const o=Bs(t.rtl,this.left,this.width),i=this.ctx,a=n.position,c=r.size/2,l=s.top+c;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+l,d=ht(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((m,y)=>Math.max(m,y.height),0);u=l+ht(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const h=ht(a,d,d+f);i.textAlign=o.textAlign(Ch(a)),i.textBaseline="middle",i.strokeStyle=n.color,i.fillStyle=n.color,i.font=r.string,cs(i,n.text,h,u,r)}_computeTitleHeight(){const t=this.options.title,n=rt(t.font),r=xt(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,s,o;if(Bn(t,this.left,this.right)&&Bn(n,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;r<o.length;++r)if(s=o[r],Bn(t,s.left,s.left+s.width)&&Bn(n,s.top,s.top+s.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!m4(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=d4(s,r);s&&!o&&Me(n.onLeave,[t,s,this],this),this._hoveredItem=r,r&&!o&&Me(n.onHover,[t,r,this],this)}else r&&Me(n.onClick,[t,r,this],this)}}function f4(e,t,n,r,s){const o=h4(r,e,t,n),i=p4(s,r,t.lineHeight);return{itemWidth:o,itemHeight:i}}function h4(e,t,n,r){let s=e.text;return s&&typeof s!="string"&&(s=s.reduce((o,i)=>o.length>i.length?o:i)),t+n.size/2+r.measureText(s).width}function p4(e,t,n){let r=e;return typeof t.text!="string"&&(r=FS(t,n)),r}function FS(e,t){const n=e.text?e.text.length:0;return t*n}function m4(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var zS={id:"legend",_element:Hy,start(e,t,n){const r=e.legend=new Hy({ctx:e.ctx,options:n,chart:e});bt.configure(e,r,n),bt.addBox(e,r)},stop(e){bt.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;bt.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,s=n.chart;s.isDatasetVisible(r)?(s.hide(r),t.hidden=!0):(s.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:s,color:o,useBorderRadius:i,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(c=>{const l=c.controller.getStyle(n?0:void 0),u=xt(l.borderWidth);return{text:t[c.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!c.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:l.borderColor,pointStyle:r||l.pointStyle,rotation:l.rotation,textAlign:s||l.textAlign,borderRadius:i&&(a||l.borderRadius),datasetIndex:c.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class jh extends Jn{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const s=ze(r.text)?r.text.length:1;this._padding=xt(r.padding);const o=s*rt(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:s,right:o,options:i}=this,a=i.align;let c=0,l,u,d;return this.isHorizontal()?(u=ht(a,r,o),d=n+t,l=o-r):(i.position==="left"?(u=r+t,d=ht(a,s,n),c=we*-.5):(u=o-t,d=ht(a,n,s),c=we*.5),l=s-n),{titleX:u,titleY:d,maxWidth:l,rotation:c}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=rt(n.font),o=r.lineHeight/2+this._padding.top,{titleX:i,titleY:a,maxWidth:c,rotation:l}=this._drawArgs(o);cs(t,n.text,0,0,r,{color:n.color,maxWidth:c,rotation:l,textAlign:Ch(n.align),textBaseline:"middle",translation:[i,a]})}}function g4(e,t){const n=new jh({ctx:e.ctx,options:t,chart:e});bt.configure(e,n,t),bt.addBox(e,n),e.titleBlock=n}var y4={id:"title",_element:jh,start(e,t,n){g4(e,n)},stop(e){const t=e.titleBlock;bt.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;bt.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const xa=new WeakMap;var b4={id:"subtitle",start(e,t,n){const r=new jh({ctx:e.ctx,options:n,chart:e});bt.configure(e,r,n),bt.addBox(e,r),xa.set(e,r)},stop(e){bt.removeBox(e,xa.get(e)),xa.delete(e)},beforeUpdate(e,t,n){const r=xa.get(e);bt.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Io={average(e){if(!e.length)return!1;let t,n,r=new Set,s=0,o=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const c=a.tooltipPosition();r.add(c.x),s+=c.y,++o}}return o===0||r.size===0?!1:{x:[...r].reduce((a,c)=>a+c)/r.size,y:s/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,s=Number.POSITIVE_INFINITY,o,i,a;for(o=0,i=e.length;o<i;++o){const c=e[o].element;if(c&&c.hasValue()){const l=c.getCenterPoint(),u=Vd(t,l);u<s&&(s=u,a=c)}}if(a){const c=a.tooltipPosition();n=c.x,r=c.y}return{x:n,y:r}}};function _n(e,t){return t&&(ze(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Fn(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
104
|
-
`)>-1?e.split(`
|
|
105
|
-
`):e}function v4(e,t){const{element:n,datasetIndex:r,index:s}=t,o=e.getDatasetMeta(r).controller,{label:i,value:a}=o.getLabelAndValue(s);return{chart:e,label:i,parsed:o.getParsed(s),raw:e.data.datasets[r].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:r,element:n}}function qy(e,t){const n=e.chart.ctx,{body:r,footer:s,title:o}=e,{boxWidth:i,boxHeight:a}=t,c=rt(t.bodyFont),l=rt(t.titleFont),u=rt(t.footerFont),d=o.length,f=s.length,h=r.length,p=xt(t.padding);let m=p.height,y=0,b=r.reduce((w,S)=>w+S.before.length+S.lines.length+S.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*l.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const w=t.displayColors?Math.max(a,c.lineHeight):c.lineHeight;m+=h*w+(b-h)*c.lineHeight+(b-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let x=0;const _=function(w){y=Math.max(y,n.measureText(w).width+x)};return n.save(),n.font=l.string,Ce(e.title,_),n.font=c.string,Ce(e.beforeBody.concat(e.afterBody),_),x=t.displayColors?i+2+t.boxPadding:0,Ce(r,w=>{Ce(w.before,_),Ce(w.lines,_),Ce(w.after,_)}),x=0,n.font=u.string,Ce(e.footer,_),n.restore(),y+=p.width,{width:y,height:m}}function x4(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function _4(e,t,n,r){const{x:s,width:o}=r,i=n.caretSize+n.caretPadding;if(e==="left"&&s+o+i>t.width||e==="right"&&s-o-i<0)return!0}function w4(e,t,n,r){const{x:s,width:o}=n,{width:i,chartArea:{left:a,right:c}}=e;let l="center";return r==="center"?l=s<=(a+c)/2?"left":"right":s<=o/2?l="left":s>=i-o/2&&(l="right"),_4(l,e,t,n)&&(l="center"),l}function Ky(e,t,n){const r=n.yAlign||t.yAlign||x4(e,n);return{xAlign:n.xAlign||t.xAlign||w4(e,t,n,r),yAlign:r}}function S4(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function E4(e,t,n){let{y:r,height:s}=e;return t==="top"?r+=n:t==="bottom"?r-=s+n:r-=s/2,r}function Zy(e,t,n,r){const{caretSize:s,caretPadding:o,cornerRadius:i}=e,{xAlign:a,yAlign:c}=n,l=s+o,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:h}=Zr(i);let p=S4(t,a);const m=E4(t,c,l);return c==="center"?a==="left"?p+=l:a==="right"&&(p-=l):a==="left"?p-=Math.max(u,f)+s:a==="right"&&(p+=Math.max(d,h)+s),{x:at(p,0,r.width-t.width),y:at(m,0,r.height-t.height)}}function _a(e,t,n){const r=xt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function Gy(e){return _n([],Fn(e))}function k4(e,t,n){return Rr(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Yy(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const $S={beforeTitle:In,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:In,beforeBody:In,beforeLabel:In,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return ye(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:In,afterBody:In,beforeFooter:In,footer:In,afterFooter:In};function Pt(e,t,n,r){const s=e[t].call(n,r);return typeof s>"u"?$S[t].call(n,r):s}class Xy extends Jn{static positioners=Io;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),s=r.enabled&&n.options.animation&&r.animations,o=new pS(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=k4(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,s=Pt(r,"beforeTitle",this,t),o=Pt(r,"title",this,t),i=Pt(r,"afterTitle",this,t);let a=[];return a=_n(a,Fn(s)),a=_n(a,Fn(o)),a=_n(a,Fn(i)),a}getBeforeBody(t,n){return Gy(Pt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,s=[];return Ce(t,o=>{const i={before:[],lines:[],after:[]},a=Yy(r,o);_n(i.before,Fn(Pt(a,"beforeLabel",this,o))),_n(i.lines,Pt(a,"label",this,o)),_n(i.after,Fn(Pt(a,"afterLabel",this,o))),s.push(i)}),s}getAfterBody(t,n){return Gy(Pt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,s=Pt(r,"beforeFooter",this,t),o=Pt(r,"footer",this,t),i=Pt(r,"afterFooter",this,t);let a=[];return a=_n(a,Fn(s)),a=_n(a,Fn(o)),a=_n(a,Fn(i)),a}_createItems(t){const n=this._active,r=this.chart.data,s=[],o=[],i=[];let a=[],c,l;for(c=0,l=n.length;c<l;++c)a.push(v4(this.chart,n[c]));return t.filter&&(a=a.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,r))),Ce(a,u=>{const d=Yy(t.callbacks,u);s.push(Pt(d,"labelColor",this,u)),o.push(Pt(d,"labelPointStyle",this,u)),i.push(Pt(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=i,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),s=this._active;let o,i=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const a=Io[r.position].call(this,s,this._eventPosition);i=this._createItems(r),this.title=this.getTitle(i,r),this.beforeBody=this.getBeforeBody(i,r),this.body=this.getBody(i,r),this.afterBody=this.getAfterBody(i,r),this.footer=this.getFooter(i,r);const c=this._size=qy(this,r),l=Object.assign({},a,c),u=Ky(this.chart,r,l),d=Zy(r,l,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:d.x,y:d.y,width:c.width,height:c.height,caretX:a.x,caretY:a.y}}this._tooltipItems=i,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,s){const o=this.getCaretPosition(t,r,s);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,r){const{xAlign:s,yAlign:o}=this,{caretSize:i,cornerRadius:a}=r,{topLeft:c,topRight:l,bottomLeft:u,bottomRight:d}=Zr(a),{x:f,y:h}=t,{width:p,height:m}=n;let y,b,x,_,w,S;return o==="center"?(w=h+m/2,s==="left"?(y=f,b=y-i,_=w+i,S=w-i):(y=f+p,b=y+i,_=w-i,S=w+i),x=y):(s==="left"?b=f+Math.max(c,u)+i:s==="right"?b=f+p-Math.max(l,d)-i:b=this.caretX,o==="top"?(_=h,w=_-i,y=b-i,x=b+i):(_=h+m,w=_+i,y=b+i,x=b-i),S=_),{x1:y,x2:b,x3:x,y1:_,y2:w,y3:S}}drawTitle(t,n,r){const s=this.title,o=s.length;let i,a,c;if(o){const l=Bs(r.rtl,this.x,this.width);for(t.x=_a(this,r.titleAlign,r),n.textAlign=l.textAlign(r.titleAlign),n.textBaseline="middle",i=rt(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=i.string,c=0;c<o;++c)n.fillText(s[c],l.x(t.x),t.y+i.lineHeight/2),t.y+=i.lineHeight+a,c+1===o&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,s,o){const i=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:c,boxWidth:l}=o,u=rt(o.bodyFont),d=_a(this,"left",o),f=s.x(d),h=c<u.lineHeight?(u.lineHeight-c)/2:0,p=n.y+h;if(o.usePointStyle){const m={radius:Math.min(l,c)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},y=s.leftForLtr(f,l)+l/2,b=p+c/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Ud(t,m,y,b),t.strokeStyle=i.borderColor,t.fillStyle=i.backgroundColor,Ud(t,m,y,b)}else{t.lineWidth=xe(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,t.strokeStyle=i.borderColor,t.setLineDash(i.borderDash||[]),t.lineDashOffset=i.borderDashOffset||0;const m=s.leftForLtr(f,l),y=s.leftForLtr(s.xPlus(f,1),l-2),b=Zr(i.borderRadius);Object.values(b).some(x=>x!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,di(t,{x:m,y:p,w:l,h:c,radius:b}),t.fill(),t.stroke(),t.fillStyle=i.backgroundColor,t.beginPath(),di(t,{x:y,y:p+1,w:l-2,h:c-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,p,l,c),t.strokeRect(m,p,l,c),t.fillStyle=i.backgroundColor,t.fillRect(y,p+1,l-2,c-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:s}=this,{bodySpacing:o,bodyAlign:i,displayColors:a,boxHeight:c,boxWidth:l,boxPadding:u}=r,d=rt(r.bodyFont);let f=d.lineHeight,h=0;const p=Bs(r.rtl,this.x,this.width),m=function(E){n.fillText(E,p.x(t.x+h),t.y+f/2),t.y+=f+o},y=p.textAlign(i);let b,x,_,w,S,C,k;for(n.textAlign=i,n.textBaseline="middle",n.font=d.string,t.x=_a(this,y,r),n.fillStyle=r.bodyColor,Ce(this.beforeBody,m),h=a&&y!=="right"?i==="center"?l/2+u:l+2+u:0,w=0,C=s.length;w<C;++w){for(b=s[w],x=this.labelTextColors[w],n.fillStyle=x,Ce(b.before,m),_=b.lines,a&&_.length&&(this._drawColorBox(n,t,w,p,r),f=Math.max(d.lineHeight,c)),S=0,k=_.length;S<k;++S)m(_[S]),f=d.lineHeight;Ce(b.after,m)}h=0,f=d.lineHeight,Ce(this.afterBody,m),t.y-=o}drawFooter(t,n,r){const s=this.footer,o=s.length;let i,a;if(o){const c=Bs(r.rtl,this.x,this.width);for(t.x=_a(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=c.textAlign(r.footerAlign),n.textBaseline="middle",i=rt(r.footerFont),n.fillStyle=r.footerColor,n.font=i.string,a=0;a<o;++a)n.fillText(s[a],c.x(t.x),t.y+i.lineHeight/2),t.y+=i.lineHeight+r.footerSpacing}}drawBackground(t,n,r,s){const{xAlign:o,yAlign:i}=this,{x:a,y:c}=t,{width:l,height:u}=r,{topLeft:d,topRight:f,bottomLeft:h,bottomRight:p}=Zr(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(a+d,c),i==="top"&&this.drawCaret(t,n,r,s),n.lineTo(a+l-f,c),n.quadraticCurveTo(a+l,c,a+l,c+f),i==="center"&&o==="right"&&this.drawCaret(t,n,r,s),n.lineTo(a+l,c+u-p),n.quadraticCurveTo(a+l,c+u,a+l-p,c+u),i==="bottom"&&this.drawCaret(t,n,r,s),n.lineTo(a+h,c+u),n.quadraticCurveTo(a,c+u,a,c+u-h),i==="center"&&o==="left"&&this.drawCaret(t,n,r,s),n.lineTo(a,c+d),n.quadraticCurveTo(a,c,a+d,c),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,s=r&&r.x,o=r&&r.y;if(s||o){const i=Io[t.position].call(this,this._active,this._eventPosition);if(!i)return;const a=this._size=qy(this,t),c=Object.assign({},i,this._size),l=Ky(n,t,c),u=Zy(t,c,l,n);(s._to!==u.x||o._to!==u.y)&&(this.xAlign=l.xAlign,this.yAlign=l.yAlign,this.width=a.width,this.height=a.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const i=xt(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(o,t,s,n),cS(t,n.textDirection),o.y+=i.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),lS(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,s=t.map(({datasetIndex:a,index:c})=>{const l=this.chart.getDatasetMeta(a);if(!l)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:l.data[c],index:c}}),o=!kc(r,s),i=this._positionChanged(s,n);(o||i)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],i=this._getActiveElements(t,o,n,r),a=this._positionChanged(i,t),c=n||!kc(i,o)||a;return c&&(this._active=i,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),c}_getActiveElements(t,n,r,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const i=this.chart.getElementsAtEventForMode(t,o.mode,o,r);return o.reverse&&i.reverse(),i}_positionChanged(t,n){const{caretX:r,caretY:s,options:o}=this,i=Io[o.position].call(this,t,n);return i!==!1&&(r!==i.x||s!==i.y)}}var VS={id:"tooltip",_element:Xy,positioners:Io,afterInit(e,t,n){n&&(e.tooltip=new Xy({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:$S},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},C4=Object.freeze({__proto__:null,Colors:VW,Decimation:HW,Filler:LS,Legend:zS,SubTitle:b4,Title:y4,Tooltip:VS});const R4=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function P4(e,t,n,r){const s=e.indexOf(t);if(s===-1)return R4(e,t,n,r);const o=e.lastIndexOf(t);return s!==o?n:s}const O4=(e,t)=>e===null?null:at(Math.round(e),0,t);function Jy(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class BS extends hs{static id="category";static defaults={ticks:{callback:Jy}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:s,label:o}of n)r[s]===o&&r.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(ye(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:P4(r,t,de(n,t),this._addedLabels),O4(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(s=this.getLabels().length-1)),this.min=r,this.max=s}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,s=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let i=t;i<=n;i++)s.push({value:i});return s}getLabelForValue(t){return Jy.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function T4(e,t){const n=[],{bounds:s,step:o,min:i,max:a,precision:c,count:l,maxTicks:u,maxDigits:d,includeBounds:f}=e,h=o||1,p=u-1,{min:m,max:y}=t,b=!ye(i),x=!ye(a),_=!ye(l),w=(y-m)/(d+1);let S=qg((y-m)/p/h)*h,C,k,E,P;if(S<1e-14&&!b&&!x)return[{value:m},{value:y}];P=Math.ceil(y/S)-Math.floor(m/S),P>p&&(S=qg(P*S/p/h)*h),ye(c)||(C=Math.pow(10,c),S=Math.ceil(S*C)/C),s==="ticks"?(k=Math.floor(m/S)*S,E=Math.ceil(y/S)*S):(k=m,E=y),b&&x&&o&&bB((a-i)/o,S/1e3)?(P=Math.round(Math.min((a-i)/S,u)),S=(a-i)/P,k=i,E=a):_?(k=b?i:k,E=x?a:E,P=l-1,S=(E-k)/P):(P=(E-k)/S,Bo(P,Math.round(P),S/1e3)?P=Math.round(P):P=Math.ceil(P));const O=Math.max(Kg(S),Kg(k));C=Math.pow(10,ye(c)?O:c),k=Math.round(k*C)/C,E=Math.round(E*C)/C;let N=0;for(b&&(f&&k!==i?(n.push({value:i}),k<i&&N++,Bo(Math.round((k+N*S)*C)/C,i,Qy(i,w,e))&&N++):k<i&&N++);N<P;++N){const A=Math.round((k+N*S)*C)/C;if(x&&A>a)break;n.push({value:A})}return x&&f&&E!==a?n.length&&Bo(n[n.length-1].value,a,Qy(a,w,e))?n[n.length-1].value=a:n.push({value:a}):(!x||E===a)&&n.push({value:E}),n}function Qy(e,t,{horizontal:n,minRotation:r}){const s=fn(r),o=(n?Math.sin(s):Math.cos(s))||.001,i=.75*t*(""+e).length;return Math.min(t/o,i)}class Ac extends hs{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return ye(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:s,max:o}=this;const i=c=>s=n?s:c,a=c=>o=r?o:c;if(t){const c=Rn(s),l=Rn(o);c<0&&l<0?a(0):c>0&&l>0&&i(0)}if(s===o){let c=o===0?1:Math.abs(o*.05);a(o+c),t||i(s-c)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,s;return r?(s=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const s={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,i=T4(s,o);return t.bounds==="ticks"&&H0(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const s=(r-n)/Math.max(t.length-1,1)/2;n-=s,r+=s}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return Oi(t,this.chart.options.locale,this.options.ticks.format)}}class US extends Ac{static id="linear";static defaults={ticks:{callback:kl.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=We(t)?t:0,this.max=We(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=fn(this.options.ticks.minRotation),s=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const hi=e=>Math.floor(ar(e)),Dr=(e,t)=>Math.pow(10,hi(e)+t);function eb(e){return e/Math.pow(10,hi(e))===1}function tb(e,t,n){const r=Math.pow(10,n),s=Math.floor(e/r);return Math.ceil(t/r)-s}function M4(e,t){const n=t-e;let r=hi(n);for(;tb(e,t,r)>10;)r++;for(;tb(e,t,r)<10;)r--;return Math.min(r,hi(e))}function A4(e,{min:t,max:n}){t=Ft(e.min,t);const r=[],s=hi(t);let o=M4(t,n),i=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),c=s>o?Math.pow(10,s):0,l=Math.round((t-c)*i)/i,u=Math.floor((t-c)/a/10)*a*10;let d=Math.floor((l-u)/Math.pow(10,o)),f=Ft(e.min,Math.round((c+u+d*Math.pow(10,o))*i)/i);for(;f<n;)r.push({value:f,major:eb(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,i=o>=0?1:i),f=Math.round((c+u+d*Math.pow(10,o))*i)/i;const h=Ft(e.max,f);return r.push({value:h,major:eb(h),significand:d}),r}class N4 extends hs{static id="logarithmic";static defaults={ticks:{callback:kl.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=Ac.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return We(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=We(t)?Math.max(0,t):null,this.max=We(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!We(this._userMin)&&(this.min=t===Dr(this.min,0)?Dr(this.min,-1):Dr(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,s=this.max;const o=a=>r=t?r:a,i=a=>s=n?s:a;r===s&&(r<=0?(o(1),i(10)):(o(Dr(r,-1)),i(Dr(s,1)))),r<=0&&o(Dr(s,-1)),s<=0&&i(Dr(r,1)),this.min=r,this.max=s}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=A4(n,this);return t.bounds==="ticks"&&H0(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":Oi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ar(t),this._valueRange=ar(this.max)-ar(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ar(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}function Gd(e){const t=e.ticks;if(t.display&&e.display){const n=xt(t.backdropPadding);return de(t.font&&t.font.size,$e.font.size)+n.height}return 0}function D4(e,t,n){return n=ze(n)?n:[n],{w:IB(e,t.string,n),h:n.length*t.lineHeight}}function nb(e,t,n,r,s){return e===r||e===s?{start:t-n/2,end:t+n/2}:e<r||e>s?{start:t-n,end:t}:{start:t,end:t+n}}function I4(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],s=[],o=e._pointLabels.length,i=e.options.pointLabels,a=i.centerPointLabels?we/o:0;for(let c=0;c<o;c++){const l=i.setContext(e.getPointLabelContext(c));s[c]=l.padding;const u=e.getPointPosition(c,e.drawingArea+s[c],a),d=rt(l.font),f=D4(e.ctx,d,e._pointLabels[c]);r[c]=f;const h=mt(e.getIndexAngle(c)+a),p=Math.round(Eh(h)),m=nb(p,u.x,f.w,0,180),y=nb(p,u.y,f.h,90,270);j4(n,t,h,m,y)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=z4(e,r,s)}function j4(e,t,n,r,s){const o=Math.abs(Math.sin(n)),i=Math.abs(Math.cos(n));let a=0,c=0;r.start<t.l?(a=(t.l-r.start)/o,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),s.start<t.t?(c=(t.t-s.start)/i,e.t=Math.min(e.t,t.t-c)):s.end>t.b&&(c=(s.end-t.b)/i,e.b=Math.max(e.b,t.b+c))}function L4(e,t,n){const r=e.drawingArea,{extra:s,additionalAngle:o,padding:i,size:a}=n,c=e.getPointPosition(t,r+s+i,o),l=Math.round(Eh(mt(c.angle+He))),u=B4(c.y,a.h,l),d=$4(l),f=V4(c.x,a.w,d);return{visible:!0,x:c.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function F4(e,t){if(!t)return!0;const{left:n,top:r,right:s,bottom:o}=e;return!(Wn({x:n,y:r},t)||Wn({x:n,y:o},t)||Wn({x:s,y:r},t)||Wn({x:s,y:o},t))}function z4(e,t,n){const r=[],s=e._pointLabels.length,o=e.options,{centerPointLabels:i,display:a}=o.pointLabels,c={extra:Gd(o)/2,additionalAngle:i?we/s:0};let l;for(let u=0;u<s;u++){c.padding=n[u],c.size=t[u];const d=L4(e,u,c);r.push(d),a==="auto"&&(d.visible=F4(d,l),d.visible&&(l=d))}return r}function $4(e){return e===0||e===180?"center":e<180?"left":"right"}function V4(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function B4(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function U4(e,t,n){const{left:r,top:s,right:o,bottom:i}=n,{backdropColor:a}=t;if(!ye(a)){const c=Zr(t.borderRadius),l=xt(t.backdropPadding);e.fillStyle=a;const u=r-l.left,d=s-l.top,f=o-r+l.width,h=i-s+l.height;Object.values(c).some(p=>p!==0)?(e.beginPath(),di(e,{x:u,y:d,w:f,h,radius:c}),e.fill()):e.fillRect(u,d,f,h)}}function W4(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let s=t-1;s>=0;s--){const o=e._pointLabelItems[s];if(!o.visible)continue;const i=r.setContext(e.getPointLabelContext(s));U4(n,i,o);const a=rt(i.font),{x:c,y:l,textAlign:u}=o;cs(n,e._pointLabels[s],c,l+a.lineHeight/2,a,{color:i.color,textAlign:u,textBaseline:"middle"})}}function WS(e,t,n,r){const{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,Ae);else{let o=e.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let i=1;i<r;i++)o=e.getPointPosition(i,t),s.lineTo(o.x,o.y)}}function H4(e,t,n,r,s){const o=e.ctx,i=t.circular,{color:a,lineWidth:c}=t;!i&&!r||!a||!c||n<0||(o.save(),o.strokeStyle=a,o.lineWidth=c,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),WS(e,n,i,r),o.closePath(),o.stroke(),o.restore())}function q4(e,t,n){return Rr(e,{label:n,index:t,type:"pointLabel"})}class K4 extends Ac{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:kl.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=xt(Gd(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=We(t)&&!isNaN(t)?t:0,this.max=We(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Gd(this.options))}generateTickLabels(t){Ac.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const s=Me(this.options.pointLabels.callback,[n,r],this);return s||s===0?s:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?I4(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,s))}getIndexAngle(t){const n=Ae/(this._pointLabels.length||1),r=this.options.startAngle||0;return mt(t*n+fn(r))}getDistanceFromCenterForValue(t){if(ye(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(ye(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return q4(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const s=this.getIndexAngle(t)-He+r;return{x:Math.cos(s)*n+this.xCenter,y:Math.sin(s)*n+this.yCenter,angle:s}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:s,bottom:o}=this._pointLabelItems[t];return{left:n,top:r,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),WS(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:s,border:o}=n,i=this._pointLabels.length;let a,c,l;if(n.pointLabels.display&&W4(this,i),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){c=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),h=s.setContext(f),p=o.setContext(f);H4(this,h,c,i,p)}}),r.display){for(t.save(),a=i-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,c=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),l=this.getPointPosition(a,c),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const s=this.getIndexAngle(0);let o,i;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,c)=>{if(c===0&&this.min>=0&&!n.reverse)return;const l=r.setContext(this.getContext(c)),u=rt(l.font);if(o=this.getDistanceFromCenterForValue(this.ticks[c].value),l.showLabelBackdrop){t.font=u.string,i=t.measureText(a.label).width,t.fillStyle=l.backdropColor;const d=xt(l.backdropPadding);t.fillRect(-i/2-d.left,-o-u.size/2-d.top,i+d.width,u.size+d.height)}cs(t,a.label,0,-o,u,{color:l.color,strokeColor:l.textStrokeColor,strokeWidth:l.textStrokeWidth})}),t.restore()}drawTitle(){}}const Ml={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Nt=Object.keys(Ml);function rb(e,t){return e-t}function sb(e,t){if(ye(t))return null;const n=e._adapter,{parser:r,round:s,isoWeekday:o}=e._parseOpts;let i=t;return typeof r=="function"&&(i=r(i)),We(i)||(i=typeof r=="string"?n.parse(i,r):n.parse(i)),i===null?null:(s&&(i=s==="week"&&(Ys(o)||o===!0)?n.startOf(i,"isoWeek",o):n.startOf(i,s)),+i)}function ob(e,t,n,r){const s=Nt.length;for(let o=Nt.indexOf(e);o<s-1;++o){const i=Ml[Nt[o]],a=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((n-t)/(a*i.size))<=r)return Nt[o]}return Nt[s-1]}function Z4(e,t,n,r,s){for(let o=Nt.length-1;o>=Nt.indexOf(n);o--){const i=Nt[o];if(Ml[i].common&&e._adapter.diff(s,r,i)>=t-1)return i}return Nt[n?Nt.indexOf(n):0]}function G4(e){for(let t=Nt.indexOf(e)+1,n=Nt.length;t<n;++t)if(Ml[Nt[t]].common)return Nt[t]}function ib(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:s}=kh(n,t),o=n[r]>=t?n[r]:n[s];e[o]=!0}}function Y4(e,t,n,r){const s=e._adapter,o=+s.startOf(t[0].value,r),i=t[t.length-1].value;let a,c;for(a=o;a<=i;a=+s.add(a,1,r))c=n[a],c>=0&&(t[c].major=!0);return t}function ab(e,t,n){const r=[],s={},o=t.length;let i,a;for(i=0;i<o;++i)a=t[i],s[a]=i,r.push({value:a,major:!1});return o===0||!n?r:Y4(e,r,s,n)}class Nc extends hs{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),s=this._adapter=new r5._date(t.adapters.date);s.init(n),Vo(r.displayFormats,s.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:sb(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:s,max:o,minDefined:i,maxDefined:a}=this.getUserBounds();function c(l){!i&&!isNaN(l.min)&&(s=Math.min(s,l.min)),!a&&!isNaN(l.max)&&(o=Math.max(o,l.max))}(!i||!a)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),s=We(s)&&!isNaN(s)?s:+n.startOf(Date.now(),r),o=We(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,s=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,i=this.max,a=wB(s,o,i);return this._unit=n.unit||(r.autoSkip?ob(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):Z4(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:G4(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),ab(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const i=t.length<3?.5:.25;n=at(n,0,i),r=at(r,0,i),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,s=this.options,o=s.time,i=o.unit||ob(o.minUnit,n,r,this._getLabelCapacity(n)),a=de(s.ticks.stepSize,1),c=i==="week"?o.isoWeekday:!1,l=Ys(c)||c===!0,u={};let d=n,f,h;if(l&&(d=+t.startOf(d,"isoWeek",c)),d=+t.startOf(d,l?"day":i),t.diff(r,n,i)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+i);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(f=d,h=0;f<r;f=+t.add(f,a,i),h++)ib(u,f,p);return(f===r||s.bounds==="ticks"||h===1)&&ib(u,f,p),Object.keys(u).sort(rb).map(m=>+m)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const s=this.options.time.displayFormats,o=this._unit,i=n||s[o];return this._adapter.format(t,i)}_tickFormatFunction(t,n,r,s){const o=this.options,i=o.ticks.callback;if(i)return Me(i,[t,n,r],this);const a=o.time.displayFormats,c=this._unit,l=this._majorUnit,u=c&&a[c],d=l&&a[l],f=r[n],h=l&&d&&f&&f.major;return this._adapter.format(t,s||(h?d:u))}generateTickLabels(t){let n,r,s;for(n=0,r=t.length;n<r;++n)s=t[n],s.label=this._tickFormatFunction(s.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,s=fn(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(s),i=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:r*o+a*i,h:r*i+a*o}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,s=r[n.unit]||r.millisecond,o=this._tickFormatFunction(t,0,ab(this,[t],this._majorUnit),s),i=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/i.w:this.height/i.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,r=s.length;n<r;++n)t=t.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const s=this.getLabels();for(n=0,r=s.length;n<r;++n)t.push(sb(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Z0(t.sort(rb))}}function wa(e,t,n){let r=0,s=e.length-1,o,i,a,c;n?(t>=e[r].pos&&t<=e[s].pos&&({lo:r,hi:s}=Un(e,"pos",t)),{pos:o,time:a}=e[r],{pos:i,time:c}=e[s]):(t>=e[r].time&&t<=e[s].time&&({lo:r,hi:s}=Un(e,"time",t)),{time:o,pos:a}=e[r],{time:i,pos:c}=e[s]);const l=i-o;return l?a+(c-a)*(t-o)/l:a}class X4 extends Nc{static id="timeseries";static defaults=Nc.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=wa(n,this.min),this._tableRange=wa(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,s=[],o=[];let i,a,c,l,u;for(i=0,a=t.length;i<a;++i)l=t[i],l>=n&&l<=r&&s.push(l);if(s.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(i=0,a=s.length;i<a;++i)u=s[i+1],c=s[i-1],l=s[i],Math.round((u+c)/2)!==l&&o.push({time:l,pos:i/(a-1)});return o}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(wa(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return wa(this._table,r*this._tableRange+this._minPos,!0)}}var J4=Object.freeze({__proto__:null,CategoryScale:BS,LinearScale:US,LogarithmicScale:N4,RadialLinearScale:K4,TimeScale:Nc,TimeSeriesScale:X4});const Q4=[n5,DW,C4,J4],HS="label";function cb(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function eH(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function qS(e,t){e.labels=t}function KS(e,t,n=HS){const r=[];e.datasets=t.map(s=>{const o=e.datasets.find(i=>i[n]===s[n]);return!o||!s.data||r.includes(o)?{...s}:(r.push(o),Object.assign(o,s),o)})}function tH(e,t=HS){const n={labels:[],datasets:[]};return qS(n,e.labels),KS(n,e.datasets,t),n}function nH(e,t){const{height:n=150,width:r=300,redraw:s=!1,datasetIdKey:o,type:i,data:a,options:c,plugins:l=[],fallbackContent:u,updateMode:d,...f}=e,h=T.useRef(null),p=T.useRef(null),m=()=>{h.current&&(p.current=new Ti(h.current,{type:i,data:tH(a,o),options:c&&{...c},plugins:l}),cb(t,p.current))},y=()=>{cb(t,null),p.current&&(p.current.destroy(),p.current=null)};return T.useEffect(()=>{!s&&p.current&&c&&eH(p.current,c)},[s,c]),T.useEffect(()=>{!s&&p.current&&qS(p.current.config.data,a.labels)},[s,a.labels]),T.useEffect(()=>{!s&&p.current&&a.datasets&&KS(p.current.config.data,a.datasets,o)},[s,a.datasets]),T.useEffect(()=>{p.current&&(s?(y(),setTimeout(m)):p.current.update(d))},[s,c,a.labels,a.datasets,d]),T.useEffect(()=>{p.current&&(y(),setTimeout(m))},[i]),T.useEffect(()=>(m(),()=>y()),[]),g.jsx("canvas",{ref:h,role:"img",height:n,width:r,...f,children:u})}const rH=T.forwardRef(nH);function sH(e,t){return Ti.register(t),T.forwardRef((n,r)=>g.jsx(rH,{...n,ref:r,type:e}))}const oH=sH("line",yS);Ti.register(...Q4);Ti.register(BS,US,TS,Mi,LS,VS,zS,Nc);const iH={id:"downBandPlugin",beforeDraw:e=>{const{ctx:t,chartArea:n,data:r}=e;if(!n)return;r?.datasets?.[0]?.meta?.raw;const s=r?.datasets?.[0]?.status??[];if(!Array.isArray(s)||s.length===0)return;t.save(),t.fillStyle="rgba(239, 68, 68, 0.14)";const o=e.scales.x;for(let i=0;i<s.length;i++){if(s[i]!=="down")continue;const a=o.getPixelForValue(i-.5),c=o.getPixelForValue(i+.5);t.fillRect(a,n.top,c-a,n.bottom-n.top)}t.restore()}};function aH({points:e}){const t=e.map(i=>new Date(i.t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})),n=e.map(i=>i.status==="down"?null:i.ping),r=e.map(i=>i.status),s={labels:t,datasets:[{label:"Ping (ms)",data:n,tension:.25,pointRadius:0,fill:!0,status:r}]},o={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{label:i=>{const a=i.dataIndex;if(r[a]==="down")return"Down";const l=i.parsed.y;return l!=null?`${l} ms`:"—"}}}},scales:{x:{ticks:{maxTicksLimit:8}},y:{beginAtZero:!0}},animation:!1};return g.jsxs("div",{className:"h-64 w-full rounded-2xl border border-neutral-200 bg-white p-3 dark:border-neutral-800 dark:bg-neutral-950",children:[g.jsx("div",{className:"mb-2 text-sm font-semibold",children:"Response Time"}),g.jsx("div",{className:"h-[220px]",children:g.jsx(oH,{data:s,options:o,plugins:[iH]})})]})}const cH=Rx("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{success:"bg-green-500 text-white",default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function lH({className:e,variant:t,asChild:n=!1,...r}){const s=n?Lf:"span";return g.jsx(s,{"data-slot":"badge",className:Se(cH({variant:t}),e),...r})}var Al="Checkbox",[uH]=wr(Al),[dH,Lh]=uH(Al);function fH(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:o,form:i,name:a,onCheckedChange:c,required:l,value:u="on",internal_do_not_use_render:d}=e,[f,h]=Zs({prop:n,defaultProp:s??!1,onChange:c,caller:Al}),[p,m]=v.useState(null),[y,b]=v.useState(null),x=v.useRef(!1),_=p?!!i||!!p.closest("form"):!0,w={checked:f,disabled:o,setChecked:h,control:p,setControl:m,name:a,form:i,value:u,hasConsumerStoppedPropagationRef:x,required:l,defaultChecked:pr(s)?!1:s,isFormControl:_,bubbleInput:y,setBubbleInput:b};return g.jsx(dH,{scope:t,...w,children:hH(d)?d(w):r})}var ZS="CheckboxTrigger",GS=v.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:o,value:i,disabled:a,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:h,bubbleInput:p}=Lh(ZS,e),m=Pe(s,u),y=v.useRef(c);return v.useEffect(()=>{const b=o?.form;if(b){const x=()=>d(y.current);return b.addEventListener("reset",x),()=>b.removeEventListener("reset",x)}},[o,d]),g.jsx(be.button,{type:"button",role:"checkbox","aria-checked":pr(c)?"mixed":c,"aria-required":l,"data-state":tE(c),"data-disabled":a?"":void 0,disabled:a,value:i,...r,ref:m,onKeyDown:re(t,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:re(n,b=>{d(x=>pr(x)?!0:!x),p&&h&&(f.current=b.isPropagationStopped(),f.current||b.stopPropagation())})})});GS.displayName=ZS;var YS=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:o,required:i,disabled:a,value:c,onCheckedChange:l,form:u,...d}=e;return g.jsx(fH,{__scopeCheckbox:n,checked:s,defaultChecked:o,disabled:a,required:i,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:f})=>g.jsxs(g.Fragment,{children:[g.jsx(GS,{...d,ref:t,__scopeCheckbox:n}),f&&g.jsx(eE,{__scopeCheckbox:n})]})})});YS.displayName=Al;var XS="CheckboxIndicator",JS=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,o=Lh(XS,n);return g.jsx(Xn,{present:r||pr(o.checked)||o.checked===!0,children:g.jsx(be.span,{"data-state":tE(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});JS.displayName=XS;var QS="CheckboxBubbleInput",eE=v.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:o,defaultChecked:i,required:a,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:h}=Lh(QS,e),p=Pe(n,h),m=kw(o),y=Wx(r);v.useEffect(()=>{const x=f;if(!x)return;const _=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(_,"checked").set,C=!s.current;if(m!==o&&S){const k=new Event("click",{bubbles:C});x.indeterminate=pr(o),S.call(x,pr(o)?!1:o),x.dispatchEvent(k)}},[f,m,o,s]);const b=v.useRef(pr(o)?!1:o);return g.jsx(be.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??b.current,required:a,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:p,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});eE.displayName=QS;function hH(e){return typeof e=="function"}function pr(e){return e==="indeterminate"}function tE(e){return pr(e)?"indeterminate":e?"checked":"unchecked"}function pH({className:e,...t}){return g.jsx(YS,{"data-slot":"checkbox",className:Se("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:g.jsx(JS,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:g.jsx(bx,{className:"size-3.5"})})})}function mH(){const{id:e}=pi({strict:!1}),t=ls(),n=Hv(),{current:r,currentResults:s,loading:o}=qv(O=>O.monitors),[i,a]=v.useState(!1),[c,l]=v.useState(!1);v.useEffect(()=>{if(!e)return;n(ks(e)),n(Aa(e));const O=setInterval(()=>{n(Aa(e)),n(ks(e))},3e4);return()=>clearInterval(O)},[e,n]);const[u,d]=v.useState(null);if(v.useEffect(()=>{if(!e)return;let O=null;return O=$a(td.apiBase,{path:td.wsPath,transports:["websocket"]}),O.on("monitor:update",N=>{N.monitorId===e&&(d(N),n(Aa(e)),n(ks(e)))}),()=>{O?.disconnect()}},[e,n]),!r)return g.jsxs("div",{className:"flex flex-col items-center justify-center p-12 text-muted-foreground",children:[g.jsx("div",{children:o?"Loading...":"Monitor not found."}),g.jsx(gt,{variant:"link",onClick:()=>t({to:"/"}),children:"Back to Monitors"})]});const f=(s??[]).slice().reverse(),h=f.slice(-40).map(O=>O.status),p=u??s?.[0]??null,m=p?.status??"unknown",y=m==="up"?"text-emerald-500":m==="down"?"text-red-500":"text-muted-foreground",b=m==="up"?"bg-emerald-500":m==="down"?"bg-red-500":"bg-neutral-400",x=f.map(O=>({t:new Date(O.checkedAt).getTime(),ping:O.pingMs??null,status:O.status??"unknown"})),_=f.filter(O=>O.status==="up"||O.status==="down"),w=_.length?_.filter(O=>O.status==="up").length/_.length*100:0,S=(()=>{const O=f.map(N=>N.pingMs).filter(N=>typeof N=="number");return O.length?Math.round(O.reduce((N,A)=>N+A,0)/O.length):null})();async function C(){if(r)try{await n(dc({id:e,paused:!r.isPaused})).unwrap(),Ee.success(r.isPaused?"Resumed":"Paused")}catch(O){Ee.error(O??"Failed")}}async function k(){try{const N=(await Te.post(`/monitors/${e}/clone`)).data.monitor.id;Ee.success("Cloned (paused)"),n(Na()),t({to:"/monitors/$id",params:{id:N}})}catch(O){Ee.error(O?.response?.data?.detail??"Clone failed")}}async function E(){try{await n(Nf(e)).unwrap(),Ee.success("Deleted"),t({to:"/"})}catch(O){Ee.error(O??"Delete failed")}}const P=async O=>{try{await n(Df({id:r.id,data:O})).unwrap(),Ee.success("Monitor updated"),n(ks(e))}catch(N){throw Ee.error(N||"Failed to update monitor"),N}};return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(gt,{variant:"ghost",size:"icon",className:"-ml-2 h-8 w-8 text-muted-foreground",onClick:()=>t({to:"/"}),children:g.jsx(yx,{className:"h-4 w-4"})}),g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx("div",{className:Se("h-3 w-3 rounded-full",b)}),g.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:r.name}),r.isPaused&&g.jsx(lH,{variant:"secondary",children:"Paused"})]})]}),g.jsxs("div",{className:"text-sm text-muted-foreground ml-10",children:[r.type.toUpperCase()," • Interval: ",r.intervalSeconds,"s • ",r.url||r.host||"No target"]}),g.jsx("div",{className:"ml-10 pt-1",children:g.jsxs("div",{className:"flex gap-[2px] items-end h-6",children:[h.map((O,N)=>g.jsx("div",{className:Se("w-1.5 rounded-sm opacity-90 transition-all hover:scale-110 hover:opacity-100",O==="up"?"bg-emerald-500 h-4":O==="down"?"bg-red-500 h-4":"bg-neutral-300 dark:bg-neutral-800 h-4"),title:O},N)),h.length===0&&g.jsx("div",{className:"text-xs text-muted-foreground",children:"No data yet"})]})})]}),g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g.jsxs(gt,{variant:"outline",size:"sm",onClick:C,children:[r.isPaused?g.jsx(Sx,{className:"mr-2 h-4 w-4"}):g.jsx(_x,{className:"mr-2 h-4 w-4"}),r.isPaused?"Resume":"Pause"]}),g.jsxs(gt,{variant:"outline",size:"sm",onClick:()=>l(!0),children:[g.jsx(wx,{className:"mr-2 h-4 w-4"})," Edit"]}),g.jsxs(gt,{variant:"outline",size:"sm",onClick:k,children:[g.jsx(xx,{className:"mr-2 h-4 w-4"})," Clone"]}),g.jsxs(gt,{variant:"destructive",size:"sm",onClick:()=>a(!0),children:[g.jsx(jf,{className:"mr-2 h-4 w-4"})," Delete"]})]})]}),g.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[g.jsxs(Rs,{children:[g.jsx(Ps,{className:"pb-2",children:g.jsx(Os,{className:"text-sm font-medium text-muted-foreground",children:"Status"})}),g.jsxs(Ts,{children:[g.jsx("div",{className:`text-2xl font-bold ${y}`,children:m.toUpperCase()}),g.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:p?.message??"—"})]})]}),g.jsxs(Rs,{children:[g.jsx(Ps,{className:"pb-2",children:g.jsx(Os,{className:"text-sm font-medium text-muted-foreground",children:"Uptime (24h)"})}),g.jsxs(Ts,{children:[g.jsxs("div",{className:"text-2xl font-bold",children:[w.toFixed(1),"%"]}),g.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Last ",s.length," checks"]})]})]}),g.jsxs(Rs,{children:[g.jsx(Ps,{className:"pb-2",children:g.jsx(Os,{className:"text-sm font-medium text-muted-foreground",children:"Avg Response"})}),g.jsxs(Ts,{children:[g.jsx("div",{className:"text-2xl font-bold",children:S!=null?`${S} ms`:"—"}),g.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Latest: ",p?.pingMs!=null?`${p.pingMs} ms`:"—"]})]})]})]}),g.jsxs(Rs,{children:[g.jsx(Ps,{children:g.jsx(Os,{children:"Response Time History"})}),g.jsx(Ts,{children:g.jsx(aH,{points:x.slice(-120)})})]}),g.jsx(gH,{monitorId:e}),g.jsx(k0,{open:i,onOpenChange:a,monitor:r,onConfirm:E}),g.jsx(Nd,{open:c,onOpenChange:l,monitor:r,onSubmit:P})]})}function gH({monitorId:e}){const{data:t}=Go({queryKey:["notifications"],queryFn:async()=>(await Te.get("/notifications")).data.notifications}),{data:n,refetch:r}=Go({queryKey:["monitor-notifications",e],queryFn:async()=>(await Te.get(`/notifications/monitor/${e}`)).data.links}),s=new Set((n??[]).map(i=>i.notificationId));async function o(i){await Te.post(`/notifications/monitor/${e}`,{notificationIds:i}),Ee.success("Notifications updated"),await r()}return g.jsxs(Rs,{children:[g.jsxs(Ps,{children:[g.jsx(Os,{children:"Notifications"}),g.jsx(C0,{children:"Select which notification channels to alert when this monitor goes down."})]}),g.jsx(Ts,{children:!t||t.length===0?g.jsx("div",{className:"text-sm text-muted-foreground",children:"No notifications configured. Go to Settings → Notifications to add channels."}):g.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:t.map(i=>g.jsxs("div",{className:"flex items-start space-x-2 rounded-md border p-3",children:[g.jsx(pH,{id:i.id,checked:s.has(i.id),onCheckedChange:a=>{const c=new Set(s);a?c.add(i.id):c.delete(i.id),o(Array.from(c))}}),g.jsxs("div",{className:"grid gap-1.5 leading-none",children:[g.jsx(e0,{htmlFor:i.id,className:"font-medium cursor-pointer",children:i.name}),g.jsx("p",{className:"text-xs text-muted-foreground truncate max-w-[200px]",title:i.webhookUrl,children:i.webhookUrl})]})]},i.id))})})]})}function yH(){const e=Go({queryKey:["statusPages"],queryFn:async()=>(await Te.get("/status-pages")).data.statusPages});Go({queryKey:["monitors"],queryFn:async()=>(await Te.get("/monitors")).data.monitors});const[t,n]=v.useState(!1),[r,s]=v.useState("My Status Page"),[o,i]=v.useState("my-status");async function a(){n(!0);try{await Te.post("/status-pages",{name:r,slug:o,domains:[]}),Ee.success("Created"),e.refetch()}catch(c){Ee.error(c?.response?.data?.detail??"Create failed")}finally{n(!1)}}return g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-2xl font-semibold",children:"Status Pages"}),g.jsx("div",{className:"text-sm text-neutral-600",children:"This scaffold includes JSON endpoints for a public status page."})]}),g.jsxs(Yo,{children:[g.jsx(Xo,{className:"font-semibold",children:"Create"}),g.jsxs(Jo,{className:"grid gap-3 sm:grid-cols-3",children:[g.jsxs("div",{children:[g.jsx("label",{className:"text-sm",children:"Name"}),g.jsx("input",{className:"mt-1 w-full rounded-xl border px-3 py-2",value:r,onChange:c=>s(c.target.value)})]}),g.jsxs("div",{children:[g.jsx("label",{className:"text-sm",children:"Slug"}),g.jsx("input",{className:"mt-1 w-full rounded-xl border px-3 py-2",value:o,onChange:c=>i(c.target.value)})]}),g.jsx("div",{className:"flex items-end",children:g.jsx("button",{disabled:t,className:"w-full rounded-xl bg-neutral-900 px-3 py-2 text-white hover:bg-neutral-800 disabled:opacity-60",onClick:a,children:t?"Creating...":"Create"})})]})]}),g.jsx("div",{className:"grid gap-3",children:(e.data??[]).map(c=>g.jsxs(Yo,{children:[g.jsxs(Xo,{className:"flex items-center justify-between",children:[g.jsxs("div",{children:[g.jsx("div",{className:"font-semibold",children:c.name}),g.jsxs("div",{className:"text-xs text-neutral-600",children:["slug: ",c.slug]})]}),g.jsx("a",{className:"rounded-xl border px-3 py-1 text-sm hover:bg-neutral-50",href:`/status-pages/public/${c.slug}`,target:"_blank",rel:"noreferrer",children:"Public JSON"})]}),g.jsxs(Jo,{className:"text-sm text-neutral-700",children:["Mapping UI is intentionally minimal in this scaffold; integrate a proper editor when needed.",g.jsx("div",{className:"mt-2 text-xs text-neutral-500",children:"Tip: map status pages to domains using Host / X-Forwarded-Host header like Uptime Kuma does."})]})]},c.id))})]})}function bH(){const{data:e,refetch:t}=Go({queryKey:["notifications"],queryFn:async()=>(await Te.get("/notifications")).data.notifications}),[n,r]=v.useState(""),[s,o]=v.useState("");async function i(){if(!n.trim()||!s.trim()){Ee.error("Name and webhook URL required");return}try{await Te.post("/notifications",{name:n,webhookUrl:s}),r(""),o(""),Ee.success("Notification created"),await t()}catch(c){Ee.error(c?.response?.data?.detail??"Failed")}}async function a(c){if(confirm("Delete this notification?"))try{await Te.delete(`/notifications/${c}`),Ee.success("Deleted"),await t()}catch(l){Ee.error(l?.response?.data?.detail??"Delete failed")}}return g.jsxs("div",{className:"mx-auto max-w-3xl space-y-4",children:[g.jsxs(Yo,{children:[g.jsxs(Xo,{children:[g.jsx("div",{className:"text-lg font-semibold",children:"Notifications"}),g.jsx("div",{className:"text-sm text-neutral-600 dark:text-neutral-400",children:"Webhook notifications on monitor status changes."})]}),g.jsxs(Jo,{children:[g.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[g.jsxs("div",{children:[g.jsx("label",{className:"text-sm",children:"Name"}),g.jsx("input",{value:n,onChange:c=>r(c.target.value),className:"mt-1 w-full rounded-xl border px-3 py-2 dark:border-neutral-800 dark:bg-neutral-950"})]}),g.jsxs("div",{className:"md:col-span-2",children:[g.jsx("label",{className:"text-sm",children:"Webhook URL"}),g.jsx("input",{value:s,onChange:c=>o(c.target.value),placeholder:"https://...",className:"mt-1 w-full rounded-xl border px-3 py-2 dark:border-neutral-800 dark:bg-neutral-950"})]})]}),g.jsx("div",{className:"mt-3",children:g.jsx("button",{onClick:i,className:"rounded-xl bg-neutral-900 px-4 py-2 text-white hover:bg-neutral-800 dark:bg-neutral-100 dark:text-neutral-900 dark:hover:bg-neutral-200",children:"Add"})})]})]}),g.jsxs(Yo,{children:[g.jsx(Xo,{children:g.jsx("div",{className:"text-sm font-semibold",children:"Configured Notifications"})}),g.jsx(Jo,{children:(e??[]).length===0?g.jsx("div",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"No notifications yet."}):g.jsx("div",{className:"space-y-2",children:(e??[]).map(c=>g.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-xl border p-3 dark:border-neutral-800",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsx("div",{className:"font-semibold",children:c.name}),g.jsx("div",{className:"truncate text-sm text-neutral-500 dark:text-neutral-400",children:c.webhookUrl})]}),g.jsx("button",{className:"rounded-xl border px-3 py-2 text-red-600 hover:bg-neutral-50 dark:border-neutral-800 dark:hover:bg-neutral-900",onClick:()=>a(c.id),children:"Delete"})]},c.id))})})]})]})}function vH(){return Wc(),vv(),g.jsxs("div",{className:"min-h-screen bg-neutral-50 text-neutral-900 dark:bg-neutral-950 dark:text-neutral-100",children:[g.jsx("main",{className:"min-h-screen",children:g.jsx(of,{})}),g.jsx(ER,{richColors:!0})]})}const Sa=Fk({component:vH}),xH=()=>{const{token:e}=Wc.getState();if(!e)throw yb({to:"/login"})};function Nl(e=!0){const t=jn({getParentRoute:()=>Sa,id:"workspace",beforeLoad:e?xH:void 0,component:yT}),n=t.addChildren([jn({getParentRoute:()=>t,path:"/",component:H$}),jn({getParentRoute:()=>t,path:"/monitors/new",component:Ng}),jn({getParentRoute:()=>t,path:"/monitors/$id",component:mH}),jn({getParentRoute:()=>t,path:"/monitors/$id/edit",component:Ng}),jn({getParentRoute:()=>t,path:"/status-pages",component:yH}),jn({getParentRoute:()=>t,path:"/settings/notifications",component:bH})]);if(e){const r=jn({getParentRoute:()=>Sa,path:"/login",component:gT});return Sa.addChildren([n,r])}else return Sa.addChildren([n])}af({routeTree:Nl(!0)});const nE=sM({reducer:{monitors:CM}}),_H=new Vb;function wH({apiBase:e,token:t,basePath:n}){T.useEffect(()=>{iO(e,t)},[e,t]);const r=T.useMemo(()=>af({routeTree:Nl(!1),basepath:n||"/"}),[n]);return g.jsx(Hb,{store:nE,children:g.jsx(Ub,{client:_H,children:g.jsx(Nb,{router:r})})})}const SH=new Vb;function EH({apiBase:e}){T.useEffect(()=>{e&&(Te.defaults.baseURL=e),aO()},[e]);const t=T.useMemo(()=>af({routeTree:Nl(!1)}),[]);return g.jsx(Hb,{store:nE,children:g.jsx(Ub,{client:SH,children:g.jsx(Nb,{router:t})})})}const kH=[{title:"Monitors",url:"/monitors",icon:"Activity"},{title:"Status Pages",url:"/status-pages",icon:"Globe"},{title:"Notifications",url:"/settings/notifications",icon:"Bell"}];exports.PulsePage=wH;exports.PulseWatch=EH;exports.api=Te;exports.createRouteTree=Nl;exports.pulseNavItems=kH;
|
|
103
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},ZM="DialogDescriptionWarning",KM=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ky(ZM).contentName}}.`;return y.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},qM=My,GM=Ly,YM=Fy,JM=$y,QM=Vy,XM=By,eD=Hy;function qy({...e}){return p.jsx(qM,{"data-slot":"dialog",...e})}function tD({...e}){return p.jsx(GM,{"data-slot":"dialog-portal",...e})}function nD({className:e,...t}){return p.jsx(YM,{"data-slot":"dialog-overlay",className:Ee("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function Gy({className:e,children:t,showCloseButton:n=!0,...r}){return p.jsxs(tD,{"data-slot":"dialog-portal",children:[p.jsx(nD,{}),p.jsxs(JM,{"data-slot":"dialog-content",className:Ee("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,n&&p.jsxs(eD,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[p.jsx(hC,{}),p.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Yy({className:e,...t}){return p.jsx("div",{"data-slot":"dialog-header",className:Ee("flex flex-col gap-2 text-center sm:text-start",e),...t})}function Jy({className:e,...t}){return p.jsx("div",{"data-slot":"dialog-footer",className:Ee("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function Qy({className:e,...t}){return p.jsx(QM,{"data-slot":"dialog-title",className:Ee("text-lg leading-none font-semibold",e),...t})}function Xy({className:e,...t}){return p.jsx(XM,{"data-slot":"dialog-description",className:Ee("text-muted-foreground text-sm",e),...t})}const rD=dI({name:fn().min(1,"Name is required"),type:ey(["http","tcp","keyword","json_query","websocket","ping","dns","push","steam","docker"]),intervalSeconds:Ma().min(1,"Interval must be at least 1s"),timeoutMs:Ma().min(100,"Timeout must be at least 100ms"),url:fn().optional(),host:fn().optional(),port:Ma().optional(),method:fn().optional(),keyword:fn().optional(),jsonQuery:fn().optional(),expectedValue:fn().optional(),dnsRecordType:fn().optional()});function Zf({open:e,onOpenChange:t,monitor:n,onSubmit:r}){const o=!!n,[s,i]=y.useState(!1),a=mp({resolver:v1(rD),defaultValues:{name:"",type:"http",intervalSeconds:20,timeoutMs:8e3,method:"GET",url:"",host:"",keyword:"",jsonQuery:"",expectedValue:""}});y.useEffect(()=>{e&&(n?a.reset({name:n.name,type:n.type,intervalSeconds:n.intervalSeconds,timeoutMs:n.timeoutMs,url:n.url??"",host:n.host??"",port:n.port,method:n.method??"GET",keyword:n.keyword??"",jsonQuery:n.jsonQuery??"",expectedValue:n.expectedValue??"",dnsRecordType:n.dnsRecordType??""}):a.reset({name:"",type:"http",intervalSeconds:20,timeoutMs:8e3,method:"GET",url:"",host:"",keyword:"",jsonQuery:"",expectedValue:""}))},[e,n,a]);const c=a.watch("type"),l=async d=>{i(!0);try{await r(d),t(!1)}catch(u){console.error(u)}finally{i(!1)}};return p.jsx(qy,{open:e,onOpenChange:t,children:p.jsxs(Gy,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[p.jsxs(Yy,{children:[p.jsx(Qy,{children:o?"Edit Monitor":"New Monitor"}),p.jsx(Xy,{children:o?"Update monitor configuration.":"Configure parameters for a new uptime monitor."})]}),p.jsx(TM,{...a,children:p.jsxs("form",{onSubmit:a.handleSubmit(l),className:"space-y-4",children:[p.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[p.jsx(vt,{control:a.control,name:"name",render:({field:d})=>p.jsxs(bt,{children:[p.jsx(wt,{children:"Name"}),p.jsx(xt,{children:p.jsx(Ht,{placeholder:"My Website",...d})}),p.jsx(_t,{})]})}),p.jsx(vt,{control:a.control,name:"type",render:({field:d})=>p.jsxs(bt,{children:[p.jsx(wt,{children:"Type"}),p.jsxs(Da,{onValueChange:d.onChange,defaultValue:d.value,value:d.value,children:[p.jsx(xt,{children:p.jsx(La,{children:p.jsx(ja,{placeholder:"Select type"})})}),p.jsx(Fa,{children:["http","tcp","keyword","json_query","websocket","ping","dns","push","steam","docker"].map(u=>p.jsx($a,{value:u,children:u.toUpperCase()},u))})]}),p.jsx(_t,{})]})}),p.jsx(vt,{control:a.control,name:"intervalSeconds",render:({field:d})=>p.jsxs(bt,{children:[p.jsx(wt,{children:"Interval (s)"}),p.jsx(xt,{children:p.jsx(Ht,{type:"number",...d})}),p.jsx(_t,{})]})}),p.jsx(vt,{control:a.control,name:"timeoutMs",render:({field:d})=>p.jsxs(bt,{children:[p.jsx(wt,{children:"Timeout (ms)"}),p.jsx(xt,{children:p.jsx(Ht,{type:"number",...d})}),p.jsx(_t,{})]})})]}),(c==="http"||c==="keyword"||c==="json_query"||c==="websocket")&&p.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[p.jsx(vt,{control:a.control,name:"url",render:({field:d})=>p.jsxs(bt,{className:"sm:col-span-2",children:[p.jsx(wt,{children:"URL"}),p.jsx(xt,{children:p.jsx(Ht,{placeholder:"https://example.com",...d})}),p.jsx(_t,{})]})}),c!=="websocket"&&p.jsx(vt,{control:a.control,name:"method",render:({field:d})=>p.jsxs(bt,{children:[p.jsx(wt,{children:"Method"}),p.jsxs(Da,{onValueChange:d.onChange,defaultValue:d.value,value:d.value,children:[p.jsx(xt,{children:p.jsx(La,{children:p.jsx(ja,{placeholder:"Select method"})})}),p.jsx(Fa,{children:["GET","POST","PUT","DELETE"].map(u=>p.jsx($a,{value:u,children:u},u))})]}),p.jsx(_t,{})]})})]}),(c==="tcp"||c==="ping"||c==="dns"||c==="steam")&&p.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[p.jsx(vt,{control:a.control,name:"host",render:({field:d})=>p.jsxs(bt,{children:[p.jsx(wt,{children:"Host"}),p.jsx(xt,{children:p.jsx(Ht,{placeholder:"example.com",...d})}),p.jsx(_t,{})]})}),(c==="tcp"||c==="steam")&&p.jsx(vt,{control:a.control,name:"port",render:({field:d})=>p.jsxs(bt,{children:[p.jsx(wt,{children:"Port"}),p.jsx(xt,{children:p.jsx(Ht,{type:"number",...d})}),p.jsx(_t,{})]})}),c==="dns"&&p.jsx(vt,{control:a.control,name:"dnsRecordType",render:({field:d})=>p.jsxs(bt,{children:[p.jsx(wt,{children:"Record Type"}),p.jsxs(Da,{onValueChange:d.onChange,defaultValue:d.value,value:d.value,children:[p.jsx(xt,{children:p.jsx(La,{children:p.jsx(ja,{placeholder:"Select Record Type"})})}),p.jsx(Fa,{children:["A","AAAA","CNAME","TXT","MX","NS"].map(u=>p.jsx($a,{value:u,children:u},u))})]}),p.jsx(_t,{})]})})]}),c==="keyword"&&p.jsx(vt,{control:a.control,name:"keyword",render:({field:d})=>p.jsxs(bt,{children:[p.jsx(wt,{children:"Keyword"}),p.jsx(xt,{children:p.jsx(Ht,{placeholder:"Search string...",...d})}),p.jsx(_t,{})]})}),c==="json_query"&&p.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[p.jsx(vt,{control:a.control,name:"jsonQuery",render:({field:d})=>p.jsxs(bt,{children:[p.jsx(wt,{children:"JSON Query (jq)"}),p.jsx(xt,{children:p.jsx(Ht,{placeholder:"$.data.status",...d})}),p.jsx(_t,{})]})}),p.jsx(vt,{control:a.control,name:"expectedValue",render:({field:d})=>p.jsxs(bt,{children:[p.jsx(wt,{children:"Expected Value"}),p.jsx(xt,{children:p.jsx(Ht,{placeholder:"healthy",...d})}),p.jsx(_t,{})]})})]}),c==="push"&&p.jsx("div",{className:"rounded-lg border bg-muted p-4 text-sm text-muted-foreground",children:"Push monitors generate a token on create. You will see the Push URL in the monitor details after saving."}),p.jsxs(Jy,{children:[p.jsx(qn,{type:"button",variant:"outline",onClick:()=>t(!1),disabled:s,children:"Cancel"}),p.jsxs(qn,{type:"submit",disabled:s,children:[s&&p.jsx(vl,{className:"mr-2 h-4 w-4 animate-spin"}),o?"Update":"Create"]})]})]})})]})})}function oD({open:e,onOpenChange:t,monitor:n,onConfirm:r}){const[o,s]=k.useState(!1);async function i(){s(!0);try{await r(),t(!1)}catch(a){console.error(a)}finally{s(!1)}}return p.jsx(qy,{open:e,onOpenChange:t,children:p.jsxs(Gy,{className:"sm:max-w-md",children:[p.jsxs(Yy,{children:[p.jsx(Qy,{children:"Delete Monitor"}),p.jsxs(Xy,{children:["Are you sure you want to delete ",p.jsx("span",{className:"font-semibold text-foreground",children:n?.name}),"? This action cannot be undone and will delete all historical data for this monitor."]})]}),p.jsxs(Jy,{children:[p.jsx(qn,{variant:"outline",onClick:()=>t(!1),disabled:o,children:"Cancel"}),p.jsxs(qn,{variant:"destructive",onClick:i,disabled:o,children:[o?p.jsx(vl,{className:"mr-2 h-4 w-4 animate-spin"}):p.jsx(om,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})})}function sD(){const e=y0(),t=bo(),{data:n,loading:r}=v0(C=>C.monitors),[o,s]=y.useState(""),[i,a]=y.useState(!1),[c,l]=y.useState(!1),[d,u]=y.useState(!1),[f,h]=y.useState(null);y.useEffect(()=>{e(Fn(60));const C=setInterval(()=>e(Fn(60)),3e4);return()=>clearInterval(C)},[e]);const m=y.useMemo(()=>{if(!o)return n;const C=o.toLowerCase();return n.filter(E=>E.monitor.name.toLowerCase().includes(C)||E.monitor.host?.toLowerCase().includes(C))},[n,o]),g=async C=>{try{await e(Qp(C)).unwrap(),ze.success("Monitor created"),e(Fn(60))}catch(E){throw ze.error(E||"Failed to create monitor"),E}},v=async C=>{if(f)try{await e(Xp({id:f.id,data:C})).unwrap(),ze.success("Monitor updated"),e(Fn(60))}catch(E){throw ze.error(E||"Failed to update monitor"),E}},b=async()=>{if(f)try{await e(Jp(f.id)).unwrap(),ze.success("Monitor deleted")}catch(C){throw ze.error(C||"Failed to delete monitor"),C}},_=async C=>{try{await e(bc({id:C.id,paused:!C.isPaused})).unwrap(),ze.success(C.isPaused?"Resumed":"Paused")}catch(E){ze.error(E||"Failed to toggle pause")}},w=async C=>{ze.info("Clone feature coming soon")},x=C=>{h(C),l(!0)},S=C=>{h(C),u(!0)},P=C=>{t({to:"/monitors/$id",params:{id:C.id}})};return p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[p.jsxs("div",{children:[p.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Monitors"}),p.jsx("p",{className:"text-muted-foreground",children:"Manage your uptime monitors and status checks."})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("div",{className:"relative w-full md:w-auto",children:[p.jsx(rm,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),p.jsx(Ht,{placeholder:"Search monitors...",value:o,onChange:C=>s(C.target.value),className:"pl-8 w-full md:w-[250px]"})]}),p.jsxs(qn,{onClick:()=>{h(null),a(!0)},children:[p.jsx(Bd,{className:"mr-2 h-4 w-4"})," Add Monitor"]})]})]}),r&&n.length===0?p.jsx("div",{className:"flex h-64 items-center justify-center",children:p.jsx(vl,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):m.length===0?p.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed p-8 text-center animate-in fade-in-50",children:[p.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-muted",children:p.jsx(YE,{className:"h-6 w-6 text-muted-foreground"})}),p.jsx("h3",{className:"mt-4 text-lg font-semibold",children:"No monitors found"}),p.jsx("p",{className:"mb-4 mt-2 text-sm text-muted-foreground",children:o?"Try adjusting your search terms.":"Get started by adding your first monitor."}),!o&&p.jsxs(qn,{onClick:()=>a(!0),children:[p.jsx(Bd,{className:"mr-2 h-4 w-4"})," Add Monitor"]})]}):p.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:m.map(C=>p.jsx(Xk,{summary:C,onEdit:x,onDelete:S,onPause:_,onClone:w,onDetails:P},C.monitor.id))}),p.jsx(Zf,{open:i,onOpenChange:a,onSubmit:g}),p.jsx(Zf,{open:c,onOpenChange:l,monitor:f,onSubmit:v}),p.jsx(oD,{open:d,onOpenChange:u,monitor:f,onConfirm:b})]})}function iD(){const e=Ja({queryKey:["statusPages"],queryFn:async()=>(await Te.get("/status-pages")).data.statusPages});Ja({queryKey:["monitors"],queryFn:async()=>(await Te.get("/monitors")).data.monitors});const[t,n]=y.useState(!1),[r,o]=y.useState("My Status Page"),[s,i]=y.useState("my-status");async function a(){n(!0);try{await Te.post("/status-pages",{name:r,slug:s,domains:[]}),ze.success("Created"),e.refetch()}catch(c){ze.error(c?.response?.data?.detail??"Create failed")}finally{n(!1)}}return p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx("div",{className:"text-2xl font-semibold",children:"Status Pages"}),p.jsx("div",{className:"text-sm text-neutral-600",children:"This scaffold includes JSON endpoints for a public status page."})]}),p.jsxs(io,{children:[p.jsx(ao,{className:"font-semibold",children:"Create"}),p.jsxs(co,{className:"grid gap-3 sm:grid-cols-3",children:[p.jsxs("div",{children:[p.jsx("label",{className:"text-sm",children:"Name"}),p.jsx("input",{className:"mt-1 w-full rounded-xl border px-3 py-2",value:r,onChange:c=>o(c.target.value)})]}),p.jsxs("div",{children:[p.jsx("label",{className:"text-sm",children:"Slug"}),p.jsx("input",{className:"mt-1 w-full rounded-xl border px-3 py-2",value:s,onChange:c=>i(c.target.value)})]}),p.jsx("div",{className:"flex items-end",children:p.jsx("button",{disabled:t,className:"w-full rounded-xl bg-neutral-900 px-3 py-2 text-white hover:bg-neutral-800 disabled:opacity-60",onClick:a,children:t?"Creating...":"Create"})})]})]}),p.jsx("div",{className:"grid gap-3",children:(e.data??[]).map(c=>p.jsxs(io,{children:[p.jsxs(ao,{className:"flex items-center justify-between",children:[p.jsxs("div",{children:[p.jsx("div",{className:"font-semibold",children:c.name}),p.jsxs("div",{className:"text-xs text-neutral-600",children:["slug: ",c.slug]})]}),p.jsx("a",{className:"rounded-xl border px-3 py-1 text-sm hover:bg-neutral-50",href:`/status-pages/public/${c.slug}`,target:"_blank",rel:"noreferrer",children:"Public JSON"})]}),p.jsxs(co,{className:"text-sm text-neutral-700",children:["Mapping UI is intentionally minimal in this scaffold; integrate a proper editor when needed.",p.jsx("div",{className:"mt-2 text-xs text-neutral-500",children:"Tip: map status pages to domains using Host / X-Forwarded-Host header like Uptime Kuma does."})]})]},c.id))})]})}function aD(){const{data:e,refetch:t}=Ja({queryKey:["notifications"],queryFn:async()=>(await Te.get("/notifications")).data.notifications}),[n,r]=y.useState(""),[o,s]=y.useState("");async function i(){if(!n.trim()||!o.trim()){ze.error("Name and webhook URL required");return}try{await Te.post("/notifications",{name:n,webhookUrl:o}),r(""),s(""),ze.success("Notification created"),await t()}catch(c){ze.error(c?.response?.data?.detail??"Failed")}}async function a(c){if(confirm("Delete this notification?"))try{await Te.delete(`/notifications/${c}`),ze.success("Deleted"),await t()}catch(l){ze.error(l?.response?.data?.detail??"Delete failed")}}return p.jsxs("div",{className:"mx-auto max-w-3xl space-y-4",children:[p.jsxs(io,{children:[p.jsxs(ao,{children:[p.jsx("div",{className:"text-lg font-semibold",children:"Notifications"}),p.jsx("div",{className:"text-sm text-neutral-600 dark:text-neutral-400",children:"Webhook notifications on monitor status changes."})]}),p.jsxs(co,{children:[p.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[p.jsxs("div",{children:[p.jsx("label",{className:"text-sm",children:"Name"}),p.jsx("input",{value:n,onChange:c=>r(c.target.value),className:"mt-1 w-full rounded-xl border px-3 py-2 dark:border-neutral-800 dark:bg-neutral-950"})]}),p.jsxs("div",{className:"md:col-span-2",children:[p.jsx("label",{className:"text-sm",children:"Webhook URL"}),p.jsx("input",{value:o,onChange:c=>s(c.target.value),placeholder:"https://...",className:"mt-1 w-full rounded-xl border px-3 py-2 dark:border-neutral-800 dark:bg-neutral-950"})]})]}),p.jsx("div",{className:"mt-3",children:p.jsx("button",{onClick:i,className:"rounded-xl bg-neutral-900 px-4 py-2 text-white hover:bg-neutral-800 dark:bg-neutral-100 dark:text-neutral-900 dark:hover:bg-neutral-200",children:"Add"})})]})]}),p.jsxs(io,{children:[p.jsx(ao,{children:p.jsx("div",{className:"text-sm font-semibold",children:"Configured Notifications"})}),p.jsx(co,{children:(e??[]).length===0?p.jsx("div",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"No notifications yet."}):p.jsx("div",{className:"space-y-2",children:(e??[]).map(c=>p.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-xl border p-3 dark:border-neutral-800",children:[p.jsxs("div",{className:"min-w-0",children:[p.jsx("div",{className:"font-semibold",children:c.name}),p.jsx("div",{className:"truncate text-sm text-neutral-500 dark:text-neutral-400",children:c.webhookUrl})]}),p.jsx("button",{className:"rounded-xl border px-3 py-2 text-red-600 hover:bg-neutral-50 dark:border-neutral-800 dark:hover:bg-neutral-900",onClick:()=>a(c.id),children:"Delete"})]},c.id))})})]})]})}function cD(){return fi(),rp(),p.jsxs("div",{className:"min-h-screen bg-neutral-50 text-neutral-900 dark:bg-neutral-950 dark:text-neutral-100",children:[p.jsx("main",{className:"min-h-screen",children:p.jsx(Zc,{})}),p.jsx(_x,{richColors:!0})]})}const ls=jb({component:cD}),lD=()=>{const{token:e}=fi.getState();if(!e)throw th({to:"/login"})};function Hi(e=!0){const t=fr({getParentRoute:()=>ls,id:"workspace",beforeLoad:e?lD:void 0,component:g0}),n=t.addChildren([fr({getParentRoute:()=>t,path:"/monitors",component:sD}),fr({getParentRoute:()=>t,path:"/status-pages",component:iD}),fr({getParentRoute:()=>t,path:"/notifications",component:aD})]);if(e){const r=fr({getParentRoute:()=>ls,path:"/login",component:m0});return ls.addChildren([n,r])}else return ls.addChildren([n])}Kc({routeTree:Hi(!0)});const ev=sE({reducer:{monitors:OE}}),uD=new Ch;function dD({apiBase:e,token:t,basePath:n}){k.useEffect(()=>{sS(e,t)},[e,t]);const r=k.useMemo(()=>Kc({routeTree:Hi(!1),basepath:"/pulse"}),[n]);return p.jsx(kh,{store:ev,children:p.jsx(Ph,{client:uD,children:p.jsx(yh,{router:r})})})}const fD=new Ch;function hD({apiBase:e}){k.useEffect(()=>{e&&(Te.defaults.baseURL=e),iS()},[e]);const t=k.useMemo(()=>Kc({routeTree:Hi(!1)}),[]);return p.jsx(kh,{store:ev,children:p.jsx(Ph,{client:fD,children:p.jsx(yh,{router:t})})})}const pD=[{title:"Monitors",url:"/pulse/monitors",icon:"Activity"},{title:"Status Pages",url:"/pulse/status-pages",icon:"Globe"},{title:"Notifications",url:"/pulse/notifications",icon:"Bell"}];exports.PulsePage=dD;exports.PulseWatch=hD;exports.api=Te;exports.createRouteTree=Hi;exports.pulseNavItems=pD;
|