@yoast/ai-insights-client 1.0.1 โ†’ 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1293 @@
1
+ "use strict";var Mx=Object.defineProperty;var wh=e=>{throw TypeError(e)};var $x=(e,t,n)=>t in e?Mx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ge=(e,t,n)=>$x(e,typeof t!="symbol"?t+"":t,n),Wc=(e,t,n)=>t.has(e)||wh("Cannot "+n);var E=(e,t,n)=>(Wc(e,t,"read from private field"),n?n.call(e):t.get(e)),te=(e,t,n)=>t.has(e)?wh("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),V=(e,t,n,r)=>(Wc(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Oe=(e,t,n)=>(Wc(e,t,"access private method"),n);var Fa=(e,t,n,r)=>({set _(i){V(e,t,i,n)},get _(){return E(e,t,r)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),O=require("@yoast/ui-library"),W=require("react"),jx=require("styled-components");function Dx(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 T=Dx(W);function Rp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Qs={},Sh;function Lx(){if(Sh)return Qs;Sh=1,Object.defineProperty(Qs,"__esModule",{value:!0}),Qs.parse=o,Qs.serialize=c;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,n=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,r=/^[\u0020-\u003A\u003D-\u007E]*$/,i=Object.prototype.toString,s=(()=>{const f=function(){};return f.prototype=Object.create(null),f})();function o(f,h){const g=new s,m=f.length;if(m<2)return g;const p=(h==null?void 0:h.decode)||u;let b=0;do{const v=f.indexOf("=",b);if(v===-1)break;const S=f.indexOf(";",b),w=S===-1?m:S;if(v>w){b=f.lastIndexOf(";",v-1)+1;continue}const x=a(f,b,v),_=l(f,v,x),C=f.slice(x,_);if(g[C]===void 0){let A=a(f,v+1,w),k=l(f,w,A);const P=p(f.slice(A,k));g[C]=P}b=w+1}while(b<m);return g}function a(f,h,g){do{const m=f.charCodeAt(h);if(m!==32&&m!==9)return h}while(++h<g);return g}function l(f,h,g){for(;h>g;){const m=f.charCodeAt(--h);if(m!==32&&m!==9)return h+1}return g}function c(f,h,g){const m=(g==null?void 0:g.encode)||encodeURIComponent;if(!e.test(f))throw new TypeError(`argument name is invalid: ${f}`);const p=m(h);if(!t.test(p))throw new TypeError(`argument val is invalid: ${h}`);let b=f+"="+p;if(!g)return b;if(g.maxAge!==void 0){if(!Number.isInteger(g.maxAge))throw new TypeError(`option maxAge is invalid: ${g.maxAge}`);b+="; Max-Age="+g.maxAge}if(g.domain){if(!n.test(g.domain))throw new TypeError(`option domain is invalid: ${g.domain}`);b+="; Domain="+g.domain}if(g.path){if(!r.test(g.path))throw new TypeError(`option path is invalid: ${g.path}`);b+="; Path="+g.path}if(g.expires){if(!d(g.expires)||!Number.isFinite(g.expires.valueOf()))throw new TypeError(`option expires is invalid: ${g.expires}`);b+="; Expires="+g.expires.toUTCString()}if(g.httpOnly&&(b+="; HttpOnly"),g.secure&&(b+="; Secure"),g.partitioned&&(b+="; Partitioned"),g.priority)switch(typeof g.priority=="string"?g.priority.toLowerCase():void 0){case"low":b+="; Priority=Low";break;case"medium":b+="; Priority=Medium";break;case"high":b+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${g.priority}`)}if(g.sameSite)switch(typeof g.sameSite=="string"?g.sameSite.toLowerCase():g.sameSite){case!0:case"strict":b+="; SameSite=Strict";break;case"lax":b+="; SameSite=Lax";break;case"none":b+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${g.sameSite}`)}return b}function u(f){if(f.indexOf("%")===-1)return f;try{return decodeURIComponent(f)}catch(h){return f}}function d(f){return i.call(f)==="[object Date]"}return Qs}Lx();/**
2
+ * react-router v7.6.3
3
+ *
4
+ * Copyright (c) Remix Software Inc.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE.md file in the root directory of this source tree.
8
+ *
9
+ * @license MIT
10
+ */var Ch="popstate";function Ix(e={}){let{initialEntries:t=["/"],initialIndex:n,v5Compat:r=!1}=e,i;i=t.map((h,g)=>u(h,typeof h=="string"?null:h.state,g===0?"default":void 0));let s=l(n==null?i.length-1:n),o="POP",a=null;function l(h){return Math.min(Math.max(h,0),i.length-1)}function c(){return i[s]}function u(h,g=null,m){let p=Ao(i?c().pathname:"/",h,g,m);return un(p.pathname.charAt(0)==="/",`relative pathnames are not supported in memory history: ${JSON.stringify(h)}`),p}function d(h){return typeof h=="string"?h:mi(h)}return{get index(){return s},get action(){return o},get location(){return c()},createHref:d,createURL(h){return new URL(d(h),"http://localhost")},encodeLocation(h){let g=typeof h=="string"?qr(h):h;return{pathname:g.pathname||"",search:g.search||"",hash:g.hash||""}},push(h,g){o="PUSH";let m=u(h,g);s+=1,i.splice(s,i.length,m),r&&a&&a({action:o,location:m,delta:1})},replace(h,g){o="REPLACE";let m=u(h,g);i[s]=m,r&&a&&a({action:o,location:m,delta:0})},go(h){o="POP";let g=l(s+h),m=i[g];s=g,a&&a({action:o,location:m,delta:h})},listen(h){return a=h,()=>{a=null}}}}function Rx(e={}){function t(r,i){let{pathname:s,search:o,hash:a}=r.location;return Ao("",{pathname:s,search:o,hash:a},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:mi(i)}return Fp(t,n,null,e)}function Fx(e={}){function t(i,s){let{pathname:o="/",search:a="",hash:l=""}=qr(i.location.hash.substring(1));return!o.startsWith("/")&&!o.startsWith(".")&&(o="/"+o),Ao("",{pathname:o,search:a,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(i,s){let o=i.document.querySelector("base"),a="";if(o&&o.getAttribute("href")){let l=i.location.href,c=l.indexOf("#");a=c===-1?l:l.slice(0,c)}return a+"#"+(typeof s=="string"?s:mi(s))}function r(i,s){un(i.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(s)})`)}return Fp(t,n,r,e)}function Je(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}function un(e,t){if(!e){typeof console!="undefined"&&console.warn(t);try{throw new Error(t)}catch(n){}}}function Nx(){return Math.random().toString(36).substring(2,10)}function _h(e,t){return{usr:e.state,key:e.key,idx:t}}function Ao(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?qr(t):t,state:n,key:t&&t.key||r||Nx()}}function mi({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function qr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Fp(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,a="POP",l=null,c=u();c==null&&(c=0,o.replaceState({...o.state,idx:c},""));function u(){return(o.state||{idx:null}).idx}function d(){a="POP";let p=u(),b=p==null?null:p-c;c=p,l&&l({action:a,location:m.location,delta:b})}function f(p,b){a="PUSH";let v=Ao(m.location,p,b);n&&n(v,p),c=u()+1;let S=_h(v,c),w=m.createHref(v);try{o.pushState(S,"",w)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;i.location.assign(w)}s&&l&&l({action:a,location:m.location,delta:1})}function h(p,b){a="REPLACE";let v=Ao(m.location,p,b);n&&n(v,p),c=u();let S=_h(v,c),w=m.createHref(v);o.replaceState(S,"",w),s&&l&&l({action:a,location:m.location,delta:0})}function g(p){return Bx(p)}let m={get action(){return a},get location(){return e(i,o)},listen(p){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(Ch,d),l=p,()=>{i.removeEventListener(Ch,d),l=null}},createHref(p){return t(i,p)},createURL:g,encodeLocation(p){let b=g(p);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:f,replace:h,go(p){return o.go(p)}};return m}function Bx(e,t=!1){let n="http://localhost";typeof window!="undefined"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Je(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:mi(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function Np(e,t,n="/"){return qx(e,t,n,!1)}function qx(e,t,n,r){let i=typeof t=="string"?qr(t):t,s=ar(i.pathname||"/",n);if(s==null)return null;let o=Bp(e);zx(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let c=zp(s);a=Xx(o[l],c,r)}return a}function Bp(e,t=[],n=[],r=""){let i=(s,o,a)=>{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(Je(l.relativePath.startsWith(r),`Absolute route path "${l.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),l.relativePath=l.relativePath.slice(r.length));let c=rr([r,l.relativePath]),u=n.concat(l);s.children&&s.children.length>0&&(Je(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),Bp(s.children,t,u,c)),!(s.path==null&&!s.index)&&t.push({path:c,score:Qx(c,s.index),routesMeta:u})};return e.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of qp(s.path))i(s,o,l)}),t}function qp(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=qp(r.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function zx(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Yx(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var Hx=/^:[\w-]+$/,Ux=3,Kx=2,Wx=1,Vx=10,Gx=-2,kh=e=>e==="*";function Qx(e,t){let n=e.split("/"),r=n.length;return n.some(kh)&&(r+=Gx),t&&(r+=Kx),n.filter(i=>!kh(i)).reduce((i,s)=>i+(Hx.test(s)?Ux:s===""?Wx:Vx),r)}function Yx(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function Xx(e,t,n=!1){let{routesMeta:r}=e,i={},s="/",o=[];for(let a=0;a<r.length;++a){let l=r[a],c=a===r.length-1,u=s==="/"?t:t.slice(s.length)||"/",d=To({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u),f=l.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=To({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:rr([s,d.pathname]),pathnameBase:nw(rr([s,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(s=rr([s,d.pathnameBase]))}return o}function To(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Jx(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((c,{paramName:u,isOptional:d},f)=>{if(u==="*"){let g=a[f]||"";o=s.slice(0,s.length-g.length).replace(/(.)\/+$/,"$1")}const h=a[f];return d&&!h?c[u]=void 0:c[u]=(h||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:o,pattern:e}}function Jx(e,t=!1,n=!0){un(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function zp(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return un(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ar(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Zx(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?qr(e):e;return{pathname:n?n.startsWith("/")?n:ew(n,t):t,search:rw(r),hash:iw(i)}}function ew(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Vc(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function tw(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Hp(e){let t=tw(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Up(e,t,n,r=!1){let i;typeof e=="string"?i=qr(e):(i={...e},Je(!i.pathname||!i.pathname.includes("?"),Vc("?","pathname","search",i)),Je(!i.pathname||!i.pathname.includes("#"),Vc("#","pathname","hash",i)),Je(!i.search||!i.search.includes("#"),Vc("#","search","hash",i)));let s=e===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=n;else{let d=t.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}a=d>=0?t[d]:"/"}let l=Zx(i,a),c=o&&o!=="/"&&o.endsWith("/"),u=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}var rr=e=>e.join("/").replace(/\/\/+/g,"/"),nw=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),rw=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,iw=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function sw(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var Kp=["POST","PUT","PATCH","DELETE"];new Set(Kp);var ow=["GET",...Kp];new Set(ow);var Ms=T.createContext(null);Ms.displayName="DataRouter";var uc=T.createContext(null);uc.displayName="DataRouterState";var Wp=T.createContext({isTransitioning:!1});Wp.displayName="ViewTransition";var aw=T.createContext(new Map);aw.displayName="Fetchers";var lw=T.createContext(null);lw.displayName="Await";var Bn=T.createContext(null);Bn.displayName="Navigation";var Sa=T.createContext(null);Sa.displayName="Location";var qn=T.createContext({outlet:null,matches:[],isDataRoute:!1});qn.displayName="Route";var ef=T.createContext(null);ef.displayName="RouteError";function cw(e,{relative:t}={}){Je($s(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=T.useContext(Bn),{hash:i,pathname:s,search:o}=Ca(e,{relative:t}),a=s;return n!=="/"&&(a=s==="/"?n:rr([n,s])),r.createHref({pathname:a,search:o,hash:i})}function $s(){return T.useContext(Sa)!=null}function dn(){return Je($s(),"useLocation() may be used only in the context of a <Router> component."),T.useContext(Sa).location}function Eh(e){Je($s(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=dn();return T.useMemo(()=>To(e,zp(t)),[t,e])}var Vp="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Gp(e){T.useContext(Bn).static||T.useLayoutEffect(e)}function zr(){let{isDataRoute:e}=T.useContext(qn);return e?_w():uw()}function uw(){Je($s(),"useNavigate() may be used only in the context of a <Router> component.");let e=T.useContext(Ms),{basename:t,navigator:n}=T.useContext(Bn),{matches:r}=T.useContext(qn),{pathname:i}=dn(),s=JSON.stringify(Hp(r)),o=T.useRef(!1);return Gp(()=>{o.current=!0}),T.useCallback((l,c={})=>{if(un(o.current,Vp),!o.current)return;if(typeof l=="number"){n.go(l);return}let u=Up(l,JSON.parse(s),i,c.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:rr([t,u.pathname])),(c.replace?n.replace:n.push)(u,c.state,c)},[t,n,s,i,e])}var dw=T.createContext(null);function fw(e){let t=T.useContext(qn).outlet;return t&&T.createElement(dw.Provider,{value:e},t)}function Ca(e,{relative:t}={}){let{matches:n}=T.useContext(qn),{pathname:r}=dn(),i=JSON.stringify(Hp(n));return T.useMemo(()=>Up(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function hw(e,t){return Qp(e,t)}function Qp(e,t,n,r){var b;Je($s(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=T.useContext(Bn),{matches:s}=T.useContext(qn),o=s[s.length-1],a=o?o.params:{},l=o?o.pathname:"/",c=o?o.pathnameBase:"/",u=o&&o.route;{let v=u&&u.path||"";Yp(l,!u||v.endsWith("*")||v.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${v}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
11
+
12
+ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}/*`}">.`)}let d=dn(),f;if(t){let v=typeof t=="string"?qr(t):t;Je(c==="/"||((b=v.pathname)==null?void 0:b.startsWith(c)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${v.pathname}" was given in the \`location\` prop.`),f=v}else f=d;let h=f.pathname||"/",g=h;if(c!=="/"){let v=c.replace(/^\//,"").split("/");g="/"+h.replace(/^\//,"").split("/").slice(v.length).join("/")}let m=Np(e,{pathname:g});un(u||m!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),un(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let p=bw(m&&m.map(v=>Object.assign({},v,{params:Object.assign({},a,v.params),pathname:rr([c,i.encodeLocation?i.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:rr([c,i.encodeLocation?i.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),s,n,r);return t&&p?T.createElement(Sa.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...f},navigationType:"POP"}},p):p}function gw(){let e=Cw(),t=sw(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=T.createElement(T.Fragment,null,T.createElement("p",null,"๐Ÿ’ฟ Hey developer ๐Ÿ‘‹"),T.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",T.createElement("code",{style:s},"ErrorBoundary")," or"," ",T.createElement("code",{style:s},"errorElement")," prop on your route.")),T.createElement(T.Fragment,null,T.createElement("h2",null,"Unexpected Application Error!"),T.createElement("h3",{style:{fontStyle:"italic"}},t),n?T.createElement("pre",{style:i},n):null,o)}var yw=T.createElement(gw,null),mw=class extends T.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?T.createElement(qn.Provider,{value:this.props.routeContext},T.createElement(ef.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function pw({routeContext:e,match:t,children:n}){let r=T.useContext(Ms);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),T.createElement(qn.Provider,{value:e},n)}function bw(e,t=[],n=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,s=n==null?void 0:n.errors;if(s!=null){let l=i.findIndex(c=>c.route.id&&(s==null?void 0:s[c.route.id])!==void 0);Je(l>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),i=i.slice(0,Math.min(i.length,l+1))}let o=!1,a=-1;if(n)for(let l=0;l<i.length;l++){let c=i[l];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(a=l),c.route.id){let{loaderData:u,errors:d}=n,f=c.route.loader&&!u.hasOwnProperty(c.route.id)&&(!d||d[c.route.id]===void 0);if(c.route.lazy||f){o=!0,a>=0?i=i.slice(0,a+1):i=[i[0]];break}}}return i.reduceRight((l,c,u)=>{let d,f=!1,h=null,g=null;n&&(d=s&&c.route.id?s[c.route.id]:void 0,h=c.route.errorElement||yw,o&&(a<0&&u===0?(Yp("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,g=null):a===u&&(f=!0,g=c.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,u+1)),p=()=>{let b;return d?b=h:f?b=g:c.route.Component?b=T.createElement(c.route.Component,null):c.route.element?b=c.route.element:b=l,T.createElement(pw,{match:c,routeContext:{outlet:l,matches:m,isDataRoute:n!=null},children:b})};return n&&(c.route.ErrorBoundary||c.route.errorElement||u===0)?T.createElement(mw,{location:n.location,revalidation:n.revalidation,component:h,error:d,children:p(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):p()},null)}function tf(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function vw(e){let t=T.useContext(Ms);return Je(t,tf(e)),t}function xw(e){let t=T.useContext(uc);return Je(t,tf(e)),t}function ww(e){let t=T.useContext(qn);return Je(t,tf(e)),t}function nf(e){let t=ww(e),n=t.matches[t.matches.length-1];return Je(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Sw(){return nf("useRouteId")}function Cw(){var r;let e=T.useContext(ef),t=xw("useRouteError"),n=nf("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function _w(){let{router:e}=vw("useNavigate"),t=nf("useNavigate"),n=T.useRef(!1);return Gp(()=>{n.current=!0}),T.useCallback(async(i,s={})=>{un(n.current,Vp),n.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...s}))},[e,t])}var Oh={};function Yp(e,t,n){!t&&!Oh[e]&&(Oh[e]=!0,un(!1,n))}T.memo(kw);function kw({routes:e,future:t,state:n}){return Qp(e,void 0,n,t)}function Ew({basename:e,children:t,initialEntries:n,initialIndex:r}){let i=T.useRef();i.current==null&&(i.current=Ix({initialEntries:n,initialIndex:r,v5Compat:!0}));let s=i.current,[o,a]=T.useState({action:s.action,location:s.location}),l=T.useCallback(c=>{T.startTransition(()=>a(c))},[a]);return T.useLayoutEffect(()=>s.listen(l),[s,l]),T.createElement(rf,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:s})}function dc(e){return fw(e.context)}function Ot(e){Je(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function rf({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:s=!1}){Je(!$s(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=e.replace(/^\/*/,"/"),a=T.useMemo(()=>({basename:o,navigator:i,static:s,future:{}}),[o,i,s]);typeof n=="string"&&(n=qr(n));let{pathname:l="/",search:c="",hash:u="",state:d=null,key:f="default"}=n,h=T.useMemo(()=>{let g=ar(l,o);return g==null?null:{location:{pathname:g,search:c,hash:u,state:d,key:f},navigationType:r}},[o,l,c,u,d,f,r]);return un(h!=null,`<Router basename="${o}"> is not able to match the URL "${l}${c}${u}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:T.createElement(Bn.Provider,{value:a},T.createElement(Sa.Provider,{children:t,value:h}))}function Ow({children:e,location:t}){return hw(Fu(e),t)}function Fu(e,t=[]){let n=[];return T.Children.forEach(e,(r,i)=>{if(!T.isValidElement(r))return;let s=[...t,i];if(r.type===T.Fragment){n.push.apply(n,Fu(r.props.children,s));return}Je(r.type===Ot,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Je(!r.props.index||!r.props.children,"An index route cannot have child routes.");let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=Fu(r.props.children,s)),n.push(o)}),n}var vl="get",xl="application/x-www-form-urlencoded";function fc(e){return e!=null&&typeof e.tagName=="string"}function Aw(e){return fc(e)&&e.tagName.toLowerCase()==="button"}function Tw(e){return fc(e)&&e.tagName.toLowerCase()==="form"}function Pw(e){return fc(e)&&e.tagName.toLowerCase()==="input"}function Mw(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function $w(e,t){return e.button===0&&(!t||t==="_self")&&!Mw(e)}var Na=null;function jw(){if(Na===null)try{new FormData(document.createElement("form"),0),Na=!1}catch(e){Na=!0}return Na}var Dw=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Gc(e){return e!=null&&!Dw.has(e)?(un(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${xl}"`),null):e}function Lw(e,t){let n,r,i,s,o;if(Tw(e)){let a=e.getAttribute("action");r=a?ar(a,t):null,n=e.getAttribute("method")||vl,i=Gc(e.getAttribute("enctype"))||xl,s=new FormData(e)}else if(Aw(e)||Pw(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||a.getAttribute("action");if(r=l?ar(l,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||vl,i=Gc(e.getAttribute("formenctype"))||Gc(a.getAttribute("enctype"))||xl,s=new FormData(a,e),!jw()){let{name:c,type:u,value:d}=e;if(u==="image"){let f=c?`${c}.`:"";s.append(`${f}x`,"0"),s.append(`${f}y`,"0")}else c&&s.append(c,d)}}else{if(fc(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=vl,r=null,i=xl,o=e}return s&&i==="text/plain"&&(o=s,s=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:s,body:o}}function sf(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}async function Iw(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Rw(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Fw(e,t,n){let r=await Promise.all(e.map(async i=>{let s=t.routes[i.route.id];if(s){let o=await Iw(s,n);return o.links?o.links():[]}return[]}));return zw(r.flat(1).filter(Rw).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function Ah(e,t,n,r,i,s){let o=(l,c)=>n[c]?l.route.id!==n[c].route.id:!0,a=(l,c)=>{var u;return n[c].pathname!==l.pathname||((u=n[c].route.path)==null?void 0:u.endsWith("*"))&&n[c].params["*"]!==l.params["*"]};return s==="assets"?t.filter((l,c)=>o(l,c)||a(l,c)):s==="data"?t.filter((l,c)=>{var d;let u=r.routes[l.route.id];if(!u||!u.hasLoader)return!1;if(o(l,c)||a(l,c))return!0;if(l.route.shouldRevalidate){let f=l.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((d=n[0])==null?void 0:d.params)||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function Nw(e,t,{includeHydrateFallback:n}={}){return Bw(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let s=[i.module];return i.clientActionModule&&(s=s.concat(i.clientActionModule)),i.clientLoaderModule&&(s=s.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(s=s.concat(i.hydrateFallbackModule)),i.imports&&(s=s.concat(i.imports)),s}).flat(1))}function Bw(e){return[...new Set(e)]}function qw(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function zw(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let s=JSON.stringify(qw(i));return n.has(s)||(n.add(s),r.push({key:s,link:i})),r},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Hw=new Set([100,101,204,205]);function Uw(e,t){let n=typeof e=="string"?new URL(e,typeof window=="undefined"?"server://singlefetch/":window.location.origin):e;return n.pathname==="/"?n.pathname="_root.data":t&&ar(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.data`:n.pathname=`${n.pathname.replace(/\/$/,"")}.data`,n}function Xp(){let e=T.useContext(Ms);return sf(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Kw(){let e=T.useContext(uc);return sf(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var of=T.createContext(void 0);of.displayName="FrameworkContext";function Jp(){let e=T.useContext(of);return sf(e,"You must render this element inside a <HydratedRouter> element"),e}function Ww(e,t){let n=T.useContext(of),[r,i]=T.useState(!1),[s,o]=T.useState(!1),{onFocus:a,onBlur:l,onMouseEnter:c,onMouseLeave:u,onTouchStart:d}=t,f=T.useRef(null);T.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let m=b=>{b.forEach(v=>{o(v.isIntersecting)})},p=new IntersectionObserver(m,{threshold:.5});return f.current&&p.observe(f.current),()=>{p.disconnect()}}},[e]),T.useEffect(()=>{if(r){let m=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(m)}}},[r]);let h=()=>{i(!0)},g=()=>{i(!1),o(!1)};return n?e!=="intent"?[s,f,{}]:[s,f,{onFocus:Ys(a,h),onBlur:Ys(l,g),onMouseEnter:Ys(c,h),onMouseLeave:Ys(u,g),onTouchStart:Ys(d,h)}]:[!1,f,{}]}function Ys(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Vw({page:e,...t}){let{router:n}=Xp(),r=T.useMemo(()=>Np(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?T.createElement(Qw,{page:e,matches:r,...t}):null}function Gw(e){let{manifest:t,routeModules:n}=Jp(),[r,i]=T.useState([]);return T.useEffect(()=>{let s=!1;return Fw(e,t,n).then(o=>{s||i(o)}),()=>{s=!0}},[e,t,n]),r}function Qw({page:e,matches:t,...n}){let r=dn(),{manifest:i,routeModules:s}=Jp(),{basename:o}=Xp(),{loaderData:a,matches:l}=Kw(),c=T.useMemo(()=>Ah(e,t,l,i,r,"data"),[e,t,l,i,r]),u=T.useMemo(()=>Ah(e,t,l,i,r,"assets"),[e,t,l,i,r]),d=T.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let g=new Set,m=!1;if(t.forEach(b=>{var S;let v=i.routes[b.route.id];!v||!v.hasLoader||(!c.some(w=>w.route.id===b.route.id)&&b.route.id in a&&((S=s[b.route.id])!=null&&S.shouldRevalidate)||v.hasClientLoader?m=!0:g.add(b.route.id))}),g.size===0)return[];let p=Uw(e,o);return m&&g.size>0&&p.searchParams.set("_routes",t.filter(b=>g.has(b.route.id)).map(b=>b.route.id).join(",")),[p.pathname+p.search]},[o,a,r,i,c,t,e,s]),f=T.useMemo(()=>Nw(u,i),[u,i]),h=Gw(u);return T.createElement(T.Fragment,null,d.map(g=>T.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...n})),f.map(g=>T.createElement("link",{key:g,rel:"modulepreload",href:g,...n})),h.map(({key:g,link:m})=>T.createElement("link",{key:g,...m})))}function Yw(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Zp=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined";try{Zp&&(window.__reactRouterVersion="7.6.3")}catch(e){}function Xw({basename:e,children:t,window:n}){let r=T.useRef();r.current==null&&(r.current=Rx({window:n,v5Compat:!0}));let i=r.current,[s,o]=T.useState({action:i.action,location:i.location}),a=T.useCallback(l=>{T.startTransition(()=>o(l))},[o]);return T.useLayoutEffect(()=>i.listen(a),[i,a]),T.createElement(rf,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:i})}function Jw({basename:e,children:t,window:n}){let r=T.useRef();r.current==null&&(r.current=Fx({window:n,v5Compat:!0}));let i=r.current,[s,o]=T.useState({action:i.action,location:i.location}),a=T.useCallback(l=>{T.startTransition(()=>o(l))},[o]);return T.useLayoutEffect(()=>i.listen(a),[i,a]),T.createElement(rf,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:i})}var e0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Hr=T.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:s,replace:o,state:a,target:l,to:c,preventScrollReset:u,viewTransition:d,...f},h){let{basename:g}=T.useContext(Bn),m=typeof c=="string"&&e0.test(c),p,b=!1;if(typeof c=="string"&&m&&(p=c,Zp))try{let k=new URL(window.location.href),P=c.startsWith("//")?new URL(k.protocol+c):new URL(c),$=ar(P.pathname,g);P.origin===k.origin&&$!=null?c=$+P.search+P.hash:b=!0}catch(k){un(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let v=cw(c,{relative:i}),[S,w,x]=Ww(r,f),_=n2(c,{replace:o,state:a,target:l,preventScrollReset:u,relative:i,viewTransition:d});function C(k){t&&t(k),k.defaultPrevented||_(k)}let A=T.createElement("a",{...f,...x,href:p||v,onClick:b||s?t:C,ref:Yw(h,w),target:l,"data-discover":!m&&n==="render"?"true":void 0});return S&&!m?T.createElement(T.Fragment,null,A,T.createElement(Vw,{page:v})):A});Hr.displayName="Link";var Zw=T.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:s,to:o,viewTransition:a,children:l,...c},u){let d=Ca(o,{relative:c.relative}),f=dn(),h=T.useContext(uc),{navigator:g,basename:m}=T.useContext(Bn),p=h!=null&&a2(d)&&a===!0,b=g.encodeLocation?g.encodeLocation(d).pathname:d.pathname,v=f.pathname,S=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;n||(v=v.toLowerCase(),S=S?S.toLowerCase():null,b=b.toLowerCase()),S&&m&&(S=ar(S,m)||S);const w=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let x=v===b||!i&&v.startsWith(b)&&v.charAt(w)==="/",_=S!=null&&(S===b||!i&&S.startsWith(b)&&S.charAt(b.length)==="/"),C={isActive:x,isPending:_,isTransitioning:p},A=x?t:void 0,k;typeof r=="function"?k=r(C):k=[r,x?"active":null,_?"pending":null,p?"transitioning":null].filter(Boolean).join(" ");let P=typeof s=="function"?s(C):s;return T.createElement(Hr,{...c,"aria-current":A,className:k,ref:u,style:P,to:o,viewTransition:a},typeof l=="function"?l(C):l)});Zw.displayName="NavLink";var e2=T.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:s,method:o=vl,action:a,onSubmit:l,relative:c,preventScrollReset:u,viewTransition:d,...f},h)=>{let g=s2(),m=o2(a,{relative:c}),p=o.toLowerCase()==="get"?"get":"post",b=typeof a=="string"&&e0.test(a),v=S=>{if(l&&l(S),S.defaultPrevented)return;S.preventDefault();let w=S.nativeEvent.submitter,x=(w==null?void 0:w.getAttribute("formmethod"))||o;g(w||S.currentTarget,{fetcherKey:t,method:x,navigate:n,replace:i,state:s,relative:c,preventScrollReset:u,viewTransition:d})};return T.createElement("form",{ref:h,method:p,action:m,onSubmit:r?l:v,...f,"data-discover":!b&&e==="render"?"true":void 0})});e2.displayName="Form";function t2(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function t0(e){let t=T.useContext(Ms);return Je(t,t2(e)),t}function n2(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:s,viewTransition:o}={}){let a=zr(),l=dn(),c=Ca(e,{relative:s});return T.useCallback(u=>{if($w(u,t)){u.preventDefault();let d=n!==void 0?n:mi(l)===mi(c);a(e,{replace:d,state:r,preventScrollReset:i,relative:s,viewTransition:o})}},[l,a,c,n,r,t,e,i,s,o])}var r2=0,i2=()=>`__${String(++r2)}__`;function s2(){let{router:e}=t0("useSubmit"),{basename:t}=T.useContext(Bn),n=Sw();return T.useCallback(async(r,i={})=>{let{action:s,method:o,encType:a,formData:l,body:c}=Lw(r,t);if(i.navigate===!1){let u=i.fetcherKey||i2();await e.fetch(u,n,i.action||s,{preventScrollReset:i.preventScrollReset,formData:l,body:c,formMethod:i.method||o,formEncType:i.encType||a,flushSync:i.flushSync})}else await e.navigate(i.action||s,{preventScrollReset:i.preventScrollReset,formData:l,body:c,formMethod:i.method||o,formEncType:i.encType||a,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[e,t,n])}function o2(e,{relative:t}={}){let{basename:n}=T.useContext(Bn),r=T.useContext(qn);Je(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...Ca(e||".",{relative:t})},o=dn();if(e==null){s.search=o.search;let a=new URLSearchParams(s.search),l=a.getAll("index");if(l.some(u=>u==="")){a.delete("index"),l.filter(d=>d).forEach(d=>a.append("index",d));let u=a.toString();s.search=u?`?${u}`:""}}return(!e||e===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:rr([n,s.pathname])),mi(s)}function a2(e,t={}){let n=T.useContext(Wp);Je(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=t0("useViewTransitionState"),i=Ca(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=ar(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=ar(n.nextLocation.pathname,r)||n.nextLocation.pathname;return To(i.pathname,o)!=null||To(i.pathname,s)!=null}[...Hw];var js=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(){}},pi=typeof window=="undefined"||"Deno"in globalThis;function Pt(){}function l2(e,t){return typeof e=="function"?e(t):e}function Nu(e){return typeof e=="number"&&e>=0&&e!==1/0}function n0(e,t){return Math.max(e+(t||0)-Date.now(),0)}function jr(e,t){return typeof e=="function"?e(t):e}function sn(e,t){return typeof e=="function"?e(t):e}function Th(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==af(o,t.options))return!1}else if(!Po(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||s&&!s(t))}function Ph(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(bi(t.options.mutationKey)!==bi(s))return!1}else if(!Po(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function af(e,t){return((t==null?void 0:t.queryKeyHashFn)||bi)(e)}function bi(e){return JSON.stringify(e,(t,n)=>qu(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Po(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Po(e[n],t[n])):!1}function Bu(e,t){if(e===t)return e;const n=Mh(e)&&Mh(t);if(n||qu(e)&&qu(t)){const r=n?e:Object.keys(e),i=r.length,s=n?t:Object.keys(t),o=s.length,a=n?[]:{},l=new Set(r);let c=0;for(let u=0;u<o;u++){const d=n?u:s[u];(!n&&l.has(d)||n)&&e[d]===void 0&&t[d]===void 0?(a[d]=void 0,c++):(a[d]=Bu(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&c++)}return i===o&&c===i?e:a}return t}function $l(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 Mh(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function qu(e){if(!$h(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!$h(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function $h(e){return Object.prototype.toString.call(e)==="[object Object]"}function c2(e){return new Promise(t=>{setTimeout(t,e)})}function zu(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 u2(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function d2(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var jl=Symbol();function r0(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===jl&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===jl?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function i0(e,t){return typeof e=="function"?e(...t):!!e}var ri,vr,Ji,kp,f2=(kp=class extends js{constructor(){super();te(this,ri);te(this,vr);te(this,Ji);V(this,Ji,t=>{if(!pi&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){E(this,vr)||this.setEventListener(E(this,Ji))}onUnsubscribe(){var t;this.hasListeners()||((t=E(this,vr))==null||t.call(this),V(this,vr,void 0))}setEventListener(t){var n;V(this,Ji,t),(n=E(this,vr))==null||n.call(this),V(this,vr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){E(this,ri)!==t&&(V(this,ri,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof E(this,ri)=="boolean"?E(this,ri):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ri=new WeakMap,vr=new WeakMap,Ji=new WeakMap,kp),lf=new f2,Zi,xr,es,Ep,h2=(Ep=class extends js{constructor(){super();te(this,Zi,!0);te(this,xr);te(this,es);V(this,es,t=>{if(!pi&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){E(this,xr)||this.setEventListener(E(this,es))}onUnsubscribe(){var t;this.hasListeners()||((t=E(this,xr))==null||t.call(this),V(this,xr,void 0))}setEventListener(t){var n;V(this,es,t),(n=E(this,xr))==null||n.call(this),V(this,xr,t(this.setOnline.bind(this)))}setOnline(t){E(this,Zi)!==t&&(V(this,Zi,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return E(this,Zi)}},Zi=new WeakMap,xr=new WeakMap,es=new WeakMap,Ep),ks=new h2;function Hu(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function g2(e){return Math.min(1e3*2**e,3e4)}function s0(e){return(e!=null?e:"online")==="online"?ks.isOnline():!0}var o0=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Qc(e){return e instanceof o0}function a0(e){let t=!1,n=0,r=!1,i;const s=Hu(),o=m=>{var p;r||(f(new o0(m)),(p=e.abort)==null||p.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>lf.isFocused()&&(e.networkMode==="always"||ks.isOnline())&&e.canRun(),u=()=>s0(e.networkMode)&&e.canRun(),d=m=>{var p;r||(r=!0,(p=e.onSuccess)==null||p.call(e,m),i==null||i(),s.resolve(m))},f=m=>{var p;r||(r=!0,(p=e.onError)==null||p.call(e,m),i==null||i(),s.reject(m))},h=()=>new Promise(m=>{var p;i=b=>{(r||c())&&m(b)},(p=e.onPause)==null||p.call(e)}).then(()=>{var m;i=void 0,r||(m=e.onContinue)==null||m.call(e)}),g=()=>{if(r)return;let m;const p=n===0?e.initialPromise:void 0;try{m=p!=null?p:e.fn()}catch(b){m=Promise.reject(b)}Promise.resolve(m).then(d).catch(b=>{var _,C,A;if(r)return;const v=(_=e.retry)!=null?_:pi?0:3,S=(C=e.retryDelay)!=null?C:g2,w=typeof S=="function"?S(n,b):S,x=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,b);if(t||!x){f(b);return}n++,(A=e.onFail)==null||A.call(e,n,b),c2(w).then(()=>c()?void 0:h()).then(()=>{t?f(b):g()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?g():h().then(g),s)}}var y2=e=>setTimeout(e,0);function m2(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=y2;const s=a=>{t?e.push(a):i(()=>{n(a)})},o=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||o()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var ut=m2(),ii,Op,l0=(Op=class{constructor(){te(this,ii)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Nu(this.gcTime)&&V(this,ii,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e!=null?e:pi?1/0:5*60*1e3)}clearGcTimeout(){E(this,ii)&&(clearTimeout(E(this,ii)),V(this,ii,void 0))}},ii=new WeakMap,Op),ts,si,rn,oi,vt,la,ai,bn,Gn,Ap,p2=(Ap=class extends l0{constructor(t){var n;super();te(this,bn);te(this,ts);te(this,si);te(this,rn);te(this,oi);te(this,vt);te(this,la);te(this,ai);V(this,ai,!1),V(this,la,t.defaultOptions),this.setOptions(t.options),this.observers=[],V(this,oi,t.client),V(this,rn,E(this,oi).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,V(this,ts,b2(this.options)),this.state=(n=t.state)!=null?n:E(this,ts),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=E(this,vt))==null?void 0:t.promise}setOptions(t){this.options={...E(this,la),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&E(this,rn).remove(this)}setData(t,n){const r=zu(this.state.data,t,this.options);return Oe(this,bn,Gn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Oe(this,bn,Gn).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=E(this,vt))==null?void 0:r.promise;return(i=E(this,vt))==null||i.cancel(t),n?n.then(Pt).catch(Pt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(E(this,ts))}isActive(){return this.observers.some(t=>sn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===jl||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>jr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!n0(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=E(this,vt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=E(this,vt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),E(this,rn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(E(this,vt)&&(E(this,ai)?E(this,vt).cancel({revert:!0}):E(this,vt).cancelRetry()),this.scheduleGc()),E(this,rn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Oe(this,bn,Gn).call(this,{type:"invalidate"})}fetch(t,n){var c,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(E(this,vt))return E(this,vt).continueRetry(),E(this,vt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(h=>h.options.queryFn);f&&this.setOptions(f.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 r=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(V(this,ai,!0),r.signal)})},s=()=>{const f=r0(this.options,n),g=(()=>{const m={client:E(this,oi),queryKey:this.queryKey,meta:this.meta};return i(m),m})();return V(this,ai,!1),this.options.persister?this.options.persister(f,g,this):f(g)},a=(()=>{const f={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:E(this,oi),state:this.state,fetchFn:s};return i(f),f})();(c=this.options.behavior)==null||c.onFetch(a,this),V(this,si,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=a.fetchOptions)==null?void 0:u.meta))&&Oe(this,bn,Gn).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta});const l=f=>{var h,g,m,p;Qc(f)&&f.silent||Oe(this,bn,Gn).call(this,{type:"error",error:f}),Qc(f)||((g=(h=E(this,rn).config).onError)==null||g.call(h,f,this),(p=(m=E(this,rn).config).onSettled)==null||p.call(m,this.state.data,f,this)),this.scheduleGc()};return V(this,vt,a0({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var h,g,m,p;if(f===void 0){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}`),l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(b){l(b);return}(g=(h=E(this,rn).config).onSuccess)==null||g.call(h,f,this),(p=(m=E(this,rn).config).onSettled)==null||p.call(m,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,h)=>{Oe(this,bn,Gn).call(this,{type:"failed",failureCount:f,error:h})},onPause:()=>{Oe(this,bn,Gn).call(this,{type:"pause"})},onContinue:()=>{Oe(this,bn,Gn).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),E(this,vt).start()}},ts=new WeakMap,si=new WeakMap,rn=new WeakMap,oi=new WeakMap,vt=new WeakMap,la=new WeakMap,ai=new WeakMap,bn=new WeakSet,Gn=function(t){const n=r=>{var i,s;switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...c0(r.data,this.options),fetchMeta:(i=t.meta)!=null?i:null};case"success":return V(this,si,void 0),{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:(s=t.dataUpdatedAt)!=null?s:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return Qc(o)&&o.revert&&E(this,si)?{...E(this,si),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ut.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),E(this,rn).notify({query:this,type:"updated",action:t})})},Ap);function c0(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:s0(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function b2(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!=null?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 $n,Tp,v2=(Tp=class extends js{constructor(t={}){super();te(this,$n);this.config=t,V(this,$n,new Map)}build(t,n,r){var a;const i=n.queryKey,s=(a=n.queryHash)!=null?a:af(i,n);let o=this.get(s);return o||(o=new p2({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){E(this,$n).has(t.queryHash)||(E(this,$n).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=E(this,$n).get(t.queryHash);n&&(t.destroy(),n===t&&E(this,$n).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ut.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return E(this,$n).get(t)}getAll(){return[...E(this,$n).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Th(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Th(t,r)):n}notify(t){ut.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ut.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ut.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},$n=new WeakMap,Tp),jn,At,li,Dn,br,Pp,x2=(Pp=class extends l0{constructor(t){super();te(this,Dn);te(this,jn);te(this,At);te(this,li);this.mutationId=t.mutationId,V(this,At,t.mutationCache),V(this,jn,[]),this.state=t.state||u0(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){E(this,jn).includes(t)||(E(this,jn).push(t),this.clearGcTimeout(),E(this,At).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){V(this,jn,E(this,jn).filter(n=>n!==t)),this.scheduleGc(),E(this,At).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){E(this,jn).length||(this.state.status==="pending"?this.scheduleGc():E(this,At).remove(this))}continue(){var t,n;return(n=(t=E(this,li))==null?void 0:t.continue())!=null?n:this.execute(this.state.variables)}async execute(t){var s,o,a,l,c,u,d,f,h,g,m,p,b,v,S,w,x,_,C,A,k;const n=()=>{Oe(this,Dn,br).call(this,{type:"continue"})};V(this,li,a0({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(P,$)=>{Oe(this,Dn,br).call(this,{type:"failed",failureCount:P,error:$})},onPause:()=>{Oe(this,Dn,br).call(this,{type:"pause"})},onContinue:n,retry:(s=this.options.retry)!=null?s:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>E(this,At).canRun(this)}));const r=this.state.status==="pending",i=!E(this,li).canStart();try{if(r)n();else{Oe(this,Dn,br).call(this,{type:"pending",variables:t,isPaused:i}),await((a=(o=E(this,At).config).onMutate)==null?void 0:a.call(o,t,this));const $=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));$!==this.state.context&&Oe(this,Dn,br).call(this,{type:"pending",context:$,variables:t,isPaused:i})}const P=await E(this,li).start();return await((d=(u=E(this,At).config).onSuccess)==null?void 0:d.call(u,P,t,this.state.context,this)),await((h=(f=this.options).onSuccess)==null?void 0:h.call(f,P,t,this.state.context)),await((m=(g=E(this,At).config).onSettled)==null?void 0:m.call(g,P,null,this.state.variables,this.state.context,this)),await((b=(p=this.options).onSettled)==null?void 0:b.call(p,P,null,t,this.state.context)),Oe(this,Dn,br).call(this,{type:"success",data:P}),P}catch(P){try{throw await((S=(v=E(this,At).config).onError)==null?void 0:S.call(v,P,t,this.state.context,this)),await((x=(w=this.options).onError)==null?void 0:x.call(w,P,t,this.state.context)),await((C=(_=E(this,At).config).onSettled)==null?void 0:C.call(_,void 0,P,this.state.variables,this.state.context,this)),await((k=(A=this.options).onSettled)==null?void 0:k.call(A,void 0,P,t,this.state.context)),P}finally{Oe(this,Dn,br).call(this,{type:"error",error:P})}}finally{E(this,At).runNext(this)}}},jn=new WeakMap,At=new WeakMap,li=new WeakMap,Dn=new WeakSet,br=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ut.batch(()=>{E(this,jn).forEach(r=>{r.onMutationUpdate(t)}),E(this,At).notify({mutation:this,type:"updated",action:t})})},Pp);function u0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Zn,vn,ca,Mp,w2=(Mp=class extends js{constructor(t={}){super();te(this,Zn);te(this,vn);te(this,ca);this.config=t,V(this,Zn,new Set),V(this,vn,new Map),V(this,ca,0)}build(t,n,r){const i=new x2({mutationCache:this,mutationId:++Fa(this,ca)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){E(this,Zn).add(t);const n=Ba(t);if(typeof n=="string"){const r=E(this,vn).get(n);r?r.push(t):E(this,vn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(E(this,Zn).delete(t)){const n=Ba(t);if(typeof n=="string"){const r=E(this,vn).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&E(this,vn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Ba(t);if(typeof n=="string"){const r=E(this,vn).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r,i;const n=Ba(t);if(typeof n=="string"){const s=(r=E(this,vn).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(i=s==null?void 0:s.continue())!=null?i:Promise.resolve()}else return Promise.resolve()}clear(){ut.batch(()=>{E(this,Zn).forEach(t=>{this.notify({type:"removed",mutation:t})}),E(this,Zn).clear(),E(this,vn).clear()})}getAll(){return Array.from(E(this,Zn))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Ph(n,r))}findAll(t={}){return this.getAll().filter(n=>Ph(t,n))}notify(t){ut.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ut.batch(()=>Promise.all(t.map(n=>n.continue().catch(Pt))))}},Zn=new WeakMap,vn=new WeakMap,ca=new WeakMap,Mp);function Ba(e){var t;return(t=e.options.scope)==null?void 0:t.id}function jh(e){return{onFetch:(t,n)=>{var u,d,f,h,g;const r=t.options,i=(f=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,s=((h=t.state.data)==null?void 0:h.pages)||[],o=((g=t.state.data)==null?void 0:g.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{var S;let m=!1;const p=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},b=r0(t.options,t.fetchOptions),v=async(w,x,_)=>{if(m)return Promise.reject();if(x==null&&w.pages.length)return Promise.resolve(w);const A=(()=>{const j={client:t.client,queryKey:t.queryKey,pageParam:x,direction:_?"backward":"forward",meta:t.options.meta};return p(j),j})(),k=await b(A),{maxPages:P}=t.options,$=_?d2:u2;return{pages:$(w.pages,k,P),pageParams:$(w.pageParams,x,P)}};if(i&&s.length){const w=i==="backward",x=w?S2:Dh,_={pages:s,pageParams:o},C=x(r,_);a=await v(_,C,w)}else{const w=e!=null?e:s.length;do{const x=l===0?(S=o[0])!=null?S:r.initialPageParam:Dh(r,a);if(l>0&&x==null)break;a=await v(a,x),l++}while(l<w)}return a};t.options.persister?t.fetchFn=()=>{var m,p;return(p=(m=t.options).persister)==null?void 0:p.call(m,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Dh(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 S2(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var it,wr,Sr,ns,rs,Cr,is,ss,$p,C2=($p=class{constructor(e={}){te(this,it);te(this,wr);te(this,Sr);te(this,ns);te(this,rs);te(this,Cr);te(this,is);te(this,ss);V(this,it,e.queryCache||new v2),V(this,wr,e.mutationCache||new w2),V(this,Sr,e.defaultOptions||{}),V(this,ns,new Map),V(this,rs,new Map),V(this,Cr,0)}mount(){Fa(this,Cr)._++,E(this,Cr)===1&&(V(this,is,lf.subscribe(async e=>{e&&(await this.resumePausedMutations(),E(this,it).onFocus())})),V(this,ss,ks.subscribe(async e=>{e&&(await this.resumePausedMutations(),E(this,it).onOnline())})))}unmount(){var e,t;Fa(this,Cr)._--,E(this,Cr)===0&&((e=E(this,is))==null||e.call(this),V(this,is,void 0),(t=E(this,ss))==null||t.call(this),V(this,ss,void 0))}isFetching(e){return E(this,it).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return E(this,wr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=E(this,it).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=E(this,it).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(jr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return E(this,it).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=E(this,it).get(r.queryHash),s=i==null?void 0:i.state.data,o=l2(t,s);if(o!==void 0)return E(this,it).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return ut.batch(()=>E(this,it).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=E(this,it).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=E(this,it);ut.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=E(this,it);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(()=>E(this,it).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Pt).catch(Pt)}invalidateQueries(e,t={}){return ut.batch(()=>{var n,r;return E(this,it).findAll(e).forEach(i=>{i.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(r=(n=e==null?void 0:e.refetchType)!=null?n:e==null?void 0:e.type)!=null?r:"active"},t)})}refetchQueries(e,t={}){var i;const n={...t,cancelRefetch:(i=t.cancelRefetch)!=null?i:!0},r=ut.batch(()=>E(this,it).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(Pt)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Pt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=E(this,it).build(this,t);return n.isStaleByTime(jr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Pt).catch(Pt)}fetchInfiniteQuery(e){return e.behavior=jh(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Pt).catch(Pt)}ensureInfiniteQueryData(e){return e.behavior=jh(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ks.isOnline()?E(this,wr).resumePausedMutations():Promise.resolve()}getQueryCache(){return E(this,it)}getMutationCache(){return E(this,wr)}getDefaultOptions(){return E(this,Sr)}setDefaultOptions(e){V(this,Sr,e)}setQueryDefaults(e,t){E(this,ns).set(bi(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...E(this,ns).values()],n={};return t.forEach(r=>{Po(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){E(this,rs).set(bi(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...E(this,rs).values()],n={};return t.forEach(r=>{Po(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...E(this,Sr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=af(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===jl&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...E(this,Sr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){E(this,it).clear(),E(this,wr).clear()}},it=new WeakMap,wr=new WeakMap,Sr=new WeakMap,ns=new WeakMap,rs=new WeakMap,Cr=new WeakMap,is=new WeakMap,ss=new WeakMap,$p),Lt,Me,ua,Tt,ci,os,_r,kr,da,as,ls,ui,di,Er,cs,Be,uo,Uu,Ku,Wu,Vu,Gu,Qu,Yu,d0,jp,_2=(jp=class extends js{constructor(t,n){super();te(this,Be);te(this,Lt);te(this,Me);te(this,ua);te(this,Tt);te(this,ci);te(this,os);te(this,_r);te(this,kr);te(this,da);te(this,as);te(this,ls);te(this,ui);te(this,di);te(this,Er);te(this,cs,new Set);this.options=n,V(this,Lt,t),V(this,kr,null),V(this,_r,Hu()),this.options.experimental_prefetchInRender||E(this,_r).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(E(this,Me).addObserver(this),Lh(E(this,Me),this.options)?Oe(this,Be,uo).call(this):this.updateResult(),Oe(this,Be,Vu).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Xu(E(this,Me),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Xu(E(this,Me),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Oe(this,Be,Gu).call(this),Oe(this,Be,Qu).call(this),E(this,Me).removeObserver(this)}setOptions(t){const n=this.options,r=E(this,Me);if(this.options=E(this,Lt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof sn(this.options.enabled,E(this,Me))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Oe(this,Be,Yu).call(this),E(this,Me).setOptions(this.options),n._defaulted&&!$l(this.options,n)&&E(this,Lt).getQueryCache().notify({type:"observerOptionsUpdated",query:E(this,Me),observer:this});const i=this.hasListeners();i&&Ih(E(this,Me),r,this.options,n)&&Oe(this,Be,uo).call(this),this.updateResult(),i&&(E(this,Me)!==r||sn(this.options.enabled,E(this,Me))!==sn(n.enabled,E(this,Me))||jr(this.options.staleTime,E(this,Me))!==jr(n.staleTime,E(this,Me)))&&Oe(this,Be,Uu).call(this);const s=Oe(this,Be,Ku).call(this);i&&(E(this,Me)!==r||sn(this.options.enabled,E(this,Me))!==sn(n.enabled,E(this,Me))||s!==E(this,Er))&&Oe(this,Be,Wu).call(this,s)}getOptimisticResult(t){const n=E(this,Lt).getQueryCache().build(E(this,Lt),t),r=this.createResult(n,t);return E2(this,r)&&(V(this,Tt,r),V(this,os,this.options),V(this,ci,E(this,Me).state)),r}getCurrentResult(){return E(this,Tt)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),Reflect.get(r,i))})}trackProp(t){E(this,cs).add(t)}getCurrentQuery(){return E(this,Me)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=E(this,Lt).defaultQueryOptions(t),r=E(this,Lt).getQueryCache().build(E(this,Lt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){var n;return Oe(this,Be,uo).call(this,{...t,cancelRefetch:(n=t.cancelRefetch)!=null?n:!0}).then(()=>(this.updateResult(),E(this,Tt)))}createResult(t,n){var k;const r=E(this,Me),i=this.options,s=E(this,Tt),o=E(this,ci),a=E(this,os),c=t!==r?t.state:E(this,ua),{state:u}=t;let d={...u},f=!1,h;if(n._optimisticResults){const P=this.hasListeners(),$=!P&&Lh(t,n),j=P&&Ih(t,r,n,i);($||j)&&(d={...d,...c0(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:g,errorUpdatedAt:m,status:p}=d;h=d.data;let b=!1;if(n.placeholderData!==void 0&&h===void 0&&p==="pending"){let P;s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(P=s.data,b=!0):P=typeof n.placeholderData=="function"?n.placeholderData((k=E(this,ls))==null?void 0:k.state.data,E(this,ls)):n.placeholderData,P!==void 0&&(p="success",h=zu(s==null?void 0:s.data,P,n),f=!0)}if(n.select&&h!==void 0&&!b)if(s&&h===(o==null?void 0:o.data)&&n.select===E(this,da))h=E(this,as);else try{V(this,da,n.select),h=n.select(h),h=zu(s==null?void 0:s.data,h,n),V(this,as,h),V(this,kr,null)}catch(P){V(this,kr,P)}E(this,kr)&&(g=E(this,kr),h=E(this,as),m=Date.now(),p="error");const v=d.fetchStatus==="fetching",S=p==="pending",w=p==="error",x=S&&v,_=h!==void 0,A={status:p,fetchStatus:d.fetchStatus,isPending:S,isSuccess:p==="success",isError:w,isInitialLoading:x,isLoading:x,data:h,dataUpdatedAt:d.dataUpdatedAt,error:g,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:v,isRefetching:v&&!S,isLoadingError:w&&!_,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:w&&_,isStale:cf(t,n),refetch:this.refetch,promise:E(this,_r),isEnabled:sn(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const P=Z=>{A.status==="error"?Z.reject(A.error):A.data!==void 0&&Z.resolve(A.data)},$=()=>{const Z=V(this,_r,A.promise=Hu());P(Z)},j=E(this,_r);switch(j.status){case"pending":t.queryHash===r.queryHash&&P(j);break;case"fulfilled":(A.status==="error"||A.data!==j.value)&&$();break;case"rejected":(A.status!=="error"||A.error!==j.reason)&&$();break}}return A}updateResult(){const t=E(this,Tt),n=this.createResult(E(this,Me),this.options);if(V(this,ci,E(this,Me).state),V(this,os,this.options),E(this,ci).data!==void 0&&V(this,ls,E(this,Me)),$l(n,t))return;V(this,Tt,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!E(this,cs).size)return!0;const o=new Set(s!=null?s:E(this,cs));return this.options.throwOnError&&o.add("error"),Object.keys(E(this,Tt)).some(a=>{const l=a;return E(this,Tt)[l]!==t[l]&&o.has(l)})};Oe(this,Be,d0).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Oe(this,Be,Vu).call(this)}},Lt=new WeakMap,Me=new WeakMap,ua=new WeakMap,Tt=new WeakMap,ci=new WeakMap,os=new WeakMap,_r=new WeakMap,kr=new WeakMap,da=new WeakMap,as=new WeakMap,ls=new WeakMap,ui=new WeakMap,di=new WeakMap,Er=new WeakMap,cs=new WeakMap,Be=new WeakSet,uo=function(t){Oe(this,Be,Yu).call(this);let n=E(this,Me).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Pt)),n},Uu=function(){Oe(this,Be,Gu).call(this);const t=jr(this.options.staleTime,E(this,Me));if(pi||E(this,Tt).isStale||!Nu(t))return;const r=n0(E(this,Tt).dataUpdatedAt,t)+1;V(this,ui,setTimeout(()=>{E(this,Tt).isStale||this.updateResult()},r))},Ku=function(){var t;return(t=typeof this.options.refetchInterval=="function"?this.options.refetchInterval(E(this,Me)):this.options.refetchInterval)!=null?t:!1},Wu=function(t){Oe(this,Be,Qu).call(this),V(this,Er,t),!(pi||sn(this.options.enabled,E(this,Me))===!1||!Nu(E(this,Er))||E(this,Er)===0)&&V(this,di,setInterval(()=>{(this.options.refetchIntervalInBackground||lf.isFocused())&&Oe(this,Be,uo).call(this)},E(this,Er)))},Vu=function(){Oe(this,Be,Uu).call(this),Oe(this,Be,Wu).call(this,Oe(this,Be,Ku).call(this))},Gu=function(){E(this,ui)&&(clearTimeout(E(this,ui)),V(this,ui,void 0))},Qu=function(){E(this,di)&&(clearInterval(E(this,di)),V(this,di,void 0))},Yu=function(){const t=E(this,Lt).getQueryCache().build(E(this,Lt),this.options);if(t===E(this,Me))return;const n=E(this,Me);V(this,Me,t),V(this,ua,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},d0=function(t){ut.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(E(this,Tt))}),E(this,Lt).getQueryCache().notify({query:E(this,Me),type:"observerResultsUpdated"})})},jp);function k2(e,t){return sn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Lh(e,t){return k2(e,t)||e.state.data!==void 0&&Xu(e,t,t.refetchOnMount)}function Xu(e,t,n){if(sn(t.enabled,e)!==!1&&jr(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&cf(e,t)}return!1}function Ih(e,t,n,r){return(e!==t||sn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&cf(e,n)}function cf(e,t){return sn(t.enabled,e)!==!1&&e.isStaleByTime(jr(t.staleTime,e))}function E2(e,t){return!$l(e.getCurrentResult(),t)}var Or,Ar,It,er,or,wl,Ju,Dp,O2=(Dp=class extends js{constructor(n,r){super();te(this,or);te(this,Or);te(this,Ar);te(this,It);te(this,er);V(this,Or,n),this.setOptions(r),this.bindMethods(),Oe(this,or,wl).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=E(this,Or).defaultMutationOptions(n),$l(this.options,r)||E(this,Or).getMutationCache().notify({type:"observerOptionsUpdated",mutation:E(this,It),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&bi(r.mutationKey)!==bi(this.options.mutationKey)?this.reset():((i=E(this,It))==null?void 0:i.state.status)==="pending"&&E(this,It).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=E(this,It))==null||n.removeObserver(this)}onMutationUpdate(n){Oe(this,or,wl).call(this),Oe(this,or,Ju).call(this,n)}getCurrentResult(){return E(this,Ar)}reset(){var n;(n=E(this,It))==null||n.removeObserver(this),V(this,It,void 0),Oe(this,or,wl).call(this),Oe(this,or,Ju).call(this)}mutate(n,r){var i;return V(this,er,r),(i=E(this,It))==null||i.removeObserver(this),V(this,It,E(this,Or).getMutationCache().build(E(this,Or),this.options)),E(this,It).addObserver(this),E(this,It).execute(n)}},Or=new WeakMap,Ar=new WeakMap,It=new WeakMap,er=new WeakMap,or=new WeakSet,wl=function(){var r,i;const n=(i=(r=E(this,It))==null?void 0:r.state)!=null?i:u0();V(this,Ar,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Ju=function(n){ut.batch(()=>{var r,i,s,o,a,l,c,u;if(E(this,er)&&this.hasListeners()){const d=E(this,Ar).variables,f=E(this,Ar).context;(n==null?void 0:n.type)==="success"?((i=(r=E(this,er)).onSuccess)==null||i.call(r,n.data,d,f),(o=(s=E(this,er)).onSettled)==null||o.call(s,n.data,null,d,f)):(n==null?void 0:n.type)==="error"&&((l=(a=E(this,er)).onError)==null||l.call(a,n.error,d,f),(u=(c=E(this,er)).onSettled)==null||u.call(c,void 0,n.error,d,f))}this.listeners.forEach(d=>{d(E(this,Ar))})})},Dp),f0=T.createContext(void 0),Ei=e=>{const t=T.useContext(f0);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},A2=({client:e,children:t})=>(T.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(f0.Provider,{value:e,children:t})),h0=T.createContext(!1),T2=()=>T.useContext(h0);h0.Provider;function P2(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var M2=T.createContext(P2()),$2=()=>T.useContext(M2),j2=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},D2=e=>{T.useEffect(()=>{e.clearReset()},[e])},L2=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||i0(n,[e.error,r])),I2=e=>{if(e.suspense){const t=r=>r==="static"?r:Math.max(r!=null?r:1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...r)=>t(n(...r)):t(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},R2=(e,t)=>e.isLoading&&e.isFetching&&!t,F2=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Rh=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function N2(e,t,n){var d,f,h,g,m;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=T2(),i=$2(),s=Ei(n),o=s.defaultQueryOptions(e);(f=(d=s.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||f.call(d,o),process.env.NODE_ENV!=="production"&&(o.queryFn||console.error(`[${o.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`)),o._optimisticResults=r?"isRestoring":"optimistic",I2(o),j2(o,i),D2(i);const a=!s.getQueryCache().get(o.queryHash),[l]=T.useState(()=>new t(s,o)),c=l.getOptimisticResult(o),u=!r&&e.subscribed!==!1;if(T.useSyncExternalStore(T.useCallback(p=>{const b=u?l.subscribe(ut.batchCalls(p)):Pt;return l.updateResult(),b},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),T.useEffect(()=>{l.setOptions(o)},[o,l]),F2(o,c))throw Rh(o,l,i);if(L2({result:c,errorResetBoundary:i,throwOnError:o.throwOnError,query:s.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw c.error;if((g=(h=s.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||g.call(h,o,c),o.experimental_prefetchInRender&&!pi&&R2(c,r)){const p=a?Rh(o,l,i):(m=s.getQueryCache().get(o.queryHash))==null?void 0:m.promise;p==null||p.catch(Pt).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?c:l.trackResult(c)}function Oi(e,t){return N2(e,_2,t)}function Ai(e,t){const n=Ei(t),[r]=T.useState(()=>new O2(n,e));T.useEffect(()=>{r.setOptions(e)},[r,e]);const i=T.useSyncExternalStore(T.useCallback(o=>r.subscribe(ut.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=T.useCallback((o,a)=>{r.mutate(o,a).catch(Pt)},[r]);if(i.error&&i0(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}var Ce={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return Fh(this.context.count)},getNextContextId(){return Fh(this.context.count++)}};function Fh(e){const t=String(e),n=t.length-1;return Ce.context.id+(n?String.fromCharCode(96+n):"")+t}function fo(e){Ce.context=e}var g0=!1,B2=(e,t)=>e===t,Dl=Symbol("solid-proxy"),y0=typeof Proxy=="function",hc=Symbol("solid-track"),Ll={equals:B2},m0=S0,dr=1,Il=2,p0={owned:null,cleanups:null,context:null,owner:null},Yc={},Re=null,Xc=null,q2=null,We=null,_t=null,ir=null,gc=0;function sr(e,t){const n=We,r=Re,i=e.length===0,s=t===void 0?r:t,o=i?p0:{owned:null,cleanups:null,context:s?s.context:null,owner:s},a=i?e:()=>e(()=>tt(()=>Mo(o)));Re=o,We=null;try{return Rn(a,!0)}finally{We=n,Re=r}}function ee(e,t){t=t?Object.assign({},Ll,t):Ll;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=i=>(typeof i=="function"&&(i=i(n.value)),w0(n,i));return[x0.bind(n),r]}function b0(e,t,n){const r=yc(e,t,!0,dr);Ds(r)}function me(e,t,n){const r=yc(e,t,!1,dr);Ds(r)}function pe(e,t,n){m0=J2;const r=yc(e,t,!1,dr);(!n||!n.render)&&(r.user=!0),ir?ir.push(r):Ds(r)}function B(e,t,n){n=n?Object.assign({},Ll,n):Ll;const r=yc(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Ds(r),x0.bind(r)}function z2(e){return e&&typeof e=="object"&&"then"in e}function H2(e,t,n){let r,i,s;r=!0,i=e,s={};let o=null,a=Yc,l=null,c=!1,u="initialValue"in s,d=typeof r=="function"&&B(r);const f=new Set,[h,g]=(s.storage||ee)(s.initialValue),[m,p]=ee(void 0),[b,v]=ee(void 0,{equals:!1}),[S,w]=ee(u?"ready":"unresolved");Ce.context&&(l=Ce.getNextContextId(),s.ssrLoadFrom==="initial"?a=s.initialValue:Ce.load&&Ce.has(l)&&(a=Ce.load(l)));function x(k,P,$,j){return o===k&&(o=null,j!==void 0&&(u=!0),(k===a||P===a)&&s.onHydrated&&queueMicrotask(()=>s.onHydrated(j,{value:P})),a=Yc,_(P,$)),P}function _(k,P){Rn(()=>{P===void 0&&g(()=>k),w(P!==void 0?"errored":u?"ready":"unresolved"),p(P);for(const $ of f.keys())$.decrement();f.clear()},!1)}function C(){const k=Q2,P=h(),$=m();if($!==void 0&&!o)throw $;return We&&We.user,P}function A(k=!0){if(k!==!1&&c)return;c=!1;const P=d?d():r;if(P==null||P===!1){x(o,tt(h));return}const $=a!==Yc?a:tt(()=>i(P,{value:h(),refetching:k}));return z2($)?(o=$,"value"in $?($.status==="success"?x(o,$.value,void 0,P):x(o,void 0,Zu($.value),P),$):(c=!0,queueMicrotask(()=>c=!1),Rn(()=>{w(u?"refreshing":"pending"),v()},!1),$.then(j=>x($,j,void 0,P),j=>x($,void 0,Zu(j),P)))):(x(o,$,void 0,P),$)}return Object.defineProperties(C,{state:{get:()=>S()},error:{get:()=>m()},loading:{get(){const k=S();return k==="pending"||k==="refreshing"}},latest:{get(){if(!u)return C();const k=m();if(k&&!o)throw k;return h()}}}),d?b0(()=>A(!1)):A(!1),[C,{refetch:A,mutate:g}]}function U2(e){return Rn(e,!1)}function tt(e){if(We===null)return e();const t=We;We=null;try{return e()}finally{We=t}}function lr(e,t,n){const r=Array.isArray(e);let i,s=n&&n.defer;return o=>{let a;if(r){a=Array(e.length);for(let c=0;c<e.length;c++)a[c]=e[c]()}else a=e();if(s)return s=!1,o;const l=tt(()=>t(a,i,o));return i=a,l}}function cr(e){pe(()=>tt(e))}function be(e){return Re===null||(Re.cleanups===null?Re.cleanups=[e]:Re.cleanups.push(e)),e}function Nh(){return Re}function K2(e,t){const n=Re,r=We;Re=e,We=null;try{return Rn(t,!0)}catch(i){uf(i)}finally{Re=n,We=r}}function W2(e){const t=We,n=Re;return Promise.resolve().then(()=>{We=t,Re=n;let r;return Rn(e,!1),We=Re=null,r?r.done:void 0})}var[V2,d9]=ee(!1);function G2(){return[V2,W2]}function pt(e,t){const n=Symbol("context");return{id:n,Provider:Z2(n),defaultValue:e}}function bt(e){let t;return Re&&Re.context&&(t=Re.context[e.id])!==void 0?t:e.defaultValue}function v0(e){const t=B(e),n=B(()=>ed(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}var Q2;function x0(){if(this.sources&&this.state)if(this.state===dr)Ds(this);else{const e=_t;_t=null,Rn(()=>Fl(this),!1),_t=e}if(We){const e=this.observers?this.observers.length:0;We.sources?(We.sources.push(this),We.sourceSlots.push(e)):(We.sources=[this],We.sourceSlots=[e]),this.observers?(this.observers.push(We),this.observerSlots.push(We.sources.length-1)):(this.observers=[We],this.observerSlots=[We.sources.length-1])}return this.value}function w0(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Rn(()=>{for(let i=0;i<e.observers.length;i+=1){const s=e.observers[i],o=Xc&&Xc.running;o&&Xc.disposed.has(s),(o?!s.tState:!s.state)&&(s.pure?_t.push(s):ir.push(s),s.observers&&C0(s)),o||(s.state=dr)}if(_t.length>1e6)throw _t=[],new Error},!1)),t}function Ds(e){if(!e.fn)return;Mo(e);const t=gc;Y2(e,e.value,t)}function Y2(e,t,n){let r;const i=Re,s=We;We=Re=e;try{r=e.fn(t)}catch(o){return e.pure&&(e.state=dr,e.owned&&e.owned.forEach(Mo),e.owned=null),e.updatedAt=n+1,uf(o)}finally{We=s,Re=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?w0(e,r):e.value=r,e.updatedAt=n)}function yc(e,t,n,r=dr,i){const s={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Re,context:Re?Re.context:null,pure:n};return Re===null||Re!==p0&&(Re.owned?Re.owned.push(s):Re.owned=[s]),s}function Rl(e){if(e.state===0)return;if(e.state===Il)return Fl(e);if(e.suspense&&tt(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<gc);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===dr)Ds(e);else if(e.state===Il){const r=_t;_t=null,Rn(()=>Fl(e,t[0]),!1),_t=r}}function Rn(e,t){if(_t)return e();let n=!1;t||(_t=[]),ir?n=!0:ir=[],gc++;try{const r=e();return X2(n),r}catch(r){n||(ir=null),_t=null,uf(r)}}function X2(e){if(_t&&(S0(_t),_t=null),e)return;const t=ir;ir=null,t.length&&Rn(()=>m0(t),!1)}function S0(e){for(let t=0;t<e.length;t++)Rl(e[t])}function J2(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Rl(r)}if(Ce.context){if(Ce.count){Ce.effects||(Ce.effects=[]),Ce.effects.push(...e.slice(0,n));return}fo()}for(Ce.effects&&(Ce.done||!Ce.count)&&(e=[...Ce.effects,...e],n+=Ce.effects.length,delete Ce.effects),t=0;t<n;t++)Rl(e[t])}function Fl(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const i=r.state;i===dr?r!==t&&(!r.updatedAt||r.updatedAt<gc)&&Rl(r):i===Il&&Fl(r,t)}}}function C0(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Il,n.pure?_t.push(n):ir.push(n),n.observers&&C0(n))}}function Mo(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),i=n.observers;if(i&&i.length){const s=i.pop(),o=n.observerSlots.pop();r<i.length&&(s.sourceSlots[o]=r,i[r]=s,n.observerSlots[r]=o)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Mo(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Mo(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function Zu(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function uf(e,t=Re){throw Zu(e)}function ed(e){if(typeof e=="function"&&!e.length)return ed(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=ed(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function Z2(e,t){return function(r){let i;return me(()=>i=tt(()=>(Re.context={...Re.context,[e]:r.value},v0(()=>r.children))),void 0),i}}var td=Symbol("fallback");function Nl(e){for(let t=0;t<e.length;t++)e[t]()}function eS(e,t,n={}){let r=[],i=[],s=[],o=0,a=t.length>1?[]:null;return be(()=>Nl(s)),()=>{let l=e()||[],c=l.length,u,d;return l[hc],tt(()=>{let h,g,m,p,b,v,S,w,x;if(c===0)o!==0&&(Nl(s),s=[],r=[],i=[],o=0,a&&(a=[])),n.fallback&&(r=[td],i[0]=sr(_=>(s[0]=_,n.fallback())),o=1);else if(o===0){for(i=new Array(c),d=0;d<c;d++)r[d]=l[d],i[d]=sr(f);o=c}else{for(m=new Array(c),p=new Array(c),a&&(b=new Array(c)),v=0,S=Math.min(o,c);v<S&&r[v]===l[v];v++);for(S=o-1,w=c-1;S>=v&&w>=v&&r[S]===l[w];S--,w--)m[w]=i[S],p[w]=s[S],a&&(b[w]=a[S]);for(h=new Map,g=new Array(w+1),d=w;d>=v;d--)x=l[d],u=h.get(x),g[d]=u===void 0?-1:u,h.set(x,d);for(u=v;u<=S;u++)x=r[u],d=h.get(x),d!==void 0&&d!==-1?(m[d]=i[u],p[d]=s[u],a&&(b[d]=a[u]),d=g[d],h.set(x,d)):s[u]();for(d=v;d<c;d++)d in m?(i[d]=m[d],s[d]=p[d],a&&(a[d]=b[d],a[d](d))):i[d]=sr(f);i=i.slice(0,o=c),r=l.slice(0)}return i});function f(h){if(s[d]=h,a){const[g,m]=ee(d);return a[d]=m,t(l[d],g)}return t(l[d])}}}function tS(e,t,n={}){let r=[],i=[],s=[],o=[],a=0,l;return be(()=>Nl(s)),()=>{const c=e()||[],u=c.length;return c[hc],tt(()=>{if(u===0)return a!==0&&(Nl(s),s=[],r=[],i=[],a=0,o=[]),n.fallback&&(r=[td],i[0]=sr(f=>(s[0]=f,n.fallback())),a=1),i;for(r[0]===td&&(s[0](),s=[],r=[],i=[],a=0),l=0;l<u;l++)l<r.length&&r[l]!==c[l]?o[l](()=>c[l]):l>=r.length&&(i[l]=sr(d));for(;l<r.length;l++)s[l]();return a=o.length=s.length=u,r=c.slice(0),i=i.slice(0,a)});function d(f){s[l]=f;const[h,g]=ee(c[l]);return o[l]=g,t(h,l)}}}function M(e,t){return tt(()=>e(t||{}))}function qa(){return!0}var nd={get(e,t,n){return t===Dl?n:e.get(t)},has(e,t){return t===Dl?!0:e.has(t)},set:qa,deleteProperty:qa,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:qa,deleteProperty:qa}},ownKeys(e){return e.keys()}};function Jc(e){return(e=typeof e=="function"?e():e)?e:{}}function nS(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function _e(...e){let t=!1;for(let o=0;o<e.length;o++){const a=e[o];t=t||!!a&&Dl in a,e[o]=typeof a=="function"?(t=!0,B(a)):a}if(y0&&t)return new Proxy({get(o){for(let a=e.length-1;a>=0;a--){const l=Jc(e[a])[o];if(l!==void 0)return l}},has(o){for(let a=e.length-1;a>=0;a--)if(o in Jc(e[a]))return!0;return!1},keys(){const o=[];for(let a=0;a<e.length;a++)o.push(...Object.keys(Jc(e[a])));return[...new Set(o)]}},nd);const n={},r=Object.create(null);for(let o=e.length-1;o>=0;o--){const a=e[o];if(!a)continue;const l=Object.getOwnPropertyNames(a);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u==="__proto__"||u==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,u);if(!r[u])r[u]=d.get?{enumerable:!0,configurable:!0,get:nS.bind(n[u]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const f=n[u];f&&(d.get?f.push(d.get.bind(a)):d.value!==void 0&&f.push(()=>d.value))}}}const i={},s=Object.keys(r);for(let o=s.length-1;o>=0;o--){const a=s[o],l=r[a];l&&l.get?Object.defineProperty(i,a,l):i[a]=l?l.value:void 0}return i}function qe(e,...t){if(y0&&Dl in e){const i=new Set(t.length>1?t.flat():t[0]),s=t.map(o=>new Proxy({get(a){return o.includes(a)?e[a]:void 0},has(a){return o.includes(a)&&a in e},keys(){return o.filter(a=>a in e)}},nd));return s.push(new Proxy({get(o){return i.has(o)?void 0:e[o]},has(o){return i.has(o)?!1:o in e},keys(){return Object.keys(e).filter(o=>!i.has(o))}},nd)),s}const n={},r=t.map(()=>({}));for(const i of Object.getOwnPropertyNames(e)){const s=Object.getOwnPropertyDescriptor(e,i),o=!s.get&&!s.set&&s.enumerable&&s.writable&&s.configurable;let a=!1,l=0;for(const c of t)c.includes(i)&&(a=!0,o?r[l][i]=s.value:Object.defineProperty(r[l],i,s)),++l;a||(o?n[i]=s.value:Object.defineProperty(n,i,s))}return[...r,n]}function _0(e){let t,n;const r=i=>{const s=Ce.context;if(s){const[a,l]=ee();Ce.count||(Ce.count=0),Ce.count++,(n||(n=e())).then(c=>{!Ce.done&&fo(s),Ce.count--,l(()=>c.default),fo()}),t=a}else if(!t){const[a]=H2(()=>(n||(n=e())).then(l=>l.default));t=a}let o;return B(()=>(o=t())?tt(()=>{if(!s||Ce.done)return o(i);const a=Ce.context;fo(s);const l=o(i);return fo(a),l}):"")};return r.preload=()=>n||((n=e()).then(i=>t=()=>i.default),n),r}var rS=0;function fn(){return Ce.context?Ce.getNextContextId():`cl-${rS++}`}var k0=e=>`Stale read from <${e}>.`;function iS(e){const t="fallback"in e&&{fallback:()=>e.fallback};return B(eS(()=>e.each,e.children,t||void 0))}function sS(e){const t="fallback"in e&&{fallback:()=>e.fallback};return B(tS(()=>e.each,e.children,t||void 0))}function ye(e){const t=e.keyed,n=B(()=>e.when,void 0,void 0),r=t?n:B(n,void 0,{equals:(i,s)=>!i==!s});return B(()=>{const i=r();if(i){const s=e.children;return typeof s=="function"&&s.length>0?tt(()=>s(t?i:()=>{if(!tt(r))throw k0("Show");return n()})):s}return e.fallback},void 0,void 0)}function oS(e){const t=v0(()=>e.children),n=B(()=>{const r=t(),i=Array.isArray(r)?r:[r];let s=()=>{};for(let o=0;o<i.length;o++){const a=o,l=i[o],c=s,u=B(()=>c()?void 0:l.when,void 0,void 0),d=l.keyed?u:B(u,void 0,{equals:(f,h)=>!f==!h});s=()=>c()||(d()?[a,u,l]:void 0)}return s});return B(()=>{const r=n()();if(!r)return e.fallback;const[i,s,o]=r,a=o.children;return typeof a=="function"&&a.length>0?tt(()=>a(o.keyed?s():()=>{var c;if(((c=tt(n)())==null?void 0:c[0])!==i)throw k0("Match");return s()})):a},void 0,void 0)}function Zc(e){return e}var aS=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],lS=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...aS]),cS=new Set(["innerHTML","textContent","innerText","children"]),uS=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),dS=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function fS(e,t){const n=dS[e];return typeof n=="object"?n[t]?n.$:void 0:n}var hS=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),gS=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),yS={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function mS(e,t,n){let r=n.length,i=t.length,s=r,o=0,a=0,l=t[i-1].nextSibling,c=null;for(;o<i||a<s;){if(t[o]===n[a]){o++,a++;continue}for(;t[i-1]===n[s-1];)i--,s--;if(i===o){const u=s<r?a?n[a-1].nextSibling:n[s-a]:l;for(;a<s;)e.insertBefore(n[a++],u)}else if(s===a)for(;o<i;)(!c||!c.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[s-1]&&n[a]===t[i-1]){const u=t[--i].nextSibling;e.insertBefore(n[a++],t[o++].nextSibling),e.insertBefore(n[--s],u),t[i]=n[s]}else{if(!c){c=new Map;let d=a;for(;d<s;)c.set(n[d],d++)}const u=c.get(t[o]);if(u!=null)if(a<u&&u<s){let d=o,f=1,h;for(;++d<i&&d<s&&!((h=c.get(t[d]))==null||h!==u+f);)f++;if(f>u-a){const g=t[o];for(;a<u;)e.insertBefore(n[a++],g)}else e.replaceChild(n[a++],t[o++])}else o++;else t[o++].remove()}}}var wo="_$DX_DELEGATE";function E0(e,t,n,r={}){let i;return sr(s=>{i=s,t===document?e():H(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=""}}function oe(e,t,n,r){let i;const s=()=>{const a=document.createElement("template");return a.innerHTML=e,a.content.firstChild},o=()=>(i||(i=s())).cloneNode(!0);return o.cloneNode=o,o}function mc(e,t=window.document){const n=t[wo]||(t[wo]=new Set);for(let r=0,i=e.length;r<i;r++){const s=e[r];n.has(s)||(n.add(s),t.addEventListener(s,T0))}}function pS(e=window.document){if(e[wo]){for(let t of e[wo].keys())e.removeEventListener(t,T0);delete e[wo]}}function G(e,t,n){Ti(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function bS(e,t,n,r){Ti(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function vS(e,t,n){Ti(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function Q(e,t){Ti(e)||(t==null?e.removeAttribute("class"):e.className=t)}function O0(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const i=n[0];e.addEventListener(t,n[0]=s=>i.call(e,n[1],s))}else e.addEventListener(t,n,typeof n!="function"&&n)}function xS(e,t,n={}){const r=Object.keys(t||{}),i=Object.keys(n);let s,o;for(s=0,o=i.length;s<o;s++){const a=i[s];!a||a==="undefined"||t[a]||(Bh(e,a,!1),delete n[a])}for(s=0,o=r.length;s<o;s++){const a=r[s],l=!!t[a];!a||a==="undefined"||n[a]===l||!l||(Bh(e,a,!0),n[a]=l)}return n}function wS(e,t,n){if(!t)return n?G(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let i,s;for(s in n)t[s]==null&&r.removeProperty(s),delete n[s];for(s in t)i=t[s],i!==n[s]&&(r.setProperty(s,i),n[s]=i);return n}function A0(e,t={},n,r){const i={};return r||me(()=>i.children=$o(e,t.children,i.children)),me(()=>typeof t.ref=="function"&&Ls(t.ref,e)),me(()=>SS(e,t,n,!0,i,!0)),i}function Ls(e,t,n){return tt(()=>e(t,n))}function H(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return $o(e,t,r,n);me(i=>$o(e,t(),i,n),r)}function SS(e,t,n,r,i={},s=!1){t||(t={});for(const o in i)if(!(o in t)){if(o==="children")continue;i[o]=qh(e,o,null,i[o],n,s,t)}for(const o in t){if(o==="children")continue;const a=t[o];i[o]=qh(e,o,a,i[o],n,s,t)}}function CS(e){let t,n;return!Ti()||!(t=Ce.registry.get(n=kS()))?e():(Ce.completed&&Ce.completed.add(t),Ce.registry.delete(n),t)}function Ti(e){return!!Ce.context&&!Ce.done&&(!e||e.isConnected)}function _S(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Bh(e,t,n){const r=t.trim().split(/\s+/);for(let i=0,s=r.length;i<s;i++)e.classList.toggle(r[i],n)}function qh(e,t,n,r,i,s,o){let a,l,c,u,d;if(t==="style")return wS(e,n,r);if(t==="classList")return xS(e,n,r);if(n===r)return r;if(t==="ref")s||n(e);else if(t.slice(0,3)==="on:"){const f=t.slice(3);r&&e.removeEventListener(f,r,typeof r!="function"&&r),n&&e.addEventListener(f,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const f=t.slice(10);r&&e.removeEventListener(f,r,!0),n&&e.addEventListener(f,n,!0)}else if(t.slice(0,2)==="on"){const f=t.slice(2).toLowerCase(),h=hS.has(f);if(!h&&r){const g=Array.isArray(r)?r[0]:r;e.removeEventListener(f,g)}(h||n)&&(O0(e,f,n,h),h&&mc([f]))}else if(t.slice(0,5)==="attr:")G(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")vS(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(c=cS.has(t))||!i&&((u=fS(t,e.tagName))||(l=lS.has(t)))||(a=e.nodeName.includes("-")||"is"in o)){if(d)t=t.slice(5),l=!0;else if(Ti(e))return n;t==="class"||t==="className"?Q(e,n):a&&!l&&!c?e[_S(t)]=n:e[u||t]=n}else{const f=i&&t.indexOf(":")>-1&&yS[t.split(":")[0]];f?bS(e,f,t,n):G(e,uS[t]||t,n)}return n}function T0(e){if(Ce.registry&&Ce.events&&Ce.events.find(([l,c])=>c===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,i=e.currentTarget,s=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),o=()=>{const l=t[n];if(l&&!t.disabled){const c=t[`${n}Data`];if(c!==void 0?l.call(t,c,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&s(t.host),!0},a=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),Ce.registry&&!Ce.done&&(Ce.done=_$HY.done=!0),e.composedPath){const l=e.composedPath();s(l[0]);for(let c=0;c<l.length-2&&(t=l[c],!!o());c++){if(t._$host){t=t._$host,a();break}if(t.parentNode===i)break}}else a();s(r)}function $o(e,t,n,r,i){const s=Ti(e);if(s){!n&&(n=[...e.childNodes]);let l=[];for(let c=0;c<n.length;c++){const u=n[c];u.nodeType===8&&u.data.slice(0,2)==="!$"?u.remove():l.push(u)}n=l}for(;typeof n=="function";)n=n();if(t===n)return n;const o=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,o==="string"||o==="number"){if(s||o==="number"&&(t=t.toString(),t===n))return n;if(a){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=Di(e,n,r,l)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||o==="boolean"){if(s)return n;n=Di(e,n,r)}else{if(o==="function")return me(()=>{let l=t();for(;typeof l=="function";)l=l();n=$o(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],c=n&&Array.isArray(n);if(rd(l,t,n,i))return me(()=>n=$o(e,l,n,r,!0)),()=>n;if(s){if(!l.length)return n;if(r===void 0)return n=[...e.childNodes];let u=l[0];if(u.parentNode!==e)return n;const d=[u];for(;(u=u.nextSibling)!==r;)d.push(u);return n=d}if(l.length===0){if(n=Di(e,n,r),a)return n}else c?n.length===0?zh(e,l,r):mS(e,n,l):(n&&Di(e),zh(e,l));n=l}else if(t.nodeType){if(s&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=Di(e,n,r,t);Di(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function rd(e,t,n,r){let i=!1;for(let s=0,o=t.length;s<o;s++){let a=t[s],l=n&&n[e.length],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))i=rd(e,a,l)||i;else if(c==="function")if(r){for(;typeof a=="function";)a=a();i=rd(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||i}else e.push(a),i=!0;else{const u=String(a);l&&l.nodeType===3&&l.data===u?e.push(l):e.push(document.createTextNode(u))}}return i}function zh(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function Di(e,t,n,r){if(n===void 0)return e.textContent="";const i=r||document.createTextNode("");if(t.length){let s=!1;for(let o=t.length-1;o>=0;o--){const a=t[o];if(i!==a){const l=a.parentNode===e;!s&&!o?l?e.replaceChild(i,a):e.insertBefore(i,n):l&&a.remove()}else s=!0}}else e.insertBefore(i,n);return[i]}function kS(){return Ce.getNextContextId()}var ES="http://www.w3.org/2000/svg";function P0(e,t=!1){return t?document.createElementNS(ES,e):document.createElement(e)}function M0(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,i=Nh();let s,o=!!Ce.context;return pe(()=>{o&&(Nh().user=o=!1),s||(s=K2(i,()=>B(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=ee(!1),u=()=>c(!0);sr(d=>H(a,()=>l()?d():s(),null)),be(u)}else{const l=P0(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),H(c,s),a.appendChild(l),e.ref&&e.ref(l),be(()=>a.removeChild(l))}},void 0,{render:!o}),n}function OS(e,t){const n=B(e);return B(()=>{const r=n();switch(typeof r){case"function":return tt(()=>r(t));case"string":const i=gS.has(r),s=Ce.context?CS():P0(r,i);return A0(s,t,i),s}})}function AS(e){const[,t]=qe(e,["component"]);return OS(()=>e.component,t)}var TS=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},$0=class{constructor(t){this.generateIdentifier=t,this.kv=new TS}register(t,n){this.kv.getByValue(t)||(n||(n=this.generateIdentifier(t)),this.kv.set(n,t))}clear(){this.kv.clear()}getIdentifier(t){return this.kv.getByValue(t)}getValue(t){return this.kv.getByKey(t)}},PS=class extends $0{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){typeof t=="object"?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}};function MS(e){if("values"in Object)return Object.values(e);const t=[];for(const n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function $S(e,t){const n=MS(e);if("find"in n)return n.find(t);const r=n;for(let i=0;i<r.length;i++){const s=r[i];if(t(s))return s}}function Es(e,t){Object.entries(e).forEach(([n,r])=>t(r,n))}function Sl(e,t){return e.indexOf(t)!==-1}function Hh(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(t(r))return r}}var jS=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return $S(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},DS=e=>Object.prototype.toString.call(e).slice(8,-1),j0=e=>typeof e=="undefined",LS=e=>e===null,jo=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,id=e=>jo(e)&&Object.keys(e).length===0,Ir=e=>Array.isArray(e),IS=e=>typeof e=="string",RS=e=>typeof e=="number"&&!isNaN(e),FS=e=>typeof e=="boolean",NS=e=>e instanceof RegExp,Do=e=>e instanceof Map,Lo=e=>e instanceof Set,D0=e=>DS(e)==="Symbol",BS=e=>e instanceof Date&&!isNaN(e.valueOf()),qS=e=>e instanceof Error,Uh=e=>typeof e=="number"&&isNaN(e),zS=e=>FS(e)||LS(e)||j0(e)||RS(e)||IS(e)||D0(e),HS=e=>typeof e=="bigint",US=e=>e===1/0||e===-1/0,KS=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),WS=e=>e instanceof URL,L0=e=>e.replace(/\./g,"\\."),eu=e=>e.map(String).map(L0).join("."),So=e=>{const t=[];let n="";for(let i=0;i<e.length;i++){let s=e.charAt(i);if(s==="\\"&&e.charAt(i+1)==="."){n+=".",i++;continue}if(s==="."){t.push(n),n="";continue}n+=s}const r=n;return t.push(r),t};function kn(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var I0=[kn(j0,"undefined",()=>null,()=>{}),kn(HS,"bigint",e=>e.toString(),e=>typeof BigInt!="undefined"?BigInt(e):e),kn(BS,"Date",e=>e.toISOString(),e=>new Date(e)),kn(qS,"Error",(e,t)=>{const n={name:e.name,message:e.message};return t.allowedErrorProps.forEach(r=>{n[r]=e[r]}),n},(e,t)=>{const n=new Error(e.message);return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(r=>{n[r]=e[r]}),n}),kn(NS,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),kn(Lo,"set",e=>[...e.values()],e=>new Set(e)),kn(Do,"map",e=>[...e.entries()],e=>new Map(e)),kn(e=>Uh(e)||US(e),"number",e=>Uh(e)?"NaN":e>0?"Infinity":"-Infinity",Number),kn(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),kn(WS,"URL",e=>e.toString(),e=>new URL(e))];function pc(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var R0=pc((e,t)=>D0(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{const r=n.symbolRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown symbol");return r}),VS=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),F0=pc(KS,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=VS[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function N0(e,t){return e!=null&&e.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var B0=pc(N0,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{const n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};const r={};return n.forEach(i=>{r[i]=e[i]}),r},(e,t,n)=>{const r=n.classRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");return Object.assign(Object.create(r.prototype),e)}),q0=pc((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{const r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw new Error("Trying to deserialize unknown custom value");return r.deserialize(e)}),GS=[B0,R0,q0,F0],Kh=(e,t)=>{const n=Hh(GS,i=>i.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const r=Hh(I0,i=>i.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},z0={};I0.forEach(e=>{z0[e.annotation]=e});var QS=(e,t,n)=>{if(Ir(t))switch(t[0]){case"symbol":return R0.untransform(e,t,n);case"class":return B0.untransform(e,t,n);case"custom":return q0.untransform(e,t,n);case"typed-array":return F0.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const r=z0[t];if(!r)throw new Error("Unknown transformation: "+t);return r.untransform(e,n)}},Ui=(e,t)=>{const n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function H0(e){if(Sl(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(Sl(e,"prototype"))throw new Error("prototype is not allowed as a property");if(Sl(e,"constructor"))throw new Error("constructor is not allowed as a property")}var YS=(e,t)=>{H0(t);for(let n=0;n<t.length;n++){const r=t[n];if(Lo(e))e=Ui(e,+r);else if(Do(e)){const i=+r,s=+t[++n]==0?"key":"value",o=Ui(e,i);switch(s){case"key":e=o;break;case"value":e=e.get(o);break}}else e=e[r]}return e},sd=(e,t,n)=>{if(H0(t),t.length===0)return n(e);let r=e;for(let s=0;s<t.length-1;s++){const o=t[s];if(Ir(r)){const a=+o;r=r[a]}else if(jo(r))r=r[o];else if(Lo(r)){const a=+o;r=Ui(r,a)}else if(Do(r)){if(s===t.length-2)break;const l=+o,c=+t[++s]==0?"key":"value",u=Ui(r,l);switch(c){case"key":r=u;break;case"value":r=r.get(u);break}}}const i=t[t.length-1];if(Ir(r)?r[+i]=n(r[+i]):jo(r)&&(r[i]=n(r[i])),Lo(r)){const s=Ui(r,+i),o=n(s);s!==o&&(r.delete(s),r.add(o))}if(Do(r)){const s=+t[t.length-2],o=Ui(r,s);switch(+i==0?"key":"value"){case"key":{const l=n(o);r.set(l,r.get(o)),l!==o&&r.delete(o);break}case"value":{r.set(o,n(r.get(o)));break}}}return e};function od(e,t,n=[]){if(!e)return;if(!Ir(e)){Es(e,(s,o)=>od(s,t,[...n,...So(o)]));return}const[r,i]=e;i&&Es(i,(s,o)=>{od(s,t,[...n,...So(o)])}),t(r,n)}function XS(e,t,n){return od(t,(r,i)=>{e=sd(e,i,s=>QS(s,r,n))}),e}function JS(e,t){function n(r,i){const s=YS(e,So(i));r.map(So).forEach(o=>{e=sd(e,o,()=>s)})}if(Ir(t)){const[r,i]=t;r.forEach(s=>{e=sd(e,So(s),()=>e)}),i&&Es(i,n)}else Es(t,n);return e}var ZS=(e,t)=>jo(e)||Ir(e)||Do(e)||Lo(e)||N0(e,t);function eC(e,t,n){const r=n.get(e);r?r.push(t):n.set(e,[t])}function tC(e,t){const n={};let r;return e.forEach(i=>{if(i.length<=1)return;t||(i=i.map(a=>a.map(String)).sort((a,l)=>a.length-l.length));const[s,...o]=i;s.length===0?r=o.map(eu):n[eu(s)]=o.map(eu)}),r?id(n)?[r]:[r,n]:id(n)?void 0:n}var U0=(e,t,n,r,i=[],s=[],o=new Map)=>{var h;const a=zS(e);if(!a){eC(e,i,t);const g=o.get(e);if(g)return r?{transformedValue:null}:g}if(!ZS(e,n)){const g=Kh(e,n),m=g?{transformedValue:g.value,annotations:[g.type]}:{transformedValue:e};return a||o.set(e,m),m}if(Sl(s,e))return{transformedValue:null};const l=Kh(e,n),c=(h=l==null?void 0:l.value)!=null?h:e,u=Ir(c)?[]:{},d={};Es(c,(g,m)=>{if(m==="__proto__"||m==="constructor"||m==="prototype")throw new Error(`Detected property ${m}. This is a prototype pollution risk, please remove it from your object.`);const p=U0(g,t,n,r,[...i,m],[...s,e],o);u[m]=p.transformedValue,Ir(p.annotations)?d[m]=p.annotations:jo(p.annotations)&&Es(p.annotations,(b,v)=>{d[L0(m)+"."+v]=b})});const f=id(d)?{transformedValue:u,annotations:l?[l.type]:void 0}:{transformedValue:u,annotations:l?[l.type,d]:d};return a||o.set(e,f),f};function K0(e){return Object.prototype.toString.call(e).slice(8,-1)}function Wh(e){return K0(e)==="Array"}function nC(e){if(K0(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function rC(e,t,n,r,i){const s={}.propertyIsEnumerable.call(r,t)?"enumerable":"nonenumerable";s==="enumerable"&&(e[t]=n),i&&s==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function ad(e,t={}){if(Wh(e))return e.map(i=>ad(i,t));if(!nC(e))return e;const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((i,s)=>{if(Wh(t.props)&&!t.props.includes(s))return i;const o=e[s],a=ad(o,t);return rC(i,s,a,e,t.nonenumerable),i},{})}var Ve=class{constructor({dedupe:e=!1}={}){this.classRegistry=new PS,this.symbolRegistry=new $0(t=>{var n;return(n=t.description)!=null?n:""}),this.customTransformerRegistry=new jS,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const t=new Map,n=U0(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});const i=tC(t,this.dedupe);return i&&(r.meta={...r.meta,referentialEqualities:i}),r}deserialize(e){const{json:t,meta:n}=e;let r=ad(t);return n!=null&&n.values&&(r=XS(r,n.values,this)),n!=null&&n.referentialEqualities&&(r=JS(r,n.referentialEqualities)),r}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e))}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};Ve.defaultInstance=new Ve;Ve.serialize=Ve.defaultInstance.serialize.bind(Ve.defaultInstance);Ve.deserialize=Ve.defaultInstance.deserialize.bind(Ve.defaultInstance);Ve.stringify=Ve.defaultInstance.stringify.bind(Ve.defaultInstance);Ve.parse=Ve.defaultInstance.parse.bind(Ve.defaultInstance);Ve.registerClass=Ve.defaultInstance.registerClass.bind(Ve.defaultInstance);Ve.registerSymbol=Ve.defaultInstance.registerSymbol.bind(Ve.defaultInstance);Ve.registerCustom=Ve.defaultInstance.registerCustom.bind(Ve.defaultInstance);Ve.allowErrorProps=Ve.defaultInstance.allowErrorProps.bind(Ve.defaultInstance);var W0=Ve.serialize,iC=Ve.stringify;function Bi(e){return e.state.fetchStatus==="fetching"?"fetching":e.getObserversCount()?e.state.fetchStatus==="paused"?"paused":e.isStale()?"stale":"fresh":"inactive"}function sC(e,t){return`${e}${t.charAt(0).toUpperCase()+t.slice(1)}`}function oC({queryState:e,observerCount:t,isStale:n}){return e.fetchStatus==="fetching"?"blue":t?e.fetchStatus==="paused"?"purple":n?"yellow":"green":"gray"}function Ki({status:e,isPaused:t}){return t?"purple":e==="error"?"red":e==="pending"?"yellow":e==="success"?"green":"gray"}function aC(e){return e==="fresh"?"green":e==="stale"?"yellow":e==="paused"?"purple":e==="inactive"?"gray":"blue"}var Bl=(e,t=!1)=>{const{json:n}=W0(e);return JSON.stringify(n,null,t?2:void 0)},za=e=>e.state.fetchStatus!=="idle"?0:e.getObserversCount()?e.isStale()?2:1:3,lC=(e,t)=>e.queryHash.localeCompare(t.queryHash),V0=(e,t)=>e.state.dataUpdatedAt<t.state.dataUpdatedAt?1:-1,cC=(e,t)=>za(e)===za(t)?V0(e,t):za(e)>za(t)?1:-1,ld={status:cC,"query hash":lC,"last updated":V0},Ha=e=>e.state.isPaused?0:e.state.status==="error"?2:e.state.status==="pending"?1:3,G0=(e,t)=>e.state.submittedAt<t.state.submittedAt?1:-1,uC=(e,t)=>Ha(e)===Ha(t)?G0(e,t):Ha(e)>Ha(t)?1:-1,cd={status:uC,"last updated":G0},Vh=e=>e*parseFloat(getComputedStyle(document.documentElement).fontSize),Q0=()=>{const[e,t]=ee("dark");return cr(()=>{const n=window.matchMedia("(prefers-color-scheme: dark)");t(n.matches?"dark":"light");const r=i=>{t(i.matches?"dark":"light")};n.addEventListener("change",r),be(()=>n.removeEventListener("change",r))}),e},ei=(e,t,n)=>{if(t.length===0)return n;if(e instanceof Map){const r=new Map(e);if(t.length===1)return r.set(t[0],n),r;const[i,...s]=t;return r.set(i,ei(r.get(i),s,n)),r}if(e instanceof Set){const r=ei(Array.from(e),t,n);return new Set(r)}if(Array.isArray(e)){const r=[...e];if(t.length===1)return r[t[0]]=n,r;const[i,...s]=t;return r[i]=ei(r[i],s,n),r}if(e instanceof Object){const r={...e};if(t.length===1)return r[t[0]]=n,r;const[i,...s]=t;return r[i]=ei(r[i],s,n),r}return e},ho=(e,t)=>{if(e instanceof Map){const n=new Map(e);if(t.length===1)return n.delete(t[0]),n;const[r,...i]=t;return n.set(r,ho(n.get(r),i)),n}if(e instanceof Set){const n=ho(Array.from(e),t);return new Set(n)}if(Array.isArray(e)){const n=[...e];if(t.length===1)return n.filter((s,o)=>o.toString()!==t[0]);const[r,...i]=t;return n[r]=ho(n[r],i),n}if(e instanceof Object){const n={...e};if(t.length===1)return delete n[t[0]],n;const[r,...i]=t;return n[r]=ho(n[r],i),n}return e},Y0=(e,t)=>{if(!e||document.querySelector("#_goober")||(t==null?void 0:t.querySelector("#_goober")))return;const r=document.createElement("style"),i=document.createTextNode("");r.appendChild(i),r.id="_goober",r.setAttribute("nonce",e),t?t.appendChild(r):document.head.appendChild(r)},us,fa,ha,ga,fi,ya,ds,fs,hs,gs,ys,ms,ma,Lp,dC=(Lp=class{constructor(e){te(this,us);te(this,fa);te(this,ha);te(this,ga);te(this,fi,!1);te(this,ya);te(this,ds);te(this,fs);te(this,hs);te(this,gs);te(this,ys);te(this,ms);te(this,ma);const{client:t,queryFlavor:n,version:r,onlineManager:i,buttonPosition:s,position:o,initialIsOpen:a,errorTypes:l,styleNonce:c,shadowDOMTarget:u}=e;V(this,us,ee(t)),V(this,ha,n),V(this,ga,r),V(this,fa,i),V(this,ya,c),V(this,ds,u),V(this,fs,ee(s)),V(this,hs,ee(o)),V(this,gs,ee(a)),V(this,ys,ee(l))}setButtonPosition(e){E(this,fs)[1](e)}setPosition(e){E(this,hs)[1](e)}setInitialIsOpen(e){E(this,gs)[1](e)}setErrorTypes(e){E(this,ys)[1](e)}setClient(e){E(this,us)[1](e)}mount(e){if(E(this,fi))throw new Error("Devtools is already mounted");const t=E0(()=>{const n=this,[r]=E(this,fs),[i]=E(this,hs),[s]=E(this,gs),[o]=E(this,ys),[a]=E(this,us);let l;return E(this,ms)?l=E(this,ms):(l=_0(()=>Promise.resolve().then(()=>QI)),V(this,ms,l)),Y0(E(this,ya),E(this,ds)),M(l,_e({get queryFlavor(){return E(n,ha)},get version(){return E(n,ga)},get onlineManager(){return E(n,fa)},get shadowDOMTarget(){return E(n,ds)}},{get client(){return a()},get buttonPosition(){return r()},get position(){return i()},get initialIsOpen(){return s()},get errorTypes(){return o()}}))},e);V(this,fi,!0),V(this,ma,t)}unmount(){var e;if(!E(this,fi))throw new Error("Devtools is not mounted");(e=E(this,ma))==null||e.call(this),V(this,fi,!1)}},us=new WeakMap,fa=new WeakMap,ha=new WeakMap,ga=new WeakMap,fi=new WeakMap,ya=new WeakMap,ds=new WeakMap,fs=new WeakMap,hs=new WeakMap,gs=new WeakMap,ys=new WeakMap,ms=new WeakMap,ma=new WeakMap,Lp),ps,pa,ba,va,hi,xa,bs,vs,xs,ws,Ss,Cs,_s,wa,Ip,fC=(Ip=class{constructor(e){te(this,ps);te(this,pa);te(this,ba);te(this,va);te(this,hi,!1);te(this,xa);te(this,bs);te(this,vs);te(this,xs);te(this,ws);te(this,Ss);te(this,Cs);te(this,_s);te(this,wa);const{client:t,queryFlavor:n,version:r,onlineManager:i,buttonPosition:s,position:o,initialIsOpen:a,errorTypes:l,styleNonce:c,shadowDOMTarget:u,onClose:d}=e;V(this,ps,ee(t)),V(this,ba,n),V(this,va,r),V(this,pa,i),V(this,xa,c),V(this,bs,u),V(this,vs,ee(s)),V(this,xs,ee(o)),V(this,ws,ee(a)),V(this,Ss,ee(l)),V(this,Cs,ee(d))}setButtonPosition(e){E(this,vs)[1](e)}setPosition(e){E(this,xs)[1](e)}setInitialIsOpen(e){E(this,ws)[1](e)}setErrorTypes(e){E(this,Ss)[1](e)}setClient(e){E(this,ps)[1](e)}setOnClose(e){E(this,Cs)[1](()=>e)}mount(e){if(E(this,hi))throw new Error("Devtools is already mounted");const t=E0(()=>{const n=this,[r]=E(this,vs),[i]=E(this,xs),[s]=E(this,ws),[o]=E(this,Ss),[a]=E(this,ps),[l]=E(this,Cs);let c;return E(this,_s)?c=E(this,_s):(c=_0(()=>Promise.resolve().then(()=>JI)),V(this,_s,c)),Y0(E(this,xa),E(this,bs)),M(c,_e({get queryFlavor(){return E(n,ba)},get version(){return E(n,va)},get onlineManager(){return E(n,pa)},get shadowDOMTarget(){return E(n,bs)}},{get client(){return a()},get buttonPosition(){return r()},get position(){return i()},get initialIsOpen(){return s()},get errorTypes(){return o()},get onClose(){return l()}}))},e);V(this,hi,!0),V(this,wa,t)}unmount(){var e;if(!E(this,hi))throw new Error("Devtools is not mounted");(e=E(this,wa))==null||e.call(this),V(this,hi,!1)}},ps=new WeakMap,pa=new WeakMap,ba=new WeakMap,va=new WeakMap,hi=new WeakMap,xa=new WeakMap,bs=new WeakMap,vs=new WeakMap,xs=new WeakMap,ws=new WeakMap,Ss=new WeakMap,Cs=new WeakMap,_s=new WeakMap,wa=new WeakMap,Ip);function hC(e){const t=Ei(e.client),n=T.useRef(null),{buttonPosition:r,position:i,initialIsOpen:s,errorTypes:o,styleNonce:a,shadowDOMTarget:l}=e,[c]=T.useState(new dC({client:t,queryFlavor:"React Query",version:"5",onlineManager:ks,buttonPosition:r,position:i,initialIsOpen:s,errorTypes:o,styleNonce:a,shadowDOMTarget:l}));return T.useEffect(()=>{c.setClient(t)},[t,c]),T.useEffect(()=>{r&&c.setButtonPosition(r)},[r,c]),T.useEffect(()=>{i&&c.setPosition(i)},[i,c]),T.useEffect(()=>{c.setInitialIsOpen(s||!1)},[s,c]),T.useEffect(()=>{c.setErrorTypes(o||[])},[o,c]),T.useEffect(()=>(n.current&&c.mount(n.current),()=>{c.unmount()}),[c]),y.jsx("div",{dir:"ltr",className:"tsqd-parent-container",ref:n})}function gC(e){const t=Ei(e.client),n=T.useRef(null),{errorTypes:r,styleNonce:i,shadowDOMTarget:s}=e,[o]=T.useState(new fC({client:t,queryFlavor:"React Query",version:"5",onlineManager:ks,buttonPosition:"bottom-left",position:"bottom",initialIsOpen:!0,errorTypes:r,styleNonce:i,shadowDOMTarget:s,onClose:e.onClose}));return T.useEffect(()=>{o.setClient(t)},[t,o]),T.useEffect(()=>{var a;o.setOnClose((a=e.onClose)!=null?a:()=>{})},[e.onClose,o]),T.useEffect(()=>{o.setErrorTypes(r||[])},[r,o]),T.useEffect(()=>(n.current&&o.mount(n.current),()=>{o.unmount()}),[o]),y.jsx("div",{style:{height:"500px",...e.style},className:"tsqd-parent-container",ref:n})}var yC=process.env.NODE_ENV!=="development"?function(){return null}:hC;process.env.NODE_ENV;function X0(e,t){return function(){return e.apply(t,arguments)}}const{toString:mC}=Object.prototype,{getPrototypeOf:df}=Object,{iterator:bc,toStringTag:J0}=Symbol,vc=(e=>t=>{const n=mC.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),_n=e=>(e=e.toLowerCase(),t=>vc(t)===e),xc=e=>t=>typeof t===e,{isArray:Is}=Array,Io=xc("undefined");function pC(e){return e!==null&&!Io(e)&&e.constructor!==null&&!Io(e.constructor)&&Nt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Z0=_n("ArrayBuffer");function bC(e){let t;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Z0(e.buffer),t}const vC=xc("string"),Nt=xc("function"),eb=xc("number"),wc=e=>e!==null&&typeof e=="object",xC=e=>e===!0||e===!1,Cl=e=>{if(vc(e)!=="object")return!1;const t=df(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(J0 in e)&&!(bc in e)},wC=_n("Date"),SC=_n("File"),CC=_n("Blob"),_C=_n("FileList"),kC=e=>wc(e)&&Nt(e.pipe),EC=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Nt(e.append)&&((t=vc(e))==="formdata"||t==="object"&&Nt(e.toString)&&e.toString()==="[object FormData]"))},OC=_n("URLSearchParams"),[AC,TC,PC,MC]=["ReadableStream","Request","Response","Headers"].map(_n),$C=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function _a(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e=="undefined")return;let r,i;if(typeof e!="object"&&(e=[e]),Is(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let a;for(r=0;r<o;r++)a=s[r],t.call(null,e[a],a,e)}}function tb(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const ti=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:global,nb=e=>!Io(e)&&e!==ti;function ud(){const{caseless:e}=nb(this)&&this||{},t={},n=(r,i)=>{const s=e&&tb(t,i)||i;Cl(t[s])&&Cl(r)?t[s]=ud(t[s],r):Cl(r)?t[s]=ud({},r):Is(r)?t[s]=r.slice():t[s]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&_a(arguments[r],n);return t}const jC=(e,t,n,{allOwnKeys:r}={})=>(_a(t,(i,s)=>{n&&Nt(i)?e[s]=X0(i,n):e[s]=i},{allOwnKeys:r}),e),DC=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),LC=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},IC=(e,t,n,r)=>{let i,s,o;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)o=i[s],(!r||r(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=n!==!1&&df(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},RC=(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},FC=e=>{if(!e)return null;if(Is(e))return e;let t=e.length;if(!eb(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},NC=(e=>t=>e&&t instanceof e)(typeof Uint8Array!="undefined"&&df(Uint8Array)),BC=(e,t)=>{const r=(e&&e[bc]).call(e);let i;for(;(i=r.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},qC=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},zC=_n("HTMLFormElement"),HC=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Gh=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),UC=_n("RegExp"),rb=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};_a(n,(i,s)=>{let o;(o=t(i,s,e))!==!1&&(r[s]=o||i)}),Object.defineProperties(e,r)},KC=e=>{rb(e,(t,n)=>{if(Nt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Nt(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+"'")})}})},WC=(e,t)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return Is(e)?r(e):r(String(e).split(t)),n},VC=()=>{},GC=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function QC(e){return!!(e&&Nt(e.append)&&e[J0]==="FormData"&&e[bc])}const YC=e=>{const t=new Array(10),n=(r,i)=>{if(wc(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const s=Is(r)?[]:{};return _a(r,(o,a)=>{const l=n(o,i+1);!Io(l)&&(s[a]=l)}),t[i]=void 0,s}}return r};return n(e,0)},XC=_n("AsyncFunction"),JC=e=>e&&(wc(e)||Nt(e))&&Nt(e.then)&&Nt(e.catch),ib=((e,t)=>e?setImmediate:t?((n,r)=>(ti.addEventListener("message",({source:i,data:s})=>{i===ti&&s===n&&r.length&&r.shift()()},!1),i=>{r.push(i),ti.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Nt(ti.postMessage)),ZC=typeof queueMicrotask!="undefined"?queueMicrotask.bind(ti):typeof process!="undefined"&&process.nextTick||ib,e_=e=>e!=null&&Nt(e[bc]),I={isArray:Is,isArrayBuffer:Z0,isBuffer:pC,isFormData:EC,isArrayBufferView:bC,isString:vC,isNumber:eb,isBoolean:xC,isObject:wc,isPlainObject:Cl,isReadableStream:AC,isRequest:TC,isResponse:PC,isHeaders:MC,isUndefined:Io,isDate:wC,isFile:SC,isBlob:CC,isRegExp:UC,isFunction:Nt,isStream:kC,isURLSearchParams:OC,isTypedArray:NC,isFileList:_C,forEach:_a,merge:ud,extend:jC,trim:$C,stripBOM:DC,inherits:LC,toFlatObject:IC,kindOf:vc,kindOfTest:_n,endsWith:RC,toArray:FC,forEachEntry:BC,matchAll:qC,isHTMLForm:zC,hasOwnProperty:Gh,hasOwnProp:Gh,reduceDescriptors:rb,freezeMethods:KC,toObjectSet:WC,toCamelCase:HC,noop:VC,toFiniteNumber:GC,findKey:tb,global:ti,isContextDefined:nb,isSpecCompliantForm:QC,toJSONObject:YC,isAsyncFn:XC,isThenable:JC,setImmediate:ib,asap:ZC,isIterable:e_};function ke(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}I.inherits(ke,Error,{toJSON:function(){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:I.toJSONObject(this.config),code:this.code,status:this.status}}});const sb=ke.prototype,ob={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{ob[e]={value:e}});Object.defineProperties(ke,ob);Object.defineProperty(sb,"isAxiosError",{value:!0});ke.from=(e,t,n,r,i,s)=>{const o=Object.create(sb);return I.toFlatObject(e,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),ke.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};const t_=null;function dd(e){return I.isPlainObject(e)||I.isArray(e)}function ab(e){return I.endsWith(e,"[]")?e.slice(0,-2):e}function Qh(e,t,n){return e?e.concat(t).map(function(i,s){return i=ab(i),!n&&s?"["+i+"]":i}).join(n?".":""):t}function n_(e){return I.isArray(e)&&!e.some(dd)}const r_=I.toFlatObject(I,{},null,function(t){return/^is[A-Z]/.test(t)});function Sc(e,t,n){if(!I.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=I.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,p){return!I.isUndefined(p[m])});const r=n.metaTokens,i=n.visitor||u,s=n.dots,o=n.indexes,l=(n.Blob||typeof Blob!="undefined"&&Blob)&&I.isSpecCompliantForm(t);if(!I.isFunction(i))throw new TypeError("visitor must be a function");function c(g){if(g===null)return"";if(I.isDate(g))return g.toISOString();if(I.isBoolean(g))return g.toString();if(!l&&I.isBlob(g))throw new ke("Blob is not supported. Use a Buffer instead.");return I.isArrayBuffer(g)||I.isTypedArray(g)?l&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function u(g,m,p){let b=g;if(g&&!p&&typeof g=="object"){if(I.endsWith(m,"{}"))m=r?m:m.slice(0,-2),g=JSON.stringify(g);else if(I.isArray(g)&&n_(g)||(I.isFileList(g)||I.endsWith(m,"[]"))&&(b=I.toArray(g)))return m=ab(m),b.forEach(function(S,w){!(I.isUndefined(S)||S===null)&&t.append(o===!0?Qh([m],w,s):o===null?m:m+"[]",c(S))}),!1}return dd(g)?!0:(t.append(Qh(p,m,s),c(g)),!1)}const d=[],f=Object.assign(r_,{defaultVisitor:u,convertValue:c,isVisitable:dd});function h(g,m){if(!I.isUndefined(g)){if(d.indexOf(g)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(g),I.forEach(g,function(b,v){(!(I.isUndefined(b)||b===null)&&i.call(t,b,I.isString(v)?v.trim():v,m,f))===!0&&h(b,m?m.concat(v):[v])}),d.pop()}}if(!I.isObject(e))throw new TypeError("data must be an object");return h(e),t}function Yh(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function ff(e,t){this._pairs=[],e&&Sc(e,this,t)}const lb=ff.prototype;lb.append=function(t,n){this._pairs.push([t,n])};lb.toString=function(t){const n=t?function(r){return t.call(this,r,Yh)}:Yh;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function i_(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function cb(e,t,n){if(!t)return e;const r=n&&n.encode||i_;I.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let s;if(i?s=i(t,n):s=I.isURLSearchParams(t)?t.toString():new ff(t,n).toString(r),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class Xh{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){I.forEach(this.handlers,function(r){r!==null&&t(r)})}}const ub={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},s_=typeof URLSearchParams!="undefined"?URLSearchParams:ff,o_=typeof FormData!="undefined"?FormData:null,a_=typeof Blob!="undefined"?Blob:null,l_={isBrowser:!0,classes:{URLSearchParams:s_,FormData:o_,Blob:a_},protocols:["http","https","file","blob","url","data"]},hf=typeof window!="undefined"&&typeof document!="undefined",fd=typeof navigator=="object"&&navigator||void 0,c_=hf&&(!fd||["ReactNative","NativeScript","NS"].indexOf(fd.product)<0),u_=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",d_=hf&&window.location.href||"http://localhost",f_=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:hf,hasStandardBrowserEnv:c_,hasStandardBrowserWebWorkerEnv:u_,navigator:fd,origin:d_},Symbol.toStringTag,{value:"Module"})),Ct={...f_,...l_};function h_(e,t){return Sc(e,new Ct.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return Ct.isNode&&I.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function g_(e){return I.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function y_(e){const t={},n=Object.keys(e);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],t[s]=e[s];return t}function db(e){function t(n,r,i,s){let o=n[s++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),l=s>=n.length;return o=!o&&I.isArray(i)?i.length:o,l?(I.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!a):((!i[o]||!I.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],s)&&I.isArray(i[o])&&(i[o]=y_(i[o])),!a)}if(I.isFormData(e)&&I.isFunction(e.entries)){const n={};return I.forEachEntry(e,(r,i)=>{t(g_(r),i,n,0)}),n}return null}function m_(e,t,n){if(I.isString(e))try{return(t||JSON.parse)(e),I.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const ka={transitional:ub,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=I.isObject(t);if(s&&I.isHTMLForm(t)&&(t=new FormData(t)),I.isFormData(t))return i?JSON.stringify(db(t)):t;if(I.isArrayBuffer(t)||I.isBuffer(t)||I.isStream(t)||I.isFile(t)||I.isBlob(t)||I.isReadableStream(t))return t;if(I.isArrayBufferView(t))return t.buffer;if(I.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 h_(t,this.formSerializer).toString();if((a=I.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Sc(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),m_(t)):t}],transformResponse:[function(t){const n=this.transitional||ka.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(I.isResponse(t)||I.isReadableStream(t))return t;if(t&&I.isString(t)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?ke.from(a,ke.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:Ct.classes.FormData,Blob:Ct.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};I.forEach(["delete","get","head","post","put","patch"],e=>{ka.headers[e]={}});const p_=I.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"]),b_=e=>{const t={};let n,r,i;return e&&e.split(`
13
+ `).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||t[n]&&p_[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Jh=Symbol("internals");function Xs(e){return e&&String(e).trim().toLowerCase()}function _l(e){return e===!1||e==null?e:I.isArray(e)?e.map(_l):String(e)}function v_(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 x_=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function tu(e,t,n,r,i){if(I.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!I.isString(t)){if(I.isString(r))return t.indexOf(r)!==-1;if(I.isRegExp(r))return r.test(t)}}function w_(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function S_(e,t){const n=I.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,s,o){return this[r].call(this,t,i,s,o)},configurable:!0})})}let Bt=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function s(a,l,c){const u=Xs(l);if(!u)throw new Error("header name must be a non-empty string");const d=I.findKey(i,u);(!d||i[d]===void 0||c===!0||c===void 0&&i[d]!==!1)&&(i[d||l]=_l(a))}const o=(a,l)=>I.forEach(a,(c,u)=>s(c,u,l));if(I.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(I.isString(t)&&(t=t.trim())&&!x_(t))o(b_(t),n);else if(I.isObject(t)&&I.isIterable(t)){let a={},l,c;for(const u of t){if(!I.isArray(u))throw TypeError("Object iterator must return a key-value pair");a[c=u[0]]=(l=a[c])?I.isArray(l)?[...l,u[1]]:[l,u[1]]:u[1]}o(a,n)}else t!=null&&s(n,t,r);return this}get(t,n){if(t=Xs(t),t){const r=I.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return v_(i);if(I.isFunction(n))return n.call(this,i,r);if(I.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Xs(t),t){const r=I.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||tu(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function s(o){if(o=Xs(o),o){const a=I.findKey(r,o);a&&(!n||tu(r,r[a],a,n))&&(delete r[a],i=!0)}}return I.isArray(t)?t.forEach(s):s(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const s=n[r];(!t||tu(this,this[s],s,t,!0))&&(delete this[s],i=!0)}return i}normalize(t){const n=this,r={};return I.forEach(this,(i,s)=>{const o=I.findKey(r,s);if(o){n[o]=_l(i),delete n[s];return}const a=t?w_(s):String(s).trim();a!==s&&delete n[s],n[a]=_l(i),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return I.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&I.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(`
14
+ `)}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(i=>r.set(i)),r}static accessor(t){const r=(this[Jh]=this[Jh]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=Xs(o);r[a]||(S_(i,o),r[a]=!0)}return I.isArray(t)?t.forEach(s):s(t),this}};Bt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);I.reduceDescriptors(Bt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});I.freezeMethods(Bt);function nu(e,t){const n=this||ka,r=t||n,i=Bt.from(r.headers);let s=r.data;return I.forEach(e,function(a){s=a.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function fb(e){return!!(e&&e.__CANCEL__)}function Rs(e,t,n){ke.call(this,e==null?"canceled":e,ke.ERR_CANCELED,t,n),this.name="CanceledError"}I.inherits(Rs,ke,{__CANCEL__:!0});function hb(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ke("Request failed with status code "+n.status,[ke.ERR_BAD_REQUEST,ke.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function C_(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function __(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,s=0,o;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=r[s];o||(o=c),n[i]=l,r[i]=c;let d=s,f=0;for(;d!==i;)f+=n[d++],d=d%e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const h=u&&c-u;return h?Math.round(f*1e3/h):void 0}}function k_(e,t){let n=0,r=1e3/t,i,s;const o=(c,u=Date.now())=>{n=u,i=null,s&&(clearTimeout(s),s=null),e.apply(null,c)};return[(...c)=>{const u=Date.now(),d=u-n;d>=r?o(c,u):(i=c,s||(s=setTimeout(()=>{s=null,o(i)},r-d)))},()=>i&&o(i)]}const ql=(e,t,n=3)=>{let r=0;const i=__(50,250);return k_(s=>{const o=s.loaded,a=s.lengthComputable?s.total:void 0,l=o-r,c=i(l),u=o<=a;r=o;const d={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-o)/c:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},Zh=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},eg=e=>(...t)=>I.asap(()=>e(...t)),E_=Ct.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ct.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ct.origin),Ct.navigator&&/(msie|trident)/i.test(Ct.navigator.userAgent)):()=>!0,O_=Ct.hasStandardBrowserEnv?{write(e,t,n,r,i,s){const o=[e+"="+encodeURIComponent(t)];I.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),I.isString(r)&&o.push("path="+r),I.isString(i)&&o.push("domain="+i),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function A_(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function T_(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function gb(e,t,n){let r=!A_(t);return e&&(r||n==!1)?T_(e,t):t}const tg=e=>e instanceof Bt?{...e}:e;function vi(e,t){t=t||{};const n={};function r(c,u,d,f){return I.isPlainObject(c)&&I.isPlainObject(u)?I.merge.call({caseless:f},c,u):I.isPlainObject(u)?I.merge({},u):I.isArray(u)?u.slice():u}function i(c,u,d,f){if(I.isUndefined(u)){if(!I.isUndefined(c))return r(void 0,c,d,f)}else return r(c,u,d,f)}function s(c,u){if(!I.isUndefined(u))return r(void 0,u)}function o(c,u){if(I.isUndefined(u)){if(!I.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,d){if(d in t)return r(c,u);if(d in e)return r(void 0,c)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,u,d)=>i(tg(c),tg(u),d,!0)};return I.forEach(Object.keys(Object.assign({},e,t)),function(u){const d=l[u]||i,f=d(e[u],t[u],u);I.isUndefined(f)&&d!==a||(n[u]=f)}),n}const yb=e=>{const t=vi({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:a}=t;t.headers=o=Bt.from(o),t.url=cb(gb(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(I.isFormData(n)){if(Ct.hasStandardBrowserEnv||Ct.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[c,...u]=l?l.split(";").map(d=>d.trim()).filter(Boolean):[];o.setContentType([c||"multipart/form-data",...u].join("; "))}}if(Ct.hasStandardBrowserEnv&&(r&&I.isFunction(r)&&(r=r(t)),r||r!==!1&&E_(t.url))){const c=i&&s&&O_.read(s);c&&o.set(i,c)}return t},P_=typeof XMLHttpRequest!="undefined",M_=P_&&function(e){return new Promise(function(n,r){const i=yb(e);let s=i.data;const o=Bt.from(i.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=i,u,d,f,h,g;function m(){h&&h(),g&&g(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let p=new XMLHttpRequest;p.open(i.method.toUpperCase(),i.url,!0),p.timeout=i.timeout;function b(){if(!p)return;const S=Bt.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),x={data:!a||a==="text"||a==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:S,config:e,request:p};hb(function(C){n(C),m()},function(C){r(C),m()},x),p=null}"onloadend"in p?p.onloadend=b:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(b)},p.onabort=function(){p&&(r(new ke("Request aborted",ke.ECONNABORTED,e,p)),p=null)},p.onerror=function(){r(new ke("Network Error",ke.ERR_NETWORK,e,p)),p=null},p.ontimeout=function(){let w=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const x=i.transitional||ub;i.timeoutErrorMessage&&(w=i.timeoutErrorMessage),r(new ke(w,x.clarifyTimeoutError?ke.ETIMEDOUT:ke.ECONNABORTED,e,p)),p=null},s===void 0&&o.setContentType(null),"setRequestHeader"in p&&I.forEach(o.toJSON(),function(w,x){p.setRequestHeader(x,w)}),I.isUndefined(i.withCredentials)||(p.withCredentials=!!i.withCredentials),a&&a!=="json"&&(p.responseType=i.responseType),c&&([f,g]=ql(c,!0),p.addEventListener("progress",f)),l&&p.upload&&([d,h]=ql(l),p.upload.addEventListener("progress",d),p.upload.addEventListener("loadend",h)),(i.cancelToken||i.signal)&&(u=S=>{p&&(r(!S||S.type?new Rs(null,e,p):S),p.abort(),p=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const v=C_(i.url);if(v&&Ct.protocols.indexOf(v)===-1){r(new ke("Unsupported protocol "+v+":",ke.ERR_BAD_REQUEST,e));return}p.send(s||null)})},$_=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const s=function(c){if(!i){i=!0,a();const u=c instanceof Error?c:this.reason;r.abort(u instanceof ke?u:new Rs(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,s(new ke(`timeout ${t} of ms exceeded`,ke.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),e=null)};e.forEach(c=>c.addEventListener("abort",s));const{signal:l}=r;return l.unsubscribe=()=>I.asap(a),l}},j_=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},D_=async function*(e,t){for await(const n of L_(e))yield*j_(n,t)},L_=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()}},ng=(e,t,n,r)=>{const i=D_(e,t);let s=0,o,a=l=>{o||(o=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await i.next();if(c){a(),l.close();return}let d=u.byteLength;if(n){let f=s+=d;n(f)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),i.return()}},{highWaterMark:2})},Cc=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",mb=Cc&&typeof ReadableStream=="function",I_=Cc&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),pb=(e,...t)=>{try{return!!e(...t)}catch(n){return!1}},R_=mb&&pb(()=>{let e=!1;const t=new Request(Ct.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),rg=64*1024,hd=mb&&pb(()=>I.isReadableStream(new Response("").body)),zl={stream:hd&&(e=>e.body)};Cc&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!zl[t]&&(zl[t]=I.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new ke(`Response type '${t}' is not supported`,ke.ERR_NOT_SUPPORT,r)})})})(new Response);const F_=async e=>{if(e==null)return 0;if(I.isBlob(e))return e.size;if(I.isSpecCompliantForm(e))return(await new Request(Ct.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(I.isArrayBufferView(e)||I.isArrayBuffer(e))return e.byteLength;if(I.isURLSearchParams(e)&&(e=e+""),I.isString(e))return(await I_(e)).byteLength},N_=async(e,t)=>{const n=I.toFiniteNumber(e.getContentLength());return n==null?F_(t):n},B_=Cc&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:s,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:f}=yb(e);c=c?(c+"").toLowerCase():"text";let h=$_([i,s&&s.toAbortSignal()],o),g;const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let p;try{if(l&&R_&&n!=="get"&&n!=="head"&&(p=await N_(u,r))!==0){let x=new Request(t,{method:"POST",body:r,duplex:"half"}),_;if(I.isFormData(r)&&(_=x.headers.get("content-type"))&&u.setContentType(_),x.body){const[C,A]=Zh(p,ql(eg(l)));r=ng(x.body,rg,C,A)}}I.isString(d)||(d=d?"include":"omit");const b="credentials"in Request.prototype;g=new Request(t,{...f,signal:h,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:b?d:void 0});let v=await fetch(g,f);const S=hd&&(c==="stream"||c==="response");if(hd&&(a||S&&m)){const x={};["status","statusText","headers"].forEach(k=>{x[k]=v[k]});const _=I.toFiniteNumber(v.headers.get("content-length")),[C,A]=a&&Zh(_,ql(eg(a),!0))||[];v=new Response(ng(v.body,rg,C,()=>{A&&A(),m&&m()}),x)}c=c||"text";let w=await zl[I.findKey(zl,c)||"text"](v,e);return!S&&m&&m(),await new Promise((x,_)=>{hb(x,_,{data:w,headers:Bt.from(v.headers),status:v.status,statusText:v.statusText,config:e,request:g})})}catch(b){throw m&&m(),b&&b.name==="TypeError"&&/Load failed|fetch/i.test(b.message)?Object.assign(new ke("Network Error",ke.ERR_NETWORK,e,g),{cause:b.cause||b}):ke.from(b,b&&b.code,e,g)}}),gd={http:t_,xhr:M_,fetch:B_};I.forEach(gd,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}});const ig=e=>`- ${e}`,q_=e=>I.isFunction(e)||e===null||e===!1,bb={getAdapter:e=>{e=I.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let s=0;s<t;s++){n=e[s];let o;if(r=n,!q_(n)&&(r=gd[(o=String(n)).toLowerCase()],r===void 0))throw new ke(`Unknown adapter '${o}'`);if(r)break;i[o||"#"+s]=r}if(!r){const s=Object.entries(i).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=t?s.length>1?`since :
15
+ `+s.map(ig).join(`
16
+ `):" "+ig(s[0]):"as no adapter specified";throw new ke("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:gd};function ru(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Rs(null,e)}function sg(e){return ru(e),e.headers=Bt.from(e.headers),e.data=nu.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),bb.getAdapter(e.adapter||ka.adapter)(e).then(function(r){return ru(e),r.data=nu.call(e,e.transformResponse,r),r.headers=Bt.from(r.headers),r},function(r){return fb(r)||(ru(e),r&&r.response&&(r.response.data=nu.call(e,e.transformResponse,r.response),r.response.headers=Bt.from(r.response.headers))),Promise.reject(r)})}const vb="1.10.0",_c={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{_c[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const og={};_c.transitional=function(t,n,r){function i(s,o){return"[Axios v"+vb+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,a)=>{if(t===!1)throw new ke(i(o," has been removed"+(n?" in "+n:"")),ke.ERR_DEPRECATED);return n&&!og[o]&&(og[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,o,a):!0}};_c.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function z_(e,t,n){if(typeof e!="object")throw new ke("options must be an object",ke.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const s=r[i],o=t[s];if(o){const a=e[s],l=a===void 0||o(a,s,e);if(l!==!0)throw new ke("option "+s+" must be "+l,ke.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ke("Unknown option "+s,ke.ERR_BAD_OPTION)}}const kl={assertOptions:z_,validators:_c},En=kl.validators;let gi=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Xh,response:new Xh}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
17
+ `+s):r.stack=s}catch(o){}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=vi(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&kl.assertOptions(r,{silentJSONParsing:En.transitional(En.boolean),forcedJSONParsing:En.transitional(En.boolean),clarifyTimeoutError:En.transitional(En.boolean)},!1),i!=null&&(I.isFunction(i)?n.paramsSerializer={serialize:i}:kl.assertOptions(i,{encode:En.function,serialize:En.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),kl.assertOptions(n,{baseUrl:En.spelling("baseURL"),withXsrfToken:En.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&I.merge(s.common,s[n.method]);s&&I.forEach(["delete","get","head","post","put","patch","common"],g=>{delete s[g]}),n.headers=Bt.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,d=0,f;if(!l){const g=[sg.bind(this),void 0];for(g.unshift.apply(g,a),g.push.apply(g,c),f=g.length,u=Promise.resolve(n);d<f;)u=u.then(g[d++],g[d++]);return u}f=a.length;let h=n;for(d=0;d<f;){const g=a[d++],m=a[d++];try{h=g(h)}catch(p){m.call(this,p);break}}try{u=sg.call(this,h)}catch(g){return Promise.reject(g)}for(d=0,f=c.length;d<f;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=vi(this.defaults,t);const n=gb(t.baseURL,t.url,t.allowAbsoluteUrls);return cb(n,t.params,t.paramsSerializer)}};I.forEach(["delete","get","head","options"],function(t){gi.prototype[t]=function(n,r){return this.request(vi(r||{},{method:t,url:n,data:(r||{}).data}))}});I.forEach(["post","put","patch"],function(t){function n(r){return function(s,o,a){return this.request(vi(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}gi.prototype[t]=n(),gi.prototype[t+"Form"]=n(!0)});let H_=class xb{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(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{r.subscribe(a),s=a}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},t(function(s,o,a){r.reason||(r.reason=new Rs(s,o,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 xb(function(i){t=i}),cancel:t}}};function U_(e){return function(n){return e.apply(null,n)}}function K_(e){return I.isObject(e)&&e.isAxiosError===!0}const yd={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(yd).forEach(([e,t])=>{yd[t]=e});function wb(e){const t=new gi(e),n=X0(gi.prototype.request,t);return I.extend(n,gi.prototype,t,{allOwnKeys:!0}),I.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return wb(vi(e,i))},n}const nt=wb(ka);nt.Axios=gi;nt.CanceledError=Rs;nt.CancelToken=H_;nt.isCancel=fb;nt.VERSION=vb;nt.toFormData=Sc;nt.AxiosError=ke;nt.Cancel=nt.CanceledError;nt.all=function(t){return Promise.all(t)};nt.spread=U_;nt.isAxiosError=K_;nt.mergeConfig=vi;nt.AxiosHeaders=Bt;nt.formToJSON=e=>db(I.isHTMLForm(e)?new FormData(e):e);nt.getAdapter=bb.getAdapter;nt.HttpStatusCode=yd;nt.default=nt;const{Axios:y9,AxiosError:m9,CanceledError:p9,isCancel:b9,CancelToken:v9,VERSION:x9,all:w9,Cancel:S9,isAxiosError:C9,spread:_9,toFormData:k9,AxiosHeaders:E9,HttpStatusCode:O9,formToJSON:A9,getAdapter:T9,mergeConfig:P9}=nt;function Ro(e){"@babel/helpers - typeof";return Ro=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ro(e)}function Fo(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var b=g&&g.prototype instanceof a?g:a,v=Object.create(b.prototype);return Ut(v,"_invoke",function(S,w,x){var _,C,A,k=0,P=x||[],$=!1,j={p:0,n:0,v:e,a:Z,f:Z.bind(e,4),d:function(N,L){return _=N,C=0,A=e,j.n=L,o}};function Z(q,N){for(C=q,A=N,t=0;!$&&k&&!L&&t<P.length;t++){var L,F=P[t],se=j.p,de=F[2];q>3?(L=de===N)&&(A=F[(C=F[4])?5:(C=3,3)],F[4]=F[5]=e):F[0]<=se&&((L=q<2&&se<F[1])?(C=0,j.v=N,j.n=F[1]):se<de&&(L=q<3||F[0]>N||N>de)&&(F[4]=q,F[5]=N,j.n=de,C=0))}if(L||q>1)return o;throw $=!0,N}return function(q,N,L){if(k>1)throw TypeError("Generator is already running");for($&&N===1&&Z(N,L),C=N,A=L;(t=C<2?e:A)||!$;){_||(C?C<3?(C>1&&(j.n=-1),Z(C,A)):j.n=A:j.v=A);try{if(k=2,_){if(C||(q="next"),t=_[q]){if(!(t=t.call(_,A)))throw TypeError("iterator result is not an object");if(!t.done)return t;A=t.value,C<2&&(C=0)}else C===1&&(t=_.return)&&t.call(_),C<2&&(A=TypeError("The iterator does not provide a '"+q+"' method"),C=1);_=e}else if((t=($=j.n<0)?A:S.call(w,j))!==o)break}catch(F){_=e,C=1,A=F}finally{k=1}}return{value:t,done:$}}}(h,m,p),!0),v}var o={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Ut(t={},r,function(){return this}),t),d=c.prototype=a.prototype=Object.create(u);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,c):(h.__proto__=c,Ut(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=c,Ut(d,"constructor",c),Ut(c,"constructor",l),l.displayName="GeneratorFunction",Ut(c,i,"GeneratorFunction"),Ut(d),Ut(d,i,"Generator"),Ut(d,r,function(){return this}),Ut(d,"toString",function(){return"[object Generator]"}),(Fo=function(){return{w:s,m:f}})()}function Ut(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Ut=function(o,a,l,c){if(a)i?i(o,a,{value:l,enumerable:!c,configurable:!c,writable:!c}):o[a]=l;else{var u=function(f,h){Ut(o,f,function(g){return this._invoke(f,h,g)})};u("next",0),u("throw",1),u("return",2)}},Ut(e,t,n,r)}function ag(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(c){return void n(c)}a.done?t(l):Promise.resolve(l).then(r,i)}function Sb(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){ag(s,r,i,o,a,"next",l)}function a(l){ag(s,r,i,o,a,"throw",l)}o(void 0)})}}function lg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Vi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lg(Object(n),!0).forEach(function(r){W_(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function W_(e,t,n){return(t=V_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V_(e){var t=G_(e,"string");return Ro(t)=="symbol"?t:t+""}function G_(e,t){if(Ro(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ro(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Q_(e){var t;if(typeof document!="undefined"){var n="; ".concat(document.cookie),r=n.split("; ".concat(e,"="));if(r.length===2)return(t=r.pop())===null||t===void 0?void 0:t.split(";").shift()}}var Y_="yst-insights-token";function X_(){if(typeof window!="undefined")return localStorage.getItem(Y_)||void 0}var xi=nt.create({withCredentials:!0});xi.interceptors.request.use(function(e){var t=Q_("XSRF-TOKEN"),n=t?decodeURIComponent(t):void 0,r=X_();return e.headers=Vi(Vi(Vi({},e.headers||{}),n?{"X-XSRF-TOKEN":n}:{}),r?{Authorization:"Bearer ".concat(r)}:{}),e},function(e){return Promise.reject(e)});xi.interceptors.response.use(function(e){return e},function(){var e=Sb(Fo().m(function t(n){var r;return Fo().w(function(i){for(;;)switch(i.n){case 0:return n==null||(r=n.response)===null||r===void 0||r.status,i.a(2,Promise.reject(n))}},t)}));return function(t){return e.apply(this,arguments)}}());function Mt(e){return md.apply(this,arguments)}function md(){return md=Sb(Fo().m(function e(t){var n;return Fo().w(function(r){for(;;)switch(r.n){case 0:return n=Vi({},t),delete n.baseURL,r.a(2,xi.request(Vi(Vi({},n),{},{withCredentials:!0})))}},e)})),md.apply(this,arguments)}function J_(e){xi.defaults.baseURL=e}function No(e){"@babel/helpers - typeof";return No=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},No(e)}function Z_(e){return rk(e)||nk(e)||tk(e)||ek()}function ek(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
18
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tk(e,t){if(e){if(typeof e=="string")return pd(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pd(e,t):void 0}}function nk(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function rk(e){if(Array.isArray(e))return pd(e)}function pd(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function cg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ee(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cg(Object(n),!0).forEach(function(r){ik(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ik(e,t,n){return(t=sk(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sk(e){var t=ok(e,"string");return No(t)=="symbol"?t:t+""}function ok(e,t){if(No(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(No(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ak=function(t,n){return Mt({url:"/brands/".concat(t,"/analysis"),method:"GET",signal:n})},Cb=function(t){return["/brands/".concat(t,"/analysis")]},lk=function(t,n){var r,i=n!=null?n:{},s=i.query,o=(r=s==null?void 0:s.queryKey)!==null&&r!==void 0?r:Cb(t),a=function(c){var u=c.signal;return ak(t,u)};return Ee({queryKey:o,queryFn:a,enabled:!!t},s)};function _b(e,t,n){var r=lk(e,t),i=Oi(r,n);return i.queryKey=r.queryKey,i}var ck=function(t,n,r){return Mt({url:"/brands/".concat(t,"/analysis"),method:"POST",headers:{"Content-Type":"application/json"},data:n,signal:r})},uk=function(t){var n=["postAnalysis"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:Ee(Ee({},t),{},{mutation:Ee(Ee({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},c=l.brandId,u=l.data;return ck(c,u)};return Ee({mutationFn:s},i)},dk=function(t,n){var r=uk(t);return Ai(r,n)},fk=function(t){return Mt({url:"/brands/".concat(t,"/analysis"),method:"DELETE"})},hk=function(t){var n=["deleteAnalysis"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:Ee(Ee({},t),{},{mutation:Ee(Ee({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},c=l.brandId;return fk(c)};return Ee({mutationFn:s},i)},gk=function(t,n){var r=hk(t);return Ai(r,n)},yk=function(t,n,r){return Mt({url:"/brands/".concat(t,"/analysis/").concat(n),method:"GET",signal:r})},mk=function(t,n){return["/brands/".concat(t,"/analysis/").concat(n)]},pk=function(t,n,r){var i,s=r!=null?r:{},o=s.query,a=(i=o==null?void 0:o.queryKey)!==null&&i!==void 0?i:mk(t,n),l=function(u){var d=u.signal;return yk(t,n,d)};return Ee({queryKey:a,queryFn:l,enabled:!!(t&&n)},o)};function zn(e,t,n,r){var i=pk(e,t,n),s=Oi(i,r);return s.queryKey=i.queryKey,s}var bk=function(t){return Mt({url:"/users/getToken",method:"POST",signal:t})},vk=function(t){return Mt({url:"/users/logout",method:"POST",signal:t})},xk=function(t){var n=["logout"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:Ee(Ee({},t),{},{mutation:Ee(Ee({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(){return vk()};return Ee({mutationFn:s},i)},wk=function(t,n){var r=xk(t);return Ai(r,n)},Sk=function(t,n){return Mt({url:"/brands/".concat(t,"/associated-brands"),method:"GET",signal:n})},Ck=function(t){return["/brands/".concat(t,"/associated-brands")]},_k=function(t,n){var r,i=n!=null?n:{},s=i.query,o=(r=s==null?void 0:s.queryKey)!==null&&r!==void 0?r:Ck(t),a=function(c){var u=c.signal;return Sk(t,u)};return Ee({queryKey:o,queryFn:a,enabled:!!t},s)};function kk(e,t,n){var r=_k(e,t),i=Oi(r,n);return i.queryKey=r.queryKey,i}var Ek=function(t,n,r){return Mt({url:"/brands/".concat(t,"/associated-brand-groups"),method:"POST",headers:{"Content-Type":"application/json"},data:n,signal:r})},Ok=function(t){var n=["createBrandAssociationGroup"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:Ee(Ee({},t),{},{mutation:Ee(Ee({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},c=l.brandId,u=l.data;return Ek(c,u)};return Ee({mutationFn:s},i)},Ak=function(t,n){var r=Ok(t);return Ai(r,n)},Tk=function(t){return Mt({url:"/brands",method:"GET",signal:t})},gf=function(){return["/brands"]},Pk=function(t){var n,r=t!=null?t:{},i=r.query,s=(n=i==null?void 0:i.queryKey)!==null&&n!==void 0?n:gf(),o=function(l){var c=l.signal;return Tk(c)};return Ee({queryKey:s,queryFn:o},i)};function kc(e,t){var n=Pk(e),r=Oi(n,t);return r.queryKey=n.queryKey,r}var Mk=function(t,n){return Mt({url:"/brands",method:"POST",headers:{"Content-Type":"application/json"},data:t,signal:n})},$k=function(t){var n=["createBrand"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:Ee(Ee({},t),{},{mutation:Ee(Ee({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},c=l.data;return Mk(c)};return Ee({mutationFn:s},i)},jk=function(t,n){var r=$k(t);return Ai(r,n)},Dk=function(t,n){return Mt({url:"/brands/".concat(t),method:"GET",signal:n})},Lk=function(t){return["/brands/".concat(t)]},Ik=function(t,n){var r,i=n!=null?n:{},s=i.query,o=(r=s==null?void 0:s.queryKey)!==null&&r!==void 0?r:Lk(t),a=function(c){var u=c.signal;return Dk(t,u)};return Ee({queryKey:o,queryFn:a,enabled:!!t},s)};function Rk(e,t,n){var r=Ik(e,t),i=Oi(r,n);return i.queryKey=r.queryKey,i}var Fk=function(t){return Mt({url:"/brands/".concat(t),method:"DELETE"})},Nk=function(t){var n=["deleteBrand"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:Ee(Ee({},t),{},{mutation:Ee(Ee({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},c=l.brandId;return Fk(c)};return Ee({mutationFn:s},i)},Bk=function(t,n){var r=Nk(t);return Ai(r,n)},qk=function(t,n){return Mt({url:"/brands/".concat(t,"/queries"),method:"PUT",headers:{"Content-Type":"application/json"},data:n})},zk=function(t){var n=["updateBrandQueries"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:Ee(Ee({},t),{},{mutation:Ee(Ee({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},c=l.brandId,u=l.data;return qk(c,u)};return Ee({mutationFn:s},i)},Hk=function(t,n){var r=zk(t);return Ai(r,n)},Uk=function(t,n,r){return Mt({url:"/brands/".concat(t,"/query-suggestions"),method:"GET",params:n,signal:r})},Kk=function(t,n){return["/brands/".concat(t,"/query-suggestions")].concat(Z_(n?[n]:[]))},Wk=function(t,n,r){var i,s=r!=null?r:{},o=s.query,a=(i=o==null?void 0:o.queryKey)!==null&&i!==void 0?i:Kk(t,n),l=function(u){var d=u.signal;return Uk(t,n,d)};return Ee({queryKey:a,queryFn:l,enabled:!!t},o)};function Vk(e,t,n,r){var i=Wk(e,t,n),s=Oi(i,r);return s.queryKey=i.queryKey,s}var Gk=function(t){return Mt({url:"/users/current",method:"GET",signal:t})},kb=function(){return["/users/current"]},Qk=function(t){var n,r=t!=null?t:{},i=r.query,s=(n=i==null?void 0:i.queryKey)!==null&&n!==void 0?n:kb(),o=function(l){var c=l.signal;return Gk(c)};return Ee({queryKey:s,queryFn:o},i)};function Eb(e,t){var n=Qk(e),r=Oi(n,t);return r.queryKey=n.queryKey,r}var Ob=W.createContext(void 0),Yk=function(t){var n,r,i=t.children,s=t.brandId,o=t.analysisId,a=t.model,l=Eh("/brands/:brandId"),c=Eh("/brands/:brandId/analysis/:analysisId"),u=W.useMemo(function(){var f,h;return{brandId:(l==null||(f=l.params)===null||f===void 0?void 0:f.brandId)||s||"",analysisId:(c==null||(h=c.params)===null||h===void 0?void 0:h.analysisId)||o||"latest",model:a||"chatgpt"}},[l==null||(n=l.params)===null||n===void 0?void 0:n.brandId,c==null||(r=c.params)===null||r===void 0?void 0:r.analysisId,s,o,a]),d=W.useMemo(function(){return{data:u}},[u]);return y.jsx(Ob.Provider,{value:d,children:i})},Ab=W.createContext(void 0),Xk=function(t){var n=t.children,r=t.setBrandId,i=t.setAnalysisId,s=t.setModel,o=W.useCallback(function(d){r(d),i("latest")},[r,i]),a=W.useCallback(function(d){i(d)},[i]),l=W.useCallback(function(d){s(d)},[s]),c=W.useMemo(function(){return{setBrandId:o,setAnalysisId:a,setModel:l}},[o,a,l]),u=W.useMemo(function(){return{mutations:c}},[c]);return y.jsx(Ab.Provider,{value:u,children:n})};function iu(e,t){return tE(e)||eE(e,t)||Zk(e,t)||Jk()}function Jk(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
19
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zk(e,t){if(e){if(typeof e=="string")return ug(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ug(e,t):void 0}}function ug(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function eE(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function tE(e){if(Array.isArray(e))return e}var nE=function(t){var n=t.children,r=W.useState(void 0),i=iu(r,2),s=i[0],o=i[1],a=W.useState("latest"),l=iu(a,2),c=l[0],u=l[1],d=W.useState(void 0),f=iu(d,2),h=f[0],g=f[1];return y.jsx(Xk,{brandId:s,setBrandId:o,analysisId:c,setAnalysisId:u,model:h,setModel:g,children:y.jsx(Yk,{brandId:s,analysisId:c,model:h,children:n})})},zt=function(){var t=W.useContext(Ob);if(t===void 0)throw new Error("useBrandAnalysisData must be used within a BrandAnalysisDataProvider");return t.data},yf=function(){var t=W.useContext(Ab);if(t===void 0)throw new Error("useBrandAnalysisMutations must be used within a BrandAnalysisMutationsProvider");return t.mutations},su={exports:{}};/*!
20
+ Copyright (c) 2018 Jed Watson.
21
+ Licensed under the MIT License (MIT), see
22
+ http://jedwatson.github.io/classnames
23
+ */var dg;function rE(){return dg||(dg=1,function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(s=i(s,r(a)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var a in s)t.call(s,a)&&s[a]&&(o=i(o,a));return o}function i(s,o){return o?s?s+" "+o:s+o:s}e.exports?(n.default=n,e.exports=n):window.classNames=n})()}(su)),su.exports}var iE=rE();const Se=Rp(iE);function Bo(e){"@babel/helpers - typeof";return Bo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bo(e)}function qo(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var b=g&&g.prototype instanceof a?g:a,v=Object.create(b.prototype);return Kt(v,"_invoke",function(S,w,x){var _,C,A,k=0,P=x||[],$=!1,j={p:0,n:0,v:e,a:Z,f:Z.bind(e,4),d:function(N,L){return _=N,C=0,A=e,j.n=L,o}};function Z(q,N){for(C=q,A=N,t=0;!$&&k&&!L&&t<P.length;t++){var L,F=P[t],se=j.p,de=F[2];q>3?(L=de===N)&&(A=F[(C=F[4])?5:(C=3,3)],F[4]=F[5]=e):F[0]<=se&&((L=q<2&&se<F[1])?(C=0,j.v=N,j.n=F[1]):se<de&&(L=q<3||F[0]>N||N>de)&&(F[4]=q,F[5]=N,j.n=de,C=0))}if(L||q>1)return o;throw $=!0,N}return function(q,N,L){if(k>1)throw TypeError("Generator is already running");for($&&N===1&&Z(N,L),C=N,A=L;(t=C<2?e:A)||!$;){_||(C?C<3?(C>1&&(j.n=-1),Z(C,A)):j.n=A:j.v=A);try{if(k=2,_){if(C||(q="next"),t=_[q]){if(!(t=t.call(_,A)))throw TypeError("iterator result is not an object");if(!t.done)return t;A=t.value,C<2&&(C=0)}else C===1&&(t=_.return)&&t.call(_),C<2&&(A=TypeError("The iterator does not provide a '"+q+"' method"),C=1);_=e}else if((t=($=j.n<0)?A:S.call(w,j))!==o)break}catch(F){_=e,C=1,A=F}finally{k=1}}return{value:t,done:$}}}(h,m,p),!0),v}var o={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Kt(t={},r,function(){return this}),t),d=c.prototype=a.prototype=Object.create(u);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,c):(h.__proto__=c,Kt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=c,Kt(d,"constructor",c),Kt(c,"constructor",l),l.displayName="GeneratorFunction",Kt(c,i,"GeneratorFunction"),Kt(d),Kt(d,i,"Generator"),Kt(d,r,function(){return this}),Kt(d,"toString",function(){return"[object Generator]"}),(qo=function(){return{w:s,m:f}})()}function Kt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Kt=function(o,a,l,c){if(a)i?i(o,a,{value:l,enumerable:!c,configurable:!c,writable:!c}):o[a]=l;else{var u=function(f,h){Kt(o,f,function(g){return this._invoke(f,h,g)})};u("next",0),u("throw",1),u("return",2)}},Kt(e,t,n,r)}function fg(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(c){return void n(c)}a.done?t(l):Promise.resolve(l).then(r,i)}function Tb(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){fg(s,r,i,o,a,"next",l)}function a(l){fg(s,r,i,o,a,"throw",l)}o(void 0)})}}function hg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ln(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hg(Object(n),!0).forEach(function(r){sE(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sE(e,t,n){return(t=oE(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oE(e){var t=aE(e,"string");return Bo(t)=="symbol"?t:t+""}function aE(e,t){if(Bo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lE(e,t){return fE(e)||dE(e,t)||uE(e,t)||cE()}function cE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
24
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uE(e,t){if(e){if(typeof e=="string")return gg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gg(e,t):void 0}}function gg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function dE(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function fE(e){if(Array.isArray(e))return e}var bd=new Set,ct={refreshing:!1,ready:!1},Ua,vd="yst-insights-token-exp",zo=void 0,Pb="env";function hE(e){e&&e.trim()&&(zo=e.trim(),Pb="prop")}function gE(){return{token:zo,source:Pb}}function Hl(){bd.forEach(function(e){return e(ct)})}function yE(e){return bd.add(e),e(ct),function(){bd.delete(e)}}function Ka(){return ct}function mE(e){if(e)try{var t=e.split("."),n=lE(t,2),r=n[1],i=atob(r.replace(/-/g,"+").replace(/_/g,"/"));return JSON.parse(decodeURIComponent(escape(i)))}catch(s){return}}function pE(){Ua&&window.clearTimeout(Ua);var e=ct.expiresAt;if(e){var t=Date.now(),n=2*60*1e3,r=e-t-n,i=Math.max(r,5e3);r<=0?Ua=window.setTimeout(function(){return void Ho()},1e3):Ua=window.setTimeout(function(){return void Ho()},i)}}function Ul(e,t){e?localStorage.setItem(Uo,e):(localStorage.removeItem(Uo),sessionStorage.removeItem(vd));var n=mE(e),r=n!=null&&n.exp?n.exp*1e3:void 0,i=t||r;i&&sessionStorage.setItem(vd,String(i)),ct=Ln(Ln({},ct),{},{token:e,decoded:n,expiresAt:i}),e?xi.defaults.headers.common.Authorization="Bearer ".concat(e):delete xi.defaults.headers.common.Authorization,pE(),Hl()}function Ho(){return xd.apply(this,arguments)}function xd(){return xd=Tb(qo().m(function e(){var t,n,r,i,s,o,a,l,c;return qo().w(function(u){for(;;)switch(u.p=u.n){case 0:if(!ct.refreshing){u.n=1;break}return u.a(2,ct.token);case 1:if(ct=Ln(Ln({},ct),{},{refreshing:!0,error:void 0}),Hl(),u.p=2,zo){u.n=3;break}throw new Error("Missing MyYoast access token (env or prop)");case 3:return xi.defaults.headers.common.Authorization="Bearer ".concat(zo),u.n=4,bk();case 4:if(n=u.v,r=n.data,i=r.plainTextToken,i){u.n=5;break}throw new Error("Token endpoint missing plainTextToken field");case 5:return o=(t=r.accessToken)===null||t===void 0?void 0:t.expires_at,o&&(typeof o=="number"?s=o>1e10?o:o*1e3:typeof o=="string"&&(a=Date.parse(o),Number.isNaN(a)||(s=a))),Ul(i,s),u.a(2,i);case 6:return u.p=6,c=u.v,l=c instanceof Error?c:new Error("Unknown token error"),ct=Ln(Ln({},ct),{},{error:l}),Ul(void 0),u.a(2,void 0);case 7:return u.p=7,ct=Ln(Ln({},ct),{},{refreshing:!1,ready:!0}),Hl(),u.f(7);case 8:return u.a(2)}},e,null,[[2,6,7,8]])})),xd.apply(this,arguments)}function bE(){return wd.apply(this,arguments)}function wd(){return wd=Tb(qo().m(function e(){var t,n,r,i;return qo().w(function(s){for(;;)switch(s.n){case 0:if(t=localStorage.getItem(Uo),!t){s.n=1;break}return n=sessionStorage.getItem(vd),r=n?Number(n):void 0,Ul(t,r&&!Number.isNaN(r)?r:void 0),ct=Ln(Ln({},ct),{},{ready:!0}),Hl(),i=ct.expiresAt?ct.expiresAt-Date.now():void 0,(!i||i<=2*60*1e3)&&Ho(),s.a(2);case 1:return s.n=2,Ho();case 2:return s.a(2)}},e)})),wd.apply(this,arguments)}window.addEventListener("storage",function(e){e.key===Uo&&e.newValue!==ct.token&&Ul(e.newValue||void 0)});function Wa(e,t){return SE(e)||wE(e,t)||xE(e,t)||vE()}function vE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
25
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xE(e,t){if(e){if(typeof e=="string")return yg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yg(e,t):void 0}}function yg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wE(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function SE(e){if(Array.isArray(e))return e}var Uo="yst-insights-token",CE=function(){var t=W.useState(Ka().ready),n=Wa(t,2),r=n[0],i=n[1],s=W.useState(Ka().error),o=Wa(s,2),a=o[0],l=o[1],c=W.useState(Ka().expiresAt),u=Wa(c,2),d=u[0],f=u[1],h=W.useState(Ka().refreshing),g=Wa(h,2),m=g[0],p=g[1],b=gE(),v=b.source;W.useEffect(function(){var x=yE(function(_){i(_.ready),l(_.error),f(_.expiresAt),p(_.refreshing)});return bE(),function(){return x()}},[]);var S=d?Math.max(0,d-Date.now()):void 0,w=S?Math.floor(S/6e4):void 0;return r?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"yst-space-y-2 yst-p-4",children:[a&&y.jsxs(O.Alert,{appearance:"danger",children:["Auth error: ",a.message," ",y.jsx("button",{type:"button",onClick:function(){return Ho()},className:"yst-text-blue-600 hover:yst-underline",children:"Retry"})]}),!a&&y.jsxs(O.Alert,{appearance:"success",children:["Session active",w!==void 0&&" โ€“ expires in ~".concat(w,"m")," ","(source: ",v,")",m&&y.jsx(O.Spinner,{className:"yst-ml-2 yst-inline"})]})]}),y.jsx(dc,{})]}):y.jsx("div",{className:"yst-p-4",children:y.jsxs(O.Alert,{appearance:"info",className:"yst-mb-4",children:[y.jsx(O.Spinner,{className:"yst-mr-2 yst-inline"})," Initializing secure session..."]})})},_E=function(){localStorage.removeItem(Uo),delete nt.defaults.headers.common.Authorization},kE=function(){var t=zr(),n=wk({mutation:{onSettled:function(){_E(),t("/"),window.location.reload()}}});return n};function EE(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4"}))}const OE=T.forwardRef(EE);function AE(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"}))}const TE=T.forwardRef(AE);function PE(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}))}const Mb=T.forwardRef(PE);function ME(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"}))}const $E=T.forwardRef(ME);function jE(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"}))}const DE=T.forwardRef(jE);function LE(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))}const $b=T.forwardRef(LE);function IE(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 15l-2 5L9 9l11 4-5 2zm0 0l5 5M7.188 2.239l.777 2.897M5.136 7.965l-2.898-.777M13.95 4.05l-2.122 2.122m-5.657 5.656l-2.12 2.122"}))}const RE=T.forwardRef(IE);function FE(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"}))}const NE=T.forwardRef(FE);function BE(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"}))}const qE=T.forwardRef(BE);function zE(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"}))}const HE=T.forwardRef(zE);function UE(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"}))}const KE=T.forwardRef(UE);function WE(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}const VE=T.forwardRef(WE);function GE(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"}))}const Sd=T.forwardRef(GE);function QE(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"}))}const YE=T.forwardRef(QE);function XE(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4h16v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4z"}))}const JE=T.forwardRef(XE);function ZE(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"}))}const eO=T.forwardRef(ZE);function tO(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z"}))}const Ec=T.forwardRef(tO);function nO(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"}))}const Cd=T.forwardRef(nO);function rO(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"}))}const jb=T.forwardRef(rO);var iO=function(){return[{label:"Brand analysis",href:"/",Icon:JE,isActive:function(n){return n.startsWith("/setup")||n==="/"},showInMenu:!0},{label:"Settings",href:"/settings",Icon:$b,isActive:function(n){return n.startsWith("/settings")},showInMenu:!0},{label:"Query history",href:"/query-history",Icon:OE,isActive:function(n){return n.startsWith("/query-history")},showInMenu:!0}]},mg;function sO(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var pg=function(t){var n=t.className,r=dn(),i=r.pathname,s=iO();return y.jsx("div",{className:Se("yst-flex yst-flex-col yst-gap-10",n),children:y.jsx(O.SidebarNavigation.Sidebar,{children:y.jsx(O.SidebarNavigation.List,{className:"yst-space-y-2",children:s.filter(function(o){return o.showInMenu!==!1}).map(function(o){var a=o.isActive?o.isActive(i):!1;return y.jsx(O.SidebarNavigation.SubmenuItem,{className:Se("yst-flex yst-gap-x-3",{"yst-sidebar-navigation__item--active":a}),href:o.href,to:o.href,as:Hr,label:y.jsxs(y.Fragment,{children:[y.jsx(o.Icon,{className:Se(mg||(mg=sO(["yst-sidebar-navigation__icon yst-h-6 yst-w-6"])))}),o.label]})},o.label)})})})})};const oO="data:image/svg+xml,%3csvg%20width='96'%20height='42'%20viewBox='0%200%2096%2042'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M31.6517%2010.1419C24.3001%2010.1419%2021.3588%2015.0112%2021.3588%2020.4319C21.3588%2025.8525%2024.2564%2030.9356%2031.6517%2030.9356C39.0469%2030.9356%2041.9256%2025.8375%2041.9123%2020.7619C41.8952%2014.58%2038.7258%2010.14%2031.6517%2010.14V10.1419ZM27.1978%2020.7394C27.3764%2013.485%2033.0235%2013.4925%2034.9104%2016.0912C36.63%2018.4594%2036.9815%2026.5556%2031.6536%2026.4975C29.1986%2026.4712%2027.2719%2024.8344%2027.1997%2020.7394H27.1978ZM91.2791%2025.905V15.3956H95.0869V10.8337H91.2791V5.32312H85.3982V10.8337H82.415V15.3956H85.3982V25.3087C85.3982%2030.9431%2089.3789%2034.2919%2093.5801%2034.9856L95.3358%2030.3206C92.8866%2030.015%2091.3019%2028.2075%2091.2791%2025.9069V25.905ZM61.6088%2024.2419V16.3425C61.6088%2016.0537%2061.5898%2015.7837%2061.5613%2015.5194C61.0521%209.13687%2051.8669%209.15%2044.7529%2011.6006L46.8089%2015.6844C51.4413%2013.5131%2054.2136%2014.0737%2055.1826%2015.1425C55.2073%2015.1706%2055.232%2015.1969%2055.2548%2015.2269C55.2567%2015.2306%2055.2605%2015.2344%2055.2624%2015.2381C55.7565%2015.8962%2055.6387%2016.935%2055.6387%2017.7525C49.5849%2017.7525%2043.1416%2018.5456%2043.1416%2025.0969C43.1416%2030.0769%2049.4652%2033.2812%2056.0738%2028.5337L57.0542%2030.8681H62.7185C62.2131%2028.1269%2061.6069%2025.7794%2061.6069%2024.2419H61.6088ZM55.6843%2024.1987C51.0271%2029.3419%2046.7613%2024.5006%2051.1297%2022.3894C52.4161%2021.9562%2054.1604%2021.9375%2055.6843%2021.9375V24.1987ZM70.6477%2015.9169C70.6477%2013.9706%2073.8037%2013.0612%2078.7839%2015.3037L80.5054%2011.1769C73.8037%209.17812%2064.6509%208.99812%2064.592%2015.9169C64.5635%2019.2319%2066.7182%2021.015%2069.8211%2022.1531C71.9701%2022.9406%2075.073%2023.3494%2075.0635%2025.0387C75.0521%2027.2456%2070.241%2027.5831%2065.8632%2024.615L64.0942%2029.0906C70.0662%2032.0231%2081.1705%2032.1056%2081.1116%2024.7556C81.0527%2017.4881%2070.6457%2018.735%2070.6457%2015.9169H70.6477ZM18.8734%200.1875L10.3495%2023.5519L6.26617%2010.935H0.195312L6.99391%2028.1644C7.57346%2029.6312%207.57346%2031.2594%206.99391%2032.7262C6.23387%2034.6481%204.97029%2036.2944%201.88831%2036.7031V41.8106C7.88886%2041.8106%2011.1324%2038.1712%2014.0262%2030.1931L25.368%200.1875H18.8734Z'%20fill='%23A61E69'/%3e%3c/svg%3e";var aO=function(t){var n,r,i=t.className,s=dn(),o=s.pathname,a=Eb({query:{select:function(m){var p=m.data;return p}}}),l=a.data,c=a.isLoading,u=kE(),d=u.mutate,f=u.isPending,h=function(m){if(m.preventDefault(),!f)return d()};return y.jsxs("div",{className:Se("ystaii-sidemenu"),children:[y.jsx("div",{className:"ystaii-mobile-menu lg:yst-hidden",children:y.jsx(O.SidebarNavigation,{activePath:o,children:y.jsx(O.SidebarNavigation.Mobile,{closeButtonScreenReaderText:"Close sidebar",openButtonScreenReaderText:"Open sidebar",children:y.jsx(pg,{})})})}),y.jsxs("div",{className:Se("ystaii-menuHeader","yst-mb-6 yst-mt-10 yst-flex yst-flex-row yst-items-center yst-justify-between yst-px-4","lg:yst-flex-col lg:yst-items-start lg:yst-space-y-12"),children:[y.jsx(O.Title,{children:y.jsx(Hr,{className:Se("yst-outline-none"),to:"/",children:y.jsx("img",{src:oO,alt:"Yoast",className:"yst-inline-block yst-h-8"})})}),y.jsxs("div",{className:Se("ystaii-userInfoContainer","yst-flex yst-flex-col"),children:[y.jsx("p",{children:y.jsx("b",{children:(l==null||(n=l.data)===null||n===void 0?void 0:n.name)||y.jsx(O.SkeletonLoader,{children:"Display name"})})}),y.jsx("p",{children:(l==null||(r=l.data)===null||r===void 0?void 0:r.email)||y.jsx(O.SkeletonLoader,{children:"loading-email@address.com"})}),y.jsx("p",{children:y.jsx(O.Link,{variant:"primary",className:"yst-no-underline",onClick:h,children:c?y.jsxs(O.SkeletonLoader,{children:["Sign out ",y.jsx("span",{"aria-hidden":"true",children:"โ†’"})]}):f?y.jsx(y.Fragment,{children:"Signing out..."}):y.jsxs(y.Fragment,{children:["Sign out ",y.jsx("span",{"aria-hidden":"true",children:"โ†’"})]})})})]})]}),y.jsx("div",{className:Se("ystaii-desktopMenu","yst-hidden","lg:yst-mb-0 lg:yst-block lg:yst-w-full lg:yst-shrink-0"),children:y.jsx(O.SidebarNavigation,{activePath:o,children:y.jsx(pg,{className:i})})})]})},Db=jx.a.withConfig({displayName:"SkipLink",componentId:"sc-40h6pc-0"})(["position:absolute;top:-1000em;left:10px;z-index:100000;display:block;height:48px;min-width:150px;padding:0 15px;font-size:14px;line-height:48px;background:var(--bg-color-white);border-radius:3px;box-shadow:0px 2px 2px 2px rgba(0,0,0,0.1);text-decoration:underline;text-align:center;outline:none;&:focus{top:10px;color:var(--text-color-blue);}"]);Db.defaultProps={href:"#content"};function ou(e){var t=e.children,n=e.disable,r=n===void 0?!1:n,i=e.hideNav,s=i===void 0?!1:i;return r?t:y.jsxs("div",{className:Se("ystaii-layout","yst-block","lg:yst-flex lg:yst-min-h-full lg:yst-overflow-hidden"),children:[y.jsx(Db,{children:"Skip to main content"}),!s&&y.jsx("div",{className:Se("ystaii-sidebar","yst-overflow-hidden","lg:yst-flex-grow-1 lg:yst-max-w-[300px] lg:yst-flex-shrink-0 lg:yst-basis-[300px] lg:yst-overflow-visible lg:yst-pl-4"),children:y.jsx(aO,{})}),y.jsx("main",{className:Se("ystaii-main","yst-mx-4 yst-my-0 yst-flex yst-min-w-0 yst-shrink yst-grow yst-basis-auto yst-px-0 yst-py-6","lg:yst-ml-12 lg:yst-mr-6"),children:y.jsx("div",{className:Se("ystaii-main-content","yst-mx-auto yst-flex yst-flex-col yst-gap-8","lg:yst-w-full lg:yst-flex-row"),children:y.jsx("div",{className:"yst-layout-root yst-mx-auto yst-w-full yst-max-w-[1200px] yst-flex-1",children:t})})})]})}function mf(e){var t=e.children,n=e.description,r=e.title;return y.jsxs(O.Paper.Header,{children:[r&&y.jsx(O.Title,{className:Se({"yst-mb-3":n||t}),children:r}),n&&(typeof n=="string"?y.jsx("p",{children:n}):n),t]})}var lO={HOME:"/"},cO=function(t){var n=t.hideNav,r=n===void 0?!1:n,i=t.disableLayout,s=i===void 0?!1:i,o=dn(),a=zr(),l={disable:s,hideNav:r},c=zt(),u=c.brandId,d=yf(),f=d.setBrandId,h=kc({query:{refetchOnReconnect:!1,refetchOnWindowFocus:!1,select:function(C){var A;return C==null||(A=C.data)===null||A===void 0||(A=A.data)===null||A===void 0?void 0:A.brands}}}),g=h.data,m=h.isLoading,p=h.error,b=h.refetch,v=W.useRef(!1),S=W.useMemo(function(){return g==null?void 0:g.find(function(_){return _.id===u})},[g,u]);W.useEffect(function(){var _;if(!(g===void 0||u)){var C=(_=g[0])===null||_===void 0?void 0:_.id;C&&f(C)}},[g,u,f,a,o.pathname]),W.useEffect(function(){!u||v.current||(v.current=!0)},[S,u,a,o.pathname,g]);var w=W.useCallback(function(){b()},[b]),x=["Loading your brands...","Preparing your dashboard...","Checking analysis status...","Almost ready!"];return o.pathname!==lO.HOME&&m?y.jsx(ou,{...l,children:y.jsxs(O.Paper,{className:"yst-mx-auto yst-max-w-2xl",children:[y.jsx(mf,{title:y.jsx(O.SkeletonLoader,{className:"yst-h-12 yst-w-36"}),description:y.jsx(O.SkeletonLoader,{className:"yst-h-6 yst-w-3/4"})}),y.jsx(O.Paper.Content,{children:y.jsx("div",{className:"yst-flex yst-min-h-screen yst-items-start yst-justify-center",children:y.jsx("div",{className:"yst-w-full yst-space-y-4",children:y.jsx("div",{className:"yst-space-y-4",children:x.map(function(_,C){return y.jsx(O.SkeletonLoader,{children:_},C)})})})})})]})}):p?y.jsx(ou,{...l,children:y.jsx("div",{className:"yst-flex yst-min-h-screen yst-items-center yst-justify-center",children:y.jsxs("div",{className:"yst-space-y-4 yst-text-center",children:[y.jsx("div",{className:"yst-mb-4 yst-text-6xl yst-text-red-600",children:"โš ๏ธ"}),y.jsx("h2",{className:"yst-text-xl yst-font-semibold yst-text-slate-900",children:"Something went wrong"}),y.jsx("p",{className:"yst-text-slate-600",children:"We couldn't load your Brand Analysis. Please try again shortly."}),y.jsx(O.Button,{variant:"primary",onClick:w,children:"Retry"})]})})}):y.jsx(ou,{...l,children:y.jsx(dc,{})})},uO="http://localhost:8000";function dO(){W.useEffect(function(){nt.get("".concat(uO,"/sanctum/csrf-cookie"),{withCredentials:!0}).catch(function(e){console.error("Failed to fetch CSRF cookie:",e)})},[])}function fO(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{fillRule:"evenodd",d:"M14.707 12.293a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L9 14.586V3a1 1 0 012 0v11.586l2.293-2.293a1 1 0 011.414 0z",clipRule:"evenodd"}))}const hO=T.forwardRef(fO);function gO(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{fillRule:"evenodd",d:"M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z",clipRule:"evenodd"}))}const yO=T.forwardRef(gO);function mO(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{fillRule:"evenodd",d:"M5.293 7.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 5.414V17a1 1 0 11-2 0V5.414L6.707 7.707a1 1 0 01-1.414 0z",clipRule:"evenodd"}))}const pO=T.forwardRef(mO);function bO(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"}))}const vO=T.forwardRef(bO);function xO(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"}))}const wO=T.forwardRef(xO);function SO(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),T.createElement("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"}))}const CO=T.forwardRef(SO);function _O(e,t){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),T.createElement("path",{fillRule:"evenodd",d:"M2 5a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 01-2 2H4a2 2 0 01-2-2V5zm14 1a1 1 0 11-2 0 1 1 0 012 0zM2 13a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 01-2 2H4a2 2 0 01-2-2v-2zm14 1a1 1 0 11-2 0 1 1 0 012 0z",clipRule:"evenodd"}))}const kO=T.forwardRef(_O);var EO=["children","as","className"];function OO(e,t){if(e==null)return{};var n,r,i=AO(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function AO(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Fs=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var s=t.reduce(function(o,a,l){return o+a+(r[l]||"")},"");return function(o){var a=o.children,l=o.as,c=l===void 0?"div":l,u=o.className,d=u===void 0?"":u,f=OO(o,EO);return y.jsx(c,{className:Se(s.trim(),d),...f,children:a})}};function Ko(e){"@babel/helpers - typeof";return Ko=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ko(e)}var TO=["children","as","startColor","endColor","angle","disabled","style","className"];function bg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bg(Object(n),!0).forEach(function(r){PO(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PO(e,t,n){return(t=MO(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MO(e){var t=$O(e,"string");return Ko(t)=="symbol"?t:t+""}function $O(e,t){if(Ko(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ko(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jO(e,t){if(e==null)return{};var n,r,i=DO(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function DO(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var pf=function(t){var n=t.children,r=t.as,i=r===void 0?"span":r,s=t.startColor,o=s===void 0?"#A61E69":s,a=t.endColor,l=a===void 0?"#6366F1":a,c=t.angle,u=c===void 0?102:c,d=t.disabled,f=d===void 0?!1:d,h=t.style,g=h===void 0?{}:h,m=t.className,p=m===void 0?"":m,b=jO(t,TO),v=vg(f?{display:"inline-block"}:{background:"linear-gradient(".concat(u,"deg, ").concat(o,", ").concat(l,")"),WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text",display:"inline-block"},g);return y.jsx(i,{className:p,style:v,...b,children:n})};function bf(e){var t=e.children,n=e.nestedInPaperContent,r=n===void 0?!1:n,i=e.className;return y.jsx("div",{className:Se("yst-mt-8 yst-flex yst-items-center yst-justify-end yst-gap-6 yst-rounded-bl-lg yst-rounded-br-lg yst-border-t yst-border-slate-200 yst-bg-slate-50 yst-px-8 yst-py-6",{"yst-mb-[-2rem] yst-ml-[-2rem] yst-mr-[-2rem]":r},i),children:t})}var LO=["Icon","className","children","placement","id"];function IO(e,t){return BO(e)||NO(e,t)||FO(e,t)||RO()}function RO(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
26
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FO(e,t){if(e){if(typeof e=="string")return xg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xg(e,t):void 0}}function xg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function NO(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function BO(e){if(Array.isArray(e))return e}function qO(e,t){if(e==null)return{};var n,r,i=zO(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function zO(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Oc(e){var t=e.Icon,n=t===void 0?VE:t,r=e.className,i=r===void 0?"":r,s=e.children,o=e.placement,a=o===void 0?"top":o,l=e.id,c=l===void 0?"":l,u=qO(e,LO),d=W.useState(!1),f=IO(d,2),h=f[0],g=f[1];return s?y.jsxs("div",{className:i||"yst-relative",onMouseEnter:function(){return g(!0)},onMouseLeave:function(){return g(!1)},"aria-describedby":c?"tooltip-button-id":"tooltip-button",...u,children:[y.jsx(n,{className:"yst-relative yst-h-6 yst-w-6 yst-text-slate-400"}),h&&y.jsx(O.Tooltip,{placement:a,id:c||"tooltip-button",children:s})]}):null}var wg;function HO(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var UO=Fs(wg||(wg=HO(["yst-font-medium yst-text-slate-800"]))),Lb=function(){var t=zr();return y.jsx("form",{onSubmit:function(){return t("/setup")},children:y.jsxs(O.Paper,{className:"yst-mx-auto yst-flex yst-max-w-2xl",children:[y.jsx(O.Paper.Header,{children:y.jsxs(O.Title,{size:"1",children:["Welcome to ",y.jsx(pf,{children:"Yoast AI Brand Insights"}),"!"]})}),y.jsxs(O.Paper.Content,{className:"yst-space-y-8",children:[y.jsxs("div",{className:"yst-space-y-4 *:yst-text-tiny",children:[y.jsx("p",{children:"See how your brand is represented in AI answers"}),y.jsxs("p",{children:[y.jsx("b",{className:"yst-font-medium yst-text-slate-800",children:"Yoast AI Brand Insights"})," ","shows how often your brand appears, how it's described, and how it compares to competitors in tools like ChatGPT and Perplexity."]}),y.jsx("p",{children:"It only takes three simple steps to get your brand insights:"})]}),y.jsx("div",{className:"yst-flex yst-flex-col yst-items-stretch yst-justify-stretch yst-gap-4 yst-pb-8",children:[{title:"1. ADD BRAND INFO",description:"Tell us about your brand and where it's active so we can customize your analysis."},{title:"2. REVIEW QUERIES",description:"Edit or approve the queries generated from your input."},{title:"3. RUN ANALYSIS",description:"Run your queries through relevant AI models to see how your brand shows up."}].map(function(n,r,i){return y.jsxs("div",{className:"yst-relative yst-flex yst-flex-col yst-items-stretch",children:[y.jsxs("div",{className:"yst-flex yst-flex-row yst-items-center yst-justify-stretch yst-gap-6",children:[y.jsx(O.Stepper.Step,{isActive:!0,isComplete:!1}),y.jsxs("div",{className:"yst-flex yst-flex-1 yst-flex-col yst-gap-2 yst-rounded yst-border yst-border-slate-200 yst-p-6",children:[y.jsx(O.Title,{size:"3",className:"yst-font-semibold yst-uppercase",children:n.title}),y.jsx("p",{children:n.description})]})]}),r<i.length-1&&y.jsx("div",{className:"yst-absolute yst-left-[-2px] yst-top-1/2 yst-my-0 yst-ml-[13px] yst-h-full yst-border-l-2 yst-border-l-primary-600"})]},n.title)})})]}),y.jsxs(bf,{className:"yst-justify-between",children:[y.jsxs("p",{className:"yst-flex yst-items-center yst-justify-start yst-gap-1",children:[y.jsxs("i",{children:[y.jsx(UO,{as:"span",className:"yst-font-medium",children:"Note:"})," ","You'll use sparks because this analysis uses AI."]}),y.jsx(Oc,{content:"Sparks are the currency used for AI analysis.",children:y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx("p",{children:y.jsx("b",{children:"Sparks power Yoast's AI tools"})}),y.jsx("p",{children:"Each time you use an AI feature, it uses a few sparks."}),y.jsxs("ul",{className:"yst-ml-6 yst-list-disc",children:[y.jsxs("li",{children:[y.jsx("b",{children:"Generate queries (up to 5):"})," 1 spark"]}),y.jsxs("li",{children:[y.jsx("b",{children:"Run an analysis:"})," 5 sparks"]})]}),y.jsxs("p",{children:["Starting now, you'll see a ",y.jsx("b",{children:"spark counter"})," next to each AI button. That way, you'll always know how many sparks you have before using a tool."]})]})})]}),y.jsxs(O.Button,{variant:"primary",onClick:function(){return t("/setup")},className:"yst-gap-1.5",children:["Start your first analysis ",y.jsx(yO,{})]})]})]})})};function Kl(e){return typeof e!="number"?{}:{"yst-text-green-600":e>0,"yst-text-red-600":e<0,"yst-text-gray-400":e===0}}function Ea(e){var t=e.score,n=e.total,r=e.suffix,i=e.isLoading,s=i===void 0?!1:i,o=e.className,a=e.hideTotal,l=a===void 0?!1:a,c=e.delta,u=e.deltaFormat,d=u===void 0?"absolute":u,f=e.deltaSuffix;return y.jsxs("div",{className:Se(o,"yst-font-medium"),children:[y.jsx("span",{className:"yst-mr-1 yst-text-xl yst-font-bold yst-text-slate-900",children:s||!t?"โ€”":t}),!l&&n&&n!==0&&n!=="0"&&y.jsxs("span",{className:"yst-text-slate-500",children:["/ ",s?"โ€”":n]}),r&&y.jsxs("span",{className:"yst-text-slate-500",children:[" ",r]}),c&&y.jsxs("span",{className:Se("yst-ml-2",Kl(c)),children:[c>-1&&"+",c,d==="percentage"&&"%"," ",f]})]})}var Ns=function(t){var n=t.title,r=t.tooltip,i=t.size,s=i===void 0?"3":i,o=t.className,a=o===void 0?"":o,l=function(d){var f=typeof d=="string"?d:"tooltip";return"tooltip-".concat(f.toLowerCase().replace(/\s+/g,"-"))},c=l(n);return y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between ".concat(a),children:[y.jsx(O.Title,{size:s,children:n}),y.jsx(Oc,{id:c,children:r})]})},Sg=function(t){var n=t.keywords,r=t.badgeClassName;return y.jsx("div",{className:"yst-flex yst-flex-wrap yst-gap-2",children:n.map(function(i){return y.jsx(O.Badge,{className:r,children:i},i)})})},Ib=function(t){var n=t.title,r=n===void 0?"Sentiment":n,i=t.tooltip,s=i===void 0?"":i,o=t.brandName,a=o===void 0?"":o,l=t.data,c=l==null?void 0:l.sentiment,u=l==null?void 0:l.delta;return y.jsx(O.Card,{className:"yst-overflow-visible",children:y.jsxs(O.Card.Content,{className:"yst-space-y-8",children:[y.jsxs("div",{className:"yst-space-y-3",children:[y.jsx(Ns,{title:r,tooltip:s}),y.jsx("p",{children:a||y.jsx(O.SkeletonLoader,{className:"yst-h-6 yst-w-20"})}),y.jsxs("div",{children:[y.jsx("div",{className:"yst-inline-flex",children:y.jsx(Ea,{className:"yst-mb-1.5",score:"".concat(c||"โ€”","%"),suffix:"positive",delta:u,deltaFormat:"percentage"})}),y.jsx(O.ProgressBar,{max:100,min:0,progress:c||0,className:Se({"yst-bg-red-500":c},"[&>*]:yst-bg-green-500")})]})]}),y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(O.Title,{as:"h5",size:"5",children:"Positive keywords"}),y.jsx(Sg,{keywords:[],badgeClassName:"yst-bg-green-100 yst-text-green-800"})]}),y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(O.Title,{as:"h5",size:"5",children:"Negative keywords"}),y.jsx(Sg,{keywords:[],badgeClassName:"yst-bg-red-100 yst-text-red-800"})]})]})]})})};function KO(){var e=zt(),t=e.brandId,n=e.analysisId,r=zn(t,n,{query:{enabled:!!t,select:function(o){var a;return o==null||(a=o.data)===null||a===void 0||(a=a.data)===null||a===void 0?void 0:a.sentimentBrand}}}),i=r.data;return y.jsx(Ib,{title:"Brand Sentiment",brandName:i==null?void 0:i.brandName,data:i,tooltip:"Percentage of positive versus negative keywords in your query results related to your brand."})}var au=[{bg:"yst-bg-blue-200",text:"yst-text-blue-900"},{bg:"yst-bg-green-200",text:"yst-text-green-900"},{bg:"yst-bg-purple-200",text:"yst-text-purple-900"},{bg:"yst-bg-pink-200",text:"yst-text-pink-900"},{bg:"yst-bg-yellow-200",text:"yst-text-yellow-900"},{bg:"yst-bg-indigo-200",text:"yst-text-indigo-900"},{bg:"yst-bg-red-200",text:"yst-text-red-900"},{bg:"yst-bg-orange-200",text:"yst-text-orange-900"},{bg:"yst-bg-teal-200",text:"yst-text-teal-900"},{bg:"yst-bg-cyan-200",text:"yst-text-cyan-900"},{bg:"yst-bg-lime-200",text:"yst-text-lime-900"},{bg:"yst-bg-emerald-200",text:"yst-text-emerald-900"},{bg:"yst-bg-sky-200",text:"yst-text-sky-900"},{bg:"yst-bg-violet-200",text:"yst-text-violet-900"},{bg:"yst-bg-fuchsia-200",text:"yst-text-fuchsia-900"},{bg:"yst-bg-rose-200",text:"yst-text-rose-900"},{bg:"yst-bg-amber-200",text:"yst-text-amber-900"}],Cg=function(t){if(!t)return au[0];if(t.toLowerCase()==="other")return{bg:"yst-bg-slate-200",text:"yst-text-slate-900"};for(var n=0,r=0;r<t.length;r++){var i=t.charCodeAt(r);n=(n<<5)-n+i,n=n&n}var s=Math.abs(n)%au.length;return au[s]},_g;function WO(e){return QO(e)||GO(e)||Rb(e)||VO()}function VO(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
27
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GO(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function QO(e){if(Array.isArray(e))return _d(e)}function YO(e,t){return ZO(e)||JO(e,t)||Rb(e,t)||XO()}function XO(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
28
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rb(e,t){if(e){if(typeof e=="string")return _d(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_d(e,t):void 0}}function _d(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function JO(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function ZO(e){if(Array.isArray(e))return e}function e3(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Va=Fs(_g||(_g=e3(["md:yst-hidden yst-mr-2 yst-font-medium yst-text-slate-400 yst-inline-flex yst-w-20"]))),kg=function(t){var n=t.data,r=t.isLoading,i=r===void 0?!1:r,s=i||!n,o=n||{},a=o.rank,l=o.url,c=o.rootDomain,u=o.category,d=o.impact,f=o.mentions;return y.jsxs("tr",{className:"yst-flex yst-flex-col md:yst-table-row",children:[y.jsx(O.Table.Cell,{className:"yst-pb-1 md:yst-pb-2",children:s?y.jsx(O.SkeletonLoader,{className:"yst-h-6 yst-w-full"}):y.jsxs("div",{className:"yst-flex yst-items-center yst-gap-2",children:[y.jsxs("span",{className:"yst-text-slate-400",children:[a!=null?a:"โ€”","."]}),y.jsxs(O.Link,{className:"yst-flex yst-items-center yst-gap-1 yst-font-medium",href:l||"#",rel:"nofollow noreferrer",children:[y.jsx("span",{children:l!=null?l:"โ€”"})," ",y.jsx(CO,{})]})]})}),y.jsxs(O.Table.Cell,{className:"yst-ml-2 yst-py-1 yst-font-medium md:yst-ml-0 md:yst-p-2 md:yst-p-4",children:[y.jsx(Va,{as:"span",children:"Domain:"}),s?y.jsx(O.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsx("span",{className:"yst-font-medium yst-text-slate-900",children:c!=null?c:"โ€”"})]}),y.jsxs(O.Table.Cell,{className:"yst-ml-2 yst-py-1 md:yst-ml-0 md:yst-p-2 md:yst-p-4",children:[y.jsx(Va,{as:"span",children:"Category:"}),s?y.jsx(O.SkeletonLoader,{className:"yst-h-6 yst-w-16"}):y.jsx(O.Badge,{className:Se(Cg(u||"").bg,Cg(u||"").text),children:u!=null?u:"โ€”"})]}),y.jsxs(O.Table.Cell,{className:Se("yst-ml-2 yst-py-0 md:yst-ml-0 md:yst-p-2 md:yst-p-4","yst-font-medium",{"yst-text-green-600":d==="High","yst-text-yellow-600":d==="Medium","yst-text-red-600":d==="Low"}),children:[y.jsx(Va,{as:"span",children:"Impact:"}),s?y.jsx(O.SkeletonLoader,{className:"yst-h-6 yst-w-12"}):d!=null?d:"โ€”"]}),y.jsxs(O.Table.Cell,{className:"yst-ml-2 yst-pt-1 md:yst-ml-0 md:yst-p-2 md:yst-p-4 md:yst-text-right",children:[y.jsx(Va,{as:"span",children:"Mentions:"}),s?y.jsx(O.SkeletonLoader,{className:"yst-h-6 yst-w-8"}):f?f.includes("/")?y.jsxs("span",{className:"yst-text-slate-500",children:[y.jsx("span",{className:"yst-text-slate-900",children:f.split("/")[0]})," ","/ ",f.split("/")[1]]}):f:"โ€”"]})]},s?void 0:l)},t3=function(){var t,n=!1,r=W.useState("all"),i=YO(r,2),s=i[0],o=i[1],a=zt(),l=a.brandId,c=a.analysisId,u=zn(l,c,{query:{enabled:!!l,select:function(m){var p;return m==null||(p=m.data)===null||p===void 0||(p=p.data)===null||p===void 0?void 0:p.citations}}}),d=u.data,f=u.isLoading,h=d==null||(t=d.results)===null||t===void 0?void 0:t.filter(function(g){return s==="all"?!0:g.category===s});return y.jsx(O.Card,{className:"yst-overflow-visible md:yst-col-span-2",children:y.jsxs(O.Card.Content,{className:"yst-flex yst-flex-col yst-gap-6",children:[y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx(Ns,{title:"Citations",tooltip:"Sources the AI used to support brand mentions in the results."}),y.jsx("p",{children:"This table highlights the most important sources where your brand was cited."}),y.jsx(Ea,{score:d==null?void 0:d.total,suffix:"citations",delta:d==null?void 0:d.delta,deltaSuffix:"since last scan",isLoading:f,hideTotal:!0})]}),y.jsxs(y.Fragment,{children:[y.jsxs("div",{children:[y.jsx(O.Select,{className:"yst-mb-4 md:yst-max-w-sm",label:"Filter categories",value:s,onChange:function(g){o(g)},id:"citation-category-filter",options:[{value:"all",label:"All categories"}].concat(WO(d!=null&&d.categories?d.categories.map(function(g){return{value:g,label:g}}):[]))}),y.jsxs(O.Table,{variant:"minimal",children:[y.jsx(O.Table.Head,{className:"yst-font-semibold",children:y.jsxs(O.Table.Row,{children:[y.jsx(O.Table.Cell,{className:"yst yst-hidden yst-text-slate-900 md:yst-table-cell",children:y.jsx("span",{className:"yst-hidden md:yst-inline",children:"URL"})}),y.jsx(O.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell",children:"Root domain"}),y.jsx(O.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell",children:"Category"}),y.jsx(O.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell",children:"Impact"}),y.jsx(O.Table.Cell,{className:"yst-hidden yst-text-right yst-text-slate-900 md:yst-table-cell",children:"Mentions"})]})}),y.jsx(O.Table.Body,{children:d!=null&&d.results?h&&h.length>0?h.map(function(g){return y.jsx(kg,{data:g},g.url)}):y.jsx(O.Table.Row,{children:y.jsxs(O.Table.Cell,{colSpan:5,className:"yst-py-8 yst-text-center yst-text-slate-500",children:[s==="all"?"No citations found.":'No citations found for the "'.concat(s,'" category.')," ",y.jsx(O.Link,{onClick:function(){return o("all")},children:"Show all categories."})]})},"no-results"):Array.from({length:5}).map(function(g,m){return y.jsx(kg,{isLoading:!0},"skeleton-".concat(m))})})]})]}),n]})]})})};function n3(e,t){var n=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Fb(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
29
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,o=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return o=c.done,c},e:function(c){a=!0,s=c},f:function(){try{o||n.return==null||n.return()}finally{if(a)throw s}}}}function r3(e,t){return o3(e)||s3(e,t)||Fb(e,t)||i3()}function i3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
30
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fb(e,t){if(e){if(typeof e=="string")return Eg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Eg(e,t):void 0}}function Eg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s3(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function o3(e){if(Array.isArray(e))return e}var Og=function(t){var n,r,i=t.data,s=t.isLoading,o=s===void 0?!1:s,a=t.isWideEnough,l=a===void 0?!1:a,c=o||!i,u=i||{},d=u.rank,f=u.delta,h=u.brand,g=u.mentions;return y.jsxs(O.Table.Row,{children:[y.jsx(O.Table.Cell,{children:c?y.jsx(O.SkeletonLoader,{className:"yst-h-6 yst-w-8"}):y.jsxs("span",{className:"yst-inline-flex yst-gap-2 yst-font-medium",children:[y.jsxs("span",{className:"yst-text-slate-500",children:["# ",y.jsx("span",{className:"yst-text-slate-900",children:d})]}),typeof f=="number"&&y.jsxs("span",{className:Se(Kl(f),"yst-ml-2 yst-flex yst-w-8 yst-justify-center yst-gap-1",{"yst-hidden":!l,"yst-inline-flex":l}),children:[f>0&&y.jsxs(y.Fragment,{children:[f,y.jsx(wO,{})]}),f<0&&y.jsxs(y.Fragment,{children:[f,y.jsx(vO,{})]}),f===0&&"="]})]})}),y.jsx(O.Table.Cell,{children:c?y.jsx(O.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsx("span",{className:"yst-font-medium",children:h==="Manna"?y.jsx(pf,{children:h}):h})}),y.jsx(O.Table.Cell,{className:"yst-text-right",children:c?y.jsx(O.SkeletonLoader,{className:"yst-h-6 yst-w-16"}):g?y.jsxs("div",{className:"yst-flex yst-justify-end",children:[y.jsxs("span",{className:"yst-text-slate-500",children:[y.jsx("span",{className:"yst-font-medium yst-text-slate-900",children:(n=g.found)!==null&&n!==void 0?n:"โ€”"})," ","/ ",(r=g.total)!==null&&r!==void 0?r:"โ€”"]}),y.jsxs("div",{className:Se("yst-ml-2 yst-w-6",{"yst-hidden":!l,"yst-inline-flex":l},Kl(g.delta)),children:[typeof(g==null?void 0:g.delta)=="number"&&g.delta>=0&&"+",g==null?void 0:g.delta]})]}):null})]},c?void 0:d)},a3=function(t){var n=t.className,r=W.useRef(null),i=W.useState(!1),s=r3(i,2),o=s[0],a=s[1],l=zt(),c=l.brandId,u=l.analysisId,d=zn(c,u,{query:{enabled:!!c&&!!u,select:function(m){var p,b=m.data;return b==null||(p=b.data)===null||p===void 0?void 0:p.ranking}}}),f=d.data,h=d.isLoading;return W.useEffect(function(){var g=r.current;if(g){var m=new ResizeObserver(function(p){var b=n3(p),v;try{for(b.s();!(v=b.n()).done;){var S=v.value;a(S.contentRect.width>400)}}catch(w){b.e(w)}finally{b.f()}});return m.observe(g),function(){return m.disconnect()}}},[]),y.jsx(O.Card,{ref:r,className:Se("yst-overflow-visible",n),children:y.jsxs(O.Card.Content,{className:"yst-mt-0 yst-space-y-6",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(Ns,{title:"Competitor ranking",tooltip:"How often competitors are mentioned in your submitted queries."}),y.jsx("p",{children:"Brands with the most mentions for your prompts."})]}),y.jsxs(O.Table,{variant:"minimal",children:[y.jsx(O.Table.Head,{children:y.jsxs(O.Table.Row,{children:[y.jsx(O.Table.Cell,{children:"Rank"}),y.jsx(O.Table.Cell,{children:"Brand"}),y.jsx(O.Table.Cell,{className:"yst-text-right",children:"Mentions"})]})}),y.jsx(O.Table.Body,{children:f&&Array.isArray(f)&&f.length>0?f.map(function(g){return y.jsx(Og,{data:g,isWideEnough:o},g.rank||Math.random())}):h?Array.from({length:5}).map(function(g,m){return y.jsx(Og,{isLoading:!0,isWideEnough:o},"skeleton-".concat(m))}):y.jsx(O.Table.Row,{children:y.jsx(O.Table.Cell,{colSpan:3,className:"yst-py-8 yst-text-center yst-text-slate-500",children:"No competitor ranking data available."})})})]})]})})},l3=function(){var t,n=zt(),r=n.brandId,i=n.analysisId,s=zn(r,i,{query:{enabled:!!r}}),o=s.data,a=o==null||(t=o.data)===null||t===void 0||(t=t.data)===null||t===void 0?void 0:t.sentimentCompetitor;return y.jsx(Ib,{title:"Competitor sentiment",brandName:a==null?void 0:a.brandName,data:a,tooltip:"Percentage of positive versus negative keywords in your query results related to your competitor's brand."})},vf=function(t){var n=t.isOpen,r=t.onClose,i=t.onConfirm,s=t.isLoading,o=s===void 0?!1:s,a=t.title,l=t.description,c=t.disabled,u=c===void 0?!1:c,d=t.confirmText,f=d===void 0?"Yes, delete":d,h=t.cancelText,g=h===void 0?"No, go back":h,m=t.className;return y.jsx(O.Modal,{isOpen:n,onClose:r,position:"center",as:"div",className:m,children:y.jsxs(O.Modal.Panel,{children:[y.jsxs("div",{className:"yst-flex yst-items-start yst-justify-stretch yst-gap-4",children:[y.jsx("div",{children:y.jsx("span",{className:"yst-inline-flex yst-h-10 yst-w-10 yst-items-center yst-justify-center yst-rounded-full yst-bg-red-100",children:y.jsx(qE,{className:"yst-h-6 yst-w-6 yst-text-red-600"})})}),y.jsxs("div",{className:"yst-flex-1",children:[y.jsx(O.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(O.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:a})}),y.jsx(O.Modal.Container.Content,{className:"yst-mb-4 yst-space-y-3",children:typeof l=="string"?y.jsx("p",{children:l}):l})]})]}),y.jsxs(O.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:[y.jsx(O.Button,{variant:"secondary",onClick:r,children:g}),y.jsx(O.Button,{variant:"error",onClick:i,isLoading:o,disabled:u,children:f})]})]})})},Ga={exports:{}},Qa={exports:{}},Fe={};/** @license React v16.13.1
31
+ * react-is.production.min.js
32
+ *
33
+ * Copyright (c) Facebook, Inc. and its affiliates.
34
+ *
35
+ * This source code is licensed under the MIT license found in the
36
+ * LICENSE file in the root directory of this source tree.
37
+ */var Ag;function c3(){if(Ag)return Fe;Ag=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,p=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function S(x){if(typeof x=="object"&&x!==null){var _=x.$$typeof;switch(_){case t:switch(x=x.type,x){case l:case c:case r:case s:case i:case d:return x;default:switch(x=x&&x.$$typeof,x){case a:case u:case g:case h:case o:return x;default:return _}}case n:return _}}}function w(x){return S(x)===c}return Fe.AsyncMode=l,Fe.ConcurrentMode=c,Fe.ContextConsumer=a,Fe.ContextProvider=o,Fe.Element=t,Fe.ForwardRef=u,Fe.Fragment=r,Fe.Lazy=g,Fe.Memo=h,Fe.Portal=n,Fe.Profiler=s,Fe.StrictMode=i,Fe.Suspense=d,Fe.isAsyncMode=function(x){return w(x)||S(x)===l},Fe.isConcurrentMode=w,Fe.isContextConsumer=function(x){return S(x)===a},Fe.isContextProvider=function(x){return S(x)===o},Fe.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===t},Fe.isForwardRef=function(x){return S(x)===u},Fe.isFragment=function(x){return S(x)===r},Fe.isLazy=function(x){return S(x)===g},Fe.isMemo=function(x){return S(x)===h},Fe.isPortal=function(x){return S(x)===n},Fe.isProfiler=function(x){return S(x)===s},Fe.isStrictMode=function(x){return S(x)===i},Fe.isSuspense=function(x){return S(x)===d},Fe.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===r||x===c||x===s||x===i||x===d||x===f||typeof x=="object"&&x!==null&&(x.$$typeof===g||x.$$typeof===h||x.$$typeof===o||x.$$typeof===a||x.$$typeof===u||x.$$typeof===p||x.$$typeof===b||x.$$typeof===v||x.$$typeof===m)},Fe.typeOf=S,Fe}var Ne={};/** @license React v16.13.1
38
+ * react-is.development.js
39
+ *
40
+ * Copyright (c) Facebook, Inc. and its affiliates.
41
+ *
42
+ * This source code is licensed under the MIT license found in the
43
+ * LICENSE file in the root directory of this source tree.
44
+ */var Tg;function u3(){return Tg||(Tg=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,p=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function S(J){return typeof J=="string"||typeof J=="function"||J===r||J===c||J===s||J===i||J===d||J===f||typeof J=="object"&&J!==null&&(J.$$typeof===g||J.$$typeof===h||J.$$typeof===o||J.$$typeof===a||J.$$typeof===u||J.$$typeof===p||J.$$typeof===b||J.$$typeof===v||J.$$typeof===m)}function w(J){if(typeof J=="object"&&J!==null){var rt=J.$$typeof;switch(rt){case t:var mt=J.type;switch(mt){case l:case c:case r:case s:case i:case d:return mt;default:var jt=mt&&mt.$$typeof;switch(jt){case a:case u:case g:case h:case o:return jt;default:return rt}}case n:return rt}}}var x=l,_=c,C=a,A=o,k=t,P=u,$=r,j=g,Z=h,q=n,N=s,L=i,F=d,se=!1;function de(J){return se||(se=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),R(J)||w(J)===l}function R(J){return w(J)===c}function K(J){return w(J)===a}function ae(J){return w(J)===o}function fe(J){return typeof J=="object"&&J!==null&&J.$$typeof===t}function D(J){return w(J)===u}function le(J){return w(J)===r}function re(J){return w(J)===g}function we(J){return w(J)===h}function X(J){return w(J)===n}function ve(J){return w(J)===s}function xe(J){return w(J)===i}function Qe(J){return w(J)===d}Ne.AsyncMode=x,Ne.ConcurrentMode=_,Ne.ContextConsumer=C,Ne.ContextProvider=A,Ne.Element=k,Ne.ForwardRef=P,Ne.Fragment=$,Ne.Lazy=j,Ne.Memo=Z,Ne.Portal=q,Ne.Profiler=N,Ne.StrictMode=L,Ne.Suspense=F,Ne.isAsyncMode=de,Ne.isConcurrentMode=R,Ne.isContextConsumer=K,Ne.isContextProvider=ae,Ne.isElement=fe,Ne.isForwardRef=D,Ne.isFragment=le,Ne.isLazy=re,Ne.isMemo=we,Ne.isPortal=X,Ne.isProfiler=ve,Ne.isStrictMode=xe,Ne.isSuspense=Qe,Ne.isValidElementType=S,Ne.typeOf=w}()),Ne}var Pg;function Nb(){return Pg||(Pg=1,process.env.NODE_ENV==="production"?Qa.exports=c3():Qa.exports=u3()),Qa.exports}/*
45
+ object-assign
46
+ (c) Sindre Sorhus
47
+ @license MIT
48
+ */var lu,Mg;function d3(){if(Mg)return lu;Mg=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function i(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var o={},a=0;a<10;a++)o["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(o).map(function(u){return o[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch(u){return!1}}return lu=i()?Object.assign:function(s,o){for(var a,l=r(s),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var d in a)t.call(a,d)&&(l[d]=a[d]);if(e){c=e(a);for(var f=0;f<c.length;f++)n.call(a,c[f])&&(l[c[f]]=a[c[f]])}}return l},lu}var cu,$g;function xf(){if($g)return cu;$g=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return cu=e,cu}var uu,jg;function Bb(){return jg||(jg=1,uu=Function.call.bind(Object.prototype.hasOwnProperty)),uu}var du,Dg;function f3(){if(Dg)return du;Dg=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=xf(),n={},r=Bb();e=function(s){var o="Warning: "+s;typeof console!="undefined"&&console.error(o);try{throw new Error(o)}catch(a){}}}function i(s,o,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in s)if(r(s,u)){var d;try{if(typeof s[u]!="function"){var f=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}d=s[u](o,u,l,a,null,t)}catch(g){d=g}if(d&&!(d instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var h=c?c():"";e("Failed "+a+" type: "+d.message+(h!=null?h:""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},du=i,du}var fu,Lg;function h3(){if(Lg)return fu;Lg=1;var e=Nb(),t=d3(),n=xf(),r=Bb(),i=f3(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(a){var l="Warning: "+a;typeof console!="undefined"&&console.error(l);try{throw new Error(l)}catch(c){}});function o(){return null}return fu=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(R){var K=R&&(c&&R[c]||R[u]);if(typeof K=="function")return K}var f="<<anonymous>>",h={array:b("array"),bigint:b("bigint"),bool:b("boolean"),func:b("function"),number:b("number"),object:b("object"),string:b("string"),symbol:b("symbol"),any:v(),arrayOf:S,element:w(),elementType:x(),instanceOf:_,node:P(),objectOf:A,oneOf:C,oneOfType:k,shape:j,exact:Z};function g(R,K){return R===K?R!==0||1/R===1/K:R!==R&&K!==K}function m(R,K){this.message=R,this.data=K&&typeof K=="object"?K:{},this.stack=""}m.prototype=Error.prototype;function p(R){if(process.env.NODE_ENV!=="production")var K={},ae=0;function fe(le,re,we,X,ve,xe,Qe){if(X=X||f,xe=xe||we,Qe!==n){if(l){var J=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw J.name="Invariant Violation",J}else if(process.env.NODE_ENV!=="production"&&typeof console!="undefined"){var rt=X+":"+we;!K[rt]&&ae<3&&(s("You are manually calling a React.PropTypes validation function for the `"+xe+"` prop on `"+X+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),K[rt]=!0,ae++)}}return re[we]==null?le?re[we]===null?new m("The "+ve+" `"+xe+"` is marked as required "+("in `"+X+"`, but its value is `null`.")):new m("The "+ve+" `"+xe+"` is marked as required in "+("`"+X+"`, but its value is `undefined`.")):null:R(re,we,X,ve,xe)}var D=fe.bind(null,!1);return D.isRequired=fe.bind(null,!0),D}function b(R){function K(ae,fe,D,le,re,we){var X=ae[fe],ve=L(X);if(ve!==R){var xe=F(X);return new m("Invalid "+le+" `"+re+"` of type "+("`"+xe+"` supplied to `"+D+"`, expected ")+("`"+R+"`."),{expectedType:R})}return null}return p(K)}function v(){return p(o)}function S(R){function K(ae,fe,D,le,re){if(typeof R!="function")return new m("Property `"+re+"` of component `"+D+"` has invalid PropType notation inside arrayOf.");var we=ae[fe];if(!Array.isArray(we)){var X=L(we);return new m("Invalid "+le+" `"+re+"` of type "+("`"+X+"` supplied to `"+D+"`, expected an array."))}for(var ve=0;ve<we.length;ve++){var xe=R(we,ve,D,le,re+"["+ve+"]",n);if(xe instanceof Error)return xe}return null}return p(K)}function w(){function R(K,ae,fe,D,le){var re=K[ae];if(!a(re)){var we=L(re);return new m("Invalid "+D+" `"+le+"` of type "+("`"+we+"` supplied to `"+fe+"`, expected a single ReactElement."))}return null}return p(R)}function x(){function R(K,ae,fe,D,le){var re=K[ae];if(!e.isValidElementType(re)){var we=L(re);return new m("Invalid "+D+" `"+le+"` of type "+("`"+we+"` supplied to `"+fe+"`, expected a single ReactElement type."))}return null}return p(R)}function _(R){function K(ae,fe,D,le,re){if(!(ae[fe]instanceof R)){var we=R.name||f,X=de(ae[fe]);return new m("Invalid "+le+" `"+re+"` of type "+("`"+X+"` supplied to `"+D+"`, expected ")+("instance of `"+we+"`."))}return null}return p(K)}function C(R){if(!Array.isArray(R))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),o;function K(ae,fe,D,le,re){for(var we=ae[fe],X=0;X<R.length;X++)if(g(we,R[X]))return null;var ve=JSON.stringify(R,function(Qe,J){var rt=F(J);return rt==="symbol"?String(J):J});return new m("Invalid "+le+" `"+re+"` of value `"+String(we)+"` "+("supplied to `"+D+"`, expected one of "+ve+"."))}return p(K)}function A(R){function K(ae,fe,D,le,re){if(typeof R!="function")return new m("Property `"+re+"` of component `"+D+"` has invalid PropType notation inside objectOf.");var we=ae[fe],X=L(we);if(X!=="object")return new m("Invalid "+le+" `"+re+"` of type "+("`"+X+"` supplied to `"+D+"`, expected an object."));for(var ve in we)if(r(we,ve)){var xe=R(we,ve,D,le,re+"."+ve,n);if(xe instanceof Error)return xe}return null}return p(K)}function k(R){if(!Array.isArray(R))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var K=0;K<R.length;K++){var ae=R[K];if(typeof ae!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+se(ae)+" at index "+K+"."),o}function fe(D,le,re,we,X){for(var ve=[],xe=0;xe<R.length;xe++){var Qe=R[xe],J=Qe(D,le,re,we,X,n);if(J==null)return null;J.data&&r(J.data,"expectedType")&&ve.push(J.data.expectedType)}var rt=ve.length>0?", expected one of type ["+ve.join(", ")+"]":"";return new m("Invalid "+we+" `"+X+"` supplied to "+("`"+re+"`"+rt+"."))}return p(fe)}function P(){function R(K,ae,fe,D,le){return q(K[ae])?null:new m("Invalid "+D+" `"+le+"` supplied to "+("`"+fe+"`, expected a ReactNode."))}return p(R)}function $(R,K,ae,fe,D){return new m((R||"React class")+": "+K+" type `"+ae+"."+fe+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+D+"`.")}function j(R){function K(ae,fe,D,le,re){var we=ae[fe],X=L(we);if(X!=="object")return new m("Invalid "+le+" `"+re+"` of type `"+X+"` "+("supplied to `"+D+"`, expected `object`."));for(var ve in R){var xe=R[ve];if(typeof xe!="function")return $(D,le,re,ve,F(xe));var Qe=xe(we,ve,D,le,re+"."+ve,n);if(Qe)return Qe}return null}return p(K)}function Z(R){function K(ae,fe,D,le,re){var we=ae[fe],X=L(we);if(X!=="object")return new m("Invalid "+le+" `"+re+"` of type `"+X+"` "+("supplied to `"+D+"`, expected `object`."));var ve=t({},ae[fe],R);for(var xe in ve){var Qe=R[xe];if(r(R,xe)&&typeof Qe!="function")return $(D,le,re,xe,F(Qe));if(!Qe)return new m("Invalid "+le+" `"+re+"` key `"+xe+"` supplied to `"+D+"`.\nBad object: "+JSON.stringify(ae[fe],null," ")+`
49
+ Valid keys: `+JSON.stringify(Object.keys(R),null," "));var J=Qe(we,xe,D,le,re+"."+xe,n);if(J)return J}return null}return p(K)}function q(R){switch(typeof R){case"number":case"string":case"undefined":return!0;case"boolean":return!R;case"object":if(Array.isArray(R))return R.every(q);if(R===null||a(R))return!0;var K=d(R);if(K){var ae=K.call(R),fe;if(K!==R.entries){for(;!(fe=ae.next()).done;)if(!q(fe.value))return!1}else for(;!(fe=ae.next()).done;){var D=fe.value;if(D&&!q(D[1]))return!1}}else return!1;return!0;default:return!1}}function N(R,K){return R==="symbol"?!0:K?K["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&K instanceof Symbol:!1}function L(R){var K=typeof R;return Array.isArray(R)?"array":R instanceof RegExp?"object":N(K,R)?"symbol":K}function F(R){if(typeof R=="undefined"||R===null)return""+R;var K=L(R);if(K==="object"){if(R instanceof Date)return"date";if(R instanceof RegExp)return"regexp"}return K}function se(R){var K=F(R);switch(K){case"array":case"object":return"an "+K;case"boolean":case"date":case"regexp":return"a "+K;default:return K}}function de(R){return!R.constructor||!R.constructor.name?f:R.constructor.name}return h.checkPropTypes=i,h.resetWarningCache=i.resetWarningCache,h.PropTypes=h,h},fu}var hu,Ig;function g3(){if(Ig)return hu;Ig=1;var e=xf();function t(){}function n(){}return n.resetWarningCache=t,hu=function(){function r(o,a,l,c,u,d){if(d!==e){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}r.isRequired=r;function i(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},hu}var Rg;function y3(){if(Rg)return Ga.exports;if(Rg=1,process.env.NODE_ENV!=="production"){var e=Nb(),t=!0;Ga.exports=h3()(e.isElement,t)}else Ga.exports=g3()();return Ga.exports}var m3=y3();const kd=Rp(m3);var Oa=function(t){var n=t.className,r=n===void 0?"":n;return y.jsx("hr",{className:Se("yst-my-6",r)})};Oa.propTypes={className:kd.string};var p3=["cost","available","total","action","hideText","style"];function b3(e,t){if(e==null)return{};var n,r,i=v3(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function v3(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var qb=function(t){var n=t.cost,r=n===void 0?1:n,i=t.available,s=i===void 0?83:i,o=t.total,a=o===void 0?100:o,l=t.action,c=l===void 0?"use":l,u=t.hideText,d=u===void 0?!1:u,f=t.style,h=f===void 0?{}:f,g=b3(t,p3);return y.jsxs("span",{className:Se("yst-flex yst-items-center yst-gap-2 yst-text-[14px] yst-text-slate-500",g.className),style:h,...g,children:[!d&&y.jsxs(y.Fragment,{children:[y.jsxs("em",{className:"yst-text-xs yst-italic yst-text-slate-600",children:["You're about to ",c," ",r," spark",r!==1?"s":"","."]})," "]}),y.jsx("span",{className:"yst-inline-flex yst-rounded-full yst-p-[1px]",style:{background:"linear-gradient(97deg, #CD82AB 0%, #A5B4FC 100%)",boxShadow:"0px 1px 3px 0px rgba(0,0,0,0.10), 0px 1px 2px 0px rgba(0,0,0,0.06)"},children:y.jsxs(O.Badge,{variant:"plain",className:"yst-flex yst-items-center yst-gap-1 yst-rounded-full yst-bg-white yst-px-2 yst-py-1 yst-text-[12px] yst-font-normal",children:[y.jsx(Ec,{className:"yst-h-[12px] yst-w-[12px]"}),y.jsxs("div",{className:"yst-flex yst-items-center yst-gap-1",children:[y.jsx("strong",{children:s}),y.jsx("span",{className:"yst-text-slate-500",children:"/"}),y.jsx("span",{className:"yst-text-slate-500",children:a})]})]})})]})};const zb=6048e5,x3=864e5,Hb=6e4,Ub=36e5,Fg=Symbol.for("constructDateFrom");function qt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Fg in e?e[Fg](t):e instanceof Date?new e.constructor(t):new Date(t)}function kt(e,t){return qt(t||e,e)}function Kb(e,t,n){const r=kt(e,n==null?void 0:n.in);if(isNaN(t))return qt(e,NaN);if(!t)return r;const i=r.getDate(),s=qt(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const o=s.getDate();return i>=o?s:(r.setFullYear(s.getFullYear(),s.getMonth(),i),r)}let w3={};function Ac(){return w3}function Wo(e,t){var a,l,c,u,d,f,h,g;const n=Ac(),r=(g=(h=(u=(c=t==null?void 0:t.weekStartsOn)!=null?c:(l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)!=null?u:n.weekStartsOn)!=null?h:(f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)!=null?g:0,i=kt(e,t==null?void 0:t.in),s=i.getDay(),o=(s<r?7:0)+s-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function Wl(e,t){return Wo(e,{...t,weekStartsOn:1})}function Wb(e,t){const n=kt(e,t==null?void 0:t.in),r=n.getFullYear(),i=qt(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=Wl(i),o=qt(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const a=Wl(o);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function Ng(e){const t=kt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Tc(e,...t){const n=qt.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Vl(e,t){const n=kt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function S3(e,t,n){const[r,i]=Tc(n==null?void 0:n.in,e,t),s=Vl(r),o=Vl(i),a=+s-Ng(s),l=+o-Ng(o);return Math.round((a-l)/x3)}function C3(e,t){const n=Wb(e,t),r=qt(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Wl(r)}function _3(e){return qt(e,Date.now())}function k3(e,t,n){const[r,i]=Tc(n==null?void 0:n.in,e,t);return+Vl(r)==+Vl(i)}function E3(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function O3(e){return!(!E3(e)&&typeof e!="number"||isNaN(+kt(e)))}function A3(e,t){const n=kt(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function T3(e,t){const[n,r]=Tc(e,t.start,t.end);return{start:n,end:r}}function P3(e,t){const{start:n,end:r}=T3(t==null?void 0:t.in,e);let i=+n>+r;const s=i?+n:+r,o=i?r:n;o.setHours(0,0,0,0);let a=1;const l=[];for(;+o<=s;)l.push(qt(n,o)),o.setDate(o.getDate()+a),o.setHours(0,0,0,0);return i?l.reverse():l}function M3(e,t){const n=kt(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function $3(e,t){const n=kt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const j3={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},D3=(e,t,n)=>{let r;const i=j3[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function gu(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const L3={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},I3={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},R3={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},F3={date:gu({formats:L3,defaultWidth:"full"}),time:gu({formats:I3,defaultWidth:"full"}),dateTime:gu({formats:R3,defaultWidth:"full"})},N3={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},B3=(e,t,n,r)=>N3[e];function Js(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):o;i=e.formattingValues[a]||e.formattingValues[o]}else{const o=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[a]||e.values[o]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}const q3={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},z3={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},H3={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},U3={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},K3={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},W3={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},V3=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},G3={ordinalNumber:V3,era:Js({values:q3,defaultWidth:"wide"}),quarter:Js({values:z3,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Js({values:H3,defaultWidth:"wide"}),day:Js({values:U3,defaultWidth:"wide"}),dayPeriod:Js({values:K3,defaultWidth:"wide",formattingValues:W3,defaultFormattingWidth:"wide"})};function Zs(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const o=s[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?Y3(a,d=>d.test(o)):Q3(a,d=>d.test(o));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(o.length);return{value:c,rest:u}}}function Q3(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Y3(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function X3(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],s=t.match(e.parsePattern);if(!s)return null;let o=e.valueCallback?e.valueCallback(s[0]):s[0];o=n.valueCallback?n.valueCallback(o):o;const a=t.slice(i.length);return{value:o,rest:a}}}const J3=/^(\d+)(th|st|nd|rd)?/i,Z3=/\d+/i,eA={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},tA={any:[/^b/i,/^(a|c)/i]},nA={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},rA={any:[/1/i,/2/i,/3/i,/4/i]},iA={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},sA={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},oA={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},aA={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},lA={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},cA={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},uA={ordinalNumber:X3({matchPattern:J3,parsePattern:Z3,valueCallback:e=>parseInt(e,10)}),era:Zs({matchPatterns:eA,defaultMatchWidth:"wide",parsePatterns:tA,defaultParseWidth:"any"}),quarter:Zs({matchPatterns:nA,defaultMatchWidth:"wide",parsePatterns:rA,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Zs({matchPatterns:iA,defaultMatchWidth:"wide",parsePatterns:sA,defaultParseWidth:"any"}),day:Zs({matchPatterns:oA,defaultMatchWidth:"wide",parsePatterns:aA,defaultParseWidth:"any"}),dayPeriod:Zs({matchPatterns:lA,defaultMatchWidth:"any",parsePatterns:cA,defaultParseWidth:"any"})},dA={code:"en-US",formatDistance:D3,formatLong:F3,formatRelative:B3,localize:G3,match:uA,options:{weekStartsOn:0,firstWeekContainsDate:1}};function fA(e,t){const n=kt(e,t==null?void 0:t.in);return S3(n,$3(n))+1}function hA(e,t){const n=kt(e,t==null?void 0:t.in),r=+Wl(n)-+C3(n);return Math.round(r/zb)+1}function Vb(e,t){var u,d,f,h,g,m,p,b;const n=kt(e,t==null?void 0:t.in),r=n.getFullYear(),i=Ac(),s=(b=(p=(h=(f=t==null?void 0:t.firstWeekContainsDate)!=null?f:(d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)!=null?h:i.firstWeekContainsDate)!=null?p:(m=(g=i.locale)==null?void 0:g.options)==null?void 0:m.firstWeekContainsDate)!=null?b:1,o=qt((t==null?void 0:t.in)||e,0);o.setFullYear(r+1,0,s),o.setHours(0,0,0,0);const a=Wo(o,t),l=qt((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const c=Wo(l,t);return+n>=+a?r+1:+n>=+c?r:r-1}function gA(e,t){var a,l,c,u,d,f,h,g;const n=Ac(),r=(g=(h=(u=(c=t==null?void 0:t.firstWeekContainsDate)!=null?c:(l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)!=null?u:n.firstWeekContainsDate)!=null?h:(f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)!=null?g:1,i=Vb(e,t),s=qt((t==null?void 0:t.in)||e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),Wo(s,t)}function yA(e,t){const n=kt(e,t==null?void 0:t.in),r=+Wo(n,t)-+gA(n,t);return Math.round(r/zb)+1}function He(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const yr={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return He(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):He(n+1,2)},d(e,t){return He(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return He(e.getHours()%12||12,t.length)},H(e,t){return He(e.getHours(),t.length)},m(e,t){return He(e.getMinutes(),t.length)},s(e,t){return He(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return He(i,t.length)}},Li={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Bg={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return yr.y(e,t)},Y:function(e,t,n,r){const i=Vb(e,r),s=i>0?i:1-i;if(t==="YY"){const o=s%100;return He(o,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):He(s,t.length)},R:function(e,t){const n=Wb(e);return He(n,t.length)},u:function(e,t){const n=e.getFullYear();return He(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return He(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return He(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return yr.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return He(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=yA(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):He(i,t.length)},I:function(e,t,n){const r=hA(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):He(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):yr.d(e,t)},D:function(e,t,n){const r=fA(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):He(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return He(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return He(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return He(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=Li.noon:r===0?i=Li.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=Li.evening:r>=12?i=Li.afternoon:r>=4?i=Li.morning:i=Li.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return yr.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):yr.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):He(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):He(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):yr.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):yr.s(e,t)},S:function(e,t){return yr.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return zg(r);case"XXXX":case"XX":return Yr(r);case"XXXXX":case"XXX":default:return Yr(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return zg(r);case"xxxx":case"xx":return Yr(r);case"xxxxx":case"xxx":default:return Yr(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+qg(r,":");case"OOOO":default:return"GMT"+Yr(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+qg(r,":");case"zzzz":default:return"GMT"+Yr(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return He(r,t.length)},T:function(e,t,n){return He(+e,t.length)}};function qg(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+He(s,2)}function zg(e,t){return e%60===0?(e>0?"-":"+")+He(Math.abs(e)/60,2):Yr(e,t)}function Yr(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=He(Math.trunc(r/60),2),s=He(r%60,2);return n+i+t+s}const Hg=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Gb=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},mA=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Hg(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Hg(r,t)).replace("{{time}}",Gb(i,t))},pA={p:Gb,P:mA},bA=/^D+$/,vA=/^Y+$/,xA=["D","DD","YY","YYYY"];function wA(e){return bA.test(e)}function SA(e){return vA.test(e)}function CA(e,t,n){const r=_A(e,t,n);if(console.warn(r),xA.includes(e))throw new RangeError(r)}function _A(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const kA=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,EA=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,OA=/^'([^]*?)'?$/,AA=/''/g,TA=/[a-zA-Z]/;function go(e,t,n){var u,d,f,h,g,m,p,b,v;const r=Ac(),i=(u=r.locale)!=null?u:dA,s=(g=(h=r.firstWeekContainsDate)!=null?h:(f=(d=r.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)!=null?g:1,o=(v=(b=r.weekStartsOn)!=null?b:(p=(m=r.locale)==null?void 0:m.options)==null?void 0:p.weekStartsOn)!=null?v:0,a=kt(e,n==null?void 0:n.in);if(!O3(a))throw new RangeError("Invalid time value");let l=t.match(EA).map(S=>{const w=S[0];if(w==="p"||w==="P"){const x=pA[w];return x(S,i.formatLong)}return S}).join("").match(kA).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const w=S[0];if(w==="'")return{isToken:!1,value:PA(S)};if(Bg[w])return{isToken:!0,value:S};if(w.match(TA))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:S}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const c={firstWeekContainsDate:s,weekStartsOn:o,locale:i};return l.map(S=>{if(!S.isToken)return S.value;const w=S.value;(SA(w)||wA(w))&&CA(w,t,String(e));const x=Bg[w[0]];return x(a,w,i.localize,c)}).join("")}function PA(e){const t=e.match(OA);return t?t[1].replace(AA,"'"):e}function Ug(e,t,n){const[r,i]=Tc(n==null?void 0:n.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function MA(e,t){return k3(qt(e,e),_3(e))}function qi(e,t){const n=()=>qt(t==null?void 0:t.in,NaN),i=LA(e);let s;if(i.date){const c=IA(i.date,2);s=RA(c.restDateString,c.year)}if(!s||isNaN(+s))return n();const o=+s;let a=0,l;if(i.time&&(a=FA(i.time),isNaN(a)))return n();if(i.timezone){if(l=NA(i.timezone),isNaN(l))return n()}else{const c=new Date(o+a),u=kt(0,t==null?void 0:t.in);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return kt(o+a+l,t==null?void 0:t.in)}const Ya={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},$A=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,jA=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,DA=/^([+-])(\d{2})(?::?(\d{2}))?$/;function LA(e){const t={},n=e.split(Ya.dateTimeDelimiter);let r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],Ya.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Ya.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){const i=Ya.timezone.exec(r);i?(t.time=r.replace(i[1],""),t.timezone=i[1]):t.time=r}return t}function IA(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};const i=r[1]?parseInt(r[1]):null,s=r[2]?parseInt(r[2]):null;return{year:s===null?i:s*100,restDateString:e.slice((r[1]||r[2]).length)}}function RA(e,t){if(t===null)return new Date(NaN);const n=e.match($A);if(!n)return new Date(NaN);const r=!!n[4],i=eo(n[1]),s=eo(n[2])-1,o=eo(n[3]),a=eo(n[4]),l=eo(n[5])-1;if(r)return UA(t,a,l)?BA(t,a,l):new Date(NaN);{const c=new Date(0);return!zA(t,s,o)||!HA(t,i)?new Date(NaN):(c.setUTCFullYear(t,s,Math.max(i,o)),c)}}function eo(e){return e?parseInt(e):1}function FA(e){const t=e.match(jA);if(!t)return NaN;const n=yu(t[1]),r=yu(t[2]),i=yu(t[3]);return KA(n,r,i)?n*Ub+r*Hb+i*1e3:NaN}function yu(e){return e&&parseFloat(e.replace(",","."))||0}function NA(e){if(e==="Z")return 0;const t=e.match(DA);if(!t)return 0;const n=t[1]==="+"?-1:1,r=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return WA(r,i)?n*(r*Ub+i*Hb):NaN}function BA(e,t,n){const r=new Date(0);r.setUTCFullYear(e,0,4);const i=r.getUTCDay()||7,s=(t-1)*7+n+1-i;return r.setUTCDate(r.getUTCDate()+s),r}const qA=[31,null,31,30,31,30,31,31,30,31,30,31];function Qb(e){return e%400===0||e%4===0&&e%100!==0}function zA(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(qA[t]||(Qb(e)?29:28))}function HA(e,t){return t>=1&&t<=(Qb(e)?366:365)}function UA(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function KA(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function WA(e,t){return t>=0&&t<=59}function VA(e,t,n){return Kb(e,-1,n)}function Vo(e){"@babel/helpers - typeof";return Vo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vo(e)}function mu(e,t,n){return(t=GA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GA(e){var t=QA(e,"string");return Vo(t)=="symbol"?t:t+""}function QA(e,t){if(Vo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function YA(e,t){return e5(e)||ZA(e,t)||JA(e,t)||XA()}function XA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
50
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JA(e,t){if(e){if(typeof e=="string")return Kg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Kg(e,t):void 0}}function Kg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ZA(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function e5(e){if(Array.isArray(e))return e}var pn={selected:{background:"yst-bg-primary-500",text:"yst-text-white",hover:"hover:yst-bg-primary-600"},hasAnalysis:{border:"yst-border-2 yst-border-primary-500",text:"yst-text-slate-900",hover:"hover:yst-bg-primary-50"},today:{underline:"yst-border-b-2 yst-border-slate-400"},indicator:{selected:"yst-bg-white",default:"yst-bg-blue-500"}},t5=function(t){var n=t.analyses,r=t.selectedAnalysisId,i=t.onAnalysisSelect,s=t.isLoading,o=s===void 0?!1:s,a=t.isOpen,l=a===void 0?!1:a,c=t.onClose,u=W.useState(new Date),d=YA(u,2),f=d[0],h=d[1],g=W.useMemo(function(){var _=new Map;return n.forEach(function(C){var A=go(qi(C.createdAt),"yyyy-MM-dd");_.has(A)||_.set(A,[]),_.get(A).push(C)}),_},[n]);W.useEffect(function(){if(l&&r){var _=n.find(function(A){return A.id===r});_&&h(qi(_.createdAt))}else if(l&&n.length>0){var C=n.reduce(function(A,k){return new Date(k.createdAt)>new Date(A.createdAt)?k:A});h(qi(C.createdAt))}},[l,r,n]);var m=W.useMemo(function(){return n.length===0?null:n.reduce(function(_,C){return new Date(C.createdAt)>new Date(_.createdAt)?C:_})},[n]),p=function(){m&&h(qi(m.createdAt))},b=W.useMemo(function(){return m?Ug(qi(m.createdAt),f):!1},[m,f]),v=W.useMemo(function(){var _=M3(f),C=A3(f),A=new Date(_),k=A.getDay(),P=k===0?6:k-1;A.setDate(A.getDate()-P);var $=new Date(C),j=$.getDay(),Z=j===0?0:7-j;return $.setDate($.getDate()+Z),P3({start:A,end:$}).map(function(q){var N=go(q,"yyyy-MM-dd"),L=g.get(N)||[],F=L.find(function(se){return se.id===r});return{date:N,dateObj:q,isCurrentMonth:Ug(q,f),isToday:MA(q),isSelected:!!F,hasAnalyses:L.length>0,analyses:L}})},[f,g,r]),S=function(){h(function(C){return VA(C)})},w=function(){h(function(C){return Kb(C,1)})},x=function(C){C.hasAnalyses&&(C.analyses.length,i(C.analyses[0].id),c==null||c())};return l?o?y.jsx("div",{className:"yst-absolute yst-left-0 yst-right-0 yst-top-full yst-z-50 yst-mt-1 yst-rounded-md yst-border yst-border-slate-200 yst-bg-white yst-p-4 yst-shadow-lg",children:y.jsxs("div",{className:"yst-animate-pulse yst-space-y-4",children:[y.jsx("div",{className:"yst-h-6 yst-rounded yst-bg-slate-200"}),y.jsx("div",{className:"yst-h-48 yst-rounded yst-bg-slate-200"})]})}):y.jsxs("div",{className:"yst-absolute yst-left-0 yst-right-0 yst-top-full yst-z-50 yst-mt-1 yst-min-w-80 yst-max-w-sm yst-rounded-md yst-border yst-border-slate-200 yst-bg-white yst-p-4 yst-shadow-lg",children:[y.jsxs("div",{className:"yst-mb-6 yst-flex yst-items-center yst-justify-between",children:[y.jsxs("button",{type:"button",onClick:S,className:"yst-rounded-md yst-p-1.5 yst-text-slate-400 hover:yst-bg-slate-100 hover:yst-text-slate-500",children:[y.jsx("span",{className:"yst-sr-only",children:"Previous month"}),y.jsx($E,{className:"yst-h-5 yst-w-5"})]}),y.jsx("h2",{className:"yst-text-sm yst-font-semibold yst-text-slate-900",children:go(f,"MMMM yyyy")}),y.jsxs("button",{type:"button",onClick:w,className:"yst-rounded-md yst-p-1.5 yst-text-slate-400 hover:yst-bg-slate-100 hover:yst-text-slate-500",children:[y.jsx("span",{className:"yst-sr-only",children:"Next month"}),y.jsx(DE,{className:"yst-h-5 yst-w-5"})]})]}),y.jsx("div",{className:"yst-mb-0 yst-grid yst-grid-cols-7 yst-gap-x-1",children:["M","T","W","T","F","S","S"].map(function(_){return y.jsx("div",{className:"yst-py-2 yst-text-center yst-text-xs yst-font-medium yst-text-slate-500",children:_},_)})}),y.jsx("div",{className:"yst-grid yst-grid-cols-7 yst-gap-x-1",children:v.map(function(_){return y.jsx("div",{className:"yst-flex yst-items-center yst-justify-center yst-py-1",children:y.jsxs("button",{type:"button",onClick:function(){return x(_)},disabled:!_.hasAnalyses,className:Se("yst-relative yst-rounded-full yst-text-sm yst-transition-colors","yst-flex yst-h-10 yst-w-10 yst-items-center yst-justify-center","yst-p-0",{"yst-text-slate-900":_.isCurrentMonth,"yst-text-slate-400":!_.isCurrentMonth},{"focus:yst-outline-none focus:yst-ring-2 focus:yst-ring-blue-500":_.hasAnalyses,"yst-cursor-not-allowed":!_.hasAnalyses,"yst-cursor-pointer":_.hasAnalyses},mu({},"".concat(pn.selected.background," ").concat(pn.selected.text," ").concat(pn.selected.hover),_.isSelected),mu({},"".concat(pn.hasAnalysis.border," ").concat(pn.hasAnalysis.text," ").concat(pn.hasAnalysis.hover),_.hasAnalyses&&!_.isSelected)),children:[y.jsx("span",{className:Se("yst-relative yst-z-10 yst-w-4",mu({},pn.today.underline,_.isToday&&!_.isSelected)),children:go(_.dateObj,"d")}),_.hasAnalyses&&_.analyses.length>1&&y.jsx("span",{className:Se("yst-absolute yst-right-1 yst-top-1 yst-h-2 yst-w-2 yst-rounded-full",_.isSelected?pn.indicator.selected:pn.indicator.default)})]})},_.date)})}),y.jsxs("div",{className:"yst-mt-4 yst-flex yst-items-center yst-gap-4 yst-text-xs yst-text-slate-600",children:[y.jsxs("div",{className:"yst-flex yst-items-center yst-gap-1",children:[y.jsx("div",{className:"yst-h-3 yst-w-3 yst-rounded-full ".concat(pn.hasAnalysis.border)}),y.jsx("span",{children:"Has analysis"})]}),y.jsxs("div",{className:"yst-flex yst-items-center yst-gap-1",children:[y.jsx("div",{className:"yst-h-3 yst-w-3 yst-rounded-full ".concat(pn.selected.background)}),y.jsx("span",{children:"Selected"})]}),y.jsxs("div",{className:"yst-flex yst-items-center yst-gap-1",children:[y.jsx("div",{className:"yst-h-0.5 yst-w-4 yst-bg-slate-400"}),y.jsx("span",{children:"Today"})]})]}),m&&y.jsx("div",{className:"yst-mt-6",children:y.jsx(O.Button,{onClick:p,className:"yst-w-full",disabled:b,children:"Show latest analysis"})})]}):null};function n5(e,t){return o5(e)||s5(e,t)||i5(e,t)||r5()}function r5(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
51
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i5(e,t){if(e){if(typeof e=="string")return Wg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wg(e,t):void 0}}function Wg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s5(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function o5(e){if(Array.isArray(e))return e}var a5=function(t){var n=t.analyses,r=t.selectedAnalysisId,i=t.onAnalysisSelect,s=t.isLoading,o=s===void 0?!1:s,a=t.disabled,l=a===void 0?!1:a,c=t.id,u=c===void 0?"analysis-date-select":c,d=W.useState(!1),f=n5(d,2),h=f[0],g=f[1],m=W.useRef(null);W.useEffect(function(){if((r==="latest"||r===""||!r)&&n.length>0&&!o){var A=n.reduce(function(k,P){return new Date(P.createdAt)>new Date(k.createdAt)?P:k});i(A.id)}},[n,r,i,o]);var p=W.useMemo(function(){if(r==="latest"||r===""||!r){if(n.length>0){var A=n.reduce(function(k,P){return new Date(P.createdAt)>new Date(k.createdAt)?P:k});return A.id}return""}return r},[r,n]),b=n.find(function(A){return A.id===p}),v=n.length>0?n.reduce(function(A,k){return new Date(k.createdAt)>new Date(A.createdAt)?k:A}).id:"",S=b?"".concat(go(qi(b.createdAt),"MMM d, yyyy")," ").concat(b.id===v?"(latest)":"(older)"):n.length>0?"Select date...":"No analyses available";W.useEffect(function(){var A=function(P){m.current&&!m.current.contains(P.target)&&g(!1)};return h&&document.addEventListener("mousedown",A),function(){document.removeEventListener("mousedown",A)}},[h]);var w=function(){!l&&!o&&g(!h)},x=function(k){i(k),g(!1)},_=function(){g(!1)},C=function(k){k.key==="Enter"||k.key===" "?(k.preventDefault(),w()):k.key==="Escape"&&g(!1)};return y.jsxs("div",{ref:m,className:"yst-relative",children:[y.jsxs("div",{className:"yst-relative",children:[y.jsx(O.TextInput,{id:u,onClick:w,onKeyDown:C,disabled:l||o,value:S,"aria-expanded":h,"aria-haspopup":"true","aria-label":"Select analysis date",className:Se("yst-pr-10",{"yst-cursor-default":!l&&!o})}),y.jsx(TE,{className:"yst-pointer-events-none yst-absolute yst-right-3 yst-top-1/2 yst--translate-y-1/2 yst-transform"})]}),y.jsx(t5,{analyses:n,selectedAnalysisId:p,onAnalysisSelect:x,isLoading:o,isOpen:h,onClose:_})]})},Vg;function l5(e,t){return f5(e)||d5(e,t)||u5(e,t)||c5()}function c5(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
52
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function u5(e,t){if(e){if(typeof e=="string")return Gg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gg(e,t):void 0}}function Gg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d5(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function f5(e){if(Array.isArray(e))return e}function h5(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var pu=Fs(Vg||(Vg=h5(["yst-flex-1 yst-space-y-2"]))),g5=function(t){var n,r=t.className,i=zt(),s=i.brandId,o=i.analysisId,a=i.model,l=yf(),c=l.setModel,u=Ei(),d=zr(),f=Eb({query:{select:function(se){var de=se.data;return de==null?void 0:de.data}}}),h=f.data,g=f.isLoading,m=h==null?void 0:h.displayName,p=kc({query:{select:function(se){var de,R=se.data;return R==null||(de=R.data)===null||de===void 0?void 0:de.brands}}}),b=p.data,v=p.isLoading,S=_b(s||"",{query:{enabled:!!s,select:function(se){var de=se.data;return de==null?void 0:de.data}}}),w=S.data,x=S.isLoading,_=zn(s||"",o||"",{query:{enabled:!!s&&!!o}}),C=_.isLoading,A=gk({mutation:{onSuccess:function(){u.invalidateQueries({queryKey:[Cb(s)]})}}}),k=A.mutate,P=A.isPending,$=W.useState(!1),j=l5($,2),Z=j[0],q=j[1],N=function(){q(!1)},L=!1;return y.jsxs(y.Fragment,{children:[L,y.jsx(vf,{isOpen:Z,onClose:N,onConfirm:function(){s&&k({brandId:s})},isLoading:P,title:"Delete analysis?",description:y.jsxs(y.Fragment,{children:[y.jsx("p",{children:"This will permanently delete all data associated with this analysis."}),y.jsx("p",{children:"This action cannot be undone."})]}),confirmText:"Yes, delete analysis",cancelText:"No, go back"}),y.jsxs(O.Card,{className:Se("yst-relative yst-overflow-visible",r),children:[y.jsx(qb,{className:"yst-absolute yst--top-3 yst-right-5 yst-z-10",hideText:!0}),y.jsxs(O.Card.Content,{children:[y.jsxs("div",{className:"yst-flex yst-flex-1 yst-flex-col yst-flex-wrap yst-items-start yst-justify-between yst-gap-4 md:yst-flex-row xl:yst-items-center",children:[y.jsx("div",{className:"xl:yst-max-w-1/4",children:y.jsxs("div",{className:"yst-flex yst-flex-col xl:yst-flex-row xl:yst-items-baseline xl:yst-gap-2",children:[y.jsx(O.Title,{children:y.jsxs(y.Fragment,{children:[g||!m?y.jsx(O.SkeletonLoader,{className:"yst-inline-block yst-h-8 yst-w-64"}):y.jsxs(y.Fragment,{children:["Hi ",m,", "]})," "]})}),y.jsx("p",{className:"yst-text-sm yst-font-normal yst-text-slate-600",children:"welcome to your brand analysis!"})]})}),y.jsxs("div",{className:"yst-flex yst-flex-row yst-flex-wrap yst-items-center yst-justify-end yst-gap-4 yst-self-end",children:[y.jsxs(O.Button,{variant:"primary",className:"yst-gap-1.5",onClick:function(){return d("/setup")},disabled:x||v,children:[y.jsx(YE,{})," Analyze a different brand"]}),y.jsxs(O.Button,{variant:"secondary",className:"yst-gap-1.5",disabled:x||v||b&&(b==null?void 0:b.length)<1,children:[y.jsx(Ec,{})," Run analysis again"]}),y.jsx("div",{className:"yst-relative",children:y.jsxs(O.DropdownMenu,{children:[y.jsx(O.DropdownMenu.IconTrigger,{screenReaderTriggerLabel:"Open brand list options",disabled:x||v||b&&(b==null?void 0:b.length)<1,children:y.jsx(NE,{})}),y.jsx(O.DropdownMenu.List,{className:"yst-absolute yst-right-0 yst-top-full yst-z-40 yst-mt-2 yst-flex yst-w-64 yst-flex-col yst-justify-start",children:y.jsxs(O.DropdownMenu.ButtonItem,{onClick:function(){return q(!0)},disabled:x||v,className:"yst-flex yst-justify-start yst-gap-1.5 yst-text-red-600 hover:yst-bg-red-50",children:[y.jsx(Cd,{className:"yst-h-4 yst-w-4"}),"Delete analysis"]})})]})})]})]}),y.jsx(Oa,{}),y.jsxs("form",{className:"yst-flex yst-flex-col yst-items-stretch yst-gap-4 md:yst-flex-row md:yst-items-center",children:[y.jsxs(pu,{children:[y.jsx(O.Label,{htmlFor:"brand-name",children:"Brand"}),y.jsx(O.Select,{onChange:function(F){d("/brands/".concat(F.toString()))},id:"brand-name",value:s,selectedLabel:(b==null||(n=b.find(function(F){var se;return((se=F.id)===null||se===void 0?void 0:se.toString())===s}))===null||n===void 0?void 0:n.name)||"",options:b&&b.length>0?b.map(function(F){return{value:F.id,label:F.name}}):[{value:"loading",label:"Loading..."}],disabled:v||!b||b.length<2||!s})]}),y.jsxs(pu,{children:[y.jsx(O.Label,{htmlFor:"analysis-date",children:"Analysis date"}),y.jsx(a5,{analyses:(w==null?void 0:w.map(function(F){return{id:F.id||"",date:F.createdAt||"",createdAt:F.createdAt||""}}))||[],selectedAnalysisId:o||"",onAnalysisSelect:function(F){d("/brands/".concat(s,"/analysis/").concat(F))},isLoading:x,disabled:x||!w||w.length<2,id:"analysis-date"})]}),y.jsxs(pu,{children:[y.jsx(O.Label,{htmlFor:"ai-tool",children:"AI model"}),y.jsx(O.Select,{onChange:function(F){console.log("AI model changed",F),c(F)},id:"ai-tool",value:a||"",options:[!a||C||x?{value:"",label:"Loading..."}:{value:"chatgpt",label:"ChatGPT"}],disabled:C||x||[{}].length<2})]})]})]})]})]})},y5=function(){var t,n,r,i,s=zt(),o=s.brandId,a=s.analysisId,l=zn(o,a,{query:{select:function(g){var m=g.data;return m},enabled:!!o}}),c=l.data,u=l.isLoading,d=l.isRefetching,f=c==null||(t=c.data)===null||t===void 0?void 0:t.mentions;return y.jsx(O.Card,{className:"yst-overflow-visible",children:y.jsxs(O.Card.Content,{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(Ns,{title:"Mentions",tooltip:"The queries where your brand was mentioned."}),y.jsx(Ea,{score:(f==null||(n=f.queries)===null||n===void 0?void 0:n.found)||0,total:f==null||(r=f.queries)===null||r===void 0?void 0:r.total,suffix:"queries",isLoading:u||d})]}),!u&&f?y.jsx("ul",{children:f==null||(i=f.list)===null||i===void 0?void 0:i.map(function(h,g){var m=g===0,p=f.list&&g===f.list.length-1;return y.jsxs("li",{className:Se("yst-flex yst-flex-row yst-items-center yst-gap-2 yst-border-l yst-border-r yst-border-slate-300 yst-p-4 yst-font-medium yst-text-slate-800",{"yst-rounded-t-lg yst-border-t":m,"yst-rounded-b-lg yst-border-b":p,"yst-border-b":!p}),children:[y.jsx("div",{className:"yst-h-4 yst-w-4",children:h.found?y.jsx(Mb,{className:"yst-text-green-500"}):y.jsx(jb,{className:"yst-text-red-500"})}),y.jsx("span",{className:"yst-justify-start",children:h.query}),y.jsx("span",{className:"yst-ml-auto yst-flex yst-items-end",children:h.found?y.jsx(O.Badge,{className:"yst-bg-green-100 yst-text-green-800",children:"Found"}):y.jsx(O.Badge,{className:"yst-bg-red-100 yst-text-red-800",children:"Not found"})})]},h.query)})}):y.jsx(O.SkeletonLoader,{className:"yst-h-56 yst-w-full"})]})})};/*!
53
+ * @kurkle/color v0.3.4
54
+ * https://github.com/kurkle/color#readme
55
+ * (c) 2024 Jukka Kurkela
56
+ * Released under the MIT License
57
+ */function Aa(e){return e+.5|0}const Tr=(e,t,n)=>Math.max(Math.min(e,n),t);function yo(e){return Tr(Aa(e*2.55),0,255)}function Dr(e){return Tr(Aa(e*255),0,255)}function Xn(e){return Tr(Aa(e/2.55)/100,0,1)}function Qg(e){return Tr(Aa(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},Ed=[..."0123456789ABCDEF"],m5=e=>Ed[e&15],p5=e=>Ed[(e&240)>>4]+Ed[e&15],Xa=e=>(e&240)>>4===(e&15),b5=e=>Xa(e.r)&&Xa(e.g)&&Xa(e.b)&&Xa(e.a);function v5(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 x5=(e,t)=>e<255?t(e):"";function w5(e){var t=b5(e)?m5:p5;return e?"#"+t(e.r)+t(e.g)+t(e.b)+x5(e.a,t):void 0}const S5=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Yb(e,t,n){const r=t*Math.min(n,1-n),i=(s,o=(s+e/30)%12)=>n-r*Math.max(Math.min(o-3,9-o,1),-1);return[i(0),i(8),i(4)]}function C5(e,t,n){const r=(i,s=(i+e/60)%6)=>n-n*t*Math.max(Math.min(s,4-s,1),0);return[r(5),r(3),r(1)]}function _5(e,t,n){const r=Yb(e,1,.5);let i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)r[i]*=1-t-n,r[i]+=t;return r}function k5(e,t,n,r,i){return e===i?(t-n)/r+(t<n?6:0):t===i?(n-e)/r+2:(e-t)/r+4}function wf(e){const n=e.r/255,r=e.g/255,i=e.b/255,s=Math.max(n,r,i),o=Math.min(n,r,i),a=(s+o)/2;let l,c,u;return s!==o&&(u=s-o,c=a>.5?u/(2-s-o):u/(s+o),l=k5(n,r,i,u,s),l=l*60+.5),[l|0,c||0,a]}function Sf(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Dr)}function Cf(e,t,n){return Sf(Yb,e,t,n)}function E5(e,t,n){return Sf(_5,e,t,n)}function O5(e,t,n){return Sf(C5,e,t,n)}function Xb(e){return(e%360+360)%360}function A5(e){const t=S5.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?yo(+t[5]):Dr(+t[5]));const i=Xb(+t[2]),s=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?r=E5(i,s,o):t[1]==="hsv"?r=O5(i,s,o):r=Cf(i,s,o),{r:r[0],g:r[1],b:r[2],a:n}}function T5(e,t){var n=wf(e);n[0]=Xb(n[0]+t),n=Cf(n),e.r=n[0],e.g=n[1],e.b=n[2]}function P5(e){if(!e)return;const t=wf(e),n=t[0],r=Qg(t[1]),i=Qg(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${Xn(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}const Yg={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"},Xg={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 M5(){const e={},t=Object.keys(Xg),n=Object.keys(Yg);let r,i,s,o,a;for(r=0;r<t.length;r++){for(o=a=t[r],i=0;i<n.length;i++)s=n[i],a=a.replace(s,Yg[s]);s=parseInt(Xg[o],16),e[a]=[s>>16&255,s>>8&255,s&255]}return e}let Ja;function $5(e){Ja||(Ja=M5(),Ja.transparent=[0,0,0,0]);const t=Ja[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const j5=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function D5(e){const t=j5.exec(e);let n=255,r,i,s;if(t){if(t[7]!==r){const o=+t[7];n=t[8]?yo(o):Tr(o*255,0,255)}return r=+t[1],i=+t[3],s=+t[5],r=255&(t[2]?yo(r):Tr(r,0,255)),i=255&(t[4]?yo(i):Tr(i,0,255)),s=255&(t[6]?yo(s):Tr(s,0,255)),{r,g:i,b:s,a:n}}}function L5(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Xn(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const bu=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Ii=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function I5(e,t,n){const r=Ii(Xn(e.r)),i=Ii(Xn(e.g)),s=Ii(Xn(e.b));return{r:Dr(bu(r+n*(Ii(Xn(t.r))-r))),g:Dr(bu(i+n*(Ii(Xn(t.g))-i))),b:Dr(bu(s+n*(Ii(Xn(t.b))-s))),a:e.a+n*(t.a-e.a)}}function Za(e,t,n){if(e){let r=wf(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=Cf(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function Jb(e,t){return e&&Object.assign(t||{},e)}function Jg(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=Dr(e[3]))):(t=Jb(e,{r:0,g:0,b:0,a:1}),t.a=Dr(t.a)),t}function R5(e){return e.charAt(0)==="r"?D5(e):A5(e)}class Go{constructor(t){if(t instanceof Go)return t;const n=typeof t;let r;n==="object"?r=Jg(t):n==="string"&&(r=v5(t)||$5(t)||R5(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=Jb(this._rgb);return t&&(t.a=Xn(t.a)),t}set rgb(t){this._rgb=Jg(t)}rgbString(){return this._valid?L5(this._rgb):void 0}hexString(){return this._valid?w5(this._rgb):void 0}hslString(){return this._valid?P5(this._rgb):void 0}mix(t,n){if(t){const r=this.rgb,i=t.rgb;let s;const o=n===s?.5:n,a=2*o-1,l=r.a-i.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;s=1-c,r.r=255&c*r.r+s*i.r+.5,r.g=255&c*r.g+s*i.g+.5,r.b=255&c*r.b+s*i.b+.5,r.a=o*r.a+(1-o)*i.a,this.rgb=r}return this}interpolate(t,n){return t&&(this._rgb=I5(this._rgb,t._rgb,n)),this}clone(){return new Go(this.rgb)}alpha(t){return this._rgb.a=Dr(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Aa(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 Za(this._rgb,2,t),this}darken(t){return Za(this._rgb,2,-t),this}saturate(t){return Za(this._rgb,1,t),this}desaturate(t){return Za(this._rgb,1,-t),this}rotate(t){return T5(this._rgb,t),this}}/*!
58
+ * Chart.js v4.5.0
59
+ * https://www.chartjs.org
60
+ * (c) 2025 Chart.js Contributors
61
+ * Released under the MIT License
62
+ */function Wn(){}const F5=(()=>{let e=0;return()=>e++})();function Ke(e){return e==null}function et(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 $e(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function gt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function On(e,t){return gt(e)?e:t}function Pe(e,t){return typeof e=="undefined"?t:e}const N5=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Ge(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Ue(e,t,n,r){let i,s,o;if(et(e))for(s=e.length,i=0;i<s;i++)t.call(n,e[i],i);else if($e(e))for(o=Object.keys(e),s=o.length,i=0;i<s;i++)t.call(n,e[o[i]],o[i])}function Gl(e,t){let n,r,i,s;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],s=t[n],i.datasetIndex!==s.datasetIndex||i.index!==s.index)return!1;return!0}function Ql(e){if(et(e))return e.map(Ql);if($e(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let i=0;for(;i<r;++i)t[n[i]]=Ql(e[n[i]]);return t}return e}function Zb(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function B5(e,t,n,r){if(!Zb(e))return;const i=t[e],s=n[e];$e(i)&&$e(s)?Qo(i,s,r):t[e]=Ql(s)}function Qo(e,t,n){const r=et(t)?t:[t],i=r.length;if(!$e(e))return e;n=n||{};const s=n.merger||B5;let o;for(let a=0;a<i;++a){if(o=r[a],!$e(o))continue;const l=Object.keys(o);for(let c=0,u=l.length;c<u;++c)s(l[c],e,o,n)}return e}function Co(e,t){return Qo(e,t,{merger:q5})}function q5(e,t,n){if(!Zb(e))return;const r=t[e],i=n[e];$e(r)&&$e(i)?Co(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Ql(i))}const Zg={"":e=>e,x:e=>e.x,y:e=>e.y};function z5(e){const t=e.split("."),n=[];let r="";for(const i of t)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function H5(e){const t=z5(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function Yo(e,t){return(Zg[t]||(Zg[t]=H5(t)))(e)}function _f(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Yl=e=>typeof e!="undefined",Rr=e=>typeof e=="function",ey=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function U5(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const lt=Math.PI,Yt=2*lt,K5=Yt+lt,Xl=Number.POSITIVE_INFINITY,W5=lt/180,Qt=lt/2,Vr=lt/4,ty=lt*2/3,ev=Math.log10,Os=Math.sign;function _o(e,t,n){return Math.abs(e-t)<n}function ny(e){const t=Math.round(e);e=_o(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(ev(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function V5(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((i,s)=>i-s).pop(),t}function G5(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Xo(e){return!G5(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Q5(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function Y5(e,t,n){let r,i,s;for(r=0,i=e.length;r<i;r++)s=e[r][n],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function Pr(e){return e*(lt/180)}function kf(e){return e*(180/lt)}function ry(e){if(!gt(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function X5(e,t){const n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);let s=Math.atan2(r,n);return s<-.5*lt&&(s+=Yt),{angle:s,distance:i}}function Od(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function J5(e,t){return(e-t+K5)%Yt-lt}function Wt(e){return(e%Yt+Yt)%Yt}function tv(e,t,n,r){const i=Wt(e),s=Wt(t),o=Wt(n),a=Wt(s-i),l=Wt(o-i),c=Wt(i-s),u=Wt(i-o);return i===s||i===o||r&&s===o||a>l&&c<u}function on(e,t,n){return Math.max(t,Math.min(n,e))}function Z5(e){return on(e,-32768,32767)}function Wi(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function Ef(e,t,n){n=n||(o=>e[o]<t);let r=e.length-1,i=0,s;for(;r-i>1;)s=i+r>>1,n(s)?i=s:r=s;return{lo:i,hi:r}}const ni=(e,t,n,r)=>Ef(e,n,r?i=>{const s=e[i][t];return s<n||s===n&&e[i+1][t]===n}:i=>e[i][t]<n),eT=(e,t,n)=>Ef(e,n,r=>e[r][t]>=n);function tT(e,t,n){let r=0,i=e.length;for(;r<i&&e[r]<t;)r++;for(;i>r&&e[i-1]>n;)i--;return r>0||i<e.length?e.slice(r,i):e}const nv=["push","pop","shift","splice","unshift"];function nT(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),nv.forEach(n=>{const r="_onData"+_f(n),i=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...s){const o=i.apply(this,s);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...s)}),o}})})}function iy(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(nv.forEach(s=>{delete e[s]}),delete e._chartjs)}function rT(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const rv=function(){return typeof window=="undefined"?function(e){return e()}:window.requestAnimationFrame}();function iv(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,rv.call(window,()=>{r=!1,e.apply(t,n)}))}}function iT(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const Of=e=>e==="start"?"left":e==="end"?"right":"center",xt=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,sT=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function oT(e,t,n){const r=t.length;let i=0,s=r;if(e._sorted){const{iScale:o,vScale:a,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=o.axis,{min:d,max:f,minDefined:h,maxDefined:g}=o.getUserBounds();if(h){if(i=Math.min(ni(l,u,d).lo,n?r:ni(t,u,o.getPixelForValue(d)).lo),c){const m=l.slice(0,i+1).reverse().findIndex(p=>!Ke(p[a.axis]));i-=Math.max(0,m)}i=on(i,0,r-1)}if(g){let m=Math.max(ni(l,o.axis,f,!0).hi+1,n?0:ni(t,u,o.getPixelForValue(f),!0).hi+1);if(c){const p=l.slice(m-1).findIndex(b=>!Ke(b[a.axis]));m+=Math.max(0,p)}s=on(m,i,r)-i}else s=r-i}return{start:i,count:s}}function aT(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;const s=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),s}const el=e=>e===0||e===1,sy=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Yt/n)),oy=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Yt/n)+1,ko={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*Qt)+1,easeOutSine:e=>Math.sin(e*Qt),easeInOutSine:e=>-.5*(Math.cos(lt*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=>el(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=>el(e)?e:sy(e,.075,.3),easeOutElastic:e=>el(e)?e:oy(e,.075,.3),easeInOutElastic(e){return el(e)?e:e<.5?.5*sy(e*2,.1125,.45):.5+.5*oy(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-ko.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?ko.easeInBounce(e*2)*.5:ko.easeOutBounce(e*2-1)*.5+.5};function Af(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function ay(e){return Af(e)?e:new Go(e)}function vu(e){return Af(e)?e:new Go(e).saturate(.5).darken(.1).hexString()}const lT=["x","y","borderWidth","radius","tension"],cT=["color","borderColor","backgroundColor"];function uT(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:cT},numbers:{type:"number",properties:lT}}),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 dT(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const ly=new Map;function fT(e,t){t=t||{};const n=e+JSON.stringify(t);let r=ly.get(n);return r||(r=new Intl.NumberFormat(e,t),ly.set(n,r)),r}function sv(e,t,n){return fT(t,n).format(e)}const hT={values(e){return et(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let i,s=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(i="scientific"),s=gT(e,n)}const o=ev(Math.abs(s)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),sv(e,r,l)}};function gT(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 Tf={formatters:hT};function yT(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:Tf.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 wi=Object.create(null),Ad=Object.create(null);function Eo(e,t){if(!t)return e;const n=t.split(".");for(let r=0,i=n.length;r<i;++r){const s=n[r];e=e[s]||(e[s]=Object.create(null))}return e}function xu(e,t,n){return typeof t=="string"?Qo(Eo(e,t),n):Qo(Eo(e,""),t)}class mT{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,i)=>vu(i.backgroundColor),this.hoverBorderColor=(r,i)=>vu(i.borderColor),this.hoverColor=(r,i)=>vu(i.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 xu(this,t,n)}get(t){return Eo(this,t)}describe(t,n){return xu(Ad,t,n)}override(t,n){return xu(wi,t,n)}route(t,n,r,i){const s=Eo(this,t),o=Eo(this,r),a="_"+n;Object.defineProperties(s,{[a]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=o[i];return $e(l)?Object.assign({},c,l):Pe(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var st=new mT({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[uT,dT,yT]);function pT(e){return!e||Ke(e.size)||Ke(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Jl(e,t,n,r,i){let s=t[i];return s||(s=t[i]=e.measureText(i).width,n.push(i)),s>r&&(r=s),r}function bT(e,t,n,r){r=r||{};let i=r.data=r.data||{},s=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},s=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let o=0;const a=n.length;let l,c,u,d,f;for(l=0;l<a;l++)if(d=n[l],d!=null&&!et(d))o=Jl(e,i,s,o,d);else if(et(d))for(c=0,u=d.length;c<u;c++)f=d[c],f!=null&&!et(f)&&(o=Jl(e,i,s,o,f));e.restore();const h=s.length/2;if(h>n.length){for(l=0;l<h;l++)delete i[s[l]];s.splice(0,h)}return o}function Gr(e,t,n){const r=e.currentDevicePixelRatio,i=n!==0?Math.max(n/2,.5):0;return Math.round((t-i)*r)/r+i}function cy(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Td(e,t,n,r){ov(e,t,n,r,null)}function ov(e,t,n,r,i){let s,o,a,l,c,u,d,f;const h=t.pointStyle,g=t.rotation,m=t.radius;let p=(g||0)*W5;if(h&&typeof h=="object"&&(s=h.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(p),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:i?e.ellipse(n,r,i/2,m,0,0,Yt):e.arc(n,r,m,0,Yt),e.closePath();break;case"triangle":u=i?i/2:m,e.moveTo(n+Math.sin(p)*u,r-Math.cos(p)*m),p+=ty,e.lineTo(n+Math.sin(p)*u,r-Math.cos(p)*m),p+=ty,e.lineTo(n+Math.sin(p)*u,r-Math.cos(p)*m),e.closePath();break;case"rectRounded":c=m*.516,l=m-c,o=Math.cos(p+Vr)*l,d=Math.cos(p+Vr)*(i?i/2-c:l),a=Math.sin(p+Vr)*l,f=Math.sin(p+Vr)*(i?i/2-c:l),e.arc(n-d,r-a,c,p-lt,p-Qt),e.arc(n+f,r-o,c,p-Qt,p),e.arc(n+d,r+a,c,p,p+Qt),e.arc(n-f,r+o,c,p+Qt,p+lt),e.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*m,u=i?i/2:l,e.rect(n-u,r-l,2*u,2*l);break}p+=Vr;case"rectRot":d=Math.cos(p)*(i?i/2:m),o=Math.cos(p)*m,a=Math.sin(p)*m,f=Math.sin(p)*(i?i/2:m),e.moveTo(n-d,r-a),e.lineTo(n+f,r-o),e.lineTo(n+d,r+a),e.lineTo(n-f,r+o),e.closePath();break;case"crossRot":p+=Vr;case"cross":d=Math.cos(p)*(i?i/2:m),o=Math.cos(p)*m,a=Math.sin(p)*m,f=Math.sin(p)*(i?i/2:m),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case"star":d=Math.cos(p)*(i?i/2:m),o=Math.cos(p)*m,a=Math.sin(p)*m,f=Math.sin(p)*(i?i/2:m),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o),p+=Vr,d=Math.cos(p)*(i?i/2:m),o=Math.cos(p)*m,a=Math.sin(p)*m,f=Math.sin(p)*(i?i/2:m),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case"line":o=i?i/2:Math.cos(p)*m,a=Math.sin(p)*m,e.moveTo(n-o,r-a),e.lineTo(n+o,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(p)*(i?i/2:m),r+Math.sin(p)*m);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function nr(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 Pc(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Mc(e){e.restore()}function vT(e,t,n,r,i){if(!t)return e.lineTo(n.x,n.y);if(i==="middle"){const s=(t.x+n.x)/2;e.lineTo(s,t.y),e.lineTo(s,n.y)}else i==="after"!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function xT(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 wT(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),Ke(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 ST(e,t,n,r,i){if(i.strikethrough||i.underline){const s=e.measureText(r),o=t-s.actualBoundingBoxLeft,a=t+s.actualBoundingBoxRight,l=n-s.actualBoundingBoxAscent,c=n+s.actualBoundingBoxDescent,u=i.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(o,u),e.lineTo(a,u),e.stroke()}}function CT(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Si(e,t,n,r,i,s={}){const o=et(t)?t:[t],a=s.strokeWidth>0&&s.strokeColor!=="";let l,c;for(e.save(),e.font=i.string,wT(e,s),l=0;l<o.length;++l)c=o[l],s.backdrop&&CT(e,s.backdrop),a&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),Ke(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(c,n,r,s.maxWidth)),e.fillText(c,n,r,s.maxWidth),ST(e,n,r,c,s),r+=Number(i.lineHeight);e.restore()}function Zl(e,t){const{x:n,y:r,w:i,h:s,radius:o}=t;e.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*lt,lt,!0),e.lineTo(n,r+s-o.bottomLeft),e.arc(n+o.bottomLeft,r+s-o.bottomLeft,o.bottomLeft,lt,Qt,!0),e.lineTo(n+i-o.bottomRight,r+s),e.arc(n+i-o.bottomRight,r+s-o.bottomRight,o.bottomRight,Qt,0,!0),e.lineTo(n+i,r+o.topRight),e.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-Qt,!0),e.lineTo(n+o.topLeft,r)}const _T=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,kT=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function ET(e,t){const n=(""+e).match(_T);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 OT=e=>+e||0;function av(e,t){const n={},r=$e(t),i=r?Object.keys(t):t,s=$e(e)?r?o=>Pe(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of i)n[o]=OT(s(o));return n}function AT(e){return av(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Gi(e){return av(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Et(e){const t=AT(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function dt(e,t){e=e||{},t=t||st.font;let n=Pe(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=Pe(e.style,t.style);r&&!(""+r).match(kT)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:Pe(e.family,t.family),lineHeight:ET(Pe(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:Pe(e.weight,t.weight),string:""};return i.string=pT(i),i}function tl(e,t,n,r){let i,s,o;for(i=0,s=e.length;i<s;++i)if(o=e[i],o!==void 0&&o!==void 0)return o}function TT(e,t,n){const{min:r,max:i}=e,s=N5(t,(i-r)/2),o=(a,l)=>n&&a===0?0:a+l;return{min:o(r,-Math.abs(s)),max:o(i,s)}}function Ur(e,t){return Object.assign(Object.create(e),t)}function Pf(e,t=[""],n,r,i=()=>e[0]){const s=n||e;typeof r=="undefined"&&(r=dv("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:r,_getTarget:i,override:a=>Pf([a,...e],t,s,r)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return cv(a,l,()=>RT(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return dy(a).includes(l)},ownKeys(a){return dy(a)},set(a,l,c){const u=a._storage||(a._storage=i());return a[l]=u[l]=c,delete a._keys,!0}})}function As(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:lv(e,r),setContext:s=>As(e,s,n,r),override:s=>As(e.override(s),t,n,r)};return new Proxy(i,{deleteProperty(s,o){return delete s[o],delete e[o],!0},get(s,o,a){return cv(s,o,()=>MT(s,o,a))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(s,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(s,o,a){return e[o]=a,delete s[o],!0}})}function lv(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Rr(n)?n:()=>n,isIndexable:Rr(r)?r:()=>r}}const PT=(e,t)=>e?e+_f(t):t,Mf=(e,t)=>$e(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function cv(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function MT(e,t,n){const{_proxy:r,_context:i,_subProxy:s,_descriptors:o}=e;let a=r[t];return Rr(a)&&o.isScriptable(t)&&(a=$T(t,a,e,n)),et(a)&&a.length&&(a=jT(t,a,e,o.isIndexable)),Mf(t,a)&&(a=As(a,i,s&&s[t],o)),a}function $T(e,t,n,r){const{_proxy:i,_context:s,_subProxy:o,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(s,o||r);return a.delete(e),Mf(e,l)&&(l=$f(i._scopes,i,e,l)),l}function jT(e,t,n,r){const{_proxy:i,_context:s,_subProxy:o,_descriptors:a}=n;if(typeof s.index!="undefined"&&r(e))return t[s.index%t.length];if($e(t[0])){const l=t,c=i._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=$f(c,i,e,u);t.push(As(d,s,o&&o[e],a))}}return t}function uv(e,t,n){return Rr(e)?e(t,n):e}const DT=(e,t)=>e===!0?t:typeof e=="string"?Yo(t,e):void 0;function LT(e,t,n,r,i){for(const s of t){const o=DT(n,s);if(o){e.add(o);const a=uv(o._fallback,n,i);if(typeof a!="undefined"&&a!==n&&a!==r)return a}else if(o===!1&&typeof r!="undefined"&&n!==r)return null}return!1}function $f(e,t,n,r){const i=t._rootScopes,s=uv(t._fallback,n,r),o=[...e,...i],a=new Set;a.add(r);let l=uy(a,o,n,s||n,r);return l===null||typeof s!="undefined"&&s!==n&&(l=uy(a,o,s,l,r),l===null)?!1:Pf(Array.from(a),[""],i,s,()=>IT(t,n,r))}function uy(e,t,n,r,i){for(;n;)n=LT(e,t,n,r,i);return n}function IT(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return et(i)&&$e(n)?n:i||{}}function RT(e,t,n,r){let i;for(const s of t)if(i=dv(PT(s,e),n),typeof i!="undefined")return Mf(e,i)?$f(n,r,e,i):i}function dv(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r!="undefined")return r}}function dy(e){let t=e._keys;return t||(t=e._keys=FT(e._scopes)),t}function FT(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(i=>!i.startsWith("_")))t.add(r);return Array.from(t)}function NT(e,t,n,r){const{iScale:i}=e,{key:s="r"}=this._parsing,o=new Array(r);let a,l,c,u;for(a=0,l=r;a<l;++a)c=a+n,u=t[c],o[a]={r:i.parse(Yo(u,s),c)};return o}const BT=Number.EPSILON||1e-14,Ts=(e,t)=>t<e.length&&!e[t].skip&&e[t],fv=e=>e==="x"?"y":"x";function qT(e,t,n,r){const i=e.skip?t:e,s=t,o=n.skip?t:n,a=Od(s,i),l=Od(o,s);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=r*c,f=r*u;return{previous:{x:s.x-d*(o.x-i.x),y:s.y-d*(o.y-i.y)},next:{x:s.x+f*(o.x-i.x),y:s.y+f*(o.y-i.y)}}}function zT(e,t,n){const r=e.length;let i,s,o,a,l,c=Ts(e,0);for(let u=0;u<r-1;++u)if(l=c,c=Ts(e,u+1),!(!l||!c)){if(_o(t[u],0,BT)){n[u]=n[u+1]=0;continue}i=n[u]/t[u],s=n[u+1]/t[u],a=Math.pow(i,2)+Math.pow(s,2),!(a<=9)&&(o=3/Math.sqrt(a),n[u]=i*o*t[u],n[u+1]=s*o*t[u])}}function HT(e,t,n="x"){const r=fv(n),i=e.length;let s,o,a,l=Ts(e,0);for(let c=0;c<i;++c){if(o=a,a=l,l=Ts(e,c+1),!a)continue;const u=a[n],d=a[r];o&&(s=(u-o[n])/3,a[`cp1${n}`]=u-s,a[`cp1${r}`]=d-s*t[c]),l&&(s=(l[n]-u)/3,a[`cp2${n}`]=u+s,a[`cp2${r}`]=d+s*t[c])}}function UT(e,t="x"){const n=fv(t),r=e.length,i=Array(r).fill(0),s=Array(r);let o,a,l,c=Ts(e,0);for(o=0;o<r;++o)if(a=l,l=c,c=Ts(e,o+1),!!l){if(c){const u=c[t]-l[t];i[o]=u!==0?(c[n]-l[n])/u:0}s[o]=a?c?Os(i[o-1])!==Os(i[o])?0:(i[o-1]+i[o])/2:i[o-1]:i[o]}zT(e,i,s),HT(e,s,t)}function nl(e,t,n){return Math.max(Math.min(e,n),t)}function KT(e,t){let n,r,i,s,o,a=nr(e[0],t);for(n=0,r=e.length;n<r;++n)o=s,s=a,a=n<r-1&&nr(e[n+1],t),s&&(i=e[n],o&&(i.cp1x=nl(i.cp1x,t.left,t.right),i.cp1y=nl(i.cp1y,t.top,t.bottom)),a&&(i.cp2x=nl(i.cp2x,t.left,t.right),i.cp2y=nl(i.cp2y,t.top,t.bottom)))}function WT(e,t,n,r,i){let s,o,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")UT(e,i);else{let c=r?e[e.length-1]:e[0];for(s=0,o=e.length;s<o;++s)a=e[s],l=qT(c,a,e[Math.min(s+1,o-(r?0:1))%o],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&KT(e,n)}function jf(){return typeof window!="undefined"&&typeof document!="undefined"}function Df(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ec(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 $c=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function VT(e,t){return $c(e).getPropertyValue(t)}const GT=["top","right","bottom","left"];function yi(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const s=GT[i];r[s]=parseFloat(e[t+"-"+s+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const QT=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function YT(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:s}=r;let o=!1,a,l;if(QT(i,s,e.target))a=i,l=s;else{const c=t.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function Xr(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=$c(n),s=i.boxSizing==="border-box",o=yi(i,"padding"),a=yi(i,"border","width"),{x:l,y:c,box:u}=YT(e,n),d=o.left+(u&&a.left),f=o.top+(u&&a.top);let{width:h,height:g}=t;return s&&(h-=o.width+a.width,g-=o.height+a.height),{x:Math.round((l-d)/h*n.width/r),y:Math.round((c-f)/g*n.height/r)}}function XT(e,t,n){let r,i;if(t===void 0||n===void 0){const s=e&&Df(e);if(!s)t=e.clientWidth,n=e.clientHeight;else{const o=s.getBoundingClientRect(),a=$c(s),l=yi(a,"border","width"),c=yi(a,"padding");t=o.width-c.width-l.width,n=o.height-c.height-l.height,r=ec(a.maxWidth,s,"clientWidth"),i=ec(a.maxHeight,s,"clientHeight")}}return{width:t,height:n,maxWidth:r||Xl,maxHeight:i||Xl}}const rl=e=>Math.round(e*10)/10;function JT(e,t,n,r){const i=$c(e),s=yi(i,"margin"),o=ec(i.maxWidth,e,"clientWidth")||Xl,a=ec(i.maxHeight,e,"clientHeight")||Xl,l=XT(e,t,n);let{width:c,height:u}=l;if(i.boxSizing==="content-box"){const f=yi(i,"border","width"),h=yi(i,"padding");c-=h.width+f.width,u-=h.height+f.height}return c=Math.max(0,c-s.width),u=Math.max(0,r?c/r:u-s.height),c=rl(Math.min(c,o,l.maxWidth)),u=rl(Math.min(u,a,l.maxHeight)),c&&!u&&(u=rl(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=rl(Math.floor(u*r))),{width:c,height:u}}function fy(e,t,n){const r=t||1,i=Math.floor(e.height*r),s=Math.floor(e.width*r);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||o.height!==i||o.width!==s?(e.currentDevicePixelRatio=r,o.height=i,o.width=s,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const ZT=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};jf()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch(t){}return e}();function hy(e,t){const n=VT(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 eP(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 tP(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},s={x:t.cp1x,y:t.cp1y},o=Jr(e,i,n),a=Jr(i,s,n),l=Jr(s,t,n),c=Jr(o,a,n),u=Jr(a,l,n);return Jr(c,u,n)}const nP=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}}},rP=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Qi(e,t,n){return e?nP(t,n):rP()}function hv(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 gv(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function yv(e){return e==="angle"?{between:tv,compare:J5,normalize:Wt}:{between:Wi,compare:(t,n)=>t-n,normalize:t=>t}}function gy({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function iP(e,t,n){const{property:r,start:i,end:s}=n,{between:o,normalize:a}=yv(r),l=t.length;let{start:c,end:u,loop:d}=e,f,h;if(d){for(c+=l,u+=l,f=0,h=l;f<h&&o(a(t[c%l][r]),i,s);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:e.style}}function mv(e,t,n){if(!n)return[e];const{property:r,start:i,end:s}=n,o=t.length,{compare:a,between:l,normalize:c}=yv(r),{start:u,end:d,loop:f,style:h}=iP(e,t,n),g=[];let m=!1,p=null,b,v,S;const w=()=>l(i,S,b)&&a(i,S)!==0,x=()=>a(s,b)===0||l(s,S,b),_=()=>m||w(),C=()=>!m||x();for(let A=u,k=u;A<=d;++A)v=t[A%o],!v.skip&&(b=c(v[r]),b!==S&&(m=l(b,i,s),p===null&&_()&&(p=a(b,i)===0?A:k),p!==null&&C()&&(g.push(gy({start:p,end:A,loop:f,count:o,style:h})),p=null),k=A,S=b));return p!==null&&g.push(gy({start:p,end:d,loop:f,count:o,style:h})),g}function pv(e,t){const n=[],r=e.segments;for(let i=0;i<r.length;i++){const s=mv(r[i],e.points,t);s.length&&n.push(...s)}return n}function sP(e,t,n,r){let i=0,s=t-1;if(n&&!r)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(s+=i);s>i&&e[s%t].skip;)s--;return s%=t,{start:i,end:s}}function oP(e,t,n,r){const i=e.length,s=[];let o=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%i];c.skip||c.stop?a.skip||(r=!1,s.push({start:t%i,end:(l-1)%i,loop:r}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&s.push({start:t%i,end:o%i,loop:r}),s}function aP(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const s=!!e._loop,{start:o,end:a}=sP(n,i,s,r);if(r===!0)return yy(e,[{start:o,end:a,loop:s}],n,t);const l=a<o?a+i:a,c=!!e._fullLoop&&o===0&&a===i-1;return yy(e,oP(n,o,l,c),n,t)}function yy(e,t,n,r){return!r||!r.setContext||!n?t:lP(e,t,n,r)}function lP(e,t,n,r){const i=e._chart.getContext(),s=my(e.options),{_datasetIndex:o,options:{spanGaps:a}}=e,l=n.length,c=[];let u=s,d=t[0].start,f=d;function h(g,m,p,b){const v=a?-1:1;if(g!==m){for(g+=l;n[g%l].skip;)g-=v;for(;n[m%l].skip;)m+=v;g%l!==m%l&&(c.push({start:g%l,end:m%l,loop:p,style:b}),u=b,d=m%l)}}for(const g of t){d=a?d:g.start;let m=n[d%l],p;for(f=d+1;f<=g.end;f++){const b=n[f%l];p=my(r.setContext(Ur(i,{type:"segment",p0:m,p1:b,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:o}))),cP(p,u)&&h(d,f-1,g.loop,u),m=b,u=p}d<f-1&&h(d,f-1,g.loop,u)}return c}function my(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function cP(e,t){if(!t)return!1;const n=[],r=function(i,s){return Af(s)?(n.includes(s)||n.push(s),n.indexOf(s)):s};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function il(e,t,n){return e.options.clip?e[n]:t[n]}function uP(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:il(n,t,"left"),right:il(n,t,"right"),top:il(r,t,"top"),bottom:il(r,t,"bottom")}:t}function bv(e,t){const n=t._clip;if(n.disabled)return!1;const r=uP(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)}}/*!
63
+ * Chart.js v4.5.0
64
+ * https://www.chartjs.org
65
+ * (c) 2025 Chart.js Contributors
66
+ * Released under the MIT License
67
+ */class dP{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const s=n.listeners[i],o=n.duration;s.forEach(a=>a({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(r-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=rv.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const s=r.items;let o=s.length-1,a=!1,l;for(;o>=0;--o)l=s[o],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(s[o]=s[s.length-1],s.pop());a&&(i.draw(),this._notify(i,r,t,"progress")),s.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=s.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,i)=>Math.max(r,i._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 i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Qn=new dP;const py="transparent",fP={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=ay(e||py),i=r.valid&&ay(t||py);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class hP{constructor(t,n,r,i){const s=n[r];i=tl([t.to,i,s,t.from]);const o=tl([t.from,s,i]);this._active=!0,this._fn=t.fn||fP[t.type||typeof o],this._easing=ko[t.easing]||ko.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=o,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],s=r-this._start,o=this._duration-s;this._start=r,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=tl([t.to,n,i,t.from]),this._from=tl([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,s=this._from,o=this._loop,a=this._to;let l;if(this._active=s!==a&&(o||n<r),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=s;return}l=n/r%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(s,a,l)}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 i=0;i<r.length;i++)r[i][n]()}}class vv{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!$e(t))return;const n=Object.keys(st.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const s=t[i];if(!$e(s))return;const o={};for(const a of n)o[a]=s[a];(et(s.properties)&&s.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,o)})})}_animateOptions(t,n){const r=n.options,i=yP(t,r);if(!i)return[];const s=this._createAnimations(i,r);return r.$shared&&gP(t.options.$animations,r).then(()=>{t.options=r},()=>{}),s}_createAnimations(t,n){const r=this._properties,i=[],s=t.$animations||(t.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,n));continue}const u=n[c];let d=s[c];const f=r.get(c);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}s[c]=d=new hP(f,t,c,u),i.push(d)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return Qn.add(this._chart,r),!0}}function gP(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const s=e[r[i]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function yP(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 by(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,s=n.max===void 0?t:0;return{start:r?s:i,end:r?i:s}}function mP(e,t,n){if(n===!1)return!1;const r=by(e,n),i=by(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function pP(e){let t,n,r,i;return $e(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function xv(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,s;for(i=0,s=r.length;i<s;++i)n.push(r[i].index);return n}function vy(e,t,n,r={}){const i=e.keys,s=r.mode==="single";let o,a,l,c;if(t===null)return;let u=!1;for(o=0,a=i.length;o<a;++o){if(l=+i[o],l===n){if(u=!0,r.all)continue;break}c=e.values[l],gt(c)&&(s||t===0||Os(t)===Os(c))&&(t+=c)}return!u&&!r.all?0:t}function bP(e,t){const{iScale:n,vScale:r}=t,i=n.axis==="x"?"x":"y",s=r.axis==="x"?"x":"y",o=Object.keys(e),a=new Array(o.length);let l,c,u;for(l=0,c=o.length;l<c;++l)u=o[l],a[l]={[i]:u,[s]:e[u]};return a}function wu(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function vP(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function xP(e){const{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function wP(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function xy(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const s=e[i.index];if(n&&s>0||!n&&s<0)return i.index}return null}function wy(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:s,vScale:o,index:a}=r,l=s.axis,c=o.axis,u=vP(s,o,r),d=t.length;let f;for(let h=0;h<d;++h){const g=t[h],{[l]:m,[c]:p}=g,b=g._stacks||(g._stacks={});f=b[c]=wP(i,u,m),f[a]=p,f._top=xy(f,o,!0,r.type),f._bottom=xy(f,o,!1,r.type);const v=f._visualValues||(f._visualValues={});v[a]=p}}function Su(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function SP(e,t){return Ur(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function CP(e,t,n){return Ur(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function to(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const s=i._stacks;if(!s||s[r]===void 0||s[r][n]===void 0)return;delete s[r][n],s[r]._visualValues!==void 0&&s[r]._visualValues[n]!==void 0&&delete s[r]._visualValues[n]}}}const Cu=e=>e==="reset"||e==="none",Sy=(e,t)=>t?e:Object.assign({},e),_P=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:xv(n,!0),values:null};class Yi{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=wu(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&&to(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,f,h,g)=>d==="x"?f:d==="r"?g:h,s=n.xAxisID=Pe(r.xAxisID,Su(t,"x")),o=n.yAxisID=Pe(r.yAxisID,Su(t,"y")),a=n.rAxisID=Pe(r.rAxisID,Su(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,s,o,a),u=n.vAxisID=i(l,o,s,a);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),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&&iy(this._data,this),t._stacked&&to(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if($e(n)){const i=this._cachedMeta;this._data=bP(n,i)}else if(r!==n){if(r){iy(r,this);const i=this._cachedMeta;to(i),i._parsed=[]}n&&Object.isExtensible(n)&&nT(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 i=!1;this._dataCheck();const s=n._stacked;n._stacked=wu(n.vScale,n),n.stack!==r.stack&&(i=!0,to(n),n.stack=r.stack),this._resyncElements(t),(i||s!==n._stacked)&&(wy(this,n._parsed),n._stacked=wu(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:i}=this,{iScale:s,_stacked:o}=r,a=s.axis;let l=t===0&&n===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,f;if(this._parsing===!1)r._parsed=i,r._sorted=!0,f=i;else{et(i[t])?f=this.parseArrayData(r,i,t,n):$e(i[t])?f=this.parseObjectData(r,i,t,n):f=this.parsePrimitiveData(r,i,t,n);const h=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<n;++u)r._parsed[u+t]=d=f[u],l&&(h()&&(l=!1),c=d);r._sorted=l}o&&wy(this,f)}parsePrimitiveData(t,n,r,i){const{iScale:s,vScale:o}=t,a=s.axis,l=o.axis,c=s.getLabels(),u=s===o,d=new Array(i);let f,h,g;for(f=0,h=i;f<h;++f)g=f+r,d[f]={[a]:u||s.parse(c[g],g),[l]:o.parse(n[g],g)};return d}parseArrayData(t,n,r,i){const{xScale:s,yScale:o}=t,a=new Array(i);let l,c,u,d;for(l=0,c=i;l<c;++l)u=l+r,d=n[u],a[l]={x:s.parse(d[0],u),y:o.parse(d[1],u)};return a}parseObjectData(t,n,r,i){const{xScale:s,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(i);let u,d,f,h;for(u=0,d=i;u<d;++u)f=u+r,h=n[f],c[u]={x:s.parse(Yo(h,a),f),y:o.parse(Yo(h,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,s=this._cachedMeta,o=n[t.axis],a={keys:xv(i,!0),values:n._stacks[t.axis]._visualValues};return vy(a,o,s.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const s=r[n.axis];let o=s===null?NaN:s;const a=i&&r._stacks[n.axis];i&&a&&(i.values=a,o=vy(i,s,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,s=r._sorted&&t===r.iScale,o=i.length,a=this._getOtherScale(t),l=_P(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=xP(a);let f,h;function g(){h=i[f];const m=h[a.axis];return!gt(h[t.axis])||u>m||d<m}for(f=0;f<o&&!(!g()&&(this.updateRangeFromParsed(c,t,h,l),s));++f);if(s){for(f=o-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(c,t,h,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,s,o;for(i=0,s=n.length;i<s;++i)o=n[i][t.axis],gt(o)&&r.push(o);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,s=this.getParsed(t);return{label:r?""+r.getLabelForValue(s[r.axis]):"",value:i?""+i.getLabelForValue(s[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=pP(Pe(this.options.clip,mP(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],s=n.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||i.length-a,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,s,a,l),u=a;u<a+l;++u){const d=i[u];d.hidden||(d.active&&c?o.push(d):d.draw(t,s))}for(u=0;u<o.length;++u)o[u].draw(t,s)}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 i=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];s=o.$context||(o.$context=CP(this.getContext(),t,o)),s.parsed=this.getParsed(t),s.raw=i.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=SP(this.chart.getContext(),this.index)),s.dataset=i,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=r,s}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 i=n==="active",s=this._cachedDataOpts,o=t+"-"+n,a=s[o],l=this.enableOptionSharing&&Yl(r);if(a)return Sy(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),h=Object.keys(st.elements[t]),g=()=>this.getContext(r,i,n),m=c.resolveNamedOptions(f,h,g,d);return m.$shared&&(m.$shared=l,s[o]=Object.freeze(Sy(m,l))),m}_resolveAnimations(t,n,r){const i=this.chart,s=this._cachedDataOpts,o=`animation-${n}`,a=s[o];if(a)return a;let l;if(i.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,r,n))}const c=new vv(i,l&&l.animations);return l&&l._cacheable&&(s[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Cu(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,s=this.getSharedOptions(r),o=this.includeOptions(n,s)||s!==i;return this.updateSharedOptions(s,n,r),{sharedOptions:s,includeOptions:o}}updateElement(t,n,r,i){Cu(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!Cu(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const s=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(s)||s})}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,l,c]of this._syncList)this[a](l,c);this._syncList=[];const i=r.length,s=n.length,o=Math.min(s,i);o&&this.parse(0,o),s>i?this._insertElements(i,s-i,t):s<i&&this._removeElements(s,i-s)}_insertElements(t,n,r=!0){const i=this._cachedMeta,s=i.data,o=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(s),a=t;a<o;++a)s[a]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(s,t,n,"reset")}updateElements(t,n,r,i){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,n);r._stacked&&to(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}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])}}ge(Yi,"defaults",{}),ge(Yi,"datasetElementType",null),ge(Yi,"dataElementType",null);class El extends Yi{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:s}=n,o=this.chart._animationsDisabled;let{start:a,count:l}=oT(n,i,o);this._drawStart=a,this._drawCount=l,aT(n)&&(a=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!o,options:c},t),this.updateElements(i,a,l,t)}updateElements(t,n,r,i){const s=i==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,i),f=o.axis,h=a.axis,{spanGaps:g,segment:m}=this.options,p=Xo(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||s||i==="none",v=n+r,S=t.length;let w=n>0&&this.getParsed(n-1);for(let x=0;x<S;++x){const _=t[x],C=b?_:{};if(x<n||x>=v){C.skip=!0;continue}const A=this.getParsed(x),k=Ke(A[h]),P=C[f]=o.getPixelForValue(A[f],x),$=C[h]=s||k?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,A,l):A[h],x);C.skip=isNaN(P)||isNaN($)||k,C.stop=x>0&&Math.abs(A[f]-w[f])>p,m&&(C.parsed=A,C.raw=c.data[x]),d&&(C.options=u||this.resolveDataElementOptions(x,_.active?"active":i)),b||this.updateElement(_,x,C,i),w=A}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const s=i[0].size(this.resolveDataElementOptions(0)),o=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,s,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}ge(El,"id","line"),ge(El,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),ge(El,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Ol extends Yi{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,i){return NT.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta,r=n.dataset,i=n.data||[],s=n.iScale.getLabels();if(r.points=i,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:s.length===i.length,options:o};this.updateElement(r,void 0,a,t)}this.updateElements(i,0,i.length,t)}updateElements(t,n,r,i){const s=this._cachedMeta.rScale,o=i==="reset";for(let a=n;a<n+r;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":i),u=s.getPointPositionForValue(a,this.getParsed(a).r),d=o?s.xCenter:u.x,f=o?s.yCenter:u.y,h={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:c};this.updateElement(l,a,h,i)}}}ge(Ol,"id","radar"),ge(Ol,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),ge(Ol,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});function Qr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Lf{constructor(t){ge(this,"options");this.options=t||{}}static override(t){Object.assign(Lf.prototype,t)}init(){}formats(){return Qr()}parse(){return Qr()}format(){return Qr()}add(){return Qr()}diff(){return Qr()}startOf(){return Qr()}endOf(){return Qr()}}var kP={_date:Lf};function EP(e,t,n,r){const{controller:i,data:s,_sorted:o}=e,a=i._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&o&&s.length){const c=a._reversePixels?eT:ni;if(r){if(i._sharedOptions){const u=s[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const f=c(s,t,n-d),h=c(s,t,n+d);return{lo:f.lo,hi:h.hi}}}}else{const u=c(s,t,n);if(l){const{vScale:d}=i._cachedMeta,{_parsed:f}=e,h=f.slice(0,u.lo+1).reverse().findIndex(m=>!Ke(m[d.axis]));u.lo-=Math.max(0,h);const g=f.slice(u.hi).findIndex(m=>!Ke(m[d.axis]));u.hi+=Math.max(0,g)}return u}}return{lo:0,hi:s.length-1}}function jc(e,t,n,r,i){const s=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=s.length;a<l;++a){const{index:c,data:u}=s[a],{lo:d,hi:f}=EP(s[a],t,o,i);for(let h=d;h<=f;++h){const g=u[h];g.skip||r(g,c,h)}}}function OP(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const s=t?Math.abs(r.x-i.x):0,o=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(o,2))}}function _u(e,t,n,r,i){const s=[];return!i&&!e.isPointInArea(t)||jc(e,n,t,function(a,l,c){!i&&!nr(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&s.push({element:a,datasetIndex:l,index:c})},!0),s}function AP(e,t,n,r){let i=[];function s(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],r),{angle:d}=X5(o,{x:t.x,y:t.y});tv(d,c,u)&&i.push({element:o,datasetIndex:a,index:l})}return jc(e,n,t,s),i}function TP(e,t,n,r,i,s){let o=[];const a=OP(n);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const h=u.inRange(t.x,t.y,i);if(r&&!h)return;const g=u.getCenterPoint(i);if(!(!!s||e.isPointInArea(g))&&!h)return;const p=a(t,g);p<l?(o=[{element:u,datasetIndex:d,index:f}],l=p):p===l&&o.push({element:u,datasetIndex:d,index:f})}return jc(e,n,t,c),o}function ku(e,t,n,r,i,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!r?AP(e,t,n,i):TP(e,t,n,r,i,s)}function Cy(e,t,n,r,i){const s=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return jc(e,n,t,(l,c,u)=>{l[o]&&l[o](t[n],i)&&(s.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,i))}),r&&!a?[]:s}var PP={modes:{index(e,t,n,r){const i=Xr(t,e),s=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?_u(e,i,s,r,o):ku(e,i,s,!1,r,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const i=Xr(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?_u(e,i,s,r,o):ku(e,i,s,!1,r,o);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(e,t,n,r){const i=Xr(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return _u(e,i,s,r,o)},nearest(e,t,n,r){const i=Xr(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return ku(e,i,s,n.intersect,r,o)},x(e,t,n,r){const i=Xr(t,e);return Cy(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=Xr(t,e);return Cy(e,i,"y",n.intersect,r)}}};const wv=["left","top","right","bottom"];function no(e,t){return e.filter(n=>n.pos===t)}function _y(e,t){return e.filter(n=>wv.indexOf(n.pos)===-1&&n.box.axis===t)}function ro(e,t){return e.sort((n,r)=>{const i=t?r:n,s=t?n:r;return i.weight===s.weight?i.index-s.index:i.weight-s.weight})}function MP(e){const t=[];let n,r,i,s,o,a;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:s,options:{stack:o,stackWeight:a=1}}=i,t.push({index:n,box:i,pos:s,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&s+o,stackWeight:a});return t}function $P(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:s}=n;if(!r||!wv.includes(i))continue;const o=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return t}function jP(e,t){const n=$P(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let s,o,a;for(s=0,o=e.length;s<o;++s){a=e[s];const{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*r:l&&t.availableWidth,a.height=i):(a.width=r,a.height=u?u*i:l&&t.availableHeight)}return n}function DP(e){const t=MP(e),n=ro(t.filter(c=>c.box.fullSize),!0),r=ro(no(t,"left"),!0),i=ro(no(t,"right")),s=ro(no(t,"top"),!0),o=ro(no(t,"bottom")),a=_y(t,"x"),l=_y(t,"y");return{fullSize:n,leftAndTop:r.concat(s),rightAndBottom:i.concat(l).concat(o).concat(a),chartArea:no(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:s.concat(o).concat(a)}}function ky(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Sv(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 LP(e,t,n,r){const{pos:i,box:s}=n,o=e.maxPadding;if(!$e(i)){n.size&&(e[i]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?s.height:s.width),n.size=d.size/d.count,e[i]+=n.size}s.getPadding&&Sv(o,s.getPadding());const a=Math.max(0,t.outerWidth-ky(o,e,"left","right")),l=Math.max(0,t.outerHeight-ky(o,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function IP(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function RP(e,t){const n=t.maxPadding;function r(i){const s={left:0,top:0,right:0,bottom:0};return i.forEach(o=>{s[o]=Math.max(t[o],n[o])}),s}return r(e?["left","right"]:["top","bottom"])}function mo(e,t,n,r){const i=[];let s,o,a,l,c,u;for(s=0,o=e.length,c=0;s<o;++s){a=e[s],l=a.box,l.update(a.width||t.w,a.height||t.h,RP(a.horizontal,t));const{same:d,other:f}=LP(t,n,a,r);c|=d&&i.length,u=u||f,l.fullSize||i.push(a)}return c&&mo(i,t,n,r)||u}function sl(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function Ey(e,t,n,r){const i=n.padding;let{x:s,y:o}=t;for(const a of e){const l=a.box,c=r[a.stack]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*u,f=c.size||l.height;Yl(c.start)&&(o=c.start),l.fullSize?sl(l,i.left,o,n.outerWidth-i.right-i.left,f):sl(l,t.left+c.placed,o,d,f),c.start=o,c.placed+=d,o=l.bottom}else{const d=t.h*u,f=c.size||l.width;Yl(c.start)&&(s=c.start),l.fullSize?sl(l,s,i.top,f,n.outerHeight-i.bottom-i.top):sl(l,s,t.top+c.placed,f,d),c.start=s,c.placed+=d,s=l.right}}t.x=s,t.y=o}var an={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 i=Et(e.options.layout.padding),s=Math.max(t-i.width,0),o=Math.max(n-i.height,0),a=DP(e.boxes),l=a.vertical,c=a.horizontal;Ue(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,p)=>p.box.options&&p.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},i);Sv(f,Et(r));const h=Object.assign({maxPadding:f,w:s,h:o,x:i.left,y:i.top},i),g=jP(l.concat(c),d);mo(a.fullSize,h,d,g),mo(l,h,d,g),mo(c,h,d,g)&&mo(l,h,d,g),IP(h),Ey(a.leftAndTop,h,d,g),h.x+=h.w,h.y+=h.h,Ey(a.rightAndBottom,h,d,g),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Ue(a.chartArea,m=>{const p=m.box;Object.assign(p,e.chartArea),p.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class Cv{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class FP extends Cv{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Al="$chartjs",NP={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Oy=e=>e===null||e==="";function BP(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[Al]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Oy(i)){const s=hy(e,"width");s!==void 0&&(e.width=s)}if(Oy(r))if(e.style.height==="")e.height=e.width/(t||2);else{const s=hy(e,"height");s!==void 0&&(e.height=s)}return e}const _v=ZT?{passive:!0}:!1;function qP(e,t,n){e&&e.addEventListener(t,n,_v)}function zP(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,_v)}function HP(e,t){const n=NP[e.type]||e.type,{x:r,y:i}=Xr(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function tc(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function UP(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||tc(a.addedNodes,r),o=o&&!tc(a.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function KP(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||tc(a.removedNodes,r),o=o&&!tc(a.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const Jo=new Map;let Ay=0;function kv(){const e=window.devicePixelRatio;e!==Ay&&(Ay=e,Jo.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function WP(e,t){Jo.size||window.addEventListener("resize",kv),Jo.set(e,t)}function VP(e){Jo.delete(e),Jo.size||window.removeEventListener("resize",kv)}function GP(e,t,n){const r=e.canvas,i=r&&Df(r);if(!i)return;const s=iv((a,l)=>{const c=i.clientWidth;n(a,l),c<i.clientWidth&&n()},window),o=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||s(c,u)});return o.observe(i),WP(e,s),o}function Eu(e,t,n){n&&n.disconnect(),t==="resize"&&VP(e)}function QP(e,t,n){const r=e.canvas,i=iv(s=>{e.ctx!==null&&n(HP(s,e))},e);return qP(r,t,i),i}class YP extends Cv{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(BP(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Al])return!1;const r=n[Al].initial;["height","width"].forEach(s=>{const o=r[s];Ke(o)?n.removeAttribute(s):n.setAttribute(s,o)});const i=r.style||{};return Object.keys(i).forEach(s=>{n.style[s]=i[s]}),n.width=n.width,delete n[Al],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),o={attach:UP,detach:KP,resize:GP}[n]||QP;i[n]=o(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:Eu,detach:Eu,resize:Eu}[n]||zP)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return JT(t,n,r,i)}isAttached(t){const n=t&&Df(t);return!!(n&&n.isConnected)}}function XP(e){return!jf()||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas?FP:YP}var bl;let Pi=(bl=class{constructor(){ge(this,"x");ge(this,"y");ge(this,"active",!1);ge(this,"options");ge(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return Xo(this.x)&&Xo(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(s=>{i[s]=r[s]&&r[s].active()?r[s]._to:this[s]}),i}},ge(bl,"defaults",{}),ge(bl,"defaultRoutes"),bl);function JP(e,t){const n=e.options.ticks,r=ZP(e),i=Math.min(n.maxTicksLimit||r,r),s=n.major.enabled?t4(t):[],o=s.length,a=s[0],l=s[o-1],c=[];if(o>i)return n4(t,c,s,o/i),c;const u=e4(s,t,i);if(o>0){let d,f;const h=o>1?Math.round((l-a)/(o-1)):null;for(ol(t,c,u,Ke(h)?0:a-h,a),d=0,f=o-1;d<f;d++)ol(t,c,u,s[d],s[d+1]);return ol(t,c,u,l,Ke(h)?t.length:l+h),c}return ol(t,c,u),c}function ZP(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function e4(e,t,n){const r=r4(e),i=t.length/n;if(!r)return Math.max(i,1);const s=V5(r);for(let o=0,a=s.length-1;o<a;o++){const l=s[o];if(l>i)return l}return Math.max(i,1)}function t4(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function n4(e,t,n,r){let i=0,s=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===s&&(t.push(e[o]),i++,s=n[i*r])}function ol(e,t,n,r,i){const s=Pe(r,0),o=Math.min(Pe(i,e.length),e.length);let a=0,l,c,u;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),u=s;u<0;)a++,u=Math.round(s+a*n);for(c=Math.max(s,0);c<o;c++)c===u&&(t.push(e[c]),a++,u=Math.round(s+a*n))}function r4(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 i4=e=>e==="left"?"right":e==="right"?"left":e,Ty=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Py=(e,t)=>Math.min(t||e,e);function My(e,t){const n=[],r=e.length/t,i=e.length;let s=0;for(;s<i;s+=r)n.push(e[Math.floor(s)]);return n}function s4(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),s=e._startPixel,o=e._endPixel,a=1e-6;let l=e.getPixelForTick(i),c;if(!(n&&(r===1?c=Math.max(l-s,o-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<s-a||l>o+a)))return l}function o4(e,t){Ue(e,n=>{const r=n.gc,i=r.length/2;let s;if(i>t){for(s=0;s<i;++s)delete n.data[r[s]];r.splice(0,i)}})}function io(e){return e.drawTicks?e.tickLength:0}function $y(e,t){if(!e.display)return 0;const n=dt(e.font,t),r=Et(e.padding);return(et(e.text)?e.text.length:1)*n.lineHeight+r.height}function a4(e,t){return Ur(e,{scale:t,type:"scale"})}function l4(e,t,n){return Ur(e,{tick:n,index:t,type:"tick"})}function c4(e,t,n){let r=Of(e);return(n&&t!=="right"||!n&&t==="right")&&(r=i4(r)),r}function u4(e,t,n,r){const{top:i,left:s,bottom:o,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,f,h,g;const m=o-i,p=a-s;if(e.isHorizontal()){if(h=xt(r,s,a),$e(n)){const b=Object.keys(n)[0],v=n[b];g=u[b].getPixelForValue(v)+m-t}else n==="center"?g=(c.bottom+c.top)/2+m-t:g=Ty(e,n,t);f=a-s}else{if($e(n)){const b=Object.keys(n)[0],v=n[b];h=u[b].getPixelForValue(v)-p+t}else n==="center"?h=(c.left+c.right)/2-p+t:h=Ty(e,n,t);g=xt(r,o,i),d=n==="left"?-Qt:Qt}return{titleX:h,titleY:g,maxWidth:f,rotation:d}}class Bs extends Pi{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:i}=this;return t=On(t,Number.POSITIVE_INFINITY),n=On(n,Number.NEGATIVE_INFINITY),r=On(r,Number.POSITIVE_INFINITY),i=On(i,Number.NEGATIVE_INFINITY),{min:On(t,r),max:On(n,i),minDefined:gt(t),maxDefined:gt(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:s}=this.getUserBounds(),o;if(i&&s)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),i||(n=Math.min(n,o.min)),s||(r=Math.max(r,o.max));return n=s&&n>r?r:n,r=i&&n>r?n:r,{min:On(n,On(r,n)),max:On(r,On(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(){Ge(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:s,ticks:o}=this.options,a=o.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=TT(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?My(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=JP(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&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(){Ge(this.options.afterUpdate,[this])}beforeSetDimensions(){Ge(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(){Ge(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Ge(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Ge(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,s;for(r=0,i=t.length;r<i;r++)s=t[r],s.label=Ge(n.callback,[s.value,r,t],this)}afterTickToLabelConversion(){Ge(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Ge(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Py(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,s=n.maxRotation;let o=i,a,l,c;if(!this._isVisible()||!n.display||i>=s||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,h=on(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)),l=this.maxHeight-io(t.grid)-n.padding-$y(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),o=kf(Math.min(Math.asin(on((u.highest.height+6)/a,-1,1)),Math.asin(on(l/c,-1,1))-Math.asin(on(f/c,-1,1)))),o=Math.max(i,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){Ge(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ge(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:s}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=$y(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=io(s)+l):(t.height=this.maxHeight,t.width=io(s)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),h=r.padding*2,g=Pr(this.labelRotation),m=Math.cos(g),p=Math.sin(g);if(a){const b=r.mirror?0:p*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+b+h)}else{const b=r.mirror?0:m*d.width+p*f.height;t.width=Math.min(this.maxWidth,t.width+b+h)}this._calculatePadding(c,u,p,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,i){const{ticks:{align:s,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=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;l?c?(f=i*t.width,h=r*n.height):(f=r*t.height,h=i*n.width):s==="start"?h=n.width:s==="end"?f=t.width:s!=="inner"&&(f=t.width/2,h=n.width/2),this.paddingLeft=Math.max((f-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-d+o)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;s==="start"?(u=0,d=t.height):s==="end"&&(u=n.height,d=0),this.paddingTop=u+o,this.paddingBottom=d+o}}_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(){Ge(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++)Ke(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=My(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:s}=this,o=[],a=[],l=Math.floor(n/Py(n,r));let c=0,u=0,d,f,h,g,m,p,b,v,S,w,x;for(d=0;d<n;d+=l){if(g=t[d].label,m=this._resolveTickFontOptions(d),i.font=p=m.string,b=s[p]=s[p]||{data:{},gc:[]},v=m.lineHeight,S=w=0,!Ke(g)&&!et(g))S=Jl(i,b.data,b.gc,S,g),w=v;else if(et(g))for(f=0,h=g.length;f<h;++f)x=g[f],!Ke(x)&&!et(x)&&(S=Jl(i,b.data,b.gc,S,x),w+=v);o.push(S),a.push(w),c=Math.max(S,c),u=Math.max(w,u)}o4(s,n);const _=o.indexOf(c),C=a.indexOf(u),A=k=>({width:o[k]||0,height:a[k]||0});return{first:A(0),last:A(n-1),widest:A(_),highest:A(C),widths:o,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 Z5(this._alignToPixels?Gr(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=l4(this.getContext(),t,r))}return this.$context||(this.$context=a4(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Pr(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),s=this._getLabelSizes(),o=t.autoSkipPadding||0,a=s?s.widest.width+o:0,l=s?s.highest.height+o:0;return this.isHorizontal()?l*r>a*i?a/r:l/i:l*i<a*r?l/r:a/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:s,position:o,border:a}=i,l=s.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=io(s),h=[],g=a.setContext(this.getContext()),m=g.display?g.width:0,p=m/2,b=function(L){return Gr(r,L,m)};let v,S,w,x,_,C,A,k,P,$,j,Z;if(o==="top")v=b(this.bottom),C=this.bottom-f,k=v-p,$=b(t.top)+p,Z=t.bottom;else if(o==="bottom")v=b(this.top),$=t.top,Z=b(t.bottom)-p,C=v+p,k=this.top+f;else if(o==="left")v=b(this.right),_=this.right-f,A=v-p,P=b(t.left)+p,j=t.right;else if(o==="right")v=b(this.left),P=t.left,j=b(t.right)-p,_=v+p,A=this.left+f;else if(n==="x"){if(o==="center")v=b((t.top+t.bottom)/2+.5);else if($e(o)){const L=Object.keys(o)[0],F=o[L];v=b(this.chart.scales[L].getPixelForValue(F))}$=t.top,Z=t.bottom,C=v+p,k=C+f}else if(n==="y"){if(o==="center")v=b((t.left+t.right)/2);else if($e(o)){const L=Object.keys(o)[0],F=o[L];v=b(this.chart.scales[L].getPixelForValue(F))}_=v-p,A=_-f,P=t.left,j=t.right}const q=Pe(i.ticks.maxTicksLimit,d),N=Math.max(1,Math.ceil(d/q));for(S=0;S<d;S+=N){const L=this.getContext(S),F=s.setContext(L),se=a.setContext(L),de=F.lineWidth,R=F.color,K=se.dash||[],ae=se.dashOffset,fe=F.tickWidth,D=F.tickColor,le=F.tickBorderDash||[],re=F.tickBorderDashOffset;w=s4(this,S,l),w!==void 0&&(x=Gr(r,w,de),c?_=A=P=j=x:C=k=$=Z=x,h.push({tx1:_,ty1:C,tx2:A,ty2:k,x1:P,y1:$,x2:j,y2:Z,width:de,color:R,borderDash:K,borderDashOffset:ae,tickWidth:fe,tickColor:D,tickBorderDash:le,tickBorderDashOffset:re}))}return this._ticksLength=d,this._borderValue=v,h}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:s}=r,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=s,f=io(r.grid),h=f+u,g=d?-u:h,m=-Pr(this.labelRotation),p=[];let b,v,S,w,x,_,C,A,k,P,$,j,Z="middle";if(i==="top")_=this.bottom-g,C=this._getXAxisLabelAlignment();else if(i==="bottom")_=this.top+g,C=this._getXAxisLabelAlignment();else if(i==="left"){const N=this._getYAxisLabelAlignment(f);C=N.textAlign,x=N.x}else if(i==="right"){const N=this._getYAxisLabelAlignment(f);C=N.textAlign,x=N.x}else if(n==="x"){if(i==="center")_=(t.top+t.bottom)/2+h;else if($e(i)){const N=Object.keys(i)[0],L=i[N];_=this.chart.scales[N].getPixelForValue(L)+h}C=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")x=(t.left+t.right)/2-h;else if($e(i)){const N=Object.keys(i)[0],L=i[N];x=this.chart.scales[N].getPixelForValue(L)}C=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?Z="top":l==="end"&&(Z="bottom"));const q=this._getLabelSizes();for(b=0,v=a.length;b<v;++b){S=a[b],w=S.label;const N=s.setContext(this.getContext(b));A=this.getPixelForTick(b)+s.labelOffset,k=this._resolveTickFontOptions(b),P=k.lineHeight,$=et(w)?w.length:1;const L=$/2,F=N.color,se=N.textStrokeColor,de=N.textStrokeWidth;let R=C;o?(x=A,C==="inner"&&(b===v-1?R=this.options.reverse?"left":"right":b===0?R=this.options.reverse?"right":"left":R="center"),i==="top"?c==="near"||m!==0?j=-$*P+P/2:c==="center"?j=-q.highest.height/2-L*P+P:j=-q.highest.height+P/2:c==="near"||m!==0?j=P/2:c==="center"?j=q.highest.height/2-L*P:j=q.highest.height-$*P,d&&(j*=-1),m!==0&&!N.showLabelBackdrop&&(x+=P/2*Math.sin(m))):(_=A,j=(1-$)*P/2);let K;if(N.showLabelBackdrop){const ae=Et(N.backdropPadding),fe=q.heights[b],D=q.widths[b];let le=j-ae.top,re=0-ae.left;switch(Z){case"middle":le-=fe/2;break;case"bottom":le-=fe;break}switch(C){case"center":re-=D/2;break;case"right":re-=D;break;case"inner":b===v-1?re-=D:b>0&&(re-=D/2);break}K={left:re,top:le,width:D+ae.width,height:fe+ae.height,color:N.backdropColor}}p.push({label:w,font:k,textOffset:j,options:{rotation:m,color:F,strokeColor:se,strokeWidth:de,textAlign:R,textBaseline:Z,translation:[x,_],backdrop:K}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Pr(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:s}}=this.options,o=this._getLabelSizes(),a=t+s,l=o.widest.width;let c,u;return n==="left"?i?(u=this.right+s,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?i?(u=this.left+s,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,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:i,width:s,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,s,o),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(s=>s.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const a=(l,c,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(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(s=0,o=i.length;s<o;++s){const l=i[s];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:i}}=this,s=r.setContext(this.getContext()),o=r.display?s.width:0;if(!o)return;const a=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,f;this.isHorizontal()?(c=Gr(t,this.left,o)-o/2,u=Gr(t,this.right,a)+a/2,d=f=l):(d=Gr(t,this.top,o)-o/2,f=Gr(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&Pc(r,i);const s=this.getLabelItems(t);for(const o of s){const a=o.options,l=o.font,c=o.label,u=o.textOffset;Si(r,c,0,u,l,a)}i&&Mc(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const s=dt(r.font),o=Et(r.padding),a=r.align;let l=s.lineHeight/2;n==="bottom"||n==="center"||$e(n)?(l+=o.bottom,et(r.text)&&(l+=s.lineHeight*(r.text.length-1))):l+=o.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=u4(this,l,n,a);Si(t,r.text,0,0,s,{color:r.color,maxWidth:d,rotation:f,textAlign:c4(a,n,i),textBaseline:"middle",translation:[c,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=Pe(t.grid&&t.grid.z,-1),i=Pe(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Bs.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:r,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let s,o;for(s=0,o=n.length;s<o;++s){const a=n[s];a[r]===this.id&&(!t||a.type===t)&&i.push(a)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return dt(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class al{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;h4(n)&&(r=this.register(n));const i=this.items,s=t.id,o=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in i||(i[s]=t,d4(t,o,r),this.override&&st.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,i=this.scope;r in n&&delete n[r],i&&r in st[i]&&(delete st[i][r],this.override&&delete wi[r])}}function d4(e,t,n){const r=Qo(Object.create(null),[n?st.get(n):{},st.get(t),e.defaults]);st.set(t,r),e.defaultRoutes&&f4(t,e.defaultRoutes),e.descriptors&&st.describe(t,e.descriptors)}function f4(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),s=[e].concat(r).join("."),o=t[n].split("."),a=o.pop(),l=o.join(".");st.route(s,i,l,a)})}function h4(e){return"id"in e&&"defaults"in e}class g4{constructor(){this.controllers=new al(Yi,"datasets",!0),this.elements=new al(Pi,"elements"),this.plugins=new al(Object,"plugins"),this.scales=new al(Bs,"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(i=>{const s=r||this._getRegistryForType(i);r||s.isForType(i)||s===this.plugins&&i.id?this._exec(t,s,i):Ue(i,o=>{const a=r||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,r){const i=_f(t);Ge(r["before"+i],[],r),n[t](r),Ge(r["after"+i],[],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 i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var Pn=new g4;class y4{constructor(){this._init=[]}notify(t,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const s=i?this._descriptors(t).filter(i):this._descriptors(t),o=this._notify(s,t,n,r);return n==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,n,r,i){i=i||{};for(const s of t){const o=s.plugin,a=o[r],l=[n,i,s.options];if(Ge(a,l,o)===!1&&i.cancelable)return!1}return!0}invalidate(){Ke(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,i=Pe(r.options&&r.options.plugins,{}),s=m4(r);return i===!1&&!n?[]:b4(t,s,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(s,o)=>s.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function m4(e){const t={},n=[],r=Object.keys(Pn.plugins.items);for(let s=0;s<r.length;s++)n.push(Pn.getPlugin(r[s]));const i=e.plugins||[];for(let s=0;s<i.length;s++){const o=i[s];n.indexOf(o)===-1&&(n.push(o),t[o.id]=!0)}return{plugins:n,localIds:t}}function p4(e,t){return!t&&e===!1?null:e===!0?{}:e}function b4(e,{plugins:t,localIds:n},r,i){const s=[],o=e.getContext();for(const a of t){const l=a.id,c=p4(r[l],i);c!==null&&s.push({plugin:a,options:v4(e.config,{plugin:a,local:n[l]},c,o)})}return s}function v4(e,{plugin:t,local:n},r,i){const s=e.pluginScopeKeys(t),o=e.getOptionScopes(r,s);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Pd(e,t){const n=st.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function x4(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function w4(e,t){return e===t?"_index_":"_value_"}function jy(e){if(e==="x"||e==="y"||e==="r")return e}function S4(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Md(e,...t){if(jy(e))return e;for(const n of t){const r=n.axis||S4(n.position)||e.length>1&&jy(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Dy(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function C4(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 Dy(e,"x",n[0])||Dy(e,"y",n[0])}return{}}function _4(e,t){const n=wi[e.type]||{scales:{}},r=t.scales||{},i=Pd(e.type,t),s=Object.create(null);return Object.keys(r).forEach(o=>{const a=r[o];if(!$e(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=Md(o,a,C4(o,e),st.scales[a.type]),c=w4(l,i),u=n.scales||{};s[o]=Co(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||Pd(a,t),u=(wi[a]||{}).scales||{};Object.keys(u).forEach(d=>{const f=x4(d,l),h=o[f+"AxisID"]||f;s[h]=s[h]||Object.create(null),Co(s[h],[{axis:f},r[h],u[d]])})}),Object.keys(s).forEach(o=>{const a=s[o];Co(a,[st.scales[a.type],st.scale])}),s}function Ev(e){const t=e.options||(e.options={});t.plugins=Pe(t.plugins,{}),t.scales=_4(e,t)}function Ov(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function k4(e){return e=e||{},e.data=Ov(e.data),Ev(e),e}const Ly=new Map,Av=new Set;function ll(e,t){let n=Ly.get(e);return n||(n=t(),Ly.set(e,n),Av.add(n)),n}const so=(e,t,n)=>{const r=Yo(t,n);r!==void 0&&e.add(r)};class E4{constructor(t){this._config=k4(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=Ov(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(),Ev(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ll(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return ll(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return ll(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return ll(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:s}=this,o=this._cachedScopes(t,r),a=o.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>so(l,t,d))),u.forEach(d=>so(l,i,d)),u.forEach(d=>so(l,wi[s]||{},d)),u.forEach(d=>so(l,st,d)),u.forEach(d=>so(l,Ad,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Av.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,wi[n]||{},st.datasets[n]||{},{type:n},st,Ad]}resolveNamedOptions(t,n,r,i=[""]){const s={$shared:!0},{resolver:o,subPrefixes:a}=Iy(this._resolverCache,t,i);let l=o;if(A4(o,n)){s.$shared=!1,r=Rr(r)?r():r;const c=this.createResolver(t,r,a);l=As(o,r,c)}for(const c of n)s[c]=l[c];return s}createResolver(t,n,r=[""],i){const{resolver:s}=Iy(this._resolverCache,t,r);return $e(n)?As(s,n,void 0,i):s}}function Iy(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let s=r.get(i);return s||(s={resolver:Pf(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,s)),s}const O4=e=>$e(e)&&Object.getOwnPropertyNames(e).some(t=>Rr(e[t]));function A4(e,t){const{isScriptable:n,isIndexable:r}=lv(e);for(const i of t){const s=n(i),o=r(i),a=(o||s)&&e[i];if(s&&(Rr(a)||O4(a))||o&&et(a))return!0}return!1}var T4="4.5.0";const P4=["top","bottom","left","right","chartArea"];function Ry(e,t){return e==="top"||e==="bottom"||P4.indexOf(e)===-1&&t==="x"}function Fy(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Ny(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Ge(n&&n.onComplete,[e],t)}function M4(e){const t=e.chart,n=t.options.animation;Ge(n&&n.onProgress,[e],t)}function Tv(e){return jf()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Tl={},By=e=>{const t=Tv(e);return Object.values(Tl).filter(n=>n.canvas===t).pop()};function $4(e,t,n){const r=Object.keys(e);for(const i of r){const s=+i;if(s>=t){const o=e[i];delete e[i],(n>0||s>t)&&(e[s+n]=o)}}}function j4(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}var pr;let Dc=(pr=class{static register(...t){Pn.add(...t),qy()}static unregister(...t){Pn.remove(...t),qy()}constructor(t,n){const r=this.config=new E4(n),i=Tv(t),s=By(i);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||XP(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=F5(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=o,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 y4,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=iT(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],Tl[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Qn.listen(this,"complete",Ny),Qn.listen(this,"progress",M4),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:s}=this;return Ke(t)?n&&s?s:i?r/i: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 Pn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():fy(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return cy(this.canvas,this.ctx),this}stop(){return Qn.stop(this),this}resize(t,n){Qn.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,s=r.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,t,n,s),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,fy(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),Ge(r.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Ue(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((o,a)=>(o[a]=!1,o),{});let s=[];n&&(s=s.concat(Object.keys(n).map(o=>{const a=n[o],l=Md(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Ue(s,o=>{const a=o.options,l=a.id,c=Md(l,a),u=Pe(a.type,o.dtype);(a.position===void 0||Ry(a.position,c)!==Ry(o.dposition))&&(a.position=o.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const f=Pn.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),Ue(i,(o,a)=>{o||delete r[a]}),Ue(r,o=>{an.configure(this,o,o.options),an.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,s)=>i.index-s.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(Fy("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(s=>s===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const s=n[r];let o=this.getDatasetMeta(r);const a=s.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(r),o=this.getDatasetMeta(r)),o.type=a,o.indexAxis=s.indexAxis||Pd(a,this.options),o.order=s.order||0,o.index=r,o.label=""+s.label,o.visible=this.isDatasetVisible(r),o.controller)o.controller.updateIndex(r),o.controller.linkScales();else{const l=Pn.getController(a),{datasetElementType:c,dataElementType:u}=st.datasets[a];Object.assign(l,{dataElementType:Pn.getElement(u),datasetElementType:c&&Pn.getElement(c)}),o.controller=new l(this,r),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){Ue(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()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!i&&s.indexOf(d)===-1;d.buildOrUpdateElements(f),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=r.layout.autoPadding?o:0,this._updateLayout(o),i||Ue(s,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Fy("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Ue(this.scales,t=>{an.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!ey(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:s}of n){const o=r==="_removeElements"?-s:s;$4(t,i,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=s=>new Set(t.filter(o=>o[0]===s).map((o,a)=>a+","+o.splice(1).join(","))),i=r(0);for(let s=1;s<n;s++)if(!ey(i,r(s)))return;return Array.from(i).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;an.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Ue(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,s)=>{i._idx=s}),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,Rr(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Qn.has(this)?this.attached&&!Qn.running(this)&&Qn.start(this):(this.draw(),Ny({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,i)}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 i,s;for(i=0,s=n.length;i<s;++i){const o=n[i];(!t||o.visible)&&r.push(o)}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},i=bv(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&Pc(n,i),t.controller.draw(),i&&Mc(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return nr(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const s=PP.modes[n];return typeof s=="function"?s(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(s=>s&&s._dataset===n).pop();return i||(i={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(i)),i}getContext(){return this.$context||(this.$context=Ur(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 i=r?"show":"hide",s=this.getDatasetMeta(t),o=s.controller._resolveAnimations(void 0,i);Yl(n)?(s.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),o.update(s,{visible:r}),this.update(a=>a.datasetIndex===t?i: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(),Qn.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(),cy(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Tl[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=(s,o)=>{n.addEventListener(this,s,o),t[s]=o},i=(s,o,a)=>{s.offsetX=o,s.offsetY=a,this._eventHandler(s)};Ue(this.options.events,s=>r(s,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},s=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",s),r("detach",o)};o=()=>{this.attached=!1,i("resize",s),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){Ue(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Ue(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let s,o,a,l;for(n==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:s,index:o})=>{const a=this.getDatasetMeta(s);if(!a)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:a.data[o],index:o}});!Gl(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 i=this.options.hover,s=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=s(n,t),a=r?t:s(t,n);o.length&&this.updateHoverStyle(o,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const s=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(s||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:s}=this,o=n,a=this._getActiveElements(t,i,r,o),l=U5(t),c=j4(t,this._lastEvent,r,l);r&&(this._lastEvent=null,Ge(s.onHover,[t,a,this],this),l&&Ge(s.onClick,[t,a,this],this));const u=!Gl(a,i);return(u||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,i)}},ge(pr,"defaults",st),ge(pr,"instances",Tl),ge(pr,"overrides",wi),ge(pr,"registry",Pn),ge(pr,"version",T4),ge(pr,"getChart",By),pr);function qy(){return Ue(Dc.instances,e=>e._plugins.invalidate())}function Pv(e,t,n=t){e.lineCap=Pe(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Pe(n.borderDash,t.borderDash)),e.lineDashOffset=Pe(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Pe(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Pe(n.borderWidth,t.borderWidth),e.strokeStyle=Pe(n.borderColor,t.borderColor)}function D4(e,t,n){e.lineTo(n.x,n.y)}function L4(e){return e.stepped?vT:e.tension||e.cubicInterpolationMode==="monotone"?xT:D4}function Mv(e,t,n={}){const r=e.length,{start:i=0,end:s=r-1}=n,{start:o,end:a}=t,l=Math.max(i,o),c=Math.min(s,a),u=i<o&&s<o||i>a&&s>a;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function I4(e,t,n,r){const{points:i,options:s}=t,{count:o,start:a,loop:l,ilen:c}=Mv(i,n,r),u=L4(s);let{move:d=!0,reverse:f}=r||{},h,g,m;for(h=0;h<=c;++h)g=i[(a+(f?c-h:h))%o],!g.skip&&(d?(e.moveTo(g.x,g.y),d=!1):u(e,m,g,f,s.stepped),m=g);return l&&(g=i[(a+(f?c:0))%o],u(e,m,g,f,s.stepped)),!!l}function R4(e,t,n,r){const i=t.points,{count:s,start:o,ilen:a}=Mv(i,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,f,h,g,m,p,b;const v=w=>(o+(c?a-w:w))%s,S=()=>{m!==p&&(e.lineTo(u,p),e.lineTo(u,m),e.lineTo(u,b))};for(l&&(h=i[v(0)],e.moveTo(h.x,h.y)),f=0;f<=a;++f){if(h=i[v(f)],h.skip)continue;const w=h.x,x=h.y,_=w|0;_===g?(x<m?m=x:x>p&&(p=x),u=(d*u+w)/++d):(S(),e.lineTo(w,x),g=_,d=0,m=p=x),b=x}S()}function $d(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?R4:I4}function F4(e){return e.stepped?eP:e.tension||e.cubicInterpolationMode==="monotone"?tP:Jr}function N4(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Pv(e,t.options),e.stroke(i)}function B4(e,t,n,r){const{segments:i,options:s}=t,o=$d(t);for(const a of i)Pv(e,s,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const q4=typeof Path2D=="function";function z4(e,t,n,r){q4&&!t.options.segment?N4(e,t,n,r):B4(e,t,n,r)}class Mr extends Pi{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 i=r.spanGaps?this._loop:this._fullLoop;WT(this._points,r,t,i,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=aP(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,i=t[n],s=this.points,o=pv(this,{property:n,start:i,end:i});if(!o.length)return;const a=[],l=F4(r);let c,u;for(c=0,u=o.length;c<u;++c){const{start:d,end:f}=o[c],h=s[d],g=s[f];if(h===g){a.push(h);continue}const m=Math.abs((i-h[n])/(g[n]-h[n])),p=l(h,g,m,r.stepped);p[n]=t[n],a.push(p)}return a.length===1?a[0]:a}pathSegment(t,n,r){return $d(this)(t,this,n,r)}path(t,n,r){const i=this.segments,s=$d(this);let o=this._loop;n=n||0,r=r||this.points.length-n;for(const a of i)o&=s(t,this,a,{start:n,end:n+r-1});return!!o}draw(t,n,r,i){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),z4(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}ge(Mr,"id","line"),ge(Mr,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),ge(Mr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),ge(Mr,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function zy(e,t,n,r){const i=e.options,{[n]:s}=e.getProps([n],r);return Math.abs(t-s)<i.radius+i.hitRadius}class Pl extends Pi{constructor(n){super();ge(this,"parsed");ge(this,"skip");ge(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,i){const s=this.options,{x:o,y:a}=this.getProps(["x","y"],i);return Math.pow(n-o,2)+Math.pow(r-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(n,r){return zy(this,n,"x",r)}inYRange(n,r){return zy(this,n,"y",r)}getCenterPoint(n){const{x:r,y:i}=this.getProps(["x","y"],n);return{x:r,y:i}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const i=r&&n.borderWidth||0;return(r+i)*2}draw(n,r){const i=this.options;this.skip||i.radius<.1||!nr(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,Td(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}ge(Pl,"id","point"),ge(Pl,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),ge(Pl,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function H4(e,t,n){const r=e.segments,i=e.points,s=t.points,o=[];for(const a of r){let{start:l,end:c}=a;c=Lc(l,c,i);const u=jd(n,i[l],i[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:i[l],end:i[c]});continue}const d=pv(t,u);for(const f of d){const h=jd(n,s[f.start],s[f.end],f.loop),g=mv(a,i,h);for(const m of g)o.push({source:m,target:f,start:{[n]:Hy(u,h,"start",Math.max)},end:{[n]:Hy(u,h,"end",Math.min)}})}}return o}function jd(e,t,n,r){if(r)return;let i=t[e],s=n[e];return e==="angle"&&(i=Wt(i),s=Wt(s)),{property:e,start:i,end:s}}function U4(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,s=[];return t.segments.forEach(({start:o,end:a})=>{a=Lc(o,a,i);const l=i[o],c=i[a];r!==null?(s.push({x:l.x,y:r}),s.push({x:c.x,y:r})):n!==null&&(s.push({x:n,y:l.y}),s.push({x:n,y:c.y}))}),s}function Lc(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function Hy(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function $v(e,t){let n=[],r=!1;return et(e)?(r=!0,n=e):n=U4(e,t),n.length?new Mr({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function Uy(e){return e&&e.fill!==!1}function K4(e,t,n){let i=e[t].fill;const s=[t];let o;if(!n)return i;for(;i!==!1&&s.indexOf(i)===-1;){if(!gt(i))return i;if(o=e[i],!o)return!1;if(o.visible)return i;s.push(i),i=o.fill}return!1}function W4(e,t,n){const r=Y4(e);if($e(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return gt(i)&&Math.floor(i)===i?V4(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function V4(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function G4(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:$e(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function Q4(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:$e(e)?r=e.value:r=t.getBaseValue(),r}function Y4(e){const t=e.options,n=t.fill;let r=Pe(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function X4(e){const{scale:t,index:n,line:r}=e,i=[],s=r.segments,o=r.points,a=J4(t,n);a.push($v({x:null,y:t.bottom},r));for(let l=0;l<s.length;l++){const c=s[l];for(let u=c.start;u<=c.end;u++)Z4(i,o[u],a)}return new Mr({points:i,options:{}})}function J4(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let i=0;i<r.length;i++){const s=r[i];if(s.index===t)break;s.hidden||n.unshift(s.dataset)}return n}function Z4(e,t,n){const r=[];for(let i=0;i<n.length;i++){const s=n[i],{first:o,last:a,point:l}=eM(s,t,"x");if(!(!l||o&&a)){if(o)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function eM(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const i=r[n],s=e.segments,o=e.points;let a=!1,l=!1;for(let c=0;c<s.length;c++){const u=s[c],d=o[u.start][n],f=o[u.end][n];if(Wi(i,d,f)){a=i===d,l=i===f;break}}return{first:a,last:l,point:r}}class jv{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:i,y:s,radius:o}=this;return n=n||{start:0,end:Yt},t.arc(i,s,o,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:i}=this,s=t.angle;return{x:n+Math.cos(s)*i,y:r+Math.sin(s)*i,angle:s}}}function tM(e){const{chart:t,fill:n,line:r}=e;if(gt(n))return nM(t,n);if(n==="stack")return X4(e);if(n==="shape")return!0;const i=rM(e);return i instanceof jv?i:$v(i,r)}function nM(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function rM(e){return(e.scale||{}).getPointPositionForValue?sM(e):iM(e)}function iM(e){const{scale:t={},fill:n}=e,r=G4(n,t);if(gt(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function sM(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,s=r.reverse?t.max:t.min,o=Q4(n,t,s),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,s);return new jv({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<i;++l)a.push(t.getPointPositionForValue(l,o));return a}function Ou(e,t,n){const r=tM(t),{chart:i,index:s,line:o,scale:a,axis:l}=t,c=o.options,u=c.fill,d=c.backgroundColor,{above:f=d,below:h=d}=u||{},g=i.getDatasetMeta(s),m=bv(i,g);r&&o.points.length&&(Pc(e,n),oM(e,{line:o,target:r,above:f,below:h,area:n,scale:a,axis:l,clip:m}),Mc(e))}function oM(e,t){const{line:n,target:r,above:i,below:s,area:o,scale:a,clip:l}=t,c=n._loop?"angle":t.axis;e.save();let u=s;s!==i&&(c==="x"?(Ky(e,r,o.top),Au(e,{line:n,target:r,color:i,scale:a,property:c,clip:l}),e.restore(),e.save(),Ky(e,r,o.bottom)):c==="y"&&(Wy(e,r,o.left),Au(e,{line:n,target:r,color:s,scale:a,property:c,clip:l}),e.restore(),e.save(),Wy(e,r,o.right),u=i)),Au(e,{line:n,target:r,color:u,scale:a,property:c,clip:l}),e.restore()}function Ky(e,t,n){const{segments:r,points:i}=t;let s=!0,o=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,u=i[l],d=i[Lc(l,c,i)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),o=!!t.pathSegment(e,a,{move:o}),o?e.closePath():e.lineTo(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Wy(e,t,n){const{segments:r,points:i}=t;let s=!0,o=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,u=i[l],d=i[Lc(l,c,i)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(n,u.y),e.lineTo(u.x,u.y)),o=!!t.pathSegment(e,a,{move:o}),o?e.closePath():e.lineTo(n,d.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function Au(e,t){const{line:n,target:r,property:i,color:s,scale:o,clip:a}=t,l=H4(n,r,i);for(const{source:c,target:u,start:d,end:f}of l){const{style:{backgroundColor:h=s}={}}=c,g=r!==!0;e.save(),e.fillStyle=h,aM(e,o,a,g&&jd(i,d,f)),e.beginPath();const m=!!n.pathSegment(e,c);let p;if(g){m?e.closePath():Vy(e,r,f,i);const b=!!r.pathSegment(e,u,{move:m,reverse:!0});p=m&&b,p||Vy(e,r,d,i)}e.closePath(),e.fill(p?"evenodd":"nonzero"),e.restore()}}function aM(e,t,n,r){const i=t.chart.chartArea,{property:s,start:o,end:a}=r||{};if(s==="x"||s==="y"){let l,c,u,d;s==="x"?(l=o,c=i.top,u=a,d=i.bottom):(l=i.left,c=o,u=i.right,d=a),e.beginPath(),n&&(l=Math.max(l,n.left),u=Math.min(u,n.right),c=Math.max(c,n.top),d=Math.min(d,n.bottom)),e.rect(l,c,u-l,d-c),e.clip()}}function Vy(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var lM={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,i=[];let s,o,a,l;for(o=0;o<r;++o)s=e.getDatasetMeta(o),a=s.dataset,l=null,a&&a.options&&a instanceof Mr&&(l={visible:e.isDatasetVisible(o),index:o,fill:W4(a,o,r),chart:e,axis:s.controller.options.indexAxis,scale:s.vScale,line:a}),s.$filler=l,i.push(l);for(o=0;o<r;++o)l=i[o],!(!l||l.fill===!1)&&(l.fill=K4(i,o,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),s=e.chartArea;for(let o=i.length-1;o>=0;--o){const a=i[o].$filler;a&&(a.line.updateControlPoints(s,a.axis),r&&a.fill&&Ou(e.ctx,a,s))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const s=r[i].$filler;Uy(s)&&Ou(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!Uy(r)||n.drawTime!=="beforeDatasetDraw"||Ou(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Gy=(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)}},cM=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Qy extends Pi{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=Ge(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,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,i=dt(r.font),s=i.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Gy(r,s);let c,u;n.font=i.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,s,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,i,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:s,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=i+a;let d=t;s.textAlign="left",s.textBaseline="middle";let f=-1,h=-u;return this.legendItems.forEach((g,m)=>{const p=r+n/2+s.measureText(g.text).width;(m===0||c[c.length-1]+p+2*a>o)&&(d+=u,c[c.length-(m>0?0:1)]=0,h+=u,f++),l[m]={left:0,top:h,row:f,width:p,height:i},c[c.length-1]+=p+a}),d}_fitCols(t,n,r,i){const{ctx:s,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,f=0,h=0,g=0,m=0;return this.legendItems.forEach((p,b)=>{const{itemWidth:v,itemHeight:S}=uM(r,n,s,p,i);b>0&&h+S+2*a>u&&(d+=f+a,c.push({width:f,height:h}),g+=f+a,m++,f=h=0),l[b]={left:g,top:h,col:m,width:v,height:S},f=Math.max(f,v),h+=S+a}),d+=f,c.push({width:f,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:s}}=this,o=Qi(s,this.left,this.width);if(this.isHorizontal()){let a=0,l=xt(r,this.left+i,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=xt(r,this.left+i,this.right-this.lineWidths[a])),c.top+=this.top+t+i,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+i}else{let a=0,l=xt(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=xt(r,this.top+t+i,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+i,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Pc(t,this),this._draw(),Mc(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:s,labels:o}=t,a=st.color,l=Qi(t.rtl,this.left,this.width),c=dt(o.font),{padding:u}=o,d=c.size,f=d/2;let h;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:g,boxHeight:m,itemHeight:p}=Gy(o,d),b=function(_,C,A){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;i.save();const k=Pe(A.lineWidth,1);if(i.fillStyle=Pe(A.fillStyle,a),i.lineCap=Pe(A.lineCap,"butt"),i.lineDashOffset=Pe(A.lineDashOffset,0),i.lineJoin=Pe(A.lineJoin,"miter"),i.lineWidth=k,i.strokeStyle=Pe(A.strokeStyle,a),i.setLineDash(Pe(A.lineDash,[])),o.usePointStyle){const P={radius:m*Math.SQRT2/2,pointStyle:A.pointStyle,rotation:A.rotation,borderWidth:k},$=l.xPlus(_,g/2),j=C+f;ov(i,P,$,j,o.pointStyleWidth&&g)}else{const P=C+Math.max((d-m)/2,0),$=l.leftForLtr(_,g),j=Gi(A.borderRadius);i.beginPath(),Object.values(j).some(Z=>Z!==0)?Zl(i,{x:$,y:P,w:g,h:m,radius:j}):i.rect($,P,g,m),i.fill(),k!==0&&i.stroke()}i.restore()},v=function(_,C,A){Si(i,A.text,_,C+p/2,c,{strikethrough:A.hidden,textAlign:l.textAlign(A.textAlign)})},S=this.isHorizontal(),w=this._computeTitleHeight();S?h={x:xt(s,this.left+u,this.right-r[0]),y:this.top+u+w,line:0}:h={x:this.left+u,y:xt(s,this.top+w+u,this.bottom-n[0].height),line:0},hv(this.ctx,t.textDirection);const x=p+u;this.legendItems.forEach((_,C)=>{i.strokeStyle=_.fontColor,i.fillStyle=_.fontColor;const A=i.measureText(_.text).width,k=l.textAlign(_.textAlign||(_.textAlign=o.textAlign)),P=g+f+A;let $=h.x,j=h.y;l.setWidth(this.width),S?C>0&&$+P+u>this.right&&(j=h.y+=x,h.line++,$=h.x=xt(s,this.left+u,this.right-r[h.line])):C>0&&j+x>this.bottom&&($=h.x=$+n[h.line].width+u,h.line++,j=h.y=xt(s,this.top+w+u,this.bottom-n[h.line].height));const Z=l.x($);if(b(Z,j,_),$=sT(k,$+g+f,S?$+P:this.right,t.rtl),v(l.x($),j,_),S)h.x+=P+u;else if(typeof _.text!="string"){const q=c.lineHeight;h.y+=Dv(_,q)+u}else h.y+=x}),gv(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=dt(n.font),i=Et(n.padding);if(!n.display)return;const s=Qi(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=r.size/2,c=i.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=xt(t.align,d,this.right-f);else{const g=this.columnSizes.reduce((m,p)=>Math.max(m,p.height),0);u=c+xt(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const h=xt(a,d,d+f);o.textAlign=s.textAlign(Of(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,Si(o,n.text,h,u,r)}_computeTitleHeight(){const t=this.options.title,n=dt(t.font),r=Et(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,s;if(Wi(t,this.left,this.right)&&Wi(n,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(i=s[r],Wi(t,i.left,i.left+i.width)&&Wi(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!hM(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,s=cM(i,r);i&&!s&&Ge(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!s&&Ge(n.onHover,[t,r,this],this)}else r&&Ge(n.onClick,[t,r,this],this)}}function uM(e,t,n,r,i){const s=dM(r,e,t,n),o=fM(i,r,t.lineHeight);return{itemWidth:s,itemHeight:o}}function dM(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((s,o)=>s.length>o.length?s:o)),t+n.size/2+r.measureText(i).width}function fM(e,t,n){let r=e;return typeof t.text!="string"&&(r=Dv(t,n)),r}function Dv(e,t){const n=e.text?e.text.length:0;return t*n}function hM(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var gM={id:"legend",_element:Qy,start(e,t,n){const r=e.legend=new Qy({ctx:e.ctx,options:n,chart:e});an.configure(e,r,n),an.addBox(e,r)},stop(e){an.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;an.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,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.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:i,color:s,useBorderRadius:o,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Et(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:s,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.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 Lv extends Pi{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 i=et(r.text)?r.text.length:1;this._padding=Et(r.padding);const s=i*dt(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:i,right:s,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=xt(a,r,s),d=n+t,c=s-r):(o.position==="left"?(u=r+t,d=xt(a,i,n),l=lt*-.5):(u=s-t,d=xt(a,n,i),l=lt*.5),c=i-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=dt(n.font),s=r.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(s);Si(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:Of(n.align),textBaseline:"middle",translation:[o,a]})}}function yM(e,t){const n=new Lv({ctx:e.ctx,options:t,chart:e});an.configure(e,n,t),an.addBox(e,n),e.titleBlock=n}var mM={id:"title",_element:Lv,start(e,t,n){yM(e,n)},stop(e){const t=e.titleBlock;an.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;an.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 po={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,s=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();r.add(l.x),i+=l.y,++s}}return s===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:i/s}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,s,o,a;for(s=0,o=e.length;s<o;++s){const l=e[s].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=Od(t,c);u<i&&(i=u,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Tn(e,t){return t&&(et(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Yn(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
68
+ `)>-1?e.split(`
69
+ `):e}function pM(e,t){const{element:n,datasetIndex:r,index:i}=t,s=e.getDatasetMeta(r).controller,{label:o,value:a}=s.getLabelAndValue(i);return{chart:e,label:o,parsed:s.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:a,dataset:s.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function Yy(e,t){const n=e.chart.ctx,{body:r,footer:i,title:s}=e,{boxWidth:o,boxHeight:a}=t,l=dt(t.bodyFont),c=dt(t.titleFont),u=dt(t.footerFont),d=s.length,f=i.length,h=r.length,g=Et(t.padding);let m=g.height,p=0,b=r.reduce((w,x)=>w+x.before.length+x.lines.length+x.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const w=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=h*w+(b-h)*l.lineHeight+(b-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let v=0;const S=function(w){p=Math.max(p,n.measureText(w).width+v)};return n.save(),n.font=c.string,Ue(e.title,S),n.font=l.string,Ue(e.beforeBody.concat(e.afterBody),S),v=t.displayColors?o+2+t.boxPadding:0,Ue(r,w=>{Ue(w.before,S),Ue(w.lines,S),Ue(w.after,S)}),v=0,n.font=u.string,Ue(e.footer,S),n.restore(),p+=g.width,{width:p,height:m}}function bM(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function vM(e,t,n,r){const{x:i,width:s}=r,o=n.caretSize+n.caretPadding;if(e==="left"&&i+s+o>t.width||e==="right"&&i-s-o<0)return!0}function xM(e,t,n,r){const{x:i,width:s}=n,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=i<=(a+l)/2?"left":"right":i<=s/2?c="left":i>=o-s/2&&(c="right"),vM(c,e,t,n)&&(c="center"),c}function Xy(e,t,n){const r=n.yAlign||t.yAlign||bM(e,n);return{xAlign:n.xAlign||t.xAlign||xM(e,t,n,r),yAlign:r}}function wM(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function SM(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function Jy(e,t,n,r){const{caretSize:i,caretPadding:s,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=i+s,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:h}=Gi(o);let g=wM(t,a);const m=SM(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(u,f)+i:a==="right"&&(g+=Math.max(d,h)+i),{x:on(g,0,r.width-t.width),y:on(m,0,r.height-t.height)}}function cl(e,t,n){const r=Et(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function Zy(e){return Tn([],Yn(e))}function CM(e,t,n){return Ur(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function em(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Iv={beforeTitle:Wn,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:Wn,beforeBody:Wn,beforeLabel:Wn,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 Ke(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:Wn,afterBody:Wn,beforeFooter:Wn,footer:Wn,afterFooter:Wn};function Dt(e,t,n,r){const i=e[t].call(n,r);return typeof i=="undefined"?Iv[t].call(n,r):i}class Dd extends Pi{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()),i=r.enabled&&n.options.animation&&r.animations,s=new vv(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=CM(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=Dt(r,"beforeTitle",this,t),s=Dt(r,"title",this,t),o=Dt(r,"afterTitle",this,t);let a=[];return a=Tn(a,Yn(i)),a=Tn(a,Yn(s)),a=Tn(a,Yn(o)),a}getBeforeBody(t,n){return Zy(Dt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Ue(t,s=>{const o={before:[],lines:[],after:[]},a=em(r,s);Tn(o.before,Yn(Dt(a,"beforeLabel",this,s))),Tn(o.lines,Dt(a,"label",this,s)),Tn(o.after,Yn(Dt(a,"afterLabel",this,s))),i.push(o)}),i}getAfterBody(t,n){return Zy(Dt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=Dt(r,"beforeFooter",this,t),s=Dt(r,"footer",this,t),o=Dt(r,"afterFooter",this,t);let a=[];return a=Tn(a,Yn(i)),a=Tn(a,Yn(s)),a=Tn(a,Yn(o)),a}_createItems(t){const n=this._active,r=this.chart.data,i=[],s=[],o=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(pM(this.chart,n[l]));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))),Ue(a,u=>{const d=em(t.callbacks,u);i.push(Dt(d,"labelColor",this,u)),s.push(Dt(d,"labelPointStyle",this,u)),o.push(Dt(d,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let s,o=[];if(!i.length)this.opacity!==0&&(s={opacity:0});else{const a=po[r.position].call(this,i,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);const l=this._size=Yy(this,r),c=Object.assign({},a,l),u=Xy(this.chart,r,c),d=Jy(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const s=this.getCaretPosition(t,r,i);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:s}=this,{caretSize:o,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Gi(a),{x:f,y:h}=t,{width:g,height:m}=n;let p,b,v,S,w,x;return s==="center"?(w=h+m/2,i==="left"?(p=f,b=p-o,S=w+o,x=w-o):(p=f+g,b=p+o,S=w-o,x=w+o),v=p):(i==="left"?b=f+Math.max(l,u)+o:i==="right"?b=f+g-Math.max(c,d)-o:b=this.caretX,s==="top"?(S=h,w=S-o,p=b-o,v=b+o):(S=h+m,w=S+o,p=b+o,v=b-o),x=S),{x1:p,x2:b,x3:v,y1:S,y2:w,y3:x}}drawTitle(t,n,r){const i=this.title,s=i.length;let o,a,l;if(s){const c=Qi(r.rtl,this.x,this.width);for(t.x=cl(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",o=dt(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=o.string,l=0;l<s;++l)n.fillText(i[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===s&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,i,s){const o=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=s,u=dt(s.bodyFont),d=cl(this,"left",s),f=i.x(d),h=l<u.lineHeight?(u.lineHeight-l)/2:0,g=n.y+h;if(s.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},p=i.leftForLtr(f,c)+c/2,b=g+l/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,Td(t,m,p,b),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Td(t,m,p,b)}else{t.lineWidth=$e(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const m=i.leftForLtr(f,c),p=i.leftForLtr(i.xPlus(f,1),c-2),b=Gi(o.borderRadius);Object.values(b).some(v=>v!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,Zl(t,{x:m,y:g,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Zl(t,{x:p,y:g+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(m,g,c,l),t.strokeRect(m,g,c,l),t.fillStyle=o.backgroundColor,t.fillRect(p,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:s,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=dt(r.bodyFont);let f=d.lineHeight,h=0;const g=Qi(r.rtl,this.x,this.width),m=function(A){n.fillText(A,g.x(t.x+h),t.y+f/2),t.y+=f+s},p=g.textAlign(o);let b,v,S,w,x,_,C;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=cl(this,p,r),n.fillStyle=r.bodyColor,Ue(this.beforeBody,m),h=a&&p!=="right"?o==="center"?c/2+u:c+2+u:0,w=0,_=i.length;w<_;++w){for(b=i[w],v=this.labelTextColors[w],n.fillStyle=v,Ue(b.before,m),S=b.lines,a&&S.length&&(this._drawColorBox(n,t,w,g,r),f=Math.max(d.lineHeight,l)),x=0,C=S.length;x<C;++x)m(S[x]),f=d.lineHeight;Ue(b.after,m)}h=0,f=d.lineHeight,Ue(this.afterBody,m),t.y-=s}drawFooter(t,n,r){const i=this.footer,s=i.length;let o,a;if(s){const l=Qi(r.rtl,this.x,this.width);for(t.x=cl(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=dt(r.footerFont),n.fillStyle=r.footerColor,n.font=o.string,a=0;a<s;++a)n.fillText(i[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:s,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:f,bottomLeft:h,bottomRight:g}=Gi(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+d,l),o==="top"&&this.drawCaret(t,n,r,i),n.lineTo(a+c-f,l),n.quadraticCurveTo(a+c,l,a+c,l+f),o==="center"&&s==="right"&&this.drawCaret(t,n,r,i),n.lineTo(a+c,l+u-g),n.quadraticCurveTo(a+c,l+u,a+c-g,l+u),o==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(a+h,l+u),n.quadraticCurveTo(a,l+u,a,l+u-h),o==="center"&&s==="left"&&this.drawCaret(t,n,r,i),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,s=r&&r.y;if(i||s){const o=po[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=Yy(this,t),l=Object.assign({},o,this._size),c=Xy(n,t,l),u=Jy(t,l,c,n);(i._to!==u.x||s._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.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 i={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const o=Et(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(s,t,i,n),hv(t,n.textDirection),s.y+=o.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),gv(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),s=!Gl(r,i),o=this._positionChanged(i,n);(s||o)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,s=this._active||[],o=this._getActiveElements(t,s,n,r),a=this._positionChanged(o,t),l=n||!Gl(o,s)||a;return l&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const s=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,s.mode,s,r);return s.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:r,caretY:i,options:s}=this,o=po[s.position].call(this,t,n);return o!==!1&&(r!==o.x||i!==o.y)}}ge(Dd,"positioners",po);var _M={id:"tooltip",_element:Dd,positioners:po,afterInit(e,t,n){n&&(e.tooltip=new Dd({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:Iv},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"]};const kM=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function EM(e,t,n,r){const i=e.indexOf(t);if(i===-1)return kM(e,t,n,r);const s=e.lastIndexOf(t);return i!==s?n:i}const OM=(e,t)=>e===null?null:on(Math.round(e),0,t);function tm(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Ld extends Bs{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:i,label:s}of n)r[i]===s&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(Ke(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:EM(r,t,Pe(n,t),this._addedLabels),OM(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let s=this.getLabels();s=t===0&&n===s.length-1?s:s.slice(t,n+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let o=t;o<=n;o++)i.push({value:o});return i}getLabelForValue(t){return tm.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}}ge(Ld,"id","category"),ge(Ld,"defaults",{ticks:{callback:tm}});function AM(e,t){const n=[],{bounds:i,step:s,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,h=s||1,g=u-1,{min:m,max:p}=t,b=!Ke(o),v=!Ke(a),S=!Ke(c),w=(p-m)/(d+1);let x=ny((p-m)/g/h)*h,_,C,A,k;if(x<1e-14&&!b&&!v)return[{value:m},{value:p}];k=Math.ceil(p/x)-Math.floor(m/x),k>g&&(x=ny(k*x/g/h)*h),Ke(l)||(_=Math.pow(10,l),x=Math.ceil(x*_)/_),i==="ticks"?(C=Math.floor(m/x)*x,A=Math.ceil(p/x)*x):(C=m,A=p),b&&v&&s&&Q5((a-o)/s,x/1e3)?(k=Math.round(Math.min((a-o)/x,u)),x=(a-o)/k,C=o,A=a):S?(C=b?o:C,A=v?a:A,k=c-1,x=(A-C)/k):(k=(A-C)/x,_o(k,Math.round(k),x/1e3)?k=Math.round(k):k=Math.ceil(k));const P=Math.max(ry(x),ry(C));_=Math.pow(10,Ke(l)?P:l),C=Math.round(C*_)/_,A=Math.round(A*_)/_;let $=0;for(b&&(f&&C!==o?(n.push({value:o}),C<o&&$++,_o(Math.round((C+$*x)*_)/_,o,nm(o,w,e))&&$++):C<o&&$++);$<k;++$){const j=Math.round((C+$*x)*_)/_;if(v&&j>a)break;n.push({value:j})}return v&&f&&A!==a?n.length&&_o(n[n.length-1].value,a,nm(a,w,e))?n[n.length-1].value=a:n.push({value:a}):(!v||A===a)&&n.push({value:A}),n}function nm(e,t,{horizontal:n,minRotation:r}){const i=Pr(r),s=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/s,o)}class Id extends Bs{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 Ke(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:i,max:s}=this;const o=l=>i=n?i:l,a=l=>s=r?s:l;if(t){const l=Os(i),c=Os(s);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(i===s){let l=s===0?1:Math.abs(s*.05);a(s+l),t||o(i-l)}this.min=i,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={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},s=this._range||this,o=AM(i,s);return t.bounds==="ticks"&&Y5(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return sv(t,this.chart.options.locale,this.options.ticks.format)}}class Rd extends Id{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=gt(t)?t:0,this.max=gt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Pr(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}ge(Rd,"id","linear"),ge(Rd,"defaults",{ticks:{callback:Tf.formatters.numeric}});function Fd(e){const t=e.ticks;if(t.display&&e.display){const n=Et(t.backdropPadding);return Pe(t.font&&t.font.size,st.font.size)+n.height}return 0}function TM(e,t,n){return n=et(n)?n:[n],{w:bT(e,t.string,n),h:n.length*t.lineHeight}}function rm(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function PM(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=[],i=[],s=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?lt/s:0;for(let l=0;l<s;l++){const c=o.setContext(e.getPointLabelContext(l));i[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+i[l],a),d=dt(c.font),f=TM(e.ctx,d,e._pointLabels[l]);r[l]=f;const h=Wt(e.getIndexAngle(l)+a),g=Math.round(kf(h)),m=rm(g,u.x,f.w,0,180),p=rm(g,u.y,f.h,90,270);MM(n,t,h,m,p)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=DM(e,r,i)}function MM(e,t,n,r,i){const s=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n));let a=0,l=0;r.start<t.l?(a=(t.l-r.start)/s,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/s,e.r=Math.max(e.r,t.r+a)),i.start<t.t?(l=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function $M(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:s,padding:o,size:a}=n,l=e.getPointPosition(t,r+i+o,s),c=Math.round(kf(Wt(l.angle+Qt))),u=RM(l.y,a.h,c),d=LM(c),f=IM(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function jM(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:s}=e;return!(nr({x:n,y:r},t)||nr({x:n,y:s},t)||nr({x:i,y:r},t)||nr({x:i,y:s},t))}function DM(e,t,n){const r=[],i=e._pointLabels.length,s=e.options,{centerPointLabels:o,display:a}=s.pointLabels,l={extra:Fd(s)/2,additionalAngle:o?lt/i:0};let c;for(let u=0;u<i;u++){l.padding=n[u],l.size=t[u];const d=$M(e,u,l);r.push(d),a==="auto"&&(d.visible=jM(d,c),d.visible&&(c=d))}return r}function LM(e){return e===0||e===180?"center":e<180?"left":"right"}function IM(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function RM(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function FM(e,t,n){const{left:r,top:i,right:s,bottom:o}=n,{backdropColor:a}=t;if(!Ke(a)){const l=Gi(t.borderRadius),c=Et(t.backdropPadding);e.fillStyle=a;const u=r-c.left,d=i-c.top,f=s-r+c.width,h=o-i+c.height;Object.values(l).some(g=>g!==0)?(e.beginPath(),Zl(e,{x:u,y:d,w:f,h,radius:l}),e.fill()):e.fillRect(u,d,f,h)}}function NM(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const s=e._pointLabelItems[i];if(!s.visible)continue;const o=r.setContext(e.getPointLabelContext(i));FM(n,o,s);const a=dt(o.font),{x:l,y:c,textAlign:u}=s;Si(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function Rv(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,Yt);else{let s=e.getPointPosition(0,t);i.moveTo(s.x,s.y);for(let o=1;o<r;o++)s=e.getPointPosition(o,t),i.lineTo(s.x,s.y)}}function BM(e,t,n,r,i){const s=e.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!r||!a||!l||n<0||(s.save(),s.strokeStyle=a,s.lineWidth=l,s.setLineDash(i.dash||[]),s.lineDashOffset=i.dashOffset,s.beginPath(),Rv(e,n,o,r),s.closePath(),s.stroke(),s.restore())}function qM(e,t,n){return Ur(e,{label:n,index:t,type:"pointLabel"})}class bo extends Id{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=Et(Fd(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=gt(t)&&!isNaN(t)?t:0,this.max=gt(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Fd(this.options))}generateTickLabels(t){Id.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=Ge(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?PM(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=Yt/(this._pointLabels.length||1),r=this.options.startAngle||0;return Wt(t*n+Pr(r))}getDistanceFromCenterForValue(t){if(Ke(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(Ke(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 qM(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-Qt+r;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}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:i,bottom:s}=this._pointLabelItems[t];return{left:n,top:r,right:i,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),Rv(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:i,border:s}=n,o=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&NM(this,o),i.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),h=i.setContext(f),g=s.setContext(f);BM(this,h,l,o,g)}}),r.display){for(t.save(),a=o-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,l=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let s,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=dt(c.font);if(s=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Et(c.backdropPadding);t.fillRect(-o/2-d.left,-s-u.size/2-d.top,o+d.width,u.size+d.height)}Si(t,a.label,0,-s,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}ge(bo,"id","radialLinear"),ge(bo,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Tf.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),ge(bo,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),ge(bo,"descriptors",{angleLines:{_fallback:"grid"}});const Ic={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}},Ft=Object.keys(Ic);function im(e,t){return e-t}function sm(e,t){if(Ke(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:s}=e._parseOpts;let o=t;return typeof r=="function"&&(o=r(o)),gt(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(Xo(s)||s===!0)?n.startOf(o,"isoWeek",s):n.startOf(o,i)),+o)}function om(e,t,n,r){const i=Ft.length;for(let s=Ft.indexOf(e);s<i-1;++s){const o=Ic[Ft[s]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(a*o.size))<=r)return Ft[s]}return Ft[i-1]}function zM(e,t,n,r,i){for(let s=Ft.length-1;s>=Ft.indexOf(n);s--){const o=Ft[s];if(Ic[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return Ft[n?Ft.indexOf(n):0]}function HM(e){for(let t=Ft.indexOf(e)+1,n=Ft.length;t<n;++t)if(Ic[Ft[t]].common)return Ft[t]}function am(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Ef(n,t),s=n[r]>=t?n[r]:n[i];e[s]=!0}}function UM(e,t,n,r){const i=e._adapter,s=+i.startOf(t[0].value,r),o=t[t.length-1].value;let a,l;for(a=s;a<=o;a=+i.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function lm(e,t,n){const r=[],i={},s=t.length;let o,a;for(o=0;o<s;++o)a=t[o],i[a]=o,r.push({value:a,major:!1});return s===0||!n?r:UM(e,r,i,n)}class nc extends Bs{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={}),i=this._adapter=new kP._date(t.adapters.date);i.init(n),Co(r.displayFormats,i.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:sm(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:i,max:s,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!a&&!isNaN(c.max)&&(s=Math.max(s,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=gt(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),s=gt(s)&&!isNaN(s)?s:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,s-1),this.max=Math.max(i+1,s)}_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,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const s=this.min,o=this.max,a=tT(i,s,o);return this._unit=n.unit||(r.autoSkip?om(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):zM(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:HM(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),lm(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,s;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?r=s:r=(s-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=on(n,0,o),r=on(r,0,o),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,s=i.time,o=s.unit||om(s.minUnit,n,r,this._getLabelCapacity(n)),a=Pe(i.ticks.stepSize,1),l=o==="week"?s.isoWeekday:!1,c=Xo(l)||l===!0,u={};let d=n,f,h;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(r,n,o)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+o);const g=i.ticks.source==="data"&&this.getDataTimestamps();for(f=d,h=0;f<r;f=+t.add(f,a,o),h++)am(u,f,g);return(f===r||i.bounds==="ticks"||h===1)&&am(u,f,g),Object.keys(u).sort(im).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 i=this.options.time.displayFormats,s=this._unit,o=n||i[s];return this._adapter.format(t,o)}_tickFormatFunction(t,n,r,i){const s=this.options,o=s.ticks.callback;if(o)return Ge(o,[t,n,r],this);const a=s.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],f=r[n],h=c&&d&&f&&f.major;return this._adapter.format(t,i||(h?d:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.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,i=Pr(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(i),o=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:r*s+a*o,h:r*o+a*s}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,s=this._tickFormatFunction(t,0,lm(this,[t],this._majorUnit),i),o=this._getLabelSize(s),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[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 i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(sm(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return rT(t.sort(im))}}ge(nc,"id","time"),ge(nc,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function ul(e,t,n){let r=0,i=e.length-1,s,o,a,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=ni(e,"pos",t)),{pos:s,time:a}=e[r],{pos:o,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=ni(e,"time",t)),{time:s,pos:a}=e[r],{time:o,pos:l}=e[i]);const c=o-s;return c?a+(l-a)*(t-s)/c:a}class cm extends nc{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=ul(n,this.min),this._tableRange=ul(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],s=[];let o,a,l,c,u;for(o=0,a=t.length;o<a;++o)c=t[o],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(o=0,a=i.length;o<a;++o)u=i[o+1],l=i[o-1],c=i[o],Math.round((u+l)/2)!==c&&s.push({time:c,pos:o/(a-1)});return s}_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((i,s)=>i-s)}_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(ul(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return ul(this._table,r*this._tableRange+this._minPos,!0)}}ge(cm,"id","timeseries"),ge(cm,"defaults",nc.defaults);const Fv="label";function um(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function KM(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Nv(e,t){e.labels=t}function Bv(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Fv;const r=[];e.datasets=t.map(i=>{const s=e.datasets.find(o=>o[n]===i[n]);return!s||!i.data||r.includes(s)?{...i}:(r.push(s),Object.assign(s,i),s)})}function WM(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fv;const n={labels:[],datasets:[]};return Nv(n,e.labels),Bv(n,e.datasets,t),n}function VM(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:s,type:o,data:a,options:l,plugins:c=[],fallbackContent:u,updateMode:d,...f}=e,h=W.useRef(null),g=W.useRef(null),m=()=>{h.current&&(g.current=new Dc(h.current,{type:o,data:WM(a,s),options:l&&{...l},plugins:c}),um(t,g.current))},p=()=>{um(t,null),g.current&&(g.current.destroy(),g.current=null)};return W.useEffect(()=>{!i&&g.current&&l&&KM(g.current,l)},[i,l]),W.useEffect(()=>{!i&&g.current&&Nv(g.current.config.data,a.labels)},[i,a.labels]),W.useEffect(()=>{!i&&g.current&&a.datasets&&Bv(g.current.config.data,a.datasets,s)},[i,a.datasets]),W.useEffect(()=>{g.current&&(i?(p(),setTimeout(m)):g.current.update(d))},[i,l,a.labels,a.datasets,d]),W.useEffect(()=>{g.current&&(p(),setTimeout(m))},[o]),W.useEffect(()=>(m(),()=>p()),[]),W.createElement("canvas",{ref:h,role:"img",height:n,width:r,...f},u)}const GM=W.forwardRef(VM);function qv(e,t){return Dc.register(t),W.forwardRef((n,r)=>W.createElement(GM,{...n,ref:r,type:e}))}const QM=qv("line",El),YM=qv("radar",Ol);Dc.register(Ld,Rd,bo,Mr,Pl,lM,mM,_M,gM);var Nd={elements:{line:{backgroundColor:"rgba(166, 30, 105, 0.2)",borderColor:"rgba(166, 30, 105, 1)",borderWidth:4},point:{backgroundColor:"rgba(166, 30, 105, 1)",borderColor:"rgba(255,255,255, .9)",borderWidth:2,radius:5,hoverRadius:6,hoverBorderWidth:3}},responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{mode:"index",intersect:!1}},interaction:{mode:"nearest",axis:"x",intersect:!1}},XM=function(t){var n=t.chart.ctx,r=t.chart.chartArea;if(!r)return"rgba(166, 30, 105, 0.2)";var i=n.createLinearGradient(0,r.top,0,r.bottom);return i.addColorStop(0,"rgba(166, 30, 105, 0.6)"),i.addColorStop(1,"rgba(255, 255, 255, 0.1)"),i},JM=function(t){var n=t.chart.ctx,r=t.chart.chartArea;if(!r)return"rgba(166, 30, 105, 0.1)";var i=(r.left+r.right)/2,s=(r.top+r.bottom)/2,o=Math.min((r.right-r.left)/2,(r.bottom-r.top)/2),a=n.createRadialGradient(i,s,0,i,s,o);return a.addColorStop(0,"rgba(255, 255, 255, 0.4)"),a.addColorStop(.3,"rgba(255, 255, 255, 0.4)"),a.addColorStop(1,"rgba(166, 30, 105, 0.2)"),a};function Zo(e){"@babel/helpers - typeof";return Zo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zo(e)}function ZM(e){return r$(e)||n$(e)||t$(e)||e$()}function e$(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
70
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function t$(e,t){if(e){if(typeof e=="string")return Bd(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Bd(e,t):void 0}}function n$(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function r$(e){if(Array.isArray(e))return Bd(e)}function Bd(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function dm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function dl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dm(Object(n),!0).forEach(function(r){i$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function i$(e,t,n){return(t=s$(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s$(e){var t=o$(e,"string");return Zo(t)=="symbol"?t:t+""}function o$(e,t){if(Zo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Zo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var a$=function(){var t,n,r=zt(),i=r.brandId,s=r.analysisId,o=zn(i,s,{query:{select:function(m){var p=m.data;return p},enabled:!!i}}),a=o.data,l=o.isLoading,c=o.isRefetching,u=a==null||(t=a.data)===null||t===void 0||(t=t.mentions)===null||t===void 0?void 0:t.progress,d=u==null?void 0:u.scoreDelta,f=u==null?void 0:u.chart,h=dl(dl({},Nd),{},{responsive:!0,maintainAspectRatio:!1,scales:{x:{display:!0,title:{display:!1,text:"Date"},grid:{display:!1}},y:{display:!0,title:{display:!1,text:"Number of Mentions"},beginAtZero:!0,max:Array.isArray(f==null||(n=f.datasets)===null||n===void 0||(n=n[0])===null||n===void 0?void 0:n.data)?Math.max.apply(Math,ZM(f.datasets[0].data).concat([0]))+2:2,ticks:{stepSize:1}}}});return y.jsx(O.Card,{className:"yst-overflow-visible",children:y.jsxs(O.Card.Content,{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(Ns,{title:"Mentions progress",tooltip:"Tracks how your brand mentions have changed over time across the same query set."}),y.jsx(Ea,{score:(u==null?void 0:u.queries)||"โ€”",total:(u==null?void 0:u.queriesTotal)||"โ€”",delta:d,deltaSuffix:"since last scan",suffix:"queries",isLoading:l||c})]}),!(f!=null&&f.datasets)&&y.jsx(O.Alert,{variant:"info",children:"Needs multiple analyses before info can be shown"}),y.jsx("div",{className:"yst-h-72",children:y.jsx(QM,{data:{labels:(f==null?void 0:f.labels)||[],datasets:((f==null?void 0:f.datasets)||[]).map(function(g){return dl(dl({},g),{},{backgroundColor:XM,pointBackgroundColor:"rgba(166, 30, 105, 1)"})})},options:h})})]})})},fm=function(t){var n=t.data,r=t.isLoading,i=r===void 0?!1:r,s=t.index,o=i||!n,a=n||{},l=a.label;return y.jsx("div",{className:Se("yst-flex yst-flex-col yst-items-start yst-gap-2",{"yst-border-t yst-border-slate-200 yst-pt-4":s>0}),children:o?y.jsxs(y.Fragment,{children:[y.jsx(O.SkeletonLoader,{className:"yst-h-4 yst-w-3/4"}),y.jsx(O.SkeletonLoader,{className:"yst-h-8 yst-w-24"})]}):y.jsx(y.Fragment,{children:y.jsx("p",{children:l})})},s)},l$=function(){var t,n=zt(),r=n.brandId,i=zn(r,"latest",{query:{select:function(u){var d=u.data;return d},enabled:!!r}}),s=i.data,o=i.isLoading,a=i.isRefetching,l=o||a||!r;return y.jsx(O.Card,{className:"yst-overflow-visible",children:y.jsxs(O.Card.Content,{className:"yst-space-y-6",children:[y.jsx(Ns,{title:"Recommendations",tooltip:"Suggested next steps to improve your brand's visibility, tone, or content performance."}),y.jsx("div",{className:"yst-space-y-4",children:s!=null&&(t=s.data)!==null&&t!==void 0&&(t=t.recommendations)!==null&&t!==void 0&&t.list&&s.data.recommendations.list.length>0?s.data.recommendations.list.map(function(c,u){return y.jsx(fm,{data:c,index:u},u)}):l?Array.from({length:3}).map(function(c,u){return y.jsx(fm,{isLoading:!0,index:u},"skeleton-".concat(u))}):y.jsx("p",{className:"yst-py-4 yst-text-center yst-text-slate-500",children:"No recommendations available."})})]})})};function fl(e){var t=e.value,n=t===void 0?"โ€”":t,r=e.label,i=e.tooltip,s=e.className,o=e.borderBottom,a=o===void 0?!1:o,l=e.borderRight,c=l===void 0?!1:l,u=e.delta;return y.jsxs("div",{className:Se("yst-relative yst-flex yst-flex-col yst-items-center yst-gap-1 yst-p-4 yst-text-center",a&&"yst-border-b yst-border-slate-200",c&&"yst-border-r yst-border-slate-200",s),children:[y.jsx("p",{className:"yst-text-2xl yst-font-bold yst-text-slate-900",children:n}),y.jsx("p",{className:"yst-text-tiny yst-text-slate-600",children:r}),typeof u=="number"&&y.jsxs("p",{className:Se("yst-flex yst-items-center yst-gap-1 yst-text-tiny yst-font-bold",Kl(u)),children:[u>0?y.jsx(pO,{}):u<0?y.jsx(hO,{}):null,u>-1&&"+",u]}),i&&y.jsx(Oc,{id:"tooltip-".concat(r.replace(/\s+/g,"-").toLowerCase()),className:"yst-absolute yst-right-2 yst-top-2",children:i})]})}function c$(e){var t=e.children,n=e.className;return y.jsx("div",{className:Se("yst-grid yst-w-full yst-grid-cols-2 yst-gap-0 yst-rounded-lg",n),children:t})}function ea(e){"@babel/helpers - typeof";return ea=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ea(e)}function hm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hm(Object(n),!0).forEach(function(r){u$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function u$(e,t,n){return(t=d$(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d$(e){var t=f$(e,"string");return ea(t)=="symbol"?t:t+""}function f$(e,t){if(ea(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ea(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function h$(){var e,t,n,r,i,s,o,a,l,c,u,d,f,h,g,m,p,b=zt(),v=b.brandId,S=b.analysisId,w=zn(v,S,{query:{select:function(de){var R=de.data;return R==null?void 0:R.data},enabled:!!v}}),x=w.data,_=w.isLoading,C=x,A=C==null||(e=C.currentScore)===null||e===void 0||(e=e.raw)===null||e===void 0?void 0:e.mentions,k=C==null||(t=C.currentScore)===null||t===void 0||(t=t.raw)===null||t===void 0?void 0:t.citations,P=C==null||(n=C.currentScore)===null||n===void 0||(n=n.raw)===null||n===void 0?void 0:n.ranking,$=(r=C==null||(i=C.currentScore)===null||i===void 0||(i=i.standardized)===null||i===void 0?void 0:i.mentions)!==null&&r!==void 0?r:0,j=(s=C==null||(o=C.currentScore)===null||o===void 0||(o=o.standardized)===null||o===void 0?void 0:o.ranking)!==null&&s!==void 0?s:0,Z=(a=C==null||(l=C.currentScore)===null||l===void 0||(l=l.standardized)===null||l===void 0?void 0:l.citations)!==null&&a!==void 0?a:0,q=(c=C==null||(u=C.currentScore)===null||u===void 0||(u=u.standardized)===null||u===void 0?void 0:u.sentiment)!==null&&c!==void 0?c:0,N=(d=C==null||(f=C.currentScore)===null||f===void 0||(f=f.standardized)===null||f===void 0?void 0:f.visibility)!==null&&d!==void 0?d:0,L={labels:["Mentions","Ranking","Citations","Sentiment"],datasets:[{data:[$,j,Z,q],backgroundColor:JM,pointBackgroundColor:"rgba(166, 30, 105, 1)"}]},F=hl(hl({},Nd),{},{plugins:hl(hl({},Nd.plugins),{},{tooltip:{mode:"point",intersect:!0,callbacks:{label:function(de){var R=de.label||"",K=de.parsed.r||0;return"".concat(R,": ").concat(K,"%")}}}}),interaction:{mode:"point",intersect:!0},scales:{r:{beginAtZero:!0,min:0,max:100,ticks:{stepSize:20}}}});return y.jsx(O.Card,{className:"yst-overflow-visible md:yst-col-span-2",children:y.jsxs(O.Card.Content,{children:[y.jsx(O.Title,{size:"3",className:"yst-mb-2",children:"AI visibility score"}),y.jsx(Ea,{score:N,total:100,isLoading:_}),y.jsxs("div",{className:"yst-flex yst-flex-col yst-items-center yst-justify-around yst-justify-items-center yst-gap-8 md:yst-flex-row",children:[y.jsxs("div",{className:"yst-radar-chart-container yst-relative yst-aspect-square yst-h-full yst-w-full md:yst-flex md:yst-w-1/2 md:yst-items-center md:yst-justify-center",children:[y.jsx(YM,{data:L,options:F}),y.jsx(Oc,{id:"tooltip-radar-chart",className:"yst-absolute yst-right-2 yst-top-2",placement:"left",children:"An overall score based on mentions, sentiment, citations, and competitor activity in your submitted queries."})]}),y.jsx("div",{className:"yst-mt-6 yst-w-full md:yst-mt-0 md:yst-flex md:yst-w-1/2 md:yst-items-center",children:y.jsxs(c$,{children:[y.jsx(fl,{value:A,label:"Mentions",tooltip:"The number of times a brand is mentioned in responses from the LLM. Each brand can be counted only once per question (0 or 1), and mentions across multiple questions are summed for the total.",borderBottom:!0,borderRight:!0,delta:C==null||(h=C.currentScore)===null||h===void 0||(h=h.delta)===null||h===void 0?void 0:h.mentions}),y.jsx(fl,{value:P&&y.jsxs(y.Fragment,{children:[P,P===1&&" ๐Ÿ†"]}),label:"Competitor ranking",tooltip:"",borderBottom:!0,delta:C==null||(g=C.currentScore)===null||g===void 0||(g=g.delta)===null||g===void 0?void 0:g.ranking}),y.jsx(fl,{value:k,label:"Citations",tooltip:"The URLs (sources) extracted from the LLM's response to a question. Each question can return zero, one, or multiple citations.",borderRight:!0,delta:C==null||(m=C.currentScore)===null||m===void 0||(m=m.delta)===null||m===void 0?void 0:m.citations}),y.jsx(fl,{value:q?"".concat(q,"%"):"โ€”%",label:"Positive sentiment",tooltip:"The percentage of your brand mentions including positive keywords based on sentiment analysis.",delta:C==null||(p=C.currentScore)===null||p===void 0||(p=p.delta)===null||p===void 0?void 0:p.sentiment})]})})]})]})})}var Tu=function(){var t=zt(),n=t.brandId,r=null,i=kc({query:{select:function(l){var c,u=l.data;return u==null||(c=u.data)===null||c===void 0?void 0:c.brands}}}),s=i.data,o=i.isLoading;return o||s&&(s==null?void 0:s.length)>0?y.jsxs("div",{className:"yst-space-y-8",children:[y.jsx(g5,{}),y.jsxs("div",{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between",children:[y.jsx(O.Title,{size:"2",children:"Your brand analysis"}),y.jsxs(O.Button,{as:Hr,variant:"secondary",to:"/brand-list",className:Se("yst-gap-1.5"),disabled:!n,children:[y.jsx(Sd,{})," Edit brand list"," ",r]})]}),y.jsxs("div",{className:"yst-grid yst-grid-cols-1 yst-gap-4 md:yst-grid-cols-2",children:[y.jsx(h$,{}),y.jsx(y5,{}),y.jsx(a$,{}),y.jsx(a3,{}),y.jsx(t3,{}),y.jsx(KO,{}),y.jsx(l3,{}),y.jsx(l$,{})]})]})]}):y.jsx(Lb,{})};function zv(e){var t=e.children,n=e.description,r=e.title;return y.jsxs(O.Card.Header,{className:"yst-h-auto yst-flex-col yst-items-start yst-gap-0 yst-border-b-[1px] yst-border-b-slate-200 yst-bg-white yst-py-8",children:[r&&y.jsx(O.Title,{className:Se({"yst-mb-3":n||t}),children:r}),n&&y.jsx("p",{children:n}),t]})}var g$=function(){return y.jsx(O.Card,{className:"yst-mb-4",children:y.jsxs(O.Card.Content,{className:"yst-flex yst-flex-col yst-gap-8",children:[y.jsx(O.Title,{size:"2",children:"Query - Best fish restaurant in Nijmegen"}),y.jsxs("div",{children:[y.jsx("p",{children:"AI Response:"}),y.jsx(O.Link,{href:"#todo",children:"Show more"})]}),y.jsxs("div",{children:[y.jsx("p",{children:"Extracted brands:"}),y.jsx(O.Badge,{children:"Example"}),y.jsx(O.Badge,{children:"Example"}),y.jsx(O.Badge,{children:"Example"}),y.jsx(O.Badge,{children:"Example"}),y.jsx(O.Badge,{children:"Example"})]}),y.jsxs(O.Table,{children:[y.jsx(O.Table.Head,{children:y.jsxs(O.Table.Row,{children:[y.jsx(O.Table.Header,{children:"URL"}),y.jsx(O.Table.Header,{children:"Associated brand"})]})}),y.jsxs(O.Table.Body,{children:[y.jsxs(O.Table.Row,{children:[y.jsx(O.Table.Cell,{children:y.jsx(O.Link,{href:"https://example.com",target:"_blank",children:"https://example.com"})}),y.jsx(O.Table.Cell,{children:"Example Brand"})]}),y.jsxs(O.Table.Row,{children:[y.jsx(O.Table.Cell,{children:y.jsx(O.Link,{href:"https://example2.com",target:"_blank",children:"https://example2.com"})}),y.jsx(O.Table.Cell,{children:"Example Brand 2"})]})]})]})]})})},y$=function(){return y.jsxs(O.Card,{children:[y.jsx(zv,{title:"Query history"}),y.jsx(O.Card,{className:"yst-mb-4",children:y.jsxs(O.Card.Content,{children:[y.jsxs("p",{className:"yst-mb-8",children:["Manna Fish Restaurant - Analysis performed on:"," ",y.jsx(O.Badge,{children:"2025-04-08 12:31:21"})]}),[0,1,2,3,4].map(function(t){return y.jsx(g$,{},t)})]})})]})},m$=W.lazy(function(){return Promise.resolve().then(()=>oR)}),p$=W.lazy(function(){return Promise.resolve().then(()=>CR)}),b$=W.lazy(function(){return Promise.resolve().then(()=>kR)}),v$=W.lazy(function(){return Promise.resolve().then(()=>BR)}),x$=W.lazy(function(){return Promise.resolve().then(()=>t9)}),w$=W.lazy(function(){return Promise.resolve().then(()=>l9)}),S$=new C2({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,staleTime:1e3*60*5},mutations:{retry:!1}}}),mr=function(){return y.jsx("div",{className:"yst-flex yst-min-h-[200px] yst-items-center yst-justify-center",children:y.jsxs("div",{className:"yst-w-full yst-max-w-md yst-space-y-3",children:[y.jsx(O.SkeletonLoader,{className:"yst-h-8 yst-w-3/4"}),y.jsx(O.SkeletonLoader,{className:"yst-h-6 yst-w-full"}),y.jsx(O.SkeletonLoader,{className:"yst-h-6 yst-w-2/3"})]})})},C$=function(t){var n=t.hideNav,r=n===void 0?!1:n,i=t.disableLayout,s=i===void 0?!1:i;return y.jsx(Ow,{children:y.jsx(Ot,{element:y.jsx(CE,{}),children:y.jsxs(Ot,{element:y.jsx(cO,{hideNav:r,disableLayout:s}),children:[y.jsxs(Ot,{path:"/",element:y.jsx(dc,{}),children:[y.jsx(Ot,{index:!0,element:y.jsx(Tu,{})}),y.jsx(Ot,{path:"brands/:brandId",element:y.jsx(Tu,{})}),y.jsx(Ot,{path:"brands/:brandId/analysis/:anaylsisId",element:y.jsx(Tu,{})}),y.jsx(Ot,{path:"/brand-list",element:y.jsx(W.Suspense,{fallback:y.jsx(mr,{}),children:y.jsx(m$,{})})}),y.jsxs(Ot,{path:"/setup",element:y.jsx(W.Suspense,{fallback:y.jsx(mr,{}),children:y.jsx(b$,{})}),children:[y.jsx(Ot,{index:!0,element:y.jsx(W.Suspense,{fallback:y.jsx(mr,{}),children:y.jsx(v$,{})})}),y.jsx(Ot,{path:"queries",element:y.jsx(W.Suspense,{fallback:y.jsx(mr,{}),children:y.jsx(x$,{})})})]}),y.jsx(Ot,{path:"/setup/analysis",element:y.jsx(W.Suspense,{fallback:y.jsx(mr,{}),children:y.jsx(w$,{})})}),y.jsx(Ot,{path:"/setup/welcome",element:y.jsx(W.Suspense,{fallback:y.jsx(mr,{}),children:y.jsx(Lb,{})})})]}),y.jsx(Ot,{path:"/settings",element:y.jsx(W.Suspense,{fallback:y.jsx(mr,{}),children:y.jsx(p$,{})})}),y.jsx(Ot,{path:"/query-history",element:y.jsx(W.Suspense,{fallback:y.jsx(mr,{}),children:y.jsx(y$,{})})})]})})})},_$=function(){return dO(),y.jsxs(A2,{client:S$,children:[y.jsx(nE,{children:y.jsx(C$,{})}),y.jsx(yC,{initialIsOpen:!1})]})},k$=function(t){var n=t.routerType,r=n===void 0?"memory":n,i=t.initialRoute,s=i===void 0?"/":i,o=t.isRtl,a=o===void 0?!1:o,l=t.className,c=t.style,u=t.token,d=u===void 0?"":u;hE(d);var f=W.useMemo(function(){switch(r){case"browser":return Xw;case"hash":return Jw;case"memory":default:return Ew}},[r]),h=r==="memory"?{initialEntries:[s]}:{};return y.jsx("div",{className:l,style:c,children:y.jsx(f,{...h,children:y.jsx(O.Root,{context:{isRtl:a},children:y.jsx(_$,{})})})})},E$=e=>e!=null,O$=e=>e.filter(E$);function A$(e){return(...t)=>{for(const n of e)n&&n(...t)}}var U=e=>typeof e=="function"&&!e.length?e():e,qd=e=>Array.isArray(e)?e:e?[e]:[];function T$(e,...t){return typeof e=="function"?e(...t):e}var P$=be;function M$(e,t,n,r){const i=e.length,s=t.length;let o=0;if(!s){for(;o<i;o++)n(e[o]);return}if(!i){for(;o<s;o++)r(t[o]);return}for(;o<s&&t[o]===e[o];o++);let a,l;t=t.slice(o),e=e.slice(o);for(a of t)e.includes(a)||r(a);for(l of e)t.includes(l)||n(l)}function $$(e){const[t,n]=ee(),r=e!=null&&e.throw?(f,h)=>{throw n(f instanceof Error?f:new Error(h)),f}:(f,h)=>{n(f instanceof Error?f:new Error(h))},i=e!=null&&e.api?Array.isArray(e.api)?e.api:[e.api]:[globalThis.localStorage].filter(Boolean),s=e!=null&&e.prefix?`${e.prefix}.`:"",o=new Map,a=new Proxy({},{get(f,h){let g=o.get(h);g||(g=ee(void 0,{equals:!1}),o.set(h,g)),g[0]();const m=i.reduce((p,b)=>{if(p!==null||!b)return p;try{return b.getItem(`${s}${h}`)}catch(v){return r(v,`Error reading ${s}${h} from ${b.name}`),null}},null);return m!==null&&(e!=null&&e.deserializer)?e.deserializer(m,h,e.options):m}}),l=(f,h,g)=>{const m=e!=null&&e.serializer?e.serializer(h,f,g!=null?g:e.options):h,p=`${s}${f}`;i.forEach(v=>{try{v.getItem(p)!==m&&v.setItem(p,m)}catch(S){r(S,`Error setting ${s}${f} to ${m} in ${v.name}`)}});const b=o.get(f);b&&b[1]()},c=f=>i.forEach(h=>{try{h.removeItem(`${s}${f}`)}catch(g){r(g,`Error removing ${s}${f} from ${h.name}`)}}),u=()=>i.forEach(f=>{try{f.clear()}catch(h){r(h,`Error clearing ${f.name}`)}}),d=()=>{const f={},h=(g,m)=>{if(!f.hasOwnProperty(g)){const p=m&&(e!=null&&e.deserializer)?e.deserializer(m,g,e.options):m;p&&(f[g]=p)}};return i.forEach(g=>{if(typeof g.getAll=="function"){let m;try{m=g.getAll()}catch(p){r(p,`Error getting all values from in ${g.name}`)}for(const p of m)h(p,m[p])}else{let m=0,p;try{for(;p=g.key(m++);)f.hasOwnProperty(p)||h(p,g.getItem(p))}catch(b){r(b,`Error getting all values from ${g.name}`)}}}),f};return(e==null?void 0:e.sync)!==!1&&cr(()=>{const f=h=>{var m;let g=!1;i.forEach(p=>{try{p!==h.storageArea&&h.key&&h.newValue!==p.getItem(h.key)&&(h.newValue?p.setItem(h.key,h.newValue):p.removeItem(h.key),g=!0)}catch(b){r(b,`Error synching api ${p.name} from storage event (${h.key}=${h.newValue})`)}}),g&&h.key&&((m=o.get(h.key))==null||m[1]())};"addEventListener"in globalThis?(globalThis.addEventListener("storage",f),be(()=>globalThis.removeEventListener("storage",f))):(i.forEach(h=>{var g;return(g=h.addEventListener)==null?void 0:g.call(h,"storage",f)}),be(()=>i.forEach(h=>{var g;return(g=h.removeEventListener)==null?void 0:g.call(h,"storage",f)})))}),[a,l,{clear:u,error:t,remove:c,toJSON:d}]}var Hv=$$,j$=e=>(typeof e.clear=="function"||(e.clear=()=>{let t;for(;t=e.key(0);)e.removeItem(t)}),e),gm=e=>{if(!e)return"";let t="";for(const n in e){if(!e.hasOwnProperty(n))continue;const r=e[n];t+=r instanceof Date?`; ${n}=${r.toUTCString()}`:typeof r=="boolean"?`; ${n}`:`; ${n}=${r}`}return t},en=j$({_cookies:[globalThis.document,"cookie"],getItem:e=>{var t,n;return(n=(t=en._cookies[0][en._cookies[1]].match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)"))==null?void 0:t.pop())!=null?n:null},setItem:(e,t,n)=>{const r=en.getItem(e);en._cookies[0][en._cookies[1]]=`${e}=${t}${gm(n)}`;const i=Object.assign(new Event("storage"),{key:e,oldValue:r,newValue:t,url:globalThis.document.URL,storageArea:en});window.dispatchEvent(i)},removeItem:e=>{en._cookies[0][en._cookies[1]]=`${e}=deleted${gm({expires:new Date(0)})}`},key:e=>{let t=null,n=0;return en._cookies[0][en._cookies[1]].replace(/(?:^|;)\s*(.+?)\s*=\s*[^;]+/g,(r,i)=>(!t&&i&&n++===e&&(t=i),"")),t},get length(){let e=0;return en._cookies[0][en._cookies[1]].replace(/(?:^|;)\s*.+?\s*=\s*[^;]+/g,t=>(e+=t?1:0,"")),e}}),D$=1024,Ci=796,If=700,L$="bottom-right",zd="bottom",Uv="system",I$=!1,Kv=500,R$=500,Wv=500,F$=Object.keys(ld)[0],ym=1,N$=Object.keys(cd)[0],Rf=pt({client:void 0,onlineManager:void 0,queryFlavor:"",version:"",shadowDOMTarget:void 0});function he(){return bt(Rf)}var Vv=pt(void 0),Gv=e=>{const[t,n]=ee(null),r=()=>{const o=t();o!=null&&(o.close(),n(null))},i=(o,a)=>{if(t()!=null)return;const l=window.open("","TSQD-Devtools-Panel",`width=${o},height=${a},popup`);if(!l)throw new Error("Failed to open popup. Please allow popups for this site to view the devtools in picture-in-picture mode.");l.document.head.innerHTML="",l.document.body.innerHTML="",pS(l.document),l.document.title="TanStack Query Devtools",l.document.body.style.margin="0",l.addEventListener("pagehide",()=>{e.setLocalStore("pip_open","false"),n(null)}),[...(he().shadowDOMTarget||document).styleSheets].forEach(c=>{try{const u=[...c.cssRules].map(g=>g.cssText).join(""),d=document.createElement("style"),f=c.ownerNode;let h="";f&&"id"in f&&(h=f.id),h&&d.setAttribute("id",h),d.textContent=u,l.document.head.appendChild(d)}catch(u){const d=document.createElement("link");if(c.href==null)return;d.rel="stylesheet",d.type=c.type,d.media=c.media.toString(),d.href=c.href,l.document.head.appendChild(d)}}),mc(["focusin","focusout","pointermove","keydown","pointerdown","pointerup","click","mousedown","input"],l.document),e.setLocalStore("pip_open","true"),n(l)};pe(()=>{var a;((a=e.localStore.pip_open)!=null?a:"false")==="true"&&!e.disabled&&i(Number(window.innerWidth),Number(e.localStore.height||R$))}),pe(()=>{const o=(he().shadowDOMTarget||document).querySelector("#_goober"),a=t();if(o&&a){const l=new MutationObserver(()=>{const c=(he().shadowDOMTarget||a.document).querySelector("#_goober");c&&(c.textContent=o.textContent)});l.observe(o,{childList:!0,subtree:!0,characterDataOldValue:!0}),be(()=>{l.disconnect()})}});const s=B(()=>{var o;return{pipWindow:t(),requestPipWindow:i,closePipWindow:r,disabled:(o=e.disabled)!=null?o:!1}});return M(Vv.Provider,{value:s,get children(){return e.children}})},Ff=()=>B(()=>{const t=bt(Vv);if(!t)throw new Error("usePiPWindow must be used within a PiPProvider");return t()}),Nf=pt(()=>"dark");function yt(){return bt(Nf)}var Qv={ร€:"A",ร:"A",ร‚:"A",รƒ:"A",ร„:"A",ร…:"A",แบค:"A",แบฎ:"A",แบฒ:"A",แบด:"A",แบถ:"A",ร†:"AE",แบฆ:"A",แบฐ:"A",ศ‚:"A",ร‡:"C",แธˆ:"C",รˆ:"E",ร‰:"E",รŠ:"E",ร‹:"E",แบพ:"E",แธ–:"E",แป€:"E",แธ”:"E",แธœ:"E",ศ†:"E",รŒ:"I",ร:"I",รŽ:"I",ร:"I",แธฎ:"I",ศŠ:"I",ร:"D",ร‘:"N",ร’:"O",ร“:"O",ร”:"O",ร•:"O",ร–:"O",ร˜:"O",แป:"O",แนŒ:"O",แน’:"O",ศŽ:"O",ร™:"U",รš:"U",ร›:"U",รœ:"U",ร:"Y",ร :"a",รก:"a",รข:"a",รฃ:"a",รค:"a",รฅ:"a",แบฅ:"a",แบฏ:"a",แบณ:"a",แบต:"a",แบท:"a",รฆ:"ae",แบง:"a",แบฑ:"a",ศƒ:"a",รง:"c",แธ‰:"c",รจ:"e",รฉ:"e",รช:"e",รซ:"e",แบฟ:"e",แธ—:"e",แป:"e",แธ•:"e",แธ:"e",ศ‡:"e",รฌ:"i",รญ:"i",รฎ:"i",รฏ:"i",แธฏ:"i",ศ‹:"i",รฐ:"d",รฑ:"n",รฒ:"o",รณ:"o",รด:"o",รต:"o",รถ:"o",รธ:"o",แป‘:"o",แน:"o",แน“:"o",ศ:"o",รน:"u",รบ:"u",รป:"u",รผ:"u",รฝ:"y",รฟ:"y",ฤ€:"A",ฤ:"a",ฤ‚:"A",ฤƒ:"a",ฤ„:"A",ฤ…:"a",ฤ†:"C",ฤ‡:"c",ฤˆ:"C",ฤ‰:"c",ฤŠ:"C",ฤ‹:"c",ฤŒ:"C",ฤ:"c",Cฬ†:"C",cฬ†:"c",ฤŽ:"D",ฤ:"d",ฤ:"D",ฤ‘:"d",ฤ’:"E",ฤ“:"e",ฤ”:"E",ฤ•:"e",ฤ–:"E",ฤ—:"e",ฤ˜:"E",ฤ™:"e",ฤš:"E",ฤ›:"e",ฤœ:"G",วด:"G",ฤ:"g",วต:"g",ฤž:"G",ฤŸ:"g",ฤ :"G",ฤก:"g",ฤข:"G",ฤฃ:"g",ฤค:"H",ฤฅ:"h",ฤฆ:"H",ฤง:"h",แธช:"H",แธซ:"h",ฤจ:"I",ฤฉ:"i",ฤช:"I",ฤซ:"i",ฤฌ:"I",ฤญ:"i",ฤฎ:"I",ฤฏ:"i",ฤฐ:"I",ฤฑ:"i",ฤฒ:"IJ",ฤณ:"ij",ฤด:"J",ฤต:"j",ฤถ:"K",ฤท:"k",แธฐ:"K",แธฑ:"k",Kฬ†:"K",kฬ†:"k",ฤน:"L",ฤบ:"l",ฤป:"L",ฤผ:"l",ฤฝ:"L",ฤพ:"l",ฤฟ:"L",ล€:"l",ล:"l",ล‚:"l",แธพ:"M",แธฟ:"m",Mฬ†:"M",mฬ†:"m",ลƒ:"N",ล„:"n",ล…:"N",ล†:"n",ล‡:"N",ลˆ:"n",ล‰:"n",Nฬ†:"N",nฬ†:"n",ลŒ:"O",ล:"o",ลŽ:"O",ล:"o",ล:"O",ล‘:"o",ล’:"OE",ล“:"oe",Pฬ†:"P",pฬ†:"p",ล”:"R",ล•:"r",ล–:"R",ล—:"r",ล˜:"R",ล™:"r",Rฬ†:"R",rฬ†:"r",ศ’:"R",ศ“:"r",ลš:"S",ล›:"s",ลœ:"S",ล:"s",ลž:"S",ศ˜:"S",ศ™:"s",ลŸ:"s",ล :"S",ลก:"s",ลข:"T",ลฃ:"t",ศ›:"t",ศš:"T",ลค:"T",ลฅ:"t",ลฆ:"T",ลง:"t",Tฬ†:"T",tฬ†:"t",ลจ:"U",ลฉ:"u",ลช:"U",ลซ:"u",ลฌ:"U",ลญ:"u",ลฎ:"U",ลฏ:"u",ลฐ:"U",ลฑ:"u",ลฒ:"U",ลณ:"u",ศ–:"U",ศ—:"u",Vฬ†:"V",vฬ†:"v",ลด:"W",ลต:"w",แบ‚:"W",แบƒ:"w",Xฬ†:"X",xฬ†:"x",ลถ:"Y",ลท:"y",ลธ:"Y",Yฬ†:"Y",yฬ†:"y",ลน:"Z",ลบ:"z",ลป:"Z",ลผ:"z",ลฝ:"Z",ลพ:"z",ลฟ:"s",ฦ’:"f",ฦ :"O",ฦก:"o",ฦฏ:"U",ฦฐ:"u",ว:"A",วŽ:"a",ว:"I",ว:"i",ว‘:"O",ว’:"o",ว“:"U",ว”:"u",ว•:"U",ว–:"u",ว—:"U",ว˜:"u",ว™:"U",วš:"u",ว›:"U",วœ:"u",แปจ:"U",แปฉ:"u",แนธ:"U",แนน:"u",วบ:"A",วป:"a",วผ:"AE",วฝ:"ae",วพ:"O",วฟ:"o",รž:"TH",รพ:"th",แน”:"P",แน•:"p",แนค:"S",แนฅ:"s",Xฬ:"X",xฬ:"x",ะƒ:"ะ“",ั“:"ะณ",ะŒ:"ะš",ัœ:"ะบ",Aฬ‹:"A",aฬ‹:"a",Eฬ‹:"E",eฬ‹:"e",Iฬ‹:"I",iฬ‹:"i",วธ:"N",วน:"n",แป’:"O",แป“:"o",แน:"O",แน‘:"o",แปช:"U",แปซ:"u",แบ€:"W",แบ:"w",แปฒ:"Y",แปณ:"y",ศ€:"A",ศ:"a",ศ„:"E",ศ…:"e",ศˆ:"I",ศ‰:"i",ศŒ:"O",ศ:"o",ศ:"R",ศ‘:"r",ศ”:"U",ศ•:"u",BฬŒ:"B",bฬŒ:"b",ฤŒฬฃ:"C",ฤฬฃ:"c",รŠฬŒ:"E",รชฬŒ:"e",FฬŒ:"F",fฬŒ:"f",วฆ:"G",วง:"g",ศž:"H",ศŸ:"h",JฬŒ:"J",วฐ:"j",วจ:"K",วฉ:"k",MฬŒ:"M",mฬŒ:"m",PฬŒ:"P",pฬŒ:"p",QฬŒ:"Q",qฬŒ:"q",ล˜ฬฉ:"R",ล™ฬฉ:"r",แนฆ:"S",แนง:"s",VฬŒ:"V",vฬŒ:"v",WฬŒ:"W",wฬŒ:"w",XฬŒ:"X",xฬŒ:"x",YฬŒ:"Y",yฬŒ:"y",Aฬง:"A",aฬง:"a",Bฬง:"B",bฬง:"b",แธ:"D",แธ‘:"d",ศจ:"E",ศฉ:"e",ฦฬง:"E",ษ›ฬง:"e",แธจ:"H",แธฉ:"h",Iฬง:"I",iฬง:"i",ฦ—ฬง:"I",ษจฬง:"i",Mฬง:"M",mฬง:"m",Oฬง:"O",oฬง:"o",Qฬง:"Q",qฬง:"q",Uฬง:"U",uฬง:"u",Xฬง:"X",xฬง:"x",Zฬง:"Z",zฬง:"z"},B$=Object.keys(Qv).join("|"),q$=new RegExp(B$,"g");function z$(e){return e.replace(q$,t=>Qv[t])}var Rt={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function mm(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:Rt.MATCHES,!n.accessors){const o=pm(e,t,n);return{rankedValue:e,rank:o,accessorIndex:-1,accessorThreshold:n.threshold,passed:o>=n.threshold}}const i=W$(e,n.accessors),s={rankedValue:e,rank:Rt.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let o=0;o<i.length;o++){const a=i[o];let l=pm(a.itemValue,t,n);const{minRanking:c,maxRanking:u,threshold:d=n.threshold}=a.attributes;l<c&&l>=Rt.MATCHES?l=c:l>u&&(l=u),l=Math.min(l,u),l>=d&&l>s.rank&&(s.rank=l,s.passed=!0,s.accessorIndex=o,s.accessorThreshold=d,s.rankedValue=a.itemValue)}return s}function pm(e,t,n){return e=bm(e,n),t=bm(t,n),t.length>e.length?Rt.NO_MATCH:e===t?Rt.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?Rt.EQUAL:e.startsWith(t)?Rt.STARTS_WITH:e.includes(` ${t}`)?Rt.WORD_STARTS_WITH:e.includes(t)?Rt.CONTAINS:t.length===1?Rt.NO_MATCH:H$(e).includes(t)?Rt.ACRONYM:U$(e,t))}function H$(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(s=>{t+=s.substr(0,1)})}),t}function U$(e,t){let n=0,r=0;function i(l,c,u){for(let d=u,f=c.length;d<f;d++)if(c[d]===l)return n+=1,d+1;return-1}function s(l){const c=1/l,u=n/t.length;return Rt.MATCHES+u*c}const o=i(t[0],e,0);if(o<0)return Rt.NO_MATCH;r=o;for(let l=1,c=t.length;l<c;l++){const u=t[l];if(r=i(u,e,r),!(r>-1))return Rt.NO_MATCH}const a=r-o;return s(a)}function bm(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=z$(e)),e}function K$(e,t){let n=t;typeof t=="object"&&(n=t.accessor);const r=n(e);return r==null?[]:Array.isArray(r)?r:[String(r)]}function W$(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const s=t[r],o=V$(s),a=K$(e,s);for(let l=0,c=a.length;l<c;l++)n.push({itemValue:a[l],attributes:o})}return n}var vm={maxRanking:1/0,minRanking:-1/0};function V$(e){return typeof e=="function"?vm:{...vm,...e}}var G$={data:""},Q$=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||G$,Y$=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,X$=/\/\*[^]*?\*\/| +/g,xm=/\n+/g,Zr=(e,t)=>{let n="",r="",i="";for(let s in e){let o=e[s];s[0]=="@"?s[1]=="i"?n=s+" "+o+";":r+=s[1]=="f"?Zr(o,s):s+"{"+Zr(o,s[1]=="k"?"":t)+"}":typeof o=="object"?r+=Zr(o,t?t.replace(/([^,])+/g,a=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,a):a?a+" "+l:l)):s):o!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=Zr.p?Zr.p(s,o):s+":"+o+";")}return n+(t&&i?t+"{"+i+"}":i)+r},Vn={},Yv=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+Yv(e[n]);return t}return e},J$=(e,t,n,r,i)=>{let s=Yv(e),o=Vn[s]||(Vn[s]=(l=>{let c=0,u=11;for(;c<l.length;)u=101*u+l.charCodeAt(c++)>>>0;return"go"+u})(s));if(!Vn[o]){let l=s!==e?e:(c=>{let u,d,f=[{}];for(;u=Y$.exec(c.replace(X$,""));)u[4]?f.shift():u[3]?(d=u[3].replace(xm," ").trim(),f.unshift(f[0][d]=f[0][d]||{})):f[0][u[1]]=u[2].replace(xm," ").trim();return f[0]})(e);Vn[o]=Zr(i?{["@keyframes "+o]:l}:l,n?"":"."+o)}let a=n&&Vn.g?Vn.g:null;return n&&(Vn.g=Vn[o]),((l,c,u,d)=>{d?c.data=c.data.replace(d,l):c.data.indexOf(l)===-1&&(c.data=u?l+c.data:c.data+l)})(Vn[o],t,r,a),o},Z$=(e,t,n)=>e.reduce((r,i,s)=>{let o=t[s];if(o&&o.call){let a=o(n),l=a&&a.props&&a.props.className||/^go/.test(a)&&a;o=l?"."+l:a&&typeof a=="object"?a.props?"":Zr(a,""):a===!1?"":a}return r+i+(o==null?"":o)},"");function Te(e){let t=this||{},n=e.call?e(t.p):e;return J$(n.unshift?n.raw?Z$(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,Q$(t.target),t.g,t.o,t.k)}Te.bind({g:1});Te.bind({k:1});function Xv(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Xv(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ne(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Xv(e))&&(r&&(r+=" "),r+=t);return r}function ej(e,t){const n=tt(e),{onChange:r}=t;let i=new Set(t.appear?void 0:n);const s=new WeakSet,[o,a]=ee([],{equals:!1}),[l]=G2(),c=d=>{a(f=>(f.push.apply(f,d),f));for(const f of d)s.delete(f)},u=(d,f,h)=>d.splice(h,0,f);return B(d=>{const f=o(),h=e();if(h[hc],tt(l))return l(),d;if(f.length){const g=d.filter(m=>!f.includes(m));return f.length=0,r({list:g,added:[],removed:[],unchanged:g,finishRemoved:c}),g}return tt(()=>{const g=new Set(h),m=h.slice(),p=[],b=[],v=[];for(const w of h)(i.has(w)?v:p).push(w);let S=!p.length;for(let w=0;w<d.length;w++){const x=d[w];g.has(x)||(s.has(x)||(b.push(x),s.add(x)),u(m,x,w)),S&&x!==m[w]&&(S=!1)}return!b.length&&S?d:(r({list:m,added:p,removed:b,unchanged:v,finishRemoved:c}),i=g,m)})},t.appear?[]:n.slice())}function $t(...e){return A$(e)}var wm=e=>e instanceof Element;function Hd(e,t){if(t(e))return e;if(typeof e=="function"&&!e.length)return Hd(e(),t);if(Array.isArray(e)){const n=[];for(const r of e){const i=Hd(r,t);i&&(Array.isArray(i)?n.push.apply(n,i):n.push(i))}return n.length?n:null}return null}function tj(e,t=wm,n=wm){const r=B(e),i=B(()=>Hd(r(),t));return i.toArray=()=>{const s=i();return Array.isArray(s)?s:s?[s]:[]},i}function nj(e){return B(()=>{const t=e.name||"s";return{enterActive:(e.enterActiveClass||t+"-enter-active").split(" "),enter:(e.enterClass||t+"-enter").split(" "),enterTo:(e.enterToClass||t+"-enter-to").split(" "),exitActive:(e.exitActiveClass||t+"-exit-active").split(" "),exit:(e.exitClass||t+"-exit").split(" "),exitTo:(e.exitToClass||t+"-exit-to").split(" "),move:(e.moveClass||t+"-move").split(" ")}})}function Jv(e){requestAnimationFrame(()=>requestAnimationFrame(e))}function rj(e,t,n,r){const{onBeforeEnter:i,onEnter:s,onAfterEnter:o}=t;i==null||i(n),n.classList.add(...e.enter),n.classList.add(...e.enterActive),queueMicrotask(()=>{if(!n.parentNode)return r==null?void 0:r();s==null||s(n,()=>a())}),Jv(()=>{n.classList.remove(...e.enter),n.classList.add(...e.enterTo),(!s||s.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))});function a(l){(!l||l.target===n)&&(n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.enterActive),n.classList.remove(...e.enterTo),o==null||o(n))}}function ij(e,t,n,r){const{onBeforeExit:i,onExit:s,onAfterExit:o}=t;if(!n.parentNode)return r==null?void 0:r();i==null||i(n),n.classList.add(...e.exit),n.classList.add(...e.exitActive),s==null||s(n,()=>a()),Jv(()=>{n.classList.remove(...e.exit),n.classList.add(...e.exitTo),(!s||s.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))});function a(l){(!l||l.target===n)&&(r==null||r(),n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.exitActive),n.classList.remove(...e.exitTo),o==null||o(n))}}var Sm=e=>{const t=nj(e);return ej(tj(()=>e.children).toArray,{appear:e.appear,onChange({added:n,removed:r,finishRemoved:i,list:s}){const o=t();for(const l of n)rj(o,e,l);const a=[];for(const l of s)l.isConnected&&(l instanceof HTMLElement||l instanceof SVGElement)&&a.push({el:l,rect:l.getBoundingClientRect()});queueMicrotask(()=>{const l=[];for(const{el:c,rect:u}of a)if(c.isConnected){const d=c.getBoundingClientRect(),f=u.left-d.left,h=u.top-d.top;(f||h)&&(c.style.transform=`translate(${f}px, ${h}px)`,c.style.transitionDuration="0s",l.push(c))}document.body.offsetHeight;for(const c of l){let u=function(d){(d.target===c||/transform$/.test(d.propertyName))&&(c.removeEventListener("transitionend",u),c.classList.remove(...o.move))};c.classList.add(...o.move),c.style.transform=c.style.transitionDuration="",c.addEventListener("transitionend",u)}});for(const l of r)ij(o,e,l,()=>i([l]))}})},Pu=Symbol("fallback");function Cm(e){for(const t of e)t.dispose()}function sj(e,t,n,r={}){const i=new Map;return be(()=>Cm(i.values())),()=>{const o=e()||[];return o[hc],tt(()=>{var u,d;if(!o.length)return Cm(i.values()),i.clear(),r.fallback?[sr(h=>(i.set(Pu,{dispose:h}),r.fallback()))]:[];const a=new Array(o.length),l=i.get(Pu);if(!i.size||l){l==null||l.dispose(),i.delete(Pu);for(let f=0;f<o.length;f++){const h=o[f],g=t(h,f);s(a,h,f,g)}return a}const c=new Set(i.keys());for(let f=0;f<o.length;f++){const h=o[f],g=t(h,f);c.delete(g);const m=i.get(g);m?(a[f]=m.mapped,(u=m.setIndex)==null||u.call(m,f),m.setItem(()=>h)):s(a,h,f,g)}for(const f of c)(d=i.get(f))==null||d.dispose(),i.delete(f);return a})};function s(o,a,l,c){sr(u=>{const[d,f]=ee(a),h={setItem:f,dispose:u};if(n.length>1){const[g,m]=ee(l);h.setIndex=m,h.mapped=n(d,g)}else h.mapped=n(d);i.set(c,h),o[l]=h.mapped})}}function rc(e){const{by:t}=e;return B(sj(()=>e.each,typeof t=="function"?t:n=>n[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function oj(e,t,n,r){return e.addEventListener(t,n,r),P$(e.removeEventListener.bind(e,t,n,r))}function aj(e,t,n,r){const i=()=>{qd(U(e)).forEach(s=>{s&&qd(U(t)).forEach(o=>oj(s,o,n,r))})};typeof e=="function"?pe(i):me(i)}function lj(e,t){const n=new ResizeObserver(e);return be(n.disconnect.bind(n)),{observe:r=>n.observe(r,t),unobserve:n.unobserve.bind(n)}}function Zv(e,t,n){const r=new WeakMap,{observe:i,unobserve:s}=lj(o=>{for(const a of o){const{contentRect:l,target:c}=a,u=Math.round(l.width),d=Math.round(l.height),f=r.get(c);(!f||f.width!==u||f.height!==d)&&(t(l,c,a),r.set(c,{width:u,height:d}))}},n);pe(o=>{const a=O$(qd(U(e)));return M$(a,o,i,s),a},[])}var cj=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function _m(e){const t={};let n;for(;n=cj.exec(e);)t[n[1]]=n[2];return t}function Rc(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=_m(e)}else typeof t=="string"&&(t=_m(t));return{...e,...t}}function uj(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function Ud(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function dj(e){return typeof e=="number"}function zi(e){return Object.prototype.toString.call(e)==="[object String]"}function fj(e){return typeof e=="function"}function Ta(e){return t=>`${e()}-${t}`}function ln(e,t){return e?e===t||e.contains(t):!1}function vo(e,t=!1){const{activeElement:n}=Fn(e);if(!(n!=null&&n.nodeName))return null;if(e1(n)&&n.contentDocument)return vo(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const i=Fn(n).getElementById(r);if(i)return i}}return n}function hj(e){return Fn(e).defaultView||window}function Fn(e){return e?e.ownerDocument||e:document}function e1(e){return e.tagName==="IFRAME"}var Bf=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(Bf||{});function qf(e){var t;return typeof window!="undefined"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)==null?void 0:t.platform)||window.navigator.platform):!1}function Fc(){return qf(/^Mac/i)}function gj(){return qf(/^iPhone/i)}function yj(){return qf(/^iPad/i)||Fc()&&navigator.maxTouchPoints>1}function mj(){return gj()||yj()}function pj(){return Fc()||mj()}function Xe(e,t){return t&&(fj(t)?t(e):t[0](t[1],e)),e==null?void 0:e.defaultPrevented}function ht(e){return t=>{for(const n of e)Xe(t,n)}}function bj(e){return Fc()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function St(e){if(e)if(vj())e.focus({preventScroll:!0});else{const t=xj(e);e.focus(),wj(t)}}var gl=null;function vj(){if(gl==null){gl=!1;try{document.createElement("div").focus({get preventScroll(){return gl=!0,!0}})}catch(e){}}return gl}function xj(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function wj(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var t1=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],Sj=[...t1,'[tabindex]:not([tabindex="-1"]):not([disabled])'],zf=t1.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",Cj=Sj.join(':not([hidden]):not([tabindex="-1"]),');function n1(e,t){const r=Array.from(e.querySelectorAll(zf)).filter(km);return t&&km(e)&&r.unshift(e),r.forEach((i,s)=>{if(e1(i)&&i.contentDocument){const o=i.contentDocument.body,a=n1(o,!1);r.splice(s,1,...a)}}),r}function km(e){return r1(e)&&!_j(e)}function r1(e){return e.matches(zf)&&Hf(e)}function _j(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}function Hf(e,t){return e.nodeName!=="#comment"&&kj(e)&&Ej(e,t)&&(!e.parentElement||Hf(e.parentElement,e))}function kj(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:i}=e.ownerDocument.defaultView,{display:s,visibility:o}=i(e);r=s!=="none"&&o!=="hidden"&&o!=="collapse"}return r}function Ej(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function Oj(e,t,n){const r=t!=null&&t.tabbable?Cj:zf,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(s){var o;return(o=t==null?void 0:t.from)!=null&&o.contains(s)?NodeFilter.FILTER_REJECT:s.matches(r)&&Hf(s)&&(!(t!=null&&t.accept)||t.accept(s))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t!=null&&t.from&&(i.currentNode=t.from),i}function Em(e){for(;e&&!Aj(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function Aj(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Tj(){}function Pj(e,t){const[n,r]=e;let i=!1;const s=t.length;for(let o=s,a=0,l=o-1;a<o;l=a++){const[c,u]=t[a],[d,f]=t[l],[,h]=t[l===0?o-1:l-1]||[0,0],g=(u-f)*(n-c)-(c-d)*(r-u);if(f<u){if(r>=f&&r<u){if(g===0)return!0;g>0&&(r===f?r>h&&(i=!i):i=!i)}}else if(u<f){if(r>u&&r<=f){if(g===0)return!0;g<0&&(r===f?r<h&&(i=!i):i=!i)}}else if(r==u&&(n>=d&&n<=c||n>=c&&n<=d))return!0}return i}function De(e,t){return _e(e,t)}var oo=new Map,Om=new Set;function Am(){if(typeof window=="undefined")return;const e=n=>{if(!n.target)return;let r=oo.get(n.target);r||(r=new Set,oo.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=oo.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),oo.delete(n.target)),oo.size===0)){for(const i of Om)i();Om.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document!="undefined"&&(document.readyState!=="loading"?Am():document.addEventListener("DOMContentLoaded",Am));function Kd(e,t){const n=Tm(e,t,"left"),r=Tm(e,t,"top"),i=t.offsetWidth,s=t.offsetHeight;let o=e.scrollLeft,a=e.scrollTop;const l=o+e.offsetWidth,c=a+e.offsetHeight;n<=o?o=n:n+i>l&&(o+=n+i-l),r<=a?a=r:r+s>c&&(a+=r+s-c),e.scrollLeft=o,e.scrollTop=a}function Tm(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[r];break}t=t.offsetParent}return i}function Mj(e,t){var n,r;if(document.contains(e)){const i=document.scrollingElement||document.documentElement;if(window.getComputedStyle(i).overflow==="hidden"){let o=Em(e);for(;e&&o&&e!==i&&o!==i;)Kd(o,e),e=o,o=Em(e)}else{const{left:o,top:a}=e.getBoundingClientRect();(n=e==null?void 0:e.scrollIntoView)==null||n.call(e,{block:"nearest"});const{left:l,top:c}=e.getBoundingClientRect();(Math.abs(o-l)>1||Math.abs(a-c)>1)&&((r=e.scrollIntoView)==null||r.call(e,{block:"nearest"}))}}}var i1={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function cn(e){return t=>(e(t),()=>e(void 0))}function Nc(e,t){const[n,r]=ee(Pm(t==null?void 0:t()));return pe(()=>{var i;r(((i=e())==null?void 0:i.tagName.toLowerCase())||Pm(t==null?void 0:t()))}),n}function Pm(e){return zi(e)?e:void 0}function Ze(e){const[t,n]=qe(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return M(AS,_e(n,{get component(){return t.as}}))}var $j=["id","name","validationState","required","disabled","readOnly"];function jj(e){const t=`form-control-${fn()}`,n=De({id:t},e),[r,i]=ee(),[s,o]=ee(),[a,l]=ee(),[c,u]=ee(),d=(m,p,b)=>{const v=b!=null||r()!=null;return[b,r(),v&&p!=null?m:void 0].filter(Boolean).join(" ")||void 0},f=m=>[a(),c(),m].filter(Boolean).join(" ")||void 0,h=B(()=>({"data-valid":U(n.validationState)==="valid"?"":void 0,"data-invalid":U(n.validationState)==="invalid"?"":void 0,"data-required":U(n.required)?"":void 0,"data-disabled":U(n.disabled)?"":void 0,"data-readonly":U(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>{var m;return(m=U(n.name))!=null?m:U(n.id)},dataset:h,validationState:()=>U(n.validationState),isRequired:()=>U(n.required),isDisabled:()=>U(n.disabled),isReadOnly:()=>U(n.readOnly),labelId:r,fieldId:s,descriptionId:a,errorMessageId:c,getAriaLabelledBy:d,getAriaDescribedBy:f,generateId:Ta(()=>U(n.id)),registerLabel:cn(i),registerField:cn(o),registerDescription:cn(l),registerErrorMessage:cn(u)}}}var s1=pt();function Pa(){const e=bt(s1);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function o1(e){const t=Pa(),n=De({id:t.generateId("description")},e);return pe(()=>be(t.registerDescription(n.id))),M(Ze,_e({as:"div"},()=>t.dataset(),n))}function a1(e){const t=Pa(),n=De({id:t.generateId("error-message")},e),[r,i]=qe(n,["forceMount"]),s=()=>t.validationState()==="invalid";return pe(()=>{s()&&be(t.registerErrorMessage(i.id))}),M(ye,{get when(){return r.forceMount||s()},get children(){return M(Ze,_e({as:"div"},()=>t.dataset(),i))}})}function Dj(e){let t;const n=Pa(),r=De({id:n.generateId("label")},e),[i,s]=qe(r,["ref"]),o=Nc(()=>t,()=>"label");return pe(()=>be(n.registerLabel(s.id))),M(Ze,_e({as:"label",ref(a){const l=$t(c=>t=c,i.ref);typeof l=="function"&&l(a)},get for(){return B(()=>o()==="label")()?n.fieldId():void 0}},()=>n.dataset(),s))}function Lj(e,t){pe(lr(e,n=>{if(n==null)return;const r=Ij(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),be(()=>{r.removeEventListener("reset",t)}))}))}function Ij(e){return Rj(e)?e.form:e.closest("form")}function Rj(e){return e.matches("textarea, input, select, button")}function Ma(e){var o;const[t,n]=ee((o=e.defaultValue)==null?void 0:o.call(e)),r=B(()=>{var a;return((a=e.value)==null?void 0:a.call(e))!==void 0}),i=B(()=>{var a;return r()?(a=e.value)==null?void 0:a.call(e):t()});return[i,a=>{tt(()=>{var c;const l=T$(a,i());return Object.is(l,i())||(r()||n(l),(c=e.onChange)==null||c.call(e,l)),l})}]}function l1(e){const[t,n]=Ma(e);return[()=>{var i;return(i=t())!=null?i:!1},n]}function Fj(e){const[t,n]=Ma(e);return[()=>{var i;return(i=t())!=null?i:[]},n]}function Nj(e={}){const[t,n]=l1({value:()=>U(e.isSelected),defaultValue:()=>!!U(e.defaultIsSelected),onChange:s=>{var o;return(o=e.onSelectedChange)==null?void 0:o.call(e,s)}});return{isSelected:t,setIsSelected:s=>{!U(e.isReadOnly)&&!U(e.isDisabled)&&n(s)},toggle:()=>{!U(e.isReadOnly)&&!U(e.isDisabled)&&n(!t())}}}var Bj=Object.defineProperty,Bc=(e,t)=>{for(var n in t)Bj(e,n,{get:t[n],enumerable:!0})},c1=pt();function u1(){return bt(c1)}function qj(){const e=u1();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function d1(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function zj(e,t){var i;const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const s=(i=e[r])==null?void 0:i.ref();if(s&&d1(s,n))return r+1}return 0}function Hj(e){const t=e.map((r,i)=>[i,r]);let n=!1;return t.sort(([r,i],[s,o])=>{const a=i.ref(),l=o.ref();return a===l||!a||!l?0:d1(a,l)?(r>s&&(n=!0),-1):(r<s&&(n=!0),1)}),n?t.map(([r,i])=>i):e}function f1(e,t){const n=Hj(e);e!==n&&t(n)}function Uj(e){var i,s;const t=e[0],n=(i=e[e.length-1])==null?void 0:i.ref();let r=(s=t==null?void 0:t.ref())==null?void 0:s.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return Fn(r).body}function Kj(e,t){pe(()=>{const n=setTimeout(()=>{f1(e(),t)});be(()=>clearTimeout(n))})}function Wj(e,t){if(typeof IntersectionObserver!="function"){Kj(e,t);return}let n=[];pe(()=>{const r=()=>{const o=!!n.length;n=e(),o&&f1(e(),t)},i=Uj(e()),s=new IntersectionObserver(r,{root:i});for(const o of e()){const a=o.ref();a&&s.observe(a)}be(()=>s.disconnect())})}function Vj(e={}){const[t,n]=Fj({value:()=>U(e.items),onChange:s=>{var o;return(o=e.onItemsChange)==null?void 0:o.call(e,s)}});Wj(t,n);const r=s=>(n(o=>{const a=zj(o,s);return uj(o,s,a)}),()=>{n(o=>{const a=o.filter(l=>l.ref()!==s.ref());return o.length===a.length?o:a})});return{DomCollectionProvider:s=>M(c1.Provider,{value:{registerItem:r},get children(){return s.children}})}}function Gj(e){const t=qj(),n=De({shouldRegisterItem:!0},e);pe(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());be(r)})}function h1(e){var l,c,u;let t=(l=e.startIndex)!=null?l:0;const n=(c=e.startLevel)!=null?c:0,r=[],i=d=>{var g;if(d==null)return"";const f=(g=e.getKey)!=null?g:"key",h=zi(f)?d[f]:f(d);return h!=null?String(h):""},s=d=>{var g;if(d==null)return"";const f=(g=e.getTextValue)!=null?g:"textValue",h=zi(f)?d[f]:f(d);return h!=null?String(h):""},o=d=>{var h,g;if(d==null)return!1;const f=(h=e.getDisabled)!=null?h:"disabled";return(g=zi(f)?d[f]:f(d))!=null?g:!1},a=d=>{var f;if(d!=null)return zi(e.getSectionChildren)?d[e.getSectionChildren]:(f=e.getSectionChildren)==null?void 0:f.call(e,d)};for(const d of e.dataSource){if(zi(d)||dj(d)){r.push({type:"item",rawValue:d,key:String(d),textValue:String(d),disabled:o(d),level:n,index:t}),t++;continue}if(a(d)!=null){r.push({type:"section",rawValue:d,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const f=(u=a(d))!=null?u:[];if(f.length>0){const h=h1({dataSource:f,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...h),t+=h.length}}else r.push({type:"item",rawValue:d,key:i(d),textValue:s(d),disabled:o(d),level:n,index:t}),t++}return r}function Qj(e,t=[]){return B(()=>{const n=h1({dataSource:U(e.dataSource),getKey:U(e.getKey),getTextValue:U(e.getTextValue),getDisabled:U(e.getDisabled),getSectionChildren:U(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var Yj=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Xj=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Jj(e){var n;if(Intl.Locale){const r=(n=new Intl.Locale(e).maximize().script)!=null?n:"";return Yj.has(r)}const t=e.split("-")[0];return Xj.has(t)}function Zj(e){return Jj(e)?"rtl":"ltr"}function g1(){let e=typeof navigator!="undefined"&&(navigator.language||navigator.userLanguage)||"en-US";return{locale:e,direction:Zj(e)}}var Wd=g1(),xo=new Set;function Mm(){Wd=g1();for(const e of xo)e(Wd)}function e6(){const[e,t]=ee(Wd),n=B(()=>e());return cr(()=>{xo.size===0&&window.addEventListener("languagechange",Mm),xo.add(t),be(()=>{xo.delete(t),xo.size===0&&window.removeEventListener("languagechange",Mm)})}),{locale:()=>n().locale,direction:()=>n().direction}}var t6=pt();function Kr(){const e=e6();return bt(t6)||e}var Mu=new Map;function n6(e){const{locale:t}=Kr(),n=B(()=>t()+(e?Object.entries(e).sort((r,i)=>r[0]<i[0]?-1:1).join():""));return B(()=>{const r=n();let i;return Mu.has(r)&&(i=Mu.get(r)),i||(i=new Intl.Collator(t(),e),Mu.set(r,i)),i})}var Jn=class y1 extends Set{constructor(n,r,i){super(n);ge(this,"anchorKey");ge(this,"currentKey");n instanceof y1?(this.anchorKey=r||n.anchorKey,this.currentKey=i||n.currentKey):(this.anchorKey=r,this.currentKey=i)}};function r6(e){const[t,n]=Ma(e);return[()=>{var i;return(i=t())!=null?i:new Jn},n]}function m1(e){return pj()?e.altKey:e.ctrlKey}function Hi(e){return Fc()?e.metaKey:e.ctrlKey}function $m(e){return new Jn(e)}function i6(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function s6(e){const t=De({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=ee(!1),[i,s]=ee(),o=B(()=>{const m=U(t.selectedKeys);return m!=null?$m(m):m}),a=B(()=>{const m=U(t.defaultSelectedKeys);return m!=null?$m(m):new Jn}),[l,c]=r6({value:o,defaultValue:a,onChange:m=>{var p;return(p=t.onSelectionChange)==null?void 0:p.call(t,m)}}),[u,d]=ee(U(t.selectionBehavior)),f=()=>U(t.selectionMode),h=()=>{var m;return(m=U(t.disallowEmptySelection))!=null?m:!1},g=m=>{(U(t.allowDuplicateSelectionEvents)||!i6(m,l()))&&c(m)};return pe(()=>{const m=l();U(t.selectionBehavior)==="replace"&&u()==="toggle"&&typeof m=="object"&&m.size===0&&d("replace")}),pe(()=>{var m;d((m=U(t.selectionBehavior))!=null?m:"toggle")}),{selectionMode:f,disallowEmptySelection:h,selectionBehavior:u,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:i,setFocusedKey:s,selectedKeys:l,setSelectedKeys:g}}function o6(e){const[t,n]=ee(""),[r,i]=ee(-1);return{typeSelectHandlers:{onKeyDown:o=>{var f,h,g;if(U(e.isDisabled))return;const a=U(e.keyboardDelegate),l=U(e.selectionManager);if(!a.getKeyForSearch)return;const c=a6(o.key);if(!c||o.ctrlKey||o.metaKey)return;c===" "&&t().trim().length>0&&(o.preventDefault(),o.stopPropagation());let u=n(m=>m+c),d=(f=a.getKeyForSearch(u,l.focusedKey()))!=null?f:a.getKeyForSearch(u);d==null&&l6(u)&&(u=u[0],d=(h=a.getKeyForSearch(u,l.focusedKey()))!=null?h:a.getKeyForSearch(u)),d!=null&&(l.setFocusedKey(d),(g=e.onTypeSelect)==null||g.call(e,d)),clearTimeout(r()),i(window.setTimeout(()=>n(""),500))}}}}function a6(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function l6(e){return e.split("").every(t=>t===e[0])}function c6(e,t,n){const i=_e({selectOnFocus:()=>U(e.selectionManager).selectionBehavior()==="replace"},e),s=()=>t(),{direction:o}=Kr();let a={top:0,left:0};aj(()=>U(i.isVirtualized)?void 0:s(),"scroll",()=>{const p=s();p&&(a={top:p.scrollTop,left:p.scrollLeft})});const{typeSelectHandlers:l}=o6({isDisabled:()=>U(i.disallowTypeAhead),keyboardDelegate:()=>U(i.keyboardDelegate),selectionManager:()=>U(i.selectionManager)}),c=()=>{var p;return(p=U(i.orientation))!=null?p:"vertical"},u=p=>{var A,k,P,$,j,Z,q,N;Xe(p,l.onKeyDown),p.altKey&&p.key==="Tab"&&p.preventDefault();const b=t();if(!(b!=null&&b.contains(p.target)))return;const v=U(i.selectionManager),S=U(i.selectOnFocus),w=L=>{L!=null&&(v.setFocusedKey(L),p.shiftKey&&v.selectionMode()==="multiple"?v.extendSelection(L):S&&!m1(p)&&v.replaceSelection(L))},x=U(i.keyboardDelegate),_=U(i.shouldFocusWrap),C=v.focusedKey();switch(p.key){case(c()==="vertical"?"ArrowDown":"ArrowRight"):{if(x.getKeyBelow){p.preventDefault();let L;C!=null?L=x.getKeyBelow(C):L=(A=x.getFirstKey)==null?void 0:A.call(x),L==null&&_&&(L=(k=x.getFirstKey)==null?void 0:k.call(x,C)),w(L)}break}case(c()==="vertical"?"ArrowUp":"ArrowLeft"):{if(x.getKeyAbove){p.preventDefault();let L;C!=null?L=x.getKeyAbove(C):L=(P=x.getLastKey)==null?void 0:P.call(x),L==null&&_&&(L=($=x.getLastKey)==null?void 0:$.call(x,C)),w(L)}break}case(c()==="vertical"?"ArrowLeft":"ArrowUp"):{if(x.getKeyLeftOf){p.preventDefault();const L=o()==="rtl";let F;C!=null?F=x.getKeyLeftOf(C):F=L?(j=x.getFirstKey)==null?void 0:j.call(x):(Z=x.getLastKey)==null?void 0:Z.call(x),w(F)}break}case(c()==="vertical"?"ArrowRight":"ArrowDown"):{if(x.getKeyRightOf){p.preventDefault();const L=o()==="rtl";let F;C!=null?F=x.getKeyRightOf(C):F=L?(q=x.getLastKey)==null?void 0:q.call(x):(N=x.getFirstKey)==null?void 0:N.call(x),w(F)}break}case"Home":if(x.getFirstKey){p.preventDefault();const L=x.getFirstKey(C,Hi(p));L!=null&&(v.setFocusedKey(L),Hi(p)&&p.shiftKey&&v.selectionMode()==="multiple"?v.extendSelection(L):S&&v.replaceSelection(L))}break;case"End":if(x.getLastKey){p.preventDefault();const L=x.getLastKey(C,Hi(p));L!=null&&(v.setFocusedKey(L),Hi(p)&&p.shiftKey&&v.selectionMode()==="multiple"?v.extendSelection(L):S&&v.replaceSelection(L))}break;case"PageDown":if(x.getKeyPageBelow&&C!=null){p.preventDefault();const L=x.getKeyPageBelow(C);w(L)}break;case"PageUp":if(x.getKeyPageAbove&&C!=null){p.preventDefault();const L=x.getKeyPageAbove(C);w(L)}break;case"a":Hi(p)&&v.selectionMode()==="multiple"&&U(i.disallowSelectAll)!==!0&&(p.preventDefault(),v.selectAll());break;case"Escape":p.defaultPrevented||(p.preventDefault(),U(i.disallowEmptySelection)||v.clearSelection());break;case"Tab":if(!U(i.allowsTabNavigation)){if(p.shiftKey)b.focus();else{const L=Oj(b,{tabbable:!0});let F,se;do se=L.lastChild(),se&&(F=se);while(se);F&&!F.contains(document.activeElement)&&St(F)}break}}},d=p=>{var w,x,_,C;const b=U(i.selectionManager),v=U(i.keyboardDelegate),S=U(i.selectOnFocus);if(b.isFocused()){p.currentTarget.contains(p.target)||b.setFocused(!1);return}if(p.currentTarget.contains(p.target)){if(b.setFocused(!0),b.focusedKey()==null){const A=P=>{P!=null&&(b.setFocusedKey(P),S&&b.replaceSelection(P))},k=p.relatedTarget;k&&p.currentTarget.compareDocumentPosition(k)&Node.DOCUMENT_POSITION_FOLLOWING?A((x=b.lastSelectedKey())!=null?x:(w=v.getLastKey)==null?void 0:w.call(v)):A((C=b.firstSelectedKey())!=null?C:(_=v.getFirstKey)==null?void 0:_.call(v))}else if(!U(i.isVirtualized)){const A=s();if(A){A.scrollTop=a.top,A.scrollLeft=a.left;const k=A.querySelector(`[data-key="${b.focusedKey()}"]`);k&&(St(k),Kd(A,k))}}}},f=p=>{const b=U(i.selectionManager);p.currentTarget.contains(p.relatedTarget)||b.setFocused(!1)},h=p=>{s()===p.target&&p.preventDefault()},g=()=>{var _,C;const p=U(i.autoFocus);if(!p)return;const b=U(i.selectionManager),v=U(i.keyboardDelegate);let S;p==="first"&&(S=(_=v.getFirstKey)==null?void 0:_.call(v)),p==="last"&&(S=(C=v.getLastKey)==null?void 0:C.call(v));const w=b.selectedKeys();w.size&&(S=w.values().next().value),b.setFocused(!0),b.setFocusedKey(S);const x=t();x&&S==null&&!U(i.shouldUseVirtualFocus)&&St(x)};return cr(()=>{i.deferAutoFocus?setTimeout(g,0):g()}),pe(lr([s,()=>U(i.isVirtualized),()=>U(i.selectionManager).focusedKey()],p=>{var w;const[b,v,S]=p;if(v)S&&((w=i.scrollToKey)==null||w.call(i,S));else if(S&&b){const x=b.querySelector(`[data-key="${S}"]`);x&&Kd(b,x)}})),{tabIndex:B(()=>{if(!U(i.shouldUseVirtualFocus))return U(i.selectionManager).focusedKey()==null?0:-1}),onKeyDown:u,onMouseDown:h,onFocusIn:d,onFocusOut:f}}function p1(e,t){const n=()=>U(e.selectionManager),r=()=>U(e.key),i=()=>U(e.shouldUseVirtualFocus),s=v=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):v!=null&&v.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||Hi(v)||"pointerType"in v&&v.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},o=()=>n().isSelected(r()),a=()=>U(e.disabled)||n().isDisabled(r()),l=()=>!a()&&n().canSelectItem(r());let c=null;const u=v=>{l()&&(c=v.pointerType,v.pointerType==="mouse"&&v.button===0&&!U(e.shouldSelectOnPressUp)&&s(v))},d=v=>{l()&&v.pointerType==="mouse"&&v.button===0&&U(e.shouldSelectOnPressUp)&&U(e.allowsDifferentPressOrigin)&&s(v)},f=v=>{l()&&(U(e.shouldSelectOnPressUp)&&!U(e.allowsDifferentPressOrigin)||c!=="mouse")&&s(v)},h=v=>{!l()||!["Enter"," "].includes(v.key)||(m1(v)?n().toggleSelection(r()):s(v))},g=v=>{a()&&v.preventDefault()},m=v=>{const S=t();i()||a()||!S||v.target===S&&n().setFocusedKey(r())},p=B(()=>{if(!(i()||a()))return r()===n().focusedKey()?0:-1}),b=B(()=>U(e.virtualized)?void 0:r());return pe(lr([t,r,i,()=>n().focusedKey(),()=>n().isFocused()],([v,S,w,x,_])=>{v&&S===x&&_&&!w&&document.activeElement!==v&&(e.focus?e.focus():St(v))})),{isSelected:o,isDisabled:a,allowsSelection:l,tabIndex:p,dataKey:b,onPointerDown:u,onPointerUp:d,onClick:f,onKeyDown:h,onMouseDown:g,onFocus:m}}var u6=class{constructor(e,t){ge(this,"collection");ge(this,"state");this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(e==null||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if(this.state.selectionMode()==="none")return!1;const t=this.getKey(e);return t==null?!1:this.state.selectedKeys().has(t)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every(t=>e.has(t))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=(n==null?void 0:n.index)!=null&&(e==null?void 0:e.index)!=null&&n.index<e.index;(!e||r)&&(e=n)}return e==null?void 0:e.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=(n==null?void 0:n.index)!=null&&(e==null?void 0:e.index)!=null&&n.index>e.index;(!e||r)&&(e=n)}return e==null?void 0:e.key}extendSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,i=new Jn(n,r,t);for(const s of this.getKeyRange(r,n.currentKey||t))i.delete(s);for(const s of this.getKeyRange(t,r))this.canSelectItem(s)&&i.add(s);this.state.setSelectedKeys(i)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?n.index!=null&&r.index!=null&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;r!=null;){const i=this.collection().getItem(r);if(i&&i.type==="item"&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?!t||t.type!=="item"?null:t.key:e}toggleSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=new Jn(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection()&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode()==="none")return;const t=this.getKey(e);if(t==null)return;const n=this.canSelectItem(t)?new Jn([t],t,t):new Jn;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new Jn;for(const n of e){const r=this.getKey(n);if(r!=null&&(t.add(r),this.selectionMode()==="single"))break}this.state.setSelectedKeys(t)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new Jn)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior()==="toggle"||t&&t.pointerType==="touch"?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode()==="none")return!1;const t=this.collection().getItem(e);return t!=null&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(n=>{for(;n!=null;){if(this.canSelectItem(n)){const r=this.collection().getItem(n);if(!r)continue;r.type==="item"&&e.push(n)}n=this.collection().getKeyAfter(n)}})(this.collection().getFirstKey()),e}},jm=class{constructor(e){ge(this,"keyMap",new Map);ge(this,"iterable");ge(this,"firstKey");ge(this,"lastKey");this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(this.keyMap.size===0)return;let t,n=0;for(const[r,i]of this.keyMap)t?(t.nextKey=r,i.prevKey=t.key):(this.firstKey=r,i.prevKey=void 0),i.type==="item"&&(i.index=n++),t=i,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){var t;return(t=this.keyMap.get(e))==null?void 0:t.prevKey}getKeyAfter(e){var t;return(t=this.keyMap.get(e))==null?void 0:t.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};function d6(e){const t=s6(e),r=Qj({dataSource:()=>U(e.dataSource),getKey:()=>U(e.getKey),getTextValue:()=>U(e.getTextValue),getDisabled:()=>U(e.getDisabled),getSectionChildren:()=>U(e.getSectionChildren),factory:s=>e.filter?new jm(e.filter(s)):new jm(s)},[()=>e.filter]),i=new u6(r,t);return b0(()=>{const s=t.focusedKey();s!=null&&!r().getItem(s)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>i}}var wt=e=>typeof e=="function"?e():e,f6=e=>{const t=B(()=>{const o=wt(e.element);if(o)return getComputedStyle(o)}),n=()=>{var o,a;return(a=(o=t())==null?void 0:o.animationName)!=null?a:"none"},[r,i]=ee(wt(e.show)?"present":"hidden");let s="none";return pe(o=>{const a=wt(e.show);return tt(()=>{var u;if(o===a)return a;const l=s,c=n();a?i("present"):c==="none"||((u=t())==null?void 0:u.display)==="none"?i("hidden"):i(o===!0&&l!==c?"hiding":"hidden")}),a}),pe(()=>{const o=wt(e.element);if(!o)return;const a=c=>{c.target===o&&(s=n())},l=c=>{const d=n().includes(c.animationName);c.target===o&&d&&r()==="hiding"&&i("hidden")};o.addEventListener("animationstart",a),o.addEventListener("animationcancel",l),o.addEventListener("animationend",l),be(()=>{o.removeEventListener("animationstart",a),o.removeEventListener("animationcancel",l),o.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r}},h6=f6,b1=h6,ic="data-kb-top-layer",v1,Vd=!1,ur=[];function ta(e){return ur.findIndex(t=>t.node===e)}function g6(e){return ur[ta(e)]}function y6(e){return ur[ur.length-1].node===e}function x1(){return ur.filter(e=>e.isPointerBlocking)}function m6(){return[...x1()].slice(-1)[0]}function Uf(){return x1().length>0}function w1(e){var n;const t=ta((n=m6())==null?void 0:n.node);return ta(e)<t}function p6(e){ur.push(e)}function b6(e){const t=ta(e);t<0||ur.splice(t,1)}function v6(){for(const{node:e}of ur)e.style.pointerEvents=w1(e)?"none":"auto"}function x6(e){if(Uf()&&!Vd){const t=Fn(e);v1=document.body.style.pointerEvents,t.body.style.pointerEvents="none",Vd=!0}}function w6(e){if(Uf())return;const t=Fn(e);t.body.style.pointerEvents=v1,t.body.style.length===0&&t.body.removeAttribute("style"),Vd=!1}var Ht={layers:ur,isTopMostLayer:y6,hasPointerBlockingLayer:Uf,isBelowPointerBlockingLayer:w1,addLayer:p6,removeLayer:b6,indexOf:ta,find:g6,assignPointerEventToLayers:v6,disableBodyPointerEvents:x6,restoreBodyPointerEvents:w6},S6={};Bc(S6,{Button:()=>k6,Root:()=>Kf});var C6=["button","color","file","image","reset","submit"];function _6(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?C6.indexOf(e.type)!==-1:!1}function Kf(e){let t;const n=De({type:"button"},e),[r,i]=qe(n,["ref","type","disabled"]),s=Nc(()=>t,()=>"button"),o=B(()=>{const c=s();return c==null?!1:_6({tagName:c,type:r.type})}),a=B(()=>s()==="input"),l=B(()=>s()==="a"&&(t==null?void 0:t.getAttribute("href"))!=null);return M(Ze,_e({as:"button",ref(c){const u=$t(d=>t=d,r.ref);typeof u=="function"&&u(c)},get type(){return o()||a()?r.type:void 0},get role(){return!o()&&!l()?"button":void 0},get tabIndex(){return!o()&&!l()&&!r.disabled?0:void 0},get disabled(){return o()||a()?r.disabled:void 0},get"aria-disabled"(){return!o()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},i))}var k6=Kf,E6=["top","right","bottom","left"],In=Math.min,Gt=Math.max,sc=Math.round,yl=Math.floor,Fr=e=>({x:e,y:e}),O6={left:"right",right:"left",bottom:"top",top:"bottom"},A6={start:"end",end:"start"};function Gd(e,t,n){return Gt(e,In(t,n))}function Mi(e,t){return typeof e=="function"?e(t):e}function Nr(e){return e.split("-")[0]}function qs(e){return e.split("-")[1]}function S1(e){return e==="x"?"y":"x"}function Wf(e){return e==="y"?"height":"width"}function _i(e){return["top","bottom"].includes(Nr(e))?"y":"x"}function Vf(e){return S1(_i(e))}function T6(e,t,n){n===void 0&&(n=!1);const r=qs(e),i=Vf(e),s=Wf(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=oc(o)),[o,oc(o)]}function P6(e){const t=oc(e);return[Qd(e),t,Qd(t)]}function Qd(e){return e.replace(/start|end/g,t=>A6[t])}function M6(e,t,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?s:o;default:return[]}}function $6(e,t,n,r){const i=qs(e);let s=M6(Nr(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(Qd)))),s}function oc(e){return e.replace(/left|right|bottom|top/g,t=>O6[t])}function j6(e){return{top:0,right:0,bottom:0,left:0,...e}}function C1(e){return typeof e!="number"?j6(e):{top:e,right:e,bottom:e,left:e}}function ac(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Dm(e,t,n){let{reference:r,floating:i}=e;const s=_i(t),o=Vf(t),a=Wf(o),l=Nr(t),c=s==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-i.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-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(qs(t)){case"start":h[o]-=f*(n&&c?-1:1);break;case"end":h[o]+=f*(n&&c?-1:1);break}return h}var D6=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Dm(c,r,l),f=r,h={},g=0;for(let m=0;m<a.length;m++){const{name:p,fn:b}=a[m],{x:v,y:S,data:w,reset:x}=await b({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:c,platform:o,elements:{reference:e,floating:t}});u=v!=null?v:u,d=S!=null?S:d,h={...h,[p]:{...h[p],...w}},x&&g<=50&&(g++,typeof x=="object"&&(x.placement&&(f=x.placement),x.rects&&(c=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Dm(c,f,l)),m=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:h}};async function na(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Mi(t,e),g=C1(h),p=a[f?d==="floating"?"reference":"floating":d],b=ac(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(p)))==null||n?p:p.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),w=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},x=ac(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:S,strategy:l}):v);return{top:(b.top-x.top+g.top)/w.y,bottom:(x.bottom-b.bottom+g.bottom)/w.y,left:(b.left-x.left+g.left)/w.x,right:(x.right-b.right+g.right)/w.x}}var L6=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Mi(e,t)||{};if(c==null)return{};const d=C1(u),f={x:n,y:r},h=Vf(i),g=Wf(h),m=await o.getDimensions(c),p=h==="y",b=p?"top":"left",v=p?"bottom":"right",S=p?"clientHeight":"clientWidth",w=s.reference[g]+s.reference[h]-f[h]-s.floating[g],x=f[h]-s.reference[h],_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let C=_?_[S]:0;(!C||!await(o.isElement==null?void 0:o.isElement(_)))&&(C=a.floating[S]||s.floating[g]);const A=w/2-x/2,k=C/2-m[g]/2-1,P=In(d[b],k),$=In(d[v],k),j=P,Z=C-m[g]-$,q=C/2-m[g]/2+A,N=Gd(j,q,Z),L=!l.arrow&&qs(i)!=null&&q!==N&&s.reference[g]/2-(q<j?P:$)-m[g]/2<0,F=L?q<j?q-j:q-Z:0;return{[h]:f[h]+F,data:{[h]:N,centerOffset:q-N-F,...L&&{alignmentOffset:F}},reset:L}}}),I6=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...p}=Mi(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=Nr(i),v=_i(a),S=Nr(a)===a,w=await(l.isRTL==null?void 0:l.isRTL(c.floating)),x=f||(S||!m?[oc(a)]:P6(a)),_=g!=="none";!f&&_&&x.push(...$6(a,m,g,w));const C=[a,...x],A=await na(t,p),k=[];let P=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&k.push(A[b]),d){const q=T6(i,o,w);k.push(A[q[0]],A[q[1]])}if(P=[...P,{placement:i,overflows:k}],!k.every(q=>q<=0)){var $,j;const q=((($=s.flip)==null?void 0:$.index)||0)+1,N=C[q];if(N)return{data:{index:q,overflows:P},reset:{placement:N}};let L=(j=P.filter(F=>F.overflows[0]<=0).sort((F,se)=>F.overflows[1]-se.overflows[1])[0])==null?void 0:j.placement;if(!L)switch(h){case"bestFit":{var Z;const F=(Z=P.filter(se=>{if(_){const de=_i(se.placement);return de===v||de==="y"}return!0}).map(se=>[se.placement,se.overflows.filter(de=>de>0).reduce((de,R)=>de+R,0)]).sort((se,de)=>se[1]-de[1])[0])==null?void 0:Z[0];F&&(L=F);break}case"initialPlacement":L=a;break}if(i!==L)return{reset:{placement:L}}}return{}}}};function Lm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Im(e){return E6.some(t=>e[t]>=0)}var R6=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Mi(e,t);switch(r){case"referenceHidden":{const s=await na(t,{...i,elementContext:"reference"}),o=Lm(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Im(o)}}}case"escaped":{const s=await na(t,{...i,altBoundary:!0}),o=Lm(s,n.floating);return{data:{escapedOffsets:o,escaped:Im(o)}}}default:return{}}}}};async function F6(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Nr(n),a=qs(n),l=_i(n)==="y",c=["left","top"].includes(o)?-1:1,u=s&&l?-1:1,d=Mi(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}var N6=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=t,l=await F6(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},B6=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:p=>{let{x:b,y:v}=p;return{x:b,y:v}}},...l}=Mi(e,t),c={x:n,y:r},u=await na(t,l),d=_i(Nr(i)),f=S1(d);let h=c[f],g=c[d];if(s){const p=f==="y"?"top":"left",b=f==="y"?"bottom":"right",v=h+u[p],S=h-u[b];h=Gd(v,h,S)}if(o){const p=d==="y"?"top":"left",b=d==="y"?"bottom":"right",v=g+u[p],S=g-u[b];g=Gd(v,g,S)}const m=a.fn({...t,[f]:h,[d]:g});return{...m,data:{x:m.x-n,y:m.y-r}}}}},q6=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:s}=t,{apply:o=()=>{},...a}=Mi(e,t),l=await na(t,a),c=Nr(n),u=qs(n),d=_i(n)==="y",{width:f,height:h}=r.floating;let g,m;c==="top"||c==="bottom"?(g=c,m=u===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(m=c,g=u==="end"?"top":"bottom");const p=h-l.top-l.bottom,b=f-l.left-l.right,v=In(h-l[g],p),S=In(f-l[m],b),w=!t.middlewareData.shift;let x=v,_=S;if(d?_=u||w?In(S,b):b:x=u||w?In(v,p):p,w&&!u){const A=Gt(l.left,0),k=Gt(l.right,0),P=Gt(l.top,0),$=Gt(l.bottom,0);d?_=f-2*(A!==0||k!==0?A+k:Gt(l.left,l.right)):x=h-2*(P!==0||$!==0?P+$:Gt(l.top,l.bottom))}await o({...t,availableWidth:_,availableHeight:x});const C=await i.getDimensions(s.floating);return f!==C.width||h!==C.height?{reset:{rects:!0}}:{}}}};function zs(e){return _1(e)?(e.nodeName||"").toLowerCase():"#document"}function Xt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function fr(e){var t;return(t=(_1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function _1(e){return e instanceof Node||e instanceof Xt(e).Node}function Sn(e){return e instanceof Element||e instanceof Xt(e).Element}function Nn(e){return e instanceof HTMLElement||e instanceof Xt(e).HTMLElement}function Rm(e){return typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof Xt(e).ShadowRoot}function $a(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Cn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function z6(e){return["table","td","th"].includes(zs(e))}function qc(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(n){return!1}})}function Gf(e){const t=Qf(),n=Sn(e)?Cn(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function H6(e){let t=Br(e);for(;Nn(t)&&!Ps(t);){if(Gf(t))return t;if(qc(t))return null;t=Br(t)}return null}function Qf(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ps(e){return["html","body","#document"].includes(zs(e))}function Cn(e){return Xt(e).getComputedStyle(e)}function zc(e){return Sn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Br(e){if(zs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Rm(e)&&e.host||fr(e);return Rm(t)?t.host:t}function k1(e){const t=Br(e);return Ps(t)?e.ownerDocument?e.ownerDocument.body:e.body:Nn(t)&&$a(t)?t:k1(t)}function ra(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=k1(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=Xt(i);return s?t.concat(o,o.visualViewport||[],$a(i)?i:[],o.frameElement&&n?ra(o.frameElement):[]):t.concat(i,ra(i,[],n))}function E1(e){const t=Cn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Nn(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=sc(n)!==s||sc(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function Yf(e){return Sn(e)?e:e.contextElement}function Xi(e){const t=Yf(e);if(!Nn(t))return Fr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=E1(t);let o=(s?sc(n.width):n.width)/r,a=(s?sc(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}var U6=Fr(0);function O1(e){const t=Xt(e);return!Qf()||!t.visualViewport?U6:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function K6(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Xt(e)?!1:t}function ki(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Yf(e);let o=Fr(1);t&&(r?Sn(r)&&(o=Xi(r)):o=Xi(e));const a=K6(s,n,r)?O1(s):Fr(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(s){const f=Xt(s),h=r&&Sn(r)?Xt(r):r;let g=f,m=g.frameElement;for(;m&&r&&h!==g;){const p=Xi(m),b=m.getBoundingClientRect(),v=Cn(m),S=b.left+(m.clientLeft+parseFloat(v.paddingLeft))*p.x,w=b.top+(m.clientTop+parseFloat(v.paddingTop))*p.y;l*=p.x,c*=p.y,u*=p.x,d*=p.y,l+=S,c+=w,g=Xt(m),m=g.frameElement}}return ac({width:u,height:d,x:l,y:c})}function W6(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=fr(r),a=t?qc(t.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=Fr(1);const u=Fr(0),d=Nn(r);if((d||!d&&!s)&&((zs(r)!=="body"||$a(o))&&(l=zc(r)),Nn(r))){const f=ki(r);c=Xi(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function V6(e){return Array.from(e.getClientRects())}function A1(e){return ki(fr(e)).left+zc(e).scrollLeft}function G6(e){const t=fr(e),n=zc(e),r=e.ownerDocument.body,i=Gt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Gt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+A1(e);const a=-n.scrollTop;return Cn(r).direction==="rtl"&&(o+=Gt(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function Q6(e,t){const n=Xt(e),r=fr(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const c=Qf();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function Y6(e,t){const n=ki(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=Nn(e)?Xi(e):Fr(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,c=r*s.y;return{width:o,height:a,x:l,y:c}}function Fm(e,t,n){let r;if(t==="viewport")r=Q6(e,n);else if(t==="document")r=G6(fr(e));else if(Sn(t))r=Y6(t,n);else{const i=O1(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return ac(r)}function T1(e,t){const n=Br(e);return n===t||!Sn(n)||Ps(n)?!1:Cn(n).position==="fixed"||T1(n,t)}function X6(e,t){const n=t.get(e);if(n)return n;let r=ra(e,[],!1).filter(a=>Sn(a)&&zs(a)!=="body"),i=null;const s=Cn(e).position==="fixed";let o=s?Br(e):e;for(;Sn(o)&&!Ps(o);){const a=Cn(o),l=Gf(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||$a(o)&&!l&&T1(e,o))?r=r.filter(u=>u!==o):i=a,o=Br(o)}return t.set(e,r),r}function J6(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?qc(t)?[]:X6(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((c,u)=>{const d=Fm(t,u,i);return c.top=Gt(d.top,c.top),c.right=In(d.right,c.right),c.bottom=In(d.bottom,c.bottom),c.left=Gt(d.left,c.left),c},Fm(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Z6(e){const{width:t,height:n}=E1(e);return{width:t,height:n}}function eD(e,t,n){const r=Nn(t),i=fr(t),s=n==="fixed",o=ki(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Fr(0);if(r||!r&&!s)if((zs(t)!=="body"||$a(i))&&(a=zc(t)),r){const d=ki(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&(l.x=A1(i));const c=o.left+a.scrollLeft-l.x,u=o.top+a.scrollTop-l.y;return{x:c,y:u,width:o.width,height:o.height}}function $u(e){return Cn(e).position==="static"}function Nm(e,t){return!Nn(e)||Cn(e).position==="fixed"?null:t?t(e):e.offsetParent}function P1(e,t){const n=Xt(e);if(qc(e))return n;if(!Nn(e)){let i=Br(e);for(;i&&!Ps(i);){if(Sn(i)&&!$u(i))return i;i=Br(i)}return n}let r=Nm(e,t);for(;r&&z6(r)&&$u(r);)r=Nm(r,t);return r&&Ps(r)&&$u(r)&&!Gf(r)?n:r||H6(e)||n}var tD=async function(e){const t=this.getOffsetParent||P1,n=this.getDimensions,r=await n(e.floating);return{reference:eD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function nD(e){return Cn(e).direction==="rtl"}var M1={convertOffsetParentRelativeRectToViewportRelativeRect:W6,getDocumentElement:fr,getClippingRect:J6,getOffsetParent:P1,getElementRects:tD,getClientRects:V6,getDimensions:Z6,getScale:Xi,isElement:Sn,isRTL:nD};function rD(e,t){let n=null,r;const i=fr(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h=yl(u),g=yl(i.clientWidth-(c+d)),m=yl(i.clientHeight-(u+f)),p=yl(c),v={rootMargin:-h+"px "+-g+"px "+-m+"px "+-p+"px",threshold:Gt(0,In(1,l))||1};let S=!0;function w(x){const _=x[0].intersectionRatio;if(_!==l){if(!S)return o();_?o(!1,_):r=setTimeout(()=>{o(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(w,{...v,root:i.ownerDocument})}catch(x){n=new IntersectionObserver(w,v)}n.observe(e)}return o(!0),s}function iD(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Yf(e),u=i||s?[...c?ra(c):[],...ra(t)]:[];u.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const d=c&&a?rD(c,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(b=>{let[v]=b;v&&v.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let g,m=l?ki(e):null;l&&p();function p(){const b=ki(e);m&&(b.x!==m.x||b.y!==m.y||b.width!==m.width||b.height!==m.height)&&n(),m=b,g=requestAnimationFrame(p)}return n(),()=>{var b;u.forEach(v=>{i&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),d==null||d(),(b=h)==null||b.disconnect(),h=null,l&&cancelAnimationFrame(g)}}var sD=N6,oD=B6,aD=I6,lD=q6,cD=R6,uD=L6,dD=(e,t,n)=>{const r=new Map,i={platform:M1,...n},s={...i.platform,_c:r};return D6(e,t,{...i,platform:s})},Xf=pt();function Jf(){const e=bt(Xf);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var fD=oe('<svg display="block" viewBox="0 0 30 30" style="transform:scale(1.02)"><g><path fill="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z"></path><path stroke="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z">'),Yd=30,Bm=Yd/2,hD={top:180,right:-90,bottom:0,left:90};function Zf(e){const t=Jf(),n=De({size:Yd},e),[r,i]=qe(n,["ref","style","size"]),s=()=>t.currentPlacement().split("-")[0],o=gD(t.contentRef),a=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue("background-color"))||"none"},l=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue(`border-${s()}-color`))||"none"},c=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue(`border-${s()}-width`))||"0px"},u=()=>Number.parseInt(c())*2*(Yd/r.size),d=()=>`rotate(${hD[s()]} ${Bm} ${Bm}) translate(0 2)`;return M(Ze,_e({as:"div",ref(f){const h=$t(t.setArrowRef,r.ref);typeof h=="function"&&h(f)},"aria-hidden":"true",get style(){return Rc({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:a(),stroke:l(),"stroke-width":u()},r.style)}},i,{get children(){const f=fD(),h=f.firstChild;return me(()=>G(h,"transform",d())),f}}))}function gD(e){const[t,n]=ee();return pe(()=>{const r=e();r&&n(hj(r).getComputedStyle(r))}),t}function yD(e){const t=Jf(),[n,r]=qe(e,["ref","style"]);return M(Ze,_e({as:"div",ref(i){const s=$t(t.setPositionerRef,n.ref);typeof s=="function"&&s(i)},"data-popper-positioner":"",get style(){return Rc({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function qm(e){const{x:t=0,y:n=0,width:r=0,height:i=0}=e!=null?e:{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,i);const s={x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:n+i,left:t};return{...s,toJSON:()=>s}}function mD(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?qm(r):e?e.getBoundingClientRect():qm()}}}function pD(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var bD={top:"bottom",right:"left",bottom:"top",left:"right"};function vD(e,t){const[n,r]=e.split("-"),i=bD[n];return r?n==="left"||n==="right"?`${i} ${r==="start"?"top":"bottom"}`:r==="start"?`${i} ${t==="rtl"?"right":"left"}`:`${i} ${t==="rtl"?"left":"right"}`:`${i} center`}function xD(e){const t=De({getAnchorRect:f=>f==null?void 0:f.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=ee(),[i,s]=ee(),[o,a]=ee(t.placement),l=()=>{var f;return mD((f=t.anchorRef)==null?void 0:f.call(t),t.getAnchorRect)},{direction:c}=Kr();async function u(){var _,C,A;const f=l(),h=n(),g=i();if(!f||!h)return;const m=((g==null?void 0:g.clientHeight)||0)/2,p=typeof t.gutter=="number"?t.gutter+m:(_=t.gutter)!=null?_:m;h.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const b=[sD(({placement:k})=>{const P=!!k.split("-")[1];return{mainAxis:p,crossAxis:P?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const k=typeof t.flip=="string"?t.flip.split(" "):void 0;if(k!==void 0&&!k.every(pD))throw new Error("`flip` expects a spaced-delimited list of placements");b.push(aD({padding:t.overflowPadding,fallbackPlacements:k}))}(t.slide||t.overlap)&&b.push(oD({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),b.push(lD({padding:t.overflowPadding,apply({availableWidth:k,availableHeight:P,rects:$}){const j=Math.round($.reference.width);k=Math.floor(k),P=Math.floor(P),h.style.setProperty("--kb-popper-anchor-width",`${j}px`),h.style.setProperty("--kb-popper-content-available-width",`${k}px`),h.style.setProperty("--kb-popper-content-available-height",`${P}px`),t.sameWidth&&(h.style.width=`${j}px`),t.fitViewport&&(h.style.maxWidth=`${k}px`,h.style.maxHeight=`${P}px`)}})),t.hideWhenDetached&&b.push(cD({padding:t.detachedPadding})),g&&b.push(uD({element:g,padding:t.arrowPadding}));const v=await dD(f,h,{placement:t.placement,strategy:"absolute",middleware:b,platform:{...M1,isRTL:()=>c()==="rtl"}});if(a(v.placement),(C=t.onCurrentPlacementChange)==null||C.call(t,v.placement),!h)return;h.style.setProperty("--kb-popper-content-transform-origin",vD(v.placement,c()));const S=Math.round(v.x),w=Math.round(v.y);let x;if(t.hideWhenDetached&&(x=(A=v.middlewareData.hide)!=null&&A.referenceHidden?"hidden":"visible"),Object.assign(h.style,{top:"0",left:"0",transform:`translate3d(${S}px, ${w}px, 0)`,visibility:x}),g&&v.middlewareData.arrow){const{x:k,y:P}=v.middlewareData.arrow,$=v.placement.split("-")[0];Object.assign(g.style,{left:k!=null?`${k}px`:"",top:P!=null?`${P}px`:"",[$]:"100%"})}}pe(()=>{const f=l(),h=n();if(!f||!h)return;const g=iD(f,h,u,{elementResize:typeof ResizeObserver=="function"});be(g)}),pe(()=>{var g;const f=n(),h=(g=t.contentRef)==null?void 0:g.call(t);!f||!h||queueMicrotask(()=>{f.style.zIndex=getComputedStyle(h).zIndex})});const d={currentPlacement:o,contentRef:()=>{var f;return(f=t.contentRef)==null?void 0:f.call(t)},setPositionerRef:r,setArrowRef:s};return M(Xf.Provider,{value:d,get children(){return t.children}})}var $1=Object.assign(xD,{Arrow:Zf,Context:Xf,usePopperContext:Jf,Positioner:yD});function wD(e){const t=n=>{var r;n.key===Bf.Escape&&((r=e.onEscapeKeyDown)==null||r.call(e,n))};pe(()=>{var r,i;if(U(e.isDisabled))return;const n=(i=(r=e.ownerDocument)==null?void 0:r.call(e))!=null?i:Fn();n.addEventListener("keydown",t),be(()=>{n.removeEventListener("keydown",t)})})}var zm="interactOutside.pointerDownOutside",Hm="interactOutside.focusOutside";function SD(e,t){let n,r=Tj;const i=()=>Fn(t()),s=d=>{var f;return(f=e.onPointerDownOutside)==null?void 0:f.call(e,d)},o=d=>{var f;return(f=e.onFocusOutside)==null?void 0:f.call(e,d)},a=d=>{var f;return(f=e.onInteractOutside)==null?void 0:f.call(e,d)},l=d=>{var h;const f=d.target;return!(f instanceof HTMLElement)||f.closest(`[${ic}]`)||!ln(i(),f)||ln(t(),f)?!1:!((h=e.shouldExcludeElement)!=null&&h.call(e,f))},c=d=>{function f(){const h=t(),g=d.target;if(!h||!g||!l(d))return;const m=ht([s,a]);g.addEventListener(zm,m,{once:!0});const p=new CustomEvent(zm,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||bj(d)&&d.button===0}});g.dispatchEvent(p)}d.pointerType==="touch"?(i().removeEventListener("click",f),r=f,i().addEventListener("click",f,{once:!0})):f()},u=d=>{const f=t(),h=d.target;if(!f||!h||!l(d))return;const g=ht([o,a]);h.addEventListener(Hm,g,{once:!0});const m=new CustomEvent(Hm,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});h.dispatchEvent(m)};pe(()=>{U(e.isDisabled)||(n=window.setTimeout(()=>{i().addEventListener("pointerdown",c,!0)},0),i().addEventListener("focusin",u,!0),be(()=>{window.clearTimeout(n),i().removeEventListener("click",r),i().removeEventListener("pointerdown",c,!0),i().removeEventListener("focusin",u,!0)}))})}var j1=pt();function CD(){return bt(j1)}function _D(e){let t;const n=CD(),[r,i]=qe(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),s=new Set([]),o=d=>{s.add(d);const f=n==null?void 0:n.registerNestedLayer(d);return()=>{s.delete(d),f==null||f()}};SD({shouldExcludeElement:d=>{var f;return t?((f=r.excludedElements)==null?void 0:f.some(h=>ln(h(),d)))||[...s].some(h=>ln(h,d)):!1},onPointerDownOutside:d=>{var f,h,g;!t||Ht.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!Ht.isTopMostLayer(t)||((f=r.onPointerDownOutside)==null||f.call(r,d),(h=r.onInteractOutside)==null||h.call(r,d),d.defaultPrevented||(g=r.onDismiss)==null||g.call(r))},onFocusOutside:d=>{var f,h,g;(f=r.onFocusOutside)==null||f.call(r,d),(h=r.onInteractOutside)==null||h.call(r,d),d.defaultPrevented||(g=r.onDismiss)==null||g.call(r)}},()=>t),wD({ownerDocument:()=>Fn(t),onEscapeKeyDown:d=>{var f;!t||!Ht.isTopMostLayer(t)||((f=r.onEscapeKeyDown)==null||f.call(r,d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),cr(()=>{if(!t)return;Ht.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n==null?void 0:n.registerNestedLayer(t);Ht.assignPointerEventToLayers(),Ht.disableBodyPointerEvents(t),be(()=>{t&&(Ht.removeLayer(t),d==null||d(),Ht.assignPointerEventToLayers(),Ht.restoreBodyPointerEvents(t))})}),pe(lr([()=>t,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const h=Ht.find(d);h&&h.isPointerBlocking!==f&&(h.isPointerBlocking=f,Ht.assignPointerEventToLayers()),f&&Ht.disableBodyPointerEvents(d),be(()=>{Ht.restoreBodyPointerEvents(d)})},{defer:!0}));const u={registerNestedLayer:o};return M(j1.Provider,{value:u,get children(){return M(Ze,_e({as:"div",ref(d){const f=$t(h=>t=h,r.ref);typeof f=="function"&&f(d)}},i))}})}function D1(e={}){const[t,n]=l1({value:()=>U(e.open),defaultValue:()=>!!U(e.defaultOpen),onChange:o=>{var a;return(a=e.onOpenChange)==null?void 0:a.call(e,o)}}),r=()=>{n(!0)},i=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:i,toggle:()=>{t()?i():r()}}}var nn={};Bc(nn,{Description:()=>o1,ErrorMessage:()=>a1,Item:()=>F1,ItemControl:()=>N1,ItemDescription:()=>B1,ItemIndicator:()=>q1,ItemInput:()=>z1,ItemLabel:()=>H1,Label:()=>U1,RadioGroup:()=>kD,Root:()=>K1});var L1=pt();function I1(){const e=bt(L1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var R1=pt();function ja(){const e=bt(R1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function F1(e){const t=Pa(),n=I1(),r=`${t.generateId("item")}-${fn()}`,i=De({id:r},e),[s,o]=qe(i,["value","disabled","onPointerDown"]),[a,l]=ee(),[c,u]=ee(),[d,f]=ee(),[h,g]=ee(),[m,p]=ee(!1),b=B(()=>n.isSelectedValue(s.value)),v=B(()=>s.disabled||t.isDisabled()||!1),S=_=>{Xe(_,s.onPointerDown),m()&&_.preventDefault()},w=B(()=>({...t.dataset(),"data-disabled":v()?"":void 0,"data-checked":b()?"":void 0})),x={value:()=>s.value,dataset:w,isSelected:b,isDisabled:v,inputId:a,labelId:c,descriptionId:d,inputRef:h,select:()=>n.setSelectedValue(s.value),generateId:Ta(()=>o.id),registerInput:cn(l),registerLabel:cn(u),registerDescription:cn(f),setIsFocused:p,setInputRef:g};return M(R1.Provider,{value:x,get children(){return M(Ze,_e({as:"div",role:"group",onPointerDown:S},w,o))}})}function N1(e){const t=ja(),n=De({id:t.generateId("control")},e),[r,i]=qe(n,["onClick","onKeyDown"]);return M(Ze,_e({as:"div",onClick:a=>{var l;Xe(a,r.onClick),t.select(),(l=t.inputRef())==null||l.focus()},onKeyDown:a=>{var l;Xe(a,r.onKeyDown),a.key===Bf.Space&&(t.select(),(l=t.inputRef())==null||l.focus())}},()=>t.dataset(),i))}function B1(e){const t=ja(),n=De({id:t.generateId("description")},e);return pe(()=>be(t.registerDescription(n.id))),M(Ze,_e({as:"div"},()=>t.dataset(),n))}function q1(e){const t=ja(),n=De({id:t.generateId("indicator")},e),[r,i]=qe(n,["ref","forceMount"]),[s,o]=ee(),{present:a}=b1({show:()=>r.forceMount||t.isSelected(),element:()=>{var l;return(l=s())!=null?l:null}});return M(ye,{get when(){return a()},get children(){return M(Ze,_e({as:"div",ref(l){const c=$t(o,r.ref);typeof c=="function"&&c(l)}},()=>t.dataset(),i))}})}function z1(e){const t=Pa(),n=I1(),r=ja(),i=De({id:r.generateId("input")},e),[s,o]=qe(i,["ref","style","aria-labelledby","aria-describedby","onChange","onFocus","onBlur"]),a=()=>[s["aria-labelledby"],r.labelId(),s["aria-labelledby"]!=null&&o["aria-label"]!=null?o.id:void 0].filter(Boolean).join(" ")||void 0,l=()=>[s["aria-describedby"],r.descriptionId(),n.ariaDescribedBy()].filter(Boolean).join(" ")||void 0,[c,u]=ee(!1),d=g=>{if(Xe(g,s.onChange),g.stopPropagation(),!c()){n.setSelectedValue(r.value());const m=g.target;m.checked=r.isSelected()}u(!1)},f=g=>{Xe(g,s.onFocus),r.setIsFocused(!0)},h=g=>{Xe(g,s.onBlur),r.setIsFocused(!1)};return pe(lr([()=>r.isSelected(),()=>r.value()],g=>{if(!g[0]&&g[1]===r.value())return;u(!0);const m=r.inputRef();m==null||m.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),m==null||m.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},{defer:!0})),pe(()=>be(r.registerInput(o.id))),M(Ze,_e({as:"input",ref(g){const m=$t(r.setInputRef,s.ref);typeof m=="function"&&m(g)},type:"radio",get name(){return t.name()},get value(){return r.value()},get checked(){return r.isSelected()},get required(){return t.isRequired()},get disabled(){return r.isDisabled()},get readonly(){return t.isReadOnly()},get style(){return Rc({...i1},s.style)},get"aria-labelledby"(){return a()},get"aria-describedby"(){return l()},onChange:d,onFocus:f,onBlur:h},()=>r.dataset(),o))}function H1(e){const t=ja(),n=De({id:t.generateId("label")},e);return pe(()=>be(t.registerLabel(n.id))),M(Ze,_e({as:"label",get for(){return t.inputId()}},()=>t.dataset(),n))}function U1(e){return M(Dj,_e({as:"span"},e))}function K1(e){let t;const n=`radiogroup-${fn()}`,r=De({id:n,orientation:"vertical"},e),[i,s,o]=qe(r,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],$j),[a,l]=Ma({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:g=>{var m;return(m=i.onChange)==null?void 0:m.call(i,g)}}),{formControlContext:c}=jj(s);Lj(()=>t,()=>{var g;return l((g=i.defaultValue)!=null?g:"")});const u=()=>c.getAriaLabelledBy(U(s.id),o["aria-label"],i["aria-labelledby"]),d=()=>c.getAriaDescribedBy(i["aria-describedby"]),f=g=>g===a(),h={ariaDescribedBy:d,isSelectedValue:f,setSelectedValue:g=>{if(!(c.isReadOnly()||c.isDisabled())&&(l(g),t))for(const m of t.querySelectorAll("[type='radio']")){const p=m;p.checked=f(p.value)}}};return M(s1.Provider,{value:c,get children(){return M(L1.Provider,{value:h,get children(){return M(Ze,_e({as:"div",ref(g){const m=$t(p=>t=p,i.ref);typeof m=="function"&&m(g)},role:"radiogroup",get id(){return U(s.id)},get"aria-invalid"(){return c.validationState()==="invalid"||void 0},get"aria-required"(){return c.isRequired()||void 0},get"aria-disabled"(){return c.isDisabled()||void 0},get"aria-readonly"(){return c.isReadOnly()||void 0},get"aria-orientation"(){return i.orientation},get"aria-labelledby"(){return u()},get"aria-describedby"(){return d()}},()=>c.dataset(),o))}})}})}var kD=Object.assign(K1,{Description:o1,ErrorMessage:a1,Item:F1,ItemControl:N1,ItemDescription:B1,ItemIndicator:q1,ItemInput:z1,ItemLabel:H1,Label:U1}),ED=class{constructor(e,t,n){ge(this,"collection");ge(this,"ref");ge(this,"collator");this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){var t,n,r;return(r=(n=(t=this.ref)==null?void 0:t.call(this))==null?void 0:n.querySelector(`[data-key="${e}"]`))!=null?r:null}getKeyPageAbove(e){var s;const t=(s=this.ref)==null?void 0:s.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop>r;)i=this.getKeyAbove(i),n=i!=null?this.getItem(i):null;return i}getKeyPageBelow(e){var s;const t=(s=this.ref)==null?void 0:s.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop<r;)i=this.getKeyBelow(i),n=i!=null?this.getItem(i):null;return i}getKeyForSearch(e,t){var i;const n=(i=this.collator)==null?void 0:i.call(this);if(!n)return;let r=t!=null?this.getKeyBelow(t):this.getFirstKey();for(;r!=null;){const s=this.collection().getItem(r);if(s){const o=s.textValue.slice(0,e.length);if(s.textValue&&n.compare(o,e)===0)return r}r=this.getKeyBelow(r)}}};function OD(e,t,n){const r=n6({usage:"search",sensitivity:"base"}),i=B(()=>{const s=U(e.keyboardDelegate);return s||new ED(e.collection,t,r)});return c6({selectionManager:()=>U(e.selectionManager),keyboardDelegate:i,autoFocus:()=>U(e.autoFocus),deferAutoFocus:()=>U(e.deferAutoFocus),shouldFocusWrap:()=>U(e.shouldFocusWrap),disallowEmptySelection:()=>U(e.disallowEmptySelection),selectOnFocus:()=>U(e.selectOnFocus),disallowTypeAhead:()=>U(e.disallowTypeAhead),shouldUseVirtualFocus:()=>U(e.shouldUseVirtualFocus),allowsTabNavigation:()=>U(e.allowsTabNavigation),isVirtualized:()=>U(e.isVirtualized),scrollToKey:s=>{var o;return(o=U(e.scrollToKey))==null?void 0:o(s)},orientation:()=>U(e.orientation)},t)}var ju="focusScope.autoFocusOnMount",Du="focusScope.autoFocusOnUnmount",Um={bubbles:!1,cancelable:!0},Km={stack:[],active(){return this.stack[0]},add(e){var t;e!==this.active()&&((t=this.active())==null||t.pause()),this.stack=Ud(this.stack,e),this.stack.unshift(e)},remove(e){var t;this.stack=Ud(this.stack,e),(t=this.active())==null||t.resume()}};function AD(e,t){const[n,r]=ee(!1),i={pause(){r(!0)},resume(){r(!1)}};let s=null;const o=g=>{var m;return(m=e.onMountAutoFocus)==null?void 0:m.call(e,g)},a=g=>{var m;return(m=e.onUnmountAutoFocus)==null?void 0:m.call(e,g)},l=()=>Fn(t()),c=()=>{const g=l().createElement("span");return g.setAttribute("data-focus-trap",""),g.tabIndex=0,Object.assign(g.style,i1),g},u=()=>{const g=t();return g?n1(g,!0).filter(m=>!m.hasAttribute("data-focus-trap")):[]},d=()=>{const g=u();return g.length>0?g[0]:null},f=()=>{const g=u();return g.length>0?g[g.length-1]:null},h=()=>{const g=t();if(!g)return!1;const m=vo(g);return!m||ln(g,m)?!1:r1(m)};pe(()=>{const g=t();if(!g)return;Km.add(i);const m=vo(g);if(!ln(g,m)){const b=new CustomEvent(ju,Um);g.addEventListener(ju,o),g.dispatchEvent(b),b.defaultPrevented||setTimeout(()=>{St(d()),vo(g)===m&&St(g)},0)}be(()=>{g.removeEventListener(ju,o),setTimeout(()=>{const b=new CustomEvent(Du,Um);h()&&b.preventDefault(),g.addEventListener(Du,a),g.dispatchEvent(b),b.defaultPrevented||St(m!=null?m:l().body),g.removeEventListener(Du,a),Km.remove(i)},0)})}),pe(()=>{const g=t();if(!g||!U(e.trapFocus)||n())return;const m=b=>{const v=b.target;v!=null&&v.closest(`[${ic}]`)||(ln(g,v)?s=v:St(s))},p=b=>{const v=b.relatedTarget,S=v!=null?v:vo(g);S!=null&&S.closest(`[${ic}]`)||ln(g,S)||St(s)};l().addEventListener("focusin",m),l().addEventListener("focusout",p),be(()=>{l().removeEventListener("focusin",m),l().removeEventListener("focusout",p)})}),pe(()=>{const g=t();if(!g||!U(e.trapFocus)||n())return;const m=c();g.insertAdjacentElement("afterbegin",m);const p=c();g.insertAdjacentElement("beforeend",p);function b(S){const w=d(),x=f();S.relatedTarget===w?St(x):St(w)}m.addEventListener("focusin",b),p.addEventListener("focusin",b);const v=new MutationObserver(S=>{for(const w of S)w.previousSibling===p&&(p.remove(),g.insertAdjacentElement("beforeend",p)),w.nextSibling===m&&(m.remove(),g.insertAdjacentElement("afterbegin",m))});v.observe(g,{childList:!0,subtree:!1}),be(()=>{m.removeEventListener("focusin",b),p.removeEventListener("focusin",b),m.remove(),p.remove(),v.disconnect()})})}var TD="data-live-announcer";function PD(e){pe(()=>{U(e.isDisabled)||be(MD(U(e.targets),U(e.root)))})}var ao=new WeakMap,tn=[];function MD(e,t=document.body){const n=new Set(e),r=new Set,i=l=>{for(const f of l.querySelectorAll(`[${TD}], [${ic}]`))n.add(f);const c=f=>{if(n.has(f)||f.parentElement&&r.has(f.parentElement)&&f.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const h of n)if(f.contains(h))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},u=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:c}),d=c(l);if(d===NodeFilter.FILTER_ACCEPT&&s(l),d!==NodeFilter.FILTER_REJECT){let f=u.nextNode();for(;f!=null;)s(f),f=u.nextNode()}},s=l=>{var u;const c=(u=ao.get(l))!=null?u:0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),ao.set(l,c+1))};tn.length&&tn[tn.length-1].disconnect(),i(t);const o=new MutationObserver(l=>{for(const c of l)if(!(c.type!=="childList"||c.addedNodes.length===0)&&![...n,...r].some(u=>u.contains(c.target))){for(const u of c.removedNodes)u instanceof Element&&(n.delete(u),r.delete(u));for(const u of c.addedNodes)(u instanceof HTMLElement||u instanceof SVGElement)&&(u.dataset.liveAnnouncer==="true"||u.dataset.reactAriaTopLayer==="true")?n.add(u):u instanceof Element&&i(u)}});o.observe(t,{childList:!0,subtree:!0});const a={observe(){o.observe(t,{childList:!0,subtree:!0})},disconnect(){o.disconnect()}};return tn.push(a),()=>{o.disconnect();for(const l of r){const c=ao.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),ao.delete(l)):ao.set(l,c-1)}a===tn[tn.length-1]?(tn.pop(),tn.length&&tn[tn.length-1].observe()):tn.splice(tn.indexOf(a),1)}}var ml=new Map,$D=e=>{pe(()=>{var s,o;const t=(s=wt(e.style))!=null?s:{},n=(o=wt(e.properties))!=null?o:[],r={};for(const a in t)r[a]=e.element.style[a];const i=ml.get(e.key);i?i.activeCount++:ml.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(a=>a.key)}),Object.assign(e.element.style,e.style);for(const a of n)e.element.style.setProperty(a.key,a.value);be(()=>{var l;const a=ml.get(e.key);if(a){if(a.activeCount!==1){a.activeCount--;return}ml.delete(e.key);for(const[c,u]of Object.entries(a.originalStyles))e.element.style[c]=u;for(const c of a.properties)e.element.style.removeProperty(c);e.element.style.length===0&&e.element.removeAttribute("style"),(l=e.cleanup)==null||l.call(e)}})})},Wm=$D,jD=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},DD=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},LD=(e,t,n)=>{var l;const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let i=e,s=0,o=0,a=!1;do{const[c,u,d]=jD(i,t),f=d-c-r*u;(u!==0||f!==0)&&DD(i,t)&&(s+=f,o+=u),i===(n!=null?n:document.documentElement)?a=!0:i=(l=i._$host)!=null?l:i.parentElement}while(i&&!a);return[s,o]},[Vm,Gm]=ee([]),ID=e=>Vm().indexOf(e)===Vm().length-1,RD=e=>{const t=_e({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=fn();let r=[0,0],i=null,s=null;pe(()=>{wt(t.enabled)&&(Gm(c=>[...c,n]),be(()=>{Gm(c=>c.filter(u=>u!==n))}))}),pe(()=>{if(!wt(t.enabled)||!wt(t.hideScrollbar))return;const{body:c}=document,u=window.innerWidth-c.offsetWidth;if(wt(t.preventScrollbarShift)){const d={overflow:"hidden"},f=[];u>0&&(wt(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${u}px)`:d.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${u}px)`,f.push({key:"--scrollbar-width",value:`${u}px`}));const h=window.scrollY,g=window.scrollX;Wm({key:"prevent-scroll",element:c,style:d,properties:f,cleanup:()=>{wt(t.restoreScrollPosition)&&u>0&&window.scrollTo(g,h)}})}else Wm({key:"prevent-scroll",element:c,style:{overflow:"hidden"}})}),pe(()=>{!ID(n)||!wt(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",o,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),be(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",o),document.removeEventListener("touchmove",l)}))});const o=c=>{r=Qm(c),i=null,s=null},a=c=>{const u=c.target,d=wt(t.element),f=FD(c),h=Math.abs(f[0])>Math.abs(f[1])?"x":"y",g=h==="x"?f[0]:f[1],m=Ym(u,h,g,d);let p;d&&Xd(d,u)?p=!m:p=!0,p&&c.cancelable&&c.preventDefault()},l=c=>{const u=wt(t.element),d=c.target;let f;if(c.touches.length===2)f=!wt(t.allowPinchZoom);else{if(i==null||s===null){const h=Qm(c).map((m,p)=>r[p]-m),g=Math.abs(h[0])>Math.abs(h[1])?"x":"y";i=g,s=g==="x"?h[0]:h[1]}if(d.type==="range")f=!1;else{const h=Ym(d,i,s,u);u&&Xd(u,d)?f=!h:f=!0}}f&&c.cancelable&&c.preventDefault()}},FD=e=>[e.deltaX,e.deltaY],Qm=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],Ym=(e,t,n,r)=>{const i=r!==null&&Xd(r,e),[s,o]=LD(e,t,i?r:void 0);return!(n>0&&Math.abs(s)<=1||n<0&&Math.abs(o)<1)},Xd=(e,t)=>{var r;if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=(r=n._$host)!=null?r:n.parentElement}return!1},ND=RD,BD=ND,W1=pt();function V1(){return bt(W1)}function hr(){const e=V1();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var G1=pt();function eh(){const e=bt(G1);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var Q1=pt();function Hn(){const e=bt(Q1);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function th(e){let t;const n=Hn(),r=hr(),i=De({id:n.generateId(`item-${fn()}`)},e),[s,o]=qe(i,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=ee(),[c,u]=ee(),[d,f]=ee(),h=()=>r.listState().selectionManager(),g=()=>o.id,m=()=>h().focusedKey()===g(),p=()=>{var k;(k=s.onSelect)==null||k.call(s),s.closeOnSelect&&setTimeout(()=>{r.close(!0)})};Gj({getItem:()=>{var k,P,$,j,Z;return{ref:()=>t,type:"item",key:g(),textValue:(j=($=(P=s.textValue)!=null?P:(k=d())==null?void 0:k.textContent)!=null?$:t==null?void 0:t.textContent)!=null?j:"",disabled:(Z=s.disabled)!=null?Z:!1}}});const b=p1({key:g,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),v=k=>{Xe(k,s.onPointerMove),k.pointerType==="mouse"&&(s.disabled?r.onItemLeave(k):(r.onItemEnter(k),k.defaultPrevented||(St(k.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(g()))))},S=k=>{Xe(k,s.onPointerLeave),k.pointerType==="mouse"&&r.onItemLeave(k)},w=k=>{Xe(k,s.onPointerUp),!s.disabled&&k.button===0&&p()},x=k=>{if(Xe(k,s.onKeyDown),!k.repeat&&!s.disabled)switch(k.key){case"Enter":case" ":p();break}},_=B(()=>{if(s.indeterminate)return"mixed";if(s.checked!=null)return s.checked}),C=B(()=>({"data-indeterminate":s.indeterminate?"":void 0,"data-checked":s.checked&&!s.indeterminate?"":void 0,"data-disabled":s.disabled?"":void 0,"data-highlighted":m()?"":void 0})),A={isChecked:()=>s.checked,dataset:C,setLabelRef:f,generateId:Ta(()=>o.id),registerLabel:cn(l),registerDescription:cn(u)};return M(G1.Provider,{value:A,get children(){return M(Ze,_e({as:"div",ref(k){const P=$t($=>t=$,s.ref);typeof P=="function"&&P(k)},get tabIndex(){return b.tabIndex()},get"aria-checked"(){return _()},get"aria-disabled"(){return s.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return b.dataKey()},get onPointerDown(){return ht([s.onPointerDown,b.onPointerDown])},get onPointerUp(){return ht([w,b.onPointerUp])},get onClick(){return ht([s.onClick,b.onClick])},get onKeyDown(){return ht([x,b.onKeyDown])},get onMouseDown(){return ht([s.onMouseDown,b.onMouseDown])},get onFocus(){return ht([s.onFocus,b.onFocus])},onPointerMove:v,onPointerLeave:S},C,o))}})}function Y1(e){const t=De({closeOnSelect:!1},e),[n,r]=qe(t,["checked","defaultChecked","onChange","onSelect"]),i=Nj({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:o=>{var a;return(a=n.onChange)==null?void 0:a.call(n,o)},isDisabled:()=>r.disabled});return M(th,_e({role:"menuitemcheckbox",get checked(){return i.isSelected()},onSelect:()=>{var o;(o=n.onSelect)==null||o.call(n),i.toggle()}},r))}var qD=pt();function Hc(){return bt(qD)}var ia={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>ia.next(e==="ltr"?"rtl":"ltr",t)},Xm={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function X1(e){const t=Hn(),n=hr(),r=Hc(),{direction:i}=Kr(),s=De({id:t.generateId("trigger")},e),[o,a]=qe(s,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();r!==void 0&&(l=()=>{var b;return(b=t.value())!=null?b:o.id},r.lastValue()===void 0&&r.setLastValue(l));const c=Nc(()=>n.triggerRef(),()=>"button"),u=B(()=>{var b;return c()==="a"&&((b=n.triggerRef())==null?void 0:b.getAttribute("href"))!=null});pe(lr(()=>r==null?void 0:r.value(),b=>{var v;u()&&b===l()&&((v=n.triggerRef())==null||v.focus())}));const d=()=>{r!==void 0?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)},f=b=>{Xe(b,o.onPointerDown),b.currentTarget.dataset.pointerType=b.pointerType,!o.disabled&&b.pointerType!=="touch"&&b.button===0&&d()},h=b=>{Xe(b,o.onClick),o.disabled||b.currentTarget.dataset.pointerType==="touch"&&d()},g=b=>{if(Xe(b,o.onKeyDown),!o.disabled){if(u())switch(b.key){case"Enter":case" ":return}switch(b.key){case"Enter":case" ":case Xm.first(t.orientation()):b.stopPropagation(),b.preventDefault(),Mj(b.currentTarget),n.open("first"),r==null||r.setAutoFocusMenu(!0),r==null||r.setValue(l);break;case Xm.last(t.orientation()):b.stopPropagation(),b.preventDefault(),n.open("last");break;case ia.next(i(),t.orientation()):if(r===void 0)break;b.stopPropagation(),b.preventDefault(),r.nextMenu();break;case ia.previous(i(),t.orientation()):if(r===void 0)break;b.stopPropagation(),b.preventDefault(),r.previousMenu();break}}},m=b=>{var v;Xe(b,o.onMouseOver),((v=n.triggerRef())==null?void 0:v.dataset.pointerType)!=="touch"&&!o.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(l)},p=b=>{Xe(b,o.onFocus),r!==void 0&&b.currentTarget.dataset.pointerType!=="touch"&&r.setValue(l)};return pe(()=>be(n.registerTriggerId(o.id))),M(Kf,_e({ref(b){const v=$t(n.setTriggerRef,o.ref);typeof v=="function"&&v(b)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return o.id},get disabled(){return o.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return B(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return l()!==void 0&&(r==null?void 0:r.value())===l()?!0:void 0},get tabIndex(){return r!==void 0?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:f,onMouseOver:m,onClick:h,onKeyDown:g,onFocus:p,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),a))}var zD=pt();function J1(){return bt(zD)}function Z1(e){let t;const n=Hn(),r=hr(),i=Hc(),s=J1(),{direction:o}=Kr(),a=De({id:n.generateId(`content-${fn()}`)},e),[l,c]=qe(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let u=0;const d=()=>r.parentMenuContext()==null&&i===void 0&&n.isModal(),f=OD({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>n.orientation()==="horizontal"?"vertical":"horizontal"},()=>t);AD({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:S=>{var w;i===void 0&&((w=l.onOpenAutoFocus)==null||w.call(l,S))},onUnmountAutoFocus:l.onCloseAutoFocus},()=>t);const h=S=>{if(ln(S.currentTarget,S.target)&&(S.key==="Tab"&&r.isOpen()&&S.preventDefault(),i!==void 0&&S.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(S.key){case ia.next(o(),n.orientation()):S.stopPropagation(),S.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.nextMenu();break;case ia.previous(o(),n.orientation()):if(S.currentTarget.hasAttribute("data-closed"))break;S.stopPropagation(),S.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.previousMenu();break}},g=S=>{var w;(w=l.onEscapeKeyDown)==null||w.call(l,S),i==null||i.setAutoFocusMenu(!1),r.close(!0)},m=S=>{var w;(w=l.onFocusOutside)==null||w.call(l,S),n.isModal()&&S.preventDefault()},p=S=>{var w,x;Xe(S,l.onPointerEnter),r.isOpen()&&((w=r.parentMenuContext())==null||w.listState().selectionManager().setFocused(!1),(x=r.parentMenuContext())==null||x.listState().selectionManager().setFocusedKey(void 0))},b=S=>{if(Xe(S,l.onPointerMove),S.pointerType!=="mouse")return;const w=S.target,x=u!==S.clientX;ln(S.currentTarget,w)&&x&&(r.setPointerDir(S.clientX>u?"right":"left"),u=S.clientX)};pe(()=>be(r.registerContentId(l.id)));const v={ref:$t(S=>{r.setContentRef(S),t=S},l.ref),role:"menu",get id(){return l.id},get tabIndex(){return f.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:ht([l.onKeyDown,f.onKeyDown,h]),onMouseDown:ht([l.onMouseDown,f.onMouseDown]),onFocusIn:ht([l.onFocusIn,f.onFocusIn]),onFocusOut:ht([l.onFocusOut,f.onFocusOut]),onPointerEnter:p,onPointerMove:b,get"data-orientation"(){return n.orientation()}};return M(ye,{get when(){return r.contentPresent()},get children(){return M(ye,{get when(){return s===void 0||r.parentMenuContext()!=null},get fallback(){return M(Ze,_e({as:"div"},()=>r.dataset(),v,c))},get children(){return M($1.Positioner,{get children(){return M(_D,_e({get disableOutsidePointerEvents(){return B(()=>!!d())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return Rc({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:g,onFocusOutside:m,get onDismiss(){return r.close}},()=>r.dataset(),v,c))}})}})}})}function HD(e){let t;const n=Hn(),r=hr(),[i,s]=qe(e,["ref"]);return BD({element:()=>t!=null?t:null,enabled:()=>r.contentPresent()&&n.preventScroll()}),M(Z1,_e({ref(o){const a=$t(l=>{t=l},i.ref);typeof a=="function"&&a(o)}},s))}var ex=pt();function UD(){const e=bt(ex);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function nh(e){const t=Hn(),n=De({id:t.generateId(`group-${fn()}`)},e),[r,i]=ee(),s={generateId:Ta(()=>n.id),registerLabelId:cn(i)};return M(ex.Provider,{value:s,get children(){return M(Ze,_e({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function tx(e){const t=UD(),n=De({id:t.generateId("label")},e),[r,i]=qe(n,["id"]);return pe(()=>be(t.registerLabelId(r.id))),M(Ze,_e({as:"span",get id(){return r.id},"aria-hidden":"true"},i))}function nx(e){const t=hr(),n=De({children:"โ–ผ"},e);return M(Ze,_e({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function rx(e){return M(th,_e({role:"menuitem",closeOnSelect:!0},e))}function ix(e){const t=eh(),n=De({id:t.generateId("description")},e),[r,i]=qe(n,["id"]);return pe(()=>be(t.registerDescription(r.id))),M(Ze,_e({as:"div",get id(){return r.id}},()=>t.dataset(),i))}function sx(e){const t=eh(),n=De({id:t.generateId("indicator")},e),[r,i]=qe(n,["forceMount"]);return M(ye,{get when(){return r.forceMount||t.isChecked()},get children(){return M(Ze,_e({as:"div"},()=>t.dataset(),i))}})}function ox(e){const t=eh(),n=De({id:t.generateId("label")},e),[r,i]=qe(n,["ref","id"]);return pe(()=>be(t.registerLabel(r.id))),M(Ze,_e({as:"div",ref(s){const o=$t(t.setLabelRef,r.ref);typeof o=="function"&&o(s)},get id(){return r.id}},()=>t.dataset(),i))}function ax(e){const t=hr();return M(ye,{get when(){return t.contentPresent()},get children(){return M(M0,e)}})}var lx=pt();function KD(){const e=bt(lx);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function cx(e){const n=Hn().generateId(`radiogroup-${fn()}`),r=De({id:n},e),[i,s]=qe(r,["value","defaultValue","onChange","disabled"]),[o,a]=Ma({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:c=>{var u;return(u=i.onChange)==null?void 0:u.call(i,c)}}),l={isDisabled:()=>i.disabled,isSelectedValue:c=>c===o(),setSelectedValue:a};return M(lx.Provider,{value:l,get children(){return M(nh,s)}})}function ux(e){const t=KD(),n=De({closeOnSelect:!1},e),[r,i]=qe(n,["value","onSelect"]);return M(th,_e({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{var o;(o=r.onSelect)==null||o.call(r),t.setSelectedValue(r.value)}},i))}function WD(e,t,n){const r=e.split("-")[0],i=n.getBoundingClientRect(),s=[],o=t.clientX,a=t.clientY;switch(r){case"top":s.push([o,a+5]),s.push([i.left,i.bottom]),s.push([i.left,i.top]),s.push([i.right,i.top]),s.push([i.right,i.bottom]);break;case"right":s.push([o-5,a]),s.push([i.left,i.top]),s.push([i.right,i.top]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]);break;case"bottom":s.push([o,a-5]),s.push([i.right,i.top]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]),s.push([i.left,i.top]);break;case"left":s.push([o+5,a]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]),s.push([i.left,i.top]),s.push([i.right,i.top]);break}return s}function VD(e,t){return t?Pj([e.clientX,e.clientY],t):!1}function dx(e){const t=Hn(),n=u1(),r=V1(),i=Hc(),s=J1(),o=De({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[a,l]=qe(o,["open","defaultOpen","onOpenChange"]);let c=0,u=null,d="right";const[f,h]=ee(),[g,m]=ee(),[p,b]=ee(),[v,S]=ee(),[w,x]=ee(!0),[_,C]=ee(l.placement),[A,k]=ee([]),[P,$]=ee([]),{DomCollectionProvider:j}=Vj({items:P,onItemsChange:$}),Z=D1({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:X=>{var ve;return(ve=a.onOpenChange)==null?void 0:ve.call(a,X)}}),{present:q}=b1({show:()=>t.forceMount()||Z.isOpen(),element:()=>{var X;return(X=v())!=null?X:null}}),N=d6({selectionMode:"none",dataSource:P}),L=X=>{x(X),Z.open()},F=(X=!1)=>{Z.close(),X&&r&&r.close(!0)},se=X=>{x(X),Z.toggle()},de=()=>{const X=v();X&&(St(X),N.selectionManager().setFocused(!0),N.selectionManager().setFocusedKey(void 0))},R=()=>{s!=null?setTimeout(()=>de()):de()},K=X=>{k(xe=>[...xe,X]);const ve=r==null?void 0:r.registerNestedMenu(X);return()=>{k(xe=>Ud(xe,X)),ve==null||ve()}},ae=X=>d===(u==null?void 0:u.side)&&VD(X,u==null?void 0:u.area),fe=X=>{ae(X)&&X.preventDefault()},D=X=>{ae(X)||R()},le=X=>{ae(X)&&X.preventDefault()};PD({isDisabled:()=>!(r==null&&Z.isOpen()&&t.isModal()),targets:()=>[v(),...A()].filter(Boolean)}),pe(()=>{const X=v();if(!X||!r)return;const ve=r.registerNestedMenu(X);be(()=>{ve()})}),pe(()=>{r===void 0&&(i==null||i.registerMenu(t.value(),[v(),...A()]))}),pe(()=>{var X;r!==void 0||i===void 0||(i.value()===t.value()?((X=p())==null||X.focus(),i.autoFocusMenu()&&L(!0)):F())}),pe(()=>{r!==void 0||i===void 0||Z.isOpen()&&i.setValue(t.value())}),be(()=>{r===void 0&&(i==null||i.unregisterMenu(t.value()))});const we={dataset:B(()=>({"data-expanded":Z.isOpen()?"":void 0,"data-closed":Z.isOpen()?void 0:""})),isOpen:Z.isOpen,contentPresent:q,nestedMenus:A,currentPlacement:_,pointerGraceTimeoutId:()=>c,autoFocus:w,listState:()=>N,parentMenuContext:()=>r,triggerRef:p,contentRef:v,triggerId:f,contentId:g,setTriggerRef:b,setContentRef:S,open:L,close:F,toggle:se,focusContent:R,onItemEnter:fe,onItemLeave:D,onTriggerLeave:le,setPointerDir:X=>d=X,setPointerGraceTimeoutId:X=>c=X,setPointerGraceIntent:X=>u=X,registerNestedMenu:K,registerItemToParentDomCollection:n==null?void 0:n.registerItem,registerTriggerId:cn(h),registerContentId:cn(m)};return M(j,{get children(){return M(W1.Provider,{value:we,get children(){return M(ye,{when:s===void 0,get fallback(){return l.children},get children(){return M($1,_e({anchorRef:p,contentRef:v,onCurrentPlacementChange:C},l))}})}})}})}function fx(e){const{direction:t}=Kr();return M(dx,_e({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var GD={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function hx(e){const t=hr(),n=Hn(),[r,i]=qe(e,["onFocusOutside","onKeyDown"]),{direction:s}=Kr();return M(Z1,_e({onOpenAutoFocus:u=>{u.preventDefault()},onCloseAutoFocus:u=>{u.preventDefault()},onFocusOutside:u=>{var f;(f=r.onFocusOutside)==null||f.call(r,u);const d=u.target;ln(t.triggerRef(),d)||t.close()},onKeyDown:u=>{Xe(u,r.onKeyDown);const d=ln(u.currentTarget,u.target),f=GD.close(s(),n.orientation()).includes(u.key),h=t.parentMenuContext()!=null;d&&f&&h&&(t.close(),St(t.triggerRef()))}},i))}var Jm=["Enter"," "],QD={open:(e,t)=>e==="ltr"?[...Jm,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...Jm,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function gx(e){let t;const n=Hn(),r=hr(),i=De({id:n.generateId(`sub-trigger-${fn()}`)},e),[s,o]=qe(i,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let a=null;const l=()=>{a&&window.clearTimeout(a),a=null},{direction:c}=Kr(),u=()=>s.id,d=()=>{const S=r.parentMenuContext();if(S==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return S.listState().selectionManager()},f=()=>r.listState().collection(),h=()=>d().focusedKey()===u(),g=p1({key:u,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),m=S=>{Xe(S,s.onClick),!r.isOpen()&&!s.disabled&&r.open(!0)},p=S=>{var x;if(Xe(S,s.onPointerMove),S.pointerType!=="mouse")return;const w=r.parentMenuContext();if(w==null||w.onItemEnter(S),!S.defaultPrevented){if(s.disabled){w==null||w.onItemLeave(S);return}!r.isOpen()&&!a&&((x=r.parentMenuContext())==null||x.setPointerGraceIntent(null),a=window.setTimeout(()=>{r.open(!1),l()},100)),w==null||w.onItemEnter(S),S.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),St(S.currentTarget),w==null||w.listState().selectionManager().setFocused(!0),w==null||w.listState().selectionManager().setFocusedKey(u()))}},b=S=>{if(Xe(S,s.onPointerLeave),S.pointerType!=="mouse")return;l();const w=r.parentMenuContext(),x=r.contentRef();if(x){w==null||w.setPointerGraceIntent({area:WD(r.currentPlacement(),S,x),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(w==null?void 0:w.pointerGraceTimeoutId());const _=window.setTimeout(()=>{w==null||w.setPointerGraceIntent(null)},300);w==null||w.setPointerGraceTimeoutId(_)}else{if(w==null||w.onTriggerLeave(S),S.defaultPrevented)return;w==null||w.setPointerGraceIntent(null)}w==null||w.onItemLeave(S)},v=S=>{Xe(S,s.onKeyDown),!S.repeat&&(s.disabled||QD.open(c(),n.orientation()).includes(S.key)&&(S.stopPropagation(),S.preventDefault(),d().setFocused(!1),d().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f().getFirstKey())))};return pe(()=>{var w,x,_;if(r.registerItemToParentDomCollection==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");const S=r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:u(),textValue:(x=(w=s.textValue)!=null?w:t==null?void 0:t.textContent)!=null?x:"",disabled:(_=s.disabled)!=null?_:!1});be(S)}),pe(lr(()=>{var S;return(S=r.parentMenuContext())==null?void 0:S.pointerGraceTimeoutId()},S=>{be(()=>{var w;window.clearTimeout(S),(w=r.parentMenuContext())==null||w.setPointerGraceIntent(null)})})),pe(()=>be(r.registerTriggerId(s.id))),be(()=>{l()}),M(Ze,_e({as:"div",ref(S){const w=$t(x=>{r.setTriggerRef(x),t=x},s.ref);typeof w=="function"&&w(S)},get id(){return s.id},role:"menuitem",get tabIndex(){return g.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return B(()=>!!r.isOpen())()?r.contentId():void 0},get"aria-disabled"(){return s.disabled},get"data-key"(){return g.dataKey()},get"data-highlighted"(){return h()?"":void 0},get"data-disabled"(){return s.disabled?"":void 0},get onPointerDown(){return ht([s.onPointerDown,g.onPointerDown])},get onPointerUp(){return ht([s.onPointerUp,g.onPointerUp])},get onClick(){return ht([m,g.onClick])},get onKeyDown(){return ht([v,g.onKeyDown])},get onMouseDown(){return ht([s.onMouseDown,g.onMouseDown])},get onFocus(){return ht([s.onFocus,g.onFocus])},onPointerMove:p,onPointerLeave:b},()=>r.dataset(),o))}function YD(e){const t=Hc(),n=`menu-${fn()}`,r=De({id:n,modal:!0},e),[i,s]=qe(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),o=D1({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:l=>{var c;return(c=i.onOpenChange)==null?void 0:c.call(i,l)}}),a={isModal:()=>{var l;return(l=i.modal)!=null?l:!0},preventScroll:()=>{var l;return(l=i.preventScroll)!=null?l:a.isModal()},forceMount:()=>{var l;return(l=i.forceMount)!=null?l:!1},generateId:Ta(()=>i.id),value:()=>i.value,orientation:()=>{var l,c;return(c=(l=i.orientation)!=null?l:t==null?void 0:t.orientation())!=null?c:"horizontal"}};return M(Q1.Provider,{value:a,get children(){return M(dx,_e({get open(){return o.isOpen()},get onOpenChange(){return o.setIsOpen}},s))}})}var XD={};Bc(XD,{Root:()=>Uc,Separator:()=>JD});function Uc(e){let t;const n=De({orientation:"horizontal"},e),[r,i]=qe(n,["ref","orientation"]),s=Nc(()=>t,()=>"hr");return M(Ze,_e({as:"hr",ref(o){const a=$t(l=>t=l,r.ref);typeof a=="function"&&a(o)},get role(){return s()!=="hr"?"separator":void 0},get"aria-orientation"(){return r.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return r.orientation}},i))}var JD=Uc,at={};Bc(at,{Arrow:()=>Zf,CheckboxItem:()=>Y1,Content:()=>yx,DropdownMenu:()=>ZD,Group:()=>nh,GroupLabel:()=>tx,Icon:()=>nx,Item:()=>rx,ItemDescription:()=>ix,ItemIndicator:()=>sx,ItemLabel:()=>ox,Portal:()=>ax,RadioGroup:()=>cx,RadioItem:()=>ux,Root:()=>mx,Separator:()=>Uc,Sub:()=>fx,SubContent:()=>hx,SubTrigger:()=>gx,Trigger:()=>X1});function yx(e){const t=Hn(),n=hr(),[r,i]=qe(e,["onCloseAutoFocus","onInteractOutside"]);let s=!1;return M(HD,_e({onCloseAutoFocus:l=>{var c;(c=r.onCloseAutoFocus)==null||c.call(r,l),s||St(n.triggerRef()),s=!1,l.preventDefault()},onInteractOutside:l=>{var c;(c=r.onInteractOutside)==null||c.call(r,l),(!t.isModal()||l.detail.isContextMenu)&&(s=!0)}},i))}function mx(e){const t=`dropdownmenu-${fn()}`,n=De({id:t},e);return M(YD,n)}var ZD=Object.assign(mx,{Arrow:Zf,CheckboxItem:Y1,Content:yx,Group:nh,GroupLabel:tx,Icon:nx,Item:rx,ItemDescription:ix,ItemIndicator:sx,ItemLabel:ox,Portal:ax,RadioGroup:cx,RadioItem:ux,Separator:Uc,Sub:fx,SubContent:hx,SubTrigger:gx,Trigger:X1}),z={colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000000",white:"#ffffff",neutral:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},darkGray:{50:"#525c7a",100:"#49536e",200:"#414962",300:"#394056",400:"#313749",500:"#292e3d",600:"#212530",700:"#191c24",800:"#111318",900:"#0b0d10"},gray:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},blue:{25:"#F5FAFF",50:"#EFF8FF",100:"#D1E9FF",200:"#B2DDFF",300:"#84CAFF",400:"#53B1FD",500:"#2E90FA",600:"#1570EF",700:"#175CD3",800:"#1849A9",900:"#194185"},green:{25:"#F6FEF9",50:"#ECFDF3",100:"#D1FADF",200:"#A6F4C5",300:"#6CE9A6",400:"#32D583",500:"#12B76A",600:"#039855",700:"#027A48",800:"#05603A",900:"#054F31"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},yellow:{25:"#FFFCF5",50:"#FFFAEB",100:"#FEF0C7",200:"#FEDF89",300:"#FEC84B",400:"#FDB022",500:"#F79009",600:"#DC6803",700:"#B54708",800:"#93370D",900:"#7A2E0E"},purple:{25:"#FAFAFF",50:"#F4F3FF",100:"#EBE9FE",200:"#D9D6FE",300:"#BDB4FE",400:"#9B8AFB",500:"#7A5AF8",600:"#6938EF",700:"#5925DC",800:"#4A1FB8",900:"#3E1C96"},teal:{25:"#F6FEFC",50:"#F0FDF9",100:"#CCFBEF",200:"#99F6E0",300:"#5FE9D0",400:"#2ED3B7",500:"#15B79E",600:"#0E9384",700:"#107569",800:"#125D56",900:"#134E48"},pink:{25:"#fdf2f8",50:"#fce7f3",100:"#fbcfe8",200:"#f9a8d4",300:"#f472b6",400:"#ec4899",500:"#db2777",600:"#be185d",700:"#9d174d",800:"#831843",900:"#500724"},cyan:{25:"#ecfeff",50:"#cffafe",100:"#a5f3fc",200:"#67e8f9",300:"#22d3ee",400:"#06b6d4",500:"#0891b2",600:"#0e7490",700:"#155e75",800:"#164e63",900:"#083344"}},alpha:{90:"e5",80:"cc"},font:{size:{xs:"calc(var(--tsqd-font-size) * 0.75)",sm:"calc(var(--tsqd-font-size) * 0.875)",md:"var(--tsqd-font-size)"},lineHeight:{xs:"calc(var(--tsqd-font-size) * 1)",sm:"calc(var(--tsqd-font-size) * 1.25)",md:"calc(var(--tsqd-font-size) * 1.5)"},weight:{medium:"500",semibold:"600",bold:"700"}},border:{radius:{xs:"calc(var(--tsqd-font-size) * 0.125)",sm:"calc(var(--tsqd-font-size) * 0.25)",full:"9999px"}},size:{.25:"calc(var(--tsqd-font-size) * 0.0625)",.5:"calc(var(--tsqd-font-size) * 0.125)",1:"calc(var(--tsqd-font-size) * 0.25)",1.5:"calc(var(--tsqd-font-size) * 0.375)",2:"calc(var(--tsqd-font-size) * 0.5)",2.5:"calc(var(--tsqd-font-size) * 0.625)",3:"calc(var(--tsqd-font-size) * 0.75)",3.5:"calc(var(--tsqd-font-size) * 0.875)",4:"calc(var(--tsqd-font-size) * 1)",4.5:"calc(var(--tsqd-font-size) * 1.125)",5:"calc(var(--tsqd-font-size) * 1.25)",6:"calc(var(--tsqd-font-size) * 1.5)",6.5:"calc(var(--tsqd-font-size) * 1.625)",14:"calc(var(--tsqd-font-size) * 3.5)"},shadow:{xs:(e="rgb(0 0 0 / 0.1)")=>"0 1px 2px 0 rgb(0 0 0 / 0.05)",sm:(e="rgb(0 0 0 / 0.1)")=>`0 1px 3px 0 ${e}, 0 1px 2px -1px ${e}`,md:(e="rgb(0 0 0 / 0.1)")=>`0 4px 6px -1px ${e}, 0 2px 4px -2px ${e}`,lg:(e="rgb(0 0 0 / 0.1)")=>`0 10px 15px -3px ${e}, 0 4px 6px -4px ${e}`,xl:(e="rgb(0 0 0 / 0.1)")=>`0 20px 25px -5px ${e}, 0 8px 10px -6px ${e}`,"2xl":(e="rgb(0 0 0 / 0.25)")=>`0 25px 50px -12px ${e}`,inner:(e="rgb(0 0 0 / 0.05)")=>`inset 0 2px 4px 0 ${e}`,none:()=>"none"}},eL=oe('<svg width=14 height=14 viewBox="0 0 14 14"fill=none xmlns=http://www.w3.org/2000/svg><path d="M13 13L9.00007 9M10.3333 5.66667C10.3333 8.244 8.244 10.3333 5.66667 10.3333C3.08934 10.3333 1 8.244 1 5.66667C1 3.08934 3.08934 1 5.66667 1C8.244 1 10.3333 3.08934 10.3333 5.66667Z"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),tL=oe('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 3H15M3 6H21M19 6L18.2987 16.5193C18.1935 18.0975 18.1409 18.8867 17.8 19.485C17.4999 20.0118 17.0472 20.4353 16.5017 20.6997C15.882 21 15.0911 21 13.5093 21H10.4907C8.90891 21 8.11803 21 7.49834 20.6997C6.95276 20.4353 6.50009 20.0118 6.19998 19.485C5.85911 18.8867 5.8065 18.0975 5.70129 16.5193L5 6M10 10.5V15.5M14 10.5V15.5"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),nL=oe('<svg width=10 height=6 viewBox="0 0 10 6"fill=none xmlns=http://www.w3.org/2000/svg><path d="M1 1L5 5L9 1"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),rL=oe('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 13.3333V2.66667M8 2.66667L4 6.66667M8 2.66667L12 6.66667"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),rh=oe('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 2.66667V13.3333M8 13.3333L4 9.33333M8 13.3333L12 9.33333"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),iL=oe('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2v2m0 16v2M4 12H2m4.314-5.686L4.9 4.9m12.786 1.414L19.1 4.9M6.314 17.69 4.9 19.104m12.786-1.414 1.414 1.414M22 12h-2m-3 0a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),sL=oe('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M22 15.844a10.424 10.424 0 0 1-4.306.925c-5.779 0-10.463-4.684-10.463-10.462 0-1.536.33-2.994.925-4.307A10.464 10.464 0 0 0 2 11.538C2 17.316 6.684 22 12.462 22c4.243 0 7.896-2.526 9.538-6.156Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),oL=oe('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 21h8m-4-4v4m-5.2-4h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 14.72 22 13.88 22 12.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 3 18.88 3 17.2 3H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 5.28 2 6.12 2 7.8v4.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 17 5.12 17 6.8 17Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),aL=oe('<svg stroke=currentColor fill=currentColor stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M0 0h24v24H0z"></path><path d="M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3a4.237 4.237 0 00-6 0zm-4-4l2 2a7.074 7.074 0 0110 0l2-2C15.14 9.14 8.87 9.14 5 13z">'),lL=oe('<svg stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M24 .01c0-.01 0-.01 0 0L0 0v24h24V.01zM0 0h24v24H0V0zm0 0h24v24H0V0z"></path><path d="M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7l2-2zm-4 4a9.793 9.793 0 00-4.49-2.56l3.53 3.53.96-.97zM2 3.05L5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24A9.684 9.684 0 005 13v.01L6.99 15a7.042 7.042 0 014.92-2.06L18.98 20l1.27-1.26L3.29 1.79 2 3.05zM9 17l3 3 3-3a4.237 4.237 0 00-6 0z">'),cL=oe('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.3951 19.3711L9.97955 20.6856C10.1533 21.0768 10.4368 21.4093 10.7958 21.6426C11.1547 21.8759 11.5737 22.0001 12.0018 22C12.4299 22.0001 12.8488 21.8759 13.2078 21.6426C13.5667 21.4093 13.8503 21.0768 14.024 20.6856L14.6084 19.3711C14.8165 18.9047 15.1664 18.5159 15.6084 18.26C16.0532 18.0034 16.5678 17.8941 17.0784 17.9478L18.5084 18.1C18.9341 18.145 19.3637 18.0656 19.7451 17.8713C20.1265 17.6771 20.4434 17.3763 20.6573 17.0056C20.8715 16.635 20.9735 16.2103 20.9511 15.7829C20.9286 15.3555 20.7825 14.9438 20.5307 14.5978L19.684 13.4344C19.3825 13.0171 19.2214 12.5148 19.224 12C19.2239 11.4866 19.3865 10.9864 19.6884 10.5711L20.5351 9.40778C20.787 9.06175 20.933 8.65007 20.9555 8.22267C20.978 7.79528 20.8759 7.37054 20.6618 7C20.4479 6.62923 20.131 6.32849 19.7496 6.13423C19.3681 5.93997 18.9386 5.86053 18.5129 5.90556L17.0829 6.05778C16.5722 6.11141 16.0577 6.00212 15.6129 5.74556C15.17 5.48825 14.82 5.09736 14.6129 4.62889L14.024 3.31444C13.8503 2.92317 13.5667 2.59072 13.2078 2.3574C12.8488 2.12408 12.4299 1.99993 12.0018 2C11.5737 1.99993 11.1547 2.12408 10.7958 2.3574C10.4368 2.59072 10.1533 2.92317 9.97955 3.31444L9.3951 4.62889C9.18803 5.09736 8.83798 5.48825 8.3951 5.74556C7.95032 6.00212 7.43577 6.11141 6.9251 6.05778L5.49066 5.90556C5.06499 5.86053 4.6354 5.93997 4.25397 6.13423C3.87255 6.32849 3.55567 6.62923 3.34177 7C3.12759 7.37054 3.02555 7.79528 3.04804 8.22267C3.07052 8.65007 3.21656 9.06175 3.46844 9.40778L4.3151 10.5711C4.61704 10.9864 4.77964 11.4866 4.77955 12C4.77964 12.5134 4.61704 13.0137 4.3151 13.4289L3.46844 14.5922C3.21656 14.9382 3.07052 15.3499 3.04804 15.7773C3.02555 16.2047 3.12759 16.6295 3.34177 17C3.55589 17.3706 3.8728 17.6712 4.25417 17.8654C4.63554 18.0596 5.06502 18.1392 5.49066 18.0944L6.92066 17.9422C7.43133 17.8886 7.94587 17.9979 8.39066 18.2544C8.83519 18.511 9.18687 18.902 9.3951 19.3711Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><path d="M12 15C13.6568 15 15 13.6569 15 12C15 10.3431 13.6568 9 12 9C10.3431 9 8.99998 10.3431 8.99998 12C8.99998 13.6569 10.3431 15 12 15Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),uL=oe('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M16 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V8M11.5 12.5L17 7M17 7H12M17 7V12M6.2 21H8.8C9.9201 21 10.4802 21 10.908 20.782C11.2843 20.5903 11.5903 20.2843 11.782 19.908C12 19.4802 12 18.9201 12 17.8V15.2C12 14.0799 12 13.5198 11.782 13.092C11.5903 12.7157 11.2843 12.4097 10.908 12.218C10.4802 12 9.92011 12 8.8 12H6.2C5.0799 12 4.51984 12 4.09202 12.218C3.71569 12.4097 3.40973 12.7157 3.21799 13.092C3 13.5198 3 14.0799 3 15.2V17.8C3 18.9201 3 19.4802 3.21799 19.908C3.40973 20.2843 3.71569 20.5903 4.09202 20.782C4.51984 21 5.07989 21 6.2 21Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),dL=oe('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path class=copier d="M8 8V5.2C8 4.0799 8 3.51984 8.21799 3.09202C8.40973 2.71569 8.71569 2.40973 9.09202 2.21799C9.51984 2 10.0799 2 11.2 2H18.8C19.9201 2 20.4802 2 20.908 2.21799C21.2843 2.40973 21.5903 2.71569 21.782 3.09202C22 3.51984 22 4.0799 22 5.2V12.8C22 13.9201 22 14.4802 21.782 14.908C21.5903 15.2843 21.2843 15.5903 20.908 15.782C20.4802 16 19.9201 16 18.8 16H16M5.2 22H12.8C13.9201 22 14.4802 22 14.908 21.782C15.2843 21.5903 15.5903 21.2843 15.782 20.908C16 20.4802 16 19.9201 16 18.8V11.2C16 10.0799 16 9.51984 15.782 9.09202C15.5903 8.71569 15.2843 8.40973 14.908 8.21799C14.4802 8 13.9201 8 12.8 8H5.2C4.0799 8 3.51984 8 3.09202 8.21799C2.71569 8.40973 2.40973 8.71569 2.21799 9.09202C2 9.51984 2 10.0799 2 11.2V18.8C2 19.9201 2 20.4802 2.21799 20.908C2.40973 21.2843 2.71569 21.5903 3.09202 21.782C3.51984 22 4.07989 22 5.2 22Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round stroke=currentColor>'),fL=oe('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M2.5 21.4998L8.04927 19.3655C8.40421 19.229 8.58168 19.1607 8.74772 19.0716C8.8952 18.9924 9.0358 18.901 9.16804 18.7984C9.31692 18.6829 9.45137 18.5484 9.72028 18.2795L21 6.99982C22.1046 5.89525 22.1046 4.10438 21 2.99981C19.8955 1.89525 18.1046 1.89524 17 2.99981L5.72028 14.2795C5.45138 14.5484 5.31692 14.6829 5.20139 14.8318C5.09877 14.964 5.0074 15.1046 4.92823 15.2521C4.83911 15.4181 4.77085 15.5956 4.63433 15.9506L2.5 21.4998ZM2.5 21.4998L4.55812 16.1488C4.7054 15.7659 4.77903 15.5744 4.90534 15.4867C5.01572 15.4101 5.1523 15.3811 5.2843 15.4063C5.43533 15.4351 5.58038 15.5802 5.87048 15.8703L8.12957 18.1294C8.41967 18.4195 8.56472 18.5645 8.59356 18.7155C8.61877 18.8475 8.58979 18.9841 8.51314 19.0945C8.42545 19.2208 8.23399 19.2944 7.85107 19.4417L2.5 21.4998Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),px=oe('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),hL=oe('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 9L15 15M15 9L9 15M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke=#F04438 stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),gL=oe('<svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 xmlns=http://www.w3.org/2000/svg><rect class=list width=20 height=20 y=2 x=2 rx=2></rect><line class=list-item y1=7 y2=7 x1=6 x2=18></line><line class=list-item y2=12 y1=12 x1=6 x2=18></line><line class=list-item y1=17 y2=17 x1=6 x2=18>'),yL=oe('<svg viewBox="0 0 24 24"height=20 width=20 fill=none xmlns=http://www.w3.org/2000/svg><path d="M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),mL=oe('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),pL=oe('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2V6M12 18V22M6 12H2M22 12H18M19.0784 19.0784L16.25 16.25M19.0784 4.99994L16.25 7.82837M4.92157 19.0784L7.75 16.25M4.92157 4.99994L7.75 7.82837"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><animateTransform attributeName=transform attributeType=XML type=rotate from=0 to=360 dur=2s repeatCount=indefinite>'),bL=oe('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M15 9L9 15M9 9L15 15M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),vL=oe('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.5 15V9M14.5 15V9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),xL=oe('<svg version=1.0 viewBox="0 0 633 633"><linearGradient x1=-666.45 x2=-666.45 y1=163.28 y2=163.99 gradientTransform="matrix(633 0 0 633 422177 -103358)"gradientUnits=userSpaceOnUse><stop stop-color=#6BDAFF offset=0></stop><stop stop-color=#F9FFB5 offset=.32></stop><stop stop-color=#FFA770 offset=.71></stop><stop stop-color=#FF7373 offset=1></stop></linearGradient><circle cx=316.5 cy=316.5 r=316.5></circle><defs><filter x=-137.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=316.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=316.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=316.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=272.2 y=308 width=176.9 height=129.3 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=272.2 y=308 width=176.9 height=129.3 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><line x1=436 x2=431 y1=403.2 y2=431.8 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=291 x2=280 y1=341.5 y2=403.5 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=332.9 x2=328.6 y1=384.1 y2=411.2 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><linearGradient x1=-670.75 x2=-671.59 y1=164.4 y2=164.49 gradientTransform="matrix(-184.16 -32.472 -11.461 64.997 -121359 -32126)"gradientUnits=userSpaceOnUse><stop stop-color=#EE2700 offset=0></stop><stop stop-color=#FF008E offset=1></stop></linearGradient><path d="m344.1 363 97.7 17.2c5.8 2.1 8.2 6.1 7.1 12.1s-4.7 9.2-11 9.9l-106-18.7-57.5-59.2c-3.2-4.8-2.9-9.1 0.8-12.8s8.3-4.4 13.7-2.1l55.2 53.6z"clip-rule=evenodd fill-rule=evenodd></path><line x1=428.2 x2=429.1 y1=384.5 y2=378 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=395.2 x2=396.1 y1=379.5 y2=373 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=362.2 x2=363.1 y1=373.5 y2=367.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=324.2 x2=328.4 y1=351.3 y2=347.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=303.2 x2=307.4 y1=331.3 y2=327.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line></g><defs><filter x=73.2 y=113.8 width=280.6 height=317.4 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=73.2 y=113.8 width=280.6 height=317.4 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-672.16 x2=-672.16 y1=165.03 y2=166.03 gradientTransform="matrix(-100.18 48.861 97.976 200.88 -83342 -93.059)"gradientUnits=userSpaceOnUse><stop stop-color=#A17500 offset=0></stop><stop stop-color=#5D2100 offset=1></stop></linearGradient><path d="m192.3 203c8.1 37.3 14 73.6 17.8 109.1 3.8 35.4 2.8 75.1-3 119.2l61.2-16.7c-15.6-59-25.2-97.9-28.6-116.6s-10.8-51.9-22.1-99.6l-25.3 4.6"clip-rule=evenodd fill-rule=evenodd></path><g stroke=#2F8A00><linearGradient x1=-660.23 x2=-660.23 y1=166.72 y2=167.72 gradientTransform="matrix(92.683 4.8573 -2.0259 38.657 61680 -3088.6)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9s-12.6-22.1-36.5-29.9c-15.9-5.2-34.4-1.5-55.5 11.1 15.9 14.3 29.5 22.6 40.7 24.9 16.8 3.6 51.3-6.1 51.3-6.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-661.36 x2=-661.36 y1=164.18 y2=165.18 gradientTransform="matrix(110 5.7648 -6.3599 121.35 73933 -15933)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5s-47.5-8.5-83.2 15.7c-23.8 16.2-34.3 49.3-31.6 99.4 30.3-27.8 52.1-48.5 65.2-61.9 19.8-20.2 49.6-53.2 49.6-53.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.79 x2=-656.79 y1=165.15 y2=166.15 gradientTransform="matrix(62.954 3.2993 -3.5023 66.828 42156 -8754.1)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9c-0.8-21.9 6-38 20.6-48.2s29.8-15.4 45.5-15.3c-6.1 21.4-14.5 35.8-25.2 43.4s-24.4 14.2-40.9 20.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-663.07 x2=-663.07 y1=165.44 y2=166.44 gradientTransform="matrix(152.47 7.9907 -3.0936 59.029 101884 -4318.7)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c31.9-30 64.1-39.7 96.7-29s50.8 30.4 54.6 59.1c-35.2-5.5-60.4-9.6-75.8-12.1-15.3-2.6-40.5-8.6-75.5-18z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-662.57 x2=-662.57 y1=164.44 y2=165.44 gradientTransform="matrix(136.46 7.1517 -5.2163 99.533 91536 -11442)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c35.8-7.6 65.6-0.2 89.2 22s37.7 49 42.3 80.3c-39.8-9.7-68.3-23.8-85.5-42.4s-32.5-38.5-46-59.9z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.43 x2=-656.43 y1=163.86 y2=164.86 gradientTransform="matrix(60.866 3.1899 -8.7773 167.48 41560 -25168)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c-33.6 13.8-53.6 35.7-60.1 65.6s-3.6 63.1 8.7 99.6c27.4-40.3 43.2-69.6 47.4-88s5.6-44.1 4-77.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><path d="m196.5 182.3c-14.8 21.6-25.1 41.4-30.8 59.4s-9.5 33-11.1 45.1"fill=none stroke-linecap=round stroke-width=8></path><path d="m194.9 185.7c-24.4 1.7-43.8 9-58.1 21.8s-24.7 25.4-31.3 37.8"fill=none stroke-linecap=round stroke-width=8></path><path d="m204.5 176.4c29.7-6.7 52-8.4 67-5.1s26.9 8.6 35.8 15.9"fill=none stroke-linecap=round stroke-width=8></path><path d="m196.5 181.4c20.3 9.9 38.2 20.5 53.9 31.9s27.4 22.1 35.1 32"fill=none stroke-linecap=round stroke-width=8></path></g></g><defs><filter x=50.5 y=399 width=532 height=633 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=50.5 y=399 width=532 height=633 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-666.06 x2=-666.23 y1=163.36 y2=163.75 gradientTransform="matrix(532 0 0 633 354760 -102959)"gradientUnits=userSpaceOnUse><stop stop-color=#FFF400 offset=0></stop><stop stop-color=#3C8700 offset=1></stop></linearGradient><ellipse cx=316.5 cy=715.5 rx=266 ry=316.5></ellipse></g><defs><filter x=391 y=-24 width=288 height=283 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=391 y=-24 width=288 height=283 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-664.56 x2=-664.56 y1=163.79 y2=164.79 gradientTransform="matrix(227 0 0 227 151421 -37204)"gradientUnits=userSpaceOnUse><stop stop-color=#FFDF00 offset=0></stop><stop stop-color=#FF9D00 offset=1></stop></linearGradient><circle cx=565.5 cy=89.5 r=113.5></circle><linearGradient x1=-644.5 x2=-645.77 y1=342 y2=342 gradientTransform="matrix(30 0 0 1 19770 -253)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=427 x2=397 y1=89 y2=89 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-641.56 x2=-642.83 y1=196.02 y2=196.07 gradientTransform="matrix(26.5 0 0 5.5 17439 -1025.5)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=430.5 x2=404 y1=55.5 y2=50 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-643.73 x2=-645 y1=185.83 y2=185.9 gradientTransform="matrix(29 0 0 8 19107 -1361)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=431 x2=402 y1=122 y2=130 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-638.94 x2=-640.22 y1=177.09 y2=177.39 gradientTransform="matrix(24 0 0 13 15783 -2145)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=442 x2=418 y1=153 y2=166 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-633.42 x2=-634.7 y1=172.41 y2=173.31 gradientTransform="matrix(20 0 0 19 13137 -3096)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=464 x2=444 y1=180 y2=199 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-619.05 x2=-619.52 y1=170.82 y2=171.82 gradientTransform="matrix(13.83 0 0 22.85 9050 -3703.4)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=491.4 x2=477.5 y1=203 y2=225.9 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-578.5 x2=-578.63 y1=170.31 y2=171.31 gradientTransform="matrix(7.5 0 0 24.5 4860 -3953)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=524.5 x2=517 y1=219.5 y2=244 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=666.5 x2=666.5 y1=170.31 y2=171.31 gradientTransform="matrix(.5 0 0 24.5 231.5 -3944)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=564.5 x2=565 y1=228.5 y2=253 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12>');function wL(){return eL()}function bx(){return tL()}function Oo(){return nL()}function Zm(){return rL()}function ep(){return rh()}function SL(){return(()=>{var e=rh();return e.style.setProperty("transform","rotate(90deg)"),e})()}function CL(){return(()=>{var e=rh();return e.style.setProperty("transform","rotate(-90deg)"),e})()}function _L(){return iL()}function kL(){return sL()}function EL(){return oL()}function OL(){return aL()}function AL(){return lL()}function TL(){return cL()}function PL(){return uL()}function ML(){return dL()}function $L(){return fL()}function jL(e){return(()=>{var t=px(),n=t.firstChild;return me(()=>G(n,"stroke",e.theme==="dark"?"#12B76A":"#027A48")),t})()}function DL(){return hL()}function LL(){return gL()}function IL(e){return[M(ye,{get when(){return e.checked},get children(){var t=px(),n=t.firstChild;return me(()=>G(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}}),M(ye,{get when(){return!e.checked},get children(){var t=yL(),n=t.firstChild;return me(()=>G(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}})]}function RL(){return mL()}function FL(){return pL()}function NL(){return bL()}function BL(){return vL()}function tp(){const e=fn();return(()=>{var t=xL(),n=t.firstChild,r=n.nextSibling,i=r.nextSibling,s=i.firstChild,o=i.nextSibling,a=o.firstChild,l=o.nextSibling,c=l.nextSibling,u=c.firstChild,d=c.nextSibling,f=d.firstChild,h=d.nextSibling,g=h.nextSibling,m=g.firstChild,p=g.nextSibling,b=p.firstChild,v=p.nextSibling,S=v.nextSibling,w=S.firstChild,x=S.nextSibling,_=x.firstChild,C=x.nextSibling,A=C.nextSibling,k=A.firstChild,P=A.nextSibling,$=P.firstChild,j=P.nextSibling,Z=j.nextSibling,q=Z.firstChild,N=Z.nextSibling,L=N.firstChild,F=N.nextSibling,se=F.nextSibling,de=se.firstChild,R=se.nextSibling,K=R.firstChild,ae=R.nextSibling,fe=ae.firstChild,D=fe.nextSibling,le=D.nextSibling,re=le.nextSibling,we=re.nextSibling,X=ae.nextSibling,ve=X.firstChild,xe=X.nextSibling,Qe=xe.firstChild,J=xe.nextSibling,rt=J.firstChild,mt=rt.nextSibling,jt=mt.nextSibling,Jt=jt.firstChild,yn=Jt.nextSibling,Y=yn.nextSibling,Le=Y.nextSibling,ot=Le.nextSibling,Ie=ot.nextSibling,ze=Ie.nextSibling,je=ze.nextSibling,Ye=je.nextSibling,ie=Ye.nextSibling,ce=ie.nextSibling,ue=ce.nextSibling,Ae=J.nextSibling,Un=Ae.firstChild,mn=Ae.nextSibling,Wr=mn.firstChild,Kn=mn.nextSibling,gr=Kn.firstChild,La=gr.nextSibling,Ks=Kn.nextSibling,Ia=Ks.firstChild,$i=Ks.nextSibling,Ra=$i.firstChild,Ws=$i.nextSibling,Vs=Ws.firstChild,Gs=Vs.nextSibling,ji=Gs.nextSibling,ah=ji.nextSibling,lh=ah.nextSibling,ch=lh.nextSibling,uh=ch.nextSibling,dh=uh.nextSibling,fh=dh.nextSibling,hh=fh.nextSibling,gh=hh.nextSibling,yh=gh.nextSibling,mh=yh.nextSibling,ph=mh.nextSibling,bh=ph.nextSibling,vh=bh.nextSibling,xh=vh.nextSibling,Px=xh.nextSibling;return G(n,"id",`a-${e}`),G(r,"fill",`url(#a-${e})`),G(s,"id",`am-${e}`),G(o,"id",`b-${e}`),G(a,"filter",`url(#am-${e})`),G(l,"mask",`url(#b-${e})`),G(u,"id",`ah-${e}`),G(d,"id",`k-${e}`),G(f,"filter",`url(#ah-${e})`),G(h,"mask",`url(#k-${e})`),G(m,"id",`ae-${e}`),G(p,"id",`j-${e}`),G(b,"filter",`url(#ae-${e})`),G(v,"mask",`url(#j-${e})`),G(w,"id",`ai-${e}`),G(x,"id",`i-${e}`),G(_,"filter",`url(#ai-${e})`),G(C,"mask",`url(#i-${e})`),G(k,"id",`aj-${e}`),G(P,"id",`h-${e}`),G($,"filter",`url(#aj-${e})`),G(j,"mask",`url(#h-${e})`),G(q,"id",`ag-${e}`),G(N,"id",`g-${e}`),G(L,"filter",`url(#ag-${e})`),G(F,"mask",`url(#g-${e})`),G(de,"id",`af-${e}`),G(R,"id",`f-${e}`),G(K,"filter",`url(#af-${e})`),G(ae,"mask",`url(#f-${e})`),G(re,"id",`m-${e}`),G(we,"fill",`url(#m-${e})`),G(ve,"id",`ak-${e}`),G(xe,"id",`e-${e}`),G(Qe,"filter",`url(#ak-${e})`),G(J,"mask",`url(#e-${e})`),G(rt,"id",`n-${e}`),G(mt,"fill",`url(#n-${e})`),G(Jt,"id",`r-${e}`),G(yn,"fill",`url(#r-${e})`),G(Y,"id",`s-${e}`),G(Le,"fill",`url(#s-${e})`),G(ot,"id",`q-${e}`),G(Ie,"fill",`url(#q-${e})`),G(ze,"id",`p-${e}`),G(je,"fill",`url(#p-${e})`),G(Ye,"id",`o-${e}`),G(ie,"fill",`url(#o-${e})`),G(ce,"id",`l-${e}`),G(ue,"fill",`url(#l-${e})`),G(Un,"id",`al-${e}`),G(mn,"id",`d-${e}`),G(Wr,"filter",`url(#al-${e})`),G(Kn,"mask",`url(#d-${e})`),G(gr,"id",`u-${e}`),G(La,"fill",`url(#u-${e})`),G(Ia,"id",`ad-${e}`),G($i,"id",`c-${e}`),G(Ra,"filter",`url(#ad-${e})`),G(Ws,"mask",`url(#c-${e})`),G(Vs,"id",`t-${e}`),G(Gs,"fill",`url(#t-${e})`),G(ji,"id",`v-${e}`),G(ah,"stroke",`url(#v-${e})`),G(lh,"id",`aa-${e}`),G(ch,"stroke",`url(#aa-${e})`),G(uh,"id",`w-${e}`),G(dh,"stroke",`url(#w-${e})`),G(fh,"id",`ac-${e}`),G(hh,"stroke",`url(#ac-${e})`),G(gh,"id",`ab-${e}`),G(yh,"stroke",`url(#ab-${e})`),G(mh,"id",`y-${e}`),G(ph,"stroke",`url(#y-${e})`),G(bh,"id",`x-${e}`),G(vh,"stroke",`url(#x-${e})`),G(xh,"id",`z-${e}`),G(Px,"stroke",`url(#z-${e})`),t})()}var qL=oe('<span><svg width=16 height=16 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M6 12L10 8L6 4"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),zL=oe('<button title="Copy object to clipboard">'),HL=oe('<button title="Remove all items"aria-label="Remove all items">'),UL=oe('<button title="Delete item"aria-label="Delete item">'),KL=oe('<button title="Toggle value"aria-label="Toggle value">'),WL=oe('<button title="Bulk Edit Data"aria-label="Bulk Edit Data">'),lo=oe("<div>"),VL=oe("<div><button> <span></span> <span> "),GL=oe("<input>"),np=oe("<span>"),QL=oe("<div><span>:"),YL=oe("<div><div><button> [<!>...<!>]");function XL(e,t){let n=0;const r=[];for(;n<e.length;)r.push(e.slice(n,n+t)),n=n+t;return r}var rp=e=>{const t=yt(),n=he().shadowDOMTarget?Te.bind({target:he().shadowDOMTarget}):Te,r=B(()=>t()==="dark"?Us(n):Hs(n));return(()=>{var i=qL();return me(()=>Q(i,ne(r().expander,n`
71
+ transform: rotate(${e.expanded?90:0}deg);
72
+ `,e.expanded&&n`
73
+ & svg {
74
+ top: -1px;
75
+ }
76
+ `))),i})()},JL=e=>{const t=yt(),n=he().shadowDOMTarget?Te.bind({target:he().shadowDOMTarget}):Te,r=B(()=>t()==="dark"?Us(n):Hs(n)),[i,s]=ee("NoCopy");return(()=>{var o=zL();return O0(o,"click",i()==="NoCopy"?()=>{navigator.clipboard.writeText(iC(e.value)).then(()=>{s("SuccessCopy"),setTimeout(()=>{s("NoCopy")},1500)},a=>{s("ErrorCopy"),setTimeout(()=>{s("NoCopy")},1500)})}:void 0,!0),H(o,M(oS,{get children(){return[M(Zc,{get when(){return i()==="NoCopy"},get children(){return M(ML,{})}}),M(Zc,{get when(){return i()==="SuccessCopy"},get children(){return M(jL,{get theme(){return t()}})}}),M(Zc,{get when(){return i()==="ErrorCopy"},get children(){return M(DL,{})}})]}})),me(a=>{var l=r().actionButton,c=`${i()==="NoCopy"?"Copy object to clipboard":i()==="SuccessCopy"?"Object copied to clipboard":"Error copying object to clipboard"}`;return l!==a.e&&Q(o,a.e=l),c!==a.t&&G(o,"aria-label",a.t=c),a},{e:void 0,t:void 0}),o})()},ZL=e=>{const t=yt(),n=he().shadowDOMTarget?Te.bind({target:he().shadowDOMTarget}):Te,r=B(()=>t()==="dark"?Us(n):Hs(n)),i=he().client;return(()=>{var s=HL();return s.$$click=()=>{const o=e.activeQuery.state.data,a=ei(o,e.dataPath,[]);i.setQueryData(e.activeQuery.queryKey,a)},H(s,M(LL,{})),me(()=>Q(s,r().actionButton)),s})()},ip=e=>{const t=yt(),n=he().shadowDOMTarget?Te.bind({target:he().shadowDOMTarget}):Te,r=B(()=>t()==="dark"?Us(n):Hs(n)),i=he().client;return(()=>{var s=UL();return s.$$click=()=>{const o=e.activeQuery.state.data,a=ho(o,e.dataPath);i.setQueryData(e.activeQuery.queryKey,a)},H(s,M(bx,{})),me(()=>Q(s,ne(r().actionButton))),s})()},eI=e=>{const t=yt(),n=he().shadowDOMTarget?Te.bind({target:he().shadowDOMTarget}):Te,r=B(()=>t()==="dark"?Us(n):Hs(n)),i=he().client;return(()=>{var s=KL();return s.$$click=()=>{const o=e.activeQuery.state.data,a=ei(o,e.dataPath,!e.value);i.setQueryData(e.activeQuery.queryKey,a)},H(s,M(IL,{get theme(){return t()},get checked(){return e.value}})),me(()=>Q(s,ne(r().actionButton,n`
77
+ width: ${z.size[3.5]};
78
+ height: ${z.size[3.5]};
79
+ `))),s})()};function sp(e){return Symbol.iterator in e}function $r(e){var g;const t=yt(),n=he().shadowDOMTarget?Te.bind({target:he().shadowDOMTarget}):Te,r=B(()=>t()==="dark"?Us(n):Hs(n)),i=he().client,[s,o]=ee((e.defaultExpanded||[]).includes(e.label)),a=()=>o(m=>!m),[l,c]=ee([]),u=B(()=>Array.isArray(e.value)?e.value.map((m,p)=>({label:p.toString(),value:m})):e.value!==null&&typeof e.value=="object"&&sp(e.value)&&typeof e.value[Symbol.iterator]=="function"?e.value instanceof Map?Array.from(e.value,([m,p])=>({label:m,value:p})):Array.from(e.value,(m,p)=>({label:p.toString(),value:m})):typeof e.value=="object"&&e.value!==null?Object.entries(e.value).map(([m,p])=>({label:m,value:p})):[]),d=B(()=>Array.isArray(e.value)?"array":e.value!==null&&typeof e.value=="object"&&sp(e.value)&&typeof e.value[Symbol.iterator]=="function"?"Iterable":typeof e.value=="object"&&e.value!==null?"object":typeof e.value),f=B(()=>XL(u(),100)),h=(g=e.dataPath)!=null?g:[];return(()=>{var m=lo();return H(m,M(ye,{get when(){return f().length},get children(){return[(()=>{var p=VL(),b=p.firstChild,v=b.firstChild,S=v.nextSibling,w=S.nextSibling,x=w.nextSibling,_=x.firstChild;return b.$$click=()=>a(),H(b,M(rp,{get expanded(){return s()}}),v),H(S,()=>e.label),H(x,()=>String(d()).toLowerCase()==="iterable"?"(Iterable) ":"",_),H(x,()=>u().length,_),H(x,()=>u().length>1?"items":"item",null),H(p,M(ye,{get when(){return e.editable},get children(){var C=lo();return H(C,M(JL,{get value(){return e.value}}),null),H(C,M(ye,{get when(){return e.itemsDeletable&&e.activeQuery!==void 0},get children(){return M(ip,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),H(C,M(ye,{get when(){return d()==="array"&&e.activeQuery!==void 0},get children(){return M(ZL,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),H(C,M(ye,{get when(){return B(()=>!!e.onEdit)()&&!W0(e.value).meta},get children(){var A=WL();return A.$$click=()=>{var k;(k=e.onEdit)==null||k.call(e)},H(A,M($L,{})),me(()=>Q(A,r().actionButton)),A}}),null),me(()=>Q(C,r().actions)),C}}),null),me(C=>{var A=r().expanderButtonContainer,k=r().expanderButton,P=r().info;return A!==C.e&&Q(p,C.e=A),k!==C.t&&Q(b,C.t=k),P!==C.a&&Q(x,C.a=P),C},{e:void 0,t:void 0,a:void 0}),p})(),M(ye,{get when(){return s()},get children(){return[M(ye,{get when(){return f().length===1},get children(){var p=lo();return H(p,M(rc,{get each(){return u()},by:b=>b.label,children:b=>M($r,{get defaultExpanded(){return e.defaultExpanded},get label(){return b().label},get value(){return b().value},get editable(){return e.editable},get dataPath(){return[...h,b().label]},get activeQuery(){return e.activeQuery},get itemsDeletable(){return d()==="array"||d()==="Iterable"||d()==="object"}})})),me(()=>Q(p,r().subEntry)),p}}),M(ye,{get when(){return f().length>1},get children(){var p=lo();return H(p,M(sS,{get each(){return f()},children:(b,v)=>(()=>{var S=YL(),w=S.firstChild,x=w.firstChild,_=x.firstChild,C=_.nextSibling,A=C.nextSibling,k=A.nextSibling;return k.nextSibling,x.$$click=()=>c(P=>P.includes(v)?P.filter($=>$!==v):[...P,v]),H(x,M(rp,{get expanded(){return l().includes(v)}}),_),H(x,v*100,C),H(x,v*100+100-1,k),H(w,M(ye,{get when(){return l().includes(v)},get children(){var P=lo();return H(P,M(rc,{get each(){return b()},by:$=>$.label,children:$=>M($r,{get defaultExpanded(){return e.defaultExpanded},get label(){return $().label},get value(){return $().value},get editable(){return e.editable},get dataPath(){return[...h,$().label]},get activeQuery(){return e.activeQuery}})})),me(()=>Q(P,r().subEntry)),P}}),null),me(P=>{var $=r().entry,j=r().expanderButton;return $!==P.e&&Q(w,P.e=$),j!==P.t&&Q(x,P.t=j),P},{e:void 0,t:void 0}),S})()})),me(()=>Q(p,r().subEntry)),p}})]}})]}}),null),H(m,M(ye,{get when(){return f().length===0},get children(){var p=QL(),b=p.firstChild,v=b.firstChild;return H(b,()=>e.label,v),H(p,M(ye,{get when(){return B(()=>!!(e.editable&&e.activeQuery!==void 0))()&&(d()==="string"||d()==="number"||d()==="boolean")},get fallback(){return(()=>{var S=np();return H(S,()=>Bl(e.value)),me(()=>Q(S,r().value)),S})()},get children(){return[M(ye,{get when(){return B(()=>!!(e.editable&&e.activeQuery!==void 0))()&&(d()==="string"||d()==="number")},get children(){var S=GL();return S.addEventListener("change",w=>{const x=e.activeQuery.state.data,_=ei(x,h,d()==="number"?w.target.valueAsNumber:w.target.value);i.setQueryData(e.activeQuery.queryKey,_)}),me(w=>{var x=d()==="number"?"number":"text",_=ne(r().value,r().editableInput);return x!==w.e&&G(S,"type",w.e=x),_!==w.t&&Q(S,w.t=_),w},{e:void 0,t:void 0}),me(()=>S.value=e.value),S}}),M(ye,{get when(){return d()==="boolean"},get children(){var S=np();return H(S,M(eI,{get activeQuery(){return e.activeQuery},dataPath:h,get value(){return e.value}}),null),H(S,()=>Bl(e.value),null),me(()=>Q(S,ne(r().value,r().actions,r().editableInput))),S}})]}}),null),H(p,M(ye,{get when(){return e.editable&&e.itemsDeletable&&e.activeQuery!==void 0},get children(){return M(ip,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),me(S=>{var w=r().row,x=r().label;return w!==S.e&&Q(p,S.e=w),x!==S.t&&Q(b,S.t=x),S},{e:void 0,t:void 0}),p}}),null),me(()=>Q(m,r().entry)),m})()}var vx=(e,t)=>{const{colors:n,font:r,size:i,border:s}=z,o=(a,l)=>e==="light"?a:l;return{entry:t`
80
+ & * {
81
+ font-size: ${r.size.xs};
82
+ font-family:
83
+ ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
84
+ 'Liberation Mono', 'Courier New', monospace;
85
+ }
86
+ position: relative;
87
+ outline: none;
88
+ word-break: break-word;
89
+ `,subEntry:t`
90
+ margin: 0 0 0 0.5em;
91
+ padding-left: 0.75em;
92
+ border-left: 2px solid ${o(n.gray[300],n.darkGray[400])};
93
+ /* outline: 1px solid ${n.teal[400]}; */
94
+ `,expander:t`
95
+ & path {
96
+ stroke: ${n.gray[400]};
97
+ }
98
+ & svg {
99
+ width: ${i[3]};
100
+ height: ${i[3]};
101
+ }
102
+ display: inline-flex;
103
+ align-items: center;
104
+ transition: all 0.1s ease;
105
+ /* outline: 1px solid ${n.blue[400]}; */
106
+ `,expanderButtonContainer:t`
107
+ display: flex;
108
+ align-items: center;
109
+ line-height: ${i[4]};
110
+ min-height: ${i[4]};
111
+ gap: ${i[2]};
112
+ `,expanderButton:t`
113
+ cursor: pointer;
114
+ color: inherit;
115
+ font: inherit;
116
+ outline: inherit;
117
+ height: ${i[5]};
118
+ background: transparent;
119
+ border: none;
120
+ padding: 0;
121
+ display: inline-flex;
122
+ align-items: center;
123
+ gap: ${i[1]};
124
+ position: relative;
125
+ /* outline: 1px solid ${n.green[400]}; */
126
+
127
+ &:focus-visible {
128
+ border-radius: ${s.radius.xs};
129
+ outline: 2px solid ${n.blue[800]};
130
+ }
131
+
132
+ & svg {
133
+ position: relative;
134
+ left: 1px;
135
+ }
136
+ `,info:t`
137
+ color: ${o(n.gray[500],n.gray[500])};
138
+ font-size: ${r.size.xs};
139
+ margin-left: ${i[1]};
140
+ /* outline: 1px solid ${n.yellow[400]}; */
141
+ `,label:t`
142
+ color: ${o(n.gray[700],n.gray[300])};
143
+ white-space: nowrap;
144
+ `,value:t`
145
+ color: ${o(n.purple[600],n.purple[400])};
146
+ flex-grow: 1;
147
+ `,actions:t`
148
+ display: inline-flex;
149
+ gap: ${i[2]};
150
+ align-items: center;
151
+ `,row:t`
152
+ display: inline-flex;
153
+ gap: ${i[2]};
154
+ width: 100%;
155
+ margin: ${i[.25]} 0px;
156
+ line-height: ${i[4.5]};
157
+ align-items: center;
158
+ `,editableInput:t`
159
+ border: none;
160
+ padding: ${i[.5]} ${i[1]} ${i[.5]} ${i[1.5]};
161
+ flex-grow: 1;
162
+ border-radius: ${s.radius.xs};
163
+ background-color: ${o(n.gray[200],n.darkGray[500])};
164
+
165
+ &:hover {
166
+ background-color: ${o(n.gray[300],n.darkGray[600])};
167
+ }
168
+ `,actionButton:t`
169
+ background-color: transparent;
170
+ color: ${o(n.gray[500],n.gray[500])};
171
+ border: none;
172
+ display: inline-flex;
173
+ padding: 0px;
174
+ align-items: center;
175
+ justify-content: center;
176
+ cursor: pointer;
177
+ width: ${i[3]};
178
+ height: ${i[3]};
179
+ position: relative;
180
+ z-index: 1;
181
+
182
+ &:hover svg {
183
+ color: ${o(n.gray[600],n.gray[400])};
184
+ }
185
+
186
+ &:focus-visible {
187
+ border-radius: ${s.radius.xs};
188
+ outline: 2px solid ${n.blue[800]};
189
+ outline-offset: 2px;
190
+ }
191
+ `}},Hs=e=>vx("light",e),Us=e=>vx("dark",e);mc(["click"]);var tI=oe('<div><div aria-hidden=true></div><button type=button aria-label="Open Tanstack query devtools"class=tsqd-open-btn>'),Da=oe("<div>"),nI=oe('<aside aria-label="Tanstack query devtools"><div></div><button aria-label="Close tanstack query devtools">'),rI=oe("<select name=tsqd-queries-filter-sort>"),iI=oe("<select name=tsqd-mutations-filter-sort>"),sI=oe("<span>Asc"),oI=oe("<span>Desc"),aI=oe('<button aria-label="Open in picture-in-picture mode"title="Open in picture-in-picture mode">'),lI=oe("<div>Settings"),cI=oe("<span>Position"),uI=oe("<span>Top"),dI=oe("<span>Bottom"),fI=oe("<span>Left"),hI=oe("<span>Right"),gI=oe("<span>Theme"),yI=oe("<span>Light"),mI=oe("<span>Dark"),pI=oe("<span>System"),bI=oe("<div><div class=tsqd-queries-container>"),vI=oe("<div><div class=tsqd-mutations-container>"),xI=oe('<div><div><div><button aria-label="Close Tanstack query devtools"><span>TANSTACK</span><span> v</span></button></div></div><div><div><div><input aria-label="Filter queries by query key"type=text placeholder=Filter name=tsqd-query-filter-input></div><div></div><button class=tsqd-query-filter-sort-order-btn></button></div><div><button aria-label="Clear query cache"></button><button>'),op=oe("<option>Sort by "),wI=oe("<div class=tsqd-query-disabled-indicator>disabled"),SI=oe("<div class=tsqd-query-static-indicator>static"),xx=oe("<button><div></div><code class=tsqd-query-hash>"),CI=oe("<div role=tooltip id=tsqd-status-tooltip>"),_I=oe("<span>"),kI=oe("<button><span></span><span>"),EI=oe("<button><span></span> Error"),OI=oe('<div><span></span>Trigger Error<select><option value=""disabled selected>'),AI=oe('<div class="tsqd-query-details-explorer-container tsqd-query-details-data-explorer">'),TI=oe("<form><textarea name=data></textarea><div><span></span><div><button type=button>Cancel</button><button>Save"),PI=oe('<div><div>Query Details</div><div><div class=tsqd-query-details-summary><pre><code></code></pre><span></span></div><div class=tsqd-query-details-observers-count><span>Observers:</span><span></span></div><div class=tsqd-query-details-last-updated><span>Last Updated:</span><span></span></div></div><div>Actions</div><div><button><span></span>Refetch</button><button><span></span>Invalidate</button><button><span></span>Reset</button><button><span></span>Remove</button><button><span></span> Loading</button></div><div>Data </div><div>Query Explorer</div><div class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer">'),MI=oe("<option>"),$I=oe('<div><div>Mutation Details</div><div><div class=tsqd-query-details-summary><pre><code></code></pre><span></span></div><div class=tsqd-query-details-last-updated><span>Submitted At:</span><span></span></div></div><div>Variables Details</div><div class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer"></div><div>Context Details</div><div class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer"></div><div>Data Explorer</div><div class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer"></div><div>Mutations Explorer</div><div class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer">'),[Vt,Kc]=ee(null),[Lr,wx]=ee(null),[wn,ih]=ee(0),[co,jI]=ee(!1),DI=e=>{const t=yt(),n=he().shadowDOMTarget?Te.bind({target:he().shadowDOMTarget}):Te,r=B(()=>t()==="dark"?gn(n):hn(n)),i=B(()=>he().onlineManager);cr(()=>{const d=i().subscribe(f=>{jI(!f)});be(()=>{d()})});const s=Ff(),o=B(()=>he().buttonPosition||L$),a=B(()=>e.localStore.open==="true"?!0:e.localStore.open==="false"?!1:he().initialIsOpen||I$),l=B(()=>e.localStore.position||he().position||zd);let c;pe(()=>{const d=c.parentElement,f=e.localStore.height||Kv,h=e.localStore.width||Wv,g=l();d.style.setProperty("--tsqd-panel-height",`${g==="top"?"-":""}${f}px`),d.style.setProperty("--tsqd-panel-width",`${g==="left"?"-":""}${h}px`)}),cr(()=>{const d=()=>{const f=c.parentElement,h=getComputedStyle(f).fontSize;f.style.setProperty("--tsqd-font-size",h)};d(),window.addEventListener("focus",d),be(()=>{window.removeEventListener("focus",d)})});const u=B(()=>{var d;return(d=e.localStore.pip_open)!=null?d:"false"});return[M(ye,{get when(){return B(()=>!!s().pipWindow)()&&u()=="true"},get children(){return M(M0,{get mount(){var d;return(d=s().pipWindow)==null?void 0:d.document.body},get children(){return M(LI,{get children(){return M(sh,e)}})}})}}),(()=>{var d=Da(),f=c;return typeof f=="function"?Ls(f,d):c=d,H(d,M(Sm,{name:"tsqd-panel-transition",get children(){return M(ye,{get when(){return B(()=>!!(a()&&!s().pipWindow))()&&u()=="false"},get children(){return M(RI,{get localStore(){return e.localStore},get setLocalStore(){return e.setLocalStore}})}})}}),null),H(d,M(Sm,{name:"tsqd-button-transition",get children(){return M(ye,{get when(){return!a()},get children(){var h=tI(),g=h.firstChild,m=g.nextSibling;return H(g,M(tp,{})),m.$$click=()=>e.setLocalStore("open","true"),H(m,M(tp,{})),me(()=>Q(h,ne(r().devtoolsBtn,r()[`devtoolsBtn-position-${o()}`],"tsqd-open-btn-container"))),h}})}}),null),me(()=>Q(d,ne(n`
192
+ & .tsqd-panel-transition-exit-active,
193
+ & .tsqd-panel-transition-enter-active {
194
+ transition:
195
+ opacity 0.3s,
196
+ transform 0.3s;
197
+ }
198
+
199
+ & .tsqd-panel-transition-exit-to,
200
+ & .tsqd-panel-transition-enter {
201
+ ${l()==="top"||l()==="bottom"?"transform: translateY(var(--tsqd-panel-height));":"transform: translateX(var(--tsqd-panel-width));"}
202
+ }
203
+
204
+ & .tsqd-button-transition-exit-active,
205
+ & .tsqd-button-transition-enter-active {
206
+ transition:
207
+ opacity 0.3s,
208
+ transform 0.3s;
209
+ opacity: 1;
210
+ }
211
+
212
+ & .tsqd-button-transition-exit-to,
213
+ & .tsqd-button-transition-enter {
214
+ transform: ${o()==="relative"?"none;":o()==="top-left"?"translateX(-72px);":o()==="top-right"?"translateX(72px);":"translateY(72px);"};
215
+ opacity: 0;
216
+ }
217
+ `,"tsqd-transitions-container"))),d})()]},LI=e=>{const t=Ff(),n=yt(),r=he().shadowDOMTarget?Te.bind({target:he().shadowDOMTarget}):Te,i=B(()=>n()==="dark"?gn(r):hn(r)),s=()=>{const{colors:o}=z,a=(l,c)=>n()==="dark"?c:l;return wn()<Ci?r`
218
+ flex-direction: column;
219
+ background-color: ${a(o.gray[300],o.gray[600])};
220
+ `:r`
221
+ flex-direction: row;
222
+ background-color: ${a(o.gray[200],o.darkGray[900])};
223
+ `};return pe(()=>{const o=t().pipWindow,a=()=>{o&&ih(o.innerWidth)};o&&(o.addEventListener("resize",a),a()),be(()=>{o&&o.removeEventListener("resize",a)})}),(()=>{var o=Da();return o.style.setProperty("--tsqd-font-size","16px"),o.style.setProperty("max-height","100vh"),o.style.setProperty("height","100vh"),o.style.setProperty("width","100vw"),H(o,()=>e.children),me(()=>Q(o,ne(i().panel,s(),{[r`
224
+ min-width: min-content;
225
+ `]:wn()<If},"tsqd-main-panel"))),o})()},II=e=>{const t=yt(),n=he().shadowDOMTarget?Te.bind({target:he().shadowDOMTarget}):Te,r=B(()=>t()==="dark"?gn(n):hn(n));let i;cr(()=>{Zv(i,({width:o},a)=>{a===i&&ih(o)})});const s=()=>{const{colors:o}=z,a=(l,c)=>t()==="dark"?c:l;return wn()<Ci?n`
226
+ flex-direction: column;
227
+ background-color: ${a(o.gray[300],o.gray[600])};
228
+ `:n`
229
+ flex-direction: row;
230
+ background-color: ${a(o.gray[200],o.darkGray[900])};
231
+ `};return(()=>{var o=Da(),a=i;return typeof a=="function"?Ls(a,o):i=o,o.style.setProperty("--tsqd-font-size","16px"),H(o,()=>e.children),me(()=>Q(o,ne(r().parentPanel,s(),{[n`
232
+ min-width: min-content;
233
+ `]:wn()<If},"tsqd-main-panel"))),o})()},RI=e=>{const t=yt(),n=he().shadowDOMTarget?Te.bind({target:he().shadowDOMTarget}):Te,r=B(()=>t()==="dark"?gn(n):hn(n)),[i,s]=ee(!1),o=B(()=>e.localStore.position||he().position||zd),a=u=>{const d=u.currentTarget.parentElement;if(!d)return;s(!0);const{height:f,width:h}=d.getBoundingClientRect(),g=u.clientX,m=u.clientY;let p=0;const b=Vh(3.5),v=Vh(12),S=x=>{if(x.preventDefault(),o()==="left"||o()==="right"){const _=o()==="right"?g-x.clientX:x.clientX-g;p=Math.round(h+_),p<v&&(p=v),e.setLocalStore("width",String(Math.round(p)));const C=d.getBoundingClientRect().width;Number(e.localStore.width)<C&&e.setLocalStore("width",String(C))}else{const _=o()==="bottom"?m-x.clientY:x.clientY-m;p=Math.round(f+_),p<b&&(p=b,Kc(null)),e.setLocalStore("height",String(Math.round(p)))}},w=()=>{i()&&s(!1),document.removeEventListener("mousemove",S,!1),document.removeEventListener("mouseUp",w,!1)};document.addEventListener("mousemove",S,!1),document.addEventListener("mouseup",w,!1)};let l;cr(()=>{Zv(l,({width:u},d)=>{d===l&&ih(u)})}),pe(()=>{var m,p;const u=(p=(m=l.parentElement)==null?void 0:m.parentElement)==null?void 0:p.parentElement;if(!u)return;const d=e.localStore.position||zd,f=sC("padding",d),h=e.localStore.position==="left"||e.localStore.position==="right",g=(({padding:b,paddingTop:v,paddingBottom:S,paddingLeft:w,paddingRight:x})=>({padding:b,paddingTop:v,paddingBottom:S,paddingLeft:w,paddingRight:x}))(u.style);u.style[f]=`${h?e.localStore.width:e.localStore.height}px`,be(()=>{Object.entries(g).forEach(([b,v])=>{u.style[b]=v})})});const c=()=>{const{colors:u}=z,d=(f,h)=>t()==="dark"?h:f;return wn()<Ci?n`
234
+ flex-direction: column;
235
+ background-color: ${d(u.gray[300],u.gray[600])};
236
+ `:n`
237
+ flex-direction: row;
238
+ background-color: ${d(u.gray[200],u.darkGray[900])};
239
+ `};return(()=>{var u=nI(),d=u.firstChild,f=d.nextSibling,h=l;return typeof h=="function"?Ls(h,u):l=u,d.$$mousedown=a,f.$$click=()=>e.setLocalStore("open","false"),H(f,M(Oo,{})),H(u,M(sh,e),null),me(g=>{var m=ne(r().panel,r()[`panel-position-${o()}`],c(),{[n`
240
+ min-width: min-content;
241
+ `]:wn()<If&&(o()==="right"||o()==="left")},"tsqd-main-panel"),p=o()==="bottom"||o()==="top"?`${e.localStore.height||Kv}px`:"auto",b=o()==="right"||o()==="left"?`${e.localStore.width||Wv}px`:"auto",v=ne(r().dragHandle,r()[`dragHandle-position-${o()}`],"tsqd-drag-handle"),S=ne(r().closeBtn,r()[`closeBtn-position-${o()}`],"tsqd-minimize-btn");return m!==g.e&&Q(u,g.e=m),p!==g.t&&((g.t=p)!=null?u.style.setProperty("height",p):u.style.removeProperty("height")),b!==g.a&&((g.a=b)!=null?u.style.setProperty("width",b):u.style.removeProperty("width")),v!==g.o&&Q(d,g.o=v),S!==g.i&&Q(f,g.i=S),g},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),u})()},sh=e=>{UI(),KI();let t;const n=yt(),r=he().shadowDOMTarget?Te.bind({target:he().shadowDOMTarget}):Te,i=B(()=>n()==="dark"?gn(r):hn(r)),s=Ff(),[o,a]=ee("queries"),l=B(()=>e.localStore.sort||F$),c=B(()=>Number(e.localStore.sortOrder)||ym),u=B(()=>e.localStore.mutationSort||N$),d=B(()=>Number(e.localStore.mutationSortOrder)||ym),f=B(()=>ld[l()]),h=B(()=>cd[u()]),g=B(()=>he().onlineManager),m=B(()=>he().client.getQueryCache()),p=B(()=>he().client.getMutationCache()),b=ft(C=>C().getAll().length,!1),v=B(lr(()=>[b(),e.localStore.filter,l(),c()],()=>{const C=m().getAll(),A=e.localStore.filter?C.filter(P=>mm(P.queryHash,e.localStore.filter||"").passed):[...C];return f()?A.sort((P,$)=>f()(P,$)*c()):A})),S=xn(C=>C().getAll().length,!1),w=B(lr(()=>[S(),e.localStore.mutationFilter,u(),d()],()=>{const C=p().getAll(),A=e.localStore.mutationFilter?C.filter(P=>{const $=`${P.options.mutationKey?JSON.stringify(P.options.mutationKey)+" - ":""}${new Date(P.state.submittedAt).toLocaleString()}`;return mm($,e.localStore.mutationFilter||"").passed}):[...C];return h()?A.sort((P,$)=>h()(P,$)*d()):A})),x=C=>{e.setLocalStore("position",C)},_=C=>{const k=getComputedStyle(t).getPropertyValue("--tsqd-font-size");C.style.setProperty("--tsqd-font-size",k)};return[(()=>{var C=xI(),A=C.firstChild,k=A.firstChild,P=k.firstChild,$=P.firstChild,j=$.nextSibling,Z=j.firstChild,q=A.nextSibling,N=q.firstChild,L=N.firstChild,F=L.firstChild,se=L.nextSibling,de=se.nextSibling,R=N.nextSibling,K=R.firstChild,ae=K.nextSibling,fe=t;return typeof fe=="function"?Ls(fe,C):t=C,P.$$click=()=>{if(!s().pipWindow&&!e.showPanelViewOnly){e.setLocalStore("open","false");return}e.onClose&&e.onClose()},H(j,()=>he().queryFlavor,Z),H(j,()=>he().version,null),H(k,M(nn.Root,{get class(){return ne(i().viewToggle)},get value(){return o()},onChange:D=>{a(D),Kc(null),wx(null)},get children(){return[M(nn.Item,{value:"queries",class:"tsqd-radio-toggle",get children(){return[M(nn.ItemInput,{}),M(nn.ItemControl,{get children(){return M(nn.ItemIndicator,{})}}),M(nn.ItemLabel,{title:"Toggle Queries View",children:"Queries"})]}}),M(nn.Item,{value:"mutations",class:"tsqd-radio-toggle",get children(){return[M(nn.ItemInput,{}),M(nn.ItemControl,{get children(){return M(nn.ItemIndicator,{})}}),M(nn.ItemLabel,{title:"Toggle Mutations View",children:"Mutations"})]}})]}}),null),H(A,M(ye,{get when(){return o()==="queries"},get children(){return M(BI,{})}}),null),H(A,M(ye,{get when(){return o()==="mutations"},get children(){return M(qI,{})}}),null),H(L,M(wL,{}),F),F.$$input=D=>{o()==="queries"?e.setLocalStore("filter",D.currentTarget.value):e.setLocalStore("mutationFilter",D.currentTarget.value)},H(se,M(ye,{get when(){return o()==="queries"},get children(){var D=rI();return D.addEventListener("change",le=>{e.setLocalStore("sort",le.currentTarget.value)}),H(D,()=>Object.keys(ld).map(le=>(()=>{var re=op();return re.firstChild,re.value=le,H(re,le,null),re})())),me(()=>D.value=l()),D}}),null),H(se,M(ye,{get when(){return o()==="mutations"},get children(){var D=iI();return D.addEventListener("change",le=>{e.setLocalStore("mutationSort",le.currentTarget.value)}),H(D,()=>Object.keys(cd).map(le=>(()=>{var re=op();return re.firstChild,re.value=le,H(re,le,null),re})())),me(()=>D.value=u()),D}}),null),H(se,M(Oo,{}),null),de.$$click=()=>{o()==="queries"?e.setLocalStore("sortOrder",String(c()*-1)):e.setLocalStore("mutationSortOrder",String(d()*-1))},H(de,M(ye,{get when(){return(o()==="queries"?c():d())===1},get children(){return[sI(),M(Zm,{})]}}),null),H(de,M(ye,{get when(){return(o()==="queries"?c():d())===-1},get children(){return[oI(),M(ep,{})]}}),null),K.$$click=()=>{o()==="queries"?(Mn({type:"CLEAR_QUERY_CACHE"}),m().clear()):(Mn({type:"CLEAR_MUTATION_CACHE"}),p().clear())},H(K,M(bx,{})),ae.$$click=()=>{g().setOnline(!g().isOnline())},H(ae,(()=>{var D=B(()=>!!co());return()=>D()?M(AL,{}):M(OL,{})})()),H(R,M(ye,{get when(){return B(()=>!s().pipWindow)()&&!s().disabled},get children(){var D=aI();return D.$$click=()=>{var le;s().requestPipWindow(Number(window.innerWidth),Number((le=e.localStore.height)!=null?le:500))},H(D,M(PL,{})),me(()=>Q(D,ne(i().actionsBtn,"tsqd-actions-btn","tsqd-action-open-pip"))),D}}),null),H(R,M(at.Root,{gutter:4,get children(){return[M(at.Trigger,{get class(){return ne(i().actionsBtn,"tsqd-actions-btn","tsqd-action-settings")},get children(){return M(TL,{})}}),M(at.Portal,{ref:D=>_(D),get mount(){return B(()=>!!s().pipWindow)()?s().pipWindow.document.body:document.body},get children(){return M(at.Content,{get class(){return ne(i().settingsMenu,"tsqd-settings-menu")},get children(){return[(()=>{var D=lI();return me(()=>Q(D,ne(i().settingsMenuHeader,"tsqd-settings-menu-header"))),D})(),M(ye,{get when(){return!e.showPanelViewOnly},get children(){return M(at.Sub,{overlap:!0,gutter:8,shift:-4,get children(){return[M(at.SubTrigger,{get class(){return ne(i().settingsSubTrigger,"tsqd-settings-menu-sub-trigger","tsqd-settings-menu-sub-trigger-position")},get children(){return[cI(),M(Oo,{})]}}),M(at.Portal,{ref:D=>_(D),get mount(){return B(()=>!!s().pipWindow)()?s().pipWindow.document.body:document.body},get children(){return M(at.SubContent,{get class(){return ne(i().settingsMenu,"tsqd-settings-submenu")},get children(){return[M(at.Item,{onSelect:()=>{x("top")},as:"button",get class(){return ne(i().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-top")},get children(){return[uI(),M(Zm,{})]}}),M(at.Item,{onSelect:()=>{x("bottom")},as:"button",get class(){return ne(i().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-bottom")},get children(){return[dI(),M(ep,{})]}}),M(at.Item,{onSelect:()=>{x("left")},as:"button",get class(){return ne(i().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-left")},get children(){return[fI(),M(SL,{})]}}),M(at.Item,{onSelect:()=>{x("right")},as:"button",get class(){return ne(i().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-right")},get children(){return[hI(),M(CL,{})]}})]}})}})]}})}}),M(at.Sub,{overlap:!0,gutter:8,shift:-4,get children(){return[M(at.SubTrigger,{get class(){return ne(i().settingsSubTrigger,"tsqd-settings-menu-sub-trigger","tsqd-settings-menu-sub-trigger-position")},get children(){return[gI(),M(Oo,{})]}}),M(at.Portal,{ref:D=>_(D),get mount(){return B(()=>!!s().pipWindow)()?s().pipWindow.document.body:document.body},get children(){return M(at.SubContent,{get class(){return ne(i().settingsMenu,"tsqd-settings-submenu")},get children(){return[M(at.Item,{onSelect:()=>{e.setLocalStore("theme_preference","light")},as:"button",get class(){return ne(i().settingsSubButton,e.localStore.theme_preference==="light"&&i().themeSelectedButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-top")},get children(){return[yI(),M(_L,{})]}}),M(at.Item,{onSelect:()=>{e.setLocalStore("theme_preference","dark")},as:"button",get class(){return ne(i().settingsSubButton,e.localStore.theme_preference==="dark"&&i().themeSelectedButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-bottom")},get children(){return[mI(),M(kL,{})]}}),M(at.Item,{onSelect:()=>{e.setLocalStore("theme_preference","system")},as:"button",get class(){return ne(i().settingsSubButton,e.localStore.theme_preference==="system"&&i().themeSelectedButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-left")},get children(){return[pI(),M(EL,{})]}})]}})}})]}})]}})}})]}}),null),H(C,M(ye,{get when(){return o()==="queries"},get children(){var D=bI(),le=D.firstChild;return H(le,M(rc,{by:re=>re.queryHash,get each(){return v()},children:re=>M(FI,{get query(){return re()}})})),me(()=>Q(D,ne(i().overflowQueryContainer,"tsqd-queries-overflow-container"))),D}}),null),H(C,M(ye,{get when(){return o()==="mutations"},get children(){var D=vI(),le=D.firstChild;return H(le,M(rc,{by:re=>re.mutationId,get each(){return w()},children:re=>M(NI,{get mutation(){return re()}})})),me(()=>Q(D,ne(i().overflowQueryContainer,"tsqd-mutations-overflow-container"))),D}}),null),me(D=>{var le=ne(i().queriesContainer,wn()<Ci&&(Vt()||Lr())&&r`
242
+ height: 50%;
243
+ max-height: 50%;
244
+ `,wn()<Ci&&!(Vt()||Lr())&&r`
245
+ height: 100%;
246
+ max-height: 100%;
247
+ `,"tsqd-queries-container"),re=ne(i().row,"tsqd-header"),we=i().logoAndToggleContainer,X=ne(i().logo,"tsqd-text-logo-container"),ve=ne(i().tanstackLogo,"tsqd-text-logo-tanstack"),xe=ne(i().queryFlavorLogo,"tsqd-text-logo-query-flavor"),Qe=ne(i().row,"tsqd-filters-actions-container"),J=ne(i().filtersContainer,"tsqd-filters-container"),rt=ne(i().filterInput,"tsqd-query-filter-textfield-container"),mt=ne("tsqd-query-filter-textfield"),jt=ne(i().filterSelect,"tsqd-query-filter-sort-container"),Jt=`Sort order ${(o()==="queries"?c():d())===-1?"descending":"ascending"}`,yn=(o()==="queries"?c():d())===-1,Y=ne(i().actionsContainer,"tsqd-actions-container"),Le=ne(i().actionsBtn,"tsqd-actions-btn","tsqd-action-clear-cache"),ot=`Clear ${o()} cache`,Ie=ne(i().actionsBtn,co()&&i().actionsBtnOffline,"tsqd-actions-btn","tsqd-action-mock-offline-behavior"),ze=`${co()?"Unset offline mocking behavior":"Mock offline behavior"}`,je=co(),Ye=`${co()?"Unset offline mocking behavior":"Mock offline behavior"}`;return le!==D.e&&Q(C,D.e=le),re!==D.t&&Q(A,D.t=re),we!==D.a&&Q(k,D.a=we),X!==D.o&&Q(P,D.o=X),ve!==D.i&&Q($,D.i=ve),xe!==D.n&&Q(j,D.n=xe),Qe!==D.s&&Q(q,D.s=Qe),J!==D.h&&Q(N,D.h=J),rt!==D.r&&Q(L,D.r=rt),mt!==D.d&&Q(F,D.d=mt),jt!==D.l&&Q(se,D.l=jt),Jt!==D.u&&G(de,"aria-label",D.u=Jt),yn!==D.c&&G(de,"aria-pressed",D.c=yn),Y!==D.w&&Q(R,D.w=Y),Le!==D.m&&Q(K,D.m=Le),ot!==D.f&&G(K,"title",D.f=ot),Ie!==D.y&&Q(ae,D.y=Ie),ze!==D.g&&G(ae,"aria-label",D.g=ze),je!==D.p&&G(ae,"aria-pressed",D.p=je),Ye!==D.b&&G(ae,"title",D.b=Ye),D},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0,g:void 0,p:void 0,b:void 0}),me(()=>F.value=o()==="queries"?e.localStore.filter||"":e.localStore.mutationFilter||""),C})(),M(ye,{get when(){return B(()=>o()==="queries")()&&Vt()},get children(){return M(zI,{})}}),M(ye,{get when(){return B(()=>o()==="mutations")()&&Lr()},get children(){return M(HI,{})}})]},FI=e=>{const t=yt(),n=he().shadowDOMTarget?Te.bind({target:he().shadowDOMTarget}):Te,r=B(()=>t()==="dark"?gn(n):hn(n)),{colors:i,alpha:s}=z,o=(g,m)=>t()==="dark"?m:g,a=ft(g=>{var m;return(m=g().find({queryKey:e.query.queryKey}))==null?void 0:m.state},!0,g=>g.query.queryHash===e.query.queryHash),l=ft(g=>{var m,p;return(p=(m=g().find({queryKey:e.query.queryKey}))==null?void 0:m.isDisabled())!=null?p:!1},!0,g=>g.query.queryHash===e.query.queryHash),c=ft(g=>{var m,p;return(p=(m=g().find({queryKey:e.query.queryKey}))==null?void 0:m.isStatic())!=null?p:!1},!0,g=>g.query.queryHash===e.query.queryHash),u=ft(g=>{var m,p;return(p=(m=g().find({queryKey:e.query.queryKey}))==null?void 0:m.isStale())!=null?p:!1},!0,g=>g.query.queryHash===e.query.queryHash),d=ft(g=>{var m,p;return(p=(m=g().find({queryKey:e.query.queryKey}))==null?void 0:m.getObserversCount())!=null?p:0},!0,g=>g.query.queryHash===e.query.queryHash),f=B(()=>oC({queryState:a(),observerCount:d(),isStale:u()})),h=()=>f()==="gray"?n`
248
+ background-color: ${o(i[f()][200],i[f()][700])};
249
+ color: ${o(i[f()][700],i[f()][300])};
250
+ `:n`
251
+ background-color: ${o(i[f()][200]+s[80],i[f()][900])};
252
+ color: ${o(i[f()][800],i[f()][300])};
253
+ `;return M(ye,{get when(){return a()},get children(){var g=xx(),m=g.firstChild,p=m.nextSibling;return g.$$click=()=>Kc(e.query.queryHash===Vt()?null:e.query.queryHash),H(m,d),H(p,()=>e.query.queryHash),H(g,M(ye,{get when(){return l()},get children(){return wI()}}),null),H(g,M(ye,{get when(){return c()},get children(){return SI()}}),null),me(b=>{var v=ne(r().queryRow,Vt()===e.query.queryHash&&r().selectedQueryRow,"tsqd-query-row"),S=`Query key ${e.query.queryHash}`,w=ne(h(),"tsqd-query-observer-count");return v!==b.e&&Q(g,b.e=v),S!==b.t&&G(g,"aria-label",b.t=S),w!==b.a&&Q(m,b.a=w),b},{e:void 0,t:void 0,a:void 0}),g}})},NI=e=>{const t=yt(),n=he().shadowDOMTarget?Te.bind({target:he().shadowDOMTarget}):Te,r=B(()=>t()==="dark"?gn(n):hn(n)),{colors:i,alpha:s}=z,o=(f,h)=>t()==="dark"?h:f,a=xn(f=>{const g=f().getAll().find(m=>m.mutationId===e.mutation.mutationId);return g==null?void 0:g.state}),l=xn(f=>{const g=f().getAll().find(m=>m.mutationId===e.mutation.mutationId);return g?g.state.isPaused:!1}),c=xn(f=>{const g=f().getAll().find(m=>m.mutationId===e.mutation.mutationId);return g?g.state.status:"idle"}),u=B(()=>Ki({isPaused:l(),status:c()})),d=()=>u()==="gray"?n`
254
+ background-color: ${o(i[u()][200],i[u()][700])};
255
+ color: ${o(i[u()][700],i[u()][300])};
256
+ `:n`
257
+ background-color: ${o(i[u()][200]+s[80],i[u()][900])};
258
+ color: ${o(i[u()][800],i[u()][300])};
259
+ `;return M(ye,{get when(){return a()},get children(){var f=xx(),h=f.firstChild,g=h.nextSibling;return f.$$click=()=>{wx(e.mutation.mutationId===Lr()?null:e.mutation.mutationId)},H(h,M(ye,{get when(){return u()==="purple"},get children(){return M(BL,{})}}),null),H(h,M(ye,{get when(){return u()==="green"},get children(){return M(RL,{})}}),null),H(h,M(ye,{get when(){return u()==="red"},get children(){return M(NL,{})}}),null),H(h,M(ye,{get when(){return u()==="yellow"},get children(){return M(FL,{})}}),null),H(g,M(ye,{get when(){return e.mutation.options.mutationKey},get children(){return[B(()=>JSON.stringify(e.mutation.options.mutationKey))," -"," "]}}),null),H(g,()=>new Date(e.mutation.state.submittedAt).toLocaleString(),null),me(m=>{var p=ne(r().queryRow,Lr()===e.mutation.mutationId&&r().selectedQueryRow,"tsqd-query-row"),b=`Mutation submitted at ${new Date(e.mutation.state.submittedAt).toLocaleString()}`,v=ne(d(),"tsqd-query-observer-count");return p!==m.e&&Q(f,m.e=p),b!==m.t&&G(f,"aria-label",m.t=b),v!==m.a&&Q(h,m.a=v),m},{e:void 0,t:void 0,a:void 0}),f}})},BI=()=>{const e=ft(l=>l().getAll().filter(c=>Bi(c)==="stale").length),t=ft(l=>l().getAll().filter(c=>Bi(c)==="fresh").length),n=ft(l=>l().getAll().filter(c=>Bi(c)==="fetching").length),r=ft(l=>l().getAll().filter(c=>Bi(c)==="paused").length),i=ft(l=>l().getAll().filter(c=>Bi(c)==="inactive").length),s=yt(),o=he().shadowDOMTarget?Te.bind({target:he().shadowDOMTarget}):Te,a=B(()=>s()==="dark"?gn(o):hn(o));return(()=>{var l=Da();return H(l,M(tr,{label:"Fresh",color:"green",get count(){return t()}}),null),H(l,M(tr,{label:"Fetching",color:"blue",get count(){return n()}}),null),H(l,M(tr,{label:"Paused",color:"purple",get count(){return r()}}),null),H(l,M(tr,{label:"Stale",color:"yellow",get count(){return e()}}),null),H(l,M(tr,{label:"Inactive",color:"gray",get count(){return i()}}),null),me(()=>Q(l,ne(a().queryStatusContainer,"tsqd-query-status-container"))),l})()},qI=()=>{const e=xn(a=>a().getAll().filter(l=>Ki({isPaused:l.state.isPaused,status:l.state.status})==="green").length),t=xn(a=>a().getAll().filter(l=>Ki({isPaused:l.state.isPaused,status:l.state.status})==="yellow").length),n=xn(a=>a().getAll().filter(l=>Ki({isPaused:l.state.isPaused,status:l.state.status})==="purple").length),r=xn(a=>a().getAll().filter(l=>Ki({isPaused:l.state.isPaused,status:l.state.status})==="red").length),i=yt(),s=he().shadowDOMTarget?Te.bind({target:he().shadowDOMTarget}):Te,o=B(()=>i()==="dark"?gn(s):hn(s));return(()=>{var a=Da();return H(a,M(tr,{label:"Paused",color:"purple",get count(){return n()}}),null),H(a,M(tr,{label:"Pending",color:"yellow",get count(){return t()}}),null),H(a,M(tr,{label:"Success",color:"green",get count(){return e()}}),null),H(a,M(tr,{label:"Error",color:"red",get count(){return r()}}),null),me(()=>Q(a,ne(o().queryStatusContainer,"tsqd-query-status-container"))),a})()},tr=e=>{const t=yt(),n=he().shadowDOMTarget?Te.bind({target:he().shadowDOMTarget}):Te,r=B(()=>t()==="dark"?gn(n):hn(n)),{colors:i,alpha:s}=z,o=(h,g)=>t()==="dark"?g:h;let a;const[l,c]=ee(!1),[u,d]=ee(!1),f=B(()=>!(Vt()&&wn()<D$&&wn()>Ci||wn()<Ci));return(()=>{var h=kI(),g=h.firstChild,m=g.nextSibling,p=a;return typeof p=="function"?Ls(p,h):a=h,h.addEventListener("mouseleave",()=>{c(!1),d(!1)}),h.addEventListener("mouseenter",()=>c(!0)),h.addEventListener("blur",()=>d(!1)),h.addEventListener("focus",()=>d(!0)),A0(h,_e({get disabled(){return f()},get class(){return ne(r().queryStatusTag,!f()&&n`
260
+ cursor: pointer;
261
+ &:hover {
262
+ background: ${o(i.gray[200],i.darkGray[400])}${s[80]};
263
+ }
264
+ `,"tsqd-query-status-tag",`tsqd-query-status-tag-${e.label.toLowerCase()}`)}},()=>l()||u()?{"aria-describedby":"tsqd-status-tooltip"}:{}),!1,!0),H(h,M(ye,{get when(){return B(()=>!f())()&&(l()||u())},get children(){var b=CI();return H(b,()=>e.label),me(()=>Q(b,ne(r().statusTooltip,"tsqd-query-status-tooltip"))),b}}),g),H(h,M(ye,{get when(){return f()},get children(){var b=_I();return H(b,()=>e.label),me(()=>Q(b,ne(r().queryStatusTagLabel,"tsqd-query-status-tag-label"))),b}}),m),H(m,()=>e.count),me(b=>{var v=ne(n`
265
+ width: ${z.size[1.5]};
266
+ height: ${z.size[1.5]};
267
+ border-radius: ${z.border.radius.full};
268
+ background-color: ${z.colors[e.color][500]};
269
+ `,"tsqd-query-status-tag-dot"),S=ne(r().queryStatusCount,e.count>0&&e.color!=="gray"&&n`
270
+ background-color: ${o(i[e.color][100],i[e.color][900])};
271
+ color: ${o(i[e.color][700],i[e.color][300])};
272
+ `,"tsqd-query-status-tag-count");return v!==b.e&&Q(g,b.e=v),S!==b.t&&Q(m,b.t=S),b},{e:void 0,t:void 0}),h})()},zI=()=>{const e=yt(),t=he().shadowDOMTarget?Te.bind({target:he().shadowDOMTarget}):Te,n=B(()=>e()==="dark"?gn(t):hn(t)),{colors:r}=z,i=(k,P)=>e()==="dark"?P:k,s=he().client,[o,a]=ee(!1),[l,c]=ee("view"),[u,d]=ee(!1),f=B(()=>he().errorTypes||[]),h=ft(k=>k().getAll().find(P=>P.queryHash===Vt()),!1),g=ft(k=>k().getAll().find(P=>P.queryHash===Vt()),!1),m=ft(k=>{var P;return(P=k().getAll().find($=>$.queryHash===Vt()))==null?void 0:P.state},!1),p=ft(k=>{var P;return(P=k().getAll().find($=>$.queryHash===Vt()))==null?void 0:P.state.data},!1),b=ft(k=>{const P=k().getAll().find($=>$.queryHash===Vt());return P?Bi(P):"inactive"}),v=ft(k=>{const P=k().getAll().find($=>$.queryHash===Vt());return P?P.state.status:"pending"}),S=ft(k=>{var P,$;return($=(P=k().getAll().find(j=>j.queryHash===Vt()))==null?void 0:P.getObserversCount())!=null?$:0}),w=B(()=>aC(b())),x=()=>{var P,$;Mn({type:"REFETCH",queryHash:(P=h())==null?void 0:P.queryHash});const k=($=h())==null?void 0:$.fetch();k==null||k.catch(()=>{})},_=k=>{var Z;const P=h();if(!P)return;Mn({type:"TRIGGER_ERROR",queryHash:P.queryHash,metadata:{error:k==null?void 0:k.name}});const $=(Z=k==null?void 0:k.initializer(P))!=null?Z:new Error("Unknown error from devtools"),j=P.options;P.setState({status:"error",error:$,fetchMeta:{...P.state.fetchMeta,__previousQueryOptions:j}})},C=()=>{const k=h();if(!k)return;Mn({type:"RESTORE_LOADING",queryHash:k.queryHash});const P=k.state,$=k.state.fetchMeta?k.state.fetchMeta.__previousQueryOptions:null;k.cancel({silent:!0}),k.setState({...P,fetchStatus:"idle",fetchMeta:null}),$&&k.fetch($)};pe(()=>{b()!=="fetching"&&a(!1)});const A=()=>w()==="gray"?t`
273
+ background-color: ${i(r[w()][200],r[w()][700])};
274
+ color: ${i(r[w()][700],r[w()][300])};
275
+ border-color: ${i(r[w()][400],r[w()][600])};
276
+ `:t`
277
+ background-color: ${i(r[w()][100],r[w()][900])};
278
+ color: ${i(r[w()][700],r[w()][300])};
279
+ border-color: ${i(r[w()][400],r[w()][600])};
280
+ `;return M(ye,{get when(){return B(()=>!!h())()&&m()},get children(){var k=PI(),P=k.firstChild,$=P.nextSibling,j=$.firstChild,Z=j.firstChild,q=Z.firstChild,N=Z.nextSibling,L=j.nextSibling,F=L.firstChild,se=F.nextSibling,de=L.nextSibling,R=de.firstChild,K=R.nextSibling,ae=$.nextSibling,fe=ae.nextSibling,D=fe.firstChild,le=D.firstChild,re=D.nextSibling,we=re.firstChild,X=re.nextSibling,ve=X.firstChild,xe=X.nextSibling,Qe=xe.firstChild,J=xe.nextSibling,rt=J.firstChild,mt=rt.nextSibling,jt=fe.nextSibling;jt.firstChild;var Jt=jt.nextSibling,yn=Jt.nextSibling;return H(q,()=>Bl(h().queryKey,!0)),H(N,b),H(se,S),H(K,()=>new Date(m().dataUpdatedAt).toLocaleTimeString()),D.$$click=x,re.$$click=()=>{var Y;Mn({type:"INVALIDATE",queryHash:(Y=h())==null?void 0:Y.queryHash}),s.invalidateQueries(h())},X.$$click=()=>{var Y;Mn({type:"RESET",queryHash:(Y=h())==null?void 0:Y.queryHash}),s.resetQueries(h())},xe.$$click=()=>{var Y;Mn({type:"REMOVE",queryHash:(Y=h())==null?void 0:Y.queryHash}),s.removeQueries(h()),Kc(null)},J.$$click=()=>{var Y;if(((Y=h())==null?void 0:Y.state.data)===void 0)a(!0),C();else{const Le=h();if(!Le)return;Mn({type:"TRIGGER_LOADING",queryHash:Le.queryHash});const ot=Le.options;Le.fetch({...ot,queryFn:()=>new Promise(()=>{}),gcTime:-1}),Le.setState({data:void 0,status:"pending",fetchMeta:{...Le.state.fetchMeta,__previousQueryOptions:ot}})}},H(J,()=>v()==="pending"?"Restore":"Trigger",mt),H(fe,M(ye,{get when(){return f().length===0||v()==="error"},get children(){var Y=EI(),Le=Y.firstChild,ot=Le.nextSibling;return Y.$$click=()=>{var Ie;h().state.error?(Mn({type:"RESTORE_ERROR",queryHash:(Ie=h())==null?void 0:Ie.queryHash}),s.resetQueries(h())):_()},H(Y,()=>v()==="error"?"Restore":"Trigger",ot),me(Ie=>{var ze=ne(t`
281
+ color: ${i(r.red[500],r.red[400])};
282
+ `,"tsqd-query-details-actions-btn","tsqd-query-details-action-error"),je=v()==="pending",Ye=t`
283
+ background-color: ${i(r.red[500],r.red[400])};
284
+ `;return ze!==Ie.e&&Q(Y,Ie.e=ze),je!==Ie.t&&(Y.disabled=Ie.t=je),Ye!==Ie.a&&Q(Le,Ie.a=Ye),Ie},{e:void 0,t:void 0,a:void 0}),Y}}),null),H(fe,M(ye,{get when(){return!(f().length===0||v()==="error")},get children(){var Y=OI(),Le=Y.firstChild,ot=Le.nextSibling,Ie=ot.nextSibling;return Ie.firstChild,Ie.addEventListener("change",ze=>{const je=f().find(Ye=>Ye.name===ze.currentTarget.value);_(je)}),H(Ie,M(iS,{get each(){return f()},children:ze=>(()=>{var je=MI();return H(je,()=>ze.name),me(()=>je.value=ze.name),je})()}),null),H(Y,M(Oo,{}),null),me(ze=>{var je=ne(n().actionsSelect,"tsqd-query-details-actions-btn","tsqd-query-details-action-error-multiple"),Ye=t`
285
+ background-color: ${z.colors.red[400]};
286
+ `,ie=v()==="pending";return je!==ze.e&&Q(Y,ze.e=je),Ye!==ze.t&&Q(Le,ze.t=Ye),ie!==ze.a&&(Ie.disabled=ze.a=ie),ze},{e:void 0,t:void 0,a:void 0}),Y}}),null),H(jt,()=>l()==="view"?"Explorer":"Editor",null),H(k,M(ye,{get when(){return l()==="view"},get children(){var Y=AI();return H(Y,M($r,{label:"Data",defaultExpanded:["Data"],get value(){return p()},editable:!0,onEdit:()=>c("edit"),get activeQuery(){return h()}})),me(Le=>(Le=z.size[2])!=null?Y.style.setProperty("padding",Le):Y.style.removeProperty("padding")),Y}}),Jt),H(k,M(ye,{get when(){return l()==="edit"},get children(){var Y=TI(),Le=Y.firstChild,ot=Le.nextSibling,Ie=ot.firstChild,ze=Ie.nextSibling,je=ze.firstChild,Ye=je.nextSibling;return Y.addEventListener("submit",ie=>{ie.preventDefault();const ue=new FormData(ie.currentTarget).get("data");try{const Ae=JSON.parse(ue);h().setState({...h().state,data:Ae}),c("view")}catch(Ae){d(!0)}}),Le.addEventListener("focus",()=>d(!1)),H(Ie,()=>u()?"Invalid Value":""),je.$$click=()=>c("view"),me(ie=>{var ce=ne(n().devtoolsEditForm,"tsqd-query-details-data-editor"),ue=n().devtoolsEditTextarea,Ae=u(),Un=n().devtoolsEditFormActions,mn=n().devtoolsEditFormError,Wr=n().devtoolsEditFormActionContainer,Kn=ne(n().devtoolsEditFormAction,t`
287
+ color: ${i(r.gray[600],r.gray[300])};
288
+ `),gr=ne(n().devtoolsEditFormAction,t`
289
+ color: ${i(r.blue[600],r.blue[400])};
290
+ `);return ce!==ie.e&&Q(Y,ie.e=ce),ue!==ie.t&&Q(Le,ie.t=ue),Ae!==ie.a&&G(Le,"data-error",ie.a=Ae),Un!==ie.o&&Q(ot,ie.o=Un),mn!==ie.i&&Q(Ie,ie.i=mn),Wr!==ie.n&&Q(ze,ie.n=Wr),Kn!==ie.s&&Q(je,ie.s=Kn),gr!==ie.h&&Q(Ye,ie.h=gr),ie},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0}),me(()=>Le.value=JSON.stringify(p(),null,2)),Y}}),Jt),H(yn,M($r,{label:"Query",defaultExpanded:["Query","queryKey"],get value(){return g()}})),me(Y=>{var Le=ne(n().detailsContainer,"tsqd-query-details-container"),ot=ne(n().detailsHeader,"tsqd-query-details-header"),Ie=ne(n().detailsBody,"tsqd-query-details-summary-container"),ze=ne(n().queryDetailsStatus,A()),je=ne(n().detailsHeader,"tsqd-query-details-header"),Ye=ne(n().actionsBody,"tsqd-query-details-actions-container"),ie=ne(t`
291
+ color: ${i(r.blue[600],r.blue[400])};
292
+ `,"tsqd-query-details-actions-btn","tsqd-query-details-action-refetch"),ce=b()==="fetching",ue=t`
293
+ background-color: ${i(r.blue[600],r.blue[400])};
294
+ `,Ae=ne(t`
295
+ color: ${i(r.yellow[600],r.yellow[400])};
296
+ `,"tsqd-query-details-actions-btn","tsqd-query-details-action-invalidate"),Un=v()==="pending",mn=t`
297
+ background-color: ${i(r.yellow[600],r.yellow[400])};
298
+ `,Wr=ne(t`
299
+ color: ${i(r.gray[600],r.gray[300])};
300
+ `,"tsqd-query-details-actions-btn","tsqd-query-details-action-reset"),Kn=v()==="pending",gr=t`
301
+ background-color: ${i(r.gray[600],r.gray[400])};
302
+ `,La=ne(t`
303
+ color: ${i(r.pink[500],r.pink[400])};
304
+ `,"tsqd-query-details-actions-btn","tsqd-query-details-action-remove"),Ks=b()==="fetching",Ia=t`
305
+ background-color: ${i(r.pink[500],r.pink[400])};
306
+ `,$i=ne(t`
307
+ color: ${i(r.cyan[500],r.cyan[400])};
308
+ `,"tsqd-query-details-actions-btn","tsqd-query-details-action-loading"),Ra=o(),Ws=t`
309
+ background-color: ${i(r.cyan[500],r.cyan[400])};
310
+ `,Vs=ne(n().detailsHeader,"tsqd-query-details-header"),Gs=ne(n().detailsHeader,"tsqd-query-details-header"),ji=z.size[2];return Le!==Y.e&&Q(k,Y.e=Le),ot!==Y.t&&Q(P,Y.t=ot),Ie!==Y.a&&Q($,Y.a=Ie),ze!==Y.o&&Q(N,Y.o=ze),je!==Y.i&&Q(ae,Y.i=je),Ye!==Y.n&&Q(fe,Y.n=Ye),ie!==Y.s&&Q(D,Y.s=ie),ce!==Y.h&&(D.disabled=Y.h=ce),ue!==Y.r&&Q(le,Y.r=ue),Ae!==Y.d&&Q(re,Y.d=Ae),Un!==Y.l&&(re.disabled=Y.l=Un),mn!==Y.u&&Q(we,Y.u=mn),Wr!==Y.c&&Q(X,Y.c=Wr),Kn!==Y.w&&(X.disabled=Y.w=Kn),gr!==Y.m&&Q(ve,Y.m=gr),La!==Y.f&&Q(xe,Y.f=La),Ks!==Y.y&&(xe.disabled=Y.y=Ks),Ia!==Y.g&&Q(Qe,Y.g=Ia),$i!==Y.p&&Q(J,Y.p=$i),Ra!==Y.b&&(J.disabled=Y.b=Ra),Ws!==Y.T&&Q(rt,Y.T=Ws),Vs!==Y.A&&Q(jt,Y.A=Vs),Gs!==Y.O&&Q(Jt,Y.O=Gs),ji!==Y.I&&((Y.I=ji)!=null?yn.style.setProperty("padding",ji):yn.style.removeProperty("padding")),Y},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0,g:void 0,p:void 0,b:void 0,T:void 0,A:void 0,O:void 0,I:void 0}),k}})},HI=()=>{const e=yt(),t=he().shadowDOMTarget?Te.bind({target:he().shadowDOMTarget}):Te,n=B(()=>e()==="dark"?gn(t):hn(t)),{colors:r}=z,i=(u,d)=>e()==="dark"?d:u,s=xn(u=>{const f=u().getAll().find(h=>h.mutationId===Lr());return f?f.state.isPaused:!1}),o=xn(u=>{const f=u().getAll().find(h=>h.mutationId===Lr());return f?f.state.status:"idle"}),a=B(()=>Ki({isPaused:s(),status:o()})),l=xn(u=>u().getAll().find(d=>d.mutationId===Lr()),!1),c=()=>a()==="gray"?t`
311
+ background-color: ${i(r[a()][200],r[a()][700])};
312
+ color: ${i(r[a()][700],r[a()][300])};
313
+ border-color: ${i(r[a()][400],r[a()][600])};
314
+ `:t`
315
+ background-color: ${i(r[a()][100],r[a()][900])};
316
+ color: ${i(r[a()][700],r[a()][300])};
317
+ border-color: ${i(r[a()][400],r[a()][600])};
318
+ `;return M(ye,{get when(){return l()},get children(){var u=$I(),d=u.firstChild,f=d.nextSibling,h=f.firstChild,g=h.firstChild,m=g.firstChild,p=g.nextSibling,b=h.nextSibling,v=b.firstChild,S=v.nextSibling,w=f.nextSibling,x=w.nextSibling,_=x.nextSibling,C=_.nextSibling,A=C.nextSibling,k=A.nextSibling,P=k.nextSibling,$=P.nextSibling;return H(m,M(ye,{get when(){return l().options.mutationKey},fallback:"No mutationKey found",get children(){return Bl(l().options.mutationKey,!0)}})),H(p,M(ye,{get when(){return a()==="purple"},children:"pending"}),null),H(p,M(ye,{get when(){return a()!=="purple"},get children(){return o()}}),null),H(S,()=>new Date(l().state.submittedAt).toLocaleTimeString()),H(x,M($r,{label:"Variables",defaultExpanded:["Variables"],get value(){return l().state.variables}})),H(C,M($r,{label:"Context",defaultExpanded:["Context"],get value(){return l().state.context}})),H(k,M($r,{label:"Data",defaultExpanded:["Data"],get value(){return l().state.data}})),H($,M($r,{label:"Mutation",defaultExpanded:["Mutation"],get value(){return l()}})),me(j=>{var Z=ne(n().detailsContainer,"tsqd-query-details-container"),q=ne(n().detailsHeader,"tsqd-query-details-header"),N=ne(n().detailsBody,"tsqd-query-details-summary-container"),L=ne(n().queryDetailsStatus,c()),F=ne(n().detailsHeader,"tsqd-query-details-header"),se=z.size[2],de=ne(n().detailsHeader,"tsqd-query-details-header"),R=z.size[2],K=ne(n().detailsHeader,"tsqd-query-details-header"),ae=z.size[2],fe=ne(n().detailsHeader,"tsqd-query-details-header"),D=z.size[2];return Z!==j.e&&Q(u,j.e=Z),q!==j.t&&Q(d,j.t=q),N!==j.a&&Q(f,j.a=N),L!==j.o&&Q(p,j.o=L),F!==j.i&&Q(w,j.i=F),se!==j.n&&((j.n=se)!=null?x.style.setProperty("padding",se):x.style.removeProperty("padding")),de!==j.s&&Q(_,j.s=de),R!==j.h&&((j.h=R)!=null?C.style.setProperty("padding",R):C.style.removeProperty("padding")),K!==j.r&&Q(A,j.r=K),ae!==j.d&&((j.d=ae)!=null?k.style.setProperty("padding",ae):k.style.removeProperty("padding")),fe!==j.l&&Q(P,j.l=fe),D!==j.u&&((j.u=D)!=null?$.style.setProperty("padding",D):$.style.removeProperty("padding")),j},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0}),u}})},lc=new Map,UI=()=>{const e=B(()=>he().client.getQueryCache()),t=e().subscribe(n=>{U2(()=>{for(const[r,i]of lc.entries())i.shouldUpdate(n)&&i.setter(r(e))})});return be(()=>{lc.clear(),t()}),t},ft=(e,t=!0,n=()=>!0)=>{const r=B(()=>he().client.getQueryCache()),[i,s]=ee(e(r),t?void 0:{equals:!1});return pe(()=>{s(e(r))}),lc.set(e,{setter:s,shouldUpdate:n}),be(()=>{lc.delete(e)}),i},cc=new Map,KI=()=>{const e=B(()=>he().client.getMutationCache()),t=e().subscribe(()=>{for(const[n,r]of cc.entries())queueMicrotask(()=>{r(n(e))})});return be(()=>{cc.clear(),t()}),t},xn=(e,t=!0)=>{const n=B(()=>he().client.getMutationCache()),[r,i]=ee(e(n),t?void 0:{equals:!1});return pe(()=>{i(e(n))}),cc.set(e,i),be(()=>{cc.delete(e)}),r},WI="@tanstack/query-devtools-event",Mn=({type:e,queryHash:t,metadata:n})=>{const r=new CustomEvent(WI,{detail:{type:e,queryHash:t,metadata:n},bubbles:!0,cancelable:!0});window.dispatchEvent(r)},Sx=(e,t)=>{const{colors:n,font:r,size:i,alpha:s,shadow:o,border:a}=z,l=(c,u)=>e==="light"?c:u;return{devtoolsBtn:t`
319
+ z-index: 100000;
320
+ position: fixed;
321
+ padding: 4px;
322
+ text-align: left;
323
+
324
+ display: flex;
325
+ align-items: center;
326
+ justify-content: center;
327
+ border-radius: 9999px;
328
+ box-shadow: ${o.md()};
329
+ overflow: hidden;
330
+
331
+ & div {
332
+ position: absolute;
333
+ top: -8px;
334
+ left: -8px;
335
+ right: -8px;
336
+ bottom: -8px;
337
+ border-radius: 9999px;
338
+
339
+ & svg {
340
+ position: absolute;
341
+ width: 100%;
342
+ height: 100%;
343
+ }
344
+ filter: blur(6px) saturate(1.2) contrast(1.1);
345
+ }
346
+
347
+ &:focus-within {
348
+ outline-offset: 2px;
349
+ outline: 3px solid ${n.green[600]};
350
+ }
351
+
352
+ & button {
353
+ position: relative;
354
+ z-index: 1;
355
+ padding: 0;
356
+ border-radius: 9999px;
357
+ background-color: transparent;
358
+ border: none;
359
+ height: 40px;
360
+ display: flex;
361
+ width: 40px;
362
+ overflow: hidden;
363
+ cursor: pointer;
364
+ outline: none;
365
+ & svg {
366
+ position: absolute;
367
+ width: 100%;
368
+ height: 100%;
369
+ }
370
+ }
371
+ `,panel:t`
372
+ position: fixed;
373
+ z-index: 9999;
374
+ display: flex;
375
+ gap: ${z.size[.5]};
376
+ & * {
377
+ box-sizing: border-box;
378
+ text-transform: none;
379
+ }
380
+
381
+ & *::-webkit-scrollbar {
382
+ width: 7px;
383
+ }
384
+
385
+ & *::-webkit-scrollbar-track {
386
+ background: transparent;
387
+ }
388
+
389
+ & *::-webkit-scrollbar-thumb {
390
+ background: ${l(n.gray[300],n.darkGray[200])};
391
+ }
392
+
393
+ & *::-webkit-scrollbar-thumb:hover {
394
+ background: ${l(n.gray[400],n.darkGray[300])};
395
+ }
396
+ `,parentPanel:t`
397
+ z-index: 9999;
398
+ display: flex;
399
+ height: 100%;
400
+ gap: ${z.size[.5]};
401
+ & * {
402
+ box-sizing: border-box;
403
+ text-transform: none;
404
+ }
405
+
406
+ & *::-webkit-scrollbar {
407
+ width: 7px;
408
+ }
409
+
410
+ & *::-webkit-scrollbar-track {
411
+ background: transparent;
412
+ }
413
+
414
+ & *::-webkit-scrollbar-thumb {
415
+ background: ${l(n.gray[300],n.darkGray[200])};
416
+ }
417
+
418
+ & *::-webkit-scrollbar-thumb:hover {
419
+ background: ${l(n.gray[400],n.darkGray[300])};
420
+ }
421
+ `,"devtoolsBtn-position-bottom-right":t`
422
+ bottom: 12px;
423
+ right: 12px;
424
+ `,"devtoolsBtn-position-bottom-left":t`
425
+ bottom: 12px;
426
+ left: 12px;
427
+ `,"devtoolsBtn-position-top-left":t`
428
+ top: 12px;
429
+ left: 12px;
430
+ `,"devtoolsBtn-position-top-right":t`
431
+ top: 12px;
432
+ right: 12px;
433
+ `,"devtoolsBtn-position-relative":t`
434
+ position: relative;
435
+ `,"panel-position-top":t`
436
+ top: 0;
437
+ right: 0;
438
+ left: 0;
439
+ max-height: 90%;
440
+ min-height: ${i[14]};
441
+ border-bottom: ${l(n.gray[400],n.darkGray[300])} 1px solid;
442
+ `,"panel-position-bottom":t`
443
+ bottom: 0;
444
+ right: 0;
445
+ left: 0;
446
+ max-height: 90%;
447
+ min-height: ${i[14]};
448
+ border-top: ${l(n.gray[400],n.darkGray[300])} 1px solid;
449
+ `,"panel-position-right":t`
450
+ bottom: 0;
451
+ right: 0;
452
+ top: 0;
453
+ border-left: ${l(n.gray[400],n.darkGray[300])} 1px solid;
454
+ max-width: 90%;
455
+ `,"panel-position-left":t`
456
+ bottom: 0;
457
+ left: 0;
458
+ top: 0;
459
+ border-right: ${l(n.gray[400],n.darkGray[300])} 1px solid;
460
+ max-width: 90%;
461
+ `,closeBtn:t`
462
+ position: absolute;
463
+ cursor: pointer;
464
+ z-index: 5;
465
+ display: flex;
466
+ align-items: center;
467
+ justify-content: center;
468
+ outline: none;
469
+ background-color: ${l(n.gray[50],n.darkGray[700])};
470
+ &:hover {
471
+ background-color: ${l(n.gray[200],n.darkGray[500])};
472
+ }
473
+ &:focus-visible {
474
+ outline: 2px solid ${n.blue[600]};
475
+ }
476
+ & svg {
477
+ color: ${l(n.gray[600],n.gray[400])};
478
+ width: ${i[2]};
479
+ height: ${i[2]};
480
+ }
481
+ `,"closeBtn-position-top":t`
482
+ bottom: 0;
483
+ right: ${i[2]};
484
+ transform: translate(0, 100%);
485
+ border-right: ${l(n.gray[400],n.darkGray[300])} 1px solid;
486
+ border-left: ${l(n.gray[400],n.darkGray[300])} 1px solid;
487
+ border-top: none;
488
+ border-bottom: ${l(n.gray[400],n.darkGray[300])} 1px solid;
489
+ border-radius: 0px 0px ${a.radius.sm} ${a.radius.sm};
490
+ padding: ${i[.5]} ${i[1.5]} ${i[1]} ${i[1.5]};
491
+
492
+ &::after {
493
+ content: ' ';
494
+ position: absolute;
495
+ bottom: 100%;
496
+ left: -${i[2.5]};
497
+ height: ${i[1.5]};
498
+ width: calc(100% + ${i[5]});
499
+ }
500
+
501
+ & svg {
502
+ transform: rotate(180deg);
503
+ }
504
+ `,"closeBtn-position-bottom":t`
505
+ top: 0;
506
+ right: ${i[2]};
507
+ transform: translate(0, -100%);
508
+ border-right: ${l(n.gray[400],n.darkGray[300])} 1px solid;
509
+ border-left: ${l(n.gray[400],n.darkGray[300])} 1px solid;
510
+ border-top: ${l(n.gray[400],n.darkGray[300])} 1px solid;
511
+ border-bottom: none;
512
+ border-radius: ${a.radius.sm} ${a.radius.sm} 0px 0px;
513
+ padding: ${i[1]} ${i[1.5]} ${i[.5]} ${i[1.5]};
514
+
515
+ &::after {
516
+ content: ' ';
517
+ position: absolute;
518
+ top: 100%;
519
+ left: -${i[2.5]};
520
+ height: ${i[1.5]};
521
+ width: calc(100% + ${i[5]});
522
+ }
523
+ `,"closeBtn-position-right":t`
524
+ bottom: ${i[2]};
525
+ left: 0;
526
+ transform: translate(-100%, 0);
527
+ border-right: none;
528
+ border-left: ${l(n.gray[400],n.darkGray[300])} 1px solid;
529
+ border-top: ${l(n.gray[400],n.darkGray[300])} 1px solid;
530
+ border-bottom: ${l(n.gray[400],n.darkGray[300])} 1px solid;
531
+ border-radius: ${a.radius.sm} 0px 0px ${a.radius.sm};
532
+ padding: ${i[1.5]} ${i[.5]} ${i[1.5]} ${i[1]};
533
+
534
+ &::after {
535
+ content: ' ';
536
+ position: absolute;
537
+ left: 100%;
538
+ height: calc(100% + ${i[5]});
539
+ width: ${i[1.5]};
540
+ }
541
+
542
+ & svg {
543
+ transform: rotate(-90deg);
544
+ }
545
+ `,"closeBtn-position-left":t`
546
+ bottom: ${i[2]};
547
+ right: 0;
548
+ transform: translate(100%, 0);
549
+ border-left: none;
550
+ border-right: ${l(n.gray[400],n.darkGray[300])} 1px solid;
551
+ border-top: ${l(n.gray[400],n.darkGray[300])} 1px solid;
552
+ border-bottom: ${l(n.gray[400],n.darkGray[300])} 1px solid;
553
+ border-radius: 0px ${a.radius.sm} ${a.radius.sm} 0px;
554
+ padding: ${i[1.5]} ${i[1]} ${i[1.5]} ${i[.5]};
555
+
556
+ &::after {
557
+ content: ' ';
558
+ position: absolute;
559
+ right: 100%;
560
+ height: calc(100% + ${i[5]});
561
+ width: ${i[1.5]};
562
+ }
563
+
564
+ & svg {
565
+ transform: rotate(90deg);
566
+ }
567
+ `,queriesContainer:t`
568
+ flex: 1 1 700px;
569
+ background-color: ${l(n.gray[50],n.darkGray[700])};
570
+ display: flex;
571
+ flex-direction: column;
572
+ & * {
573
+ font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
574
+ }
575
+ `,dragHandle:t`
576
+ position: absolute;
577
+ transition: background-color 0.125s ease;
578
+ &:hover {
579
+ background-color: ${n.purple[400]}${l("",s[90])};
580
+ }
581
+ z-index: 4;
582
+ `,"dragHandle-position-top":t`
583
+ bottom: 0;
584
+ width: 100%;
585
+ height: 3px;
586
+ cursor: ns-resize;
587
+ `,"dragHandle-position-bottom":t`
588
+ top: 0;
589
+ width: 100%;
590
+ height: 3px;
591
+ cursor: ns-resize;
592
+ `,"dragHandle-position-right":t`
593
+ left: 0;
594
+ width: 3px;
595
+ height: 100%;
596
+ cursor: ew-resize;
597
+ `,"dragHandle-position-left":t`
598
+ right: 0;
599
+ width: 3px;
600
+ height: 100%;
601
+ cursor: ew-resize;
602
+ `,row:t`
603
+ display: flex;
604
+ justify-content: space-between;
605
+ align-items: center;
606
+ padding: ${z.size[2]} ${z.size[2.5]};
607
+ gap: ${z.size[2.5]};
608
+ border-bottom: ${l(n.gray[300],n.darkGray[500])} 1px solid;
609
+ align-items: center;
610
+ & > button {
611
+ padding: 0;
612
+ background: transparent;
613
+ border: none;
614
+ display: flex;
615
+ gap: ${i[.5]};
616
+ flex-direction: column;
617
+ }
618
+ `,logoAndToggleContainer:t`
619
+ display: flex;
620
+ gap: ${z.size[3]};
621
+ align-items: center;
622
+ `,logo:t`
623
+ cursor: pointer;
624
+ display: flex;
625
+ flex-direction: column;
626
+ background-color: transparent;
627
+ border: none;
628
+ gap: ${z.size[.5]};
629
+ padding: 0px;
630
+ &:hover {
631
+ opacity: 0.7;
632
+ }
633
+ &:focus-visible {
634
+ outline-offset: 4px;
635
+ border-radius: ${a.radius.xs};
636
+ outline: 2px solid ${n.blue[800]};
637
+ }
638
+ `,tanstackLogo:t`
639
+ font-size: ${r.size.md};
640
+ font-weight: ${r.weight.bold};
641
+ line-height: ${r.lineHeight.xs};
642
+ white-space: nowrap;
643
+ color: ${l(n.gray[600],n.gray[300])};
644
+ `,queryFlavorLogo:t`
645
+ font-weight: ${r.weight.semibold};
646
+ font-size: ${r.size.xs};
647
+ background: linear-gradient(
648
+ to right,
649
+ ${l("#ea4037, #ff9b11","#dd524b, #e9a03b")}
650
+ );
651
+ background-clip: text;
652
+ -webkit-background-clip: text;
653
+ line-height: 1;
654
+ -webkit-text-fill-color: transparent;
655
+ white-space: nowrap;
656
+ `,queryStatusContainer:t`
657
+ display: flex;
658
+ gap: ${z.size[2]};
659
+ height: min-content;
660
+ `,queryStatusTag:t`
661
+ display: flex;
662
+ gap: ${z.size[1.5]};
663
+ box-sizing: border-box;
664
+ height: ${z.size[6.5]};
665
+ background: ${l(n.gray[50],n.darkGray[500])};
666
+ color: ${l(n.gray[700],n.gray[300])};
667
+ border-radius: ${z.border.radius.sm};
668
+ font-size: ${r.size.sm};
669
+ padding: ${z.size[1]};
670
+ padding-left: ${z.size[1.5]};
671
+ align-items: center;
672
+ font-weight: ${r.weight.medium};
673
+ border: ${l("1px solid "+n.gray[300],"1px solid transparent")};
674
+ user-select: none;
675
+ position: relative;
676
+ &:focus-visible {
677
+ outline-offset: 2px;
678
+ outline: 2px solid ${n.blue[800]};
679
+ }
680
+ `,queryStatusTagLabel:t`
681
+ font-size: ${r.size.xs};
682
+ `,queryStatusCount:t`
683
+ font-size: ${r.size.xs};
684
+ padding: 0 5px;
685
+ display: flex;
686
+ align-items: center;
687
+ justify-content: center;
688
+ color: ${l(n.gray[500],n.gray[400])};
689
+ background-color: ${l(n.gray[200],n.darkGray[300])};
690
+ border-radius: 2px;
691
+ font-variant-numeric: tabular-nums;
692
+ height: ${z.size[4.5]};
693
+ `,statusTooltip:t`
694
+ position: absolute;
695
+ z-index: 1;
696
+ background-color: ${l(n.gray[50],n.darkGray[500])};
697
+ top: 100%;
698
+ left: 50%;
699
+ transform: translate(-50%, calc(${z.size[2]}));
700
+ padding: ${z.size[.5]} ${z.size[2]};
701
+ border-radius: ${z.border.radius.sm};
702
+ font-size: ${r.size.xs};
703
+ border: 1px solid ${l(n.gray[400],n.gray[600])};
704
+ color: ${l(n.gray[600],n.gray[300])};
705
+
706
+ &::before {
707
+ top: 0px;
708
+ content: ' ';
709
+ display: block;
710
+ left: 50%;
711
+ transform: translate(-50%, -100%);
712
+ position: absolute;
713
+ border-color: transparent transparent
714
+ ${l(n.gray[400],n.gray[600])} transparent;
715
+ border-style: solid;
716
+ border-width: 7px;
717
+ /* transform: rotate(180deg); */
718
+ }
719
+
720
+ &::after {
721
+ top: 0px;
722
+ content: ' ';
723
+ display: block;
724
+ left: 50%;
725
+ transform: translate(-50%, calc(-100% + 2px));
726
+ position: absolute;
727
+ border-color: transparent transparent
728
+ ${l(n.gray[100],n.darkGray[500])} transparent;
729
+ border-style: solid;
730
+ border-width: 7px;
731
+ }
732
+ `,filtersContainer:t`
733
+ display: flex;
734
+ gap: ${z.size[2]};
735
+ & > button {
736
+ cursor: pointer;
737
+ padding: ${z.size[.5]} ${z.size[1.5]} ${z.size[.5]}
738
+ ${z.size[2]};
739
+ border-radius: ${z.border.radius.sm};
740
+ background-color: ${l(n.gray[100],n.darkGray[400])};
741
+ border: 1px solid ${l(n.gray[300],n.darkGray[200])};
742
+ color: ${l(n.gray[700],n.gray[300])};
743
+ font-size: ${r.size.xs};
744
+ display: flex;
745
+ align-items: center;
746
+ line-height: ${r.lineHeight.sm};
747
+ gap: ${z.size[1.5]};
748
+ max-width: 160px;
749
+ &:focus-visible {
750
+ outline-offset: 2px;
751
+ border-radius: ${a.radius.xs};
752
+ outline: 2px solid ${n.blue[800]};
753
+ }
754
+ & svg {
755
+ width: ${z.size[3]};
756
+ height: ${z.size[3]};
757
+ color: ${l(n.gray[500],n.gray[400])};
758
+ }
759
+ }
760
+ `,filterInput:t`
761
+ padding: ${i[.5]} ${i[2]};
762
+ border-radius: ${z.border.radius.sm};
763
+ background-color: ${l(n.gray[100],n.darkGray[400])};
764
+ display: flex;
765
+ box-sizing: content-box;
766
+ align-items: center;
767
+ gap: ${z.size[1.5]};
768
+ max-width: 160px;
769
+ min-width: 100px;
770
+ border: 1px solid ${l(n.gray[300],n.darkGray[200])};
771
+ height: min-content;
772
+ color: ${l(n.gray[600],n.gray[400])};
773
+ & > svg {
774
+ width: ${i[3]};
775
+ height: ${i[3]};
776
+ }
777
+ & input {
778
+ font-size: ${r.size.xs};
779
+ width: 100%;
780
+ background-color: ${l(n.gray[100],n.darkGray[400])};
781
+ border: none;
782
+ padding: 0;
783
+ line-height: ${r.lineHeight.sm};
784
+ color: ${l(n.gray[700],n.gray[300])};
785
+ &::placeholder {
786
+ color: ${l(n.gray[700],n.gray[300])};
787
+ }
788
+ &:focus {
789
+ outline: none;
790
+ }
791
+ }
792
+
793
+ &:focus-within {
794
+ outline-offset: 2px;
795
+ border-radius: ${a.radius.xs};
796
+ outline: 2px solid ${n.blue[800]};
797
+ }
798
+ `,filterSelect:t`
799
+ padding: ${z.size[.5]} ${z.size[2]};
800
+ border-radius: ${z.border.radius.sm};
801
+ background-color: ${l(n.gray[100],n.darkGray[400])};
802
+ display: flex;
803
+ align-items: center;
804
+ gap: ${z.size[1.5]};
805
+ box-sizing: content-box;
806
+ max-width: 160px;
807
+ border: 1px solid ${l(n.gray[300],n.darkGray[200])};
808
+ height: min-content;
809
+ & > svg {
810
+ color: ${l(n.gray[600],n.gray[400])};
811
+ width: ${z.size[2]};
812
+ height: ${z.size[2]};
813
+ }
814
+ & > select {
815
+ appearance: none;
816
+ color: ${l(n.gray[700],n.gray[300])};
817
+ min-width: 100px;
818
+ line-height: ${r.lineHeight.sm};
819
+ font-size: ${r.size.xs};
820
+ background-color: ${l(n.gray[100],n.darkGray[400])};
821
+ border: none;
822
+ &:focus {
823
+ outline: none;
824
+ }
825
+ }
826
+ &:focus-within {
827
+ outline-offset: 2px;
828
+ border-radius: ${a.radius.xs};
829
+ outline: 2px solid ${n.blue[800]};
830
+ }
831
+ `,actionsContainer:t`
832
+ display: flex;
833
+ gap: ${z.size[2]};
834
+ `,actionsBtn:t`
835
+ border-radius: ${z.border.radius.sm};
836
+ background-color: ${l(n.gray[100],n.darkGray[400])};
837
+ border: 1px solid ${l(n.gray[300],n.darkGray[200])};
838
+ width: ${z.size[6.5]};
839
+ height: ${z.size[6.5]};
840
+ justify-content: center;
841
+ display: flex;
842
+ align-items: center;
843
+ gap: ${z.size[1.5]};
844
+ max-width: 160px;
845
+ cursor: pointer;
846
+ padding: 0;
847
+ &:hover {
848
+ background-color: ${l(n.gray[200],n.darkGray[500])};
849
+ }
850
+ & svg {
851
+ color: ${l(n.gray[700],n.gray[300])};
852
+ width: ${z.size[3]};
853
+ height: ${z.size[3]};
854
+ }
855
+ &:focus-visible {
856
+ outline-offset: 2px;
857
+ border-radius: ${a.radius.xs};
858
+ outline: 2px solid ${n.blue[800]};
859
+ }
860
+ `,actionsBtnOffline:t`
861
+ & svg {
862
+ stroke: ${l(n.yellow[700],n.yellow[500])};
863
+ fill: ${l(n.yellow[700],n.yellow[500])};
864
+ }
865
+ `,overflowQueryContainer:t`
866
+ flex: 1;
867
+ overflow-y: auto;
868
+ & > div {
869
+ display: flex;
870
+ flex-direction: column;
871
+ }
872
+ `,queryRow:t`
873
+ display: flex;
874
+ align-items: center;
875
+ padding: 0;
876
+ border: none;
877
+ cursor: pointer;
878
+ color: ${l(n.gray[700],n.gray[300])};
879
+ background-color: ${l(n.gray[50],n.darkGray[700])};
880
+ line-height: 1;
881
+ &:focus {
882
+ outline: none;
883
+ }
884
+ &:focus-visible {
885
+ outline-offset: -2px;
886
+ border-radius: ${a.radius.xs};
887
+ outline: 2px solid ${n.blue[800]};
888
+ }
889
+ &:hover .tsqd-query-hash {
890
+ background-color: ${l(n.gray[200],n.darkGray[600])};
891
+ }
892
+
893
+ & .tsqd-query-observer-count {
894
+ padding: 0 ${z.size[1]};
895
+ user-select: none;
896
+ min-width: ${z.size[6.5]};
897
+ align-self: stretch;
898
+ display: flex;
899
+ align-items: center;
900
+ justify-content: center;
901
+ font-size: ${r.size.xs};
902
+ font-weight: ${r.weight.medium};
903
+ border-bottom-width: 1px;
904
+ border-bottom-style: solid;
905
+ border-bottom: 1px solid ${l(n.gray[300],n.darkGray[700])};
906
+ }
907
+ & .tsqd-query-hash {
908
+ user-select: text;
909
+ font-size: ${r.size.xs};
910
+ display: flex;
911
+ align-items: center;
912
+ min-height: ${z.size[6]};
913
+ flex: 1;
914
+ padding: ${z.size[1]} ${z.size[2]};
915
+ font-family:
916
+ ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
917
+ 'Liberation Mono', 'Courier New', monospace;
918
+ border-bottom: 1px solid ${l(n.gray[300],n.darkGray[400])};
919
+ text-align: left;
920
+ text-overflow: clip;
921
+ word-break: break-word;
922
+ }
923
+
924
+ & .tsqd-query-disabled-indicator {
925
+ align-self: stretch;
926
+ display: flex;
927
+ align-items: center;
928
+ padding: 0 ${z.size[2]};
929
+ color: ${l(n.gray[800],n.gray[300])};
930
+ background-color: ${l(n.gray[300],n.darkGray[600])};
931
+ border-bottom: 1px solid ${l(n.gray[300],n.darkGray[400])};
932
+ font-size: ${r.size.xs};
933
+ }
934
+
935
+ & .tsqd-query-static-indicator {
936
+ align-self: stretch;
937
+ display: flex;
938
+ align-items: center;
939
+ padding: 0 ${z.size[2]};
940
+ color: ${l(n.teal[800],n.teal[300])};
941
+ background-color: ${l(n.teal[100],n.teal[900])};
942
+ border-bottom: 1px solid ${l(n.teal[300],n.teal[700])};
943
+ font-size: ${r.size.xs};
944
+ }
945
+ `,selectedQueryRow:t`
946
+ background-color: ${l(n.gray[200],n.darkGray[500])};
947
+ `,detailsContainer:t`
948
+ flex: 1 1 700px;
949
+ background-color: ${l(n.gray[50],n.darkGray[700])};
950
+ color: ${l(n.gray[700],n.gray[300])};
951
+ font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
952
+ display: flex;
953
+ flex-direction: column;
954
+ overflow-y: auto;
955
+ display: flex;
956
+ text-align: left;
957
+ `,detailsHeader:t`
958
+ font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
959
+ position: sticky;
960
+ top: 0;
961
+ z-index: 2;
962
+ background-color: ${l(n.gray[200],n.darkGray[600])};
963
+ padding: ${z.size[1.5]} ${z.size[2]};
964
+ font-weight: ${r.weight.medium};
965
+ font-size: ${r.size.xs};
966
+ line-height: ${r.lineHeight.xs};
967
+ text-align: left;
968
+ `,detailsBody:t`
969
+ margin: ${z.size[1.5]} 0px ${z.size[2]} 0px;
970
+ & > div {
971
+ display: flex;
972
+ align-items: stretch;
973
+ padding: 0 ${z.size[2]};
974
+ line-height: ${r.lineHeight.sm};
975
+ justify-content: space-between;
976
+ & > span {
977
+ font-size: ${r.size.xs};
978
+ }
979
+ & > span:nth-child(2) {
980
+ font-variant-numeric: tabular-nums;
981
+ }
982
+ }
983
+
984
+ & > div:first-child {
985
+ margin-bottom: ${z.size[1.5]};
986
+ }
987
+
988
+ & code {
989
+ font-family:
990
+ ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
991
+ 'Liberation Mono', 'Courier New', monospace;
992
+ margin: 0;
993
+ font-size: ${r.size.xs};
994
+ line-height: ${r.lineHeight.xs};
995
+ }
996
+
997
+ & pre {
998
+ margin: 0;
999
+ display: flex;
1000
+ align-items: center;
1001
+ }
1002
+ `,queryDetailsStatus:t`
1003
+ border: 1px solid ${n.darkGray[200]};
1004
+ border-radius: ${z.border.radius.sm};
1005
+ font-weight: ${r.weight.medium};
1006
+ padding: ${z.size[1]} ${z.size[2.5]};
1007
+ `,actionsBody:t`
1008
+ flex-wrap: wrap;
1009
+ margin: ${z.size[2]} 0px ${z.size[2]} 0px;
1010
+ display: flex;
1011
+ gap: ${z.size[2]};
1012
+ padding: 0px ${z.size[2]};
1013
+ & > button {
1014
+ font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
1015
+ font-size: ${r.size.xs};
1016
+ padding: ${z.size[1]} ${z.size[2]};
1017
+ display: flex;
1018
+ border-radius: ${z.border.radius.sm};
1019
+ background-color: ${l(n.gray[100],n.darkGray[600])};
1020
+ border: 1px solid ${l(n.gray[300],n.darkGray[400])};
1021
+ align-items: center;
1022
+ gap: ${z.size[2]};
1023
+ font-weight: ${r.weight.medium};
1024
+ line-height: ${r.lineHeight.xs};
1025
+ cursor: pointer;
1026
+ &:focus-visible {
1027
+ outline-offset: 2px;
1028
+ border-radius: ${a.radius.xs};
1029
+ outline: 2px solid ${n.blue[800]};
1030
+ }
1031
+ &:hover {
1032
+ background-color: ${l(n.gray[200],n.darkGray[500])};
1033
+ }
1034
+
1035
+ &:disabled {
1036
+ opacity: 0.6;
1037
+ cursor: not-allowed;
1038
+ }
1039
+
1040
+ & > span {
1041
+ width: ${i[1.5]};
1042
+ height: ${i[1.5]};
1043
+ border-radius: ${z.border.radius.full};
1044
+ }
1045
+ }
1046
+ `,actionsSelect:t`
1047
+ font-size: ${r.size.xs};
1048
+ padding: ${z.size[.5]} ${z.size[2]};
1049
+ display: flex;
1050
+ border-radius: ${z.border.radius.sm};
1051
+ overflow: hidden;
1052
+ background-color: ${l(n.gray[100],n.darkGray[600])};
1053
+ border: 1px solid ${l(n.gray[300],n.darkGray[400])};
1054
+ align-items: center;
1055
+ gap: ${z.size[2]};
1056
+ font-weight: ${r.weight.medium};
1057
+ line-height: ${r.lineHeight.sm};
1058
+ color: ${l(n.red[500],n.red[400])};
1059
+ cursor: pointer;
1060
+ position: relative;
1061
+ &:hover {
1062
+ background-color: ${l(n.gray[200],n.darkGray[500])};
1063
+ }
1064
+ & > span {
1065
+ width: ${i[1.5]};
1066
+ height: ${i[1.5]};
1067
+ border-radius: ${z.border.radius.full};
1068
+ }
1069
+ &:focus-within {
1070
+ outline-offset: 2px;
1071
+ border-radius: ${a.radius.xs};
1072
+ outline: 2px solid ${n.blue[800]};
1073
+ }
1074
+ & select {
1075
+ position: absolute;
1076
+ top: 0;
1077
+ left: 0;
1078
+ width: 100%;
1079
+ height: 100%;
1080
+ appearance: none;
1081
+ background-color: transparent;
1082
+ border: none;
1083
+ color: transparent;
1084
+ outline: none;
1085
+ }
1086
+
1087
+ & svg path {
1088
+ stroke: ${z.colors.red[400]};
1089
+ }
1090
+ & svg {
1091
+ width: ${z.size[2]};
1092
+ height: ${z.size[2]};
1093
+ }
1094
+ `,settingsMenu:t`
1095
+ display: flex;
1096
+ & * {
1097
+ font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
1098
+ }
1099
+ flex-direction: column;
1100
+ gap: ${i[.5]};
1101
+ border-radius: ${z.border.radius.sm};
1102
+ border: 1px solid ${l(n.gray[300],n.gray[700])};
1103
+ background-color: ${l(n.gray[50],n.darkGray[600])};
1104
+ font-size: ${r.size.xs};
1105
+ color: ${l(n.gray[700],n.gray[300])};
1106
+ z-index: 99999;
1107
+ min-width: 120px;
1108
+ padding: ${i[.5]};
1109
+ `,settingsSubTrigger:t`
1110
+ display: flex;
1111
+ align-items: center;
1112
+ justify-content: space-between;
1113
+ border-radius: ${z.border.radius.xs};
1114
+ padding: ${z.size[1]} ${z.size[1]};
1115
+ cursor: pointer;
1116
+ background-color: transparent;
1117
+ border: none;
1118
+ color: ${l(n.gray[700],n.gray[300])};
1119
+ & svg {
1120
+ color: ${l(n.gray[600],n.gray[400])};
1121
+ transform: rotate(-90deg);
1122
+ width: ${z.size[2]};
1123
+ height: ${z.size[2]};
1124
+ }
1125
+ &:hover {
1126
+ background-color: ${l(n.gray[200],n.darkGray[500])};
1127
+ }
1128
+ &:focus-visible {
1129
+ outline-offset: 2px;
1130
+ outline: 2px solid ${n.blue[800]};
1131
+ }
1132
+ &.data-disabled {
1133
+ opacity: 0.6;
1134
+ cursor: not-allowed;
1135
+ }
1136
+ `,settingsMenuHeader:t`
1137
+ padding: ${z.size[1]} ${z.size[1]};
1138
+ font-weight: ${r.weight.medium};
1139
+ border-bottom: 1px solid ${l(n.gray[300],n.darkGray[400])};
1140
+ color: ${l(n.gray[500],n.gray[400])};
1141
+ font-size: ${r.size.xs};
1142
+ `,settingsSubButton:t`
1143
+ display: flex;
1144
+ align-items: center;
1145
+ justify-content: space-between;
1146
+ color: ${l(n.gray[700],n.gray[300])};
1147
+ font-size: ${r.size.xs};
1148
+ border-radius: ${z.border.radius.xs};
1149
+ padding: ${z.size[1]} ${z.size[1]};
1150
+ cursor: pointer;
1151
+ background-color: transparent;
1152
+ border: none;
1153
+ & svg {
1154
+ color: ${l(n.gray[600],n.gray[400])};
1155
+ }
1156
+ &:hover {
1157
+ background-color: ${l(n.gray[200],n.darkGray[500])};
1158
+ }
1159
+ &:focus-visible {
1160
+ outline-offset: 2px;
1161
+ outline: 2px solid ${n.blue[800]};
1162
+ }
1163
+ `,themeSelectedButton:t`
1164
+ background-color: ${l(n.purple[100],n.purple[900])};
1165
+ color: ${l(n.purple[700],n.purple[300])};
1166
+ & svg {
1167
+ color: ${l(n.purple[700],n.purple[300])};
1168
+ }
1169
+ &:hover {
1170
+ background-color: ${l(n.purple[100],n.purple[900])};
1171
+ }
1172
+ `,viewToggle:t`
1173
+ border-radius: ${z.border.radius.sm};
1174
+ background-color: ${l(n.gray[200],n.darkGray[600])};
1175
+ border: 1px solid ${l(n.gray[300],n.darkGray[200])};
1176
+ display: flex;
1177
+ padding: 0;
1178
+ font-size: ${r.size.xs};
1179
+ color: ${l(n.gray[700],n.gray[300])};
1180
+ overflow: hidden;
1181
+
1182
+ &:has(:focus-visible) {
1183
+ outline: 2px solid ${n.blue[800]};
1184
+ }
1185
+
1186
+ & .tsqd-radio-toggle {
1187
+ opacity: 0.5;
1188
+ display: flex;
1189
+ & label {
1190
+ display: flex;
1191
+ align-items: center;
1192
+ cursor: pointer;
1193
+ line-height: ${r.lineHeight.md};
1194
+ }
1195
+
1196
+ & label:hover {
1197
+ background-color: ${l(n.gray[100],n.darkGray[500])};
1198
+ }
1199
+ }
1200
+
1201
+ & > [data-checked] {
1202
+ opacity: 1;
1203
+ background-color: ${l(n.gray[100],n.darkGray[400])};
1204
+ & label:hover {
1205
+ background-color: ${l(n.gray[100],n.darkGray[400])};
1206
+ }
1207
+ }
1208
+
1209
+ & .tsqd-radio-toggle:first-child {
1210
+ & label {
1211
+ padding: 0 ${z.size[1.5]} 0 ${z.size[2]};
1212
+ }
1213
+ border-right: 1px solid ${l(n.gray[300],n.darkGray[200])};
1214
+ }
1215
+
1216
+ & .tsqd-radio-toggle:nth-child(2) {
1217
+ & label {
1218
+ padding: 0 ${z.size[2]} 0 ${z.size[1.5]};
1219
+ }
1220
+ }
1221
+ `,devtoolsEditForm:t`
1222
+ padding: ${i[2]};
1223
+ & > [data-error='true'] {
1224
+ outline: 2px solid ${l(n.red[200],n.red[800])};
1225
+ outline-offset: 2px;
1226
+ border-radius: ${a.radius.xs};
1227
+ }
1228
+ `,devtoolsEditTextarea:t`
1229
+ width: 100%;
1230
+ max-height: 500px;
1231
+ font-family: 'Fira Code', monospace;
1232
+ font-size: ${r.size.xs};
1233
+ border-radius: ${a.radius.sm};
1234
+ field-sizing: content;
1235
+ padding: ${i[2]};
1236
+ background-color: ${l(n.gray[100],n.darkGray[800])};
1237
+ color: ${l(n.gray[900],n.gray[100])};
1238
+ border: 1px solid ${l(n.gray[200],n.gray[700])};
1239
+ resize: none;
1240
+ &:focus {
1241
+ outline-offset: 2px;
1242
+ border-radius: ${a.radius.xs};
1243
+ outline: 2px solid ${l(n.blue[200],n.blue[800])};
1244
+ }
1245
+ `,devtoolsEditFormActions:t`
1246
+ display: flex;
1247
+ justify-content: space-between;
1248
+ gap: ${i[2]};
1249
+ align-items: center;
1250
+ padding-top: ${i[1]};
1251
+ font-size: ${r.size.xs};
1252
+ `,devtoolsEditFormError:t`
1253
+ color: ${l(n.red[700],n.red[500])};
1254
+ `,devtoolsEditFormActionContainer:t`
1255
+ display: flex;
1256
+ gap: ${i[2]};
1257
+ `,devtoolsEditFormAction:t`
1258
+ font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
1259
+ font-size: ${r.size.xs};
1260
+ padding: ${i[1]} ${z.size[2]};
1261
+ display: flex;
1262
+ border-radius: ${a.radius.sm};
1263
+ background-color: ${l(n.gray[100],n.darkGray[600])};
1264
+ border: 1px solid ${l(n.gray[300],n.darkGray[400])};
1265
+ align-items: center;
1266
+ gap: ${i[2]};
1267
+ font-weight: ${r.weight.medium};
1268
+ line-height: ${r.lineHeight.xs};
1269
+ cursor: pointer;
1270
+ &:focus-visible {
1271
+ outline-offset: 2px;
1272
+ border-radius: ${a.radius.xs};
1273
+ outline: 2px solid ${n.blue[800]};
1274
+ }
1275
+ &:hover {
1276
+ background-color: ${l(n.gray[200],n.darkGray[500])};
1277
+ }
1278
+
1279
+ &:disabled {
1280
+ opacity: 0.6;
1281
+ cursor: not-allowed;
1282
+ }
1283
+ `}},hn=e=>Sx("light",e),gn=e=>Sx("dark",e);mc(["click","mousedown","input"]);var VI=e=>{const[t,n]=Hv({prefix:"TanstackQueryDevtools"}),r=Q0(),i=B(()=>{const s=t.theme_preference||Uv;return s!=="system"?s:r()});return M(Rf.Provider,{value:e,get children(){return M(Gv,{localStore:t,setLocalStore:n,get children(){return M(Nf.Provider,{value:i,get children(){return M(DI,{localStore:t,setLocalStore:n})}})}})}})},GI=VI;const QI=Object.freeze(Object.defineProperty({__proto__:null,default:GI},Symbol.toStringTag,{value:"Module"}));var YI=e=>{const[t,n]=Hv({prefix:"TanstackQueryDevtools"}),r=Q0(),i=B(()=>{const s=t.theme_preference||Uv;return s!=="system"?s:r()});return M(Rf.Provider,{value:e,get children(){return M(Gv,{disabled:!0,localStore:t,setLocalStore:n,get children(){return M(Nf.Provider,{value:i,get children(){return M(II,{get children(){return M(sh,{localStore:t,setLocalStore:n,get onClose(){return e.onClose},showPanelViewOnly:!0})}})}})}})}})},XI=YI;const JI=Object.freeze(Object.defineProperty({__proto__:null,default:XI},Symbol.toStringTag,{value:"Module"}));function sa(e){"@babel/helpers - typeof";return sa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sa(e)}function ap(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ri(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ap(Object(n),!0).forEach(function(r){Ml(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ap(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ml(e,t,n){return(t=ZI(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZI(e){var t=eR(e,"string");return sa(t)=="symbol"?t:t+""}function eR(e,t){if(sa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(sa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function An(e,t){return iR(e)||rR(e,t)||nR(e,t)||tR()}function tR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1284
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nR(e,t){if(e){if(typeof e=="string")return lp(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lp(e,t):void 0}}function lp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function rR(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function iR(e){if(Array.isArray(e))return e}var sR=function(){var t,n=zr(),r=W.useState(!1),i=An(r,2),s=i[0],o=i[1],a=W.useState({}),l=An(a,2),c=l[0],u=l[1],d=W.useState(""),f=An(d,2),h=f[0],g=f[1],m=W.useState(1),p=An(m,2),b=p[0],v=p[1],S=W.useState({}),w=An(S,2),x=w[0],_=w[1],C=W.useState(!1),A=An(C,2),k=A[0],P=A[1],$=W.useState(""),j=An($,2),Z=j[0],q=j[1],N=W.useState([]),L=An(N,2),F=L[0],se=L[1],de=zt(),R=de.brandId;function K(ie){var ce;if(!ie)return"";if(typeof ie=="string")return ie;var ue=(ce=ie.id)!==null&&ce!==void 0?ce:"";return String(ue)}var ae=kk(R,{query:{enabled:!!R}}),fe=ae.data,D=ae.isLoading,le=Ak({mutation:{onSuccess:function(ce){console.log("Group created successfully",ce)},onError:function(ce){console.error("Error creating group:",ce)}}}),re=le.mutate,we=le.isPending,X=10,ve=(fe==null||(t=fe.data)===null||t===void 0||(t=t.associatedBrands)===null||t===void 0?void 0:t.filter(function(ie){var ce,ue;return h?((ce=(ue=ie.name)===null||ue===void 0?void 0:ue.toLowerCase())!==null&&ce!==void 0?ce:"").includes(h.toLowerCase()):!0}))||[],xe=Math.ceil(ve.length/X),Qe=(b-1)*X,J=ve.slice(Qe,Qe+X),rt=function(ce){console.log("Edit brand:",ce)},mt=Object.entries(x).filter(function(ie){var ce=An(ie,2),ue=ce[1];return ue}).map(function(ie){var ce=An(ie,1),ue=ce[0];return ue}),jt=function(){console.log("Group brands:",mt);var ce=ve.filter(function(ue){return mt.includes(K(ue))}).map(function(ue){return ue.name});q(ce.length>0&&ce[0]?ce[0]:"New Group"),se(mt),P(!0)},Jt=function(ce){g(ce.target.value),v(1)},yn=function(ce){_(function(ue){return Ri(Ri({},ue),{},Ml({},ce,!ue[ce]))})},Y=function(){n("/")},Le=function(ce){_(function(ue){return Ri(Ri({},ue),{},Ml({},K(ce),!1))}),u(function(ue){var Ae=K(ce),Un=Ae in ue?!ue[Ae]:ce.isHidden!==!0,mn=Ri(Ri({},ue),{},Ml({},Ae,Un));return mn}),o(!0)},ot=function(){_({}),u({}),o(!1)},Ie=function(){P(!1),q(""),se([])},ze=function(){!Z.trim()||F.length===0||(re({brandId:R,data:{groupName:Z.trim(),brandIds:F}}),Ie())},je=function(ce,ue){return ce in c?!!c[ce]:ue.isHidden!==!0},Ye=[{Header:"Brand name",accessor:"name",Cell:function(ce){var ue=ce.value,Ae=ce.row;return y.jsx("span",{className:"yst-font-medium yst-text-slate-900",children:y.jsx(O.Checkbox,{id:"brand-checkbox-".concat(Ae.id),checked:!!x[K(Ae)],onChange:function(){return yn(K(Ae))},value:K(Ae),label:y.jsxs("span",{className:"yst-flex yst-items-center yst-gap-1",children:[Ae.type==="group"&&y.jsx(kO,{className:"yst-h-4 yst-w-4 yst-text-slate-400"}),ue]}),name:"brand-checkbox-".concat(Ae.id),disabled:!je(K(Ae),Ae)})})},LoadingComponent:function(ce){var ue=ce.id,Ae=ue===void 0?"":ue;return y.jsxs("div",{className:"yst-flex",children:[y.jsx(O.Checkbox,{id:"loading-row-checkbox-".concat(Ae),value:"loading...",disabled:!0,name:"brand-checkbox-".concat(Ae)})," ",y.jsx(O.SkeletonLoader,{className:"yst-h-6 yst-w-32",id:"loading-row-skeleton-".concat(Ae)})]})}},{Header:"Mentions",accessor:"mentionsFound",Cell:function(ce){var ue=ce.row;return y.jsxs("span",{className:Se("yst-text-sm"),children:[y.jsx("span",{className:Se({"yst-text-slate-900":je(K(ue),ue),"yst-text-slate-400":!je(K(ue),ue)}),children:0})," ",y.jsxs("span",{className:Se({"yst-text-slate-500":je(K(ue),ue),"yst-text-slate-300":!je(K(ue),ue)}),children:["/ ",0]})]})},LoadingComponent:function(){return y.jsx(O.SkeletonLoader,{className:"yst-h-6 yst-w-8"})}},{Header:"Actions",accessor:"id",Cell:function(ce){var ue=ce.value,Ae=ce.row;return y.jsx(y.Fragment,{children:Ae.type==="group"?y.jsxs(O.Button,{variant:"tertiary",size:"small",onClick:function(){return rt(String(ue!=null?ue:""))},className:"yst-gap-1.5 yst-px-0",disabled:!je(K(Ae),Ae),children:[y.jsx(Sd,{className:"yst-h-4 yst-w-4"}),"Edit group"]}):y.jsxs(O.Button,{variant:"tertiary",size:"small",onClick:function(){return rt(String(ue!=null?ue:""))},className:"yst-gap-1.5 yst-px-0",disabled:!je(K(Ae),Ae),children:[y.jsx(Sd,{className:"yst-h-4 yst-w-4"}),"Rename"]})})},LoadingComponent:function(){return y.jsx(O.SkeletonLoader,{className:"yst-h-6 yst-w-24"})}},{Header:"Exclude",accessor:"included",Cell:function(ce){var ue=ce.row;return y.jsx(O.Button,{variant:"tertiary",size:"small",onClick:function(){return Le(ue)},className:"yst-gap-1.5 yst-px-0",children:je(K(ue),ue)?y.jsxs(y.Fragment,{children:[y.jsx(HE,{className:"yst-h-4 yst-w-4"})," Exclude"]}):y.jsxs(y.Fragment,{children:[y.jsx(KE,{className:"yst-h-4 yst-w-4"})," Include"]})})},LoadingComponent:function(){return y.jsx(O.SkeletonLoader,{className:"yst-h-6 yst-w-20"})}}];return y.jsxs(O.Paper,{className:"yst-mx-auto yst-max-w-2xl",children:[y.jsx(mf,{title:"Brand list ".concat(""),children:y.jsx("p",{children:"These are the brands found in responses to your example prompts. Group related brands to improve your analysis. You can rename or exclude irrelevant brands, and new brands will be added automatically if they appear in future analysis runs."})}),y.jsxs(O.Paper.Content,{children:[y.jsx("div",{className:"yst-mb-6",children:y.jsx(O.TextInput,{id:"brand-search",label:"Search brands",placeholder:"Search brands",value:h,onChange:Jt})}),y.jsx("div",{className:"yst-mb-6",children:y.jsxs(O.Table,{columns:Ye,className:"yst-w-full",variant:"minimal",children:[y.jsx(O.Table.Head,{children:y.jsx(O.Table.Row,{children:Ye.map(function(ie){return y.jsx(O.Table.Header,{children:ie.Header},ie.accessor)})})}),y.jsx(O.Table.Body,{children:D?[1,2,3].map(function(ie,ce){return y.jsx(O.Table.Row,{children:Ye.map(function(ue,Ae){return y.jsx(O.Table.Cell,{children:y.jsx(ue.LoadingComponent,{id:"skeleton-".concat(ce,"-").concat(Ae)},ue.accessor)},"cell-".concat(Ae))})},ce)}):J.length===0?y.jsx(O.Table.Row,{children:y.jsx(O.Table.Cell,{colSpan:Ye.length,children:y.jsxs("div",{className:"yst-py-12 yst-text-center",children:[y.jsx("h3",{className:"yst-mt-4 yst-text-lg yst-font-medium yst-text-slate-900",children:"No brands found"}),y.jsx("p",{className:"yst-mt-2 yst-text-sm yst-text-slate-500",children:h?'No brands match "'.concat(h,'". Try a different search term.'):"No brands have been found yet. Run an analysis to discover brands."}),h&&y.jsx(O.Button,{variant:"secondary",size:"small",onClick:function(){g(""),v(1)},className:"yst-mt-4",children:"Clear search"})]})})}):J.map(function(ie){return y.jsx(O.Table.Row,{children:Ye.map(function(ce){return y.jsx(O.Table.Cell,{children:ce.Cell?ce.Cell({value:ie[ce.accessor],row:ie}):ie[ce.accessor]},ce.accessor)})},ie.id)})})]})}),y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between",children:[y.jsxs(O.Button,{variant:"secondary",onClick:jt,className:"yst-mb-0 yst-gap-2",disabled:mt.length<2,children:[y.jsx(eO,{})," Group brands"]}),y.jsx(O.Pagination,{variant:"text",current:b,total:xe,onNavigate:v,className:"yst-flex-row",screenReaderTextPrevious:"Previous page",screenReaderTextNext:"Next page"})]})]}),y.jsx(bf,{children:y.jsx("div",{className:"yst-flex yst-items-center yst-justify-end yst-gap-4",children:s?y.jsxs(y.Fragment,{children:[y.jsx(O.Button,{variant:"secondary",className:"yst-mb-0",onClick:ot,children:"Discard changes"}),y.jsx(O.Button,{variant:"primary",className:"yst-mb-0",onClick:Y,children:"Save changes"})]}):y.jsx(O.Button,{as:Hr,to:"/",variant:"primary",className:"yst-mb-0",children:"Show analysis โ†’"})})}),y.jsx(O.Modal,{isOpen:k,onClose:Ie,children:y.jsx(O.Modal.Panel,{children:y.jsxs(O.Modal.Container,{children:[y.jsx(O.Modal.Container.Header,{children:y.jsx(O.Modal.Title,{children:"Edit brand group"})}),y.jsxs(O.Modal.Container.Content,{className:"yst-space-y-4",children:[y.jsxs("div",{children:[y.jsx("label",{htmlFor:"groupName",className:"yst-mb-2 yst-block yst-text-sm yst-font-medium",children:"Group name"}),y.jsx(O.TextInput,{id:"groupName",value:Z,onChange:function(ie){return q(ie.target.value)},placeholder:"Enter group name",className:"yst-w-full"})]}),y.jsxs("div",{children:[F.length&&y.jsxs(O.Label,{className:"yst-mb-2 yst-block yst-text-sm yst-font-medium",children:["Brands in group (",F.length,")"]}),y.jsx("div",{className:"yst-max-h-40 yst-space-y-2 yst-overflow-y-auto",children:F.map(function(ie){var ce=ve.find(function(ue){return K(ue)===ie});return ce&&y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between yst-rounded yst-bg-gray-50 yst-p-2",children:[y.jsx("span",{className:"yst-text-sm",children:ce.name}),y.jsx(O.Button,{variant:"ghost",size:"small",onClick:function(){return se(function(ue){return ue.filter(function(Ae){return Ae!==ie})})},className:"yst-hover:text-red-700 yst-text-red-500",children:"Remove"})]},ie)})}),F.length===0&&y.jsx("p",{className:"yst-text-sm yst-italic yst-text-gray-500",children:"No brands selected"})]})]}),y.jsx(O.Modal.Container.Footer,{children:y.jsxs("div",{className:"yst-flex yst-justify-end yst-gap-2",children:[y.jsx(O.Button,{variant:"secondary",onClick:Ie,disabled:we,children:"Cancel"}),y.jsx(O.Button,{variant:"primary",onClick:ze,disabled:!Z.trim()||F.length===0||we,children:we?"Saving...":"Save group"})]})})]})})})]})};const oR=Object.freeze(Object.defineProperty({__proto__:null,default:sR},Symbol.toStringTag,{value:"Module"}));function cp(e,t){return uR(e)||cR(e,t)||lR(e,t)||aR()}function aR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1285
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lR(e,t){if(e){if(typeof e=="string")return up(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?up(e,t):void 0}}function up(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function cR(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function uR(e){if(Array.isArray(e))return e}var dR=function(t){var n=t.isOpen,r=t.onClose,i=W.useState(""),s=cp(i,2),o=s[0],a=s[1],l=W.useState({mutate:function(){},isLoading:!1}),c=cp(l,1),u=c[0],d=u.mutate,f=u.isLoading;return W.useEffect(function(){n&&a("")},[n]),y.jsx(vf,{isOpen:n,onClose:r,onConfirm:function(){d(),console.log("Deleting all data"),r()},isLoading:f,disabled:o!=="DELETE ALL",title:"Delete all data?",description:y.jsxs(y.Fragment,{children:[y.jsx("p",{children:"This will permanently erase all brands, analysis results, and queries from your account."}),y.jsx("p",{children:"This action cannot be undone."}),y.jsx(O.TextField,{label:"To confirm, please type DELETE ALL:",value:o,onChange:function(h){return a(h.target.value)}}),y.jsx("p",{children:y.jsx("em",{children:"This is to make sure you understand this action is permanent."})})]}),confirmText:"Yes, delete all data",cancelText:"No, go back"})};function fR(e,t){return mR(e)||yR(e,t)||gR(e,t)||hR()}function hR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1286
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gR(e,t){if(e){if(typeof e=="string")return dp(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dp(e,t):void 0}}function dp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function yR(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function mR(e){if(Array.isArray(e))return e}var pR=function(t){var n=t.isOpen,r=t.brandId,i=t.onClose,s=t.brandName,o=Ei(),a=W.useState(""),l=fR(a,2),c=l[0],u=l[1],d=Bk({mutation:{onSuccess:function(){o.invalidateQueries({queryKey:gf()}),console.log("Brand data deleted"),i()}}}),f=d.mutate,h=d.isPending;return W.useEffect(function(){n&&u("")},[n]),y.jsx(vf,{isOpen:n,onClose:i,onConfirm:function(){if(!s){console.error("Brand name is required for deletion confirmation");return}f({brandId:r})},isLoading:h,disabled:c.toLowerCase()!==(s==null?void 0:s.toLowerCase()),title:"Delete brand?",description:y.jsxs(y.Fragment,{children:[y.jsx("p",{children:"This will permanently delete all data associated with this brand, including past analyses and query history."}),y.jsx("p",{children:"This action cannot be undone."}),y.jsx(O.TextField,{id:"delete-modal-brand-name-confirmation",label:"To confirm, please type your brand name ".concat(s,":"),value:c,onChange:function(g){return u(g.target.value)}}),y.jsx("p",{children:y.jsx("em",{children:"This is to make sure you understand this action is permanent."})})]}),confirmText:"Yes, delete brand",cancelText:"No, go back"})},fp,hp,gp;function Lu(e,t){return wR(e)||xR(e,t)||vR(e,t)||bR()}function bR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1287
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vR(e,t){if(e){if(typeof e=="string")return yp(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yp(e,t):void 0}}function yp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function xR(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function wR(e){if(Array.isArray(e))return e}function oh(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var mp=Fs(fp||(fp=oh(["xl:yst-w-1/3"]))),pp=Fs(hp||(hp=oh(["xl:yst-w-2/3"]))),bp=Fs(gp||(gp=oh(["yst-flex yst-flex-col yst-gap-8 xl:yst-flex-row"]))),SR=function(){var t=W.useState(!1),n=Lu(t,2),r=n[0],i=n[1],s=W.useState(!1),o=Lu(s,2),a=o[0],l=o[1],c=W.useState(null),u=Lu(c,2),d=u[0],f=u[1],h=kc({query:{select:function(b){var v,S=b.data;return S==null||(v=S.data)===null||v===void 0?void 0:v.brands}}}),g=h.data,m=g==null?void 0:g.find(function(p){return p.id===d});return y.jsxs("form",{children:[y.jsxs(O.Card,{children:[y.jsx(zv,{title:"Settings"}),y.jsxs(O.Card.Content,{children:[y.jsxs(bp,{children:[y.jsxs(mp,{className:"yst-space-y-2",children:[y.jsx(O.Title,{size:"4",children:"Brands"}),y.jsx("p",{children:"Manage your brands. You can edit analysis preferences per brand or delete a brand and its data."})]}),y.jsxs(pp,{children:[g&&g.length===0&&y.jsxs("p",{className:"yst-text-slate-500",children:["No brands found. Please"," ",y.jsx(O.Link,{as:Hr,to:"/setup",children:"add a brand"})," ","to start analyzing."]}),(g||[{id:"loading",name:"Loading..."}]).map(function(p,b,v){return y.jsxs("div",{className:Se("yst-flex yst-flex-col yst-items-start yst-items-center yst-justify-between yst-gap-2 yst-py-4 lg:yst-flex-row",{"yst-border-b-[1px] yst-border-b-slate-200":b!==v.length-1}),children:[y.jsx("div",{className:"yst-font-medium",children:p.id==="loading"?y.jsx(O.SkeletonLoader,{className:"yst-h-6 yst-w-32"}):p.name}),y.jsxs("div",{className:"yst-flex yst-flex-col yst-items-start yst-justify-start yst-gap-2 lg:yst-flex-row lg:yst-items-center",children:[p.id==="loading"?y.jsx(O.SkeletonLoader,{className:"yst-h-6 yst-w-32"}):y.jsxs(O.Button,{size:"small",variant:"secondary",className:"yst-gap-1",disabled:p.id==="loading",children:[y.jsx($b,{})," Edit analysis preferences"]}),p.id==="loading"?y.jsx(O.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsxs(O.Button,{size:"small",variant:"tertiary",className:"yst-gap-1 yst-text-red-600 *:hover:yst-text-red-700",onClick:function(){p.id&&(f(p.id),i(!0))},disabled:p.id==="loading",children:[y.jsx(Cd,{})," Delete brand"]})]})]},p.id)})]})]}),y.jsx(Oa,{}),y.jsxs(bp,{children:[y.jsxs(mp,{className:"yst-space-y-2",children:[y.jsx(O.Title,{size:"4",children:"Delete all data"}),y.jsx("p",{children:"Permanently delete all brands, analysis results, and query history from your account."})]}),y.jsxs(pp,{className:"yst-space-y-4",children:[y.jsxs(O.Button,{variant:"error",onClick:function(){l(!0)},children:[y.jsx(Cd,{})," Delete all data"]}),y.jsx("p",{children:y.jsxs("i",{children:[y.jsx("b",{children:"Note:"})," This will erase everything and cannot be reversed."]})})]})]})]})]}),y.jsx(pR,{isOpen:r,onClose:function(){i(!1),f(null)},brandId:d,brandName:m==null?void 0:m.name}),y.jsx(dR,{isOpen:a,onClose:function(){l(!1)}})]})};const CR=Object.freeze(Object.defineProperty({__proto__:null,default:SR},Symbol.toStringTag,{value:"Module"}));function _R(){var e=dn(),t=[{path:"/setup",id:1,title:"Brand & location info",description:"Enter a few basic details about your brand so we can generate relevant queries people might use in AI models like ChatGPT and Perplexity. This helps us analyze how visible your brand is in their responses."},{path:"/setup/queries",id:2,title:"Queries",description:"Review the queries we've generated from your brand info. These are phrases people might type into AI models that could trigger your brand to appear."},{path:"/setup/analysis",id:3,title:"Analysis",description:"We're checking how your brand shows up in AI. Your queries will now be tested in ChatGPT and Perplexity. This process should take around 5 minutes."}],n=function(){return t.find(function(s){return s.path===e.pathname})||t[0]},r=n();return y.jsxs(O.Paper,{className:"yst-mx-auto yst-max-w-2xl",children:[y.jsx(mf,{title:y.jsxs("span",{className:"yst-inline-flex yst-flex-row yst-gap-4",children:[y.jsxs("span",{className:"yst-tracking-[.2em] yst-text-slate-400",children:[y.jsx("span",{className:"yst-text-slate-900",children:r.id}),"/",t.length]}),y.jsx("span",{children:r.title})]}),description:r.description}),y.jsx(O.Paper.Content,{children:y.jsx(dc,{})})]})}const kR=Object.freeze(Object.defineProperty({__proto__:null,default:_R},Symbol.toStringTag,{value:"Module"}));var Cx=function(t){var n=t.sparkCost,r=n===void 0?0:n,i=t.onBack,s=t.variant,o=s===void 0?"ai":s,a=t.buttonText,l=t.onButtonClick,c=t.isButtonDisabled,u=c===void 0?!1:c,d=t.isLoading,f=d===void 0?!1:d;return y.jsx(bf,{nestedInPaperContent:!0,children:y.jsxs("div",{className:Se({"yst-flex yst-flex-1 yst-flex-col yst-items-start yst-justify-between yst-gap-4 md:yst-flex-row md:yst-items-center md:yst-justify-between":i}),children:[i&&y.jsx(O.Button,{variant:"tertiary",onClick:i,className:"yst-no-underline",children:"โ† Back"}),y.jsxs("div",{className:Se("yst-flex yst-flex-col yst-items-stretch yst-gap-4 md:yst-flex-row md:yst-items-center md:yst-justify-end"),children:[r>0&&y.jsx(qb,{cost:r}),y.jsxs(O.Button,{onClick:l,variant:o==="ai"?"primary":o,className:"yst-gap-1.5",style:o==="ai"?{background:"linear-gradient(102deg, #A61E69 0%, #6366F1 100%)",color:"#fff"}:{},disabled:u,type:"submit",isLoading:f,children:[o==="ai"&&y.jsx(Ec,{}),a]})]})]})})},ER=[{value:"US",label:"United States"},{value:"GB",label:"United Kingdom"},{value:"CA",label:"Canada"},{value:"AU",label:"Australia"},{value:"DE",label:"Germany"},{value:"FR",label:"France"},{value:"NL",label:"Netherlands"}],OR=[{value:"AR",label:"Argentina"},{value:"BE",label:"Belgium"},{value:"BR",label:"Brazil"},{value:"CN",label:"China"},{value:"EG",label:"Egypt"},{value:"ID",label:"Indonesia"},{value:"IE",label:"Ireland"},{value:"IL",label:"Israel"},{value:"IN",label:"India"},{value:"IT",label:"Italy"},{value:"JP",label:"Japan"},{value:"KR",label:"South Korea"},{value:"MX",label:"Mexico"},{value:"NG",label:"Nigeria"},{value:"PL",label:"Poland"},{value:"RU",label:"Russia"},{value:"SA",label:"Saudi Arabia"},{value:"SE",label:"Sweden"},{value:"ES",label:"Spain"},{value:"TH",label:"Thailand"},{value:"TR",label:"Turkey"},{value:"TW",label:"Taiwan"},{value:"ZA",label:"South Africa"}],pl=[].concat(ER,OR,[{value:"OTHER",label:"Other"}]),AR=[{value:"en",label:"English"},{value:"es",label:"Spanish"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"zh",label:"Chinese (Mandarin)"},{value:"ja",label:"Japanese"}],TR=[{value:"ar",label:"Arabic"},{value:"da",label:"Danish"},{value:"nl",label:"Dutch"},{value:"fi",label:"Finnish"},{value:"hi",label:"Hindi"},{value:"it",label:"Italian"},{value:"ko",label:"Korean"},{value:"no",label:"Norwegian"},{value:"pl",label:"Polish"},{value:"pt",label:"Portuguese"},{value:"ru",label:"Russian"},{value:"sv",label:"Swedish"},{value:"th",label:"Thai"},{value:"tr",label:"Turkish"}],PR=[].concat(AR,TR),vp=["Software","SaaS","Mobile Apps","Web Development","Cybersecurity","AI/Machine Learning","Cloud Computing","Data Analytics","IT Services","Gaming","E-commerce","Online Retail","Fashion Retail","Electronics Retail","Home Goods","Sporting Goods","Jewelry","Beauty Products","Automotive Parts","Books & Media","Consulting","Legal Services","Accounting","Marketing Agency","Public Relations","HR Services","Business Coaching","Financial Advisory","Real Estate","Insurance","Healthcare","Dental","Mental Health","Fitness","Spa & Wellness","Nutrition","Medical Device","Pharmacy","Veterinary","Alternative Medicine","Photography","Graphic Design","Video Production","Marketing","Advertising","Content Creation","Music","Art & Design","Entertainment","Publishing","Restaurant","Cafe","Food Delivery","Catering","Bakery","Brewery","Wine","Food Production","Grocery","Food Truck","Education","Online Learning","Training","Coaching","Tutoring","Language Learning","Professional Development","Childcare","University","Certification","Manufacturing","Construction","Engineering","Automotive","Aerospace","Chemical","Textile","Furniture","Packaging","Industrial Equipment","Travel","Hotel","Tourism","Event Planning","Transportation","Airline","Cruise","Car Rental","Vacation Rental","Adventure Tours","Non-Profit","Charity","Government","Religious Organization","Community Service","Environmental","Political","Social Services","Foundation","Advocacy"];function oa(e){"@babel/helpers - typeof";return oa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oa(e)}function xp(e){return jR(e)||$R(e)||kx(e)||MR()}function MR(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1288
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $R(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function jR(e){if(Array.isArray(e))return Jd(e)}function wp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wp(Object(n),!0).forEach(function(r){_x(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wp(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _x(e,t,n){return(t=DR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DR(e){var t=LR(e,"string");return oa(t)=="symbol"?t:t+""}function LR(e,t){if(oa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(oa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Iu(e,t){return FR(e)||RR(e,t)||kx(e,t)||IR()}function IR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1289
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kx(e,t){if(e){if(typeof e=="string")return Jd(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jd(e,t):void 0}}function Jd(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function RR(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function FR(e){if(Array.isArray(e))return e}var NR=function(){var t,n,r=zr(),i=yf(),s=Ei(),o=W.useState({name:"",url:"",industry:"",language:"en",isLocal:!1,country:"",region:""}),a=Iu(o,2),l=a[0],c=a[1],u=W.useState(vp),d=Iu(u,2),f=d[0],h=d[1],g=jk({mutation:{onSuccess:function(x){var _,C=(_=x.data)===null||_===void 0?void 0:_.id;console.log("Brand created successfully",C),s.invalidateQueries({queryKey:[kb(),gf()]}),i.setBrandId(C),x!=null&&x.status&&x.status>=200&&x.status<300&&C&&(i.setBrandId(C),r("/setup/queries"))},onError:function(x){console.log("Error creating brand:",x)}}}),m=g.mutate,p=g.isPending,b=g.error,v=function(x,_){c(function(C){return Sp(Sp({},C),{},_x({},x,_))})},S=function(x){x.preventDefault();var _=l.url;_&&!/^https?:\/\//i.test(_)&&(_="https://".concat(_)),m({data:{name:l.name,url:_,industry:l.industry,focusLanguage:l.language,isLocalFocus:l.isLocal,country:String(l.country),regionOrCity:String(l.region)}})};return y.jsxs("form",{onSubmit:S,children:[y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx(O.Title,{size:"2",children:"Brand info"}),!!b&&y.jsx(O.Alert,{variant:"error",title:"Error",isVisible:!!b,children:y.jsx("ul",{children:b!=null&&(t=b.response)!==null&&t!==void 0&&(t=t.data)!==null&&t!==void 0&&t.error?Object.entries(b.response.data.error).flatMap(function(w){var x=Iu(w,2),_=x[0],C=x[1];return Array.isArray(C)?C.map(function(A,k){return y.jsx("li",{children:A},"".concat(_,"-").concat(k))}):null}):"There was an error creating the brand."})}),y.jsx(O.TextField,{id:"name",label:"Brand name",value:l.name,onChange:function(w){return v("name",w.target.value)}}),y.jsx(O.TextField,{id:"url",label:"Website URL (optional)",placeholder:"Example: https://yourwebsite.com",value:l.url,onChange:function(w){return v("url",w.target.value)}}),y.jsxs(O.Autocomplete,{className:"yst-max-w-sm",clearButtonScreenReaderText:"Clear selection",id:"industry",label:"Industry",labelProps:{className:"yst-text-slate-800 yst-font-medium"},nullable:!0,onChange:function(w){return v("industry",w)},onQueryChange:function(w){h([w.target.value].concat(xp(vp.filter(function(x){return x.toLowerCase().includes(w.target.value.toLowerCase())}))))},placeholder:"Select or type your industry...",selectedLabel:l.industry,value:l.industry,children:[!f.find(function(w){return w===l.industry})&&l.industry&&y.jsx(O.Autocomplete.Option,{value:l.industry,children:l.industry}),f.map(function(w){return y.jsx(O.Autocomplete.Option,{value:w,children:w},w)})]}),y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(O.Select,{className:"yst-max-w-sm",id:"language-select",label:"Target language",value:l.language,onChange:function(w){return v("language",w)},options:PR.map(function(w){return{label:w.label,value:w.value}})}),y.jsx("p",{children:"The main language your brand uses to communicate or create content."})]})]}),y.jsx(Oa,{}),y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx(O.Title,{size:"2",children:"Location info"}),y.jsx("p",{children:"You can specify a location to help focus the analysis."}),y.jsx(O.Select,{className:"yst-max-w-sm",id:"language-select",label:"Target country (optional)",value:l.country,placeholder:"Select...",onChange:function(w){return v("country",w)},options:[{label:"Select...",value:"none"}].concat(xp(pl)).map(function(w){return{label:w.label,value:w.value}})}),y.jsxs(O.Autocomplete,{className:"yst-hidden yst-max-w-sm",clearButtonScreenReaderText:"Clear selection",id:"country",label:"Which country do you operate in?",nullable:!0,onChange:function(w){return v("country",w)},onQueryChange:function(w){return v("country",w.target.value)},placeholder:"Select or type your country...",selectedLabel:((n=pl.find(function(w){return w.value===l.country}))===null||n===void 0?void 0:n.label)||l.country,value:l.country,children:[!pl.find(function(w){return w.value===l.country})&&l.country&&y.jsx(O.Autocomplete.Option,{value:l.country,children:l.country}),pl.map(function(w){return y.jsx(O.Autocomplete.Option,{value:w.value,children:w.label},w.value)})]}),l.country&&y.jsx(O.TextField,{id:"region",label:"Target city, state, or region (optional)",value:l.region,onChange:function(w){return v("region",w.target.value)},description:`Enter a city, state, or region to narrow down the analysis. For
1290
+ example: California, Bavaria, or Paris.`})]}),y.jsx(Cx,{sparkCost:1,onBack:function(){return r(-1)},buttonText:"Generate queries",isButtonDisabled:p,isLoading:p})]})};const BR=Object.freeze(Object.defineProperty({__proto__:null,default:NR},Symbol.toStringTag,{value:"Module"}));function aa(e){"@babel/helpers - typeof";return aa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},aa(e)}function qR(e){return UR(e)||HR(e)||Ex(e)||zR()}function zR(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1291
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HR(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function UR(e){if(Array.isArray(e))return Zd(e)}function Cp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Fi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Cp(Object(n),!0).forEach(function(r){KR(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cp(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function KR(e,t,n){return(t=WR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WR(e){var t=VR(e,"string");return aa(t)=="symbol"?t:t+""}function VR(e,t){if(aa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(aa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ru(e,t){return YR(e)||QR(e,t)||Ex(e,t)||GR()}function GR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1292
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ex(e,t){if(e){if(typeof e=="string")return Zd(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zd(e,t):void 0}}function Zd(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function QR(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function YR(e){if(Array.isArray(e))return e}var Ox=5,Ax="Generating...",XR="Re-generating...",JR=["******************************","***********************","*******************************************************","***********************************************","***************************************************************","*******************************************************","*******************************************************","***********************************************"],ZR=Array.from({length:Ox},function(e,t){return{id:"query-".concat(t),text:Ax,isRegenerating:!0}}),e9=function(){var t=zt(),n=t.brandId,r=zr(),i=W.useState(ZR),s=Ru(i,2),o=s[0],a=s[1],l=W.useState(!1),c=Ru(l,2),u=c[0],d=c[1],f=W.useState([]),h=Ru(f,2),g=h[0],m=h[1],p=g.length||Ox,b=Vk(n||"",{quantity:p},{query:{enabled:!!n}}),v=b.data,S=b.isRefetching,w=b.refetch,x=Hk({mutation:{onSuccess:function(N){N!=null&&N.status&&N.status>=200&&N.status<300&&r("/setup/analysis")},onError:function(N){console.error("Error saving queries:",N)}}}),_=x.mutate,C=x.isPending;W.useEffect(function(){var q;v!=null&&(q=v.data)!==null&&q!==void 0&&q.queries&&Array.isArray(v.data.queries)&&o.every(function(N){return N.text===Ax})&&a(v.data.queries.map(function(N,L){return{id:"query-".concat(L),text:N,isRegenerating:!1}}))},[v,o]),W.useEffect(function(){var q;if(v!=null&&(q=v.data)!==null&&q!==void 0&&q.queries&&Array.isArray(v.data.queries)&&!S&&g.length>0){var N=v.data.queries,L=g.map(Number);a(function(F){return F.map(function(se,de){var R=L.indexOf(de);return Fi(Fi({},se),{},{text:R>=0&&N[R]?N[R]:se.text,isRegenerating:!1})})})}},[v,S,g]);var A=W.useMemo(function(){return S||o.length===0},[S,o.length]),k=W.useCallback(function(q){var N=q.toString();m(function(L){return L.includes(N)?L.filter(function(F){return F!==N}):[].concat(qR(L),[N])})},[]),P=W.useCallback(function(q,N){a(function(L){return L.map(function(F,se){return se===q?Fi(Fi({},F),{},{text:N}):F})})},[]),$=function(){d(!u),m([])},j=W.useCallback(function(){S||g.length===0||(a(function(q){return q.map(function(N,L){return Fi(Fi({},N),{},{isRegenerating:g.includes(L.toString())})})}),w())},[S,g,w]),Z=W.useCallback(function(q){q.preventDefault(),n&&_({brandId:n,data:o.map(function(N){return N.text})})},[n,o,_]);return y.jsxs("form",{onSubmit:Z,children:[y.jsxs("div",{className:"yst-mb-8",children:[y.jsx(O.Title,{size:"2",className:"yst-mb-2",children:"Your queries"}),y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx("p",{children:"You can edit your queries or regenerate new ones with AI."}),y.jsx("div",{className:Se("yst-flex yst-gap-3",u?"yst-justify-end":"yst-justify-start"),children:u?y.jsxs(y.Fragment,{children:[y.jsx(O.Button,{size:"small",variant:"secondary",onClick:$,children:"Cancel"}),y.jsxs(O.Button,{size:"small",onClick:j,className:"yst-gap-1.5",isLoading:S,disabled:S||g.length===0,children:[y.jsx(Ec,{}),"Re-generate selected prompts"]})]}):y.jsxs(O.Button,{size:"small",variant:"secondary",onClick:$,className:"yst-gap-1.5",children:[y.jsx(RE,{}),"Select prompts to regenerate"]})})]})]}),y.jsx("div",{className:"yst-mb-8",children:o.length===0?JR.map(function(q,N){return y.jsx("div",{className:Se("yst-mb-4 yst-cursor-pointer yst-rounded yst-border yst-border-slate-300 yst-p-3 yst-transition-colors","yst-bg-white"),children:y.jsx(O.SkeletonLoader,{children:q||"Example placeholder query for demonstration purposes."})},"placeholder-query-".concat(N))}):o.map(function(q,N){var L=q.isRegenerating?XR:q.text;return y.jsx("div",{className:Se("yst-mb-4"),children:y.jsxs("div",{className:"yst-flex yst-gap-2",children:[u&&y.jsx("div",{className:"yst-flex yst-items-center",children:y.jsx(O.Checkbox,{id:"query-regenerate-".concat(N),name:"query-regenerate-".concat(N),value:N.toString(),checked:g.includes(N.toString()),onChange:function(){return k(N)},disabled:S})}),y.jsxs("div",{className:"yst-flex-1",children:[y.jsxs(O.Label,{htmlFor:"query-text-".concat(N),className:"yst-mb-2 yst-block yst-text-sm yst-font-medium yst-text-slate-700",children:["Prompt ",N+1]}),y.jsx(O.TextInput,{id:"query-text-".concat(N),type:"text",value:L,onChange:function(F){q.isRegenerating||P(N,F.target.value)},placeholder:"Enter your query...",className:"yst-w-full",disabled:q.isRegenerating})]})]})},q.id)})}),y.jsx(Cx,{sparkCost:1,buttonText:"Start analysis (~ 5 minutes)",isButtonDisabled:A,isLoading:C})]})};const t9=Object.freeze(Object.defineProperty({__proto__:null,default:e9},Symbol.toStringTag,{value:"Module"}));var Ni=[{label:"Getting started",threshold:20},{label:"Building analysis",threshold:97},{label:"Finalizing",threshold:100}],Tx=function(t){var n=t.progress,r=n===void 0?0:n,i=t.className,s=i===void 0?"":i,o=function(){for(var c=0;c<Ni.length;c++)if(r<=Ni[c].threshold)return Ni[c].label;return Ni[Ni.length-1].label},a=o();return y.jsxs("div",{className:Se("yst-font-medium yst-text-slate-800",s),children:[y.jsxs("span",{className:"yst-text-sm yst-font-medium yst-italic",children:[a,"..."]}),y.jsx(O.ProgressBar,{className:"yst-mt-3",progress:r,min:0,max:100}),y.jsx("div",{className:"yst-mt-3 yst-flex yst-justify-between yst-text-xs",children:Ni.slice(0,-1).map(function(l){return y.jsx("span",{children:y.jsx(pf,{disabled:a!==l.label,children:l.label})},l.label)})})]})};Tx.propTypes={progress:kd.number,className:kd.string};function n9(e,t){return o9(e)||s9(e,t)||i9(e,t)||r9()}function r9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1293
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i9(e,t){if(e){if(typeof e=="string")return _p(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_p(e,t):void 0}}function _p(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s9(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function o9(e){if(Array.isArray(e))return e}var a9=function(){var t=zt(),n=t.brandId,r=W.useState(10),i=n9(r,2),s=i[0],o=i[1],a=[{title:"SEO Fundamentals: A Complete Guide",url:"https://yoast.com/seo-fundamentals/",image:"https://images.unsplash.com/photo-1460925895917-afdab827c52f?w=400&h=200&fit=crop"},{title:"Content Marketing Best Practices",url:"https://yoast.com/content-marketing/",image:"https://images.unsplash.com/photo-1552664730-d307ca884978?w=400&h=200&fit=crop"}],l=_b(n,{query:{enabled:!!n}}),c=l.data,u=l.isFetched,d=dk({mutation:{onSuccess:function(w){console.log("Analysis started successfully",w),o(33)},onError:function(w){console.error("Error starting analysis:",w)}}}),f=d.mutate,h=Rk(n,{query:{enabled:!!n,select:function(w){var x=w.data;return x}}}),g=h.data,m=zn(n,"latest",{query:{enabled:s>=60&&!!n&&u,select:function(w){var x,_=w.data;return(_==null||(x=_.data)===null||x===void 0||(x=x.mentions)===null||x===void 0?void 0:x.list)||[]}}}),p=m.data;W.useEffect(function(){if(n&&c&&u){var S;(c==null||(S=c.data)===null||S===void 0||(S=S.data)===null||S===void 0?void 0:S.length)===0?(f({brandId:n,data:{}}),o(66)):o(100)}},[c,n,u,f]);var b="/brand-list";console.log("brandData",g);var v=[];return y.jsxs("div",{className:"yst-space-y-12",children:[y.jsxs(O.Paper,{children:[y.jsxs(O.Paper.Header,{children:[y.jsx(O.Title,{size:"1",className:"yst-mb-2",children:"Analyzing..."}),y.jsx("p",{children:"This process should take around 5 minutes."})]}),y.jsxs(O.Paper.Content,{className:"yst-space-y-8",children:[y.jsx(Tx,{progress:s}),y.jsx(Oa,{}),y.jsx("div",{className:"yst-space-y-4",children:v.map(function(S){var w,x=S.query,_=S.id,C=p==null||(w=p.find(function(A){return A.queryId===_}))===null||w===void 0?void 0:w.found;return y.jsxs("div",{className:Se("yst-flex yst-items-center yst-justify-between yst-gap-2"),children:[C===!0?y.jsx(Mb,{className:"yst-h-5 yst-w-5 yst-text-green-600"}):C===!1?y.jsx(jb,{className:"yst-h-5 yst-w-5 yst-text-red-600"}):y.jsx(O.Spinner,{}),y.jsx("span",{className:"yst-flex-1 yst-text-sm",children:x}),y.jsx(O.Badge,{className:"yst-ml-4",children:C?"Found":"Not found"})]},_)})})]}),y.jsx(O.Paper.Content,{className:"yst-flex yst-justify-end yst-gap-4 yst-border-t yst-border-slate-200 yst-bg-slate-50 yst-px-8 yst-py-6",children:y.jsx(O.Button,{as:Hr,to:b,children:"Continue โ†’"})})]}),y.jsxs("div",{className:"yst-space-y-6",children:[y.jsx(O.Title,{size:"2",children:"Want to read while you wait? Based on your input, we think you'll like these articles:"}),y.jsx("div",{className:"yst-flex yst-flex-col yst-gap-6 md:yst-flex-row",children:a.map(function(S,w){return y.jsxs(O.Card,{className:"yst-overflow-hidden yst-shadow-md md:yst-w-1/3",children:[S.image&&y.jsx(O.Card.Header,{className:"min-h-[12rem] bg-cover bg-center bg-no-repeat",style:{backgroundImage:"url(".concat(S.image,")")},children:y.jsx("span",{className:"yst-hidden",children:"Article preview image"})}),y.jsxs(O.Card.Content,{className:"yst-mb-2",children:[y.jsx(O.Title,{size:"2",className:"yst-mb-4",children:S.title}),y.jsx("p",{className:"yst-text-right",children:y.jsx(O.Link,{href:S.url,className:"yst-text-right",target:"_blank",rel:"noopener noreferrer",children:y.jsx("span",{children:"Read article ยป"})})})]})]},w)})})]})]})};const l9=Object.freeze(Object.defineProperty({__proto__:null,default:a9},Symbol.toStringTag,{value:"Module"}));exports.AIInsightsClient=k$;exports.setApiBaseUrl=J_;