dccxx-s3-explorer 1.0.22 → 1.0.23

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.
@@ -1,4 +1,4 @@
1
- (function(Le,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],l):(Le=typeof globalThis<"u"?globalThis:Le||self,l(Le.S3Explorer={},Le.jsxRuntime,Le.React,Le.ReactDOM))})(this,function(Le,l,O,Yr){"use strict";function gi(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 d=gi(O),Hn=gi(Yr);function Cd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"}))}const hi=d.forwardRef(Cd);function Sd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))}const Ed=d.forwardRef(Sd);function Nd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"}))}const Td=d.forwardRef(Nd);function Pd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 10.5v6m3-3H9m4.06-7.19-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"}))}const Ad=d.forwardRef(Pd);function _d({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"}))}const Zr=d.forwardRef(_d);function Fd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418"}))}const Od=d.forwardRef(Fd);function Dd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"}))}const Md=d.forwardRef(Dd);function $d({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))}const mi=d.forwardRef($d);/**
1
+ (function(He,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],l):(He=typeof globalThis<"u"?globalThis:He||self,l(He.S3Explorer={},He.jsxRuntime,He.React,He.ReactDOM))})(this,function(He,l,D,Yr){"use strict";function gi(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 d=gi(D),zn=gi(Yr);function Cd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"}))}const hi=d.forwardRef(Cd);function Sd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))}const Ed=d.forwardRef(Sd);function Nd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"}))}const Td=d.forwardRef(Nd);function Pd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 10.5v6m3-3H9m4.06-7.19-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"}))}const Ad=d.forwardRef(Pd);function _d({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"}))}const Zr=d.forwardRef(_d);function Fd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418"}))}const Od=d.forwardRef(Fd);function Dd({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"}))}const Md=d.forwardRef(Dd);function $d({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))}const mi=d.forwardRef($d);/**
2
2
  * table-core
3
3
  *
4
4
  * Copyright (c) TanStack
@@ -7,10 +7,10 @@
7
7
  * LICENSE.md file in the root directory of this source tree.
8
8
  *
9
9
  * @license MIT
10
- */function vt(e,t){return typeof e=="function"?e(t):e}function Fe(e,t){return n=>{t.setState(r=>({...r,[e]:vt(n,r[e])}))}}function zn(e){return e instanceof Function}function kd(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Id(e,t){const n=[],r=o=>{o.forEach(s=>{n.push(s);const i=t(s);i!=null&&i.length&&r(i)})};return r(e),n}function J(e,t,n){let r=[],o;return s=>{let i;n.key&&n.debug&&(i=Date.now());const a=e(s);if(!(a.length!==r.length||a.some((f,g)=>r[g]!==f)))return o;r=a;let c;if(n.key&&n.debug&&(c=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const f=Math.round((Date.now()-i)*100)/100,g=Math.round((Date.now()-c)*100)/100,m=g/16,p=(v,h)=>{for(v=String(v);v.length<h;)v=" "+v;return v};console.info(`%c⏱ ${p(g,5)} /${p(f,5)} ms`,`
10
+ */function wt(e,t){return typeof e=="function"?e(t):e}function Me(e,t){return n=>{t.setState(r=>({...r,[e]:wt(n,r[e])}))}}function Hn(e){return e instanceof Function}function kd(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Id(e,t){const n=[],r=o=>{o.forEach(s=>{n.push(s);const i=t(s);i!=null&&i.length&&r(i)})};return r(e),n}function J(e,t,n){let r=[],o;return s=>{let i;n.key&&n.debug&&(i=Date.now());const a=e(s);if(!(a.length!==r.length||a.some((f,g)=>r[g]!==f)))return o;r=a;let c;if(n.key&&n.debug&&(c=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const f=Math.round((Date.now()-i)*100)/100,g=Math.round((Date.now()-c)*100)/100,m=g/16,p=(v,h)=>{for(v=String(v);v.length<h;)v=" "+v;return v};console.info(`%c⏱ ${p(g,5)} /${p(f,5)} ms`,`
11
11
  font-size: .6rem;
12
12
  font-weight: bold;
13
- color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function Y(e,t,n,r){return{debug:()=>{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function Rd(e,t,n,r){const o=()=>{var i;return(i=s.getValue())!=null?i:e.options.renderFallbackValue},s={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:J(()=>[e,n,t,s],(i,a,u,c)=>({table:i,column:a,row:u,cell:c,getValue:c.getValue,renderValue:c.renderValue}),Y(e.options,"debugCells","cell.getContext"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(s,n,t,e)},{}),s}function Ld(e,t,n,r){var o,s;const a={...e._getDefaultColumnDef(),...t},u=a.accessorKey;let c=(o=(s=a.id)!=null?s:u?typeof String.prototype.replaceAll=="function"?u.replaceAll(".","_"):u.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,f;if(a.accessorFn?f=a.accessorFn:u&&(u.includes(".")?f=m=>{let p=m;for(const h of u.split(".")){var v;p=(v=p)==null?void 0:v[h],process.env.NODE_ENV!=="production"&&p===void 0&&console.warn(`"${h}" in deeply nested key "${u}" returned undefined.`)}return p}:f=m=>m[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let g={id:`${String(c)}`,accessorFn:f,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:J(()=>[!0],()=>{var m;return[g,...(m=g.columns)==null?void 0:m.flatMap(p=>p.getFlatColumns())]},Y(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:J(()=>[e._getOrderColumnsFn()],m=>{var p;if((p=g.columns)!=null&&p.length){let v=g.columns.flatMap(h=>h.getLeafColumns());return m(v)}return[g]},Y(e.options,"debugColumns","column.getLeafColumns"))};for(const m of e._features)m.createColumn==null||m.createColumn(g,e);return g}const be="debugHeaders";function vi(e,t,n){var r;let s={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const i=[],a=u=>{u.subHeaders&&u.subHeaders.length&&u.subHeaders.map(a),i.push(u)};return a(s),i},getContext:()=>({table:e,header:s,column:t})};return e._features.forEach(i=>{i.createHeader==null||i.createHeader(s,e)}),s}const Vd={createTable:e=>{e.getHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var s,i;const a=(s=r==null?void 0:r.map(g=>n.find(m=>m.id===g)).filter(Boolean))!=null?s:[],u=(i=o==null?void 0:o.map(g=>n.find(m=>m.id===g)).filter(Boolean))!=null?i:[],c=n.filter(g=>!(r!=null&&r.includes(g.id))&&!(o!=null&&o.includes(g.id)));return Un(t,[...a,...c,...u],e)},Y(e.options,be,"getHeaderGroups")),e.getCenterHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(s=>!(r!=null&&r.includes(s.id))&&!(o!=null&&o.includes(s.id))),Un(t,n,e,"center")),Y(e.options,be,"getCenterHeaderGroups")),e.getLeftHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const s=(o=r==null?void 0:r.map(i=>n.find(a=>a.id===i)).filter(Boolean))!=null?o:[];return Un(t,s,e,"left")},Y(e.options,be,"getLeftHeaderGroups")),e.getRightHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const s=(o=r==null?void 0:r.map(i=>n.find(a=>a.id===i)).filter(Boolean))!=null?o:[];return Un(t,s,e,"right")},Y(e.options,be,"getRightHeaderGroups")),e.getFooterGroups=J(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Y(e.options,be,"getFooterGroups")),e.getLeftFooterGroups=J(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Y(e.options,be,"getLeftFooterGroups")),e.getCenterFooterGroups=J(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Y(e.options,be,"getCenterFooterGroups")),e.getRightFooterGroups=J(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Y(e.options,be,"getRightFooterGroups")),e.getFlatHeaders=J(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Y(e.options,be,"getFlatHeaders")),e.getLeftFlatHeaders=J(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Y(e.options,be,"getLeftFlatHeaders")),e.getCenterFlatHeaders=J(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Y(e.options,be,"getCenterFlatHeaders")),e.getRightFlatHeaders=J(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Y(e.options,be,"getRightFlatHeaders")),e.getCenterLeafHeaders=J(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Y(e.options,be,"getCenterLeafHeaders")),e.getLeftLeafHeaders=J(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Y(e.options,be,"getLeftLeafHeaders")),e.getRightLeafHeaders=J(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Y(e.options,be,"getRightLeafHeaders")),e.getLeafHeaders=J(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,s,i,a,u,c;return[...(o=(s=t[0])==null?void 0:s.headers)!=null?o:[],...(i=(a=n[0])==null?void 0:a.headers)!=null?i:[],...(u=(c=r[0])==null?void 0:c.headers)!=null?u:[]].map(f=>f.getLeafHeaders()).flat()},Y(e.options,be,"getLeafHeaders"))}};function Un(e,t,n,r){var o,s;let i=0;const a=function(m,p){p===void 0&&(p=1),i=Math.max(i,p),m.filter(v=>v.getIsVisible()).forEach(v=>{var h;(h=v.columns)!=null&&h.length&&a(v.columns,p+1)},0)};a(e);let u=[];const c=(m,p)=>{const v={depth:p,id:[r,`${p}`].filter(Boolean).join("_"),headers:[]},h=[];m.forEach(y=>{const w=[...h].reverse()[0],x=y.column.depth===v.depth;let E,T=!1;if(x&&y.column.parent?E=y.column.parent:(E=y.column,T=!0),w&&(w==null?void 0:w.column)===E)w.subHeaders.push(y);else{const C=vi(n,E,{id:[r,p,E.id,y==null?void 0:y.id].filter(Boolean).join("_"),isPlaceholder:T,placeholderId:T?`${h.filter(N=>N.column===E).length}`:void 0,depth:p,index:h.length});C.subHeaders.push(y),h.push(C)}v.headers.push(y),y.headerGroup=v}),u.push(v),p>0&&c(h,p-1)},f=t.map((m,p)=>vi(n,m,{depth:i,index:p}));c(f,i-1),u.reverse();const g=m=>m.filter(v=>v.column.getIsVisible()).map(v=>{let h=0,y=0,w=[0];v.subHeaders&&v.subHeaders.length?(w=[],g(v.subHeaders).forEach(E=>{let{colSpan:T,rowSpan:C}=E;h+=T,w.push(C)})):h=1;const x=Math.min(...w);return y=y+x,v.colSpan=h,v.rowSpan=y,{colSpan:h,rowSpan:y}});return g((o=(s=u[0])==null?void 0:s.headers)!=null?o:[]),u}const Qr=(e,t,n,r,o,s,i)=>{let a={id:t,index:r,original:n,depth:o,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:u=>{if(a._valuesCache.hasOwnProperty(u))return a._valuesCache[u];const c=e.getColumn(u);if(c!=null&&c.accessorFn)return a._valuesCache[u]=c.accessorFn(a.original,r),a._valuesCache[u]},getUniqueValues:u=>{if(a._uniqueValuesCache.hasOwnProperty(u))return a._uniqueValuesCache[u];const c=e.getColumn(u);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[u]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[u]):(a._uniqueValuesCache[u]=[a.getValue(u)],a._uniqueValuesCache[u])},renderValue:u=>{var c;return(c=a.getValue(u))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Id(a.subRows,u=>u.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let u=[],c=a;for(;;){const f=c.getParentRow();if(!f)break;u.push(f),c=f}return u.reverse()},getAllCells:J(()=>[e.getAllLeafColumns()],u=>u.map(c=>Rd(e,a,c,c.id)),Y(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:J(()=>[a.getAllCells()],u=>u.reduce((c,f)=>(c[f.column.id]=f,c),{}),Y(e.options,"debugRows","getAllCellsByColumnId"))};for(let u=0;u<e._features.length;u++){const c=e._features[u];c==null||c.createRow==null||c.createRow(a,e)}return a},Bd={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},yi=(e,t,n)=>{var r,o;const s=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(s))};yi.autoRemove=e=>Ve(e);const wi=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};wi.autoRemove=e=>Ve(e);const bi=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};bi.autoRemove=e=>Ve(e);const xi=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};xi.autoRemove=e=>Ve(e)||!(e!=null&&e.length);const Ci=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});Ci.autoRemove=e=>Ve(e)||!(e!=null&&e.length);const Si=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});Si.autoRemove=e=>Ve(e)||!(e!=null&&e.length);const Ei=(e,t,n)=>e.getValue(t)===n;Ei.autoRemove=e=>Ve(e);const Ni=(e,t,n)=>e.getValue(t)==n;Ni.autoRemove=e=>Ve(e);const eo=(e,t,n)=>{let[r,o]=n;const s=e.getValue(t);return s>=r&&s<=o};eo.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,s=t===null||Number.isNaN(r)?-1/0:r,i=n===null||Number.isNaN(o)?1/0:o;if(s>i){const a=s;s=i,i=a}return[s,i]},eo.autoRemove=e=>Ve(e)||Ve(e[0])&&Ve(e[1]);const ot={includesString:yi,includesStringSensitive:wi,equalsString:bi,arrIncludes:xi,arrIncludesAll:Ci,arrIncludesSome:Si,equals:Ei,weakEquals:Ni,inNumberRange:eo};function Ve(e){return e==null||e===""}const Hd={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Fe("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?ot.includesString:typeof r=="number"?ot.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?ot.equals:Array.isArray(r)?ot.arrIncludes:ot.weakEquals},e.getFilterFn=()=>{var n,r;return zn(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:ot[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),s=r==null?void 0:r.find(f=>f.id===e.id),i=vt(n,s?s.value:void 0);if(Ti(o,i,e)){var a;return(a=r==null?void 0:r.filter(f=>f.id!==e.id))!=null?a:[]}const u={id:e.id,value:i};if(s){var c;return(c=r==null?void 0:r.map(f=>f.id===e.id?u:f))!=null?c:[]}return r!=null&&r.length?[...r,u]:[u]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var s;return(s=vt(t,o))==null?void 0:s.filter(i=>{const a=n.find(u=>u.id===i.id);if(a){const u=a.getFilterFn();if(Ti(u,i.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Ti(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const to={sum:(e,t,n)=>n.reduce((r,o)=>{const s=o.getValue(e);return r+(typeof s=="number"?s:0)},0),min:(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r>s||r===void 0&&s>=s)&&(r=s)}),r},max:(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r<s||r===void 0&&s>=s)&&(r=s)}),r},extent:(e,t,n)=>{let r,o;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(r===void 0?i>=i&&(r=o=i):(r>i&&(r=i),o<i&&(o=i)))}),[r,o]},mean:(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let s=o.getValue(e);s!=null&&(s=+s)>=s&&(++n,r+=s)}),n)return r/n},median:(e,t)=>{if(!t.length)return;const n=t.map(s=>s.getValue(e));if(!kd(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((s,i)=>s-i);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},unique:(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(n=>n.getValue(e))).size,count:(e,t)=>t.length},zd={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Fe("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return to.sum;if(Object.prototype.toString.call(r)==="[object Date]")return to.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return zn(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:to[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function Ud(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(s=>!t.includes(s.id));return n==="remove"?r:[...t.map(s=>e.find(i=>i.id===s)).filter(Boolean),...r]}const jd={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Fe("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=J(n=>[mn(t,n)],n=>n.findIndex(r=>r.id===e.id),Y(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=mn(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=mn(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=J(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let s=[];if(!(t!=null&&t.length))s=o;else{const i=[...t],a=[...o];for(;a.length&&i.length;){const u=i.shift(),c=a.findIndex(f=>f.id===u);c>-1&&s.push(a.splice(c,1)[0])}s=[...s,...a]}return Ud(s,n,r)},Y(e.options,"debugTable","_getOrderColumnsFn"))}},no=()=>({left:[],right:[]}),Wd={getInitialState:e=>({columnPinning:no(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Fe("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var s,i;if(n==="right"){var a,u;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(g=>!(r!=null&&r.includes(g))),right:[...((u=o==null?void 0:o.right)!=null?u:[]).filter(g=>!(r!=null&&r.includes(g))),...r]}}if(n==="left"){var c,f;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(g=>!(r!=null&&r.includes(g))),...r],right:((f=o==null?void 0:o.right)!=null?f:[]).filter(g=>!(r!=null&&r.includes(g)))}}return{left:((s=o==null?void 0:o.left)!=null?s:[]).filter(g=>!(r!=null&&r.includes(g))),right:((i=o==null?void 0:o.right)!=null?i:[]).filter(g=>!(r!=null&&r.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,s,i;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((s=(i=t.options.enableColumnPinning)!=null?i:t.options.enablePinning)!=null?s:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,s=n.some(a=>r==null?void 0:r.includes(a)),i=n.some(a=>o==null?void 0:o.includes(a));return s?"left":i?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=J(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const s=[...r??[],...o??[]];return n.filter(i=>!s.includes(i.column.id))},Y(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=J(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),Y(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=J(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),Y(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?no():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:no())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,s;return!!((o=r.left)!=null&&o.length||(s=r.right)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=J(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Y(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=J(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Y(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=J(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(s=>!o.includes(s.id))},Y(e.options,"debugColumns","getCenterLeafColumns"))}},jn={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},ro=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Gd={getDefaultColumnDef:()=>jn,getInitialState:e=>({columnSizing:{},columnSizingInfo:ro(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Fe("columnSizing",e),onColumnSizingInfoChange:Fe("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const s=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:jn.minSize,(r=s??e.columnDef.size)!=null?r:jn.size),(o=e.columnDef.maxSize)!=null?o:jn.maxSize)},e.getStart=J(n=>[n,mn(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,s)=>o+s.getSize(),0),Y(t.options,"debugColumns","getStart")),e.getAfter=J(n=>[n,mn(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,s)=>o+s.getSize(),0),Y(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var s;n+=(s=o.column.getSize())!=null?s:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r==null?void 0:r.getCanResize();return s=>{if(!r||!o||(s.persist==null||s.persist(),oo(s)&&s.touches&&s.touches.length>1))return;const i=e.getSize(),a=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[r.id,r.getSize()]],u=oo(s)?Math.round(s.touches[0].clientX):s.clientX,c={},f=(w,x)=>{typeof x=="number"&&(t.setColumnSizingInfo(E=>{var T,C;const N=t.options.columnResizeDirection==="rtl"?-1:1,S=(x-((T=E==null?void 0:E.startOffset)!=null?T:0))*N,A=Math.max(S/((C=E==null?void 0:E.startSize)!=null?C:0),-.999999);return E.columnSizingStart.forEach(B=>{let[H,K]=B;c[H]=Math.round(Math.max(K+K*A,0)*100)/100}),{...E,deltaOffset:S,deltaPercentage:A}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(E=>({...E,...c})))},g=w=>f("move",w),m=w=>{f("end",w),t.setColumnSizingInfo(x=>({...x,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=n||typeof document<"u"?document:null,v={moveHandler:w=>g(w.clientX),upHandler:w=>{p==null||p.removeEventListener("mousemove",v.moveHandler),p==null||p.removeEventListener("mouseup",v.upHandler),m(w.clientX)}},h={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),g(w.touches[0].clientX),!1),upHandler:w=>{var x;p==null||p.removeEventListener("touchmove",h.moveHandler),p==null||p.removeEventListener("touchend",h.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),m((x=w.touches[0])==null?void 0:x.clientX)}},y=qd()?{passive:!1}:!1;oo(s)?(p==null||p.addEventListener("touchmove",h.moveHandler,y),p==null||p.addEventListener("touchend",h.upHandler,y)):(p==null||p.addEventListener("mousemove",v.moveHandler,y),p==null||p.addEventListener("mouseup",v.upHandler,y)),t.setColumnSizingInfo(w=>({...w,startOffset:u,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?ro():(n=e.initialState.columnSizingInfo)!=null?n:ro())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Wn=null;function qd(){if(typeof Wn=="boolean")return Wn;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Wn=e,Wn}function oo(e){return e.type==="touchstart"}const Kd={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Fe("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(s=>s.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=J(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Y(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=J(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],Y(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>J(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),Y(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,s)=>({...o,[s.id]:n||!(s.getCanHide!=null&&s.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function mn(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const Xd={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},Jd={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Fe("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,s;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((s=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?s:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>ot.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return zn(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:ot[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Yd={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Fe("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,s;e.setExpanded(r?{}:(o=(s=e.initialState)==null?void 0:s.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(s=>{const i=s.split(".");r=Math.max(r,i.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const s=r===!0?!0:!!(r!=null&&r[e.id]);let i={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{i[a]=!0}):i=r,n=(o=n)!=null?o:!s,!s&&n)return{...i,[e.id]:!0};if(s&&!n){const{[e.id]:a,...u}=i;return u}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},so=0,io=10,ao=()=>({pageIndex:so,pageSize:io}),Zd={getInitialState:e=>({...e,pagination:{...ao(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Fe("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=s=>vt(r,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?ao():(o=e.initialState.pagination)!=null?o:ao())},e.setPageIndex=r=>{e.setPagination(o=>{let s=vt(r,o.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return s=Math.max(0,Math.min(s,i)),{...o,pageIndex:s}})},e.resetPageIndex=r=>{var o,s;e.setPageIndex(r?so:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?o:so)},e.resetPageSize=r=>{var o,s;e.setPageSize(r?io:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?o:io)},e.setPageSize=r=>{e.setPagination(o=>{const s=Math.max(1,vt(r,o.pageSize)),i=o.pageSize*o.pageIndex,a=Math.floor(i/s);return{...o,pageIndex:a,pageSize:s}})},e.setPageCount=r=>e.setPagination(o=>{var s;let i=vt(r,(s=e.options.pageCount)!=null?s:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...o,pageCount:i}}),e.getPageOptions=J(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((s,i)=>i)),o},Y(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},lo=()=>({top:[],bottom:[]}),Qd={getInitialState:e=>({rowPinning:lo(),...e}),getDefaultOptions:e=>({onRowPinningChange:Fe("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const s=r?e.getLeafRows().map(u=>{let{id:c}=u;return c}):[],i=o?e.getParentRows().map(u=>{let{id:c}=u;return c}):[],a=new Set([...i,e.id,...s]);t.setRowPinning(u=>{var c,f;if(n==="bottom"){var g,m;return{top:((g=u==null?void 0:u.top)!=null?g:[]).filter(h=>!(a!=null&&a.has(h))),bottom:[...((m=u==null?void 0:u.bottom)!=null?m:[]).filter(h=>!(a!=null&&a.has(h))),...Array.from(a)]}}if(n==="top"){var p,v;return{top:[...((p=u==null?void 0:u.top)!=null?p:[]).filter(h=>!(a!=null&&a.has(h))),...Array.from(a)],bottom:((v=u==null?void 0:u.bottom)!=null?v:[]).filter(h=>!(a!=null&&a.has(h)))}}return{top:((c=u==null?void 0:u.top)!=null?c:[]).filter(h=>!(a!=null&&a.has(h))),bottom:((f=u==null?void 0:u.bottom)!=null?f:[]).filter(h=>!(a!=null&&a.has(h)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,s=n.some(a=>r==null?void 0:r.includes(a)),i=n.some(a=>o==null?void 0:o.includes(a));return s?"top":i?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const s=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(i=>{let{id:a}=i;return a});return(r=s==null?void 0:s.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?lo():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:lo())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,s;return!!((o=r.top)!=null&&o.length||(s=r.bottom)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(i=>{const a=e.getRow(i,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(i=>t.find(a=>a.id===i))).filter(Boolean).map(i=>({...i,position:r}))},e.getTopRows=J(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Y(e.options,"debugRows","getTopRows")),e.getBottomRows=J(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Y(e.options,"debugRows","getBottomRows")),e.getCenterRows=J(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(s=>!o.has(s.id))},Y(e.options,"debugRows","getCenterRows"))}},ef={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Fe("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(s=>{s.getCanSelect()&&(r[s.id]=!0)}):o.forEach(s=>{delete r[s.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(s=>{co(o,s.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=J(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?uo(e,n):{rows:[],flatRows:[],rowsById:{}},Y(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=J(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?uo(e,n):{rows:[],flatRows:[],rowsById:{}},Y(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=J(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?uo(e,n):{rows:[],flatRows:[],rowsById:{}},Y(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(s=>{var i;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return s;const a={...s};return co(a,e.id,n,(i=r==null?void 0:r.selectChildren)!=null?i:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return fo(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return po(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return po(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},co=(e,t,n,r,o)=>{var s;const i=o.getRow(t,!0);n?(i.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),i.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(s=i.subRows)!=null&&s.length&&i.getCanSelectSubRows()&&i.subRows.forEach(a=>co(e,a.id,n,r,o))};function uo(e,t){const n=e.getState().rowSelection,r=[],o={},s=function(i,a){return i.map(u=>{var c;const f=fo(u,n);if(f&&(r.push(u),o[u.id]=u),(c=u.subRows)!=null&&c.length&&(u={...u,subRows:s(u.subRows)}),f)return u}).filter(Boolean)};return{rows:s(t.rows),flatRows:r,rowsById:o}}function fo(e,t){var n;return(n=t[e.id])!=null?n:!1}function po(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,s=!1;return e.subRows.forEach(i=>{if(!(s&&!o)&&(i.getCanSelect()&&(fo(i,t)?s=!0:o=!1),i.subRows&&i.subRows.length)){const a=po(i,t);a==="all"?s=!0:(a==="some"&&(s=!0),o=!1)}}),o?"all":s?"some":!1}const go=/([0-9]+)/gm,tf=(e,t,n)=>Pi(yt(e.getValue(n)).toLowerCase(),yt(t.getValue(n)).toLowerCase()),nf=(e,t,n)=>Pi(yt(e.getValue(n)),yt(t.getValue(n))),rf=(e,t,n)=>ho(yt(e.getValue(n)).toLowerCase(),yt(t.getValue(n)).toLowerCase()),of=(e,t,n)=>ho(yt(e.getValue(n)),yt(t.getValue(n))),sf=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},af=(e,t,n)=>ho(e.getValue(n),t.getValue(n));function ho(e,t){return e===t?0:e>t?1:-1}function yt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Pi(e,t){const n=e.split(go).filter(Boolean),r=t.split(go).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),s=r.shift(),i=parseInt(o,10),a=parseInt(s,10),u=[i,a].sort();if(isNaN(u[0])){if(o>s)return 1;if(s>o)return-1;continue}if(isNaN(u[1]))return isNaN(i)?-1:1;if(i>a)return 1;if(a>i)return-1}return n.length-r.length}const vn={alphanumeric:tf,alphanumericCaseSensitive:nf,text:rf,textCaseSensitive:of,datetime:sf,basic:af},lf=[Vd,Kd,jd,Wd,Bd,Hd,Xd,Jd,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Fe("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const s=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(s)==="[object Date]")return vn.datetime;if(typeof s=="string"&&(r=!0,s.split(go).length>1))return vn.alphanumeric}return r?vn.text:vn.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return zn(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:vn[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),s=typeof n<"u"&&n!==null;t.setSorting(i=>{const a=i==null?void 0:i.find(p=>p.id===e.id),u=i==null?void 0:i.findIndex(p=>p.id===e.id);let c=[],f,g=s?n:o==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&r?a?f="toggle":f="add":i!=null&&i.length&&u!==i.length-1?f="replace":a?f="toggle":f="replace",f==="toggle"&&(s||o||(f="remove")),f==="add"){var m;c=[...i,{id:e.id,desc:g}],c.splice(0,c.length-((m=t.options.maxMultiSortColCount)!=null?m:Number.MAX_SAFE_INTEGER))}else f==="toggle"?c=i.map(p=>p.id===e.id?{...p,desc:g}:p):f==="remove"?c=i.filter(p=>p.id!==e.id):c=[{id:e.id,desc:g}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const s=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==s&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:i==="desc"?"asc":"desc":s},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},zd,Yd,Zd,Qd,ef,Gd];function cf(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...lf,...(t=e._features)!=null?t:[]];let o={_features:r};const s=o._features.reduce((m,p)=>Object.assign(m,p.getDefaultOptions==null?void 0:p.getDefaultOptions(o)),{}),i=m=>o.options.mergeOptions?o.options.mergeOptions(s,m):{...s,...m};let u={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(m=>{var p;u=(p=m.getInitialState==null?void 0:m.getInitialState(u))!=null?p:u});const c=[];let f=!1;const g={_features:r,options:{...s,...e},initialState:u,_queue:m=>{c.push(m),f||(f=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();f=!1}).catch(p=>setTimeout(()=>{throw p})))},reset:()=>{o.setState(o.initialState)},setOptions:m=>{const p=vt(m,o.options);o.options=i(p)},getState:()=>o.options.state,setState:m=>{o.options.onStateChange==null||o.options.onStateChange(m)},_getRowId:(m,p,v)=>{var h;return(h=o.options.getRowId==null?void 0:o.options.getRowId(m,p,v))!=null?h:`${v?[v.id,p].join("."):p}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(m,p)=>{let v=(p?o.getPrePaginationRowModel():o.getRowModel()).rowsById[m];if(!v&&(v=o.getCoreRowModel().rowsById[m],!v))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${m}`):new Error;return v},_getDefaultColumnDef:J(()=>[o.options.defaultColumn],m=>{var p;return m=(p=m)!=null?p:{},{header:v=>{const h=v.header.column.columnDef;return h.accessorKey?h.accessorKey:h.accessorFn?h.id:null},cell:v=>{var h,y;return(h=(y=v.renderValue())==null||y.toString==null?void 0:y.toString())!=null?h:null},...o._features.reduce((v,h)=>Object.assign(v,h.getDefaultColumnDef==null?void 0:h.getDefaultColumnDef()),{}),...m}},Y(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:J(()=>[o._getColumnDefs()],m=>{const p=function(v,h,y){return y===void 0&&(y=0),v.map(w=>{const x=Ld(o,w,y,h),E=w;return x.columns=E.columns?p(E.columns,x,y+1):[],x})};return p(m)},Y(e,"debugColumns","getAllColumns")),getAllFlatColumns:J(()=>[o.getAllColumns()],m=>m.flatMap(p=>p.getFlatColumns()),Y(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:J(()=>[o.getAllFlatColumns()],m=>m.reduce((p,v)=>(p[v.id]=v,p),{}),Y(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:J(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(m,p)=>{let v=m.flatMap(h=>h.getLeafColumns());return p(v)},Y(e,"debugColumns","getAllLeafColumns")),getColumn:m=>{const p=o._getAllFlatColumnsById()[m];return process.env.NODE_ENV!=="production"&&!p&&console.error(`[Table] Column with id '${m}' does not exist.`),p}};Object.assign(o,g);for(let m=0;m<o._features.length;m++){const p=o._features[m];p==null||p.createTable==null||p.createTable(o)}return o}function Ai(){return e=>J(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,s,i){s===void 0&&(s=0);const a=[];for(let c=0;c<o.length;c++){const f=Qr(e,e._getRowId(o[c],c,i),o[c],c,s,void 0,i==null?void 0:i.id);if(n.flatRows.push(f),n.rowsById[f.id]=f,a.push(f),e.options.getSubRows){var u;f.originalSubRows=e.options.getSubRows(o[c],c),(u=f.originalSubRows)!=null&&u.length&&(f.subRows=r(f.originalSubRows,s+1,f))}}return a};return n.rows=r(t),n},Y(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function uf(e,t,n){return n.options.filterFromLeafRows?df(e,t,n):ff(e,t,n)}function df(e,t,n){var r;const o=[],s={},i=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(u,c){c===void 0&&(c=0);const f=[];for(let m=0;m<u.length;m++){var g;let p=u[m];const v=Qr(n,p.id,p.original,p.index,p.depth,void 0,p.parentId);if(v.columnFilters=p.columnFilters,(g=p.subRows)!=null&&g.length&&c<i){if(v.subRows=a(p.subRows,c+1),p=v,t(p)&&!v.subRows.length){f.push(p),s[p.id]=p,o.push(p);continue}if(t(p)||v.subRows.length){f.push(p),s[p.id]=p,o.push(p);continue}}else p=v,t(p)&&(f.push(p),s[p.id]=p,o.push(p))}return f};return{rows:a(e),flatRows:o,rowsById:s}}function ff(e,t,n){var r;const o=[],s={},i=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(u,c){c===void 0&&(c=0);const f=[];for(let m=0;m<u.length;m++){let p=u[m];if(t(p)){var g;if((g=p.subRows)!=null&&g.length&&c<i){const h=Qr(n,p.id,p.original,p.index,p.depth,void 0,p.parentId);h.subRows=a(p.subRows,c+1),p=h}f.push(p),o.push(p),s[p.id]=p}}return f};return{rows:a(e),flatRows:o,rowsById:s}}function pf(){return e=>J(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let m=0;m<t.flatRows.length;m++)t.flatRows[m].columnFilters={},t.flatRows[m].columnFiltersMeta={};return t}const o=[],s=[];(n??[]).forEach(m=>{var p;const v=e.getColumn(m.id);if(!v)return;const h=v.getFilterFn();if(!h){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${v.id}.`);return}o.push({id:m.id,filterFn:h,resolvedValue:(p=h.resolveFilterValue==null?void 0:h.resolveFilterValue(m.value))!=null?p:m.value})});const i=(n??[]).map(m=>m.id),a=e.getGlobalFilterFn(),u=e.getAllLeafColumns().filter(m=>m.getCanGlobalFilter());r&&a&&u.length&&(i.push("__global__"),u.forEach(m=>{var p;s.push({id:m.id,filterFn:a,resolvedValue:(p=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?p:r})}));let c,f;for(let m=0;m<t.flatRows.length;m++){const p=t.flatRows[m];if(p.columnFilters={},o.length)for(let v=0;v<o.length;v++){c=o[v];const h=c.id;p.columnFilters[h]=c.filterFn(p,h,c.resolvedValue,y=>{p.columnFiltersMeta[h]=y})}if(s.length){for(let v=0;v<s.length;v++){f=s[v];const h=f.id;if(f.filterFn(p,h,f.resolvedValue,y=>{p.columnFiltersMeta[h]=y})){p.columnFilters.__global__=!0;break}}p.columnFilters.__global__!==!0&&(p.columnFilters.__global__=!1)}}const g=m=>{for(let p=0;p<i.length;p++)if(m.columnFilters[i[p]]===!1)return!1;return!0};return uf(t.rows,g,e)},Y(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}/**
13
+ color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function Y(e,t,n,r){return{debug:()=>{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function Rd(e,t,n,r){const o=()=>{var i;return(i=s.getValue())!=null?i:e.options.renderFallbackValue},s={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:J(()=>[e,n,t,s],(i,a,u,c)=>({table:i,column:a,row:u,cell:c,getValue:c.getValue,renderValue:c.renderValue}),Y(e.options,"debugCells","cell.getContext"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(s,n,t,e)},{}),s}function Ld(e,t,n,r){var o,s;const a={...e._getDefaultColumnDef(),...t},u=a.accessorKey;let c=(o=(s=a.id)!=null?s:u?typeof String.prototype.replaceAll=="function"?u.replaceAll(".","_"):u.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,f;if(a.accessorFn?f=a.accessorFn:u&&(u.includes(".")?f=m=>{let p=m;for(const h of u.split(".")){var v;p=(v=p)==null?void 0:v[h],process.env.NODE_ENV!=="production"&&p===void 0&&console.warn(`"${h}" in deeply nested key "${u}" returned undefined.`)}return p}:f=m=>m[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let g={id:`${String(c)}`,accessorFn:f,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:J(()=>[!0],()=>{var m;return[g,...(m=g.columns)==null?void 0:m.flatMap(p=>p.getFlatColumns())]},Y(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:J(()=>[e._getOrderColumnsFn()],m=>{var p;if((p=g.columns)!=null&&p.length){let v=g.columns.flatMap(h=>h.getLeafColumns());return m(v)}return[g]},Y(e.options,"debugColumns","column.getLeafColumns"))};for(const m of e._features)m.createColumn==null||m.createColumn(g,e);return g}const Ce="debugHeaders";function vi(e,t,n){var r;let s={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const i=[],a=u=>{u.subHeaders&&u.subHeaders.length&&u.subHeaders.map(a),i.push(u)};return a(s),i},getContext:()=>({table:e,header:s,column:t})};return e._features.forEach(i=>{i.createHeader==null||i.createHeader(s,e)}),s}const Vd={createTable:e=>{e.getHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var s,i;const a=(s=r==null?void 0:r.map(g=>n.find(m=>m.id===g)).filter(Boolean))!=null?s:[],u=(i=o==null?void 0:o.map(g=>n.find(m=>m.id===g)).filter(Boolean))!=null?i:[],c=n.filter(g=>!(r!=null&&r.includes(g.id))&&!(o!=null&&o.includes(g.id)));return Un(t,[...a,...c,...u],e)},Y(e.options,Ce,"getHeaderGroups")),e.getCenterHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(s=>!(r!=null&&r.includes(s.id))&&!(o!=null&&o.includes(s.id))),Un(t,n,e,"center")),Y(e.options,Ce,"getCenterHeaderGroups")),e.getLeftHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const s=(o=r==null?void 0:r.map(i=>n.find(a=>a.id===i)).filter(Boolean))!=null?o:[];return Un(t,s,e,"left")},Y(e.options,Ce,"getLeftHeaderGroups")),e.getRightHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const s=(o=r==null?void 0:r.map(i=>n.find(a=>a.id===i)).filter(Boolean))!=null?o:[];return Un(t,s,e,"right")},Y(e.options,Ce,"getRightHeaderGroups")),e.getFooterGroups=J(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Y(e.options,Ce,"getFooterGroups")),e.getLeftFooterGroups=J(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Y(e.options,Ce,"getLeftFooterGroups")),e.getCenterFooterGroups=J(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Y(e.options,Ce,"getCenterFooterGroups")),e.getRightFooterGroups=J(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Y(e.options,Ce,"getRightFooterGroups")),e.getFlatHeaders=J(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Y(e.options,Ce,"getFlatHeaders")),e.getLeftFlatHeaders=J(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Y(e.options,Ce,"getLeftFlatHeaders")),e.getCenterFlatHeaders=J(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Y(e.options,Ce,"getCenterFlatHeaders")),e.getRightFlatHeaders=J(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Y(e.options,Ce,"getRightFlatHeaders")),e.getCenterLeafHeaders=J(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Y(e.options,Ce,"getCenterLeafHeaders")),e.getLeftLeafHeaders=J(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Y(e.options,Ce,"getLeftLeafHeaders")),e.getRightLeafHeaders=J(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Y(e.options,Ce,"getRightLeafHeaders")),e.getLeafHeaders=J(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,s,i,a,u,c;return[...(o=(s=t[0])==null?void 0:s.headers)!=null?o:[],...(i=(a=n[0])==null?void 0:a.headers)!=null?i:[],...(u=(c=r[0])==null?void 0:c.headers)!=null?u:[]].map(f=>f.getLeafHeaders()).flat()},Y(e.options,Ce,"getLeafHeaders"))}};function Un(e,t,n,r){var o,s;let i=0;const a=function(m,p){p===void 0&&(p=1),i=Math.max(i,p),m.filter(v=>v.getIsVisible()).forEach(v=>{var h;(h=v.columns)!=null&&h.length&&a(v.columns,p+1)},0)};a(e);let u=[];const c=(m,p)=>{const v={depth:p,id:[r,`${p}`].filter(Boolean).join("_"),headers:[]},h=[];m.forEach(y=>{const w=[...h].reverse()[0],x=y.column.depth===v.depth;let S,E=!1;if(x&&y.column.parent?S=y.column.parent:(S=y.column,E=!0),w&&(w==null?void 0:w.column)===S)w.subHeaders.push(y);else{const C=vi(n,S,{id:[r,p,S.id,y==null?void 0:y.id].filter(Boolean).join("_"),isPlaceholder:E,placeholderId:E?`${h.filter(P=>P.column===S).length}`:void 0,depth:p,index:h.length});C.subHeaders.push(y),h.push(C)}v.headers.push(y),y.headerGroup=v}),u.push(v),p>0&&c(h,p-1)},f=t.map((m,p)=>vi(n,m,{depth:i,index:p}));c(f,i-1),u.reverse();const g=m=>m.filter(v=>v.column.getIsVisible()).map(v=>{let h=0,y=0,w=[0];v.subHeaders&&v.subHeaders.length?(w=[],g(v.subHeaders).forEach(S=>{let{colSpan:E,rowSpan:C}=S;h+=E,w.push(C)})):h=1;const x=Math.min(...w);return y=y+x,v.colSpan=h,v.rowSpan=y,{colSpan:h,rowSpan:y}});return g((o=(s=u[0])==null?void 0:s.headers)!=null?o:[]),u}const Qr=(e,t,n,r,o,s,i)=>{let a={id:t,index:r,original:n,depth:o,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:u=>{if(a._valuesCache.hasOwnProperty(u))return a._valuesCache[u];const c=e.getColumn(u);if(c!=null&&c.accessorFn)return a._valuesCache[u]=c.accessorFn(a.original,r),a._valuesCache[u]},getUniqueValues:u=>{if(a._uniqueValuesCache.hasOwnProperty(u))return a._uniqueValuesCache[u];const c=e.getColumn(u);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[u]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[u]):(a._uniqueValuesCache[u]=[a.getValue(u)],a._uniqueValuesCache[u])},renderValue:u=>{var c;return(c=a.getValue(u))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Id(a.subRows,u=>u.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let u=[],c=a;for(;;){const f=c.getParentRow();if(!f)break;u.push(f),c=f}return u.reverse()},getAllCells:J(()=>[e.getAllLeafColumns()],u=>u.map(c=>Rd(e,a,c,c.id)),Y(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:J(()=>[a.getAllCells()],u=>u.reduce((c,f)=>(c[f.column.id]=f,c),{}),Y(e.options,"debugRows","getAllCellsByColumnId"))};for(let u=0;u<e._features.length;u++){const c=e._features[u];c==null||c.createRow==null||c.createRow(a,e)}return a},Bd={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},yi=(e,t,n)=>{var r,o;const s=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(s))};yi.autoRemove=e=>Ue(e);const wi=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};wi.autoRemove=e=>Ue(e);const bi=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};bi.autoRemove=e=>Ue(e);const xi=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};xi.autoRemove=e=>Ue(e)||!(e!=null&&e.length);const Ci=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});Ci.autoRemove=e=>Ue(e)||!(e!=null&&e.length);const Si=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});Si.autoRemove=e=>Ue(e)||!(e!=null&&e.length);const Ei=(e,t,n)=>e.getValue(t)===n;Ei.autoRemove=e=>Ue(e);const Ni=(e,t,n)=>e.getValue(t)==n;Ni.autoRemove=e=>Ue(e);const eo=(e,t,n)=>{let[r,o]=n;const s=e.getValue(t);return s>=r&&s<=o};eo.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,s=t===null||Number.isNaN(r)?-1/0:r,i=n===null||Number.isNaN(o)?1/0:o;if(s>i){const a=s;s=i,i=a}return[s,i]},eo.autoRemove=e=>Ue(e)||Ue(e[0])&&Ue(e[1]);const at={includesString:yi,includesStringSensitive:wi,equalsString:bi,arrIncludes:xi,arrIncludesAll:Ci,arrIncludesSome:Si,equals:Ei,weakEquals:Ni,inNumberRange:eo};function Ue(e){return e==null||e===""}const zd={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Me("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?at.includesString:typeof r=="number"?at.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?at.equals:Array.isArray(r)?at.arrIncludes:at.weakEquals},e.getFilterFn=()=>{var n,r;return Hn(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:at[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),s=r==null?void 0:r.find(f=>f.id===e.id),i=wt(n,s?s.value:void 0);if(Ti(o,i,e)){var a;return(a=r==null?void 0:r.filter(f=>f.id!==e.id))!=null?a:[]}const u={id:e.id,value:i};if(s){var c;return(c=r==null?void 0:r.map(f=>f.id===e.id?u:f))!=null?c:[]}return r!=null&&r.length?[...r,u]:[u]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var s;return(s=wt(t,o))==null?void 0:s.filter(i=>{const a=n.find(u=>u.id===i.id);if(a){const u=a.getFilterFn();if(Ti(u,i.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Ti(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const to={sum:(e,t,n)=>n.reduce((r,o)=>{const s=o.getValue(e);return r+(typeof s=="number"?s:0)},0),min:(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r>s||r===void 0&&s>=s)&&(r=s)}),r},max:(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r<s||r===void 0&&s>=s)&&(r=s)}),r},extent:(e,t,n)=>{let r,o;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(r===void 0?i>=i&&(r=o=i):(r>i&&(r=i),o<i&&(o=i)))}),[r,o]},mean:(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let s=o.getValue(e);s!=null&&(s=+s)>=s&&(++n,r+=s)}),n)return r/n},median:(e,t)=>{if(!t.length)return;const n=t.map(s=>s.getValue(e));if(!kd(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((s,i)=>s-i);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},unique:(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(n=>n.getValue(e))).size,count:(e,t)=>t.length},Hd={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Me("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return to.sum;if(Object.prototype.toString.call(r)==="[object Date]")return to.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Hn(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:to[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function Ud(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(s=>!t.includes(s.id));return n==="remove"?r:[...t.map(s=>e.find(i=>i.id===s)).filter(Boolean),...r]}const jd={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Me("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=J(n=>[mn(t,n)],n=>n.findIndex(r=>r.id===e.id),Y(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=mn(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=mn(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=J(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let s=[];if(!(t!=null&&t.length))s=o;else{const i=[...t],a=[...o];for(;a.length&&i.length;){const u=i.shift(),c=a.findIndex(f=>f.id===u);c>-1&&s.push(a.splice(c,1)[0])}s=[...s,...a]}return Ud(s,n,r)},Y(e.options,"debugTable","_getOrderColumnsFn"))}},no=()=>({left:[],right:[]}),Wd={getInitialState:e=>({columnPinning:no(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Me("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var s,i;if(n==="right"){var a,u;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(g=>!(r!=null&&r.includes(g))),right:[...((u=o==null?void 0:o.right)!=null?u:[]).filter(g=>!(r!=null&&r.includes(g))),...r]}}if(n==="left"){var c,f;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(g=>!(r!=null&&r.includes(g))),...r],right:((f=o==null?void 0:o.right)!=null?f:[]).filter(g=>!(r!=null&&r.includes(g)))}}return{left:((s=o==null?void 0:o.left)!=null?s:[]).filter(g=>!(r!=null&&r.includes(g))),right:((i=o==null?void 0:o.right)!=null?i:[]).filter(g=>!(r!=null&&r.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,s,i;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((s=(i=t.options.enableColumnPinning)!=null?i:t.options.enablePinning)!=null?s:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,s=n.some(a=>r==null?void 0:r.includes(a)),i=n.some(a=>o==null?void 0:o.includes(a));return s?"left":i?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=J(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const s=[...r??[],...o??[]];return n.filter(i=>!s.includes(i.column.id))},Y(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=J(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),Y(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=J(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),Y(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?no():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:no())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,s;return!!((o=r.left)!=null&&o.length||(s=r.right)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=J(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Y(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=J(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Y(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=J(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(s=>!o.includes(s.id))},Y(e.options,"debugColumns","getCenterLeafColumns"))}},jn={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},ro=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Gd={getDefaultColumnDef:()=>jn,getInitialState:e=>({columnSizing:{},columnSizingInfo:ro(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Me("columnSizing",e),onColumnSizingInfoChange:Me("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const s=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:jn.minSize,(r=s??e.columnDef.size)!=null?r:jn.size),(o=e.columnDef.maxSize)!=null?o:jn.maxSize)},e.getStart=J(n=>[n,mn(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,s)=>o+s.getSize(),0),Y(t.options,"debugColumns","getStart")),e.getAfter=J(n=>[n,mn(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,s)=>o+s.getSize(),0),Y(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var s;n+=(s=o.column.getSize())!=null?s:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r==null?void 0:r.getCanResize();return s=>{if(!r||!o||(s.persist==null||s.persist(),oo(s)&&s.touches&&s.touches.length>1))return;const i=e.getSize(),a=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[r.id,r.getSize()]],u=oo(s)?Math.round(s.touches[0].clientX):s.clientX,c={},f=(w,x)=>{typeof x=="number"&&(t.setColumnSizingInfo(S=>{var E,C;const P=t.options.columnResizeDirection==="rtl"?-1:1,_=(x-((E=S==null?void 0:S.startOffset)!=null?E:0))*P,O=Math.max(_/((C=S==null?void 0:S.startSize)!=null?C:0),-.999999);return S.columnSizingStart.forEach($=>{let[F,G]=$;c[F]=Math.round(Math.max(G+G*O,0)*100)/100}),{...S,deltaOffset:_,deltaPercentage:O}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(S=>({...S,...c})))},g=w=>f("move",w),m=w=>{f("end",w),t.setColumnSizingInfo(x=>({...x,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=n||typeof document<"u"?document:null,v={moveHandler:w=>g(w.clientX),upHandler:w=>{p==null||p.removeEventListener("mousemove",v.moveHandler),p==null||p.removeEventListener("mouseup",v.upHandler),m(w.clientX)}},h={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),g(w.touches[0].clientX),!1),upHandler:w=>{var x;p==null||p.removeEventListener("touchmove",h.moveHandler),p==null||p.removeEventListener("touchend",h.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),m((x=w.touches[0])==null?void 0:x.clientX)}},y=qd()?{passive:!1}:!1;oo(s)?(p==null||p.addEventListener("touchmove",h.moveHandler,y),p==null||p.addEventListener("touchend",h.upHandler,y)):(p==null||p.addEventListener("mousemove",v.moveHandler,y),p==null||p.addEventListener("mouseup",v.upHandler,y)),t.setColumnSizingInfo(w=>({...w,startOffset:u,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?ro():(n=e.initialState.columnSizingInfo)!=null?n:ro())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Wn=null;function qd(){if(typeof Wn=="boolean")return Wn;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Wn=e,Wn}function oo(e){return e.type==="touchstart"}const Kd={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Me("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(s=>s.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=J(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Y(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=J(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],Y(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>J(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),Y(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,s)=>({...o,[s.id]:n||!(s.getCanHide!=null&&s.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function mn(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const Xd={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},Jd={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Me("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,s;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((s=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?s:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>at.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Hn(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:at[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Yd={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Me("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,s;e.setExpanded(r?{}:(o=(s=e.initialState)==null?void 0:s.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(s=>{const i=s.split(".");r=Math.max(r,i.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const s=r===!0?!0:!!(r!=null&&r[e.id]);let i={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{i[a]=!0}):i=r,n=(o=n)!=null?o:!s,!s&&n)return{...i,[e.id]:!0};if(s&&!n){const{[e.id]:a,...u}=i;return u}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},so=0,io=10,ao=()=>({pageIndex:so,pageSize:io}),Zd={getInitialState:e=>({...e,pagination:{...ao(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Me("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=s=>wt(r,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?ao():(o=e.initialState.pagination)!=null?o:ao())},e.setPageIndex=r=>{e.setPagination(o=>{let s=wt(r,o.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return s=Math.max(0,Math.min(s,i)),{...o,pageIndex:s}})},e.resetPageIndex=r=>{var o,s;e.setPageIndex(r?so:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?o:so)},e.resetPageSize=r=>{var o,s;e.setPageSize(r?io:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?o:io)},e.setPageSize=r=>{e.setPagination(o=>{const s=Math.max(1,wt(r,o.pageSize)),i=o.pageSize*o.pageIndex,a=Math.floor(i/s);return{...o,pageIndex:a,pageSize:s}})},e.setPageCount=r=>e.setPagination(o=>{var s;let i=wt(r,(s=e.options.pageCount)!=null?s:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...o,pageCount:i}}),e.getPageOptions=J(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((s,i)=>i)),o},Y(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},lo=()=>({top:[],bottom:[]}),Qd={getInitialState:e=>({rowPinning:lo(),...e}),getDefaultOptions:e=>({onRowPinningChange:Me("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const s=r?e.getLeafRows().map(u=>{let{id:c}=u;return c}):[],i=o?e.getParentRows().map(u=>{let{id:c}=u;return c}):[],a=new Set([...i,e.id,...s]);t.setRowPinning(u=>{var c,f;if(n==="bottom"){var g,m;return{top:((g=u==null?void 0:u.top)!=null?g:[]).filter(h=>!(a!=null&&a.has(h))),bottom:[...((m=u==null?void 0:u.bottom)!=null?m:[]).filter(h=>!(a!=null&&a.has(h))),...Array.from(a)]}}if(n==="top"){var p,v;return{top:[...((p=u==null?void 0:u.top)!=null?p:[]).filter(h=>!(a!=null&&a.has(h))),...Array.from(a)],bottom:((v=u==null?void 0:u.bottom)!=null?v:[]).filter(h=>!(a!=null&&a.has(h)))}}return{top:((c=u==null?void 0:u.top)!=null?c:[]).filter(h=>!(a!=null&&a.has(h))),bottom:((f=u==null?void 0:u.bottom)!=null?f:[]).filter(h=>!(a!=null&&a.has(h)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,s=n.some(a=>r==null?void 0:r.includes(a)),i=n.some(a=>o==null?void 0:o.includes(a));return s?"top":i?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const s=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(i=>{let{id:a}=i;return a});return(r=s==null?void 0:s.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?lo():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:lo())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,s;return!!((o=r.top)!=null&&o.length||(s=r.bottom)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(i=>{const a=e.getRow(i,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(i=>t.find(a=>a.id===i))).filter(Boolean).map(i=>({...i,position:r}))},e.getTopRows=J(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Y(e.options,"debugRows","getTopRows")),e.getBottomRows=J(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Y(e.options,"debugRows","getBottomRows")),e.getCenterRows=J(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(s=>!o.has(s.id))},Y(e.options,"debugRows","getCenterRows"))}},ef={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Me("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(s=>{s.getCanSelect()&&(r[s.id]=!0)}):o.forEach(s=>{delete r[s.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(s=>{co(o,s.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=J(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?uo(e,n):{rows:[],flatRows:[],rowsById:{}},Y(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=J(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?uo(e,n):{rows:[],flatRows:[],rowsById:{}},Y(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=J(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?uo(e,n):{rows:[],flatRows:[],rowsById:{}},Y(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(s=>{var i;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return s;const a={...s};return co(a,e.id,n,(i=r==null?void 0:r.selectChildren)!=null?i:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return fo(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return po(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return po(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},co=(e,t,n,r,o)=>{var s;const i=o.getRow(t,!0);n?(i.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),i.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(s=i.subRows)!=null&&s.length&&i.getCanSelectSubRows()&&i.subRows.forEach(a=>co(e,a.id,n,r,o))};function uo(e,t){const n=e.getState().rowSelection,r=[],o={},s=function(i,a){return i.map(u=>{var c;const f=fo(u,n);if(f&&(r.push(u),o[u.id]=u),(c=u.subRows)!=null&&c.length&&(u={...u,subRows:s(u.subRows)}),f)return u}).filter(Boolean)};return{rows:s(t.rows),flatRows:r,rowsById:o}}function fo(e,t){var n;return(n=t[e.id])!=null?n:!1}function po(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,s=!1;return e.subRows.forEach(i=>{if(!(s&&!o)&&(i.getCanSelect()&&(fo(i,t)?s=!0:o=!1),i.subRows&&i.subRows.length)){const a=po(i,t);a==="all"?s=!0:(a==="some"&&(s=!0),o=!1)}}),o?"all":s?"some":!1}const go=/([0-9]+)/gm,tf=(e,t,n)=>Pi(bt(e.getValue(n)).toLowerCase(),bt(t.getValue(n)).toLowerCase()),nf=(e,t,n)=>Pi(bt(e.getValue(n)),bt(t.getValue(n))),rf=(e,t,n)=>ho(bt(e.getValue(n)).toLowerCase(),bt(t.getValue(n)).toLowerCase()),of=(e,t,n)=>ho(bt(e.getValue(n)),bt(t.getValue(n))),sf=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},af=(e,t,n)=>ho(e.getValue(n),t.getValue(n));function ho(e,t){return e===t?0:e>t?1:-1}function bt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Pi(e,t){const n=e.split(go).filter(Boolean),r=t.split(go).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),s=r.shift(),i=parseInt(o,10),a=parseInt(s,10),u=[i,a].sort();if(isNaN(u[0])){if(o>s)return 1;if(s>o)return-1;continue}if(isNaN(u[1]))return isNaN(i)?-1:1;if(i>a)return 1;if(a>i)return-1}return n.length-r.length}const vn={alphanumeric:tf,alphanumericCaseSensitive:nf,text:rf,textCaseSensitive:of,datetime:sf,basic:af},lf=[Vd,Kd,jd,Wd,Bd,zd,Xd,Jd,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Me("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const s=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(s)==="[object Date]")return vn.datetime;if(typeof s=="string"&&(r=!0,s.split(go).length>1))return vn.alphanumeric}return r?vn.text:vn.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return Hn(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:vn[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),s=typeof n<"u"&&n!==null;t.setSorting(i=>{const a=i==null?void 0:i.find(p=>p.id===e.id),u=i==null?void 0:i.findIndex(p=>p.id===e.id);let c=[],f,g=s?n:o==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&r?a?f="toggle":f="add":i!=null&&i.length&&u!==i.length-1?f="replace":a?f="toggle":f="replace",f==="toggle"&&(s||o||(f="remove")),f==="add"){var m;c=[...i,{id:e.id,desc:g}],c.splice(0,c.length-((m=t.options.maxMultiSortColCount)!=null?m:Number.MAX_SAFE_INTEGER))}else f==="toggle"?c=i.map(p=>p.id===e.id?{...p,desc:g}:p):f==="remove"?c=i.filter(p=>p.id!==e.id):c=[{id:e.id,desc:g}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const s=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==s&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:i==="desc"?"asc":"desc":s},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Hd,Yd,Zd,Qd,ef,Gd];function cf(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...lf,...(t=e._features)!=null?t:[]];let o={_features:r};const s=o._features.reduce((m,p)=>Object.assign(m,p.getDefaultOptions==null?void 0:p.getDefaultOptions(o)),{}),i=m=>o.options.mergeOptions?o.options.mergeOptions(s,m):{...s,...m};let u={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(m=>{var p;u=(p=m.getInitialState==null?void 0:m.getInitialState(u))!=null?p:u});const c=[];let f=!1;const g={_features:r,options:{...s,...e},initialState:u,_queue:m=>{c.push(m),f||(f=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();f=!1}).catch(p=>setTimeout(()=>{throw p})))},reset:()=>{o.setState(o.initialState)},setOptions:m=>{const p=wt(m,o.options);o.options=i(p)},getState:()=>o.options.state,setState:m=>{o.options.onStateChange==null||o.options.onStateChange(m)},_getRowId:(m,p,v)=>{var h;return(h=o.options.getRowId==null?void 0:o.options.getRowId(m,p,v))!=null?h:`${v?[v.id,p].join("."):p}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(m,p)=>{let v=(p?o.getPrePaginationRowModel():o.getRowModel()).rowsById[m];if(!v&&(v=o.getCoreRowModel().rowsById[m],!v))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${m}`):new Error;return v},_getDefaultColumnDef:J(()=>[o.options.defaultColumn],m=>{var p;return m=(p=m)!=null?p:{},{header:v=>{const h=v.header.column.columnDef;return h.accessorKey?h.accessorKey:h.accessorFn?h.id:null},cell:v=>{var h,y;return(h=(y=v.renderValue())==null||y.toString==null?void 0:y.toString())!=null?h:null},...o._features.reduce((v,h)=>Object.assign(v,h.getDefaultColumnDef==null?void 0:h.getDefaultColumnDef()),{}),...m}},Y(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:J(()=>[o._getColumnDefs()],m=>{const p=function(v,h,y){return y===void 0&&(y=0),v.map(w=>{const x=Ld(o,w,y,h),S=w;return x.columns=S.columns?p(S.columns,x,y+1):[],x})};return p(m)},Y(e,"debugColumns","getAllColumns")),getAllFlatColumns:J(()=>[o.getAllColumns()],m=>m.flatMap(p=>p.getFlatColumns()),Y(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:J(()=>[o.getAllFlatColumns()],m=>m.reduce((p,v)=>(p[v.id]=v,p),{}),Y(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:J(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(m,p)=>{let v=m.flatMap(h=>h.getLeafColumns());return p(v)},Y(e,"debugColumns","getAllLeafColumns")),getColumn:m=>{const p=o._getAllFlatColumnsById()[m];return process.env.NODE_ENV!=="production"&&!p&&console.error(`[Table] Column with id '${m}' does not exist.`),p}};Object.assign(o,g);for(let m=0;m<o._features.length;m++){const p=o._features[m];p==null||p.createTable==null||p.createTable(o)}return o}function Ai(){return e=>J(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,s,i){s===void 0&&(s=0);const a=[];for(let c=0;c<o.length;c++){const f=Qr(e,e._getRowId(o[c],c,i),o[c],c,s,void 0,i==null?void 0:i.id);if(n.flatRows.push(f),n.rowsById[f.id]=f,a.push(f),e.options.getSubRows){var u;f.originalSubRows=e.options.getSubRows(o[c],c),(u=f.originalSubRows)!=null&&u.length&&(f.subRows=r(f.originalSubRows,s+1,f))}}return a};return n.rows=r(t),n},Y(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function uf(e,t,n){return n.options.filterFromLeafRows?df(e,t,n):ff(e,t,n)}function df(e,t,n){var r;const o=[],s={},i=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(u,c){c===void 0&&(c=0);const f=[];for(let m=0;m<u.length;m++){var g;let p=u[m];const v=Qr(n,p.id,p.original,p.index,p.depth,void 0,p.parentId);if(v.columnFilters=p.columnFilters,(g=p.subRows)!=null&&g.length&&c<i){if(v.subRows=a(p.subRows,c+1),p=v,t(p)&&!v.subRows.length){f.push(p),s[p.id]=p,o.push(p);continue}if(t(p)||v.subRows.length){f.push(p),s[p.id]=p,o.push(p);continue}}else p=v,t(p)&&(f.push(p),s[p.id]=p,o.push(p))}return f};return{rows:a(e),flatRows:o,rowsById:s}}function ff(e,t,n){var r;const o=[],s={},i=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(u,c){c===void 0&&(c=0);const f=[];for(let m=0;m<u.length;m++){let p=u[m];if(t(p)){var g;if((g=p.subRows)!=null&&g.length&&c<i){const h=Qr(n,p.id,p.original,p.index,p.depth,void 0,p.parentId);h.subRows=a(p.subRows,c+1),p=h}f.push(p),o.push(p),s[p.id]=p}}return f};return{rows:a(e),flatRows:o,rowsById:s}}function pf(){return e=>J(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let m=0;m<t.flatRows.length;m++)t.flatRows[m].columnFilters={},t.flatRows[m].columnFiltersMeta={};return t}const o=[],s=[];(n??[]).forEach(m=>{var p;const v=e.getColumn(m.id);if(!v)return;const h=v.getFilterFn();if(!h){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${v.id}.`);return}o.push({id:m.id,filterFn:h,resolvedValue:(p=h.resolveFilterValue==null?void 0:h.resolveFilterValue(m.value))!=null?p:m.value})});const i=(n??[]).map(m=>m.id),a=e.getGlobalFilterFn(),u=e.getAllLeafColumns().filter(m=>m.getCanGlobalFilter());r&&a&&u.length&&(i.push("__global__"),u.forEach(m=>{var p;s.push({id:m.id,filterFn:a,resolvedValue:(p=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?p:r})}));let c,f;for(let m=0;m<t.flatRows.length;m++){const p=t.flatRows[m];if(p.columnFilters={},o.length)for(let v=0;v<o.length;v++){c=o[v];const h=c.id;p.columnFilters[h]=c.filterFn(p,h,c.resolvedValue,y=>{p.columnFiltersMeta[h]=y})}if(s.length){for(let v=0;v<s.length;v++){f=s[v];const h=f.id;if(f.filterFn(p,h,f.resolvedValue,y=>{p.columnFiltersMeta[h]=y})){p.columnFilters.__global__=!0;break}}p.columnFilters.__global__!==!0&&(p.columnFilters.__global__=!1)}}const g=m=>{for(let p=0;p<i.length;p++)if(m.columnFilters[i[p]]===!1)return!1;return!0};return uf(t.rows,g,e)},Y(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}/**
14
14
  * react-table
15
15
  *
16
16
  * Copyright (c) TanStack
@@ -19,12 +19,12 @@
19
19
  * LICENSE.md file in the root directory of this source tree.
20
20
  *
21
21
  * @license MIT
22
- */function Gn(e,t){return e?gf(e)?d.createElement(e,t):e:null}function gf(e){return hf(e)||typeof e=="function"||mf(e)}function hf(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function mf(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function _i(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=d.useState(()=>({current:cf(t)})),[r,o]=d.useState(()=>n.current.initialState);return n.current.setOptions(s=>({...s,...e,state:{...r,...e.state},onStateChange:i=>{o(i),e.onStateChange==null||e.onStateChange(i)}})),n.current}function Fi(e,t){return function(){return e.apply(t,arguments)}}const{toString:vf}=Object.prototype,{getPrototypeOf:mo}=Object,qn=(e=>t=>{const n=vf.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Be=e=>(e=e.toLowerCase(),t=>qn(t)===e),Kn=e=>t=>typeof t===e,{isArray:jt}=Array,yn=Kn("undefined");function yf(e){return e!==null&&!yn(e)&&e.constructor!==null&&!yn(e.constructor)&&Oe(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Oi=Be("ArrayBuffer");function wf(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Oi(e.buffer),t}const bf=Kn("string"),Oe=Kn("function"),Di=Kn("number"),Xn=e=>e!==null&&typeof e=="object",xf=e=>e===!0||e===!1,Jn=e=>{if(qn(e)!=="object")return!1;const t=mo(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Cf=Be("Date"),Sf=Be("File"),Ef=Be("Blob"),Nf=Be("FileList"),Tf=e=>Xn(e)&&Oe(e.pipe),Pf=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Oe(e.append)&&((t=qn(e))==="formdata"||t==="object"&&Oe(e.toString)&&e.toString()==="[object FormData]"))},Af=Be("URLSearchParams"),[_f,Ff,Of,Df]=["ReadableStream","Request","Response","Headers"].map(Be),Mf=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function wn(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),jt(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length;let a;for(r=0;r<i;r++)a=s[r],t.call(null,e[a],a,e)}}function Mi(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,o;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const Mt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,$i=e=>!yn(e)&&e!==Mt;function vo(){const{caseless:e}=$i(this)&&this||{},t={},n=(r,o)=>{const s=e&&Mi(t,o)||o;Jn(t[s])&&Jn(r)?t[s]=vo(t[s],r):Jn(r)?t[s]=vo({},r):jt(r)?t[s]=r.slice():t[s]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&wn(arguments[r],n);return t}const $f=(e,t,n,{allOwnKeys:r}={})=>(wn(t,(o,s)=>{n&&Oe(o)?e[s]=Fi(o,n):e[s]=o},{allOwnKeys:r}),e),kf=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),If=(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)},Rf=(e,t,n,r)=>{let o,s,i;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],(!r||r(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&mo(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Lf=(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},Vf=e=>{if(!e)return null;if(jt(e))return e;let t=e.length;if(!Di(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Bf=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&mo(Uint8Array)),Hf=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=r.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},zf=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Uf=Be("HTMLFormElement"),jf=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),ki=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Wf=Be("RegExp"),Ii=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};wn(n,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(r[s]=i||o)}),Object.defineProperties(e,r)},Gf=e=>{Ii(e,(t,n)=>{if(Oe(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Oe(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+"'")})}})},qf=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return jt(e)?r(e):r(String(e).split(t)),n},Kf=()=>{},Xf=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,yo="abcdefghijklmnopqrstuvwxyz",Ri="0123456789",Li={DIGIT:Ri,ALPHA:yo,ALPHA_DIGIT:yo+yo.toUpperCase()+Ri},Jf=(e=16,t=Li.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function Yf(e){return!!(e&&Oe(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Zf=e=>{const t=new Array(10),n=(r,o)=>{if(Xn(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const s=jt(r)?[]:{};return wn(r,(i,a)=>{const u=n(i,o+1);!yn(u)&&(s[a]=u)}),t[o]=void 0,s}}return r};return n(e,0)},Qf=Be("AsyncFunction"),ep=e=>e&&(Xn(e)||Oe(e))&&Oe(e.then)&&Oe(e.catch),Vi=((e,t)=>e?setImmediate:t?((n,r)=>(Mt.addEventListener("message",({source:o,data:s})=>{o===Mt&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),Mt.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Oe(Mt.postMessage)),tp=typeof queueMicrotask<"u"?queueMicrotask.bind(Mt):typeof process<"u"&&process.nextTick||Vi,_={isArray:jt,isArrayBuffer:Oi,isBuffer:yf,isFormData:Pf,isArrayBufferView:wf,isString:bf,isNumber:Di,isBoolean:xf,isObject:Xn,isPlainObject:Jn,isReadableStream:_f,isRequest:Ff,isResponse:Of,isHeaders:Df,isUndefined:yn,isDate:Cf,isFile:Sf,isBlob:Ef,isRegExp:Wf,isFunction:Oe,isStream:Tf,isURLSearchParams:Af,isTypedArray:Bf,isFileList:Nf,forEach:wn,merge:vo,extend:$f,trim:Mf,stripBOM:kf,inherits:If,toFlatObject:Rf,kindOf:qn,kindOfTest:Be,endsWith:Lf,toArray:Vf,forEachEntry:Hf,matchAll:zf,isHTMLForm:Uf,hasOwnProperty:ki,hasOwnProp:ki,reduceDescriptors:Ii,freezeMethods:Gf,toObjectSet:qf,toCamelCase:jf,noop:Kf,toFiniteNumber:Xf,findKey:Mi,global:Mt,isContextDefined:$i,ALPHABET:Li,generateString:Jf,isSpecCompliantForm:Yf,toJSONObject:Zf,isAsyncFn:Qf,isThenable:ep,setImmediate:Vi,asap:tp};function Q(e,t,n,r,o){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),o&&(this.response=o,this.status=o.status?o.status:null)}_.inherits(Q,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:_.toJSONObject(this.config),code:this.code,status:this.status}}});const Bi=Q.prototype,Hi={};["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=>{Hi[e]={value:e}}),Object.defineProperties(Q,Hi),Object.defineProperty(Bi,"isAxiosError",{value:!0}),Q.from=(e,t,n,r,o,s)=>{const i=Object.create(Bi);return _.toFlatObject(e,i,function(u){return u!==Error.prototype},a=>a!=="isAxiosError"),Q.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const np=null;function wo(e){return _.isPlainObject(e)||_.isArray(e)}function zi(e){return _.endsWith(e,"[]")?e.slice(0,-2):e}function Ui(e,t,n){return e?e.concat(t).map(function(o,s){return o=zi(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function rp(e){return _.isArray(e)&&!e.some(wo)}const op=_.toFlatObject(_,{},null,function(t){return/^is[A-Z]/.test(t)});function Yn(e,t,n){if(!_.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=_.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,y){return!_.isUndefined(y[h])});const r=n.metaTokens,o=n.visitor||f,s=n.dots,i=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&_.isSpecCompliantForm(t);if(!_.isFunction(o))throw new TypeError("visitor must be a function");function c(v){if(v===null)return"";if(_.isDate(v))return v.toISOString();if(!u&&_.isBlob(v))throw new Q("Blob is not supported. Use a Buffer instead.");return _.isArrayBuffer(v)||_.isTypedArray(v)?u&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function f(v,h,y){let w=v;if(v&&!y&&typeof v=="object"){if(_.endsWith(h,"{}"))h=r?h:h.slice(0,-2),v=JSON.stringify(v);else if(_.isArray(v)&&rp(v)||(_.isFileList(v)||_.endsWith(h,"[]"))&&(w=_.toArray(v)))return h=zi(h),w.forEach(function(E,T){!(_.isUndefined(E)||E===null)&&t.append(i===!0?Ui([h],T,s):i===null?h:h+"[]",c(E))}),!1}return wo(v)?!0:(t.append(Ui(y,h,s),c(v)),!1)}const g=[],m=Object.assign(op,{defaultVisitor:f,convertValue:c,isVisitable:wo});function p(v,h){if(!_.isUndefined(v)){if(g.indexOf(v)!==-1)throw Error("Circular reference detected in "+h.join("."));g.push(v),_.forEach(v,function(w,x){(!(_.isUndefined(w)||w===null)&&o.call(t,w,_.isString(x)?x.trim():x,h,m))===!0&&p(w,h?h.concat(x):[x])}),g.pop()}}if(!_.isObject(e))throw new TypeError("data must be an object");return p(e),t}function ji(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function bo(e,t){this._pairs=[],e&&Yn(e,this,t)}const Wi=bo.prototype;Wi.append=function(t,n){this._pairs.push([t,n])},Wi.toString=function(t){const n=t?function(r){return t.call(this,r,ji)}:ji;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function sp(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Gi(e,t,n){if(!t)return e;const r=n&&n.encode||sp;_.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(o?s=o(t,n):s=_.isURLSearchParams(t)?t.toString():new bo(t,n).toString(r),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class qi{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){_.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Ki={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ip={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:bo,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},xo=typeof window<"u"&&typeof document<"u",Co=typeof navigator=="object"&&navigator||void 0,ap=xo&&(!Co||["ReactNative","NativeScript","NS"].indexOf(Co.product)<0),lp=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",cp=xo&&window.location.href||"http://localhost",xe={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:xo,hasStandardBrowserEnv:ap,hasStandardBrowserWebWorkerEnv:lp,navigator:Co,origin:cp},Symbol.toStringTag,{value:"Module"})),...ip};function up(e,t){return Yn(e,new xe.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,s){return xe.isNode&&_.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function dp(e){return _.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function fp(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}function Xi(e){function t(n,r,o,s){let i=n[s++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),u=s>=n.length;return i=!i&&_.isArray(o)?o.length:i,u?(_.hasOwnProp(o,i)?o[i]=[o[i],r]:o[i]=r,!a):((!o[i]||!_.isObject(o[i]))&&(o[i]=[]),t(n,r,o[i],s)&&_.isArray(o[i])&&(o[i]=fp(o[i])),!a)}if(_.isFormData(e)&&_.isFunction(e.entries)){const n={};return _.forEachEntry(e,(r,o)=>{t(dp(r),o,n,0)}),n}return null}function pp(e,t,n){if(_.isString(e))try{return(t||JSON.parse)(e),_.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const bn={transitional:Ki,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=_.isObject(t);if(s&&_.isHTMLForm(t)&&(t=new FormData(t)),_.isFormData(t))return o?JSON.stringify(Xi(t)):t;if(_.isArrayBuffer(t)||_.isBuffer(t)||_.isStream(t)||_.isFile(t)||_.isBlob(t)||_.isReadableStream(t))return t;if(_.isArrayBufferView(t))return t.buffer;if(_.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 up(t,this.formSerializer).toString();if((a=_.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Yn(a?{"files[]":t}:t,u&&new u,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),pp(t)):t}],transformResponse:[function(t){const n=this.transitional||bn.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(_.isResponse(t)||_.isReadableStream(t))return t;if(t&&_.isString(t)&&(r&&!this.responseType||o)){const i=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(a){if(i)throw a.name==="SyntaxError"?Q.from(a,Q.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:xe.classes.FormData,Blob:xe.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};_.forEach(["delete","get","head","post","put","patch"],e=>{bn.headers[e]={}});const gp=_.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"]),hp=e=>{const t={};let n,r,o;return e&&e.split(`
23
- `).forEach(function(i){o=i.indexOf(":"),n=i.substring(0,o).trim().toLowerCase(),r=i.substring(o+1).trim(),!(!n||t[n]&&gp[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Ji=Symbol("internals");function xn(e){return e&&String(e).trim().toLowerCase()}function Zn(e){return e===!1||e==null?e:_.isArray(e)?e.map(Zn):String(e)}function mp(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 vp=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function So(e,t,n,r,o){if(_.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!_.isString(t)){if(_.isString(r))return t.indexOf(r)!==-1;if(_.isRegExp(r))return r.test(t)}}function yp(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function wp(e,t){const n=_.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,s,i){return this[r].call(this,t,o,s,i)},configurable:!0})})}class Ne{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function s(a,u,c){const f=xn(u);if(!f)throw new Error("header name must be a non-empty string");const g=_.findKey(o,f);(!g||o[g]===void 0||c===!0||c===void 0&&o[g]!==!1)&&(o[g||u]=Zn(a))}const i=(a,u)=>_.forEach(a,(c,f)=>s(c,f,u));if(_.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(_.isString(t)&&(t=t.trim())&&!vp(t))i(hp(t),n);else if(_.isHeaders(t))for(const[a,u]of t.entries())s(u,a,r);else t!=null&&s(n,t,r);return this}get(t,n){if(t=xn(t),t){const r=_.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return mp(o);if(_.isFunction(n))return n.call(this,o,r);if(_.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=xn(t),t){const r=_.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||So(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function s(i){if(i=xn(i),i){const a=_.findKey(r,i);a&&(!n||So(r,r[a],a,n))&&(delete r[a],o=!0)}}return _.isArray(t)?t.forEach(s):s(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const s=n[r];(!t||So(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const n=this,r={};return _.forEach(this,(o,s)=>{const i=_.findKey(r,s);if(i){n[i]=Zn(o),delete n[s];return}const a=t?yp(s):String(s).trim();a!==s&&delete n[s],n[a]=Zn(o),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return _.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&_.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
24
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[Ji]=this[Ji]={accessors:{}}).accessors,o=this.prototype;function s(i){const a=xn(i);r[a]||(wp(o,i),r[a]=!0)}return _.isArray(t)?t.forEach(s):s(t),this}}Ne.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),_.reduceDescriptors(Ne.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),_.freezeMethods(Ne);function Eo(e,t){const n=this||bn,r=t||n,o=Ne.from(r.headers);let s=r.data;return _.forEach(e,function(a){s=a.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Yi(e){return!!(e&&e.__CANCEL__)}function Wt(e,t,n){Q.call(this,e??"canceled",Q.ERR_CANCELED,t,n),this.name="CanceledError"}_.inherits(Wt,Q,{__CANCEL__:!0});function Zi(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Q("Request failed with status code "+n.status,[Q.ERR_BAD_REQUEST,Q.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function bp(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function xp(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,s=0,i;return t=t!==void 0?t:1e3,function(u){const c=Date.now(),f=r[s];i||(i=c),n[o]=u,r[o]=c;let g=s,m=0;for(;g!==o;)m+=n[g++],g=g%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),c-i<t)return;const p=f&&c-f;return p?Math.round(m*1e3/p):void 0}}function Cp(e,t){let n=0,r=1e3/t,o,s;const i=(c,f=Date.now())=>{n=f,o=null,s&&(clearTimeout(s),s=null),e.apply(null,c)};return[(...c)=>{const f=Date.now(),g=f-n;g>=r?i(c,f):(o=c,s||(s=setTimeout(()=>{s=null,i(o)},r-g)))},()=>o&&i(o)]}const Qn=(e,t,n=3)=>{let r=0;const o=xp(50,250);return Cp(s=>{const i=s.loaded,a=s.lengthComputable?s.total:void 0,u=i-r,c=o(u),f=i<=a;r=i;const g={loaded:i,total:a,progress:a?i/a:void 0,bytes:u,rate:c||void 0,estimated:c&&a&&f?(a-i)/c:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(g)},n)},Qi=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ea=e=>(...t)=>_.asap(()=>e(...t)),Sp=xe.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,xe.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(xe.origin),xe.navigator&&/(msie|trident)/i.test(xe.navigator.userAgent)):()=>!0,Ep=xe.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];_.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),_.isString(r)&&i.push("path="+r),_.isString(o)&&i.push("domain="+o),s===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Np(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Tp(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ta(e,t){return e&&!Np(t)?Tp(e,t):t}const na=e=>e instanceof Ne?{...e}:e;function $t(e,t){t=t||{};const n={};function r(c,f,g,m){return _.isPlainObject(c)&&_.isPlainObject(f)?_.merge.call({caseless:m},c,f):_.isPlainObject(f)?_.merge({},f):_.isArray(f)?f.slice():f}function o(c,f,g,m){if(_.isUndefined(f)){if(!_.isUndefined(c))return r(void 0,c,g,m)}else return r(c,f,g,m)}function s(c,f){if(!_.isUndefined(f))return r(void 0,f)}function i(c,f){if(_.isUndefined(f)){if(!_.isUndefined(c))return r(void 0,c)}else return r(void 0,f)}function a(c,f,g){if(g in t)return r(c,f);if(g in e)return r(void 0,c)}const u={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(c,f,g)=>o(na(c),na(f),g,!0)};return _.forEach(Object.keys(Object.assign({},e,t)),function(f){const g=u[f]||o,m=g(e[f],t[f],f);_.isUndefined(m)&&g!==a||(n[f]=m)}),n}const ra=e=>{const t=$t({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;t.headers=i=Ne.from(i),t.url=Gi(ta(t.baseURL,t.url),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let u;if(_.isFormData(n)){if(xe.hasStandardBrowserEnv||xe.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((u=i.getContentType())!==!1){const[c,...f]=u?u.split(";").map(g=>g.trim()).filter(Boolean):[];i.setContentType([c||"multipart/form-data",...f].join("; "))}}if(xe.hasStandardBrowserEnv&&(r&&_.isFunction(r)&&(r=r(t)),r||r!==!1&&Sp(t.url))){const c=o&&s&&Ep.read(s);c&&i.set(o,c)}return t},Pp=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const o=ra(e);let s=o.data;const i=Ne.from(o.headers).normalize();let{responseType:a,onUploadProgress:u,onDownloadProgress:c}=o,f,g,m,p,v;function h(){p&&p(),v&&v(),o.cancelToken&&o.cancelToken.unsubscribe(f),o.signal&&o.signal.removeEventListener("abort",f)}let y=new XMLHttpRequest;y.open(o.method.toUpperCase(),o.url,!0),y.timeout=o.timeout;function w(){if(!y)return;const E=Ne.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),C={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:E,config:e,request:y};Zi(function(S){n(S),h()},function(S){r(S),h()},C),y=null}"onloadend"in y?y.onloadend=w:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(w)},y.onabort=function(){y&&(r(new Q("Request aborted",Q.ECONNABORTED,e,y)),y=null)},y.onerror=function(){r(new Q("Network Error",Q.ERR_NETWORK,e,y)),y=null},y.ontimeout=function(){let T=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const C=o.transitional||Ki;o.timeoutErrorMessage&&(T=o.timeoutErrorMessage),r(new Q(T,C.clarifyTimeoutError?Q.ETIMEDOUT:Q.ECONNABORTED,e,y)),y=null},s===void 0&&i.setContentType(null),"setRequestHeader"in y&&_.forEach(i.toJSON(),function(T,C){y.setRequestHeader(C,T)}),_.isUndefined(o.withCredentials)||(y.withCredentials=!!o.withCredentials),a&&a!=="json"&&(y.responseType=o.responseType),c&&([m,v]=Qn(c,!0),y.addEventListener("progress",m)),u&&y.upload&&([g,p]=Qn(u),y.upload.addEventListener("progress",g),y.upload.addEventListener("loadend",p)),(o.cancelToken||o.signal)&&(f=E=>{y&&(r(!E||E.type?new Wt(null,e,y):E),y.abort(),y=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const x=bp(o.url);if(x&&xe.protocols.indexOf(x)===-1){r(new Q("Unsupported protocol "+x+":",Q.ERR_BAD_REQUEST,e));return}y.send(s||null)})},Ap=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const s=function(c){if(!o){o=!0,a();const f=c instanceof Error?c:this.reason;r.abort(f instanceof Q?f:new Wt(f instanceof Error?f.message:f))}};let i=t&&setTimeout(()=>{i=null,s(new Q(`timeout ${t} of ms exceeded`,Q.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),e=null)};e.forEach(c=>c.addEventListener("abort",s));const{signal:u}=r;return u.unsubscribe=()=>_.asap(a),u}},_p=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},Fp=async function*(e,t){for await(const n of Op(e))yield*_p(n,t)},Op=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()}},oa=(e,t,n,r)=>{const o=Fp(e,t);let s=0,i,a=u=>{i||(i=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:c,value:f}=await o.next();if(c){a(),u.close();return}let g=f.byteLength;if(n){let m=s+=g;n(m)}u.enqueue(new Uint8Array(f))}catch(c){throw a(c),c}},cancel(u){return a(u),o.return()}},{highWaterMark:2})},er=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",sa=er&&typeof ReadableStream=="function",Dp=er&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),ia=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Mp=sa&&ia(()=>{let e=!1;const t=new Request(xe.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),aa=64*1024,No=sa&&ia(()=>_.isReadableStream(new Response("").body)),tr={stream:No&&(e=>e.body)};er&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!tr[t]&&(tr[t]=_.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Q(`Response type '${t}' is not supported`,Q.ERR_NOT_SUPPORT,r)})})})(new Response);const $p=async e=>{if(e==null)return 0;if(_.isBlob(e))return e.size;if(_.isSpecCompliantForm(e))return(await new Request(xe.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(_.isArrayBufferView(e)||_.isArrayBuffer(e))return e.byteLength;if(_.isURLSearchParams(e)&&(e=e+""),_.isString(e))return(await Dp(e)).byteLength},kp=async(e,t)=>{const n=_.toFiniteNumber(e.getContentLength());return n??$p(t)},To={http:np,xhr:Pp,fetch:er&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:s,timeout:i,onDownloadProgress:a,onUploadProgress:u,responseType:c,headers:f,withCredentials:g="same-origin",fetchOptions:m}=ra(e);c=c?(c+"").toLowerCase():"text";let p=Ap([o,s&&s.toAbortSignal()],i),v;const h=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(u&&Mp&&n!=="get"&&n!=="head"&&(y=await kp(f,r))!==0){let C=new Request(t,{method:"POST",body:r,duplex:"half"}),N;if(_.isFormData(r)&&(N=C.headers.get("content-type"))&&f.setContentType(N),C.body){const[S,A]=Qi(y,Qn(ea(u)));r=oa(C.body,aa,S,A)}}_.isString(g)||(g=g?"include":"omit");const w="credentials"in Request.prototype;v=new Request(t,{...m,signal:p,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:w?g:void 0});let x=await fetch(v);const E=No&&(c==="stream"||c==="response");if(No&&(a||E&&h)){const C={};["status","statusText","headers"].forEach(B=>{C[B]=x[B]});const N=_.toFiniteNumber(x.headers.get("content-length")),[S,A]=a&&Qi(N,Qn(ea(a),!0))||[];x=new Response(oa(x.body,aa,S,()=>{A&&A(),h&&h()}),C)}c=c||"text";let T=await tr[_.findKey(tr,c)||"text"](x,e);return!E&&h&&h(),await new Promise((C,N)=>{Zi(C,N,{data:T,headers:Ne.from(x.headers),status:x.status,statusText:x.statusText,config:e,request:v})})}catch(w){throw h&&h(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new Q("Network Error",Q.ERR_NETWORK,e,v),{cause:w.cause||w}):Q.from(w,w&&w.code,e,v)}})};_.forEach(To,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const la=e=>`- ${e}`,Ip=e=>_.isFunction(e)||e===null||e===!1,ca={getAdapter:e=>{e=_.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let s=0;s<t;s++){n=e[s];let i;if(r=n,!Ip(n)&&(r=To[(i=String(n)).toLowerCase()],r===void 0))throw new Q(`Unknown adapter '${i}'`);if(r)break;o[i||"#"+s]=r}if(!r){const s=Object.entries(o).map(([a,u])=>`adapter ${a} `+(u===!1?"is not supported by the environment":"is not available in the build"));let i=t?s.length>1?`since :
22
+ */function Gn(e,t){return e?gf(e)?d.createElement(e,t):e:null}function gf(e){return hf(e)||typeof e=="function"||mf(e)}function hf(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function mf(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function _i(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=d.useState(()=>({current:cf(t)})),[r,o]=d.useState(()=>n.current.initialState);return n.current.setOptions(s=>({...s,...e,state:{...r,...e.state},onStateChange:i=>{o(i),e.onStateChange==null||e.onStateChange(i)}})),n.current}function Fi(e,t){return function(){return e.apply(t,arguments)}}const{toString:vf}=Object.prototype,{getPrototypeOf:mo}=Object,qn=(e=>t=>{const n=vf.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),je=e=>(e=e.toLowerCase(),t=>qn(t)===e),Kn=e=>t=>typeof t===e,{isArray:Gt}=Array,yn=Kn("undefined");function yf(e){return e!==null&&!yn(e)&&e.constructor!==null&&!yn(e.constructor)&&$e(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Oi=je("ArrayBuffer");function wf(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Oi(e.buffer),t}const bf=Kn("string"),$e=Kn("function"),Di=Kn("number"),Xn=e=>e!==null&&typeof e=="object",xf=e=>e===!0||e===!1,Jn=e=>{if(qn(e)!=="object")return!1;const t=mo(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Cf=je("Date"),Sf=je("File"),Ef=je("Blob"),Nf=je("FileList"),Tf=e=>Xn(e)&&$e(e.pipe),Pf=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||$e(e.append)&&((t=qn(e))==="formdata"||t==="object"&&$e(e.toString)&&e.toString()==="[object FormData]"))},Af=je("URLSearchParams"),[_f,Ff,Of,Df]=["ReadableStream","Request","Response","Headers"].map(je),Mf=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function wn(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),Gt(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length;let a;for(r=0;r<i;r++)a=s[r],t.call(null,e[a],a,e)}}function Mi(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,o;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const Rt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,$i=e=>!yn(e)&&e!==Rt;function vo(){const{caseless:e}=$i(this)&&this||{},t={},n=(r,o)=>{const s=e&&Mi(t,o)||o;Jn(t[s])&&Jn(r)?t[s]=vo(t[s],r):Jn(r)?t[s]=vo({},r):Gt(r)?t[s]=r.slice():t[s]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&wn(arguments[r],n);return t}const $f=(e,t,n,{allOwnKeys:r}={})=>(wn(t,(o,s)=>{n&&$e(o)?e[s]=Fi(o,n):e[s]=o},{allOwnKeys:r}),e),kf=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),If=(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)},Rf=(e,t,n,r)=>{let o,s,i;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],(!r||r(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&mo(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Lf=(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},Vf=e=>{if(!e)return null;if(Gt(e))return e;let t=e.length;if(!Di(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Bf=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&mo(Uint8Array)),zf=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=r.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},Hf=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Uf=je("HTMLFormElement"),jf=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),ki=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Wf=je("RegExp"),Ii=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};wn(n,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(r[s]=i||o)}),Object.defineProperties(e,r)},Gf=e=>{Ii(e,(t,n)=>{if($e(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if($e(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+"'")})}})},qf=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return Gt(e)?r(e):r(String(e).split(t)),n},Kf=()=>{},Xf=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,yo="abcdefghijklmnopqrstuvwxyz",Ri="0123456789",Li={DIGIT:Ri,ALPHA:yo,ALPHA_DIGIT:yo+yo.toUpperCase()+Ri},Jf=(e=16,t=Li.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function Yf(e){return!!(e&&$e(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Zf=e=>{const t=new Array(10),n=(r,o)=>{if(Xn(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const s=Gt(r)?[]:{};return wn(r,(i,a)=>{const u=n(i,o+1);!yn(u)&&(s[a]=u)}),t[o]=void 0,s}}return r};return n(e,0)},Qf=je("AsyncFunction"),ep=e=>e&&(Xn(e)||$e(e))&&$e(e.then)&&$e(e.catch),Vi=((e,t)=>e?setImmediate:t?((n,r)=>(Rt.addEventListener("message",({source:o,data:s})=>{o===Rt&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),Rt.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",$e(Rt.postMessage)),tp=typeof queueMicrotask<"u"?queueMicrotask.bind(Rt):typeof process<"u"&&process.nextTick||Vi,T={isArray:Gt,isArrayBuffer:Oi,isBuffer:yf,isFormData:Pf,isArrayBufferView:wf,isString:bf,isNumber:Di,isBoolean:xf,isObject:Xn,isPlainObject:Jn,isReadableStream:_f,isRequest:Ff,isResponse:Of,isHeaders:Df,isUndefined:yn,isDate:Cf,isFile:Sf,isBlob:Ef,isRegExp:Wf,isFunction:$e,isStream:Tf,isURLSearchParams:Af,isTypedArray:Bf,isFileList:Nf,forEach:wn,merge:vo,extend:$f,trim:Mf,stripBOM:kf,inherits:If,toFlatObject:Rf,kindOf:qn,kindOfTest:je,endsWith:Lf,toArray:Vf,forEachEntry:zf,matchAll:Hf,isHTMLForm:Uf,hasOwnProperty:ki,hasOwnProp:ki,reduceDescriptors:Ii,freezeMethods:Gf,toObjectSet:qf,toCamelCase:jf,noop:Kf,toFiniteNumber:Xf,findKey:Mi,global:Rt,isContextDefined:$i,ALPHABET:Li,generateString:Jf,isSpecCompliantForm:Yf,toJSONObject:Zf,isAsyncFn:Qf,isThenable:ep,setImmediate:Vi,asap:tp};function Q(e,t,n,r,o){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),o&&(this.response=o,this.status=o.status?o.status:null)}T.inherits(Q,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:T.toJSONObject(this.config),code:this.code,status:this.status}}});const Bi=Q.prototype,zi={};["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=>{zi[e]={value:e}}),Object.defineProperties(Q,zi),Object.defineProperty(Bi,"isAxiosError",{value:!0}),Q.from=(e,t,n,r,o,s)=>{const i=Object.create(Bi);return T.toFlatObject(e,i,function(u){return u!==Error.prototype},a=>a!=="isAxiosError"),Q.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const np=null;function wo(e){return T.isPlainObject(e)||T.isArray(e)}function Hi(e){return T.endsWith(e,"[]")?e.slice(0,-2):e}function Ui(e,t,n){return e?e.concat(t).map(function(o,s){return o=Hi(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function rp(e){return T.isArray(e)&&!e.some(wo)}const op=T.toFlatObject(T,{},null,function(t){return/^is[A-Z]/.test(t)});function Yn(e,t,n){if(!T.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=T.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,y){return!T.isUndefined(y[h])});const r=n.metaTokens,o=n.visitor||f,s=n.dots,i=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&T.isSpecCompliantForm(t);if(!T.isFunction(o))throw new TypeError("visitor must be a function");function c(v){if(v===null)return"";if(T.isDate(v))return v.toISOString();if(!u&&T.isBlob(v))throw new Q("Blob is not supported. Use a Buffer instead.");return T.isArrayBuffer(v)||T.isTypedArray(v)?u&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function f(v,h,y){let w=v;if(v&&!y&&typeof v=="object"){if(T.endsWith(h,"{}"))h=r?h:h.slice(0,-2),v=JSON.stringify(v);else if(T.isArray(v)&&rp(v)||(T.isFileList(v)||T.endsWith(h,"[]"))&&(w=T.toArray(v)))return h=Hi(h),w.forEach(function(S,E){!(T.isUndefined(S)||S===null)&&t.append(i===!0?Ui([h],E,s):i===null?h:h+"[]",c(S))}),!1}return wo(v)?!0:(t.append(Ui(y,h,s),c(v)),!1)}const g=[],m=Object.assign(op,{defaultVisitor:f,convertValue:c,isVisitable:wo});function p(v,h){if(!T.isUndefined(v)){if(g.indexOf(v)!==-1)throw Error("Circular reference detected in "+h.join("."));g.push(v),T.forEach(v,function(w,x){(!(T.isUndefined(w)||w===null)&&o.call(t,w,T.isString(x)?x.trim():x,h,m))===!0&&p(w,h?h.concat(x):[x])}),g.pop()}}if(!T.isObject(e))throw new TypeError("data must be an object");return p(e),t}function ji(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function bo(e,t){this._pairs=[],e&&Yn(e,this,t)}const Wi=bo.prototype;Wi.append=function(t,n){this._pairs.push([t,n])},Wi.toString=function(t){const n=t?function(r){return t.call(this,r,ji)}:ji;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function sp(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Gi(e,t,n){if(!t)return e;const r=n&&n.encode||sp;T.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(o?s=o(t,n):s=T.isURLSearchParams(t)?t.toString():new bo(t,n).toString(r),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class qi{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){T.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Ki={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ip={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:bo,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},xo=typeof window<"u"&&typeof document<"u",Co=typeof navigator=="object"&&navigator||void 0,ap=xo&&(!Co||["ReactNative","NativeScript","NS"].indexOf(Co.product)<0),lp=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",cp=xo&&window.location.href||"http://localhost",Se={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:xo,hasStandardBrowserEnv:ap,hasStandardBrowserWebWorkerEnv:lp,navigator:Co,origin:cp},Symbol.toStringTag,{value:"Module"})),...ip};function up(e,t){return Yn(e,new Se.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,s){return Se.isNode&&T.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function dp(e){return T.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function fp(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}function Xi(e){function t(n,r,o,s){let i=n[s++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),u=s>=n.length;return i=!i&&T.isArray(o)?o.length:i,u?(T.hasOwnProp(o,i)?o[i]=[o[i],r]:o[i]=r,!a):((!o[i]||!T.isObject(o[i]))&&(o[i]=[]),t(n,r,o[i],s)&&T.isArray(o[i])&&(o[i]=fp(o[i])),!a)}if(T.isFormData(e)&&T.isFunction(e.entries)){const n={};return T.forEachEntry(e,(r,o)=>{t(dp(r),o,n,0)}),n}return null}function pp(e,t,n){if(T.isString(e))try{return(t||JSON.parse)(e),T.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const bn={transitional:Ki,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=T.isObject(t);if(s&&T.isHTMLForm(t)&&(t=new FormData(t)),T.isFormData(t))return o?JSON.stringify(Xi(t)):t;if(T.isArrayBuffer(t)||T.isBuffer(t)||T.isStream(t)||T.isFile(t)||T.isBlob(t)||T.isReadableStream(t))return t;if(T.isArrayBufferView(t))return t.buffer;if(T.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return up(t,this.formSerializer).toString();if((a=T.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Yn(a?{"files[]":t}:t,u&&new u,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),pp(t)):t}],transformResponse:[function(t){const n=this.transitional||bn.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(T.isResponse(t)||T.isReadableStream(t))return t;if(t&&T.isString(t)&&(r&&!this.responseType||o)){const i=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(a){if(i)throw a.name==="SyntaxError"?Q.from(a,Q.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:Se.classes.FormData,Blob:Se.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};T.forEach(["delete","get","head","post","put","patch"],e=>{bn.headers[e]={}});const gp=T.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),hp=e=>{const t={};let n,r,o;return e&&e.split(`
23
+ `).forEach(function(i){o=i.indexOf(":"),n=i.substring(0,o).trim().toLowerCase(),r=i.substring(o+1).trim(),!(!n||t[n]&&gp[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Ji=Symbol("internals");function xn(e){return e&&String(e).trim().toLowerCase()}function Zn(e){return e===!1||e==null?e:T.isArray(e)?e.map(Zn):String(e)}function mp(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 vp=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function So(e,t,n,r,o){if(T.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!T.isString(t)){if(T.isString(r))return t.indexOf(r)!==-1;if(T.isRegExp(r))return r.test(t)}}function yp(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function wp(e,t){const n=T.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,s,i){return this[r].call(this,t,o,s,i)},configurable:!0})})}class Pe{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function s(a,u,c){const f=xn(u);if(!f)throw new Error("header name must be a non-empty string");const g=T.findKey(o,f);(!g||o[g]===void 0||c===!0||c===void 0&&o[g]!==!1)&&(o[g||u]=Zn(a))}const i=(a,u)=>T.forEach(a,(c,f)=>s(c,f,u));if(T.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(T.isString(t)&&(t=t.trim())&&!vp(t))i(hp(t),n);else if(T.isHeaders(t))for(const[a,u]of t.entries())s(u,a,r);else t!=null&&s(n,t,r);return this}get(t,n){if(t=xn(t),t){const r=T.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return mp(o);if(T.isFunction(n))return n.call(this,o,r);if(T.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=xn(t),t){const r=T.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||So(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function s(i){if(i=xn(i),i){const a=T.findKey(r,i);a&&(!n||So(r,r[a],a,n))&&(delete r[a],o=!0)}}return T.isArray(t)?t.forEach(s):s(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const s=n[r];(!t||So(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const n=this,r={};return T.forEach(this,(o,s)=>{const i=T.findKey(r,s);if(i){n[i]=Zn(o),delete n[s];return}const a=t?yp(s):String(s).trim();a!==s&&delete n[s],n[a]=Zn(o),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return T.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&T.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
24
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[Ji]=this[Ji]={accessors:{}}).accessors,o=this.prototype;function s(i){const a=xn(i);r[a]||(wp(o,i),r[a]=!0)}return T.isArray(t)?t.forEach(s):s(t),this}}Pe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),T.reduceDescriptors(Pe.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),T.freezeMethods(Pe);function Eo(e,t){const n=this||bn,r=t||n,o=Pe.from(r.headers);let s=r.data;return T.forEach(e,function(a){s=a.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Yi(e){return!!(e&&e.__CANCEL__)}function qt(e,t,n){Q.call(this,e??"canceled",Q.ERR_CANCELED,t,n),this.name="CanceledError"}T.inherits(qt,Q,{__CANCEL__:!0});function Zi(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Q("Request failed with status code "+n.status,[Q.ERR_BAD_REQUEST,Q.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function bp(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function xp(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,s=0,i;return t=t!==void 0?t:1e3,function(u){const c=Date.now(),f=r[s];i||(i=c),n[o]=u,r[o]=c;let g=s,m=0;for(;g!==o;)m+=n[g++],g=g%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),c-i<t)return;const p=f&&c-f;return p?Math.round(m*1e3/p):void 0}}function Cp(e,t){let n=0,r=1e3/t,o,s;const i=(c,f=Date.now())=>{n=f,o=null,s&&(clearTimeout(s),s=null),e.apply(null,c)};return[(...c)=>{const f=Date.now(),g=f-n;g>=r?i(c,f):(o=c,s||(s=setTimeout(()=>{s=null,i(o)},r-g)))},()=>o&&i(o)]}const Qn=(e,t,n=3)=>{let r=0;const o=xp(50,250);return Cp(s=>{const i=s.loaded,a=s.lengthComputable?s.total:void 0,u=i-r,c=o(u),f=i<=a;r=i;const g={loaded:i,total:a,progress:a?i/a:void 0,bytes:u,rate:c||void 0,estimated:c&&a&&f?(a-i)/c:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(g)},n)},Qi=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ea=e=>(...t)=>T.asap(()=>e(...t)),Sp=Se.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Se.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Se.origin),Se.navigator&&/(msie|trident)/i.test(Se.navigator.userAgent)):()=>!0,Ep=Se.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];T.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),T.isString(r)&&i.push("path="+r),T.isString(o)&&i.push("domain="+o),s===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Np(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Tp(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ta(e,t){return e&&!Np(t)?Tp(e,t):t}const na=e=>e instanceof Pe?{...e}:e;function Lt(e,t){t=t||{};const n={};function r(c,f,g,m){return T.isPlainObject(c)&&T.isPlainObject(f)?T.merge.call({caseless:m},c,f):T.isPlainObject(f)?T.merge({},f):T.isArray(f)?f.slice():f}function o(c,f,g,m){if(T.isUndefined(f)){if(!T.isUndefined(c))return r(void 0,c,g,m)}else return r(c,f,g,m)}function s(c,f){if(!T.isUndefined(f))return r(void 0,f)}function i(c,f){if(T.isUndefined(f)){if(!T.isUndefined(c))return r(void 0,c)}else return r(void 0,f)}function a(c,f,g){if(g in t)return r(c,f);if(g in e)return r(void 0,c)}const u={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(c,f,g)=>o(na(c),na(f),g,!0)};return T.forEach(Object.keys(Object.assign({},e,t)),function(f){const g=u[f]||o,m=g(e[f],t[f],f);T.isUndefined(m)&&g!==a||(n[f]=m)}),n}const ra=e=>{const t=Lt({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;t.headers=i=Pe.from(i),t.url=Gi(ta(t.baseURL,t.url),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let u;if(T.isFormData(n)){if(Se.hasStandardBrowserEnv||Se.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((u=i.getContentType())!==!1){const[c,...f]=u?u.split(";").map(g=>g.trim()).filter(Boolean):[];i.setContentType([c||"multipart/form-data",...f].join("; "))}}if(Se.hasStandardBrowserEnv&&(r&&T.isFunction(r)&&(r=r(t)),r||r!==!1&&Sp(t.url))){const c=o&&s&&Ep.read(s);c&&i.set(o,c)}return t},Pp=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const o=ra(e);let s=o.data;const i=Pe.from(o.headers).normalize();let{responseType:a,onUploadProgress:u,onDownloadProgress:c}=o,f,g,m,p,v;function h(){p&&p(),v&&v(),o.cancelToken&&o.cancelToken.unsubscribe(f),o.signal&&o.signal.removeEventListener("abort",f)}let y=new XMLHttpRequest;y.open(o.method.toUpperCase(),o.url,!0),y.timeout=o.timeout;function w(){if(!y)return;const S=Pe.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),C={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:S,config:e,request:y};Zi(function(_){n(_),h()},function(_){r(_),h()},C),y=null}"onloadend"in y?y.onloadend=w:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(w)},y.onabort=function(){y&&(r(new Q("Request aborted",Q.ECONNABORTED,e,y)),y=null)},y.onerror=function(){r(new Q("Network Error",Q.ERR_NETWORK,e,y)),y=null},y.ontimeout=function(){let E=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const C=o.transitional||Ki;o.timeoutErrorMessage&&(E=o.timeoutErrorMessage),r(new Q(E,C.clarifyTimeoutError?Q.ETIMEDOUT:Q.ECONNABORTED,e,y)),y=null},s===void 0&&i.setContentType(null),"setRequestHeader"in y&&T.forEach(i.toJSON(),function(E,C){y.setRequestHeader(C,E)}),T.isUndefined(o.withCredentials)||(y.withCredentials=!!o.withCredentials),a&&a!=="json"&&(y.responseType=o.responseType),c&&([m,v]=Qn(c,!0),y.addEventListener("progress",m)),u&&y.upload&&([g,p]=Qn(u),y.upload.addEventListener("progress",g),y.upload.addEventListener("loadend",p)),(o.cancelToken||o.signal)&&(f=S=>{y&&(r(!S||S.type?new qt(null,e,y):S),y.abort(),y=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const x=bp(o.url);if(x&&Se.protocols.indexOf(x)===-1){r(new Q("Unsupported protocol "+x+":",Q.ERR_BAD_REQUEST,e));return}y.send(s||null)})},Ap=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const s=function(c){if(!o){o=!0,a();const f=c instanceof Error?c:this.reason;r.abort(f instanceof Q?f:new qt(f instanceof Error?f.message:f))}};let i=t&&setTimeout(()=>{i=null,s(new Q(`timeout ${t} of ms exceeded`,Q.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),e=null)};e.forEach(c=>c.addEventListener("abort",s));const{signal:u}=r;return u.unsubscribe=()=>T.asap(a),u}},_p=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},Fp=async function*(e,t){for await(const n of Op(e))yield*_p(n,t)},Op=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()}},oa=(e,t,n,r)=>{const o=Fp(e,t);let s=0,i,a=u=>{i||(i=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:c,value:f}=await o.next();if(c){a(),u.close();return}let g=f.byteLength;if(n){let m=s+=g;n(m)}u.enqueue(new Uint8Array(f))}catch(c){throw a(c),c}},cancel(u){return a(u),o.return()}},{highWaterMark:2})},er=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",sa=er&&typeof ReadableStream=="function",Dp=er&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),ia=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Mp=sa&&ia(()=>{let e=!1;const t=new Request(Se.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),aa=64*1024,No=sa&&ia(()=>T.isReadableStream(new Response("").body)),tr={stream:No&&(e=>e.body)};er&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!tr[t]&&(tr[t]=T.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Q(`Response type '${t}' is not supported`,Q.ERR_NOT_SUPPORT,r)})})})(new Response);const $p=async e=>{if(e==null)return 0;if(T.isBlob(e))return e.size;if(T.isSpecCompliantForm(e))return(await new Request(Se.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(T.isArrayBufferView(e)||T.isArrayBuffer(e))return e.byteLength;if(T.isURLSearchParams(e)&&(e=e+""),T.isString(e))return(await Dp(e)).byteLength},kp=async(e,t)=>{const n=T.toFiniteNumber(e.getContentLength());return n??$p(t)},To={http:np,xhr:Pp,fetch:er&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:s,timeout:i,onDownloadProgress:a,onUploadProgress:u,responseType:c,headers:f,withCredentials:g="same-origin",fetchOptions:m}=ra(e);c=c?(c+"").toLowerCase():"text";let p=Ap([o,s&&s.toAbortSignal()],i),v;const h=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(u&&Mp&&n!=="get"&&n!=="head"&&(y=await kp(f,r))!==0){let C=new Request(t,{method:"POST",body:r,duplex:"half"}),P;if(T.isFormData(r)&&(P=C.headers.get("content-type"))&&f.setContentType(P),C.body){const[_,O]=Qi(y,Qn(ea(u)));r=oa(C.body,aa,_,O)}}T.isString(g)||(g=g?"include":"omit");const w="credentials"in Request.prototype;v=new Request(t,{...m,signal:p,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:w?g:void 0});let x=await fetch(v);const S=No&&(c==="stream"||c==="response");if(No&&(a||S&&h)){const C={};["status","statusText","headers"].forEach($=>{C[$]=x[$]});const P=T.toFiniteNumber(x.headers.get("content-length")),[_,O]=a&&Qi(P,Qn(ea(a),!0))||[];x=new Response(oa(x.body,aa,_,()=>{O&&O(),h&&h()}),C)}c=c||"text";let E=await tr[T.findKey(tr,c)||"text"](x,e);return!S&&h&&h(),await new Promise((C,P)=>{Zi(C,P,{data:E,headers:Pe.from(x.headers),status:x.status,statusText:x.statusText,config:e,request:v})})}catch(w){throw h&&h(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new Q("Network Error",Q.ERR_NETWORK,e,v),{cause:w.cause||w}):Q.from(w,w&&w.code,e,v)}})};T.forEach(To,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const la=e=>`- ${e}`,Ip=e=>T.isFunction(e)||e===null||e===!1,ca={getAdapter:e=>{e=T.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let s=0;s<t;s++){n=e[s];let i;if(r=n,!Ip(n)&&(r=To[(i=String(n)).toLowerCase()],r===void 0))throw new Q(`Unknown adapter '${i}'`);if(r)break;o[i||"#"+s]=r}if(!r){const s=Object.entries(o).map(([a,u])=>`adapter ${a} `+(u===!1?"is not supported by the environment":"is not available in the build"));let i=t?s.length>1?`since :
25
25
  `+s.map(la).join(`
26
- `):" "+la(s[0]):"as no adapter specified";throw new Q("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:To};function Po(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Wt(null,e)}function ua(e){return Po(e),e.headers=Ne.from(e.headers),e.data=Eo.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ca.getAdapter(e.adapter||bn.adapter)(e).then(function(r){return Po(e),r.data=Eo.call(e,e.transformResponse,r),r.headers=Ne.from(r.headers),r},function(r){return Yi(r)||(Po(e),r&&r.response&&(r.response.data=Eo.call(e,e.transformResponse,r.response),r.response.headers=Ne.from(r.response.headers))),Promise.reject(r)})}const da="1.7.9",nr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{nr[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const fa={};nr.transitional=function(t,n,r){function o(s,i){return"[Axios v"+da+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,a)=>{if(t===!1)throw new Q(o(i," has been removed"+(n?" in "+n:"")),Q.ERR_DEPRECATED);return n&&!fa[i]&&(fa[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,i,a):!0}},nr.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Rp(e,t,n){if(typeof e!="object")throw new Q("options must be an object",Q.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const a=e[s],u=a===void 0||i(a,s,e);if(u!==!0)throw new Q("option "+s+" must be "+u,Q.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Q("Unknown option "+s,Q.ERR_BAD_OPTION)}}const rr={assertOptions:Rp,validators:nr},qe=rr.validators;class kt{constructor(t){this.defaults=t,this.interceptors={request:new qi,response:new qi}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
27
- `+s):r.stack=s}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=$t(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&rr.assertOptions(r,{silentJSONParsing:qe.transitional(qe.boolean),forcedJSONParsing:qe.transitional(qe.boolean),clarifyTimeoutError:qe.transitional(qe.boolean)},!1),o!=null&&(_.isFunction(o)?n.paramsSerializer={serialize:o}:rr.assertOptions(o,{encode:qe.function,serialize:qe.function},!0)),rr.assertOptions(n,{baseUrl:qe.spelling("baseURL"),withXsrfToken:qe.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=s&&_.merge(s.common,s[n.method]);s&&_.forEach(["delete","get","head","post","put","patch","common"],v=>{delete s[v]}),n.headers=Ne.concat(i,s);const a=[];let u=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(u=u&&h.synchronous,a.unshift(h.fulfilled,h.rejected))});const c=[];this.interceptors.response.forEach(function(h){c.push(h.fulfilled,h.rejected)});let f,g=0,m;if(!u){const v=[ua.bind(this),void 0];for(v.unshift.apply(v,a),v.push.apply(v,c),m=v.length,f=Promise.resolve(n);g<m;)f=f.then(v[g++],v[g++]);return f}m=a.length;let p=n;for(g=0;g<m;){const v=a[g++],h=a[g++];try{p=v(p)}catch(y){h.call(this,y);break}}try{f=ua.call(this,p)}catch(v){return Promise.reject(v)}for(g=0,m=c.length;g<m;)f=f.then(c[g++],c[g++]);return f}getUri(t){t=$t(this.defaults,t);const n=ta(t.baseURL,t.url);return Gi(n,t.params,t.paramsSerializer)}}_.forEach(["delete","get","head","options"],function(t){kt.prototype[t]=function(n,r){return this.request($t(r||{},{method:t,url:n,data:(r||{}).data}))}}),_.forEach(["post","put","patch"],function(t){function n(r){return function(s,i,a){return this.request($t(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}kt.prototype[t]=n(),kt.prototype[t+"Form"]=n(!0)});class Ao{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(a=>{r.subscribe(a),s=a}).then(o);return i.cancel=function(){r.unsubscribe(s)},i},t(function(s,i,a){r.reason||(r.reason=new Wt(s,i,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ao(function(o){t=o}),cancel:t}}}function Lp(e){return function(n){return e.apply(null,n)}}function Vp(e){return _.isObject(e)&&e.isAxiosError===!0}const _o={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(_o).forEach(([e,t])=>{_o[t]=e});function pa(e){const t=new kt(e),n=Fi(kt.prototype.request,t);return _.extend(n,kt.prototype,t,{allOwnKeys:!0}),_.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return pa($t(e,o))},n}const oe=pa(bn);oe.Axios=kt,oe.CanceledError=Wt,oe.CancelToken=Ao,oe.isCancel=Yi,oe.VERSION=da,oe.toFormData=Yn,oe.AxiosError=Q,oe.Cancel=oe.CanceledError,oe.all=function(t){return Promise.all(t)},oe.spread=Lp,oe.isAxiosError=Vp,oe.mergeConfig=$t,oe.AxiosHeaders=Ne,oe.formToJSON=e=>Xi(_.isHTMLForm(e)?new FormData(e):e),oe.getAdapter=ca.getAdapter,oe.HttpStatusCode=_o,oe.default=oe;/**
26
+ `):" "+la(s[0]):"as no adapter specified";throw new Q("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:To};function Po(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new qt(null,e)}function ua(e){return Po(e),e.headers=Pe.from(e.headers),e.data=Eo.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ca.getAdapter(e.adapter||bn.adapter)(e).then(function(r){return Po(e),r.data=Eo.call(e,e.transformResponse,r),r.headers=Pe.from(r.headers),r},function(r){return Yi(r)||(Po(e),r&&r.response&&(r.response.data=Eo.call(e,e.transformResponse,r.response),r.response.headers=Pe.from(r.response.headers))),Promise.reject(r)})}const da="1.7.9",nr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{nr[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const fa={};nr.transitional=function(t,n,r){function o(s,i){return"[Axios v"+da+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,a)=>{if(t===!1)throw new Q(o(i," has been removed"+(n?" in "+n:"")),Q.ERR_DEPRECATED);return n&&!fa[i]&&(fa[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,i,a):!0}},nr.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Rp(e,t,n){if(typeof e!="object")throw new Q("options must be an object",Q.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const a=e[s],u=a===void 0||i(a,s,e);if(u!==!0)throw new Q("option "+s+" must be "+u,Q.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Q("Unknown option "+s,Q.ERR_BAD_OPTION)}}const rr={assertOptions:Rp,validators:nr},Ze=rr.validators;class Vt{constructor(t){this.defaults=t,this.interceptors={request:new qi,response:new qi}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
27
+ `+s):r.stack=s}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Lt(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&rr.assertOptions(r,{silentJSONParsing:Ze.transitional(Ze.boolean),forcedJSONParsing:Ze.transitional(Ze.boolean),clarifyTimeoutError:Ze.transitional(Ze.boolean)},!1),o!=null&&(T.isFunction(o)?n.paramsSerializer={serialize:o}:rr.assertOptions(o,{encode:Ze.function,serialize:Ze.function},!0)),rr.assertOptions(n,{baseUrl:Ze.spelling("baseURL"),withXsrfToken:Ze.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=s&&T.merge(s.common,s[n.method]);s&&T.forEach(["delete","get","head","post","put","patch","common"],v=>{delete s[v]}),n.headers=Pe.concat(i,s);const a=[];let u=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(u=u&&h.synchronous,a.unshift(h.fulfilled,h.rejected))});const c=[];this.interceptors.response.forEach(function(h){c.push(h.fulfilled,h.rejected)});let f,g=0,m;if(!u){const v=[ua.bind(this),void 0];for(v.unshift.apply(v,a),v.push.apply(v,c),m=v.length,f=Promise.resolve(n);g<m;)f=f.then(v[g++],v[g++]);return f}m=a.length;let p=n;for(g=0;g<m;){const v=a[g++],h=a[g++];try{p=v(p)}catch(y){h.call(this,y);break}}try{f=ua.call(this,p)}catch(v){return Promise.reject(v)}for(g=0,m=c.length;g<m;)f=f.then(c[g++],c[g++]);return f}getUri(t){t=Lt(this.defaults,t);const n=ta(t.baseURL,t.url);return Gi(n,t.params,t.paramsSerializer)}}T.forEach(["delete","get","head","options"],function(t){Vt.prototype[t]=function(n,r){return this.request(Lt(r||{},{method:t,url:n,data:(r||{}).data}))}}),T.forEach(["post","put","patch"],function(t){function n(r){return function(s,i,a){return this.request(Lt(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}Vt.prototype[t]=n(),Vt.prototype[t+"Form"]=n(!0)});class Ao{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(a=>{r.subscribe(a),s=a}).then(o);return i.cancel=function(){r.unsubscribe(s)},i},t(function(s,i,a){r.reason||(r.reason=new qt(s,i,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ao(function(o){t=o}),cancel:t}}}function Lp(e){return function(n){return e.apply(null,n)}}function Vp(e){return T.isObject(e)&&e.isAxiosError===!0}const _o={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(_o).forEach(([e,t])=>{_o[t]=e});function pa(e){const t=new Vt(e),n=Fi(Vt.prototype.request,t);return T.extend(n,Vt.prototype,t,{allOwnKeys:!0}),T.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return pa(Lt(e,o))},n}const oe=pa(bn);oe.Axios=Vt,oe.CanceledError=qt,oe.CancelToken=Ao,oe.isCancel=Yi,oe.VERSION=da,oe.toFormData=Yn,oe.AxiosError=Q,oe.Cancel=oe.CanceledError,oe.all=function(t){return Promise.all(t)},oe.spread=Lp,oe.isAxiosError=Vp,oe.mergeConfig=Lt,oe.AxiosHeaders=Pe,oe.formToJSON=e=>Xi(T.isHTMLForm(e)?new FormData(e):e),oe.getAdapter=ca.getAdapter,oe.HttpStatusCode=_o,oe.default=oe;/**
28
28
  * @license lucide-react v0.468.0 - ISC
29
29
  *
30
30
  * This source code is licensed under the ISC license.
@@ -34,62 +34,67 @@
34
34
  *
35
35
  * This source code is licensed under the ISC license.
36
36
  * See the LICENSE file in the root directory of this source tree.
37
- */var Hp={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
37
+ */var zp={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
38
38
  * @license lucide-react v0.468.0 - ISC
39
39
  *
40
40
  * This source code is licensed under the ISC license.
41
41
  * See the LICENSE file in the root directory of this source tree.
42
- */const zp=O.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},u)=>O.createElement("svg",{ref:u,...Hp,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ga("lucide",o),...a},[...i.map(([c,f])=>O.createElement(c,f)),...Array.isArray(s)?s:[s]]));/**
42
+ */const Hp=D.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},u)=>D.createElement("svg",{ref:u,...zp,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ga("lucide",o),...a},[...i.map(([c,f])=>D.createElement(c,f)),...Array.isArray(s)?s:[s]]));/**
43
43
  * @license lucide-react v0.468.0 - ISC
44
44
  *
45
45
  * This source code is licensed under the ISC license.
46
46
  * See the LICENSE file in the root directory of this source tree.
47
- */const wt=(e,t)=>{const n=O.forwardRef(({className:r,...o},s)=>O.createElement(zp,{ref:s,iconNode:t,className:ga(`lucide-${Bp(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
47
+ */const lt=(e,t)=>{const n=D.forwardRef(({className:r,...o},s)=>D.createElement(Hp,{ref:s,iconNode:t,className:ga(`lucide-${Bp(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
48
48
  * @license lucide-react v0.468.0 - ISC
49
49
  *
50
50
  * This source code is licensed under the ISC license.
51
51
  * See the LICENSE file in the root directory of this source tree.
52
- */const Up=wt("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/**
52
+ */const Up=lt("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/**
53
53
  * @license lucide-react v0.468.0 - ISC
54
54
  *
55
55
  * This source code is licensed under the ISC license.
56
56
  * See the LICENSE file in the root directory of this source tree.
57
- */const jp=wt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
57
+ */const jp=lt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
58
58
  * @license lucide-react v0.468.0 - ISC
59
59
  *
60
60
  * This source code is licensed under the ISC license.
61
61
  * See the LICENSE file in the root directory of this source tree.
62
- */const Wp=wt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
62
+ */const Wp=lt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
63
63
  * @license lucide-react v0.468.0 - ISC
64
64
  *
65
65
  * This source code is licensed under the ISC license.
66
66
  * See the LICENSE file in the root directory of this source tree.
67
- */const ha=wt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
67
+ */const ha=lt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
68
68
  * @license lucide-react v0.468.0 - ISC
69
69
  *
70
70
  * This source code is licensed under the ISC license.
71
71
  * See the LICENSE file in the root directory of this source tree.
72
- */const Gp=wt("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
72
+ */const Gp=lt("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
73
73
  * @license lucide-react v0.468.0 - ISC
74
74
  *
75
75
  * This source code is licensed under the ISC license.
76
76
  * See the LICENSE file in the root directory of this source tree.
77
- */const we=wt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
77
+ */const qp=lt("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
78
78
  * @license lucide-react v0.468.0 - ISC
79
79
  *
80
80
  * This source code is licensed under the ISC license.
81
81
  * See the LICENSE file in the root directory of this source tree.
82
- */const qp=wt("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
82
+ */const be=lt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
83
83
  * @license lucide-react v0.468.0 - ISC
84
84
  *
85
85
  * This source code is licensed under the ISC license.
86
86
  * See the LICENSE file in the root directory of this source tree.
87
- */const ma=wt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function va(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Kp(...e){return t=>{let n=!1;const r=e.map(o=>{const s=va(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():va(e[o],null)}}}}var Gt=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Xp);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(Fo,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Fo,{...r,ref:t,children:n})});Gt.displayName="Slot";var Fo=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Yp(n);return d.cloneElement(n,{...Jp(r,n.props),ref:t?Kp(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Fo.displayName="SlotClone";var ya=({children:e})=>l.jsx(l.Fragment,{children:e});function Xp(e){return d.isValidElement(e)&&e.type===ya}function Jp(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Yp(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function wa(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=wa(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ba(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=wa(e))&&(r&&(r+=" "),r+=t);return r}const Oo="-",Zp=e=>{const t=eg(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(Oo);return a[0]===""&&a.length!==1&&a.shift(),xa(a,t)||Qp(i)},getConflictingClassGroupIds:(i,a)=>{const u=n[i]||[];return a&&r[i]?[...u,...r[i]]:u}}},xa=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?xa(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Oo);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},Ca=/^\[(.+)\]$/,Qp=e=>{if(Ca.test(e)){const t=Ca.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},eg=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return ng(Object.entries(e.classGroups),n).forEach(([s,i])=>{Do(i,r,s,t)}),r},Do=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Sa(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(tg(o)){Do(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{Do(i,Sa(t,s),n,r)})})},Sa=(e,t)=>{let n=e;return t.split(Oo).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},tg=e=>e.isThemeGetter,ng=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e,rg=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},Ea="!",og=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const u=[];let c=0,f=0,g;for(let y=0;y<a.length;y++){let w=a[y];if(c===0){if(w===o&&(r||a.slice(y,y+s)===t)){u.push(a.slice(f,y)),f=y+s;continue}if(w==="/"){g=y;continue}}w==="["?c++:w==="]"&&c--}const m=u.length===0?a:a.substring(f),p=m.startsWith(Ea),v=p?m.substring(1):m,h=g&&g>f?g-f:void 0;return{modifiers:u,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:h}};return n?a=>n({className:a,parseClassName:i}):i},sg=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},ig=e=>({cache:rg(e.cacheSize),parseClassName:og(e),...Zp(e)}),ag=/\s+/,lg=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(ag);let a="";for(let u=i.length-1;u>=0;u-=1){const c=i[u],{modifiers:f,hasImportantModifier:g,baseClassName:m,maybePostfixModifierPosition:p}=n(c);let v=!!p,h=r(v?m.substring(0,p):m);if(!h){if(!v){a=c+(a.length>0?" "+a:a);continue}if(h=r(m),!h){a=c+(a.length>0?" "+a:a);continue}v=!1}const y=sg(f).join(":"),w=g?y+Ea:y,x=w+h;if(s.includes(x))continue;s.push(x);const E=o(h,v);for(let T=0;T<E.length;++T){const C=E[T];s.push(w+C)}a=c+(a.length>0?" "+a:a)}return a};function cg(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Na(t))&&(r&&(r+=" "),r+=n);return r}const Na=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Na(e[r]))&&(n&&(n+=" "),n+=t);return n};function ug(e,...t){let n,r,o,s=i;function i(u){const c=t.reduce((f,g)=>g(f),e());return n=ig(c),r=n.cache.get,o=n.cache.set,s=a,a(u)}function a(u){const c=r(u);if(c)return c;const f=lg(u,n);return o(u,f),f}return function(){return s(cg.apply(null,arguments))}}const ue=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ta=/^\[(?:([a-z-]+):)?(.+)\]$/i,dg=/^\d+\/\d+$/,fg=new Set(["px","full","screen"]),pg=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gg=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,hg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,mg=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,st=e=>qt(e)||fg.has(e)||dg.test(e),bt=e=>Kt(e,"length",Ng),qt=e=>!!e&&!Number.isNaN(Number(e)),Mo=e=>Kt(e,"number",qt),Cn=e=>!!e&&Number.isInteger(Number(e)),yg=e=>e.endsWith("%")&&qt(e.slice(0,-1)),ee=e=>Ta.test(e),xt=e=>pg.test(e),wg=new Set(["length","size","percentage"]),bg=e=>Kt(e,wg,Pa),xg=e=>Kt(e,"position",Pa),Cg=new Set(["image","url"]),Sg=e=>Kt(e,Cg,Pg),Eg=e=>Kt(e,"",Tg),Sn=()=>!0,Kt=(e,t,n)=>{const r=Ta.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Ng=e=>gg.test(e)&&!hg.test(e),Pa=()=>!1,Tg=e=>mg.test(e),Pg=e=>vg.test(e),Ag=ug(()=>{const e=ue("colors"),t=ue("spacing"),n=ue("blur"),r=ue("brightness"),o=ue("borderColor"),s=ue("borderRadius"),i=ue("borderSpacing"),a=ue("borderWidth"),u=ue("contrast"),c=ue("grayscale"),f=ue("hueRotate"),g=ue("invert"),m=ue("gap"),p=ue("gradientColorStops"),v=ue("gradientColorStopPositions"),h=ue("inset"),y=ue("margin"),w=ue("opacity"),x=ue("padding"),E=ue("saturate"),T=ue("scale"),C=ue("sepia"),N=ue("skew"),S=ue("space"),A=ue("translate"),B=()=>["auto","contain","none"],H=()=>["auto","hidden","clip","visible","scroll"],K=()=>["auto",ee,t],$=()=>[ee,t],R=()=>["",st,bt],D=()=>["auto",qt,ee],G=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],j=()=>["solid","dashed","dotted","double","none"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],q=()=>["start","end","center","between","around","evenly","stretch"],ne=()=>["","0",ee],ae=()=>["auto","avoid","all","avoid-page","page","left","right","column"],se=()=>[qt,ee];return{cacheSize:500,separator:":",theme:{colors:[Sn],spacing:[st,bt],blur:["none","",xt,ee],brightness:se(),borderColor:[e],borderRadius:["none","","full",xt,ee],borderSpacing:$(),borderWidth:R(),contrast:se(),grayscale:ne(),hueRotate:se(),invert:ne(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[yg,bt],inset:K(),margin:K(),opacity:se(),padding:$(),saturate:se(),scale:se(),sepia:ne(),skew:se(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",ee]}],container:["container"],columns:[{columns:[xt]}],"break-after":[{"break-after":ae()}],"break-before":[{"break-before":ae()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...G(),ee]}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Cn,ee]}],basis:[{basis:K()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ee]}],grow:[{grow:ne()}],shrink:[{shrink:ne()}],order:[{order:["first","last","none",Cn,ee]}],"grid-cols":[{"grid-cols":[Sn]}],"col-start-end":[{col:["auto",{span:["full",Cn,ee]},ee]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[Sn]}],"row-start-end":[{row:["auto",{span:[Cn,ee]},ee]}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ee]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ee]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ee,t]}],"min-w":[{"min-w":[ee,t,"min","max","fit"]}],"max-w":[{"max-w":[ee,t,"none","full","min","max","fit","prose",{screen:[xt]},xt]}],h:[{h:[ee,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ee,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ee,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ee,t,"auto","min","max","fit"]}],"font-size":[{text:["base",xt,bt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Mo]}],"font-family":[{font:[Sn]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ee]}],"line-clamp":[{"line-clamp":["none",qt,Mo]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",st,ee]}],"list-image":[{"list-image":["none",ee]}],"list-style-type":[{list:["none","disc","decimal",ee]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...j(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",st,bt]}],"underline-offset":[{"underline-offset":["auto",st,ee]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ee]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...G(),xg]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",bg]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Sg]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...j(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:j()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...j()]}],"outline-offset":[{"outline-offset":[st,ee]}],"outline-w":[{outline:[st,bt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:R()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[st,bt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",xt,Eg]}],"shadow-color":[{shadow:[Sn]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...X(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":X()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",xt,ee]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[g]}],saturate:[{saturate:[E]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[E]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ee]}],duration:[{duration:se()}],ease:[{ease:["linear","in","out","in-out",ee]}],delay:[{delay:se()}],animate:[{animate:["none","spin","ping","pulse","bounce",ee]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[Cn,ee]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ee]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ee]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ee]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[st,bt,Mo]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});function Z(...e){return Ag(ba(e))}const _g=e=>{if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB","TB"],r=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,r)).toFixed(2))} ${n[r]}`},Aa=d.forwardRef(({className:e,...t},n)=>l.jsx("nav",{ref:n,"aria-label":"breadcrumb",className:Z("s3-explr-ui-breadcrumb",e),...t}));Aa.displayName="Breadcrumb";const _a=d.forwardRef(({className:e,...t},n)=>l.jsx("ol",{ref:n,className:Z("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5","s3-explr-ui-breadcrumb-list",e),...t}));_a.displayName="BreadcrumbList";const $o=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:Z("inline-flex items-center gap-1.5","s3-explr-ui-breadcrumb-item",e),...t}));$o.displayName="BreadcrumbItem";const ko=d.forwardRef(({asChild:e,className:t,...n},r)=>{const o=e?Gt:"a";return l.jsx(o,{ref:r,className:Z("transition-colors hover:text-foreground","s3-explr-ui-breadcrumb-link",t),...n})});ko.displayName="BreadcrumbLink";const Fg=d.forwardRef(({className:e,...t},n)=>l.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Z("font-normal text-foreground","s3-explr-ui-breadcrumb-page",e),...t}));Fg.displayName="BreadcrumbPage";const Fa=({children:e,className:t,...n})=>l.jsx("li",{role:"presentation","aria-hidden":"true",className:Z("[&>svg]:w-3.5 [&>svg]:h-3.5","s3-explr-ui-breadcrumb-separator",t),...n,children:e??l.jsx(ha,{})});Fa.displayName="BreadcrumbSeparator";const Oa=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Da=ba,Io=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Da(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(c=>{const f=n==null?void 0:n[c],g=s==null?void 0:s[c];if(f===null)return null;const m=Oa(f)||Oa(g);return o[c][m]}),a=n&&Object.entries(n).reduce((c,f)=>{let[g,m]=f;return m===void 0||(c[g]=m),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:g,className:m,...p}=f;return Object.entries(p).every(v=>{let[h,y]=v;return Array.isArray(y)?y.includes({...s,...a}[h]):{...s,...a}[h]===y})?[...c,g,m]:c},[]);return Da(e,i,u,n==null?void 0:n.class,n==null?void 0:n.className)},Ma=Io("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 s3-explr-ui-button",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90 s3-explr-ui-button-default",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90 s3-explr-ui-button-destructive",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground s3-explr-ui-button-outline",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80 s3-explr-ui-button-secondary",ghost:"hover:bg-accent hover:text-accent-foreground s3-explr-ui-button-ghost",link:"text-primary underline-offset-4 hover:underline s3-explr-ui-button-link"},size:{default:"h-9 px-4 py-2 s3-explr-ui-button-size-default",sm:"h-8 rounded-md px-3 text-xs s3-explr-ui-button-size-sm",lg:"h-10 rounded-md px-8 s3-explr-ui-button-size-lg",icon:"h-9 w-9 s3-explr-ui-button-size-icon"}},defaultVariants:{variant:"default",size:"default"}}),le=d.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?Gt:"button";return l.jsx(i,{className:Z(Ma({variant:t,size:n,className:e})),ref:s,...o})});le.displayName="Button";function Og(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function or(...e){return t=>e.forEach(n=>Og(n,t))}function ke(...e){return d.useCallback(or(...e),e)}function Dg(e,t){const n=d.createContext(t),r=s=>{const{children:i,...a}=s,u=d.useMemo(()=>a,Object.values(a));return l.jsx(n.Provider,{value:u,children:i})};r.displayName=e+"Provider";function o(s){const i=d.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Ct(e,t=[]){let n=[];function r(s,i){const a=d.createContext(i),u=n.length;n=[...n,i];const c=g=>{var w;const{scope:m,children:p,...v}=g,h=((w=m==null?void 0:m[e])==null?void 0:w[u])||a,y=d.useMemo(()=>v,Object.values(v));return l.jsx(h.Provider,{value:y,children:p})};c.displayName=s+"Provider";function f(g,m){var h;const p=((h=m==null?void 0:m[e])==null?void 0:h[u])||a,v=d.useContext(p);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${g}\` must be used within \`${s}\``)}return[c,f]}const o=()=>{const s=n.map(i=>d.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return d.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return o.scopeName=e,[r,Mg(o,...t)]}function Mg(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:u,scopeName:c})=>{const g=u(s)[`__scope${c}`];return{...a,...g}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function me(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Se(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Xt({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=$g({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=Se(n),u=d.useCallback(c=>{if(s){const g=typeof c=="function"?c(e):c;g!==e&&a(g)}else o(c)},[s,e,o,a]);return[i,u]}function $g({defaultProp:e,onChange:t}){const n=d.useState(e),[r]=n,o=d.useRef(r),s=Se(t);return d.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}function kg(e){const t=d.useRef({value:e,previous:e});return d.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var De=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{};function $a(e){const[t,n]=d.useState(void 0);return De(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const u=s.borderBoxSize,c=Array.isArray(u)?u[0]:u;i=c.inlineSize,a=c.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function Ig(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var Jt=e=>{const{present:t,children:n}=e,r=Rg(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=ke(r.ref,Lg(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};Jt.displayName="Presence";function Rg(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=Ig(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=sr(r.current);s.current=a==="mounted"?c:"none"},[a]),De(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,p=sr(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&m!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),De(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const h=sr(r.current).includes(p.animationName);if(p.target===t&&h&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},m=p=>{p.target===t&&(s.current=sr(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function sr(e){return(e==null?void 0:e.animationName)||"none"}function Lg(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ka=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Bg);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(Ro,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Ro,{...r,ref:t,children:n})});ka.displayName="Slot";var Ro=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=zg(n);return d.cloneElement(n,{...Hg(r,n.props),ref:t?or(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Ro.displayName="SlotClone";var Vg=({children:e})=>l.jsx(l.Fragment,{children:e});function Bg(e){return d.isValidElement(e)&&e.type===Vg}function Hg(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function zg(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ug=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ve=Ug.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?ka:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Ia(e,t){e&&Hn.flushSync(()=>e.dispatchEvent(t))}var Lo="Checkbox",[jg,Rx]=Ct(Lo),[Wg,Gg]=jg(Lo),Ra=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:u="on",onCheckedChange:c,form:f,...g}=e,[m,p]=d.useState(null),v=ke(t,T=>p(T)),h=d.useRef(!1),y=m?f||!!m.closest("form"):!0,[w=!1,x]=Xt({prop:o,defaultProp:s,onChange:c}),E=d.useRef(w);return d.useEffect(()=>{const T=m==null?void 0:m.form;if(T){const C=()=>x(E.current);return T.addEventListener("reset",C),()=>T.removeEventListener("reset",C)}},[m,x]),l.jsxs(Wg,{scope:n,state:w,disabled:a,children:[l.jsx(ve.button,{type:"button",role:"checkbox","aria-checked":St(w)?"mixed":w,"aria-required":i,"data-state":Ba(w),"data-disabled":a?"":void 0,disabled:a,value:u,...g,ref:v,onKeyDown:me(e.onKeyDown,T=>{T.key==="Enter"&&T.preventDefault()}),onClick:me(e.onClick,T=>{x(C=>St(C)?!0:!C),y&&(h.current=T.isPropagationStopped(),h.current||T.stopPropagation())})}),y&&l.jsx(qg,{control:m,bubbles:!h.current,name:r,value:u,checked:w,required:i,disabled:a,form:f,style:{transform:"translateX(-100%)"},defaultChecked:St(s)?!1:s})]})});Ra.displayName=Lo;var La="CheckboxIndicator",Va=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=Gg(La,n);return l.jsx(Jt,{present:r||St(s.state)||s.state===!0,children:l.jsx(ve.span,{"data-state":Ba(s.state),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Va.displayName=La;var qg=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...s}=e,i=d.useRef(null),a=kg(n),u=$a(t);d.useEffect(()=>{const f=i.current,g=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(g,"checked").set;if(a!==n&&p){const v=new Event("click",{bubbles:r});f.indeterminate=St(n),p.call(f,St(n)?!1:n),f.dispatchEvent(v)}},[a,n,r]);const c=d.useRef(St(n)?!1:n);return l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o??c.current,...s,tabIndex:-1,ref:i,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function St(e){return e==="indeterminate"}function Ba(e){return St(e)?"indeterminate":e?"checked":"unchecked"}var Ha=Ra,Kg=Va;const Vo=d.forwardRef(({className:e,...t},n)=>l.jsx(Ha,{ref:n,className:Z("s3-explr-ui-checkbox peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:l.jsx(Kg,{className:Z("s3-explr-ui-checkbox-indicator flex items-center justify-center text-current"),children:l.jsx(jp,{className:"s3-explr-ui-checkbox-check h-4 w-4"})})}));Vo.displayName=Ha.displayName;var Xg=d.useId||(()=>{}),Jg=0;function Yt(e){const[t,n]=d.useState(Xg());return De(()=>{e||n(r=>r??String(Jg++))},[e]),e||(t?`radix-${t}`:"")}function za(e,t=globalThis==null?void 0:globalThis.document){const n=Se(e);d.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Yg="DismissableLayer",Bo="dismissableLayer.update",Zg="dismissableLayer.pointerDownOutside",Qg="dismissableLayer.focusOutside",Ua,ja=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ho=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,c=d.useContext(ja),[f,g]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=d.useState({}),v=ke(t,S=>g(S)),h=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=h.indexOf(y),x=f?h.indexOf(f):-1,E=c.layersWithOutsidePointerEventsDisabled.size>0,T=x>=w,C=th(S=>{const A=S.target,B=[...c.branches].some(H=>H.contains(A));!T||B||(o==null||o(S),i==null||i(S),S.defaultPrevented||a==null||a())},m),N=nh(S=>{const A=S.target;[...c.branches].some(H=>H.contains(A))||(s==null||s(S),i==null||i(S),S.defaultPrevented||a==null||a())},m);return za(S=>{x===c.layers.size-1&&(r==null||r(S),!S.defaultPrevented&&a&&(S.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Ua=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),Ga(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Ua)}},[f,m,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),Ga())},[f,c]),d.useEffect(()=>{const S=()=>p({});return document.addEventListener(Bo,S),()=>document.removeEventListener(Bo,S)},[]),l.jsx(ve.div,{...u,ref:v,style:{pointerEvents:E?T?"auto":"none":void 0,...e.style},onFocusCapture:me(e.onFocusCapture,N.onFocusCapture),onBlurCapture:me(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:me(e.onPointerDownCapture,C.onPointerDownCapture)})});Ho.displayName=Yg;var eh="DismissableLayerBranch",Wa=d.forwardRef((e,t)=>{const n=d.useContext(ja),r=d.useRef(null),o=ke(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(ve.div,{...e,ref:o})});Wa.displayName=eh;function th(e,t=globalThis==null?void 0:globalThis.document){const n=Se(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){qa(Zg,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function nh(e,t=globalThis==null?void 0:globalThis.document){const n=Se(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&qa(Qg,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Ga(){const e=new CustomEvent(Bo);document.dispatchEvent(e)}function qa(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Ia(o,s):o.dispatchEvent(s)}var rh=Ho,oh=Wa,zo="focusScope.autoFocusOnMount",Uo="focusScope.autoFocusOnUnmount",Ka={bubbles:!1,cancelable:!0},sh="FocusScope",Xa=d.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,u]=d.useState(null),c=Se(o),f=Se(s),g=d.useRef(null),m=ke(t,h=>u(h)),p=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let h=function(E){if(p.paused||!a)return;const T=E.target;a.contains(T)?g.current=T:Et(g.current,{select:!0})},y=function(E){if(p.paused||!a)return;const T=E.relatedTarget;T!==null&&(a.contains(T)||Et(g.current,{select:!0}))},w=function(E){if(document.activeElement===document.body)for(const C of E)C.removedNodes.length>0&&Et(a)};document.addEventListener("focusin",h),document.addEventListener("focusout",y);const x=new MutationObserver(w);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),x.disconnect()}}},[r,a,p.paused]),d.useEffect(()=>{if(a){Za.add(p);const h=document.activeElement;if(!a.contains(h)){const w=new CustomEvent(zo,Ka);a.addEventListener(zo,c),a.dispatchEvent(w),w.defaultPrevented||(ih(dh(Ja(a)),{select:!0}),document.activeElement===h&&Et(a))}return()=>{a.removeEventListener(zo,c),setTimeout(()=>{const w=new CustomEvent(Uo,Ka);a.addEventListener(Uo,f),a.dispatchEvent(w),w.defaultPrevented||Et(h??document.body,{select:!0}),a.removeEventListener(Uo,f),Za.remove(p)},0)}}},[a,c,f,p]);const v=d.useCallback(h=>{if(!n&&!r||p.paused)return;const y=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,w=document.activeElement;if(y&&w){const x=h.currentTarget,[E,T]=ah(x);E&&T?!h.shiftKey&&w===T?(h.preventDefault(),n&&Et(E,{select:!0})):h.shiftKey&&w===E&&(h.preventDefault(),n&&Et(T,{select:!0})):w===x&&h.preventDefault()}},[n,r,p.paused]);return l.jsx(ve.div,{tabIndex:-1,...i,ref:m,onKeyDown:v})});Xa.displayName=sh;function ih(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Et(r,{select:t}),document.activeElement!==n)return}function ah(e){const t=Ja(e),n=Ya(t,e),r=Ya(t.reverse(),e);return[n,r]}function Ja(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ya(e,t){for(const n of e)if(!lh(n,{upTo:t}))return n}function lh(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function ch(e){return e instanceof HTMLInputElement&&"select"in e}function Et(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ch(e)&&t&&e.select()}}var Za=uh();function uh(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Qa(e,t),e.unshift(t)},remove(t){var n;e=Qa(e,t),(n=e[0])==null||n.resume()}}}function Qa(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function dh(e){return e.filter(t=>t.tagName!=="A")}var fh="Portal",jo=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);De(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Yr.createPortal(l.jsx(ve.div,{...r,ref:t}),i):null});jo.displayName=fh;var Wo=0;function ph(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??el()),document.body.insertAdjacentElement("beforeend",e[1]??el()),Wo++,()=>{Wo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Wo--}},[])}function el(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ke=function(){return Ke=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Ke.apply(this,arguments)};function tl(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function nl(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],i;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(a){i={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s}function rl(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var ir="right-scroll-bar-position",ar="width-before-scroll-bar",gh="with-scroll-bars-hidden",hh="--removed-body-scroll-bar-size";function Go(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function mh(e,t){var n=O.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var vh=typeof window<"u"?d.useLayoutEffect:d.useEffect,ol=new WeakMap;function yh(e,t){var n=mh(null,function(r){return e.forEach(function(o){return Go(o,r)})});return vh(function(){var r=ol.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Go(a,null)}),s.forEach(function(a){o.has(a)||Go(a,i)})}ol.set(n,e)},[e]),n}function wh(e){return e}function bh(e,t){t===void 0&&(t=wh);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var u=function(){var f=i;i=[],f.forEach(s)},c=function(){return Promise.resolve().then(u)};c(),n={push:function(f){i.push(f),c()},filter:function(f){return i=i.filter(f),n}}}};return o}function xh(e){e===void 0&&(e={});var t=bh(null);return t.options=Ke({async:!0,ssr:!1},e),t}var sl=function(e){var t=e.sideCar,n=tl(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return d.createElement(r,Ke({},n))};sl.isSideCarExport=!0;function Ch(e,t){return e.useMedium(t),sl}var il=xh(),qo=function(){},lr=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:qo,onWheelCapture:qo,onTouchMoveCapture:qo}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,u=e.className,c=e.removeScrollBar,f=e.enabled,g=e.shards,m=e.sideCar,p=e.noIsolation,v=e.inert,h=e.allowPinchZoom,y=e.as,w=y===void 0?"div":y,x=e.gapMode,E=tl(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=m,C=yh([n,t]),N=Ke(Ke({},E),o);return d.createElement(d.Fragment,null,f&&d.createElement(T,{sideCar:il,removeScrollBar:c,shards:g,noIsolation:p,inert:v,setCallbacks:s,allowPinchZoom:!!h,lockRef:n,gapMode:x}),i?d.cloneElement(d.Children.only(a),Ke(Ke({},N),{ref:C})):d.createElement(w,Ke({},N,{className:u,ref:C}),a))});lr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},lr.classNames={fullWidth:ar,zeroRight:ir};var Sh=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Eh(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Sh();return t&&e.setAttribute("nonce",t),e}function Nh(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Th(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ph=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Eh())&&(Nh(t,n),Th(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ah=function(){var e=Ph();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},al=function(){var e=Ah(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},_h={left:0,top:0,right:0,gap:0},Ko=function(e){return parseInt(e||"",10)||0},Fh=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Ko(n),Ko(r),Ko(o)]},Oh=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return _h;var t=Fh(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Dh=al(),Zt="data-scroll-locked",Mh=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
88
- .`.concat(gh,` {
87
+ */const Kp=lt("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
88
+ * @license lucide-react v0.468.0 - ISC
89
+ *
90
+ * This source code is licensed under the ISC license.
91
+ * See the LICENSE file in the root directory of this source tree.
92
+ */const Fo=lt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function ma(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Xp(...e){return t=>{let n=!1;const r=e.map(o=>{const s=ma(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():ma(e[o],null)}}}}var Kt=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Jp);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(Oo,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Oo,{...r,ref:t,children:n})});Kt.displayName="Slot";var Oo=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Zp(n);return d.cloneElement(n,{...Yp(r,n.props),ref:t?Xp(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Oo.displayName="SlotClone";var va=({children:e})=>l.jsx(l.Fragment,{children:e});function Jp(e){return d.isValidElement(e)&&e.type===va}function Yp(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Zp(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ya(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=ya(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function wa(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=ya(e))&&(r&&(r+=" "),r+=t);return r}const Do="-",Qp=e=>{const t=tg(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(Do);return a[0]===""&&a.length!==1&&a.shift(),ba(a,t)||eg(i)},getConflictingClassGroupIds:(i,a)=>{const u=n[i]||[];return a&&r[i]?[...u,...r[i]]:u}}},ba=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?ba(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Do);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},xa=/^\[(.+)\]$/,eg=e=>{if(xa.test(e)){const t=xa.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},tg=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return rg(Object.entries(e.classGroups),n).forEach(([s,i])=>{Mo(i,r,s,t)}),r},Mo=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Ca(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(ng(o)){Mo(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{Mo(i,Ca(t,s),n,r)})})},Ca=(e,t)=>{let n=e;return t.split(Do).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},ng=e=>e.isThemeGetter,rg=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e,og=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},Sa="!",sg=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const u=[];let c=0,f=0,g;for(let y=0;y<a.length;y++){let w=a[y];if(c===0){if(w===o&&(r||a.slice(y,y+s)===t)){u.push(a.slice(f,y)),f=y+s;continue}if(w==="/"){g=y;continue}}w==="["?c++:w==="]"&&c--}const m=u.length===0?a:a.substring(f),p=m.startsWith(Sa),v=p?m.substring(1):m,h=g&&g>f?g-f:void 0;return{modifiers:u,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:h}};return n?a=>n({className:a,parseClassName:i}):i},ig=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},ag=e=>({cache:og(e.cacheSize),parseClassName:sg(e),...Qp(e)}),lg=/\s+/,cg=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(lg);let a="";for(let u=i.length-1;u>=0;u-=1){const c=i[u],{modifiers:f,hasImportantModifier:g,baseClassName:m,maybePostfixModifierPosition:p}=n(c);let v=!!p,h=r(v?m.substring(0,p):m);if(!h){if(!v){a=c+(a.length>0?" "+a:a);continue}if(h=r(m),!h){a=c+(a.length>0?" "+a:a);continue}v=!1}const y=ig(f).join(":"),w=g?y+Sa:y,x=w+h;if(s.includes(x))continue;s.push(x);const S=o(h,v);for(let E=0;E<S.length;++E){const C=S[E];s.push(w+C)}a=c+(a.length>0?" "+a:a)}return a};function ug(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Ea(t))&&(r&&(r+=" "),r+=n);return r}const Ea=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ea(e[r]))&&(n&&(n+=" "),n+=t);return n};function dg(e,...t){let n,r,o,s=i;function i(u){const c=t.reduce((f,g)=>g(f),e());return n=ag(c),r=n.cache.get,o=n.cache.set,s=a,a(u)}function a(u){const c=r(u);if(c)return c;const f=cg(u,n);return o(u,f),f}return function(){return s(ug.apply(null,arguments))}}const ce=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Na=/^\[(?:([a-z-]+):)?(.+)\]$/i,fg=/^\d+\/\d+$/,pg=new Set(["px","full","screen"]),gg=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hg=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,mg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,vg=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,yg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ct=e=>Xt(e)||pg.has(e)||fg.test(e),xt=e=>Jt(e,"length",Tg),Xt=e=>!!e&&!Number.isNaN(Number(e)),$o=e=>Jt(e,"number",Xt),Cn=e=>!!e&&Number.isInteger(Number(e)),wg=e=>e.endsWith("%")&&Xt(e.slice(0,-1)),te=e=>Na.test(e),Ct=e=>gg.test(e),bg=new Set(["length","size","percentage"]),xg=e=>Jt(e,bg,Ta),Cg=e=>Jt(e,"position",Ta),Sg=new Set(["image","url"]),Eg=e=>Jt(e,Sg,Ag),Ng=e=>Jt(e,"",Pg),Sn=()=>!0,Jt=(e,t,n)=>{const r=Na.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Tg=e=>hg.test(e)&&!mg.test(e),Ta=()=>!1,Pg=e=>vg.test(e),Ag=e=>yg.test(e),_g=dg(()=>{const e=ce("colors"),t=ce("spacing"),n=ce("blur"),r=ce("brightness"),o=ce("borderColor"),s=ce("borderRadius"),i=ce("borderSpacing"),a=ce("borderWidth"),u=ce("contrast"),c=ce("grayscale"),f=ce("hueRotate"),g=ce("invert"),m=ce("gap"),p=ce("gradientColorStops"),v=ce("gradientColorStopPositions"),h=ce("inset"),y=ce("margin"),w=ce("opacity"),x=ce("padding"),S=ce("saturate"),E=ce("scale"),C=ce("sepia"),P=ce("skew"),_=ce("space"),O=ce("translate"),$=()=>["auto","contain","none"],F=()=>["auto","hidden","clip","visible","scroll"],G=()=>["auto",te,t],k=()=>[te,t],R=()=>["",ct,xt],M=()=>["auto",Xt,te],q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],j=()=>["solid","dashed","dotted","double","none"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>["start","end","center","between","around","evenly","stretch"],ee=()=>["","0",te],ie=()=>["auto","avoid","all","avoid-page","page","left","right","column"],de=()=>[Xt,te];return{cacheSize:500,separator:":",theme:{colors:[Sn],spacing:[ct,xt],blur:["none","",Ct,te],brightness:de(),borderColor:[e],borderRadius:["none","","full",Ct,te],borderSpacing:k(),borderWidth:R(),contrast:de(),grayscale:ee(),hueRotate:de(),invert:ee(),gap:k(),gradientColorStops:[e],gradientColorStopPositions:[wg,xt],inset:G(),margin:G(),opacity:de(),padding:k(),saturate:de(),scale:de(),sepia:ee(),skew:de(),space:k(),translate:k()},classGroups:{aspect:[{aspect:["auto","square","video",te]}],container:["container"],columns:[{columns:[Ct]}],"break-after":[{"break-after":ie()}],"break-before":[{"break-before":ie()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...q(),te]}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Cn,te]}],basis:[{basis:G()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",te]}],grow:[{grow:ee()}],shrink:[{shrink:ee()}],order:[{order:["first","last","none",Cn,te]}],"grid-cols":[{"grid-cols":[Sn]}],"col-start-end":[{col:["auto",{span:["full",Cn,te]},te]}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":[Sn]}],"row-start-end":[{row:["auto",{span:[Cn,te]},te]}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",te]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",te]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",te,t]}],"min-w":[{"min-w":[te,t,"min","max","fit"]}],"max-w":[{"max-w":[te,t,"none","full","min","max","fit","prose",{screen:[Ct]},Ct]}],h:[{h:[te,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[te,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[te,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[te,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ct,xt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",$o]}],"font-family":[{font:[Sn]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",te]}],"line-clamp":[{"line-clamp":["none",Xt,$o]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ct,te]}],"list-image":[{"list-image":["none",te]}],"list-style-type":[{list:["none","disc","decimal",te]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...j(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ct,xt]}],"underline-offset":[{"underline-offset":["auto",ct,te]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",te]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...q(),Cg]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",xg]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Eg]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...j(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:j()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...j()]}],"outline-offset":[{"outline-offset":[ct,te]}],"outline-w":[{outline:[ct,xt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:R()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[ct,xt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ct,Ng]}],"shadow-color":[{shadow:[Sn]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...X(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":X()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Ct,te]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[g]}],saturate:[{saturate:[S]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",te]}],duration:[{duration:de()}],ease:[{ease:["linear","in","out","in-out",te]}],delay:[{delay:de()}],animate:[{animate:["none","spin","ping","pulse","bounce",te]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Cn,te]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",te]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",te]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",te]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ct,xt,$o]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});function Z(...e){return _g(wa(e))}const Fg=e=>{if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB","TB"],r=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,r)).toFixed(2))} ${n[r]}`},Pa=d.forwardRef(({className:e,...t},n)=>l.jsx("nav",{ref:n,"aria-label":"breadcrumb",className:Z("s3-explr-ui-breadcrumb",e),...t}));Pa.displayName="Breadcrumb";const Aa=d.forwardRef(({className:e,...t},n)=>l.jsx("ol",{ref:n,className:Z("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5","s3-explr-ui-breadcrumb-list",e),...t}));Aa.displayName="BreadcrumbList";const ko=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:Z("inline-flex items-center gap-1.5","s3-explr-ui-breadcrumb-item",e),...t}));ko.displayName="BreadcrumbItem";const Io=d.forwardRef(({asChild:e,className:t,...n},r)=>{const o=e?Kt:"a";return l.jsx(o,{ref:r,className:Z("transition-colors hover:text-foreground","s3-explr-ui-breadcrumb-link",t),...n})});Io.displayName="BreadcrumbLink";const Og=d.forwardRef(({className:e,...t},n)=>l.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Z("font-normal text-foreground","s3-explr-ui-breadcrumb-page",e),...t}));Og.displayName="BreadcrumbPage";const _a=({children:e,className:t,...n})=>l.jsx("li",{role:"presentation","aria-hidden":"true",className:Z("[&>svg]:w-3.5 [&>svg]:h-3.5","s3-explr-ui-breadcrumb-separator",t),...n,children:e??l.jsx(ha,{})});_a.displayName="BreadcrumbSeparator";const Fa=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Oa=wa,Ro=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Oa(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(c=>{const f=n==null?void 0:n[c],g=s==null?void 0:s[c];if(f===null)return null;const m=Fa(f)||Fa(g);return o[c][m]}),a=n&&Object.entries(n).reduce((c,f)=>{let[g,m]=f;return m===void 0||(c[g]=m),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:g,className:m,...p}=f;return Object.entries(p).every(v=>{let[h,y]=v;return Array.isArray(y)?y.includes({...s,...a}[h]):{...s,...a}[h]===y})?[...c,g,m]:c},[]);return Oa(e,i,u,n==null?void 0:n.class,n==null?void 0:n.className)},Da=Ro("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 s3-explr-ui-button",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90 s3-explr-ui-button-default",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90 s3-explr-ui-button-destructive",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground s3-explr-ui-button-outline",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80 s3-explr-ui-button-secondary",ghost:"hover:bg-accent hover:text-accent-foreground s3-explr-ui-button-ghost",link:"text-primary underline-offset-4 hover:underline s3-explr-ui-button-link"},size:{default:"h-9 px-4 py-2 s3-explr-ui-button-size-default",sm:"h-8 rounded-md px-3 text-xs s3-explr-ui-button-size-sm",lg:"h-10 rounded-md px-8 s3-explr-ui-button-size-lg",icon:"h-9 w-9 s3-explr-ui-button-size-icon"}},defaultVariants:{variant:"default",size:"default"}}),ae=d.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?Kt:"button";return l.jsx(i,{className:Z(Da({variant:t,size:n,className:e})),ref:s,...o})});ae.displayName="Button";function Dg(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function or(...e){return t=>e.forEach(n=>Dg(n,t))}function Le(...e){return d.useCallback(or(...e),e)}function Mg(e,t){const n=d.createContext(t),r=s=>{const{children:i,...a}=s,u=d.useMemo(()=>a,Object.values(a));return l.jsx(n.Provider,{value:u,children:i})};r.displayName=e+"Provider";function o(s){const i=d.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function St(e,t=[]){let n=[];function r(s,i){const a=d.createContext(i),u=n.length;n=[...n,i];const c=g=>{var w;const{scope:m,children:p,...v}=g,h=((w=m==null?void 0:m[e])==null?void 0:w[u])||a,y=d.useMemo(()=>v,Object.values(v));return l.jsx(h.Provider,{value:y,children:p})};c.displayName=s+"Provider";function f(g,m){var h;const p=((h=m==null?void 0:m[e])==null?void 0:h[u])||a,v=d.useContext(p);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${g}\` must be used within \`${s}\``)}return[c,f]}const o=()=>{const s=n.map(i=>d.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return d.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return o.scopeName=e,[r,$g(o,...t)]}function $g(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:u,scopeName:c})=>{const g=u(s)[`__scope${c}`];return{...a,...g}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function me(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Ne(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Yt({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=kg({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=Ne(n),u=d.useCallback(c=>{if(s){const g=typeof c=="function"?c(e):c;g!==e&&a(g)}else o(c)},[s,e,o,a]);return[i,u]}function kg({defaultProp:e,onChange:t}){const n=d.useState(e),[r]=n,o=d.useRef(r),s=Ne(t);return d.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}function Ig(e){const t=d.useRef({value:e,previous:e});return d.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var ke=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{};function Ma(e){const[t,n]=d.useState(void 0);return ke(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const u=s.borderBoxSize,c=Array.isArray(u)?u[0]:u;i=c.inlineSize,a=c.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function Rg(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var Zt=e=>{const{present:t,children:n}=e,r=Lg(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=Le(r.ref,Vg(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};Zt.displayName="Presence";function Lg(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=Rg(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=sr(r.current);s.current=a==="mounted"?c:"none"},[a]),ke(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,p=sr(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&m!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),ke(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const h=sr(r.current).includes(p.animationName);if(p.target===t&&h&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},m=p=>{p.target===t&&(s.current=sr(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function sr(e){return(e==null?void 0:e.animationName)||"none"}function Vg(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var $a=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(zg);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(Lo,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Lo,{...r,ref:t,children:n})});$a.displayName="Slot";var Lo=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Ug(n);return d.cloneElement(n,{...Hg(r,n.props),ref:t?or(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Lo.displayName="SlotClone";var Bg=({children:e})=>l.jsx(l.Fragment,{children:e});function zg(e){return d.isValidElement(e)&&e.type===Bg}function Hg(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Ug(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var jg=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ve=jg.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?$a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ka(e,t){e&&zn.flushSync(()=>e.dispatchEvent(t))}var Vo="Checkbox",[Wg,Vx]=St(Vo),[Gg,qg]=Wg(Vo),Ia=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:u="on",onCheckedChange:c,form:f,...g}=e,[m,p]=d.useState(null),v=Le(t,E=>p(E)),h=d.useRef(!1),y=m?f||!!m.closest("form"):!0,[w=!1,x]=Yt({prop:o,defaultProp:s,onChange:c}),S=d.useRef(w);return d.useEffect(()=>{const E=m==null?void 0:m.form;if(E){const C=()=>x(S.current);return E.addEventListener("reset",C),()=>E.removeEventListener("reset",C)}},[m,x]),l.jsxs(Gg,{scope:n,state:w,disabled:a,children:[l.jsx(ve.button,{type:"button",role:"checkbox","aria-checked":Et(w)?"mixed":w,"aria-required":i,"data-state":Va(w),"data-disabled":a?"":void 0,disabled:a,value:u,...g,ref:v,onKeyDown:me(e.onKeyDown,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:me(e.onClick,E=>{x(C=>Et(C)?!0:!C),y&&(h.current=E.isPropagationStopped(),h.current||E.stopPropagation())})}),y&&l.jsx(Kg,{control:m,bubbles:!h.current,name:r,value:u,checked:w,required:i,disabled:a,form:f,style:{transform:"translateX(-100%)"},defaultChecked:Et(s)?!1:s})]})});Ia.displayName=Vo;var Ra="CheckboxIndicator",La=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=qg(Ra,n);return l.jsx(Zt,{present:r||Et(s.state)||s.state===!0,children:l.jsx(ve.span,{"data-state":Va(s.state),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});La.displayName=Ra;var Kg=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...s}=e,i=d.useRef(null),a=Ig(n),u=Ma(t);d.useEffect(()=>{const f=i.current,g=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(g,"checked").set;if(a!==n&&p){const v=new Event("click",{bubbles:r});f.indeterminate=Et(n),p.call(f,Et(n)?!1:n),f.dispatchEvent(v)}},[a,n,r]);const c=d.useRef(Et(n)?!1:n);return l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o??c.current,...s,tabIndex:-1,ref:i,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Et(e){return e==="indeterminate"}function Va(e){return Et(e)?"indeterminate":e?"checked":"unchecked"}var Ba=Ia,Xg=La;const Bo=d.forwardRef(({className:e,...t},n)=>l.jsx(Ba,{ref:n,className:Z("s3-explr-ui-checkbox peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:l.jsx(Xg,{className:Z("s3-explr-ui-checkbox-indicator flex items-center justify-center text-current"),children:l.jsx(jp,{className:"s3-explr-ui-checkbox-check h-4 w-4"})})}));Bo.displayName=Ba.displayName;var Jg=d.useId||(()=>{}),Yg=0;function Qt(e){const[t,n]=d.useState(Jg());return ke(()=>{e||n(r=>r??String(Yg++))},[e]),e||(t?`radix-${t}`:"")}function za(e,t=globalThis==null?void 0:globalThis.document){const n=Ne(e);d.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Zg="DismissableLayer",zo="dismissableLayer.update",Qg="dismissableLayer.pointerDownOutside",eh="dismissableLayer.focusOutside",Ha,Ua=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ho=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,c=d.useContext(Ua),[f,g]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=d.useState({}),v=Le(t,_=>g(_)),h=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=h.indexOf(y),x=f?h.indexOf(f):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,E=x>=w,C=nh(_=>{const O=_.target,$=[...c.branches].some(F=>F.contains(O));!E||$||(o==null||o(_),i==null||i(_),_.defaultPrevented||a==null||a())},m),P=rh(_=>{const O=_.target;[...c.branches].some(F=>F.contains(O))||(s==null||s(_),i==null||i(_),_.defaultPrevented||a==null||a())},m);return za(_=>{x===c.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&a&&(_.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Ha=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),Wa(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Ha)}},[f,m,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),Wa())},[f,c]),d.useEffect(()=>{const _=()=>p({});return document.addEventListener(zo,_),()=>document.removeEventListener(zo,_)},[]),l.jsx(ve.div,{...u,ref:v,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:me(e.onFocusCapture,P.onFocusCapture),onBlurCapture:me(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:me(e.onPointerDownCapture,C.onPointerDownCapture)})});Ho.displayName=Zg;var th="DismissableLayerBranch",ja=d.forwardRef((e,t)=>{const n=d.useContext(Ua),r=d.useRef(null),o=Le(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(ve.div,{...e,ref:o})});ja.displayName=th;function nh(e,t=globalThis==null?void 0:globalThis.document){const n=Ne(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){Ga(Qg,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function rh(e,t=globalThis==null?void 0:globalThis.document){const n=Ne(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&Ga(eh,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Wa(){const e=new CustomEvent(zo);document.dispatchEvent(e)}function Ga(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?ka(o,s):o.dispatchEvent(s)}var oh=Ho,sh=ja,Uo="focusScope.autoFocusOnMount",jo="focusScope.autoFocusOnUnmount",qa={bubbles:!1,cancelable:!0},ih="FocusScope",Ka=d.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,u]=d.useState(null),c=Ne(o),f=Ne(s),g=d.useRef(null),m=Le(t,h=>u(h)),p=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let h=function(S){if(p.paused||!a)return;const E=S.target;a.contains(E)?g.current=E:Nt(g.current,{select:!0})},y=function(S){if(p.paused||!a)return;const E=S.relatedTarget;E!==null&&(a.contains(E)||Nt(g.current,{select:!0}))},w=function(S){if(document.activeElement===document.body)for(const C of S)C.removedNodes.length>0&&Nt(a)};document.addEventListener("focusin",h),document.addEventListener("focusout",y);const x=new MutationObserver(w);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),x.disconnect()}}},[r,a,p.paused]),d.useEffect(()=>{if(a){Ya.add(p);const h=document.activeElement;if(!a.contains(h)){const w=new CustomEvent(Uo,qa);a.addEventListener(Uo,c),a.dispatchEvent(w),w.defaultPrevented||(ah(fh(Xa(a)),{select:!0}),document.activeElement===h&&Nt(a))}return()=>{a.removeEventListener(Uo,c),setTimeout(()=>{const w=new CustomEvent(jo,qa);a.addEventListener(jo,f),a.dispatchEvent(w),w.defaultPrevented||Nt(h??document.body,{select:!0}),a.removeEventListener(jo,f),Ya.remove(p)},0)}}},[a,c,f,p]);const v=d.useCallback(h=>{if(!n&&!r||p.paused)return;const y=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,w=document.activeElement;if(y&&w){const x=h.currentTarget,[S,E]=lh(x);S&&E?!h.shiftKey&&w===E?(h.preventDefault(),n&&Nt(S,{select:!0})):h.shiftKey&&w===S&&(h.preventDefault(),n&&Nt(E,{select:!0})):w===x&&h.preventDefault()}},[n,r,p.paused]);return l.jsx(ve.div,{tabIndex:-1,...i,ref:m,onKeyDown:v})});Ka.displayName=ih;function ah(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Nt(r,{select:t}),document.activeElement!==n)return}function lh(e){const t=Xa(e),n=Ja(t,e),r=Ja(t.reverse(),e);return[n,r]}function Xa(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ja(e,t){for(const n of e)if(!ch(n,{upTo:t}))return n}function ch(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function uh(e){return e instanceof HTMLInputElement&&"select"in e}function Nt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&uh(e)&&t&&e.select()}}var Ya=dh();function dh(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Za(e,t),e.unshift(t)},remove(t){var n;e=Za(e,t),(n=e[0])==null||n.resume()}}}function Za(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function fh(e){return e.filter(t=>t.tagName!=="A")}var ph="Portal",Wo=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);ke(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Yr.createPortal(l.jsx(ve.div,{...r,ref:t}),i):null});Wo.displayName=ph;var Go=0;function gh(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Qa()),document.body.insertAdjacentElement("beforeend",e[1]??Qa()),Go++,()=>{Go===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Go--}},[])}function Qa(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Qe=function(){return Qe=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Qe.apply(this,arguments)};function el(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function tl(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],i;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(a){i={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s}function nl(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var ir="right-scroll-bar-position",ar="width-before-scroll-bar",hh="with-scroll-bars-hidden",mh="--removed-body-scroll-bar-size";function qo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function vh(e,t){var n=D.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var yh=typeof window<"u"?d.useLayoutEffect:d.useEffect,rl=new WeakMap;function wh(e,t){var n=vh(null,function(r){return e.forEach(function(o){return qo(o,r)})});return yh(function(){var r=rl.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||qo(a,null)}),s.forEach(function(a){o.has(a)||qo(a,i)})}rl.set(n,e)},[e]),n}function bh(e){return e}function xh(e,t){t===void 0&&(t=bh);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var u=function(){var f=i;i=[],f.forEach(s)},c=function(){return Promise.resolve().then(u)};c(),n={push:function(f){i.push(f),c()},filter:function(f){return i=i.filter(f),n}}}};return o}function Ch(e){e===void 0&&(e={});var t=xh(null);return t.options=Qe({async:!0,ssr:!1},e),t}var ol=function(e){var t=e.sideCar,n=el(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return d.createElement(r,Qe({},n))};ol.isSideCarExport=!0;function Sh(e,t){return e.useMedium(t),ol}var sl=Ch(),Ko=function(){},lr=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:Ko,onWheelCapture:Ko,onTouchMoveCapture:Ko}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,u=e.className,c=e.removeScrollBar,f=e.enabled,g=e.shards,m=e.sideCar,p=e.noIsolation,v=e.inert,h=e.allowPinchZoom,y=e.as,w=y===void 0?"div":y,x=e.gapMode,S=el(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=m,C=wh([n,t]),P=Qe(Qe({},S),o);return d.createElement(d.Fragment,null,f&&d.createElement(E,{sideCar:sl,removeScrollBar:c,shards:g,noIsolation:p,inert:v,setCallbacks:s,allowPinchZoom:!!h,lockRef:n,gapMode:x}),i?d.cloneElement(d.Children.only(a),Qe(Qe({},P),{ref:C})):d.createElement(w,Qe({},P,{className:u,ref:C}),a))});lr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},lr.classNames={fullWidth:ar,zeroRight:ir};var Eh=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Nh(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Eh();return t&&e.setAttribute("nonce",t),e}function Th(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ph(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ah=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Nh())&&(Th(t,n),Ph(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},_h=function(){var e=Ah();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},il=function(){var e=_h(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Fh={left:0,top:0,right:0,gap:0},Xo=function(e){return parseInt(e||"",10)||0},Oh=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Xo(n),Xo(r),Xo(o)]},Dh=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Fh;var t=Oh(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Mh=il(),en="data-scroll-locked",$h=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
93
+ .`.concat(hh,` {
89
94
  overflow: hidden `).concat(r,`;
90
95
  padding-right: `).concat(a,"px ").concat(r,`;
91
96
  }
92
- body[`).concat(Zt,`] {
97
+ body[`).concat(en,`] {
93
98
  overflow: hidden `).concat(r,`;
94
99
  overscroll-behavior: contain;
95
100
  `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
@@ -118,16 +123,16 @@
118
123
  margin-right: 0 `).concat(r,`;
119
124
  }
120
125
 
121
- body[`).concat(Zt,`] {
122
- `).concat(hh,": ").concat(a,`px;
126
+ body[`).concat(en,`] {
127
+ `).concat(mh,": ").concat(a,`px;
123
128
  }
124
- `)},ll=function(){var e=parseInt(document.body.getAttribute(Zt)||"0",10);return isFinite(e)?e:0},$h=function(){d.useEffect(function(){return document.body.setAttribute(Zt,(ll()+1).toString()),function(){var e=ll()-1;e<=0?document.body.removeAttribute(Zt):document.body.setAttribute(Zt,e.toString())}},[])},kh=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;$h();var s=d.useMemo(function(){return Oh(o)},[o]);return d.createElement(Dh,{styles:Mh(s,!t,o,n?"":"!important")})},Xo=!1;if(typeof window<"u")try{var cr=Object.defineProperty({},"passive",{get:function(){return Xo=!0,!0}});window.addEventListener("test",cr,cr),window.removeEventListener("test",cr,cr)}catch{Xo=!1}var Qt=Xo?{passive:!1}:!1,Ih=function(e){return e.tagName==="TEXTAREA"},cl=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Ih(e)&&n[t]==="visible")},Rh=function(e){return cl(e,"overflowY")},Lh=function(e){return cl(e,"overflowX")},ul=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=dl(e,r);if(o){var s=fl(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Vh=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Bh=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},dl=function(e,t){return e==="v"?Rh(t):Lh(t)},fl=function(e,t){return e==="v"?Vh(t):Bh(t)},Hh=function(e,t){return e==="h"&&t==="rtl"?-1:1},zh=function(e,t,n,r,o){var s=Hh(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,u=t.contains(a),c=!1,f=i>0,g=0,m=0;do{var p=fl(e,a),v=p[0],h=p[1],y=p[2],w=h-y-s*v;(v||w)&&dl(e,a)&&(g+=w,m+=v),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!u&&a!==document.body||u&&(t.contains(a)||t===a));return(f&&(Math.abs(g)<1||!o)||!f&&(Math.abs(m)<1||!o))&&(c=!0),c},ur=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},pl=function(e){return[e.deltaX,e.deltaY]},gl=function(e){return e&&"current"in e?e.current:e},Uh=function(e,t){return e[0]===t[0]&&e[1]===t[1]},jh=function(e){return`
129
+ `)},al=function(){var e=parseInt(document.body.getAttribute(en)||"0",10);return isFinite(e)?e:0},kh=function(){d.useEffect(function(){return document.body.setAttribute(en,(al()+1).toString()),function(){var e=al()-1;e<=0?document.body.removeAttribute(en):document.body.setAttribute(en,e.toString())}},[])},Ih=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;kh();var s=d.useMemo(function(){return Dh(o)},[o]);return d.createElement(Mh,{styles:$h(s,!t,o,n?"":"!important")})},Jo=!1;if(typeof window<"u")try{var cr=Object.defineProperty({},"passive",{get:function(){return Jo=!0,!0}});window.addEventListener("test",cr,cr),window.removeEventListener("test",cr,cr)}catch{Jo=!1}var tn=Jo?{passive:!1}:!1,Rh=function(e){return e.tagName==="TEXTAREA"},ll=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Rh(e)&&n[t]==="visible")},Lh=function(e){return ll(e,"overflowY")},Vh=function(e){return ll(e,"overflowX")},cl=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=ul(e,r);if(o){var s=dl(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Bh=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},zh=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ul=function(e,t){return e==="v"?Lh(t):Vh(t)},dl=function(e,t){return e==="v"?Bh(t):zh(t)},Hh=function(e,t){return e==="h"&&t==="rtl"?-1:1},Uh=function(e,t,n,r,o){var s=Hh(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,u=t.contains(a),c=!1,f=i>0,g=0,m=0;do{var p=dl(e,a),v=p[0],h=p[1],y=p[2],w=h-y-s*v;(v||w)&&ul(e,a)&&(g+=w,m+=v),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!u&&a!==document.body||u&&(t.contains(a)||t===a));return(f&&(Math.abs(g)<1||!o)||!f&&(Math.abs(m)<1||!o))&&(c=!0),c},ur=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},fl=function(e){return[e.deltaX,e.deltaY]},pl=function(e){return e&&"current"in e?e.current:e},jh=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Wh=function(e){return`
125
130
  .block-interactivity-`.concat(e,` {pointer-events: none;}
126
131
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
127
- `)},Wh=0,en=[];function Gh(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(Wh++)[0],s=d.useState(al)[0],i=d.useRef(e);d.useEffect(function(){i.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=rl([e.lockRef.current],(e.shards||[]).map(gl),!0).filter(Boolean);return h.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=d.useCallback(function(h,y){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!i.current.allowPinchZoom;var w=ur(h),x=n.current,E="deltaX"in h?h.deltaX:x[0]-w[0],T="deltaY"in h?h.deltaY:x[1]-w[1],C,N=h.target,S=Math.abs(E)>Math.abs(T)?"h":"v";if("touches"in h&&S==="h"&&N.type==="range")return!1;var A=ul(S,N);if(!A)return!0;if(A?C=S:(C=S==="v"?"h":"v",A=ul(S,N)),!A)return!1;if(!r.current&&"changedTouches"in h&&(E||T)&&(r.current=C),!C)return!0;var B=r.current||C;return zh(B,y,h,B==="h"?E:T,!0)},[]),u=d.useCallback(function(h){var y=h;if(!(!en.length||en[en.length-1]!==s)){var w="deltaY"in y?pl(y):ur(y),x=t.current.filter(function(C){return C.name===y.type&&(C.target===y.target||y.target===C.shadowParent)&&Uh(C.delta,w)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var E=(i.current.shards||[]).map(gl).filter(Boolean).filter(function(C){return C.contains(y.target)}),T=E.length>0?a(y,E[0]):!i.current.noIsolation;T&&y.cancelable&&y.preventDefault()}}},[]),c=d.useCallback(function(h,y,w,x){var E={name:h,delta:y,target:w,should:x,shadowParent:qh(w)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(T){return T!==E})},1)},[]),f=d.useCallback(function(h){n.current=ur(h),r.current=void 0},[]),g=d.useCallback(function(h){c(h.type,pl(h),h.target,a(h,e.lockRef.current))},[]),m=d.useCallback(function(h){c(h.type,ur(h),h.target,a(h,e.lockRef.current))},[]);d.useEffect(function(){return en.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:m}),document.addEventListener("wheel",u,Qt),document.addEventListener("touchmove",u,Qt),document.addEventListener("touchstart",f,Qt),function(){en=en.filter(function(h){return h!==s}),document.removeEventListener("wheel",u,Qt),document.removeEventListener("touchmove",u,Qt),document.removeEventListener("touchstart",f,Qt)}},[]);var p=e.removeScrollBar,v=e.inert;return d.createElement(d.Fragment,null,v?d.createElement(s,{styles:jh(o)}):null,p?d.createElement(kh,{gapMode:e.gapMode}):null)}function qh(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Kh=Ch(il,Gh);var hl=d.forwardRef(function(e,t){return d.createElement(lr,Ke({},e,{ref:t,sideCar:Kh}))});hl.classNames=lr.classNames;var Xh=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},tn=new WeakMap,dr=new WeakMap,fr={},Jo=0,ml=function(e){return e&&(e.host||ml(e.parentNode))},Jh=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=ml(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Yh=function(e,t,n,r){var o=Jh(t,Array.isArray(e)?e:[e]);fr[n]||(fr[n]=new WeakMap);var s=fr[n],i=[],a=new Set,u=new Set(o),c=function(g){!g||a.has(g)||(a.add(g),c(g.parentNode))};o.forEach(c);var f=function(g){!g||u.has(g)||Array.prototype.forEach.call(g.children,function(m){if(a.has(m))f(m);else try{var p=m.getAttribute(r),v=p!==null&&p!=="false",h=(tn.get(m)||0)+1,y=(s.get(m)||0)+1;tn.set(m,h),s.set(m,y),i.push(m),h===1&&v&&dr.set(m,!0),y===1&&m.setAttribute(n,"true"),v||m.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",m,w)}})};return f(t),a.clear(),Jo++,function(){i.forEach(function(g){var m=tn.get(g)-1,p=s.get(g)-1;tn.set(g,m),s.set(g,p),m||(dr.has(g)||g.removeAttribute(r),dr.delete(g)),p||g.removeAttribute(n)}),Jo--,Jo||(tn=new WeakMap,tn=new WeakMap,dr=new WeakMap,fr={})}},Zh=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Xh(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Yh(r,o,n,"aria-hidden")):function(){return null}},vl=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(em);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(Yo,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Yo,{...r,ref:t,children:n})});vl.displayName="Slot";var Yo=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=nm(n);return d.cloneElement(n,{...tm(r,n.props),ref:t?or(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Yo.displayName="SlotClone";var Qh=({children:e})=>l.jsx(l.Fragment,{children:e});function em(e){return d.isValidElement(e)&&e.type===Qh}function tm(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function nm(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Zo="Dialog",[yl,Lx]=Ct(Zo),[rm,He]=yl(Zo),wl=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=d.useRef(null),u=d.useRef(null),[c=!1,f]=Xt({prop:r,defaultProp:o,onChange:s});return l.jsx(rm,{scope:t,triggerRef:a,contentRef:u,contentId:Yt(),titleId:Yt(),descriptionId:Yt(),open:c,onOpenChange:f,onOpenToggle:d.useCallback(()=>f(g=>!g),[f]),modal:i,children:n})};wl.displayName=Zo;var bl="DialogTrigger",xl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=He(bl,n),s=ke(t,o.triggerRef);return l.jsx(ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ts(o.open),...r,ref:s,onClick:me(e.onClick,o.onOpenToggle)})});xl.displayName=bl;var Qo="DialogPortal",[om,Cl]=yl(Qo,{forceMount:void 0}),Sl=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=He(Qo,t);return l.jsx(om,{scope:t,forceMount:n,children:d.Children.map(r,i=>l.jsx(Jt,{present:n||s.open,children:l.jsx(jo,{asChild:!0,container:o,children:i})}))})};Sl.displayName=Qo;var pr="DialogOverlay",El=d.forwardRef((e,t)=>{const n=Cl(pr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=He(pr,e.__scopeDialog);return s.modal?l.jsx(Jt,{present:r||s.open,children:l.jsx(sm,{...o,ref:t})}):null});El.displayName=pr;var sm=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=He(pr,n);return l.jsx(hl,{as:vl,allowPinchZoom:!0,shards:[o.contentRef],children:l.jsx(ve.div,{"data-state":ts(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),It="DialogContent",Nl=d.forwardRef((e,t)=>{const n=Cl(It,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=He(It,e.__scopeDialog);return l.jsx(Jt,{present:r||s.open,children:s.modal?l.jsx(im,{...o,ref:t}):l.jsx(am,{...o,ref:t})})});Nl.displayName=It;var im=d.forwardRef((e,t)=>{const n=He(It,e.__scopeDialog),r=d.useRef(null),o=ke(t,n.contentRef,r);return d.useEffect(()=>{const s=r.current;if(s)return Zh(s)},[]),l.jsx(Tl,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:me(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:me(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:me(e.onFocusOutside,s=>s.preventDefault())})}),am=d.forwardRef((e,t)=>{const n=He(It,e.__scopeDialog),r=d.useRef(!1),o=d.useRef(!1);return l.jsx(Tl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var u,c;(u=e.onInteractOutside)==null||u.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((c=n.triggerRef.current)==null?void 0:c.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Tl=d.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=He(It,n),u=d.useRef(null),c=ke(t,u);return ph(),l.jsxs(l.Fragment,{children:[l.jsx(Xa,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(Ho,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ts(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(lm,{titleId:a.titleId}),l.jsx(um,{contentRef:u,descriptionId:a.descriptionId})]})]})}),es="DialogTitle",Pl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=He(es,n);return l.jsx(ve.h2,{id:o.titleId,...r,ref:t})});Pl.displayName=es;var Al="DialogDescription",_l=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=He(Al,n);return l.jsx(ve.p,{id:o.descriptionId,...r,ref:t})});_l.displayName=Al;var Fl="DialogClose",Ol=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=He(Fl,n);return l.jsx(ve.button,{type:"button",...r,ref:t,onClick:me(e.onClick,()=>o.onOpenChange(!1))})});Ol.displayName=Fl;function ts(e){return e?"open":"closed"}var Dl="DialogTitleWarning",[Vx,Ml]=Dg(Dl,{contentName:It,titleName:es,docsSlug:"dialog"}),lm=({titleId:e})=>{const t=Ml(Dl),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
132
+ `)},Gh=0,nn=[];function qh(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(Gh++)[0],s=d.useState(il)[0],i=d.useRef(e);d.useEffect(function(){i.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=nl([e.lockRef.current],(e.shards||[]).map(pl),!0).filter(Boolean);return h.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=d.useCallback(function(h,y){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!i.current.allowPinchZoom;var w=ur(h),x=n.current,S="deltaX"in h?h.deltaX:x[0]-w[0],E="deltaY"in h?h.deltaY:x[1]-w[1],C,P=h.target,_=Math.abs(S)>Math.abs(E)?"h":"v";if("touches"in h&&_==="h"&&P.type==="range")return!1;var O=cl(_,P);if(!O)return!0;if(O?C=_:(C=_==="v"?"h":"v",O=cl(_,P)),!O)return!1;if(!r.current&&"changedTouches"in h&&(S||E)&&(r.current=C),!C)return!0;var $=r.current||C;return Uh($,y,h,$==="h"?S:E,!0)},[]),u=d.useCallback(function(h){var y=h;if(!(!nn.length||nn[nn.length-1]!==s)){var w="deltaY"in y?fl(y):ur(y),x=t.current.filter(function(C){return C.name===y.type&&(C.target===y.target||y.target===C.shadowParent)&&jh(C.delta,w)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var S=(i.current.shards||[]).map(pl).filter(Boolean).filter(function(C){return C.contains(y.target)}),E=S.length>0?a(y,S[0]):!i.current.noIsolation;E&&y.cancelable&&y.preventDefault()}}},[]),c=d.useCallback(function(h,y,w,x){var S={name:h,delta:y,target:w,should:x,shadowParent:Kh(w)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(E){return E!==S})},1)},[]),f=d.useCallback(function(h){n.current=ur(h),r.current=void 0},[]),g=d.useCallback(function(h){c(h.type,fl(h),h.target,a(h,e.lockRef.current))},[]),m=d.useCallback(function(h){c(h.type,ur(h),h.target,a(h,e.lockRef.current))},[]);d.useEffect(function(){return nn.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:m}),document.addEventListener("wheel",u,tn),document.addEventListener("touchmove",u,tn),document.addEventListener("touchstart",f,tn),function(){nn=nn.filter(function(h){return h!==s}),document.removeEventListener("wheel",u,tn),document.removeEventListener("touchmove",u,tn),document.removeEventListener("touchstart",f,tn)}},[]);var p=e.removeScrollBar,v=e.inert;return d.createElement(d.Fragment,null,v?d.createElement(s,{styles:Wh(o)}):null,p?d.createElement(Ih,{gapMode:e.gapMode}):null)}function Kh(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Xh=Sh(sl,qh);var gl=d.forwardRef(function(e,t){return d.createElement(lr,Qe({},e,{ref:t,sideCar:Xh}))});gl.classNames=lr.classNames;var Jh=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},rn=new WeakMap,dr=new WeakMap,fr={},Yo=0,hl=function(e){return e&&(e.host||hl(e.parentNode))},Yh=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=hl(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Zh=function(e,t,n,r){var o=Yh(t,Array.isArray(e)?e:[e]);fr[n]||(fr[n]=new WeakMap);var s=fr[n],i=[],a=new Set,u=new Set(o),c=function(g){!g||a.has(g)||(a.add(g),c(g.parentNode))};o.forEach(c);var f=function(g){!g||u.has(g)||Array.prototype.forEach.call(g.children,function(m){if(a.has(m))f(m);else try{var p=m.getAttribute(r),v=p!==null&&p!=="false",h=(rn.get(m)||0)+1,y=(s.get(m)||0)+1;rn.set(m,h),s.set(m,y),i.push(m),h===1&&v&&dr.set(m,!0),y===1&&m.setAttribute(n,"true"),v||m.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",m,w)}})};return f(t),a.clear(),Yo++,function(){i.forEach(function(g){var m=rn.get(g)-1,p=s.get(g)-1;rn.set(g,m),s.set(g,p),m||(dr.has(g)||g.removeAttribute(r),dr.delete(g)),p||g.removeAttribute(n)}),Yo--,Yo||(rn=new WeakMap,rn=new WeakMap,dr=new WeakMap,fr={})}},Qh=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Jh(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Zh(r,o,n,"aria-hidden")):function(){return null}},ml=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(tm);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(Zo,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Zo,{...r,ref:t,children:n})});ml.displayName="Slot";var Zo=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=rm(n);return d.cloneElement(n,{...nm(r,n.props),ref:t?or(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Zo.displayName="SlotClone";var em=({children:e})=>l.jsx(l.Fragment,{children:e});function tm(e){return d.isValidElement(e)&&e.type===em}function nm(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function rm(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Qo="Dialog",[vl,Bx]=St(Qo),[om,We]=vl(Qo),yl=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=d.useRef(null),u=d.useRef(null),[c=!1,f]=Yt({prop:r,defaultProp:o,onChange:s});return l.jsx(om,{scope:t,triggerRef:a,contentRef:u,contentId:Qt(),titleId:Qt(),descriptionId:Qt(),open:c,onOpenChange:f,onOpenToggle:d.useCallback(()=>f(g=>!g),[f]),modal:i,children:n})};yl.displayName=Qo;var wl="DialogTrigger",bl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=We(wl,n),s=Le(t,o.triggerRef);return l.jsx(ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ns(o.open),...r,ref:s,onClick:me(e.onClick,o.onOpenToggle)})});bl.displayName=wl;var es="DialogPortal",[sm,xl]=vl(es,{forceMount:void 0}),Cl=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=We(es,t);return l.jsx(sm,{scope:t,forceMount:n,children:d.Children.map(r,i=>l.jsx(Zt,{present:n||s.open,children:l.jsx(Wo,{asChild:!0,container:o,children:i})}))})};Cl.displayName=es;var pr="DialogOverlay",Sl=d.forwardRef((e,t)=>{const n=xl(pr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=We(pr,e.__scopeDialog);return s.modal?l.jsx(Zt,{present:r||s.open,children:l.jsx(im,{...o,ref:t})}):null});Sl.displayName=pr;var im=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=We(pr,n);return l.jsx(gl,{as:ml,allowPinchZoom:!0,shards:[o.contentRef],children:l.jsx(ve.div,{"data-state":ns(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Bt="DialogContent",El=d.forwardRef((e,t)=>{const n=xl(Bt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=We(Bt,e.__scopeDialog);return l.jsx(Zt,{present:r||s.open,children:s.modal?l.jsx(am,{...o,ref:t}):l.jsx(lm,{...o,ref:t})})});El.displayName=Bt;var am=d.forwardRef((e,t)=>{const n=We(Bt,e.__scopeDialog),r=d.useRef(null),o=Le(t,n.contentRef,r);return d.useEffect(()=>{const s=r.current;if(s)return Qh(s)},[]),l.jsx(Nl,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:me(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:me(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:me(e.onFocusOutside,s=>s.preventDefault())})}),lm=d.forwardRef((e,t)=>{const n=We(Bt,e.__scopeDialog),r=d.useRef(!1),o=d.useRef(!1);return l.jsx(Nl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var u,c;(u=e.onInteractOutside)==null||u.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((c=n.triggerRef.current)==null?void 0:c.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Nl=d.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=We(Bt,n),u=d.useRef(null),c=Le(t,u);return gh(),l.jsxs(l.Fragment,{children:[l.jsx(Ka,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(Ho,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ns(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(cm,{titleId:a.titleId}),l.jsx(dm,{contentRef:u,descriptionId:a.descriptionId})]})]})}),ts="DialogTitle",Tl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=We(ts,n);return l.jsx(ve.h2,{id:o.titleId,...r,ref:t})});Tl.displayName=ts;var Pl="DialogDescription",Al=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=We(Pl,n);return l.jsx(ve.p,{id:o.descriptionId,...r,ref:t})});Al.displayName=Pl;var _l="DialogClose",Fl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=We(_l,n);return l.jsx(ve.button,{type:"button",...r,ref:t,onClick:me(e.onClick,()=>o.onOpenChange(!1))})});Fl.displayName=_l;function ns(e){return e?"open":"closed"}var Ol="DialogTitleWarning",[zx,Dl]=Mg(Ol,{contentName:Bt,titleName:ts,docsSlug:"dialog"}),cm=({titleId:e})=>{const t=Dl(Ol),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
128
133
 
129
134
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
130
135
 
131
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return d.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},cm="DialogDescriptionWarning",um=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ml(cm).contentName}}.`;return d.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},dm=wl,fm=xl,pm=Sl,$l=El,kl=Nl,Il=Pl,Rl=_l,gm=Ol;const nn=dm,gr=fm,hm=pm,Ll=d.forwardRef(({className:e,...t},n)=>l.jsx($l,{ref:n,className:Z("s3-explr-ui-dialog-overlay fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Ll.displayName=$l.displayName;const Rt=d.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(hm,{children:[l.jsx(Ll,{}),l.jsxs(kl,{ref:r,className:Z("s3-explr-ui-dialog-content fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,l.jsxs(gm,{className:Z("s3-explr-ui-dialog-close absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"),children:[l.jsx(ma,{className:"s3-explr-ui-dialog-close-icon h-4 w-4"}),l.jsx("span",{className:"s3-explr-ui-dialog-close-text sr-only",children:"Close"})]})]})]}));Rt.displayName=kl.displayName;const Lt=({className:e,...t})=>l.jsx("div",{className:Z("s3-explr-ui-dialog-header flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Lt.displayName="DialogHeader";const En=({className:e,...t})=>l.jsx("div",{className:Z("s3-explr-ui-dialog-footer flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});En.displayName="DialogFooter";const Vt=d.forwardRef(({className:e,...t},n)=>l.jsx(Il,{ref:n,className:Z("s3-explr-ui-dialog-title text-lg font-semibold leading-none tracking-tight",e),...t}));Vt.displayName=Il.displayName;const hr=d.forwardRef(({className:e,...t},n)=>l.jsx(Rl,{ref:n,className:Z("s3-explr-ui-dialog-description text-sm text-muted-foreground",e),...t}));hr.displayName=Rl.displayName;const Nt=d.forwardRef(({className:e,type:t,...n},r)=>l.jsx("input",{type:t,className:Z("s3-explr-ui-input","flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Nt.displayName="Input";var mm="Label",Vl=d.forwardRef((e,t)=>l.jsx(ve.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Vl.displayName=mm;var Bl=Vl;const vm=Io("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 s3-explr-ui-label",{variants:{variant:{default:"s3-explr-ui-label-default",required:"s3-explr-ui-label-required",disabled:"s3-explr-ui-label-disabled"},size:{default:"s3-explr-ui-label-size-default",sm:"s3-explr-ui-label-size-sm",lg:"s3-explr-ui-label-size-lg"}},defaultVariants:{variant:"default",size:"default"}}),Bt=d.forwardRef(({className:e,variant:t,size:n,...r},o)=>l.jsx(Bl,{ref:o,className:Z(vm({variant:t,size:n}),e),...r}));Bt.displayName=Bl.displayName;const mr=d.forwardRef(({className:e,...t},n)=>l.jsx("div",{className:Z("relative w-full overflow-auto","s3-explr-ui-table-container"),children:l.jsx("table",{ref:n,className:Z("w-full caption-bottom text-sm","s3-explr-ui-table",e),...t})}));mr.displayName="Table";const vr=d.forwardRef(({className:e,...t},n)=>l.jsx("thead",{ref:n,className:Z("[&_tr]:border-b","s3-explr-ui-table-header",e),...t}));vr.displayName="TableHeader";const yr=d.forwardRef(({className:e,...t},n)=>l.jsx("tbody",{ref:n,className:Z("[&_tr:last-child]:border-0","s3-explr-ui-table-body",e),...t}));yr.displayName="TableBody";const ym=d.forwardRef(({className:e,...t},n)=>l.jsx("tfoot",{ref:n,className:Z("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0","s3-explr-ui-table-footer",e),...t}));ym.displayName="TableFooter";const ze=d.forwardRef(({className:e,...t},n)=>l.jsx("tr",{ref:n,className:Z("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted","s3-explr-ui-table-row",e),...t}));ze.displayName="TableRow";const Xe=d.forwardRef(({className:e,...t},n)=>l.jsx("th",{ref:n,className:Z("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-head",e),...t}));Xe.displayName="TableHead";const Te=d.forwardRef(({className:e,...t},n)=>l.jsx("td",{ref:n,className:Z("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-cell",e),...t}));Te.displayName="TableCell";const wm=d.forwardRef(({className:e,...t},n)=>l.jsx("caption",{ref:n,className:Z("mt-4 text-sm text-muted-foreground","s3-explr-ui-table-caption",e),...t}));wm.displayName="TableCaption";function ns(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function rn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Hl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function rs(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Hl(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Hl(e[o],null)}}}}function os(...e){return d.useCallback(rs(...e),e)}var ss=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(xm);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(is,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(is,{...r,ref:t,children:n})});ss.displayName="Slot";var is=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Sm(n);return d.cloneElement(n,{...Cm(r,n.props),ref:t?rs(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});is.displayName="SlotClone";var bm=({children:e})=>l.jsx(l.Fragment,{children:e});function xm(e){return d.isValidElement(e)&&e.type===bm}function Cm(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Sm(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Em(e){const t=e+"CollectionProvider",[n,r]=Ct(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:h}=p,y=O.useRef(null),w=O.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:h})};i.displayName=t;const a=e+"CollectionSlot",u=O.forwardRef((p,v)=>{const{scope:h,children:y}=p,w=s(a,h),x=os(v,w.collectionRef);return l.jsx(ss,{ref:x,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",g=O.forwardRef((p,v)=>{const{scope:h,children:y,...w}=p,x=O.useRef(null),E=os(v,x),T=s(c,h);return O.useEffect(()=>(T.itemMap.set(x,{ref:x,...w}),()=>void T.itemMap.delete(x))),l.jsx(ss,{[f]:"",ref:E,children:y})});g.displayName=c;function m(p){const v=s(e+"CollectionConsumer",p);return O.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((T,C)=>w.indexOf(T.ref.current)-w.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:g},m,r]}var zl=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Tm);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(as,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(as,{...r,ref:t,children:n})});zl.displayName="Slot";var as=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Am(n);return d.cloneElement(n,{...Pm(r,n.props),ref:t?rs(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});as.displayName="SlotClone";var Nm=({children:e})=>l.jsx(l.Fragment,{children:e});function Tm(e){return d.isValidElement(e)&&e.type===Nm}function Pm(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Am(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _m=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ul=_m.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?zl:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Fm=d.createContext(void 0);function jl(e){const t=d.useContext(Fm);return e||t||"ltr"}var ls="rovingFocusGroup.onEntryFocus",Om={bubbles:!1,cancelable:!0},wr="RovingFocusGroup",[cs,Wl,Dm]=Em(wr),[Mm,Gl]=Ct(wr,[Dm]),[$m,km]=Mm(wr),ql=d.forwardRef((e,t)=>l.jsx(cs.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(cs.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Im,{...e,ref:t})})}));ql.displayName=wr;var Im=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:f=!1,...g}=e,m=d.useRef(null),p=os(t,m),v=jl(s),[h=null,y]=Xt({prop:i,defaultProp:a,onChange:u}),[w,x]=d.useState(!1),E=Se(c),T=Wl(n),C=d.useRef(!1),[N,S]=d.useState(0);return d.useEffect(()=>{const A=m.current;if(A)return A.addEventListener(ls,E),()=>A.removeEventListener(ls,E)},[E]),l.jsx($m,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:h,onItemFocus:d.useCallback(A=>y(A),[y]),onItemShiftTab:d.useCallback(()=>x(!0),[]),onFocusableItemAdd:d.useCallback(()=>S(A=>A+1),[]),onFocusableItemRemove:d.useCallback(()=>S(A=>A-1),[]),children:l.jsx(Ul.div,{tabIndex:w||N===0?-1:0,"data-orientation":r,...g,ref:p,style:{outline:"none",...e.style},onMouseDown:rn(e.onMouseDown,()=>{C.current=!0}),onFocus:rn(e.onFocus,A=>{const B=!C.current;if(A.target===A.currentTarget&&B&&!w){const H=new CustomEvent(ls,Om);if(A.currentTarget.dispatchEvent(H),!H.defaultPrevented){const K=T().filter(j=>j.focusable),$=K.find(j=>j.active),R=K.find(j=>j.id===h),G=[$,R,...K].filter(Boolean).map(j=>j.ref.current);Jl(G,f)}}C.current=!1}),onBlur:rn(e.onBlur,()=>x(!1))})})}),Kl="RovingFocusGroupItem",Xl=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...i}=e,a=Yt(),u=s||a,c=km(Kl,n),f=c.currentTabStopId===u,g=Wl(n),{onFocusableItemAdd:m,onFocusableItemRemove:p}=c;return d.useEffect(()=>{if(r)return m(),()=>p()},[r,m,p]),l.jsx(cs.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:l.jsx(Ul.span,{tabIndex:f?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:rn(e.onMouseDown,v=>{r?c.onItemFocus(u):v.preventDefault()}),onFocus:rn(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:rn(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const h=Vm(v,c.orientation,c.dir);if(h!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let w=g().filter(x=>x.focusable).map(x=>x.ref.current);if(h==="last")w.reverse();else if(h==="prev"||h==="next"){h==="prev"&&w.reverse();const x=w.indexOf(v.currentTarget);w=c.loop?Bm(w,x+1):w.slice(x+1)}setTimeout(()=>Jl(w))}})})})});Xl.displayName=Kl;var Rm={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Lm(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Vm(e,t,n){const r=Lm(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Rm[r]}function Jl(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Bm(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Hm=ql,zm=Xl;function Yl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Um(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Yl(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Yl(e[o],null)}}}}function jm(...e){return d.useCallback(Um(...e),e)}function Wm(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var Zl=e=>{const{present:t,children:n}=e,r=Gm(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=jm(r.ref,qm(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};Zl.displayName="Presence";function Gm(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=Wm(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=br(r.current);s.current=a==="mounted"?c:"none"},[a]),De(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,p=br(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&m!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),De(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const h=br(r.current).includes(p.animationName);if(p.target===t&&h&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},m=p=>{p.target===t&&(s.current=br(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function br(e){return(e==null?void 0:e.animationName)||"none"}function qm(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Ql(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Km(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Ql(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Ql(e[o],null)}}}}var ec=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Jm);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(us,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(us,{...r,ref:t,children:n})});ec.displayName="Slot";var us=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Zm(n);return d.cloneElement(n,{...Ym(r,n.props),ref:t?Km(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});us.displayName="SlotClone";var Xm=({children:e})=>l.jsx(l.Fragment,{children:e});function Jm(e){return d.isValidElement(e)&&e.type===Xm}function Ym(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Zm(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Qm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],xr=Qm.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?ec:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),ds="Tabs",[ev,Bx]=Ct(ds,[Gl]),tc=Gl(),[tv,fs]=ev(ds),nc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:u="automatic",...c}=e,f=jl(a),[g,m]=Xt({prop:r,onChange:o,defaultProp:s});return l.jsx(tv,{scope:n,baseId:Yt(),value:g,onValueChange:m,orientation:i,dir:f,activationMode:u,children:l.jsx(xr.div,{dir:f,"data-orientation":i,...c,ref:t})})});nc.displayName=ds;var rc="TabsList",oc=d.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=fs(rc,n),i=tc(n);return l.jsx(Hm,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:l.jsx(xr.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});oc.displayName=rc;var sc="TabsTrigger",ic=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=fs(sc,n),a=tc(n),u=cc(i.baseId,r),c=uc(i.baseId,r),f=r===i.value;return l.jsx(zm,{asChild:!0,...a,focusable:!o,active:f,children:l.jsx(xr.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":c,"data-state":f?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...s,ref:t,onMouseDown:ns(e.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?i.onValueChange(r):g.preventDefault()}),onKeyDown:ns(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&i.onValueChange(r)}),onFocus:ns(e.onFocus,()=>{const g=i.activationMode!=="manual";!f&&!o&&g&&i.onValueChange(r)})})})});ic.displayName=sc;var ac="TabsContent",lc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=fs(ac,n),u=cc(a.baseId,r),c=uc(a.baseId,r),f=r===a.value,g=d.useRef(f);return d.useEffect(()=>{const m=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(m)},[]),l.jsx(Zl,{present:o||f,children:({present:m})=>l.jsx(xr.div,{"data-state":f?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":u,hidden:!m,id:c,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:m&&s})})});lc.displayName=ac;function cc(e,t){return`${e}-trigger-${t}`}function uc(e,t){return`${e}-content-${t}`}var nv=nc,dc=oc,fc=ic,pc=lc;const rv=nv,gc=d.forwardRef(({className:e,...t},n)=>l.jsx(dc,{ref:n,className:Z("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));gc.displayName=dc.displayName;const ps=d.forwardRef(({className:e,...t},n)=>l.jsx(fc,{ref:n,className:Z("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));ps.displayName=fc.displayName;const gs=d.forwardRef(({className:e,...t},n)=>l.jsx(pc,{ref:n,className:Z("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));gs.displayName=pc.displayName;const Cr=d.forwardRef(({className:e,...t},n)=>l.jsx("textarea",{className:Z("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));Cr.displayName="Textarea";function ov(e,t=[]){let n=[];function r(s,i){const a=d.createContext(i),u=n.length;n=[...n,i];function c(g){const{scope:m,children:p,...v}=g,h=(m==null?void 0:m[e][u])||a,y=d.useMemo(()=>v,Object.values(v));return l.jsx(h.Provider,{value:y,children:p})}function f(g,m){const p=(m==null?void 0:m[e][u])||a,v=d.useContext(p);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${g}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,f]}const o=()=>{const s=n.map(i=>d.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return d.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return o.scopeName=e,[r,sv(o,...t)]}function sv(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:u,scopeName:c})=>{const g=u(s)[`__scope${c}`];return{...a,...g}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var hs=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(av);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(ms,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(ms,{...r,ref:t,children:n})});hs.displayName="Slot";var ms=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=cv(n);return d.cloneElement(n,{...lv(r,n.props),ref:t?or(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});ms.displayName="SlotClone";var iv=({children:e})=>l.jsx(l.Fragment,{children:e});function av(e){return d.isValidElement(e)&&e.type===iv}function lv(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function cv(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function uv(e){const t=e+"CollectionProvider",[n,r]=ov(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:h}=p,y=O.useRef(null),w=O.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:h})};i.displayName=t;const a=e+"CollectionSlot",u=O.forwardRef((p,v)=>{const{scope:h,children:y}=p,w=s(a,h),x=ke(v,w.collectionRef);return l.jsx(hs,{ref:x,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",g=O.forwardRef((p,v)=>{const{scope:h,children:y,...w}=p,x=O.useRef(null),E=ke(v,x),T=s(c,h);return O.useEffect(()=>(T.itemMap.set(x,{ref:x,...w}),()=>void T.itemMap.delete(x))),l.jsx(hs,{[f]:"",ref:E,children:y})});g.displayName=c;function m(p){const v=s(e+"CollectionConsumer",p);return O.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((T,C)=>w.indexOf(T.ref.current)-w.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:g},m,r]}var dv="VisuallyHidden",vs=d.forwardRef((e,t)=>l.jsx(ve.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));vs.displayName=dv;var ys="ToastProvider",[ws,fv,pv]=uv("Toast"),[hc,Hx]=Ct("Toast",[pv]),[gv,Sr]=hc(ys),mc=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:s=50,children:i}=e,[a,u]=d.useState(null),[c,f]=d.useState(0),g=d.useRef(!1),m=d.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${ys}\`. Expected non-empty \`string\`.`),l.jsx(ws.Provider,{scope:t,children:l.jsx(gv,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:s,toastCount:c,viewport:a,onViewportChange:u,onToastAdd:d.useCallback(()=>f(p=>p+1),[]),onToastRemove:d.useCallback(()=>f(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:g,isClosePausedRef:m,children:i})})};mc.displayName=ys;var vc="ToastViewport",hv=["F8"],bs="toast.viewportPause",xs="toast.viewportResume",yc=d.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=hv,label:o="Notifications ({hotkey})",...s}=e,i=Sr(vc,n),a=fv(n),u=d.useRef(null),c=d.useRef(null),f=d.useRef(null),g=d.useRef(null),m=ke(t,g,i.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=i.toastCount>0;d.useEffect(()=>{const y=w=>{var E;r.length!==0&&r.every(T=>w[T]||w.code===T)&&((E=g.current)==null||E.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),d.useEffect(()=>{const y=u.current,w=g.current;if(v&&y&&w){const x=()=>{if(!i.isClosePausedRef.current){const N=new CustomEvent(bs);w.dispatchEvent(N),i.isClosePausedRef.current=!0}},E=()=>{if(i.isClosePausedRef.current){const N=new CustomEvent(xs);w.dispatchEvent(N),i.isClosePausedRef.current=!1}},T=N=>{!y.contains(N.relatedTarget)&&E()},C=()=>{y.contains(document.activeElement)||E()};return y.addEventListener("focusin",x),y.addEventListener("focusout",T),y.addEventListener("pointermove",x),y.addEventListener("pointerleave",C),window.addEventListener("blur",x),window.addEventListener("focus",E),()=>{y.removeEventListener("focusin",x),y.removeEventListener("focusout",T),y.removeEventListener("pointermove",x),y.removeEventListener("pointerleave",C),window.removeEventListener("blur",x),window.removeEventListener("focus",E)}}},[v,i.isClosePausedRef]);const h=d.useCallback(({tabbingDirection:y})=>{const x=a().map(E=>{const T=E.ref.current,C=[T,...Av(T)];return y==="forwards"?C:C.reverse()});return(y==="forwards"?x.reverse():x).flat()},[a]);return d.useEffect(()=>{const y=g.current;if(y){const w=x=>{var C,N,S;const E=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!E){const A=document.activeElement,B=x.shiftKey;if(x.target===y&&B){(C=c.current)==null||C.focus();return}const $=h({tabbingDirection:B?"backwards":"forwards"}),R=$.findIndex(D=>D===A);Es($.slice(R+1))?x.preventDefault():B?(N=c.current)==null||N.focus():(S=f.current)==null||S.focus()}};return y.addEventListener("keydown",w),()=>y.removeEventListener("keydown",w)}},[a,h]),l.jsxs(oh,{ref:u,role:"region","aria-label":o.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&l.jsx(Cs,{ref:c,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"forwards"});Es(y)}}),l.jsx(ws.Slot,{scope:n,children:l.jsx(ve.ol,{tabIndex:-1,...s,ref:m})}),v&&l.jsx(Cs,{ref:f,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"backwards"});Es(y)}})]})});yc.displayName=vc;var wc="ToastFocusProxy",Cs=d.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,s=Sr(wc,n);return l.jsx(vs,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:i=>{var c;const a=i.relatedTarget;!((c=s.viewport)!=null&&c.contains(a))&&r()}})});Cs.displayName=wc;var Er="Toast",mv="toast.swipeStart",vv="toast.swipeMove",yv="toast.swipeCancel",wv="toast.swipeEnd",bc=d.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:s,...i}=e,[a=!0,u]=Xt({prop:r,defaultProp:o,onChange:s});return l.jsx(Jt,{present:n||a,children:l.jsx(Cv,{open:a,...i,ref:t,onClose:()=>u(!1),onPause:Se(e.onPause),onResume:Se(e.onResume),onSwipeStart:me(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:me(e.onSwipeMove,c=>{const{x:f,y:g}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${g}px`)}),onSwipeCancel:me(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:me(e.onSwipeEnd,c=>{const{x:f,y:g}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${g}px`),u(!1)})})})});bc.displayName=Er;var[bv,xv]=hc(Er,{onClose(){}}),Cv=d.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:s,onClose:i,onEscapeKeyDown:a,onPause:u,onResume:c,onSwipeStart:f,onSwipeMove:g,onSwipeCancel:m,onSwipeEnd:p,...v}=e,h=Sr(Er,n),[y,w]=d.useState(null),x=ke(t,D=>w(D)),E=d.useRef(null),T=d.useRef(null),C=o||h.duration,N=d.useRef(0),S=d.useRef(C),A=d.useRef(0),{onToastAdd:B,onToastRemove:H}=h,K=Se(()=>{var G;(y==null?void 0:y.contains(document.activeElement))&&((G=h.viewport)==null||G.focus()),i()}),$=d.useCallback(D=>{!D||D===1/0||(window.clearTimeout(A.current),N.current=new Date().getTime(),A.current=window.setTimeout(K,D))},[K]);d.useEffect(()=>{const D=h.viewport;if(D){const G=()=>{$(S.current),c==null||c()},j=()=>{const X=new Date().getTime()-N.current;S.current=S.current-X,window.clearTimeout(A.current),u==null||u()};return D.addEventListener(bs,j),D.addEventListener(xs,G),()=>{D.removeEventListener(bs,j),D.removeEventListener(xs,G)}}},[h.viewport,C,u,c,$]),d.useEffect(()=>{s&&!h.isClosePausedRef.current&&$(C)},[s,C,h.isClosePausedRef,$]),d.useEffect(()=>(B(),()=>H()),[B,H]);const R=d.useMemo(()=>y?Pc(y):null,[y]);return h.viewport?l.jsxs(l.Fragment,{children:[R&&l.jsx(Sv,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:R}),l.jsx(bv,{scope:n,onClose:K,children:Hn.createPortal(l.jsx(ws.ItemSlot,{scope:n,children:l.jsx(rh,{asChild:!0,onEscapeKeyDown:me(a,()=>{h.isFocusedToastEscapeKeyDownRef.current||K(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(ve.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":h.swipeDirection,...v,ref:x,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:me(e.onKeyDown,D=>{D.key==="Escape"&&(a==null||a(D.nativeEvent),D.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,K()))}),onPointerDown:me(e.onPointerDown,D=>{D.button===0&&(E.current={x:D.clientX,y:D.clientY})}),onPointerMove:me(e.onPointerMove,D=>{if(!E.current)return;const G=D.clientX-E.current.x,j=D.clientY-E.current.y,X=!!T.current,q=["left","right"].includes(h.swipeDirection),ne=["left","up"].includes(h.swipeDirection)?Math.min:Math.max,ae=q?ne(0,G):0,se=q?0:ne(0,j),Ce=D.pointerType==="touch"?10:2,Ae={x:ae,y:se},nt={originalEvent:D,delta:Ae};X?(T.current=Ae,Nr(vv,g,nt,{discrete:!1})):Ac(Ae,h.swipeDirection,Ce)?(T.current=Ae,Nr(mv,f,nt,{discrete:!1}),D.target.setPointerCapture(D.pointerId)):(Math.abs(G)>Ce||Math.abs(j)>Ce)&&(E.current=null)}),onPointerUp:me(e.onPointerUp,D=>{const G=T.current,j=D.target;if(j.hasPointerCapture(D.pointerId)&&j.releasePointerCapture(D.pointerId),T.current=null,E.current=null,G){const X=D.currentTarget,q={originalEvent:D,delta:G};Ac(G,h.swipeDirection,h.swipeThreshold)?Nr(wv,p,q,{discrete:!0}):Nr(yv,m,q,{discrete:!0}),X.addEventListener("click",ne=>ne.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),Sv=e=>{const{__scopeToast:t,children:n,...r}=e,o=Sr(Er,t),[s,i]=d.useState(!1),[a,u]=d.useState(!1);return Tv(()=>i(!0)),d.useEffect(()=>{const c=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:l.jsx(jo,{asChild:!0,children:l.jsx(vs,{...r,children:s&&l.jsxs(l.Fragment,{children:[o.label," ",n]})})})},Ev="ToastTitle",xc=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(ve.div,{...r,ref:t})});xc.displayName=Ev;var Nv="ToastDescription",Cc=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(ve.div,{...r,ref:t})});Cc.displayName=Nv;var Sc="ToastAction",Ec=d.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?l.jsx(Tc,{altText:n,asChild:!0,children:l.jsx(Ss,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Sc}\`. Expected non-empty \`string\`.`),null)});Ec.displayName=Sc;var Nc="ToastClose",Ss=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=xv(Nc,n);return l.jsx(Tc,{asChild:!0,children:l.jsx(ve.button,{type:"button",...r,ref:t,onClick:me(e.onClick,o.onClose)})})});Ss.displayName=Nc;var Tc=d.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return l.jsx(ve.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function Pc(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),Pv(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!o)if(s){const i=r.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...Pc(r))}}),t}function Nr(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Ia(o,s):o.dispatchEvent(s)}var Ac=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),s=r>o;return t==="left"||t==="right"?s&&r>n:!s&&o>n};function Tv(e=()=>{}){const t=Se(e);De(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function Pv(e){return e.nodeType===e.ELEMENT_NODE}function Av(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Es(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var _v=mc,_c=yc,Fc=bc,Oc=xc,Dc=Cc,Mc=Ec,$c=Ss;const Fv=_v,kc=d.forwardRef(({className:e,...t},n)=>l.jsx(_c,{ref:n,className:Z("s3-explr-ui-toast-viewport fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));kc.displayName=_c.displayName;const Ov=Io("s3-explr-ui-toast group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"s3-explr-ui-toast-default border bg-background text-foreground",destructive:"s3-explr-ui-toast-destructive destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Ic=d.forwardRef(({className:e,variant:t,...n},r)=>l.jsx(Fc,{ref:r,className:Z(Ov({variant:t}),e),...n}));Ic.displayName=Fc.displayName;const Dv=d.forwardRef(({className:e,...t},n)=>l.jsx(Mc,{ref:n,className:Z("s3-explr-ui-toast-action inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Dv.displayName=Mc.displayName;const Rc=d.forwardRef(({className:e,...t},n)=>l.jsx($c,{ref:n,className:Z("s3-explr-ui-toast-close absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:l.jsx(ma,{className:"s3-explr-ui-toast-close-icon h-4 w-4"})}));Rc.displayName=$c.displayName;const Lc=d.forwardRef(({className:e,...t},n)=>l.jsx(Oc,{ref:n,className:Z("s3-explr-ui-toast-title text-sm font-semibold [&+div]:text-xs",e),...t}));Lc.displayName=Oc.displayName;const Vc=d.forwardRef(({className:e,...t},n)=>l.jsx(Dc,{ref:n,className:Z("s3-explr-ui-toast-description text-sm opacity-90",e),...t}));Vc.displayName=Dc.displayName;const Mv=1,$v=1e6;let Ns=0;function kv(){return Ns=(Ns+1)%Number.MAX_SAFE_INTEGER,Ns.toString()}const Ts=new Map,Bc=e=>{if(Ts.has(e))return;const t=setTimeout(()=>{Ts.delete(e),Nn({type:"REMOVE_TOAST",toastId:e})},$v);Ts.set(e,t)},Iv=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Mv)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?Bc(n):e.toasts.forEach(r=>{Bc(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Tr=[];let Pr={toasts:[]};function Nn(e){Pr=Iv(Pr,e),Tr.forEach(t=>{t(Pr)})}function Rv({...e}){const t=kv(),n=o=>Nn({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>Nn({type:"DISMISS_TOAST",toastId:t});return Nn({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function Ps(){const[e,t]=d.useState(Pr);return d.useEffect(()=>(Tr.push(t),()=>{const n=Tr.indexOf(t);n>-1&&Tr.splice(n,1)}),[e]),{...e,toast:Rv,dismiss:n=>Nn({type:"DISMISS_TOAST",toastId:n})}}function Hc(){const{toasts:e}=Ps();return l.jsxs(Fv,{children:[e.map(function({id:t,title:n,description:r,action:o,...s}){return l.jsxs(Ic,{...s,className:`s3-explr-ui-toast ${s.className||""}`,children:[l.jsxs("div",{className:"s3-explr-ui-toast-content grid gap-1",children:[n&&l.jsx(Lc,{className:"s3-explr-ui-toast-title",children:n}),r&&l.jsx(Vc,{className:"s3-explr-ui-toast-description",children:r})]}),o&&l.jsx("div",{className:"s3-explr-ui-toast-action",children:o}),l.jsx(Rc,{className:"s3-explr-ui-toast-close"})]},t)}),l.jsx(kc,{className:"s3-explr-ui-toast-viewport"})]})}function it(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function zc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Lv(...e){return t=>{let n=!1;const r=e.map(o=>{const s=zc(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():zc(e[o],null)}}}}function Tn(...e){return d.useCallback(Lv(...e),e)}var Vv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Pn=Vv.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Gt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Bv(e,t){e&&Hn.flushSync(()=>e.dispatchEvent(t))}var Hv="DismissableLayer",As="dismissableLayer.update",zv="dismissableLayer.pointerDownOutside",Uv="dismissableLayer.focusOutside",Uc,jc=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wc=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,c=d.useContext(jc),[f,g]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=d.useState({}),v=Tn(t,S=>g(S)),h=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=h.indexOf(y),x=f?h.indexOf(f):-1,E=c.layersWithOutsidePointerEventsDisabled.size>0,T=x>=w,C=Gv(S=>{const A=S.target,B=[...c.branches].some(H=>H.contains(A));!T||B||(o==null||o(S),i==null||i(S),S.defaultPrevented||a==null||a())},m),N=qv(S=>{const A=S.target;[...c.branches].some(H=>H.contains(A))||(s==null||s(S),i==null||i(S),S.defaultPrevented||a==null||a())},m);return za(S=>{x===c.layers.size-1&&(r==null||r(S),!S.defaultPrevented&&a&&(S.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Uc=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),Gc(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Uc)}},[f,m,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),Gc())},[f,c]),d.useEffect(()=>{const S=()=>p({});return document.addEventListener(As,S),()=>document.removeEventListener(As,S)},[]),l.jsx(Pn.div,{...u,ref:v,style:{pointerEvents:E?T?"auto":"none":void 0,...e.style},onFocusCapture:it(e.onFocusCapture,N.onFocusCapture),onBlurCapture:it(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:it(e.onPointerDownCapture,C.onPointerDownCapture)})});Wc.displayName=Hv;var jv="DismissableLayerBranch",Wv=d.forwardRef((e,t)=>{const n=d.useContext(jc),r=d.useRef(null),o=Tn(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(Pn.div,{...e,ref:o})});Wv.displayName=jv;function Gv(e,t=globalThis==null?void 0:globalThis.document){const n=Se(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){qc(zv,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function qv(e,t=globalThis==null?void 0:globalThis.document){const n=Se(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&qc(Uv,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Gc(){const e=new CustomEvent(As);document.dispatchEvent(e)}function qc(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Bv(o,s):o.dispatchEvent(s)}const Kv=["top","right","bottom","left"],Tt=Math.min,Me=Math.max,Ar=Math.round,_r=Math.floor,Je=e=>({x:e,y:e}),Xv={left:"right",right:"left",bottom:"top",top:"bottom"},Jv={start:"end",end:"start"};function _s(e,t,n){return Me(e,Tt(t,n))}function at(e,t){return typeof e=="function"?e(t):e}function lt(e){return e.split("-")[0]}function on(e){return e.split("-")[1]}function Fs(e){return e==="x"?"y":"x"}function Os(e){return e==="y"?"height":"width"}function Pt(e){return["top","bottom"].includes(lt(e))?"y":"x"}function Ds(e){return Fs(Pt(e))}function Yv(e,t,n){n===void 0&&(n=!1);const r=on(e),o=Ds(e),s=Os(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Fr(i)),[i,Fr(i)]}function Zv(e){const t=Fr(e);return[Ms(e),t,Ms(t)]}function Ms(e){return e.replace(/start|end/g,t=>Jv[t])}function Qv(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function ey(e,t,n,r){const o=on(e);let s=Qv(lt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Ms)))),s}function Fr(e){return e.replace(/left|right|bottom|top/g,t=>Xv[t])}function ty(e){return{top:0,right:0,bottom:0,left:0,...e}}function Kc(e){return typeof e!="number"?ty(e):{top:e,right:e,bottom:e,left:e}}function Or(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Xc(e,t,n){let{reference:r,floating:o}=e;const s=Pt(t),i=Ds(t),a=Os(i),u=lt(t),c=s==="y",f=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let p;switch(u){case"top":p={x:f,y:r.y-o.height};break;case"bottom":p={x:f,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:g};break;case"left":p={x:r.x-o.width,y:g};break;default:p={x:r.x,y:r.y}}switch(on(t)){case"start":p[i]-=m*(n&&c?-1:1);break;case"end":p[i]+=m*(n&&c?-1:1);break}return p}const ny=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:g}=Xc(c,r,u),m=r,p={},v=0;for(let h=0;h<a.length;h++){const{name:y,fn:w}=a[h],{x,y:E,data:T,reset:C}=await w({x:f,y:g,initialPlacement:r,placement:m,strategy:o,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});f=x??f,g=E??g,p={...p,[y]:{...p[y],...T}},C&&v<=50&&(v++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(c=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:f,y:g}=Xc(c,m,u)),h=-1)}return{x:f,y:g,placement:m,strategy:o,middlewareData:p}};async function An(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:g="floating",altBoundary:m=!1,padding:p=0}=at(t,e),v=Kc(p),y=a[m?g==="floating"?"reference":"floating":g],w=Or(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:u})),x=g==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),T=await(s.isElement==null?void 0:s.isElement(E))?await(s.getScale==null?void 0:s.getScale(E))||{x:1,y:1}:{x:1,y:1},C=Or(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:E,strategy:u}):x);return{top:(w.top-C.top+v.top)/T.y,bottom:(C.bottom-w.bottom+v.bottom)/T.y,left:(w.left-C.left+v.left)/T.x,right:(C.right-w.right+v.right)/T.x}}const ry=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:u}=t,{element:c,padding:f=0}=at(e,t)||{};if(c==null)return{};const g=Kc(f),m={x:n,y:r},p=Ds(o),v=Os(p),h=await i.getDimensions(c),y=p==="y",w=y?"top":"left",x=y?"bottom":"right",E=y?"clientHeight":"clientWidth",T=s.reference[v]+s.reference[p]-m[p]-s.floating[v],C=m[p]-s.reference[p],N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let S=N?N[E]:0;(!S||!await(i.isElement==null?void 0:i.isElement(N)))&&(S=a.floating[E]||s.floating[v]);const A=T/2-C/2,B=S/2-h[v]/2-1,H=Tt(g[w],B),K=Tt(g[x],B),$=H,R=S-h[v]-K,D=S/2-h[v]/2+A,G=_s($,D,R),j=!u.arrow&&on(o)!=null&&D!==G&&s.reference[v]/2-(D<$?H:K)-h[v]/2<0,X=j?D<$?D-$:D-R:0;return{[p]:m[p]+X,data:{[p]:G,centerOffset:D-G-X,...j&&{alignmentOffset:X}},reset:j}}}),oy=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:u,elements:c}=t,{mainAxis:f=!0,crossAxis:g=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:h=!0,...y}=at(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=lt(o),x=Pt(a),E=lt(a)===a,T=await(u.isRTL==null?void 0:u.isRTL(c.floating)),C=m||(E||!h?[Fr(a)]:Zv(a)),N=v!=="none";!m&&N&&C.push(...ey(a,h,v,T));const S=[a,...C],A=await An(t,y),B=[];let H=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&B.push(A[w]),g){const D=Yv(o,i,T);B.push(A[D[0]],A[D[1]])}if(H=[...H,{placement:o,overflows:B}],!B.every(D=>D<=0)){var K,$;const D=(((K=s.flip)==null?void 0:K.index)||0)+1,G=S[D];if(G)return{data:{index:D,overflows:H},reset:{placement:G}};let j=($=H.filter(X=>X.overflows[0]<=0).sort((X,q)=>X.overflows[1]-q.overflows[1])[0])==null?void 0:$.placement;if(!j)switch(p){case"bestFit":{var R;const X=(R=H.filter(q=>{if(N){const ne=Pt(q.placement);return ne===x||ne==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(ne=>ne>0).reduce((ne,ae)=>ne+ae,0)]).sort((q,ne)=>q[1]-ne[1])[0])==null?void 0:R[0];X&&(j=X);break}case"initialPlacement":j=a;break}if(o!==j)return{reset:{placement:j}}}return{}}}};function Jc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Yc(e){return Kv.some(t=>e[t]>=0)}const sy=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=at(e,t);switch(r){case"referenceHidden":{const s=await An(t,{...o,elementContext:"reference"}),i=Jc(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Yc(i)}}}case"escaped":{const s=await An(t,{...o,altBoundary:!0}),i=Jc(s,n.floating);return{data:{escapedOffsets:i,escaped:Yc(i)}}}default:return{}}}}};async function iy(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=lt(n),a=on(n),u=Pt(n)==="y",c=["left","top"].includes(i)?-1:1,f=s&&u?-1:1,g=at(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:v}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return a&&typeof v=="number"&&(p=a==="end"?v*-1:v),u?{x:p*f,y:m*c}:{x:m*c,y:p*f}}const ay=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,u=await iy(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:i}}}}},ly=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:y=>{let{x:w,y:x}=y;return{x:w,y:x}}},...u}=at(e,t),c={x:n,y:r},f=await An(t,u),g=Pt(lt(o)),m=Fs(g);let p=c[m],v=c[g];if(s){const y=m==="y"?"top":"left",w=m==="y"?"bottom":"right",x=p+f[y],E=p-f[w];p=_s(x,p,E)}if(i){const y=g==="y"?"top":"left",w=g==="y"?"bottom":"right",x=v+f[y],E=v-f[w];v=_s(x,v,E)}const h=a.fn({...t,[m]:p,[g]:v});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[m]:s,[g]:i}}}}}},cy=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:u=!0,crossAxis:c=!0}=at(e,t),f={x:n,y:r},g=Pt(o),m=Fs(g);let p=f[m],v=f[g];const h=at(a,t),y=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){const E=m==="y"?"height":"width",T=s.reference[m]-s.floating[E]+y.mainAxis,C=s.reference[m]+s.reference[E]-y.mainAxis;p<T?p=T:p>C&&(p=C)}if(c){var w,x;const E=m==="y"?"width":"height",T=["top","left"].includes(lt(o)),C=s.reference[g]-s.floating[E]+(T&&((w=i.offset)==null?void 0:w[g])||0)+(T?0:y.crossAxis),N=s.reference[g]+s.reference[E]+(T?0:((x=i.offset)==null?void 0:x[g])||0)-(T?y.crossAxis:0);v<C?v=C:v>N&&(v=N)}return{[m]:p,[g]:v}}}},uy=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:u=()=>{},...c}=at(e,t),f=await An(t,c),g=lt(o),m=on(o),p=Pt(o)==="y",{width:v,height:h}=s.floating;let y,w;g==="top"||g==="bottom"?(y=g,w=m===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(w=g,y=m==="end"?"top":"bottom");const x=h-f.top-f.bottom,E=v-f.left-f.right,T=Tt(h-f[y],x),C=Tt(v-f[w],E),N=!t.middlewareData.shift;let S=T,A=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=E),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(S=x),N&&!m){const H=Me(f.left,0),K=Me(f.right,0),$=Me(f.top,0),R=Me(f.bottom,0);p?A=v-2*(H!==0||K!==0?H+K:Me(f.left,f.right)):S=h-2*($!==0||R!==0?$+R:Me(f.top,f.bottom))}await u({...t,availableWidth:A,availableHeight:S});const B=await i.getDimensions(a.floating);return v!==B.width||h!==B.height?{reset:{rects:!0}}:{}}}};function Dr(){return typeof window<"u"}function sn(e){return Zc(e)?(e.nodeName||"").toLowerCase():"#document"}function $e(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ye(e){var t;return(t=(Zc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Zc(e){return Dr()?e instanceof Node||e instanceof $e(e).Node:!1}function Ue(e){return Dr()?e instanceof Element||e instanceof $e(e).Element:!1}function Ze(e){return Dr()?e instanceof HTMLElement||e instanceof $e(e).HTMLElement:!1}function Qc(e){return!Dr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof $e(e).ShadowRoot}function _n(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=je(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function dy(e){return["table","td","th"].includes(sn(e))}function Mr(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function $s(e){const t=ks(),n=Ue(e)?je(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 fy(e){let t=At(e);for(;Ze(t)&&!an(t);){if($s(t))return t;if(Mr(t))return null;t=At(t)}return null}function ks(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function an(e){return["html","body","#document"].includes(sn(e))}function je(e){return $e(e).getComputedStyle(e)}function $r(e){return Ue(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function At(e){if(sn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Qc(e)&&e.host||Ye(e);return Qc(t)?t.host:t}function eu(e){const t=At(e);return an(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ze(t)&&_n(t)?t:eu(t)}function Fn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=eu(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=$e(o);if(s){const a=Is(i);return t.concat(i,i.visualViewport||[],_n(o)?o:[],a&&n?Fn(a):[])}return t.concat(o,Fn(o,[],n))}function Is(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function tu(e){const t=je(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ze(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Ar(n)!==s||Ar(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Rs(e){return Ue(e)?e:e.contextElement}function ln(e){const t=Rs(e);if(!Ze(t))return Je(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=tu(t);let i=(s?Ar(n.width):n.width)/r,a=(s?Ar(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const py=Je(0);function nu(e){const t=$e(e);return!ks()||!t.visualViewport?py:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function gy(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==$e(e)?!1:t}function Ht(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Rs(e);let i=Je(1);t&&(r?Ue(r)&&(i=ln(r)):i=ln(e));const a=gy(s,n,r)?nu(s):Je(0);let u=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,f=o.width/i.x,g=o.height/i.y;if(s){const m=$e(s),p=r&&Ue(r)?$e(r):r;let v=m,h=Is(v);for(;h&&r&&p!==v;){const y=ln(h),w=h.getBoundingClientRect(),x=je(h),E=w.left+(h.clientLeft+parseFloat(x.paddingLeft))*y.x,T=w.top+(h.clientTop+parseFloat(x.paddingTop))*y.y;u*=y.x,c*=y.y,f*=y.x,g*=y.y,u+=E,c+=T,v=$e(h),h=Is(v)}}return Or({width:f,height:g,x:u,y:c})}function Ls(e,t){const n=$r(e).scrollLeft;return t?t.left+n:Ht(Ye(e)).left+n}function ru(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Ls(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function hy(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Ye(r),a=t?Mr(t.floating):!1;if(r===i||a&&s)return n;let u={scrollLeft:0,scrollTop:0},c=Je(1);const f=Je(0),g=Ze(r);if((g||!g&&!s)&&((sn(r)!=="body"||_n(i))&&(u=$r(r)),Ze(r))){const p=Ht(r);c=ln(r),f.x=p.x+r.clientLeft,f.y=p.y+r.clientTop}const m=i&&!g&&!s?ru(i,u,!0):Je(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+f.x+m.x,y:n.y*c.y-u.scrollTop*c.y+f.y+m.y}}function my(e){return Array.from(e.getClientRects())}function vy(e){const t=Ye(e),n=$r(e),r=e.ownerDocument.body,o=Me(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Me(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Ls(e);const a=-n.scrollTop;return je(r).direction==="rtl"&&(i+=Me(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function yy(e,t){const n=$e(e),r=Ye(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,u=0;if(o){s=o.width,i=o.height;const c=ks();(!c||c&&t==="fixed")&&(a=o.offsetLeft,u=o.offsetTop)}return{width:s,height:i,x:a,y:u}}function wy(e,t){const n=Ht(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Ze(e)?ln(e):Je(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,u=o*s.x,c=r*s.y;return{width:i,height:a,x:u,y:c}}function ou(e,t,n){let r;if(t==="viewport")r=yy(e,n);else if(t==="document")r=vy(Ye(e));else if(Ue(t))r=wy(t,n);else{const o=nu(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Or(r)}function su(e,t){const n=At(e);return n===t||!Ue(n)||an(n)?!1:je(n).position==="fixed"||su(n,t)}function by(e,t){const n=t.get(e);if(n)return n;let r=Fn(e,[],!1).filter(a=>Ue(a)&&sn(a)!=="body"),o=null;const s=je(e).position==="fixed";let i=s?At(e):e;for(;Ue(i)&&!an(i);){const a=je(i),u=$s(i);!u&&a.position==="fixed"&&(o=null),(s?!u&&!o:!u&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||_n(i)&&!u&&su(e,i))?r=r.filter(f=>f!==i):o=a,i=At(i)}return t.set(e,r),r}function xy(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Mr(t)?[]:by(t,this._c):[].concat(n),r],a=i[0],u=i.reduce((c,f)=>{const g=ou(t,f,o);return c.top=Me(g.top,c.top),c.right=Tt(g.right,c.right),c.bottom=Tt(g.bottom,c.bottom),c.left=Me(g.left,c.left),c},ou(t,a,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Cy(e){const{width:t,height:n}=tu(e);return{width:t,height:n}}function Sy(e,t,n){const r=Ze(t),o=Ye(t),s=n==="fixed",i=Ht(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const u=Je(0);if(r||!r&&!s)if((sn(t)!=="body"||_n(o))&&(a=$r(t)),r){const m=Ht(t,!0,s,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else o&&(u.x=Ls(o));const c=o&&!r&&!s?ru(o,a):Je(0),f=i.left+a.scrollLeft-u.x-c.x,g=i.top+a.scrollTop-u.y-c.y;return{x:f,y:g,width:i.width,height:i.height}}function Vs(e){return je(e).position==="static"}function iu(e,t){if(!Ze(e)||je(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ye(e)===n&&(n=n.ownerDocument.body),n}function au(e,t){const n=$e(e);if(Mr(e))return n;if(!Ze(e)){let o=At(e);for(;o&&!an(o);){if(Ue(o)&&!Vs(o))return o;o=At(o)}return n}let r=iu(e,t);for(;r&&dy(r)&&Vs(r);)r=iu(r,t);return r&&an(r)&&Vs(r)&&!$s(r)?n:r||fy(e)||n}const Ey=async function(e){const t=this.getOffsetParent||au,n=this.getDimensions,r=await n(e.floating);return{reference:Sy(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ny(e){return je(e).direction==="rtl"}const Ty={convertOffsetParentRelativeRectToViewportRelativeRect:hy,getDocumentElement:Ye,getClippingRect:xy,getOffsetParent:au,getElementRects:Ey,getClientRects:my,getDimensions:Cy,getScale:ln,isElement:Ue,isRTL:Ny};function Py(e,t){let n=null,r;const o=Ye(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),s();const{left:c,top:f,width:g,height:m}=e.getBoundingClientRect();if(a||t(),!g||!m)return;const p=_r(f),v=_r(o.clientWidth-(c+g)),h=_r(o.clientHeight-(f+m)),y=_r(c),x={rootMargin:-p+"px "+-v+"px "+-h+"px "+-y+"px",threshold:Me(0,Tt(1,u))||1};let E=!0;function T(C){const N=C[0].intersectionRatio;if(N!==u){if(!E)return i();N?i(!1,N):r=setTimeout(()=>{i(!1,1e-7)},1e3)}E=!1}try{n=new IntersectionObserver(T,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(T,x)}n.observe(e)}return i(!0),s}function Ay(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=Rs(e),f=o||s?[...c?Fn(c):[],...Fn(t)]:[];f.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const g=c&&a?Py(c,n):null;let m=-1,p=null;i&&(p=new ResizeObserver(w=>{let[x]=w;x&&x.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var E;(E=p)==null||E.observe(t)})),n()}),c&&!u&&p.observe(c),p.observe(t));let v,h=u?Ht(e):null;u&&y();function y(){const w=Ht(e);h&&(w.x!==h.x||w.y!==h.y||w.width!==h.width||w.height!==h.height)&&n(),h=w,v=requestAnimationFrame(y)}return n(),()=>{var w;f.forEach(x=>{o&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),g==null||g(),(w=p)==null||w.disconnect(),p=null,u&&cancelAnimationFrame(v)}}const _y=ay,Fy=ly,Oy=oy,Dy=uy,My=sy,lu=ry,$y=cy,ky=(e,t,n)=>{const r=new Map,o={platform:Ty,...n},s={...o.platform,_c:r};return ny(e,t,{...o,platform:s})};var kr=typeof document<"u"?O.useLayoutEffect:O.useEffect;function Ir(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ir(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Ir(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function cu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function uu(e,t){const n=cu(e);return Math.round(t*n)/n}function Bs(e){const t=d.useRef(e);return kr(()=>{t.current=e}),t}function Iy(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:u,open:c}=e,[f,g]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=d.useState(r);Ir(m,r)||p(r);const[v,h]=d.useState(null),[y,w]=d.useState(null),x=d.useCallback(q=>{q!==N.current&&(N.current=q,h(q))},[]),E=d.useCallback(q=>{q!==S.current&&(S.current=q,w(q))},[]),T=s||v,C=i||y,N=d.useRef(null),S=d.useRef(null),A=d.useRef(f),B=u!=null,H=Bs(u),K=Bs(o),$=Bs(c),R=d.useCallback(()=>{if(!N.current||!S.current)return;const q={placement:t,strategy:n,middleware:m};K.current&&(q.platform=K.current),ky(N.current,S.current,q).then(ne=>{const ae={...ne,isPositioned:$.current!==!1};D.current&&!Ir(A.current,ae)&&(A.current=ae,Hn.flushSync(()=>{g(ae)}))})},[m,t,n,K,$]);kr(()=>{c===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,g(q=>({...q,isPositioned:!1})))},[c]);const D=d.useRef(!1);kr(()=>(D.current=!0,()=>{D.current=!1}),[]),kr(()=>{if(T&&(N.current=T),C&&(S.current=C),T&&C){if(H.current)return H.current(T,C,R);R()}},[T,C,R,H,B]);const G=d.useMemo(()=>({reference:N,floating:S,setReference:x,setFloating:E}),[x,E]),j=d.useMemo(()=>({reference:T,floating:C}),[T,C]),X=d.useMemo(()=>{const q={position:n,left:0,top:0};if(!j.floating)return q;const ne=uu(j.floating,f.x),ae=uu(j.floating,f.y);return a?{...q,transform:"translate("+ne+"px, "+ae+"px)",...cu(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ne,top:ae}},[n,a,j.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:R,refs:G,elements:j,floatingStyles:X}),[f,R,G,j,X])}const Ry=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?lu({element:r.current,padding:o}).fn(n):{}:r?lu({element:r,padding:o}).fn(n):{}}}},Ly=(e,t)=>({..._y(e),options:[e,t]}),Vy=(e,t)=>({...Fy(e),options:[e,t]}),By=(e,t)=>({...$y(e),options:[e,t]}),Hy=(e,t)=>({...Oy(e),options:[e,t]}),zy=(e,t)=>({...Dy(e),options:[e,t]}),Uy=(e,t)=>({...My(e),options:[e,t]}),jy=(e,t)=>({...Ry(e),options:[e,t]});var Wy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Gy=Wy.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Gt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),qy="Arrow",du=d.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return l.jsx(Gy.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});du.displayName=qy;var Ky=du;function fu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Xy(...e){return t=>{let n=!1;const r=e.map(o=>{const s=fu(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():fu(e[o],null)}}}}function pu(...e){return d.useCallback(Xy(...e),e)}var Jy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],gu=Jy.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Gt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Hs="Popper",[hu,mu]=Ct(Hs),[Yy,vu]=hu(Hs),yu=e=>{const{__scopePopper:t,children:n}=e,[r,o]=d.useState(null);return l.jsx(Yy,{scope:t,anchor:r,onAnchorChange:o,children:n})};yu.displayName=Hs;var wu="PopperAnchor",bu=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=vu(wu,n),i=d.useRef(null),a=pu(t,i);return d.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:l.jsx(gu.div,{...o,ref:a})});bu.displayName=wu;var zs="PopperContent",[Zy,Qy]=hu(zs),xu=d.forwardRef((e,t)=>{var Ft,ft,rt,fn,pt,gt;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:f=0,sticky:g="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:v,...h}=e,y=vu(zs,n),[w,x]=d.useState(null),E=pu(t,Re=>x(Re)),[T,C]=d.useState(null),N=$a(T),S=(N==null?void 0:N.width)??0,A=(N==null?void 0:N.height)??0,B=r+(s!=="center"?"-"+s:""),H=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},K=Array.isArray(c)?c:[c],$=K.length>0,R={padding:H,boundary:K.filter(tw),altBoundary:$},{refs:D,floatingStyles:G,placement:j,isPositioned:X,middlewareData:q}=Iy({strategy:"fixed",placement:B,whileElementsMounted:(...Re)=>Ay(...Re,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[Ly({mainAxis:o+A,alignmentAxis:i}),u&&Vy({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?By():void 0,...R}),u&&Hy({...R}),zy({...R,apply:({elements:Re,rects:Ot,availableWidth:pn,availableHeight:Dt})=>{const{width:Vn,height:b}=Ot.reference,P=Re.floating.style;P.setProperty("--radix-popper-available-width",`${pn}px`),P.setProperty("--radix-popper-available-height",`${Dt}px`),P.setProperty("--radix-popper-anchor-width",`${Vn}px`),P.setProperty("--radix-popper-anchor-height",`${b}px`)}}),T&&jy({element:T,padding:a}),nw({arrowWidth:S,arrowHeight:A}),m&&Uy({strategy:"referenceHidden",...R})]}),[ne,ae]=Eu(j),se=Se(v);De(()=>{X&&(se==null||se())},[X,se]);const Ce=(Ft=q.arrow)==null?void 0:Ft.x,Ae=(ft=q.arrow)==null?void 0:ft.y,nt=((rt=q.arrow)==null?void 0:rt.centerOffset)!==0,[dn,dt]=d.useState();return De(()=>{w&&dt(window.getComputedStyle(w).zIndex)},[w]),l.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:X?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:dn,"--radix-popper-transform-origin":[(fn=q.transformOrigin)==null?void 0:fn.x,(pt=q.transformOrigin)==null?void 0:pt.y].join(" "),...((gt=q.hide)==null?void 0:gt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(Zy,{scope:n,placedSide:ne,onArrowChange:C,arrowX:Ce,arrowY:Ae,shouldHideArrow:nt,children:l.jsx(gu.div,{"data-side":ne,"data-align":ae,...h,ref:E,style:{...h.style,animation:X?void 0:"none"}})})})});xu.displayName=zs;var Cu="PopperArrow",ew={top:"bottom",right:"left",bottom:"top",left:"right"},Su=d.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=Qy(Cu,r),i=ew[s.placedSide];return l.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:l.jsx(Ky,{...o,ref:n,style:{...o.style,display:"block"}})})});Su.displayName=Cu;function tw(e){return e!==null}var nw=e=>({name:"transformOrigin",options:e,fn(t){var y,w,x;const{placement:n,rects:r,middlewareData:o}=t,i=((y=o.arrow)==null?void 0:y.centerOffset)!==0,a=i?0:e.arrowWidth,u=i?0:e.arrowHeight,[c,f]=Eu(n),g={start:"0%",center:"50%",end:"100%"}[f],m=(((w=o.arrow)==null?void 0:w.x)??0)+a/2,p=(((x=o.arrow)==null?void 0:x.y)??0)+u/2;let v="",h="";return c==="bottom"?(v=i?g:`${m}px`,h=`${-u}px`):c==="top"?(v=i?g:`${m}px`,h=`${r.floating.height+u}px`):c==="right"?(v=`${-u}px`,h=i?g:`${p}px`):c==="left"&&(v=`${r.floating.width+u}px`,h=i?g:`${p}px`),{data:{x:v,y:h}}}});function Eu(e){const[t,n="center"]=e.split("-");return[t,n]}var rw=yu,ow=bu,sw=xu,iw=Su,aw="Portal",Nu=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);De(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Yr.createPortal(l.jsx(Pn.div,{...r,ref:t}),i):null});Nu.displayName=aw;function lw(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var Us=e=>{const{present:t,children:n}=e,r=cw(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=Tn(r.ref,uw(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};Us.displayName="Presence";function cw(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=lw(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=Rr(r.current);s.current=a==="mounted"?c:"none"},[a]),De(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,p=Rr(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&m!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),De(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const h=Rr(r.current).includes(p.animationName);if(p.target===t&&h&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},m=p=>{p.target===t&&(s.current=Rr(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Rr(e){return(e==null?void 0:e.animationName)||"none"}function uw(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var dw="VisuallyHidden",Tu=d.forwardRef((e,t)=>l.jsx(Pn.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Tu.displayName=dw;var fw=Tu,[Lr,zx]=Ct("Tooltip",[mu]),Vr=mu(),Pu="TooltipProvider",pw=700,js="tooltip.open",[gw,Ws]=Lr(Pu),Au=e=>{const{__scopeTooltip:t,delayDuration:n=pw,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,[i,a]=d.useState(!0),u=d.useRef(!1),c=d.useRef(0);return d.useEffect(()=>{const f=c.current;return()=>window.clearTimeout(f)},[]),l.jsx(gw,{scope:t,isOpenDelayed:i,delayDuration:n,onOpen:d.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:d.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:d.useCallback(f=>{u.current=f},[]),disableHoverableContent:o,children:s})};Au.displayName=Pu;var Br="Tooltip",[hw,On]=Lr(Br),_u=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,u=Ws(Br,e.__scopeTooltip),c=Vr(t),[f,g]=d.useState(null),m=Yt(),p=d.useRef(0),v=i??u.disableHoverableContent,h=a??u.delayDuration,y=d.useRef(!1),[w=!1,x]=Xt({prop:r,defaultProp:o,onChange:S=>{S?(u.onOpen(),document.dispatchEvent(new CustomEvent(js))):u.onClose(),s==null||s(S)}}),E=d.useMemo(()=>w?y.current?"delayed-open":"instant-open":"closed",[w]),T=d.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y.current=!1,x(!0)},[x]),C=d.useCallback(()=>{window.clearTimeout(p.current),p.current=0,x(!1)},[x]),N=d.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,x(!0),p.current=0},h)},[h,x]);return d.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),l.jsx(rw,{...c,children:l.jsx(hw,{scope:t,contentId:m,open:w,stateAttribute:E,trigger:f,onTriggerChange:g,onTriggerEnter:d.useCallback(()=>{u.isOpenDelayed?N():T()},[u.isOpenDelayed,N,T]),onTriggerLeave:d.useCallback(()=>{v?C():(window.clearTimeout(p.current),p.current=0)},[C,v]),onOpen:T,onClose:C,disableHoverableContent:v,children:n})})};_u.displayName=Br;var Gs="TooltipTrigger",Fu=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=On(Gs,n),s=Ws(Gs,n),i=Vr(n),a=d.useRef(null),u=Tn(t,a,o.onTriggerChange),c=d.useRef(!1),f=d.useRef(!1),g=d.useCallback(()=>c.current=!1,[]);return d.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),l.jsx(ow,{asChild:!0,...i,children:l.jsx(Pn.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:it(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:it(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:it(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:it(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:it(e.onBlur,o.onClose),onClick:it(e.onClick,o.onClose)})})});Fu.displayName=Gs;var qs="TooltipPortal",[mw,vw]=Lr(qs,{forceMount:void 0}),Ou=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=On(qs,t);return l.jsx(mw,{scope:t,forceMount:n,children:l.jsx(Us,{present:n||s.open,children:l.jsx(Nu,{asChild:!0,container:o,children:r})})})};Ou.displayName=qs;var cn="TooltipContent",Du=d.forwardRef((e,t)=>{const n=vw(cn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=On(cn,e.__scopeTooltip);return l.jsx(Us,{present:r||i.open,children:i.disableHoverableContent?l.jsx(Mu,{side:o,...s,ref:t}):l.jsx(yw,{side:o,...s,ref:t})})}),yw=d.forwardRef((e,t)=>{const n=On(cn,e.__scopeTooltip),r=Ws(cn,e.__scopeTooltip),o=d.useRef(null),s=Tn(t,o),[i,a]=d.useState(null),{trigger:u,onClose:c}=n,f=o.current,{onPointerInTransitChange:g}=r,m=d.useCallback(()=>{a(null),g(!1)},[g]),p=d.useCallback((v,h)=>{const y=v.currentTarget,w={x:v.clientX,y:v.clientY},x=Cw(w,y.getBoundingClientRect()),E=Sw(w,x),T=Ew(h.getBoundingClientRect()),C=Tw([...E,...T]);a(C),g(!0)},[g]);return d.useEffect(()=>()=>m(),[m]),d.useEffect(()=>{if(u&&f){const v=y=>p(y,f),h=y=>p(y,u);return u.addEventListener("pointerleave",v),f.addEventListener("pointerleave",h),()=>{u.removeEventListener("pointerleave",v),f.removeEventListener("pointerleave",h)}}},[u,f,p,m]),d.useEffect(()=>{if(i){const v=h=>{const y=h.target,w={x:h.clientX,y:h.clientY},x=(u==null?void 0:u.contains(y))||(f==null?void 0:f.contains(y)),E=!Nw(w,i);x?m():E&&(m(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[u,f,i,c,m]),l.jsx(Mu,{...e,ref:s})}),[ww,bw]=Lr(Br,{isInside:!1}),Mu=d.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,u=On(cn,n),c=Vr(n),{onClose:f}=u;return d.useEffect(()=>(document.addEventListener(js,f),()=>document.removeEventListener(js,f)),[f]),d.useEffect(()=>{if(u.trigger){const g=m=>{const p=m.target;p!=null&&p.contains(u.trigger)&&f()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[u.trigger,f]),l.jsx(Wc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:g=>g.preventDefault(),onDismiss:f,children:l.jsxs(sw,{"data-state":u.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(ya,{children:r}),l.jsx(ww,{scope:n,isInside:!0,children:l.jsx(fw,{id:u.contentId,role:"tooltip",children:o||r})})]})})});Du.displayName=cn;var $u="TooltipArrow",xw=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Vr(n);return bw($u,n).isInside?null:l.jsx(iw,{...o,...r,ref:t})});xw.displayName=$u;function Cw(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Sw(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Ew(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Nw(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s].x,u=t[s].y,c=t[i].x,f=t[i].y;u>r!=f>r&&n<(c-a)*(r-u)/(f-u)+a&&(o=!o)}return o}function Tw(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Pw(t)}function Pw(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Aw=Au,_w=_u,Fw=Fu,Ow=Ou,ku=Du;const Iu=Aw,Ru=_w,Lu=Fw,Ks=d.forwardRef(({className:e,sideOffset:t=4,...n},r)=>l.jsx(Ow,{children:l.jsx(ku,{ref:r,sideOffset:t,className:Z("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Ks.displayName=ku.displayName;function Dw({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const Mw=d.forwardRef(Dw);var $w=function(e){return function(t,n){var r=O.useRef(!1);e(function(){return function(){r.current=!1}},[]),e(function(){if(!r.current)r.current=!0;else return t()},n)}},Vu=function(e){return typeof e=="function"},Bu=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";const kw=$w(O.useEffect);function Hu(e){var t=O.useRef(e);return t.current=e,t}var Iw=function(e){Bu&&(Vu(e)||console.error("useUnmount expected parameter is a function, got ".concat(typeof e)));var t=Hu(e);O.useEffect(function(){return function(){t.current()}},[])},Hr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Lw(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var zu=Lw,Vw=typeof Hr=="object"&&Hr&&Hr.Object===Object&&Hr,Bw=Vw,Hw=Bw,zw=typeof self=="object"&&self&&self.Object===Object&&self,Uw=Hw||zw||Function("return this")(),Uu=Uw,jw=Uu,Ww=function(){return jw.Date.now()},Gw=Ww,qw=/\s/;function Kw(e){for(var t=e.length;t--&&qw.test(e.charAt(t)););return t}var Xw=Kw,Jw=Xw,Yw=/^\s+/;function Zw(e){return e&&e.slice(0,Jw(e)+1).replace(Yw,"")}var Qw=Zw,eb=Uu,tb=eb.Symbol,ju=tb,Wu=ju,Gu=Object.prototype,nb=Gu.hasOwnProperty,rb=Gu.toString,Dn=Wu?Wu.toStringTag:void 0;function ob(e){var t=nb.call(e,Dn),n=e[Dn];try{e[Dn]=void 0;var r=!0}catch{}var o=rb.call(e);return r&&(t?e[Dn]=n:delete e[Dn]),o}var sb=ob,ib=Object.prototype,ab=ib.toString;function lb(e){return ab.call(e)}var cb=lb,qu=ju,ub=sb,db=cb,fb="[object Null]",pb="[object Undefined]",Ku=qu?qu.toStringTag:void 0;function gb(e){return e==null?e===void 0?pb:fb:Ku&&Ku in Object(e)?ub(e):db(e)}var hb=gb;function mb(e){return e!=null&&typeof e=="object"}var vb=mb,yb=hb,wb=vb,bb="[object Symbol]";function xb(e){return typeof e=="symbol"||wb(e)&&yb(e)==bb}var Cb=xb,Sb=Qw,Xu=zu,Eb=Cb,Ju=NaN,Nb=/^[-+]0x[0-9a-f]+$/i,Tb=/^0b[01]+$/i,Pb=/^0o[0-7]+$/i,Ab=parseInt;function _b(e){if(typeof e=="number")return e;if(Eb(e))return Ju;if(Xu(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Xu(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Sb(e);var n=Tb.test(e);return n||Pb.test(e)?Ab(e.slice(2),n?2:8):Nb.test(e)?Ju:+e}var Fb=_b,Ob=zu,Xs=Gw,Yu=Fb,Db="Expected a function",Mb=Math.max,$b=Math.min;function kb(e,t,n){var r,o,s,i,a,u,c=0,f=!1,g=!1,m=!0;if(typeof e!="function")throw new TypeError(Db);t=Yu(t)||0,Ob(n)&&(f=!!n.leading,g="maxWait"in n,s=g?Mb(Yu(n.maxWait)||0,t):s,m="trailing"in n?!!n.trailing:m);function p(N){var S=r,A=o;return r=o=void 0,c=N,i=e.apply(A,S),i}function v(N){return c=N,a=setTimeout(w,t),f?p(N):i}function h(N){var S=N-u,A=N-c,B=t-S;return g?$b(B,s-A):B}function y(N){var S=N-u,A=N-c;return u===void 0||S>=t||S<0||g&&A>=s}function w(){var N=Xs();if(y(N))return x(N);a=setTimeout(w,h(N))}function x(N){return a=void 0,m&&r?p(N):(r=o=void 0,i)}function E(){a!==void 0&&clearTimeout(a),c=0,r=u=o=a=void 0}function T(){return a===void 0?i:x(Xs())}function C(){var N=Xs(),S=y(N);if(r=arguments,o=this,u=N,S){if(a===void 0)return v(u);if(g)return clearTimeout(a),a=setTimeout(w,t),p(u)}return a===void 0&&(a=setTimeout(w,t)),i}return C.cancel=E,C.flush=T,C}var Ib=kb;const Rb=Rw(Ib);function Lb(){var e=(typeof global>"u"?"undefined":typeof global)=="object"&&global&&global.Object===Object&&global,t=typeof self=="object"&&self&&self.Object===Object&&self;return e||t}Lb()||(global.Date=Date);function Vb(e,t){var n;Bu&&(Vu(e)||console.error("useDebounceFn expected parameter is a function, got ".concat(typeof e)));var r=Hu(e),o=(n=t==null?void 0:t.wait)!==null&&n!==void 0?n:1e3,s=O.useMemo(function(){return Rb(function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return r.current.apply(r,rl([],nl(i),!1))},o,t)},[]);return Iw(function(){s.cancel()}),{run:s,cancel:s.cancel,flush:s.flush}}function Bb(e,t,n){var r=nl(O.useState({}),2),o=r[0],s=r[1],i=Vb(function(){s({})},n).run;O.useEffect(function(){return i()},t),kw(e,[o])}const Hb=O.forwardRef(({onChange:e},t)=>{const n=O.useRef(null),[r,o]=O.useState("");return O.useImperativeHandle(t,()=>({setValue:s=>{var i;o(s),(i=n.current)==null||i.focus()}})),Bb(()=>{e==null||e(r)},[r],{wait:300}),l.jsxs(l.Fragment,{children:[l.jsx(Nt,{ref:n,type:"text",placeholder:"Search files...",value:r,onChange:s=>o(s.target.value),className:"pr-8"}),r&&l.jsx("button",{onClick:()=>{var s;o(""),(s=n.current)==null||s.focus()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",children:l.jsx(Mw,{className:"h-5 w-5"})})]})}),We={current:!1},Zu="crawl:jobs",Mn="crawl:current_job",zb=e=>{const[t,n]=O.useState(null),[r,o]=O.useState(0);return O.useEffect(()=>{const s=localStorage.getItem(Mn);if(s){const i=JSON.parse(s);n(i),i.startTime&&o(Math.floor((Date.now()-i.startTime)/1e3))}},[]),O.useEffect(()=>{if(!(t!=null&&t.startTime))return;const s=setInterval(()=>{o(Math.floor((Date.now()-t.startTime)/1e3))},1e3);return()=>clearInterval(s)},[t==null?void 0:t.startTime]),O.useEffect(()=>{if(!(t!=null&&t.id))return;const s=async()=>{try{const u=(await oe.get(`${e}/api/crawl/${t.id}`)).data;n(c=>{if(!c)return null;const f={...c,status:u};return localStorage.setItem(Mn,JSON.stringify(f)),(u.status==="completed"||u.status==="failed")&&setTimeout(()=>{n(null),localStorage.removeItem(Mn)},100),f})}catch(a){console.error("Error polling job status:",a)}},i=setInterval(s,3e3);return s(),()=>clearInterval(i)},[t==null?void 0:t.id,e]),{currentJob:t,elapsedTime:r,setCurrentJob:s=>{s&&!s.startTime&&(s.startTime=Date.now()),n(s),s?localStorage.setItem(Mn,JSON.stringify(s)):localStorage.removeItem(Mn)}}},Ub=(e,t,n)=>{const r=[],o=s=>{(e[s]||[]).forEach(a=>{a.name.toLowerCase().includes(t.toLowerCase())&&r.push(a),a.isFolder&&a.key.startsWith(n)&&o(a.key)})};return o(n),r},zr=(e,t)=>{const n=[],r=o=>{(e[o]||[]).forEach(i=>{n.push(i.key),i.isFolder&&r(i.key)})};return r(t),n},jb=(e,t)=>{const n=[];return(e[t]||[]).forEach(o=>{n.push(o.key),o.isFolder&&n.push(...zr(e,o.key))}),n},Wb=(e,t,n=[])=>{const[r,o]=O.useState({}),[s,i]=O.useState(!1),[a,u]=O.useState(null),c=async()=>{i(!0);try{const f=!We.current;We.current&&(We.current=!1);const g=await oe.get(`${e}/api/files`,{params:{cache:f,displayPrefixes:JSON.stringify(n),prefix:t},timeout:3e5});o(g.data),u(null)}catch(f){u(f instanceof Error?f:new Error("Failed to fetch files"))}finally{i(!1)}};return O.useEffect(()=>{c()},[]),{data:r,isLoading:s,error:a,refetch:c}},Ur=e=>{var r,o,s;const t=((s=(o=(r=e==null?void 0:e.name)==null?void 0:r.split("."))==null?void 0:o.pop())==null?void 0:s.toLowerCase())??"";return["txt","md","json","js","ts","jsx","tsx","css","html","xml","yaml","yml"].includes(t||"")},Gb=O.memo(({homeLabel:e="Kho tài liệu",apiBaseUrl:t="http://localhost:3000",rootPrefix:n="",asSelector:r=!1,onSelected:o=i=>console.log("Đã chọn:",i),displayPrefixes:s})=>{var xd;const[i,a]=O.useState(""),[u,c]=O.useState(new Set),[f,g]=O.useState(n),[m,p]=O.useState(!1),[v,h]=O.useState(""),[y,w]=O.useState(!1),[x,E]=O.useState(null),[T,C]=O.useState(!1),[N,S]=O.useState(!1),[A,B]=O.useState(!1),[H,K]=O.useState(null),$=O.useRef(null),{toast:R}=Ps(),[D,G]=O.useState(null),[j,X]=O.useState(""),[q,ne]=O.useState(!1),[ae,se]=O.useState(new Set),[Ce,Ae]=O.useState(""),[nt,dn]=O.useState(!1),[dt,Ft]=O.useState(!1),[ft,rt]=O.useState("rename"),[fn,pt]=O.useState(!1),[gt,Re]=O.useState(""),[Ot,pn]=O.useState("1"),[Dt,Vn]=O.useState(!1),{currentJob:b,elapsedTime:P,setCurrentJob:F}=zb(t),{data:L={},isLoading:V,error:k,refetch:W}=Wb(t,n,s);O.useEffect(()=>{b!=null&&b.status&&(b.status.status==="completed"?(R({title:"Thu thập website hoàn tất",description:`Đã thu thập thành công ${b.url} với ${b.status.completed} trang`}),We.current=!0,W()):b.status.status==="failed"&&R({title:"Thu thập website thất bại",description:`Không thể thu thập ${b.url}. Vui lòng thử lại.`,variant:"destructive"}))},[(xd=b==null?void 0:b.status)==null?void 0:xd.status]);const te=O.useMemo(()=>L[f]||[],[L,f]),ce=O.useMemo(()=>i?Ub(L,i,f):te,[te,i,f,L]),fe=O.useMemo(()=>{const M={};return ce.forEach((I,U)=>{u.has(I.key)&&(M[U]=!0)}),M},[u,ce]),ht=M=>{const I=zr(L,M);if(I.length===0)return u.has(M)?"all":"none";const U=I.filter(re=>u.has(re)).length;return U===0?"none":U===I.length?"all":"partial"},gn=M=>{g(M)},Bn=async(M,I)=>{w(!0);try{const U=`${I}${M}/`;if((await oe.post(`${t}/api/create-folder`,{prefix:U})).status!==200){R({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"});return}We.current=!0,await W(),R({title:"Đã tạo thư mục",description:`Đã tạo thành công thư mục "${M}"`}),h(""),p(!1)}catch(U){console.error("Error creating folder:",U),R({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"})}finally{w(!1)}},hn=async(M,I,U)=>{K(U);try{const re=new FormData;re.append("prefix",I),Array.from(M).forEach(pe=>{pe instanceof File&&re.append("files",pe)}),(await oe.post(`${t}/api/upload`,re,{headers:{"Content-Type":"multipart/form-data"}})).status===200&&(We.current=!0,await W(),R({title:"Đã tải lên tập tin",description:`Đã tải lên thành công ${M.length} tập tin`}))}catch(re){console.error("Error uploading files:",re),R({title:"Lỗi",description:"Không thể tải lên tập tin",variant:"destructive"})}finally{K(null)}},ui=async M=>{C(!0);try{await oe.delete(`${t}/api/files`,{data:{paths:[M.key]}}),We.current=!0,await W(),R({title:"Đã xóa tập tin",description:`Đã xóa thành công "${M.name}"`}),E(null)}catch(I){console.error("Error deleting file:",I),R({title:"Lỗi",description:"Không thể xóa tập tin",variant:"destructive"})}finally{C(!1)}},Ut=M=>{const I=new Set(u),U=typeof M=="function"?M(fe):M;new Set(Object.keys(fe).map(Number)).forEach(ie=>{const pe=ce[ie];pe&&(U[ie]||(I.delete(pe.key),pe.isFolder&&zr(L,pe.key).forEach(_e=>I.delete(_e))))}),Object.entries(U).forEach(([ie,pe])=>{const _e=parseInt(ie),mt=ce[_e];mt&&pe&&(I.add(mt.key),mt.isFolder&&zr(L,mt.key).forEach(pi=>I.add(pi)))}),c(I)},di=async()=>{S(!0);try{const M=Array.from(u).map(I=>{var U;for(const re in L){const ie=(U=L[re])==null?void 0:U.find(pe=>pe.key===I);if(ie)return ie}return null}).filter(I=>I!==null);await oe.delete(`${t}/api/files`,{data:{paths:Array.from(u)}}),We.current=!0,await W(),R({title:"Đã xóa tập tin",description:`Đã xóa thành công ${M.length} mục`}),B(!1),c(new Set)}catch(M){console.error("Error deleting files:",M),R({title:"Lỗi",description:"Không thể xóa các tập tin đã chọn",variant:"destructive"})}finally{S(!1)}},Jr=async(M,I)=>{ne(!0);try{const U=M.key;let re;M.isFolder?re=U.split("/").slice(0,-2).join("/")+"/":re=U.substring(0,U.lastIndexOf("/")+1);const ie=re+I+(M.isFolder?"/":"");await oe.post(`${t}/api/rename`,{oldPath:U,newPath:ie}),We.current=!0,await W(),R({title:"Đã đổi tên",description:`Đã đổi tên thành công "${M.name}" thành "${I}"`}),G(null),X("")}catch(U){console.error("Error renaming item:",U),R({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{ne(!1)}},yd=async M=>{se(I=>new Set([...I,...M]));try{const I=await oe.post(`${t}/api/download`,{paths:M},{responseType:"blob"}),U=window.URL.createObjectURL(I.data),re=document.createElement("a");re.href=U;const ie=I.headers["Content-Disposition"]||I.headers["content-disposition"],pe=ie==null?void 0:ie.match(/filename="(.+)"/),_e=pe?decodeURIComponent(pe[1]):"download.zip";re.setAttribute("download",_e),document.body.appendChild(re),re.click(),document.body.removeChild(re),window.URL.revokeObjectURL(U),R({title:"Bắt đầu tải xuống",description:`Đã bắt đầu tải xuống ${M.length} mục${M.length>1,""}`})}catch(I){console.error("Error downloading files:",I),R({title:"Lỗi",description:"Không thể tải xuống tập tin",variant:"destructive"})}finally{se(I=>{const U=new Set(I);return M.forEach(re=>U.delete(re)),U})}},wd=f?f.replace(n,"").split("/").filter(Boolean):[],mx=()=>Array.from(u).map(M=>{var I;for(const U in L){const re=(I=L[U])==null?void 0:I.find(ie=>ie.key===M);if(re)return re}return null}).filter(M=>M!==null),bd=O.useMemo(()=>{const M=[{id:"select",header:()=>{const I=jb(L,f),U=I.length>0&&I.every(ie=>u.has(ie)),re=I.some(ie=>u.has(ie));return l.jsx(Vo,{checked:U?!0:re?"indeterminate":!1,onCheckedChange:ie=>{if(ie){const pe=ce.reduce((_e,mt,pi)=>(_e[pi]=!0,_e),{});Ut(pe)}else Ut({})},"aria-label":"Chọn tất cả"})},cell:({row:I})=>{const U=I.original,ie=U.isFolder?ht(U.key):u.has(U.key)?"all":"none";return l.jsx("div",{className:"flex items-center",children:l.jsx(Vo,{checked:ie==="partial"?"indeterminate":ie==="all",onCheckedChange:pe=>{const _e={...fe};pe?_e[I.index]=!0:delete _e[I.index],Ut(_e)},"aria-label":"Chọn dòng"})})},enableSorting:!1},{id:"fileName",header:"Tên tập tin",accessorKey:"name",cell:({row:I})=>{const U=I.original,re=U.key.substring(0,U.key.lastIndexOf("/"))||"/",ie=i.trim()!==""&&re!==f,pe=re.split("/").filter(Boolean);return l.jsxs("div",{className:"flex flex-col",children:[l.jsxs("div",{className:`flex items-center gap-2 ${U.isFolder?"cursor-pointer hover:text-blue-600":""}`,onClick:()=>{U.isFolder&&gn(U.key)},children:[U.isFolder?l.jsx(Zr,{className:"h-5 w-5 text-blue-500"}):null,U.name]}),ie&&l.jsxs("div",{className:"text-sm text-gray-500 flex items-center",children:[l.jsx(Zr,{className:"h-4 w-4 text-gray-500 my-auto"}),l.jsxs("span",{className:"flex items-center ml-1",children:[l.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{gn("")},children:"/"}),pe.map((_e,mt)=>l.jsxs("span",{className:"flex items-center",children:[l.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{gn(pe.slice(0,mt+1).join("/")+"/")},children:_e}),mt<pe.length-1&&l.jsx("span",{children:"/"})]},mt))]})]})]})}}];return r||M.push({id:"size",header:"Kích thước",accessorKey:"size",cell:({getValue:I,row:U})=>{const re=I();return l.jsx("span",{children:U.original.isFolder?"-":_g(re)})}},{id:"lastModified",header:"Sửa đổi lần cuối",accessorKey:"lastModified",cell:({row:I})=>{const U=I.original.lastModified;return l.jsx("span",{children:U.toLocaleString()})}},{id:"actions",header:"Hành động",accessorKey:"key",cell:({row:I})=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(le,{variant:"ghost",size:"icon",onClick:()=>yd([I.original.key]),className:"h-8 w-8 p-0",disabled:ae.has(I.original.key),children:ae.has(I.original.key)?l.jsx(we,{className:"h-4 w-4 animate-spin"}):l.jsx(hi,{className:"h-4 w-4"})}),l.jsx(le,{variant:"ghost",size:"icon",onClick:()=>{G(I.original),X(I.original.name)},className:"h-8 w-8 p-0",children:l.jsx(Md,{className:"h-4 w-4"})}),l.jsx(le,{variant:"ghost",size:"icon",onClick:()=>E(I.original),className:"h-8 w-8 p-0",children:l.jsx(mi,{className:"h-4 w-4"})})]})}),M},[u,ce,fe,ae,r]),fi=_i({data:ce,columns:bd,state:{rowSelection:fe},enableRowSelection:!0,onRowSelectionChange:Ut,getCoreRowModel:Ai()}),vx=async M=>{if(Ur(M)){dn(!0);try{const I=await oe.get(`${t}/api/read-text`,{params:{path:M.key}});Ae(I.data.content)}catch(I){console.error("Error loading file content:",I),R({title:"Lỗi",description:"Không thể tải nội dung tập tin",variant:"destructive"})}finally{dn(!1)}}},yx=async(M,I)=>{Ft(!0);try{await oe.post(`${t}/api/modify-text`,{path:M.key,content:I}),R({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),We.current=!0,await W(),G(null),Ae(""),rt("rename")}catch(U){console.error("Error saving file content:",U),R({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{Ft(!1)}};O.useEffect(()=>{D&&Ur(D)&&(vx(D),rt("rename"))},[D]);const wx=async(M,I)=>{if(b){R({title:"Đang thu thập website",description:"Vui lòng đợi cho công việc thu thập hiện tại hoàn thành.",variant:"destructive"});return}Vn(!0);try{const{data:U}=await oe.post(`${t}/api/crawl`,{url:M,limit:I,prefix:f});if(U.id){F({id:U.id,url:M,limit:I,prefix:f});const re=localStorage.getItem(Zu),ie=re?JSON.parse(re):[];ie.some(pe=>pe.id===U.id)||(ie.unshift({url:M,id:U.id,limit:I,prefix:f,timestamp:Date.now()}),ie.length>20&&(ie.length=20),localStorage.setItem(Zu,JSON.stringify(ie))),R({title:"Bắt đầu thu thập website",description:`Đã thêm nhiệm vụ thu thập ${M} với giới hạn ${I}. Dữ liệu sẽ có sẵn sau khi thu thập hoàn tất.`}),pt(!1),Re(""),pn("1")}}catch(U){console.error("Error crawling website:",U),R({title:"Lỗi",description:"Không thể bắt đầu thu thập website",variant:"destructive"})}finally{Vn(!1)}};return l.jsxs("div",{className:"space-y-4 s3-explr-container",children:[l.jsx(Aa,{className:"s3-explr-breadcrumb",children:l.jsxs(_a,{className:"s3-explr-breadcrumb-list",children:[l.jsx($o,{className:"s3-explr-breadcrumb-item",children:l.jsx(ko,{onClick:()=>g(n),className:"flex items-center gap-1 cursor-pointer s3-explr-breadcrumb-home",children:e})}),wd.map((M,I)=>l.jsxs(l.Fragment,{children:[l.jsx(Fa,{className:"s3-explr-breadcrumb-separator"},`sep-${I}`),l.jsx($o,{className:"s3-explr-breadcrumb-item",children:l.jsx(ko,{onClick:()=>gn(n+wd.slice(0,I+1).join("/")+"/"),className:"cursor-pointer s3-explr-breadcrumb-link",children:M})},`item-${M}`)]}))]})}),l.jsxs("div",{className:"flex items-center space-x-4 s3-explr-toolbar",children:[l.jsx("div",{className:"relative max-w-sm w-full s3-explr-search-container",children:l.jsx(Hb,{ref:$,onChange:M=>a(M)})}),l.jsxs(le,{variant:"outline",size:"sm",onClick:()=>{We.current=!0,W()},disabled:V,className:"flex items-center gap-2 s3-explr-refresh-btn",children:[l.jsx(Ed,{className:`h-4 w-4 s3-explr-refresh-icon ${V?"animate-spin":""}`}),"Làm mới"]}),!r&&l.jsxs(l.Fragment,{children:[u.size>0&&l.jsxs(l.Fragment,{children:[l.jsxs(le,{variant:"outline",size:"sm",onClick:()=>yd(Array.from(u)),disabled:Array.from(u).some(M=>ae.has(M)),className:"flex items-center gap-2 s3-explr-download-selected-btn",children:[Array.from(u).some(M=>ae.has(M))?l.jsx(we,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}):l.jsx(hi,{className:"h-4 w-4 s3-explr-download-icon"}),"Tải xuống đã chọn (",u.size,")"]}),l.jsxs(nn,{open:A,onOpenChange:B,children:[l.jsx(gr,{asChild:!0,children:l.jsxs(le,{variant:"destructive",size:"sm",className:"flex items-center gap-2 s3-explr-bulk-delete-btn",children:[l.jsx(mi,{className:"h-4 w-4 s3-explr-trash-icon"}),"Xóa đã chọn (",u.size,")"]})}),l.jsxs(Rt,{className:"s3-explr-dialog-content",children:[l.jsxs(Lt,{className:"s3-explr-dialog-header",children:[l.jsx(Vt,{className:"s3-explr-dialog-title",children:"Xác nhận xóa hàng loạt"}),l.jsxs(hr,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",u.size," mục đã chọn? Hành động này không thể hoàn tác."]})]}),l.jsxs(En,{className:"s3-explr-dialog-footer",children:[l.jsx(le,{variant:"outline",onClick:()=>B(!1),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(le,{variant:"destructive",onClick:di,disabled:N,className:"s3-explr-confirm-delete-btn",children:N?l.jsxs(l.Fragment,{children:[l.jsx(we,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa đã chọn"})]})]})]})]}),l.jsxs(nn,{open:m,onOpenChange:p,children:[l.jsx(gr,{asChild:!0,children:l.jsxs(le,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-new-folder-btn",disabled:!!s&&!f,children:[l.jsx(Ad,{className:"h-4 w-4 s3-explr-folder-plus-icon"}),"Thư mục mới"]})}),l.jsxs(Rt,{className:"s3-explr-dialog-content",children:[l.jsx(Lt,{className:"s3-explr-dialog-header",children:l.jsx(Vt,{className:"s3-explr-dialog-title",children:"Tạo thư mục mới"})}),l.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(Bt,{htmlFor:"name",className:"s3-explr-label",children:"Tên thư mục"}),l.jsx(Nt,{disabled:y,id:"name",value:v,onChange:M=>h(M.target.value),placeholder:"Nhập tên thư mục",className:"s3-explr-input"})]}),l.jsxs(le,{onClick:()=>{v.trim()&&Bn(v,f)},disabled:y,className:"s3-explr-create-btn",children:[y&&l.jsx(we,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),y?"Đang tạo...":"Tạo"]})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2 s3-explr-upload-group",children:[l.jsx(le,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-upload-files-btn",onClick:()=>{const M=document.createElement("input");M.type="file",M.multiple=!0,M.onchange=I=>{const U=I.target.files;U&&hn(U,f,"files")},M.click()},disabled:H!==null||!!s&&!f,children:H==="files"?l.jsxs(l.Fragment,{children:[l.jsx(we,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Td,{className:"h-4 w-4 s3-explr-upload-icon"}),"Tải lên tập tin"]})}),l.jsx(le,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-upload-folder-btn",onClick:()=>{const M=document.createElement("input");M.type="file",M.multiple=!0,M.webkitdirectory=!0,M.onchange=I=>{const U=I.target.files;U&&hn(U,f,"folder")},M.click()},disabled:H!==null||!!s&&!f,children:H==="folder"?l.jsxs(l.Fragment,{children:[l.jsx(we,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Zr,{className:"h-4 w-4 s3-explr-folder-icon"}),"Tải lên thư mục"]})}),b?l.jsx(Iu,{delayDuration:0,children:l.jsxs(Ru,{children:[l.jsx(Lu,{asChild:!0,children:l.jsx("div",{children:l.jsxs(le,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!0,children:[l.jsx(we,{className:"h-4 w-4 animate-spin s3-explr-loader"}),b.status?l.jsxs(l.Fragment,{children:["Đang thu thập (",b.status.completed,"/",b.status.total,") - ",Math.floor(P/60),":",String(P%60).padStart(2,"0")]}):"Đang thu thập..."]})})}),b.status&&l.jsx(Ks,{side:"right",sideOffset:5,children:l.jsxs("div",{className:"space-y-1 p-2",children:[l.jsxs("p",{className:"font-semibold",children:["Đang thu thập ",b.url]}),l.jsxs("p",{children:["Tiến độ: ",b.status.completed,"/",b.status.total," trang"]}),l.jsxs("p",{children:["Thời gian: ",Math.floor(P/60),":",String(P%60).padStart(2,"0")]}),l.jsxs("p",{children:["Trạng thái:"," ",b.status.status==="scraping"?"Đang thu thập":b.status.status==="completed"?"Hoàn thành":"Thất bại"]})]})})]})}):l.jsxs(nn,{open:fn,onOpenChange:pt,children:[l.jsx(gr,{asChild:!0,children:l.jsxs(le,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!!s&&!f,children:[l.jsx(Od,{className:"h-4 w-4 s3-explr-globe-icon"}),"Thêm website"]})}),l.jsxs(Rt,{className:"s3-explr-dialog-content",children:[l.jsxs(Lt,{className:"s3-explr-dialog-header",children:[l.jsx(Vt,{className:"s3-explr-dialog-title",children:"Thêm website"}),l.jsx(hr,{className:"s3-explr-dialog-description",children:"Nhập URL website để thu thập và thêm vào S3."})]}),l.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(Bt,{htmlFor:"websiteUrl",className:"s3-explr-label",children:"URL Website"}),l.jsx(Nt,{id:"websiteUrl",value:gt,onChange:M=>Re(M.target.value),placeholder:"https://example.com",type:"url",disabled:Dt,className:"s3-explr-input"})]}),l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(Bt,{htmlFor:"crawlLimit",className:"s3-explr-label",children:"Giới hạn thu thập"}),l.jsx(Nt,{id:"crawlLimit",value:Ot,onChange:M=>{const I=M.target.value;/^\d*$/.test(I)&&pn(I)},placeholder:"1",type:"text",disabled:Dt,className:"s3-explr-input"}),l.jsx("p",{className:"text-sm text-gray-500",children:"Số lượng liên kết cần thu thập (mặc định: 1)"})]})]}),l.jsxs(En,{className:"s3-explr-dialog-footer",children:[l.jsx(le,{variant:"outline",onClick:()=>{pt(!1),Re(""),pn("1")},disabled:Dt,className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(le,{onClick:()=>{gt.trim()&&wx(gt.trim(),parseInt(Ot)||1)},disabled:Dt||!gt.trim(),className:"s3-explr-crawl-btn",children:Dt?l.jsxs(l.Fragment,{children:[l.jsx(we,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]}):"Bắt đầu thu thập"})]})]})]})]}),l.jsx(nn,{open:!!x,onOpenChange:M=>!M&&E(null),children:l.jsxs(Rt,{className:"s3-explr-dialog-content",children:[l.jsxs(Lt,{className:"s3-explr-dialog-header",children:[l.jsx(Vt,{className:"s3-explr-dialog-title",children:"Xác nhận xóa"}),l.jsxs(hr,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",x==null?void 0:x.name,"? Hành động này không thể hoàn tác."]})]}),l.jsxs(En,{className:"s3-explr-dialog-footer",children:[l.jsx(le,{variant:"outline",onClick:()=>E(null),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(le,{variant:"destructive",onClick:()=>ui(x),disabled:T,className:"s3-explr-confirm-delete-btn",children:T?l.jsxs(l.Fragment,{children:[l.jsx(we,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa"})]})]})}),l.jsx(nn,{open:!!D,onOpenChange:M=>{M||(G(null),X(""),Ae(""),rt("rename"))},children:l.jsxs(Rt,{className:"s3-explr-dialog-content max-w-2xl",children:[l.jsx(Lt,{className:"s3-explr-dialog-header",children:l.jsx(Vt,{className:"s3-explr-dialog-title",children:D!=null&&D.isFolder?"Đổi tên thư mục":Ur(D)?"Quản lý tập tin":"Đổi tên tập tin"})}),D&&!D.isFolder&&Ur(D)?l.jsxs(rv,{value:ft,onValueChange:M=>rt(M),children:[l.jsxs(gc,{className:"grid w-full grid-cols-2",children:[l.jsx(ps,{value:"rename",children:"Đổi tên"}),l.jsx(ps,{value:"edit",children:"Sửa nội dung"})]}),l.jsx(gs,{value:"rename",children:l.jsx("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(Bt,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),l.jsx(Nt,{id:"newName",value:j,onChange:M=>X(M.target.value),placeholder:"Nhập tên mới",disabled:q,className:"s3-explr-input"})]})})}),l.jsx(gs,{value:"edit",children:l.jsx("div",{className:"space-y-4 py-4",children:nt?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx(we,{className:"h-6 w-6 animate-spin"})}):l.jsxs("div",{className:"space-y-2",children:[l.jsx(Bt,{htmlFor:"content",className:"s3-explr-label",children:"Nội dung tập tin"}),l.jsx(Cr,{id:"content",value:Ce,onChange:M=>Ae(M.target.value),placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:dt})]})})})]}):l.jsx("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(Bt,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),l.jsx(Nt,{id:"newName",value:j,onChange:M=>X(M.target.value),placeholder:"Nhập tên mới",disabled:q,className:"s3-explr-input"})]})}),l.jsxs(En,{className:"s3-explr-dialog-footer",children:[l.jsx(le,{variant:"outline",onClick:()=>{G(null),X(""),Ae("")},className:"s3-explr-cancel-btn",children:"Hủy"}),ft==="edit"?l.jsx(le,{onClick:()=>D&&yx(D,Ce),disabled:dt||nt,className:"s3-explr-save-btn",children:dt?l.jsxs(l.Fragment,{children:[l.jsx(we,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):l.jsx(le,{onClick:()=>{j.trim()&&D&&Jr(D,j.trim())},disabled:q||!j.trim()||j.trim()===(D==null?void 0:D.name),className:"s3-explr-rename-btn",children:q?l.jsxs(l.Fragment,{children:[l.jsx(we,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang đổi tên..."]}):"Đổi tên"})]})]})})]})]}),k&&l.jsx("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative s3-explr-error",children:"Đã xảy ra lỗi khi tải danh sách tập tin"}),l.jsx("div",{className:"rounded-md border s3-explr-table-container",children:l.jsxs(mr,{className:"s3-explr-table",children:[l.jsx(vr,{className:"s3-explr-table-header",children:fi.getHeaderGroups().map(M=>l.jsx(ze,{className:"hover:bg-transparent s3-explr-header-row",children:M.headers.map(I=>l.jsx(Xe,{className:"s3-explr-header-cell",children:I.isPlaceholder?null:Gn(I.column.columnDef.header,I.getContext())},I.id))},M.id))}),l.jsx(yr,{className:"s3-explr-table-body",children:fi.getRowModel().rows.length===0?l.jsx(ze,{className:"s3-explr-empty-row",children:l.jsx(Te,{colSpan:bd.length,className:"h-24 text-center s3-explr-empty-cell",children:i?l.jsxs("div",{className:"text-gray-500 s3-explr-no-results",children:['Không tìm thấy tập tin hoặc thư mục nào khớp với "',i,'"']}):l.jsx("div",{className:"text-gray-500 s3-explr-empty-message",children:V?"Đang tải nội dung thư mục... Vui lòng đợi":"Thư mục này không chứa tập tin hoặc thư mục con nào"})})}):fi.getRowModel().rows.map(M=>l.jsx(ze,{className:"h-12 s3-explr-row",children:M.getVisibleCells().map(I=>l.jsx(Te,{className:"align-middle s3-explr-cell",children:Gn(I.column.columnDef.cell,I.getContext())},I.id))},M.id))})]})}),r&&o&&l.jsxs("div",{className:"flex justify-between items-center mt-4 s3-explr-selector-footer",children:[l.jsxs("div",{className:"text-sm text-gray-500 s3-explr-selection-count",children:[u.size," ",(u.size===1,"tập tin")," đã chọn"]}),l.jsx(le,{variant:"default",onClick:()=>o(mx()),disabled:u.size===0,className:"s3-explr-ok-btn",children:"OK"})]}),!r&&l.jsx(Hc,{})]})});var $n=e=>e.type==="checkbox",zt=e=>e instanceof Date,Ee=e=>e==null;const Qu=e=>typeof e=="object";var he=e=>!Ee(e)&&!Array.isArray(e)&&Qu(e)&&!zt(e),qb=e=>he(e)&&e.target?$n(e.target)?e.target.checked:e.target.value:e,Kb=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Xb=(e,t)=>e.has(Kb(t)),Jb=e=>{const t=e.constructor&&e.constructor.prototype;return he(t)&&t.hasOwnProperty("isPrototypeOf")},Js=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ie(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Js&&(e instanceof Blob||r))&&(n||he(e)))if(t=n?[]:{},!n&&!Jb(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=Ie(e[o]));else return e;return t}var jr=e=>Array.isArray(e)?e.filter(Boolean):[],ge=e=>e===void 0,z=(e,t,n)=>{if(!t||!he(e))return n;const r=jr(t.split(/[,[\].]+?/)).reduce((o,s)=>Ee(o)?o:o[s],e);return ge(r)||r===e?ge(e[t])?n:e[t]:r},Qe=e=>typeof e=="boolean",Ys=e=>/^\w*$/.test(e),ed=e=>jr(e.replace(/["|']|\]/g,"").split(/\.|\[/)),de=(e,t,n)=>{let r=-1;const o=Ys(t)?[t]:ed(t),s=o.length,i=s-1;for(;++r<s;){const a=o[r];let u=n;if(r!==i){const c=e[a];u=he(c)||Array.isArray(c)?c:isNaN(+o[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=u,e=e[a]}return e};const td={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Ge={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ct={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};O.createContext(null);var Yb=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const i=s;return t._proxyFormState[i]!==Ge.all&&(t._proxyFormState[i]=!r||Ge.all),e[i]}});return o},Pe=e=>he(e)&&!Object.keys(e).length,Zb=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return Pe(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===Ge.all)},Wr=e=>Array.isArray(e)?e:[e];function Qb(e){const t=O.useRef(e);t.current=e,O.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}var et=e=>typeof e=="string",ex=(e,t,n,r,o)=>et(e)?(r&&t.watch.add(e),z(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),z(n,s))):(r&&(t.watchAll=!0),n),tx=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},nd=e=>({isOnSubmit:!e||e===Ge.onSubmit,isOnBlur:e===Ge.onBlur,isOnChange:e===Ge.onChange,isOnAll:e===Ge.all,isOnTouch:e===Ge.onTouched}),rd=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const kn=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const s=z(e,o);if(s){const{_f:i,...a}=s;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],o)&&!r)return!0;if(i.ref&&t(i.ref,i.name)&&!r)return!0;if(kn(a,t))break}else if(he(a)&&kn(a,t))break}}};var nx=(e,t,n)=>{const r=Wr(z(e,n));return de(r,"root",t[n]),de(e,n,r),e},Zs=e=>e.type==="file",tt=e=>typeof e=="function",Gr=e=>{if(!Js)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},qr=e=>et(e),Qs=e=>e.type==="radio",Kr=e=>e instanceof RegExp;const od={value:!1,isValid:!1},sd={value:!0,isValid:!0};var id=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ge(e[0].attributes.value)?ge(e[0].value)||e[0].value===""?sd:{value:e[0].value,isValid:!0}:sd:od}return od};const ad={isValid:!1,value:null};var ld=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,ad):ad;function cd(e,t,n="validate"){if(qr(e)||Array.isArray(e)&&e.every(qr)||Qe(e)&&!e)return{type:n,message:qr(e)?e:"",ref:t}}var un=e=>he(e)&&!Kr(e)?e:{value:e,message:""},ud=async(e,t,n,r,o)=>{const{ref:s,refs:i,required:a,maxLength:u,minLength:c,min:f,max:g,pattern:m,validate:p,name:v,valueAsNumber:h,mount:y,disabled:w}=e._f,x=z(t,v);if(!y||w)return{};const E=i?i[0]:s,T=$=>{r&&E.reportValidity&&(E.setCustomValidity(Qe($)?"":$||""),E.reportValidity())},C={},N=Qs(s),S=$n(s),A=N||S,B=(h||Zs(s))&&ge(s.value)&&ge(x)||Gr(s)&&s.value===""||x===""||Array.isArray(x)&&!x.length,H=tx.bind(null,v,n,C),K=($,R,D,G=ct.maxLength,j=ct.minLength)=>{const X=$?R:D;C[v]={type:$?G:j,message:X,ref:s,...H($?G:j,X)}};if(o?!Array.isArray(x)||!x.length:a&&(!A&&(B||Ee(x))||Qe(x)&&!x||S&&!id(i).isValid||N&&!ld(i).isValid)){const{value:$,message:R}=qr(a)?{value:!!a,message:a}:un(a);if($&&(C[v]={type:ct.required,message:R,ref:E,...H(ct.required,R)},!n))return T(R),C}if(!B&&(!Ee(f)||!Ee(g))){let $,R;const D=un(g),G=un(f);if(!Ee(x)&&!isNaN(x)){const j=s.valueAsNumber||x&&+x;Ee(D.value)||($=j>D.value),Ee(G.value)||(R=j<G.value)}else{const j=s.valueAsDate||new Date(x),X=ae=>new Date(new Date().toDateString()+" "+ae),q=s.type=="time",ne=s.type=="week";et(D.value)&&x&&($=q?X(x)>X(D.value):ne?x>D.value:j>new Date(D.value)),et(G.value)&&x&&(R=q?X(x)<X(G.value):ne?x<G.value:j<new Date(G.value))}if(($||R)&&(K(!!$,D.message,G.message,ct.max,ct.min),!n))return T(C[v].message),C}if((u||c)&&!B&&(et(x)||o&&Array.isArray(x))){const $=un(u),R=un(c),D=!Ee($.value)&&x.length>+$.value,G=!Ee(R.value)&&x.length<+R.value;if((D||G)&&(K(D,$.message,R.message),!n))return T(C[v].message),C}if(m&&!B&&et(x)){const{value:$,message:R}=un(m);if(Kr($)&&!x.match($)&&(C[v]={type:ct.pattern,message:R,ref:s,...H(ct.pattern,R)},!n))return T(R),C}if(p){if(tt(p)){const $=await p(x,t),R=cd($,E);if(R&&(C[v]={...R,...H(ct.validate,R.message)},!n))return T(R.message),C}else if(he(p)){let $={};for(const R in p){if(!Pe($)&&!n)break;const D=cd(await p[R](x,t),E,R);D&&($={...D,...H(R,D.message)},T(D.message),n&&(C[v]=$))}if(!Pe($)&&(C[v]={ref:E,...$},!n))return C}}return T(!0),C};function rx(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=ge(e)?r++:e[t[r++]];return e}function ox(e){for(const t in e)if(e.hasOwnProperty(t)&&!ge(e[t]))return!1;return!0}function ye(e,t){const n=Array.isArray(t)?t:Ys(t)?[t]:ed(t),r=n.length===1?e:rx(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(he(r)&&Pe(r)||Array.isArray(r)&&ox(r))&&ye(e,n.slice(0,-1)),e}var ei=()=>{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}},ti=e=>Ee(e)||!Qu(e);function _t(e,t){if(ti(e)||ti(t))return e===t;if(zt(e)&&zt(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const s=e[o];if(!r.includes(o))return!1;if(o!=="ref"){const i=t[o];if(zt(s)&&zt(i)||he(s)&&he(i)||Array.isArray(s)&&Array.isArray(i)?!_t(s,i):s!==i)return!1}}return!0}var dd=e=>e.type==="select-multiple",sx=e=>Qs(e)||$n(e),ni=e=>Gr(e)&&e.isConnected,fd=e=>{for(const t in e)if(tt(e[t]))return!0;return!1};function Xr(e,t={}){const n=Array.isArray(e);if(he(e)||n)for(const r in e)Array.isArray(e[r])||he(e[r])&&!fd(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Xr(e[r],t[r])):Ee(e[r])||(t[r]=!0);return t}function pd(e,t,n){const r=Array.isArray(e);if(he(e)||r)for(const o in e)Array.isArray(e[o])||he(e[o])&&!fd(e[o])?ge(t)||ti(n[o])?n[o]=Array.isArray(e[o])?Xr(e[o],[]):{...Xr(e[o])}:pd(e[o],Ee(t)?{}:t[o],n[o]):n[o]=!_t(e[o],t[o]);return n}var In=(e,t)=>pd(e,t,Xr(t)),gd=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>ge(e)?e:t?e===""?NaN:e&&+e:n&&et(e)?new Date(e):r?r(e):e;function ri(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return Zs(t)?t.files:Qs(t)?ld(e.refs).value:dd(t)?[...t.selectedOptions].map(({value:n})=>n):$n(t)?id(e.refs).value:gd(ge(t.value)?e.ref.value:t.value,e)}var ix=(e,t,n,r)=>{const o={};for(const s of e){const i=z(t,s);i&&de(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Rn=e=>ge(e)?e:Kr(e)?e.source:he(e)?Kr(e.value)?e.value.source:e.value:e;const hd="AsyncFunction";var ax=e=>!!e&&!!e.validate&&!!(tt(e.validate)&&e.validate.constructor.name===hd||he(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===hd)),lx=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function md(e,t,n){const r=z(e,n);if(r||Ys(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),i=z(t,s),a=z(e,s);if(i&&!Array.isArray(i)&&n!==s)return{name:n};if(a&&a.type)return{name:s,error:a};o.pop()}return{name:n}}var cx=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,ux=(e,t)=>!jr(z(e,t)).length&&ye(e,t);const dx={mode:Ge.onSubmit,reValidateMode:Ge.onChange,shouldFocusError:!0};function fx(e={}){let t={...dx,...e},n={submitCount:0,isDirty:!1,isLoading:tt(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=he(t.defaultValues)||he(t.values)?Ie(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:Ie(o),i={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,c=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},g={values:ei(),array:ei(),state:ei()},m=nd(t.mode),p=nd(t.reValidateMode),v=t.criteriaMode===Ge.all,h=b=>P=>{clearTimeout(c),c=setTimeout(b,P)},y=async b=>{if(!t.disabled&&(f.isValid||b)){const P=t.resolver?Pe((await A()).errors):await H(r,!0);P!==n.isValid&&g.state.next({isValid:P})}},w=(b,P)=>{!t.disabled&&(f.isValidating||f.validatingFields)&&((b||Array.from(a.mount)).forEach(F=>{F&&(P?de(n.validatingFields,F,P):ye(n.validatingFields,F))}),g.state.next({validatingFields:n.validatingFields,isValidating:!Pe(n.validatingFields)}))},x=(b,P=[],F,L,V=!0,k=!0)=>{if(L&&F&&!t.disabled){if(i.action=!0,k&&Array.isArray(z(r,b))){const W=F(z(r,b),L.argA,L.argB);V&&de(r,b,W)}if(k&&Array.isArray(z(n.errors,b))){const W=F(z(n.errors,b),L.argA,L.argB);V&&de(n.errors,b,W),ux(n.errors,b)}if(f.touchedFields&&k&&Array.isArray(z(n.touchedFields,b))){const W=F(z(n.touchedFields,b),L.argA,L.argB);V&&de(n.touchedFields,b,W)}f.dirtyFields&&(n.dirtyFields=In(o,s)),g.state.next({name:b,isDirty:$(b,P),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else de(s,b,P)},E=(b,P)=>{de(n.errors,b,P),g.state.next({errors:n.errors})},T=b=>{n.errors=b,g.state.next({errors:n.errors,isValid:!1})},C=(b,P,F,L)=>{const V=z(r,b);if(V){const k=z(s,b,ge(F)?z(o,b):F);ge(k)||L&&L.defaultChecked||P?de(s,b,P?k:ri(V._f)):G(b,k),i.mount&&y()}},N=(b,P,F,L,V)=>{let k=!1,W=!1;const te={name:b};if(!t.disabled){const ce=!!(z(r,b)&&z(r,b)._f&&z(r,b)._f.disabled);if(!F||L){f.isDirty&&(W=n.isDirty,n.isDirty=te.isDirty=$(),k=W!==te.isDirty);const fe=ce||_t(z(o,b),P);W=!!(!ce&&z(n.dirtyFields,b)),fe||ce?ye(n.dirtyFields,b):de(n.dirtyFields,b,!0),te.dirtyFields=n.dirtyFields,k=k||f.dirtyFields&&W!==!fe}if(F){const fe=z(n.touchedFields,b);fe||(de(n.touchedFields,b,F),te.touchedFields=n.touchedFields,k=k||f.touchedFields&&fe!==F)}k&&V&&g.state.next(te)}return k?te:{}},S=(b,P,F,L)=>{const V=z(n.errors,b),k=f.isValid&&Qe(P)&&n.isValid!==P;if(t.delayError&&F?(u=h(()=>E(b,F)),u(t.delayError)):(clearTimeout(c),u=null,F?de(n.errors,b,F):ye(n.errors,b)),(F?!_t(V,F):V)||!Pe(L)||k){const W={...L,...k&&Qe(P)?{isValid:P}:{},errors:n.errors,name:b};n={...n,...W},g.state.next(W)}},A=async b=>{w(b,!0);const P=await t.resolver(s,t.context,ix(b||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(b),P},B=async b=>{const{errors:P}=await A(b);if(b)for(const F of b){const L=z(P,F);L?de(n.errors,F,L):ye(n.errors,F)}else n.errors=P;return P},H=async(b,P,F={valid:!0})=>{for(const L in b){const V=b[L];if(V){const{_f:k,...W}=V;if(k){const te=a.array.has(k.name),ce=V._f&&ax(V._f);ce&&f.validatingFields&&w([L],!0);const fe=await ud(V,s,v,t.shouldUseNativeValidation&&!P,te);if(ce&&f.validatingFields&&w([L]),fe[k.name]&&(F.valid=!1,P))break;!P&&(z(fe,k.name)?te?nx(n.errors,fe,k.name):de(n.errors,k.name,fe[k.name]):ye(n.errors,k.name))}!Pe(W)&&await H(W,P,F)}}return F.valid},K=()=>{for(const b of a.unMount){const P=z(r,b);P&&(P._f.refs?P._f.refs.every(F=>!ni(F)):!ni(P._f.ref))&&dt(b)}a.unMount=new Set},$=(b,P)=>!t.disabled&&(b&&P&&de(s,b,P),!_t(se(),o)),R=(b,P,F)=>ex(b,a,{...i.mount?s:ge(P)?o:et(b)?{[b]:P}:P},F,P),D=b=>jr(z(i.mount?s:o,b,t.shouldUnregister?z(o,b,[]):[])),G=(b,P,F={})=>{const L=z(r,b);let V=P;if(L){const k=L._f;k&&(!k.disabled&&de(s,b,gd(P,k)),V=Gr(k.ref)&&Ee(P)?"":P,dd(k.ref)?[...k.ref.options].forEach(W=>W.selected=V.includes(W.value)):k.refs?$n(k.ref)?k.refs.length>1?k.refs.forEach(W=>(!W.defaultChecked||!W.disabled)&&(W.checked=Array.isArray(V)?!!V.find(te=>te===W.value):V===W.value)):k.refs[0]&&(k.refs[0].checked=!!V):k.refs.forEach(W=>W.checked=W.value===V):Zs(k.ref)?k.ref.value="":(k.ref.value=V,k.ref.type||g.values.next({name:b,values:{...s}})))}(F.shouldDirty||F.shouldTouch)&&N(b,V,F.shouldTouch,F.shouldDirty,!0),F.shouldValidate&&ae(b)},j=(b,P,F)=>{for(const L in P){const V=P[L],k=`${b}.${L}`,W=z(r,k);(a.array.has(b)||he(V)||W&&!W._f)&&!zt(V)?j(k,V,F):G(k,V,F)}},X=(b,P,F={})=>{const L=z(r,b),V=a.array.has(b),k=Ie(P);de(s,b,k),V?(g.array.next({name:b,values:{...s}}),(f.isDirty||f.dirtyFields)&&F.shouldDirty&&g.state.next({name:b,dirtyFields:In(o,s),isDirty:$(b,k)})):L&&!L._f&&!Ee(k)?j(b,k,F):G(b,k,F),rd(b,a)&&g.state.next({...n}),g.values.next({name:i.mount?b:void 0,values:{...s}})},q=async b=>{i.mount=!0;const P=b.target;let F=P.name,L=!0;const V=z(r,F),k=()=>P.type?ri(V._f):qb(b),W=te=>{L=Number.isNaN(te)||zt(te)&&isNaN(te.getTime())||_t(te,z(s,F,te))};if(V){let te,ce;const fe=k(),ht=b.type===td.BLUR||b.type===td.FOCUS_OUT,gn=!lx(V._f)&&!t.resolver&&!z(n.errors,F)&&!V._f.deps||cx(ht,z(n.touchedFields,F),n.isSubmitted,p,m),Bn=rd(F,a,ht);de(s,F,fe),ht?(V._f.onBlur&&V._f.onBlur(b),u&&u(0)):V._f.onChange&&V._f.onChange(b);const hn=N(F,fe,ht,!1),ui=!Pe(hn)||Bn;if(!ht&&g.values.next({name:F,type:b.type,values:{...s}}),gn)return f.isValid&&(t.mode==="onBlur"?ht&&y():y()),ui&&g.state.next({name:F,...Bn?{}:hn});if(!ht&&Bn&&g.state.next({...n}),t.resolver){const{errors:Ut}=await A([F]);if(W(fe),L){const di=md(n.errors,r,F),Jr=md(Ut,r,di.name||F);te=Jr.error,F=Jr.name,ce=Pe(Ut)}}else w([F],!0),te=(await ud(V,s,v,t.shouldUseNativeValidation))[F],w([F]),W(fe),L&&(te?ce=!1:f.isValid&&(ce=await H(r,!0)));L&&(V._f.deps&&ae(V._f.deps),S(F,ce,te,hn))}},ne=(b,P)=>{if(z(n.errors,P)&&b.focus)return b.focus(),1},ae=async(b,P={})=>{let F,L;const V=Wr(b);if(t.resolver){const k=await B(ge(b)?b:V);F=Pe(k),L=b?!V.some(W=>z(k,W)):F}else b?(L=(await Promise.all(V.map(async k=>{const W=z(r,k);return await H(W&&W._f?{[k]:W}:W)}))).every(Boolean),!(!L&&!n.isValid)&&y()):L=F=await H(r);return g.state.next({...!et(b)||f.isValid&&F!==n.isValid?{}:{name:b},...t.resolver||!b?{isValid:F}:{},errors:n.errors}),P.shouldFocus&&!L&&kn(r,ne,b?V:a.mount),L},se=b=>{const P={...i.mount?s:o};return ge(b)?P:et(b)?z(P,b):b.map(F=>z(P,F))},Ce=(b,P)=>({invalid:!!z((P||n).errors,b),isDirty:!!z((P||n).dirtyFields,b),error:z((P||n).errors,b),isValidating:!!z(n.validatingFields,b),isTouched:!!z((P||n).touchedFields,b)}),Ae=b=>{b&&Wr(b).forEach(P=>ye(n.errors,P)),g.state.next({errors:b?n.errors:{}})},nt=(b,P,F)=>{const L=(z(r,b,{_f:{}})._f||{}).ref,V=z(n.errors,b)||{},{ref:k,message:W,type:te,...ce}=V;de(n.errors,b,{...ce,...P,ref:L}),g.state.next({name:b,errors:n.errors,isValid:!1}),F&&F.shouldFocus&&L&&L.focus&&L.focus()},dn=(b,P)=>tt(b)?g.values.subscribe({next:F=>b(R(void 0,P),F)}):R(b,P,!0),dt=(b,P={})=>{for(const F of b?Wr(b):a.mount)a.mount.delete(F),a.array.delete(F),P.keepValue||(ye(r,F),ye(s,F)),!P.keepError&&ye(n.errors,F),!P.keepDirty&&ye(n.dirtyFields,F),!P.keepTouched&&ye(n.touchedFields,F),!P.keepIsValidating&&ye(n.validatingFields,F),!t.shouldUnregister&&!P.keepDefaultValue&&ye(o,F);g.values.next({values:{...s}}),g.state.next({...n,...P.keepDirty?{isDirty:$()}:{}}),!P.keepIsValid&&y()},Ft=({disabled:b,name:P,field:F,fields:L,value:V})=>{if(Qe(b)&&i.mount||b){const k=b?void 0:ge(V)?ri(F?F._f:z(L,P)._f):V;(b||!b&&!ge(k))&&de(s,P,k),N(P,k,!1,!1,!0)}},ft=(b,P={})=>{let F=z(r,b);const L=Qe(P.disabled)||Qe(t.disabled);return de(r,b,{...F||{},_f:{...F&&F._f?F._f:{ref:{name:b}},name:b,mount:!0,...P}}),a.mount.add(b),F?Ft({field:F,disabled:Qe(P.disabled)?P.disabled:t.disabled,name:b,value:P.value}):C(b,!0,P.value),{...L?{disabled:P.disabled||t.disabled}:{},...t.progressive?{required:!!P.required,min:Rn(P.min),max:Rn(P.max),minLength:Rn(P.minLength),maxLength:Rn(P.maxLength),pattern:Rn(P.pattern)}:{},name:b,onChange:q,onBlur:q,ref:V=>{if(V){ft(b,P),F=z(r,b);const k=ge(V.value)&&V.querySelectorAll&&V.querySelectorAll("input,select,textarea")[0]||V,W=sx(k),te=F._f.refs||[];if(W?te.find(ce=>ce===k):k===F._f.ref)return;de(r,b,{_f:{...F._f,...W?{refs:[...te.filter(ni),k,...Array.isArray(z(o,b))?[{}]:[]],ref:{type:k.type,name:b}}:{ref:k}}}),C(b,!1,void 0,k)}else F=z(r,b,{}),F._f&&(F._f.mount=!1),(t.shouldUnregister||P.shouldUnregister)&&!(Xb(a.array,b)&&i.action)&&a.unMount.add(b)}}},rt=()=>t.shouldFocusError&&kn(r,ne,a.mount),fn=b=>{Qe(b)&&(g.state.next({disabled:b}),kn(r,(P,F)=>{const L=z(r,F);L&&(P.disabled=L._f.disabled||b,Array.isArray(L._f.refs)&&L._f.refs.forEach(V=>{V.disabled=L._f.disabled||b}))},0,!1))},pt=(b,P)=>async F=>{let L;if(F&&(F.preventDefault&&F.preventDefault(),F.persist&&F.persist()),t.disabled){P&&await P({...n.errors},F);return}let V=Ie(s);if(g.state.next({isSubmitting:!0}),t.resolver){const{errors:k,values:W}=await A();n.errors=k,V=W}else await H(r);if(ye(n.errors,"root"),Pe(n.errors)){g.state.next({errors:{}});try{await b(V,F)}catch(k){L=k}}else P&&await P({...n.errors},F),rt(),setTimeout(rt);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Pe(n.errors)&&!L,submitCount:n.submitCount+1,errors:n.errors}),L)throw L},gt=(b,P={})=>{z(r,b)&&(ge(P.defaultValue)?X(b,Ie(z(o,b))):(X(b,P.defaultValue),de(o,b,Ie(P.defaultValue))),P.keepTouched||ye(n.touchedFields,b),P.keepDirty||(ye(n.dirtyFields,b),n.isDirty=P.defaultValue?$(b,Ie(z(o,b))):$()),P.keepError||(ye(n.errors,b),f.isValid&&y()),g.state.next({...n}))},Re=(b,P={})=>{const F=b?Ie(b):o,L=Ie(F),V=Pe(b),k=V?o:L;if(P.keepDefaultValues||(o=F),!P.keepValues){if(P.keepDirtyValues){const W=new Set([...a.mount,...Object.keys(In(o,s))]);for(const te of Array.from(W))z(n.dirtyFields,te)?de(k,te,z(s,te)):X(te,z(k,te))}else{if(Js&&ge(b))for(const W of a.mount){const te=z(r,W);if(te&&te._f){const ce=Array.isArray(te._f.refs)?te._f.refs[0]:te._f.ref;if(Gr(ce)){const fe=ce.closest("form");if(fe){fe.reset();break}}}}r={}}s=t.shouldUnregister?P.keepDefaultValues?Ie(o):{}:Ie(k),g.array.next({values:{...k}}),g.values.next({values:{...k}})}a={mount:P.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!f.isValid||!!P.keepIsValid||!!P.keepDirtyValues,i.watch=!!t.shouldUnregister,g.state.next({submitCount:P.keepSubmitCount?n.submitCount:0,isDirty:V?!1:P.keepDirty?n.isDirty:!!(P.keepDefaultValues&&!_t(b,o)),isSubmitted:P.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:V?{}:P.keepDirtyValues?P.keepDefaultValues&&s?In(o,s):n.dirtyFields:P.keepDefaultValues&&b?In(o,b):P.keepDirty?n.dirtyFields:{},touchedFields:P.keepTouched?n.touchedFields:{},errors:P.keepErrors?n.errors:{},isSubmitSuccessful:P.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Ot=(b,P)=>Re(tt(b)?b(s):b,P);return{control:{register:ft,unregister:dt,getFieldState:Ce,handleSubmit:pt,setError:nt,_executeSchema:A,_getWatch:R,_getDirty:$,_updateValid:y,_removeUnmounted:K,_updateFieldArray:x,_updateDisabledField:Ft,_getFieldArray:D,_reset:Re,_resetDefaultValues:()=>tt(t.defaultValues)&&t.defaultValues().then(b=>{Ot(b,t.resetOptions),g.state.next({isLoading:!1})}),_updateFormState:b=>{n={...n,...b}},_disableForm:fn,_subjects:g,_proxyFormState:f,_setErrors:T,get _fields(){return r},get _formValues(){return s},get _state(){return i},set _state(b){i=b},get _defaultValues(){return o},get _names(){return a},set _names(b){a=b},get _formState(){return n},set _formState(b){n=b},get _options(){return t},set _options(b){t={...t,...b}}},trigger:ae,register:ft,handleSubmit:pt,watch:dn,setValue:X,getValues:se,reset:Ot,resetField:gt,clearErrors:Ae,unregister:dt,setError:nt,setFocus:(b,P={})=>{const F=z(r,b),L=F&&F._f;if(L){const V=L.refs?L.refs[0]:L.ref;V.focus&&(V.focus(),P.shouldSelect&&tt(V.select)&&V.select())}},getFieldState:Ce}}function px(e={}){const t=O.useRef(),n=O.useRef(),[r,o]=O.useState({isDirty:!1,isValidating:!1,isLoading:tt(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:tt(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...fx(e),formState:r});const s=t.current.control;return s._options=e,Qb({subject:s._subjects.state,next:i=>{Zb(i,s._proxyFormState,s._updateFormState)&&o({...s._formState})}}),O.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),O.useEffect(()=>{if(s._proxyFormState.isDirty){const i=s._getDirty();i!==r.isDirty&&s._subjects.state.next({isDirty:i})}},[s,r.isDirty]),O.useEffect(()=>{e.values&&!_t(e.values,n.current)?(s._reset(e.values,s._options.resetOptions),n.current=e.values,o(i=>({...i}))):s._resetDefaultValues()},[e.values,s]),O.useEffect(()=>{e.errors&&s._setErrors(e.errors)},[e.errors,s]),O.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),O.useEffect(()=>{e.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[e.shouldUnregister,s]),O.useMemo(()=>({...t.current,formState:Yb(r,s)}),[r,s])}const oi=({className:e,children:t,content:n,side:r})=>{const[o,s]=O.useState(!1);return l.jsx(Iu,{delayDuration:0,children:l.jsxs(Ru,{open:o,children:[l.jsx(Lu,{asChild:!0,children:l.jsx("button",{type:"button",className:Z("cursor-pointer",e),onClick:()=>s(!o),onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onTouchStart:()=>s(!o),onKeyDown:i=>{i.preventDefault(),i.key==="Enter"&&s(!o)},children:t})}),l.jsx(Ks,{side:r,className:n?"":"hidden",children:l.jsx("span",{className:"inline-block",children:n})})]})})},si=({className:e,...t})=>l.jsx("nav",{role:"navigation","aria-label":"pagination",className:Z("mx-auto flex w-full justify-center",e),...t});si.displayName="Pagination";const ii=d.forwardRef(({className:e,...t},n)=>l.jsx("ul",{ref:n,className:Z("flex flex-row items-center gap-1",e),...t}));ii.displayName="PaginationContent";const ut=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:Z("",e),...t}));ut.displayName="PaginationItem";const Ln=({className:e,isActive:t,size:n="icon",...r})=>l.jsx("a",{"aria-current":t?"page":void 0,className:Z(Ma({variant:t?"outline":"ghost",size:n}),e),...r});Ln.displayName="PaginationLink";const ai=({className:e,...t})=>l.jsxs(Ln,{"aria-label":"Go to previous page",size:"default",className:Z("gap-1 pl-2.5",e),...t,children:[l.jsx(Wp,{className:"h-4 w-4"}),l.jsx("span",{children:"Previous"})]});ai.displayName="PaginationPrevious";const li=({className:e,...t})=>l.jsxs(Ln,{"aria-label":"Go to next page",size:"default",className:Z("gap-1 pr-2.5",e),...t,children:[l.jsx("span",{children:"Next"}),l.jsx(ha,{className:"h-4 w-4"})]});li.displayName="PaginationNext";const ci=({className:e,...t})=>l.jsxs("span",{"aria-hidden":!0,className:Z("flex h-9 w-9 items-center justify-center",e),...t,children:[l.jsx(Gp,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"More pages"})]});ci.displayName="PaginationEllipsis";const gx=({apiBaseUrl:e="http://localhost:3000"})=>{var E,T,C;const[t,n]=O.useState([]),[r,o]=O.useState(!1),[s,i]=O.useState([]),[a,u]=O.useState(1),[c,f]=O.useState(1),[g,m]=O.useState(null),p=N=>{const S=N.match(/\d{6}/);if(!S)return{month:"",year:""};const A=S[0],B=A.substring(0,2),H=A.substring(2);return{month:B,year:H}},v=N=>N.map(A=>{let B=(A==null?void 0:A.month)||"",H=(A==null?void 0:A.year)||"";if((!B||!H)&&(A!=null&&A.file_name)){const K=p(A.file_name);B=B||K.month,H=H||K.year}return{id:A==null?void 0:A.id,prefix:(A==null?void 0:A.prefix)||"",model:(A==null?void 0:A.model)||"",fileName:(A==null?void 0:A.file_name)||"",code:(A==null?void 0:A.stock_id)||"",month:B,year:H,content:(A==null?void 0:A.text_summary)||"",status:(A==null?void 0:A.status)||"",note:(A==null?void 0:A.note)||"",lastUpdate:A==null?void 0:A.updated_at,stock_id:A==null?void 0:A.stock_id}}),h=N=>{if(!(N!=null&&N.data))return[];const S=v(N==null?void 0:N.data);n(S),f(N.pagination.totalPages)},y=async(N=1,S=15)=>{console.log("🚀 ~ fetchData ~ page:",N),m(N);try{const A=await oe.get(`${e}/api/latest-summaries`,{params:{page:N,limit:S}});console.log("🚀 ~ fetchData ~ result.data:",A.data),(A==null?void 0:A.status)===200?h(A.data):console.error(A)}catch(A){console.error("Error fetching data:",A)}finally{m(null),o(!1)}};O.useEffect(()=>{y(a)},[a]);const w=O.useMemo(()=>[{id:"code",header:"Mã",accessorKey:"code",cell:({row:S})=>l.jsx("span",{className:"flex flex-col",children:S.original.code})},{id:"month",header:"Tháng",accessorKey:"month",cell:({row:S})=>{const A=S.original.month,B=S.original.year;return l.jsx("span",{className:"flex flex-col",children:`${A}/${B}`})}},{id:"content",header:"Nội dung",accessorKey:"content",cell:({row:S})=>{const A=S.getValue("content");return l.jsx(oi,{content:l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:A}),children:l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]",children:A})})}},{id:"status",header:"Trạng thái",accessorKey:"status",cell:({row:S})=>{const B=S.original.status!=="unpublish";return l.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0 text-[10px] font-bold ${B?"bg-green-50 text-green-700 ring-1 ring-inset ring-green-600/20":"bg-gray-50 text-gray-600 ring-1 ring-inset ring-gray-500/20"}`,children:B?"PUBLISHED":"UNPUBLISHED"})}},{id:"note",header:"Ghi chú",accessorKey:"note",cell:({row:S})=>l.jsx(oi,{content:l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:S.original.note}),children:l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[20dvw]",children:S.original.note})})},{id:"last-update",header:"Cập nhật",accessorKey:"last-update",cell:({row:S})=>{const A=new Date(S.original.lastUpdate),B=A.getDate(),H=A.getMonth()+1,K=`ngày ${B} tháng ${H}`;return l.jsx("span",{className:"flex flex-col",children:K})}},{accessorKey:"actions",header:()=>l.jsx("div",{className:"font-medium text-right",children:"Hành động"}),cell:({row:S})=>{const[A,B]=O.useState(!1),[H,K]=O.useState(!1),{handleSubmit:$,register:R,reset:D}=px(),G=S.original.id,j=S.getValue("status"),[X,q]=O.useState(!1),ne=async()=>{try{q(!0);const se=await oe.patch(`${e}/api/toggle-publish/${G}`,{id:G,typeAction:"update",status:j,idInput:G,stock_id:S.original.stock_id,prefix:S.original.prefix,model:S.original.model,summary_result:S.original.content,note:S.original.note});se.status===200?y(a):console.error("Failed to toggle publish status:",se)}catch(se){console.error("Error toggling publish status:",se)}finally{q(!1)}},ae=async se=>{B(!0);try{const Ce=await oe.patch(`${e}/api/update-summary`,{note:se.note,text_summary:se.content,id:G});Ce.status===200?(await y(a),K(!1)):console.error("Failed to update summary:",Ce)}catch(Ce){console.error("Error updating summary:",Ce)}return B(!1)};return l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsxs(nn,{open:H,onOpenChange:se=>{K(se),se?D({content:S.original.content,note:S.original.note}):D()},children:[l.jsx(gr,{asChild:!0,children:l.jsx(le,{variant:"outline",size:"sm",onClick:()=>K(!0),className:"px-2 py-0.5 h-7",children:"Sửa"})}),l.jsx(Rt,{className:"rounded-lg sm:px-3 h-[calc(100dvh-200px)] min-w-[calc(100dvw-112px)]",children:l.jsxs(Lt,{className:"flex flex-col gap-3",children:[l.jsx(Vt,{className:"max-sm:hidden text-center",children:"Sửa summary"}),l.jsxs("form",{className:"flex flex-col gap-3 h-full justify-between",onSubmit:$(ae),children:[l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{children:"Nội dung:"}),l.jsx(Cr,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:S.original.answer||"",rows:10,...R("content")})]}),l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{children:"Lưu ý:"}),l.jsx(Cr,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:S.original.note||"",rows:1,...R("note")})]})]}),l.jsx("div",{className:"flex justify-end",children:l.jsx(le,{disabled:A,type:"submit",variant:"default",children:A?l.jsx(we,{className:"h-4 w-4 animate-spin"}):"Ok"})})]})]})})]}),l.jsx(le,{variant:"outline",size:"sm",onClick:ne,disabled:X,className:"w-[70px] px-2 py-0.5 h-7",children:X?l.jsx(we,{className:"h-4 w-4 animate-spin"}):j==="unpublish"?"Publish":"Unpublish"})]})}}],[]),x=_i({data:t,columns:w,state:{columnFilters:s},enableRowSelection:!0,onColumnFiltersChange:i,getFilteredRowModel:pf(),getCoreRowModel:Ai()});return l.jsxs("div",{className:"space-y-4 s3-explr-container",children:[l.jsx("div",{className:"flex items-center space-x-4 s3-explr-toolbar",children:l.jsx(Nt,{placeholder:"Tìm kiếm theo mã...",value:((E=x.getColumn("code"))==null?void 0:E.getFilterValue())??"",onChange:N=>{var S;return(S=x.getColumn("code"))==null?void 0:S.setFilterValue(N.target.value)},className:"max-w-sm"})}),l.jsx("div",{className:"rounded-md border s3-explr-table-container",children:l.jsxs(mr,{className:"s3-explr-table",children:[l.jsx(vr,{className:"s3-explr-table-header",children:x.getHeaderGroups().map(N=>l.jsx(ze,{className:"hover:bg-transparent s3-explr-header-row",children:N.headers.map(S=>l.jsx(Xe,{className:"s3-explr-header-cell",children:S.isPlaceholder?null:Gn(S.column.columnDef.header,S.getContext())},S.id))},N.id))}),l.jsx(yr,{className:"s3-explr-table-body",children:(T=x.getRowModel().rows)!=null&&T.length?(C=x.getRowModel().rows)==null?void 0:C.map(N=>l.jsx(ze,{className:"h-12 s3-explr-row",children:N.getVisibleCells().map(S=>l.jsx(Te,{className:"align-middle s3-explr-cell",children:Gn(S.column.columnDef.cell,S.getContext())},S.id))},N.id)):r?l.jsx(ze,{children:l.jsx(Te,{colSpan:w.length,className:"h-24 text-center",children:"loading..."})}):l.jsx(ze,{children:l.jsx(Te,{colSpan:w.length,className:"h-24 text-center",children:"Không có kết quả."})})})]})}),l.jsx("div",{className:"mt-4",children:l.jsx(si,{children:l.jsxs(ii,{children:[l.jsx(ut,{children:l.jsx(ai,{onClick:()=>u(N=>Math.max(1,N-1)),className:a===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:c},(N,S)=>S+1).filter(N=>N===1||N===c||Math.abs(N-a)<=1).map((N,S,A)=>l.jsxs(l.Fragment,{children:[S>0&&A[S-1]!==N-1&&l.jsx(ut,{children:l.jsx(ci,{})},N+"..."),l.jsx(ut,{children:l.jsx(Ln,{onClick:()=>u(N),isActive:a===N,className:`cursor-pointer ${r?"pointer-events-none":""}`,children:g===N?l.jsx(we,{className:"h-4 w-4 animate-spin"}):N})},N)]})),l.jsx(ut,{children:l.jsx(li,{onClick:()=>u(N=>Math.min(c,N+1)),className:a===c||g!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})})]})},vd=10,hx=O.memo(({apiBaseUrl:e="http://localhost:3000"})=>{const[t,n]=O.useState(1),[r,o]=O.useState([]),[s,i]=O.useState({total:0,page:1,limit:vd,totalPages:1}),[a,u]=O.useState(!0),[c,f]=O.useState(null),[g,m]=O.useState(new Set),{toast:p}=Ps(),[v,h]=O.useState(!1),y=async C=>{try{f(C);const N=await oe.get(`${e}/api/jobs`,{params:{page:C.toString(),limit:vd.toString()}});o(N.data.data),i(N.data.pagination)}catch{p({variant:"destructive",title:"Error",description:"Failed to fetch jobs. Please try again."})}finally{f(null),u(!1)}};O.useEffect(()=>{y(t)},[t,e]);const w=async C=>{m(N=>new Set(N).add(C.toString()));try{await oe.post(`${e}/api/retry-job`,{jobId:C}),p({title:"Job Restarted",description:`Job ${C} has been successfully restarted.`}),y(t)}catch{p({variant:"destructive",title:"Retry Failed",description:`Failed to restart job ${C}. Please try again.`})}finally{m(N=>{const S=new Set(N);return S.delete(C.toString()),S})}},x=async()=>{h(!0),n(1),await y(1),h(!1)},E=C=>new Date(C).toLocaleString(),T=C=>{if(C=parseFloat(C),C<60)return`${C.toFixed(2)}s`;const N=Math.floor(C/60),S=(C%60).toFixed(0);return`${N}m ${S}s`};return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[l.jsx(Up,{className:"w-8 h-8 text-primary"}),l.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Job Management"}),l.jsx(le,{variant:"outline",size:"icon",onClick:x,disabled:v||a,className:"ml-2",children:l.jsx(qp,{className:`h-4 w-4 ${v?"animate-spin":""}`})})]}),l.jsx("div",{className:"rounded-md border",children:l.jsxs(mr,{children:[l.jsx(vr,{children:l.jsxs(ze,{children:[l.jsx(Xe,{children:"ID"}),l.jsx(Xe,{children:"Tên Công Việc"}),l.jsx(Xe,{children:"Thời Gian Bắt Đầu"}),l.jsx(Xe,{children:"Thời Gian Cập Nhật"}),l.jsx(Xe,{children:"Thời Gian Thực Thi"}),l.jsx(Xe,{children:"Trạng Thái"}),l.jsx(Xe,{children:"Thao Tác"})]})}),l.jsx(yr,{children:a&&r.length===0?l.jsx(ze,{children:l.jsx(Te,{colSpan:7,className:"text-center py-4",children:l.jsx(we,{className:"w-6 h-6 animate-spin mx-auto"})})}):r.map(C=>{var N,S;return l.jsxs(ze,{children:[l.jsx(Te,{className:"!w-[100px]",children:C.id}),l.jsx(Te,{className:"font-medium",children:(N=C.job_name)==null?void 0:N.replace("Upload file","Summary")}),l.jsx(Te,{className:"!w-[200px]",children:E(C.created_at)}),l.jsx(Te,{className:"!w-[200px]",children:E(C.updated_at)}),l.jsx(Te,{className:"!w-[150px]",children:T(C.execution_time_seconds)}),l.jsx(Te,{className:"!w-[200px]",children:l.jsx(oi,{content:C.status==="fail"&&C.error?l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:C.error}):null,children:l.jsx("div",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]
132
- ${C.status==="done"?"bg-green-100 text-green-800":C.status==="fail"?"bg-red-100 text-red-800":"bg-yellow-100 text-yellow-800"}`,children:C.status==="fail"?"FAILED":(S=C.status)==null?void 0:S.toUpperCase()})})}),l.jsx(Te,{className:"!w-[200px]",children:C.status==="fail"?l.jsx(le,{variant:"outline",size:"sm",onClick:()=>w(C.id),disabled:g.has(C.id.toString()),className:"h-[32px]",children:g.has(C.id.toString())?l.jsxs(l.Fragment,{children:[l.jsx(we,{className:"mr-2 h-4 w-4 animate-spin"}),"Đang thử lại..."]}):"Thử Lại"}):l.jsx("div",{className:"h-[32px]"})})]},C.id)})})]})}),l.jsx("div",{className:"mt-4",children:l.jsx(si,{children:l.jsxs(ii,{children:[l.jsx(ut,{children:l.jsx(ai,{onClick:()=>n(C=>Math.max(1,C-1)),className:t===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:s.totalPages},(C,N)=>N+1).filter(C=>C===1||C===s.totalPages||Math.abs(C-t)<=1).map((C,N,S)=>l.jsxs(l.Fragment,{children:[N>0&&S[N-1]!==C-1&&l.jsx(ut,{children:l.jsx(ci,{})},C+"..."),l.jsx(ut,{children:l.jsx(Ln,{onClick:()=>n(C),isActive:t===C,className:`cursor-pointer ${c!==null?"pointer-events-none":""}`,children:c===C?l.jsx(we,{className:"h-4 w-4 animate-spin"}):C})},C)]})),l.jsx(ut,{children:l.jsx(li,{onClick:()=>n(C=>Math.min(s.totalPages,C+1)),className:t===s.totalPages||c!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})}),l.jsx(Hc,{})]})});Le.Job=hx,Le.S3Explorer=Gb,Le.Summary=gx,Object.defineProperty(Le,Symbol.toStringTag,{value:"Module"})});
136
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return d.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},um="DialogDescriptionWarning",dm=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Dl(um).contentName}}.`;return d.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},fm=yl,pm=bl,gm=Cl,Ml=Sl,$l=El,kl=Tl,Il=Al,hm=Fl;const zt=fm,gr=pm,mm=gm,Rl=d.forwardRef(({className:e,...t},n)=>l.jsx(Ml,{ref:n,className:Z("s3-explr-ui-dialog-overlay fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Rl.displayName=Ml.displayName;const Tt=d.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(mm,{children:[l.jsx(Rl,{}),l.jsxs($l,{ref:r,className:Z("s3-explr-ui-dialog-content fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,l.jsxs(hm,{className:Z("s3-explr-ui-dialog-close absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"),children:[l.jsx(Fo,{className:"s3-explr-ui-dialog-close-icon h-4 w-4"}),l.jsx("span",{className:"s3-explr-ui-dialog-close-text sr-only",children:"Close"})]})]})]}));Tt.displayName=$l.displayName;const Pt=({className:e,...t})=>l.jsx("div",{className:Z("s3-explr-ui-dialog-header flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Pt.displayName="DialogHeader";const En=({className:e,...t})=>l.jsx("div",{className:Z("s3-explr-ui-dialog-footer flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});En.displayName="DialogFooter";const At=d.forwardRef(({className:e,...t},n)=>l.jsx(kl,{ref:n,className:Z("s3-explr-ui-dialog-title text-lg font-semibold leading-none tracking-tight",e),...t}));At.displayName=kl.displayName;const hr=d.forwardRef(({className:e,...t},n)=>l.jsx(Il,{ref:n,className:Z("s3-explr-ui-dialog-description text-sm text-muted-foreground",e),...t}));hr.displayName=Il.displayName;const _t=d.forwardRef(({className:e,type:t,...n},r)=>l.jsx("input",{type:t,className:Z("s3-explr-ui-input","flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));_t.displayName="Input";var vm="Label",Ll=d.forwardRef((e,t)=>l.jsx(ve.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Ll.displayName=vm;var Vl=Ll;const ym=Ro("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 s3-explr-ui-label",{variants:{variant:{default:"s3-explr-ui-label-default",required:"s3-explr-ui-label-required",disabled:"s3-explr-ui-label-disabled"},size:{default:"s3-explr-ui-label-size-default",sm:"s3-explr-ui-label-size-sm",lg:"s3-explr-ui-label-size-lg"}},defaultVariants:{variant:"default",size:"default"}}),Ht=d.forwardRef(({className:e,variant:t,size:n,...r},o)=>l.jsx(Vl,{ref:o,className:Z(ym({variant:t,size:n}),e),...r}));Ht.displayName=Vl.displayName;const mr=d.forwardRef(({className:e,...t},n)=>l.jsx("div",{className:Z("relative w-full overflow-auto","s3-explr-ui-table-container"),children:l.jsx("table",{ref:n,className:Z("w-full caption-bottom text-sm","s3-explr-ui-table",e),...t})}));mr.displayName="Table";const vr=d.forwardRef(({className:e,...t},n)=>l.jsx("thead",{ref:n,className:Z("[&_tr]:border-b","s3-explr-ui-table-header",e),...t}));vr.displayName="TableHeader";const yr=d.forwardRef(({className:e,...t},n)=>l.jsx("tbody",{ref:n,className:Z("[&_tr:last-child]:border-0","s3-explr-ui-table-body",e),...t}));yr.displayName="TableBody";const wm=d.forwardRef(({className:e,...t},n)=>l.jsx("tfoot",{ref:n,className:Z("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0","s3-explr-ui-table-footer",e),...t}));wm.displayName="TableFooter";const Ge=d.forwardRef(({className:e,...t},n)=>l.jsx("tr",{ref:n,className:Z("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted","s3-explr-ui-table-row",e),...t}));Ge.displayName="TableRow";const et=d.forwardRef(({className:e,...t},n)=>l.jsx("th",{ref:n,className:Z("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-head",e),...t}));et.displayName="TableHead";const Ae=d.forwardRef(({className:e,...t},n)=>l.jsx("td",{ref:n,className:Z("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-cell",e),...t}));Ae.displayName="TableCell";const bm=d.forwardRef(({className:e,...t},n)=>l.jsx("caption",{ref:n,className:Z("mt-4 text-sm text-muted-foreground","s3-explr-ui-table-caption",e),...t}));bm.displayName="TableCaption";function rs(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function on(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Bl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function os(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Bl(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Bl(e[o],null)}}}}function ss(...e){return d.useCallback(os(...e),e)}var is=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Cm);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(as,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(as,{...r,ref:t,children:n})});is.displayName="Slot";var as=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Em(n);return d.cloneElement(n,{...Sm(r,n.props),ref:t?os(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});as.displayName="SlotClone";var xm=({children:e})=>l.jsx(l.Fragment,{children:e});function Cm(e){return d.isValidElement(e)&&e.type===xm}function Sm(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Em(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Nm(e){const t=e+"CollectionProvider",[n,r]=St(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:h}=p,y=D.useRef(null),w=D.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:h})};i.displayName=t;const a=e+"CollectionSlot",u=D.forwardRef((p,v)=>{const{scope:h,children:y}=p,w=s(a,h),x=ss(v,w.collectionRef);return l.jsx(is,{ref:x,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",g=D.forwardRef((p,v)=>{const{scope:h,children:y,...w}=p,x=D.useRef(null),S=ss(v,x),E=s(c,h);return D.useEffect(()=>(E.itemMap.set(x,{ref:x,...w}),()=>void E.itemMap.delete(x))),l.jsx(is,{[f]:"",ref:S,children:y})});g.displayName=c;function m(p){const v=s(e+"CollectionConsumer",p);return D.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((E,C)=>w.indexOf(E.ref.current)-w.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:g},m,r]}var zl=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Pm);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(ls,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(ls,{...r,ref:t,children:n})});zl.displayName="Slot";var ls=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=_m(n);return d.cloneElement(n,{...Am(r,n.props),ref:t?os(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});ls.displayName="SlotClone";var Tm=({children:e})=>l.jsx(l.Fragment,{children:e});function Pm(e){return d.isValidElement(e)&&e.type===Tm}function Am(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function _m(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Fm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Hl=Fm.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?zl:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Om=d.createContext(void 0);function Ul(e){const t=d.useContext(Om);return e||t||"ltr"}var cs="rovingFocusGroup.onEntryFocus",Dm={bubbles:!1,cancelable:!0},wr="RovingFocusGroup",[us,jl,Mm]=Nm(wr),[$m,Wl]=St(wr,[Mm]),[km,Im]=$m(wr),Gl=d.forwardRef((e,t)=>l.jsx(us.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(us.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Rm,{...e,ref:t})})}));Gl.displayName=wr;var Rm=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:f=!1,...g}=e,m=d.useRef(null),p=ss(t,m),v=Ul(s),[h=null,y]=Yt({prop:i,defaultProp:a,onChange:u}),[w,x]=d.useState(!1),S=Ne(c),E=jl(n),C=d.useRef(!1),[P,_]=d.useState(0);return d.useEffect(()=>{const O=m.current;if(O)return O.addEventListener(cs,S),()=>O.removeEventListener(cs,S)},[S]),l.jsx(km,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:h,onItemFocus:d.useCallback(O=>y(O),[y]),onItemShiftTab:d.useCallback(()=>x(!0),[]),onFocusableItemAdd:d.useCallback(()=>_(O=>O+1),[]),onFocusableItemRemove:d.useCallback(()=>_(O=>O-1),[]),children:l.jsx(Hl.div,{tabIndex:w||P===0?-1:0,"data-orientation":r,...g,ref:p,style:{outline:"none",...e.style},onMouseDown:on(e.onMouseDown,()=>{C.current=!0}),onFocus:on(e.onFocus,O=>{const $=!C.current;if(O.target===O.currentTarget&&$&&!w){const F=new CustomEvent(cs,Dm);if(O.currentTarget.dispatchEvent(F),!F.defaultPrevented){const G=E().filter(j=>j.focusable),k=G.find(j=>j.active),R=G.find(j=>j.id===h),q=[k,R,...G].filter(Boolean).map(j=>j.ref.current);Xl(q,f)}}C.current=!1}),onBlur:on(e.onBlur,()=>x(!1))})})}),ql="RovingFocusGroupItem",Kl=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...i}=e,a=Qt(),u=s||a,c=Im(ql,n),f=c.currentTabStopId===u,g=jl(n),{onFocusableItemAdd:m,onFocusableItemRemove:p}=c;return d.useEffect(()=>{if(r)return m(),()=>p()},[r,m,p]),l.jsx(us.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:l.jsx(Hl.span,{tabIndex:f?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:on(e.onMouseDown,v=>{r?c.onItemFocus(u):v.preventDefault()}),onFocus:on(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:on(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const h=Bm(v,c.orientation,c.dir);if(h!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let w=g().filter(x=>x.focusable).map(x=>x.ref.current);if(h==="last")w.reverse();else if(h==="prev"||h==="next"){h==="prev"&&w.reverse();const x=w.indexOf(v.currentTarget);w=c.loop?zm(w,x+1):w.slice(x+1)}setTimeout(()=>Xl(w))}})})})});Kl.displayName=ql;var Lm={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Vm(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Bm(e,t,n){const r=Vm(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Lm[r]}function Xl(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function zm(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Hm=Gl,Um=Kl;function Jl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function jm(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Jl(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Jl(e[o],null)}}}}function Wm(...e){return d.useCallback(jm(...e),e)}function Gm(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var Yl=e=>{const{present:t,children:n}=e,r=qm(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=Wm(r.ref,Km(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};Yl.displayName="Presence";function qm(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=Gm(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=br(r.current);s.current=a==="mounted"?c:"none"},[a]),ke(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,p=br(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&m!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),ke(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const h=br(r.current).includes(p.animationName);if(p.target===t&&h&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},m=p=>{p.target===t&&(s.current=br(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function br(e){return(e==null?void 0:e.animationName)||"none"}function Km(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Zl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Xm(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Zl(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Zl(e[o],null)}}}}var Ql=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Ym);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(ds,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(ds,{...r,ref:t,children:n})});Ql.displayName="Slot";var ds=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Qm(n);return d.cloneElement(n,{...Zm(r,n.props),ref:t?Xm(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});ds.displayName="SlotClone";var Jm=({children:e})=>l.jsx(l.Fragment,{children:e});function Ym(e){return d.isValidElement(e)&&e.type===Jm}function Zm(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Qm(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ev=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],xr=ev.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Ql:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),fs="Tabs",[tv,Hx]=St(fs,[Wl]),ec=Wl(),[nv,ps]=tv(fs),tc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:u="automatic",...c}=e,f=Ul(a),[g,m]=Yt({prop:r,onChange:o,defaultProp:s});return l.jsx(nv,{scope:n,baseId:Qt(),value:g,onValueChange:m,orientation:i,dir:f,activationMode:u,children:l.jsx(xr.div,{dir:f,"data-orientation":i,...c,ref:t})})});tc.displayName=fs;var nc="TabsList",rc=d.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=ps(nc,n),i=ec(n);return l.jsx(Hm,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:l.jsx(xr.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});rc.displayName=nc;var oc="TabsTrigger",sc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=ps(oc,n),a=ec(n),u=lc(i.baseId,r),c=cc(i.baseId,r),f=r===i.value;return l.jsx(Um,{asChild:!0,...a,focusable:!o,active:f,children:l.jsx(xr.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":c,"data-state":f?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...s,ref:t,onMouseDown:rs(e.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?i.onValueChange(r):g.preventDefault()}),onKeyDown:rs(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&i.onValueChange(r)}),onFocus:rs(e.onFocus,()=>{const g=i.activationMode!=="manual";!f&&!o&&g&&i.onValueChange(r)})})})});sc.displayName=oc;var ic="TabsContent",ac=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=ps(ic,n),u=lc(a.baseId,r),c=cc(a.baseId,r),f=r===a.value,g=d.useRef(f);return d.useEffect(()=>{const m=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(m)},[]),l.jsx(Yl,{present:o||f,children:({present:m})=>l.jsx(xr.div,{"data-state":f?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":u,hidden:!m,id:c,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:m&&s})})});ac.displayName=ic;function lc(e,t){return`${e}-trigger-${t}`}function cc(e,t){return`${e}-content-${t}`}var rv=tc,uc=rc,dc=sc,fc=ac;const ov=rv,pc=d.forwardRef(({className:e,...t},n)=>l.jsx(uc,{ref:n,className:Z("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));pc.displayName=uc.displayName;const gs=d.forwardRef(({className:e,...t},n)=>l.jsx(dc,{ref:n,className:Z("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));gs.displayName=dc.displayName;const hs=d.forwardRef(({className:e,...t},n)=>l.jsx(fc,{ref:n,className:Z("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));hs.displayName=fc.displayName;const Cr=d.forwardRef(({className:e,...t},n)=>l.jsx("textarea",{className:Z("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));Cr.displayName="Textarea";function sv(e,t=[]){let n=[];function r(s,i){const a=d.createContext(i),u=n.length;n=[...n,i];function c(g){const{scope:m,children:p,...v}=g,h=(m==null?void 0:m[e][u])||a,y=d.useMemo(()=>v,Object.values(v));return l.jsx(h.Provider,{value:y,children:p})}function f(g,m){const p=(m==null?void 0:m[e][u])||a,v=d.useContext(p);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${g}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,f]}const o=()=>{const s=n.map(i=>d.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return d.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return o.scopeName=e,[r,iv(o,...t)]}function iv(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:u,scopeName:c})=>{const g=u(s)[`__scope${c}`];return{...a,...g}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var ms=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(lv);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(vs,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(vs,{...r,ref:t,children:n})});ms.displayName="Slot";var vs=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=uv(n);return d.cloneElement(n,{...cv(r,n.props),ref:t?or(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});vs.displayName="SlotClone";var av=({children:e})=>l.jsx(l.Fragment,{children:e});function lv(e){return d.isValidElement(e)&&e.type===av}function cv(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function uv(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function dv(e){const t=e+"CollectionProvider",[n,r]=sv(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:h}=p,y=D.useRef(null),w=D.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:h})};i.displayName=t;const a=e+"CollectionSlot",u=D.forwardRef((p,v)=>{const{scope:h,children:y}=p,w=s(a,h),x=Le(v,w.collectionRef);return l.jsx(ms,{ref:x,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",g=D.forwardRef((p,v)=>{const{scope:h,children:y,...w}=p,x=D.useRef(null),S=Le(v,x),E=s(c,h);return D.useEffect(()=>(E.itemMap.set(x,{ref:x,...w}),()=>void E.itemMap.delete(x))),l.jsx(ms,{[f]:"",ref:S,children:y})});g.displayName=c;function m(p){const v=s(e+"CollectionConsumer",p);return D.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((E,C)=>w.indexOf(E.ref.current)-w.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:g},m,r]}var fv="VisuallyHidden",ys=d.forwardRef((e,t)=>l.jsx(ve.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));ys.displayName=fv;var ws="ToastProvider",[bs,pv,gv]=dv("Toast"),[gc,Ux]=St("Toast",[gv]),[hv,Sr]=gc(ws),hc=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:s=50,children:i}=e,[a,u]=d.useState(null),[c,f]=d.useState(0),g=d.useRef(!1),m=d.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${ws}\`. Expected non-empty \`string\`.`),l.jsx(bs.Provider,{scope:t,children:l.jsx(hv,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:s,toastCount:c,viewport:a,onViewportChange:u,onToastAdd:d.useCallback(()=>f(p=>p+1),[]),onToastRemove:d.useCallback(()=>f(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:g,isClosePausedRef:m,children:i})})};hc.displayName=ws;var mc="ToastViewport",mv=["F8"],xs="toast.viewportPause",Cs="toast.viewportResume",vc=d.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=mv,label:o="Notifications ({hotkey})",...s}=e,i=Sr(mc,n),a=pv(n),u=d.useRef(null),c=d.useRef(null),f=d.useRef(null),g=d.useRef(null),m=Le(t,g,i.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=i.toastCount>0;d.useEffect(()=>{const y=w=>{var S;r.length!==0&&r.every(E=>w[E]||w.code===E)&&((S=g.current)==null||S.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),d.useEffect(()=>{const y=u.current,w=g.current;if(v&&y&&w){const x=()=>{if(!i.isClosePausedRef.current){const P=new CustomEvent(xs);w.dispatchEvent(P),i.isClosePausedRef.current=!0}},S=()=>{if(i.isClosePausedRef.current){const P=new CustomEvent(Cs);w.dispatchEvent(P),i.isClosePausedRef.current=!1}},E=P=>{!y.contains(P.relatedTarget)&&S()},C=()=>{y.contains(document.activeElement)||S()};return y.addEventListener("focusin",x),y.addEventListener("focusout",E),y.addEventListener("pointermove",x),y.addEventListener("pointerleave",C),window.addEventListener("blur",x),window.addEventListener("focus",S),()=>{y.removeEventListener("focusin",x),y.removeEventListener("focusout",E),y.removeEventListener("pointermove",x),y.removeEventListener("pointerleave",C),window.removeEventListener("blur",x),window.removeEventListener("focus",S)}}},[v,i.isClosePausedRef]);const h=d.useCallback(({tabbingDirection:y})=>{const x=a().map(S=>{const E=S.ref.current,C=[E,..._v(E)];return y==="forwards"?C:C.reverse()});return(y==="forwards"?x.reverse():x).flat()},[a]);return d.useEffect(()=>{const y=g.current;if(y){const w=x=>{var C,P,_;const S=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!S){const O=document.activeElement,$=x.shiftKey;if(x.target===y&&$){(C=c.current)==null||C.focus();return}const k=h({tabbingDirection:$?"backwards":"forwards"}),R=k.findIndex(M=>M===O);Ns(k.slice(R+1))?x.preventDefault():$?(P=c.current)==null||P.focus():(_=f.current)==null||_.focus()}};return y.addEventListener("keydown",w),()=>y.removeEventListener("keydown",w)}},[a,h]),l.jsxs(sh,{ref:u,role:"region","aria-label":o.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&l.jsx(Ss,{ref:c,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"forwards"});Ns(y)}}),l.jsx(bs.Slot,{scope:n,children:l.jsx(ve.ol,{tabIndex:-1,...s,ref:m})}),v&&l.jsx(Ss,{ref:f,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"backwards"});Ns(y)}})]})});vc.displayName=mc;var yc="ToastFocusProxy",Ss=d.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,s=Sr(yc,n);return l.jsx(ys,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:i=>{var c;const a=i.relatedTarget;!((c=s.viewport)!=null&&c.contains(a))&&r()}})});Ss.displayName=yc;var Er="Toast",vv="toast.swipeStart",yv="toast.swipeMove",wv="toast.swipeCancel",bv="toast.swipeEnd",wc=d.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:s,...i}=e,[a=!0,u]=Yt({prop:r,defaultProp:o,onChange:s});return l.jsx(Zt,{present:n||a,children:l.jsx(Sv,{open:a,...i,ref:t,onClose:()=>u(!1),onPause:Ne(e.onPause),onResume:Ne(e.onResume),onSwipeStart:me(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:me(e.onSwipeMove,c=>{const{x:f,y:g}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${g}px`)}),onSwipeCancel:me(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:me(e.onSwipeEnd,c=>{const{x:f,y:g}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${g}px`),u(!1)})})})});wc.displayName=Er;var[xv,Cv]=gc(Er,{onClose(){}}),Sv=d.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:s,onClose:i,onEscapeKeyDown:a,onPause:u,onResume:c,onSwipeStart:f,onSwipeMove:g,onSwipeCancel:m,onSwipeEnd:p,...v}=e,h=Sr(Er,n),[y,w]=d.useState(null),x=Le(t,M=>w(M)),S=d.useRef(null),E=d.useRef(null),C=o||h.duration,P=d.useRef(0),_=d.useRef(C),O=d.useRef(0),{onToastAdd:$,onToastRemove:F}=h,G=Ne(()=>{var q;(y==null?void 0:y.contains(document.activeElement))&&((q=h.viewport)==null||q.focus()),i()}),k=d.useCallback(M=>{!M||M===1/0||(window.clearTimeout(O.current),P.current=new Date().getTime(),O.current=window.setTimeout(G,M))},[G]);d.useEffect(()=>{const M=h.viewport;if(M){const q=()=>{k(_.current),c==null||c()},j=()=>{const X=new Date().getTime()-P.current;_.current=_.current-X,window.clearTimeout(O.current),u==null||u()};return M.addEventListener(xs,j),M.addEventListener(Cs,q),()=>{M.removeEventListener(xs,j),M.removeEventListener(Cs,q)}}},[h.viewport,C,u,c,k]),d.useEffect(()=>{s&&!h.isClosePausedRef.current&&k(C)},[s,C,h.isClosePausedRef,k]),d.useEffect(()=>($(),()=>F()),[$,F]);const R=d.useMemo(()=>y?Tc(y):null,[y]);return h.viewport?l.jsxs(l.Fragment,{children:[R&&l.jsx(Ev,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:R}),l.jsx(xv,{scope:n,onClose:G,children:zn.createPortal(l.jsx(bs.ItemSlot,{scope:n,children:l.jsx(oh,{asChild:!0,onEscapeKeyDown:me(a,()=>{h.isFocusedToastEscapeKeyDownRef.current||G(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(ve.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":h.swipeDirection,...v,ref:x,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:me(e.onKeyDown,M=>{M.key==="Escape"&&(a==null||a(M.nativeEvent),M.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,G()))}),onPointerDown:me(e.onPointerDown,M=>{M.button===0&&(S.current={x:M.clientX,y:M.clientY})}),onPointerMove:me(e.onPointerMove,M=>{if(!S.current)return;const q=M.clientX-S.current.x,j=M.clientY-S.current.y,X=!!E.current,K=["left","right"].includes(h.swipeDirection),ee=["left","up"].includes(h.swipeDirection)?Math.min:Math.max,ie=K?ee(0,q):0,de=K?0:ee(0,j),Fe=M.pointerType==="touch"?10:2,xe={x:ie,y:de},Be={originalEvent:M,delta:xe};X?(E.current=xe,Nr(yv,g,Be,{discrete:!1})):Pc(xe,h.swipeDirection,Fe)?(E.current=xe,Nr(vv,f,Be,{discrete:!1}),M.target.setPointerCapture(M.pointerId)):(Math.abs(q)>Fe||Math.abs(j)>Fe)&&(S.current=null)}),onPointerUp:me(e.onPointerUp,M=>{const q=E.current,j=M.target;if(j.hasPointerCapture(M.pointerId)&&j.releasePointerCapture(M.pointerId),E.current=null,S.current=null,q){const X=M.currentTarget,K={originalEvent:M,delta:q};Pc(q,h.swipeDirection,h.swipeThreshold)?Nr(bv,p,K,{discrete:!0}):Nr(wv,m,K,{discrete:!0}),X.addEventListener("click",ee=>ee.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),Ev=e=>{const{__scopeToast:t,children:n,...r}=e,o=Sr(Er,t),[s,i]=d.useState(!1),[a,u]=d.useState(!1);return Pv(()=>i(!0)),d.useEffect(()=>{const c=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:l.jsx(Wo,{asChild:!0,children:l.jsx(ys,{...r,children:s&&l.jsxs(l.Fragment,{children:[o.label," ",n]})})})},Nv="ToastTitle",bc=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(ve.div,{...r,ref:t})});bc.displayName=Nv;var Tv="ToastDescription",xc=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(ve.div,{...r,ref:t})});xc.displayName=Tv;var Cc="ToastAction",Sc=d.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?l.jsx(Nc,{altText:n,asChild:!0,children:l.jsx(Es,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Cc}\`. Expected non-empty \`string\`.`),null)});Sc.displayName=Cc;var Ec="ToastClose",Es=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=Cv(Ec,n);return l.jsx(Nc,{asChild:!0,children:l.jsx(ve.button,{type:"button",...r,ref:t,onClick:me(e.onClick,o.onClose)})})});Es.displayName=Ec;var Nc=d.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return l.jsx(ve.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function Tc(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),Av(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!o)if(s){const i=r.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...Tc(r))}}),t}function Nr(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?ka(o,s):o.dispatchEvent(s)}var Pc=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),s=r>o;return t==="left"||t==="right"?s&&r>n:!s&&o>n};function Pv(e=()=>{}){const t=Ne(e);ke(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function Av(e){return e.nodeType===e.ELEMENT_NODE}function _v(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ns(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var Fv=hc,Ac=vc,_c=wc,Fc=bc,Oc=xc,Dc=Sc,Mc=Es;const Ov=Fv,$c=d.forwardRef(({className:e,...t},n)=>l.jsx(Ac,{ref:n,className:Z("s3-explr-ui-toast-viewport fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));$c.displayName=Ac.displayName;const Dv=Ro("s3-explr-ui-toast group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"s3-explr-ui-toast-default border bg-background text-foreground",destructive:"s3-explr-ui-toast-destructive destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),kc=d.forwardRef(({className:e,variant:t,...n},r)=>l.jsx(_c,{ref:r,className:Z(Dv({variant:t}),e),...n}));kc.displayName=_c.displayName;const Mv=d.forwardRef(({className:e,...t},n)=>l.jsx(Dc,{ref:n,className:Z("s3-explr-ui-toast-action inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Mv.displayName=Dc.displayName;const Ic=d.forwardRef(({className:e,...t},n)=>l.jsx(Mc,{ref:n,className:Z("s3-explr-ui-toast-close absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:l.jsx(Fo,{className:"s3-explr-ui-toast-close-icon h-4 w-4"})}));Ic.displayName=Mc.displayName;const Rc=d.forwardRef(({className:e,...t},n)=>l.jsx(Fc,{ref:n,className:Z("s3-explr-ui-toast-title text-sm font-semibold [&+div]:text-xs",e),...t}));Rc.displayName=Fc.displayName;const Lc=d.forwardRef(({className:e,...t},n)=>l.jsx(Oc,{ref:n,className:Z("s3-explr-ui-toast-description text-sm opacity-90",e),...t}));Lc.displayName=Oc.displayName;const $v=1,kv=1e6;let Ts=0;function Iv(){return Ts=(Ts+1)%Number.MAX_SAFE_INTEGER,Ts.toString()}const Ps=new Map,Vc=e=>{if(Ps.has(e))return;const t=setTimeout(()=>{Ps.delete(e),Nn({type:"REMOVE_TOAST",toastId:e})},kv);Ps.set(e,t)},Rv=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,$v)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?Vc(n):e.toasts.forEach(r=>{Vc(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Tr=[];let Pr={toasts:[]};function Nn(e){Pr=Rv(Pr,e),Tr.forEach(t=>{t(Pr)})}function Lv({...e}){const t=Iv(),n=o=>Nn({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>Nn({type:"DISMISS_TOAST",toastId:t});return Nn({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function As(){const[e,t]=d.useState(Pr);return d.useEffect(()=>(Tr.push(t),()=>{const n=Tr.indexOf(t);n>-1&&Tr.splice(n,1)}),[e]),{...e,toast:Lv,dismiss:n=>Nn({type:"DISMISS_TOAST",toastId:n})}}function Bc(){const{toasts:e}=As();return l.jsxs(Ov,{children:[e.map(function({id:t,title:n,description:r,action:o,...s}){return l.jsxs(kc,{...s,className:`s3-explr-ui-toast ${s.className||""}`,children:[l.jsxs("div",{className:"s3-explr-ui-toast-content grid gap-1",children:[n&&l.jsx(Rc,{className:"s3-explr-ui-toast-title",children:n}),r&&l.jsx(Lc,{className:"s3-explr-ui-toast-description",children:r})]}),o&&l.jsx("div",{className:"s3-explr-ui-toast-action",children:o}),l.jsx(Ic,{className:"s3-explr-ui-toast-close"})]},t)}),l.jsx($c,{className:"s3-explr-ui-toast-viewport"})]})}function ut(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function zc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Vv(...e){return t=>{let n=!1;const r=e.map(o=>{const s=zc(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():zc(e[o],null)}}}}function Tn(...e){return d.useCallback(Vv(...e),e)}var Bv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Pn=Bv.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Kt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function zv(e,t){e&&zn.flushSync(()=>e.dispatchEvent(t))}var Hv="DismissableLayer",_s="dismissableLayer.update",Uv="dismissableLayer.pointerDownOutside",jv="dismissableLayer.focusOutside",Hc,Uc=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),jc=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,c=d.useContext(Uc),[f,g]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=d.useState({}),v=Tn(t,_=>g(_)),h=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=h.indexOf(y),x=f?h.indexOf(f):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,E=x>=w,C=qv(_=>{const O=_.target,$=[...c.branches].some(F=>F.contains(O));!E||$||(o==null||o(_),i==null||i(_),_.defaultPrevented||a==null||a())},m),P=Kv(_=>{const O=_.target;[...c.branches].some(F=>F.contains(O))||(s==null||s(_),i==null||i(_),_.defaultPrevented||a==null||a())},m);return za(_=>{x===c.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&a&&(_.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Hc=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),Wc(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Hc)}},[f,m,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),Wc())},[f,c]),d.useEffect(()=>{const _=()=>p({});return document.addEventListener(_s,_),()=>document.removeEventListener(_s,_)},[]),l.jsx(Pn.div,{...u,ref:v,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:ut(e.onFocusCapture,P.onFocusCapture),onBlurCapture:ut(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:ut(e.onPointerDownCapture,C.onPointerDownCapture)})});jc.displayName=Hv;var Wv="DismissableLayerBranch",Gv=d.forwardRef((e,t)=>{const n=d.useContext(Uc),r=d.useRef(null),o=Tn(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(Pn.div,{...e,ref:o})});Gv.displayName=Wv;function qv(e,t=globalThis==null?void 0:globalThis.document){const n=Ne(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){Gc(Uv,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Kv(e,t=globalThis==null?void 0:globalThis.document){const n=Ne(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&Gc(jv,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Wc(){const e=new CustomEvent(_s);document.dispatchEvent(e)}function Gc(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?zv(o,s):o.dispatchEvent(s)}const Xv=["top","right","bottom","left"],Ft=Math.min,Ie=Math.max,Ar=Math.round,_r=Math.floor,tt=e=>({x:e,y:e}),Jv={left:"right",right:"left",bottom:"top",top:"bottom"},Yv={start:"end",end:"start"};function Fs(e,t,n){return Ie(e,Ft(t,n))}function dt(e,t){return typeof e=="function"?e(t):e}function ft(e){return e.split("-")[0]}function sn(e){return e.split("-")[1]}function Os(e){return e==="x"?"y":"x"}function Ds(e){return e==="y"?"height":"width"}function Ot(e){return["top","bottom"].includes(ft(e))?"y":"x"}function Ms(e){return Os(Ot(e))}function Zv(e,t,n){n===void 0&&(n=!1);const r=sn(e),o=Ms(e),s=Ds(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Fr(i)),[i,Fr(i)]}function Qv(e){const t=Fr(e);return[$s(e),t,$s(t)]}function $s(e){return e.replace(/start|end/g,t=>Yv[t])}function ey(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function ty(e,t,n,r){const o=sn(e);let s=ey(ft(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map($s)))),s}function Fr(e){return e.replace(/left|right|bottom|top/g,t=>Jv[t])}function ny(e){return{top:0,right:0,bottom:0,left:0,...e}}function qc(e){return typeof e!="number"?ny(e):{top:e,right:e,bottom:e,left:e}}function Or(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Kc(e,t,n){let{reference:r,floating:o}=e;const s=Ot(t),i=Ms(t),a=Ds(i),u=ft(t),c=s==="y",f=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let p;switch(u){case"top":p={x:f,y:r.y-o.height};break;case"bottom":p={x:f,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:g};break;case"left":p={x:r.x-o.width,y:g};break;default:p={x:r.x,y:r.y}}switch(sn(t)){case"start":p[i]-=m*(n&&c?-1:1);break;case"end":p[i]+=m*(n&&c?-1:1);break}return p}const ry=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:g}=Kc(c,r,u),m=r,p={},v=0;for(let h=0;h<a.length;h++){const{name:y,fn:w}=a[h],{x,y:S,data:E,reset:C}=await w({x:f,y:g,initialPlacement:r,placement:m,strategy:o,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});f=x??f,g=S??g,p={...p,[y]:{...p[y],...E}},C&&v<=50&&(v++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(c=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:f,y:g}=Kc(c,m,u)),h=-1)}return{x:f,y:g,placement:m,strategy:o,middlewareData:p}};async function An(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:g="floating",altBoundary:m=!1,padding:p=0}=dt(t,e),v=qc(p),y=a[m?g==="floating"?"reference":"floating":g],w=Or(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:u})),x=g==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),E=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},C=Or(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:S,strategy:u}):x);return{top:(w.top-C.top+v.top)/E.y,bottom:(C.bottom-w.bottom+v.bottom)/E.y,left:(w.left-C.left+v.left)/E.x,right:(C.right-w.right+v.right)/E.x}}const oy=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:u}=t,{element:c,padding:f=0}=dt(e,t)||{};if(c==null)return{};const g=qc(f),m={x:n,y:r},p=Ms(o),v=Ds(p),h=await i.getDimensions(c),y=p==="y",w=y?"top":"left",x=y?"bottom":"right",S=y?"clientHeight":"clientWidth",E=s.reference[v]+s.reference[p]-m[p]-s.floating[v],C=m[p]-s.reference[p],P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let _=P?P[S]:0;(!_||!await(i.isElement==null?void 0:i.isElement(P)))&&(_=a.floating[S]||s.floating[v]);const O=E/2-C/2,$=_/2-h[v]/2-1,F=Ft(g[w],$),G=Ft(g[x],$),k=F,R=_-h[v]-G,M=_/2-h[v]/2+O,q=Fs(k,M,R),j=!u.arrow&&sn(o)!=null&&M!==q&&s.reference[v]/2-(M<k?F:G)-h[v]/2<0,X=j?M<k?M-k:M-R:0;return{[p]:m[p]+X,data:{[p]:q,centerOffset:M-q-X,...j&&{alignmentOffset:X}},reset:j}}}),sy=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:u,elements:c}=t,{mainAxis:f=!0,crossAxis:g=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:h=!0,...y}=dt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=ft(o),x=Ot(a),S=ft(a)===a,E=await(u.isRTL==null?void 0:u.isRTL(c.floating)),C=m||(S||!h?[Fr(a)]:Qv(a)),P=v!=="none";!m&&P&&C.push(...ty(a,h,v,E));const _=[a,...C],O=await An(t,y),$=[];let F=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&$.push(O[w]),g){const M=Zv(o,i,E);$.push(O[M[0]],O[M[1]])}if(F=[...F,{placement:o,overflows:$}],!$.every(M=>M<=0)){var G,k;const M=(((G=s.flip)==null?void 0:G.index)||0)+1,q=_[M];if(q)return{data:{index:M,overflows:F},reset:{placement:q}};let j=(k=F.filter(X=>X.overflows[0]<=0).sort((X,K)=>X.overflows[1]-K.overflows[1])[0])==null?void 0:k.placement;if(!j)switch(p){case"bestFit":{var R;const X=(R=F.filter(K=>{if(P){const ee=Ot(K.placement);return ee===x||ee==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(ee=>ee>0).reduce((ee,ie)=>ee+ie,0)]).sort((K,ee)=>K[1]-ee[1])[0])==null?void 0:R[0];X&&(j=X);break}case"initialPlacement":j=a;break}if(o!==j)return{reset:{placement:j}}}return{}}}};function Xc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Jc(e){return Xv.some(t=>e[t]>=0)}const iy=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=dt(e,t);switch(r){case"referenceHidden":{const s=await An(t,{...o,elementContext:"reference"}),i=Xc(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Jc(i)}}}case"escaped":{const s=await An(t,{...o,altBoundary:!0}),i=Xc(s,n.floating);return{data:{escapedOffsets:i,escaped:Jc(i)}}}default:return{}}}}};async function ay(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=ft(n),a=sn(n),u=Ot(n)==="y",c=["left","top"].includes(i)?-1:1,f=s&&u?-1:1,g=dt(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:v}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return a&&typeof v=="number"&&(p=a==="end"?v*-1:v),u?{x:p*f,y:m*c}:{x:m*c,y:p*f}}const ly=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,u=await ay(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:i}}}}},cy=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:y=>{let{x:w,y:x}=y;return{x:w,y:x}}},...u}=dt(e,t),c={x:n,y:r},f=await An(t,u),g=Ot(ft(o)),m=Os(g);let p=c[m],v=c[g];if(s){const y=m==="y"?"top":"left",w=m==="y"?"bottom":"right",x=p+f[y],S=p-f[w];p=Fs(x,p,S)}if(i){const y=g==="y"?"top":"left",w=g==="y"?"bottom":"right",x=v+f[y],S=v-f[w];v=Fs(x,v,S)}const h=a.fn({...t,[m]:p,[g]:v});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[m]:s,[g]:i}}}}}},uy=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:u=!0,crossAxis:c=!0}=dt(e,t),f={x:n,y:r},g=Ot(o),m=Os(g);let p=f[m],v=f[g];const h=dt(a,t),y=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){const S=m==="y"?"height":"width",E=s.reference[m]-s.floating[S]+y.mainAxis,C=s.reference[m]+s.reference[S]-y.mainAxis;p<E?p=E:p>C&&(p=C)}if(c){var w,x;const S=m==="y"?"width":"height",E=["top","left"].includes(ft(o)),C=s.reference[g]-s.floating[S]+(E&&((w=i.offset)==null?void 0:w[g])||0)+(E?0:y.crossAxis),P=s.reference[g]+s.reference[S]+(E?0:((x=i.offset)==null?void 0:x[g])||0)-(E?y.crossAxis:0);v<C?v=C:v>P&&(v=P)}return{[m]:p,[g]:v}}}},dy=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:u=()=>{},...c}=dt(e,t),f=await An(t,c),g=ft(o),m=sn(o),p=Ot(o)==="y",{width:v,height:h}=s.floating;let y,w;g==="top"||g==="bottom"?(y=g,w=m===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(w=g,y=m==="end"?"top":"bottom");const x=h-f.top-f.bottom,S=v-f.left-f.right,E=Ft(h-f[y],x),C=Ft(v-f[w],S),P=!t.middlewareData.shift;let _=E,O=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(_=x),P&&!m){const F=Ie(f.left,0),G=Ie(f.right,0),k=Ie(f.top,0),R=Ie(f.bottom,0);p?O=v-2*(F!==0||G!==0?F+G:Ie(f.left,f.right)):_=h-2*(k!==0||R!==0?k+R:Ie(f.top,f.bottom))}await u({...t,availableWidth:O,availableHeight:_});const $=await i.getDimensions(a.floating);return v!==$.width||h!==$.height?{reset:{rects:!0}}:{}}}};function Dr(){return typeof window<"u"}function an(e){return Yc(e)?(e.nodeName||"").toLowerCase():"#document"}function Re(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function nt(e){var t;return(t=(Yc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Yc(e){return Dr()?e instanceof Node||e instanceof Re(e).Node:!1}function qe(e){return Dr()?e instanceof Element||e instanceof Re(e).Element:!1}function rt(e){return Dr()?e instanceof HTMLElement||e instanceof Re(e).HTMLElement:!1}function Zc(e){return!Dr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Re(e).ShadowRoot}function _n(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ke(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function fy(e){return["table","td","th"].includes(an(e))}function Mr(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ks(e){const t=Is(),n=qe(e)?Ke(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 py(e){let t=Dt(e);for(;rt(t)&&!ln(t);){if(ks(t))return t;if(Mr(t))return null;t=Dt(t)}return null}function Is(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ln(e){return["html","body","#document"].includes(an(e))}function Ke(e){return Re(e).getComputedStyle(e)}function $r(e){return qe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Dt(e){if(an(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Zc(e)&&e.host||nt(e);return Zc(t)?t.host:t}function Qc(e){const t=Dt(e);return ln(t)?e.ownerDocument?e.ownerDocument.body:e.body:rt(t)&&_n(t)?t:Qc(t)}function Fn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Qc(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Re(o);if(s){const a=Rs(i);return t.concat(i,i.visualViewport||[],_n(o)?o:[],a&&n?Fn(a):[])}return t.concat(o,Fn(o,[],n))}function Rs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function eu(e){const t=Ke(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=rt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Ar(n)!==s||Ar(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Ls(e){return qe(e)?e:e.contextElement}function cn(e){const t=Ls(e);if(!rt(t))return tt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=eu(t);let i=(s?Ar(n.width):n.width)/r,a=(s?Ar(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const gy=tt(0);function tu(e){const t=Re(e);return!Is()||!t.visualViewport?gy:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function hy(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Re(e)?!1:t}function Ut(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Ls(e);let i=tt(1);t&&(r?qe(r)&&(i=cn(r)):i=cn(e));const a=hy(s,n,r)?tu(s):tt(0);let u=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,f=o.width/i.x,g=o.height/i.y;if(s){const m=Re(s),p=r&&qe(r)?Re(r):r;let v=m,h=Rs(v);for(;h&&r&&p!==v;){const y=cn(h),w=h.getBoundingClientRect(),x=Ke(h),S=w.left+(h.clientLeft+parseFloat(x.paddingLeft))*y.x,E=w.top+(h.clientTop+parseFloat(x.paddingTop))*y.y;u*=y.x,c*=y.y,f*=y.x,g*=y.y,u+=S,c+=E,v=Re(h),h=Rs(v)}}return Or({width:f,height:g,x:u,y:c})}function Vs(e,t){const n=$r(e).scrollLeft;return t?t.left+n:Ut(nt(e)).left+n}function nu(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Vs(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function my(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=nt(r),a=t?Mr(t.floating):!1;if(r===i||a&&s)return n;let u={scrollLeft:0,scrollTop:0},c=tt(1);const f=tt(0),g=rt(r);if((g||!g&&!s)&&((an(r)!=="body"||_n(i))&&(u=$r(r)),rt(r))){const p=Ut(r);c=cn(r),f.x=p.x+r.clientLeft,f.y=p.y+r.clientTop}const m=i&&!g&&!s?nu(i,u,!0):tt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+f.x+m.x,y:n.y*c.y-u.scrollTop*c.y+f.y+m.y}}function vy(e){return Array.from(e.getClientRects())}function yy(e){const t=nt(e),n=$r(e),r=e.ownerDocument.body,o=Ie(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Ie(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Vs(e);const a=-n.scrollTop;return Ke(r).direction==="rtl"&&(i+=Ie(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function wy(e,t){const n=Re(e),r=nt(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,u=0;if(o){s=o.width,i=o.height;const c=Is();(!c||c&&t==="fixed")&&(a=o.offsetLeft,u=o.offsetTop)}return{width:s,height:i,x:a,y:u}}function by(e,t){const n=Ut(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=rt(e)?cn(e):tt(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,u=o*s.x,c=r*s.y;return{width:i,height:a,x:u,y:c}}function ru(e,t,n){let r;if(t==="viewport")r=wy(e,n);else if(t==="document")r=yy(nt(e));else if(qe(t))r=by(t,n);else{const o=tu(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Or(r)}function ou(e,t){const n=Dt(e);return n===t||!qe(n)||ln(n)?!1:Ke(n).position==="fixed"||ou(n,t)}function xy(e,t){const n=t.get(e);if(n)return n;let r=Fn(e,[],!1).filter(a=>qe(a)&&an(a)!=="body"),o=null;const s=Ke(e).position==="fixed";let i=s?Dt(e):e;for(;qe(i)&&!ln(i);){const a=Ke(i),u=ks(i);!u&&a.position==="fixed"&&(o=null),(s?!u&&!o:!u&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||_n(i)&&!u&&ou(e,i))?r=r.filter(f=>f!==i):o=a,i=Dt(i)}return t.set(e,r),r}function Cy(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Mr(t)?[]:xy(t,this._c):[].concat(n),r],a=i[0],u=i.reduce((c,f)=>{const g=ru(t,f,o);return c.top=Ie(g.top,c.top),c.right=Ft(g.right,c.right),c.bottom=Ft(g.bottom,c.bottom),c.left=Ie(g.left,c.left),c},ru(t,a,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Sy(e){const{width:t,height:n}=eu(e);return{width:t,height:n}}function Ey(e,t,n){const r=rt(t),o=nt(t),s=n==="fixed",i=Ut(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const u=tt(0);if(r||!r&&!s)if((an(t)!=="body"||_n(o))&&(a=$r(t)),r){const m=Ut(t,!0,s,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else o&&(u.x=Vs(o));const c=o&&!r&&!s?nu(o,a):tt(0),f=i.left+a.scrollLeft-u.x-c.x,g=i.top+a.scrollTop-u.y-c.y;return{x:f,y:g,width:i.width,height:i.height}}function Bs(e){return Ke(e).position==="static"}function su(e,t){if(!rt(e)||Ke(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return nt(e)===n&&(n=n.ownerDocument.body),n}function iu(e,t){const n=Re(e);if(Mr(e))return n;if(!rt(e)){let o=Dt(e);for(;o&&!ln(o);){if(qe(o)&&!Bs(o))return o;o=Dt(o)}return n}let r=su(e,t);for(;r&&fy(r)&&Bs(r);)r=su(r,t);return r&&ln(r)&&Bs(r)&&!ks(r)?n:r||py(e)||n}const Ny=async function(e){const t=this.getOffsetParent||iu,n=this.getDimensions,r=await n(e.floating);return{reference:Ey(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ty(e){return Ke(e).direction==="rtl"}const Py={convertOffsetParentRelativeRectToViewportRelativeRect:my,getDocumentElement:nt,getClippingRect:Cy,getOffsetParent:iu,getElementRects:Ny,getClientRects:vy,getDimensions:Sy,getScale:cn,isElement:qe,isRTL:Ty};function Ay(e,t){let n=null,r;const o=nt(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),s();const{left:c,top:f,width:g,height:m}=e.getBoundingClientRect();if(a||t(),!g||!m)return;const p=_r(f),v=_r(o.clientWidth-(c+g)),h=_r(o.clientHeight-(f+m)),y=_r(c),x={rootMargin:-p+"px "+-v+"px "+-h+"px "+-y+"px",threshold:Ie(0,Ft(1,u))||1};let S=!0;function E(C){const P=C[0].intersectionRatio;if(P!==u){if(!S)return i();P?i(!1,P):r=setTimeout(()=>{i(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(E,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,x)}n.observe(e)}return i(!0),s}function _y(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=Ls(e),f=o||s?[...c?Fn(c):[],...Fn(t)]:[];f.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const g=c&&a?Ay(c,n):null;let m=-1,p=null;i&&(p=new ResizeObserver(w=>{let[x]=w;x&&x.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var S;(S=p)==null||S.observe(t)})),n()}),c&&!u&&p.observe(c),p.observe(t));let v,h=u?Ut(e):null;u&&y();function y(){const w=Ut(e);h&&(w.x!==h.x||w.y!==h.y||w.width!==h.width||w.height!==h.height)&&n(),h=w,v=requestAnimationFrame(y)}return n(),()=>{var w;f.forEach(x=>{o&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),g==null||g(),(w=p)==null||w.disconnect(),p=null,u&&cancelAnimationFrame(v)}}const Fy=ly,Oy=cy,Dy=sy,My=dy,$y=iy,au=oy,ky=uy,Iy=(e,t,n)=>{const r=new Map,o={platform:Py,...n},s={...o.platform,_c:r};return ry(e,t,{...o,platform:s})};var kr=typeof document<"u"?D.useLayoutEffect:D.useEffect;function Ir(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ir(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Ir(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function lu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function cu(e,t){const n=lu(e);return Math.round(t*n)/n}function zs(e){const t=d.useRef(e);return kr(()=>{t.current=e}),t}function Ry(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:u,open:c}=e,[f,g]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=d.useState(r);Ir(m,r)||p(r);const[v,h]=d.useState(null),[y,w]=d.useState(null),x=d.useCallback(K=>{K!==P.current&&(P.current=K,h(K))},[]),S=d.useCallback(K=>{K!==_.current&&(_.current=K,w(K))},[]),E=s||v,C=i||y,P=d.useRef(null),_=d.useRef(null),O=d.useRef(f),$=u!=null,F=zs(u),G=zs(o),k=zs(c),R=d.useCallback(()=>{if(!P.current||!_.current)return;const K={placement:t,strategy:n,middleware:m};G.current&&(K.platform=G.current),Iy(P.current,_.current,K).then(ee=>{const ie={...ee,isPositioned:k.current!==!1};M.current&&!Ir(O.current,ie)&&(O.current=ie,zn.flushSync(()=>{g(ie)}))})},[m,t,n,G,k]);kr(()=>{c===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,g(K=>({...K,isPositioned:!1})))},[c]);const M=d.useRef(!1);kr(()=>(M.current=!0,()=>{M.current=!1}),[]),kr(()=>{if(E&&(P.current=E),C&&(_.current=C),E&&C){if(F.current)return F.current(E,C,R);R()}},[E,C,R,F,$]);const q=d.useMemo(()=>({reference:P,floating:_,setReference:x,setFloating:S}),[x,S]),j=d.useMemo(()=>({reference:E,floating:C}),[E,C]),X=d.useMemo(()=>{const K={position:n,left:0,top:0};if(!j.floating)return K;const ee=cu(j.floating,f.x),ie=cu(j.floating,f.y);return a?{...K,transform:"translate("+ee+"px, "+ie+"px)",...lu(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ee,top:ie}},[n,a,j.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:R,refs:q,elements:j,floatingStyles:X}),[f,R,q,j,X])}const Ly=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?au({element:r.current,padding:o}).fn(n):{}:r?au({element:r,padding:o}).fn(n):{}}}},Vy=(e,t)=>({...Fy(e),options:[e,t]}),By=(e,t)=>({...Oy(e),options:[e,t]}),zy=(e,t)=>({...ky(e),options:[e,t]}),Hy=(e,t)=>({...Dy(e),options:[e,t]}),Uy=(e,t)=>({...My(e),options:[e,t]}),jy=(e,t)=>({...$y(e),options:[e,t]}),Wy=(e,t)=>({...Ly(e),options:[e,t]});var Gy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],qy=Gy.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Kt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Ky="Arrow",uu=d.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return l.jsx(qy.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});uu.displayName=Ky;var Xy=uu;function du(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Jy(...e){return t=>{let n=!1;const r=e.map(o=>{const s=du(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():du(e[o],null)}}}}function fu(...e){return d.useCallback(Jy(...e),e)}var Yy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],pu=Yy.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Kt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Hs="Popper",[gu,hu]=St(Hs),[Zy,mu]=gu(Hs),vu=e=>{const{__scopePopper:t,children:n}=e,[r,o]=d.useState(null);return l.jsx(Zy,{scope:t,anchor:r,onAnchorChange:o,children:n})};vu.displayName=Hs;var yu="PopperAnchor",wu=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=mu(yu,n),i=d.useRef(null),a=fu(t,i);return d.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:l.jsx(pu.div,{...o,ref:a})});wu.displayName=yu;var Us="PopperContent",[Qy,ew]=gu(Us),bu=d.forwardRef((e,t)=>{var Ee,Ye,Oe,fn,ht,mt;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:f=0,sticky:g="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:v,...h}=e,y=mu(Us,n),[w,x]=d.useState(null),S=fu(t,ze=>x(ze)),[E,C]=d.useState(null),P=Ma(E),_=(P==null?void 0:P.width)??0,O=(P==null?void 0:P.height)??0,$=r+(s!=="center"?"-"+s:""),F=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},G=Array.isArray(c)?c:[c],k=G.length>0,R={padding:F,boundary:G.filter(nw),altBoundary:k},{refs:M,floatingStyles:q,placement:j,isPositioned:X,middlewareData:K}=Ry({strategy:"fixed",placement:$,whileElementsMounted:(...ze)=>_y(...ze,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[Vy({mainAxis:o+O,alignmentAxis:i}),u&&By({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?zy():void 0,...R}),u&&Hy({...R}),Uy({...R,apply:({elements:ze,rects:kt,availableWidth:pn,availableHeight:It})=>{const{width:Vn,height:b}=kt.reference,N=ze.floating.style;N.setProperty("--radix-popper-available-width",`${pn}px`),N.setProperty("--radix-popper-available-height",`${It}px`),N.setProperty("--radix-popper-anchor-width",`${Vn}px`),N.setProperty("--radix-popper-anchor-height",`${b}px`)}}),E&&Wy({element:E,padding:a}),rw({arrowWidth:_,arrowHeight:O}),m&&jy({strategy:"referenceHidden",...R})]}),[ee,ie]=Su(j),de=Ne(v);ke(()=>{X&&(de==null||de())},[X,de]);const Fe=(Ee=K.arrow)==null?void 0:Ee.x,xe=(Ye=K.arrow)==null?void 0:Ye.y,Be=((Oe=K.arrow)==null?void 0:Oe.centerOffset)!==0,[$t,we]=d.useState();return ke(()=>{w&&we(window.getComputedStyle(w).zIndex)},[w]),l.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:X?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:$t,"--radix-popper-transform-origin":[(fn=K.transformOrigin)==null?void 0:fn.x,(ht=K.transformOrigin)==null?void 0:ht.y].join(" "),...((mt=K.hide)==null?void 0:mt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(Qy,{scope:n,placedSide:ee,onArrowChange:C,arrowX:Fe,arrowY:xe,shouldHideArrow:Be,children:l.jsx(pu.div,{"data-side":ee,"data-align":ie,...h,ref:S,style:{...h.style,animation:X?void 0:"none"}})})})});bu.displayName=Us;var xu="PopperArrow",tw={top:"bottom",right:"left",bottom:"top",left:"right"},Cu=d.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=ew(xu,r),i=tw[s.placedSide];return l.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:l.jsx(Xy,{...o,ref:n,style:{...o.style,display:"block"}})})});Cu.displayName=xu;function nw(e){return e!==null}var rw=e=>({name:"transformOrigin",options:e,fn(t){var y,w,x;const{placement:n,rects:r,middlewareData:o}=t,i=((y=o.arrow)==null?void 0:y.centerOffset)!==0,a=i?0:e.arrowWidth,u=i?0:e.arrowHeight,[c,f]=Su(n),g={start:"0%",center:"50%",end:"100%"}[f],m=(((w=o.arrow)==null?void 0:w.x)??0)+a/2,p=(((x=o.arrow)==null?void 0:x.y)??0)+u/2;let v="",h="";return c==="bottom"?(v=i?g:`${m}px`,h=`${-u}px`):c==="top"?(v=i?g:`${m}px`,h=`${r.floating.height+u}px`):c==="right"?(v=`${-u}px`,h=i?g:`${p}px`):c==="left"&&(v=`${r.floating.width+u}px`,h=i?g:`${p}px`),{data:{x:v,y:h}}}});function Su(e){const[t,n="center"]=e.split("-");return[t,n]}var ow=vu,sw=wu,iw=bu,aw=Cu,lw="Portal",Eu=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);ke(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Yr.createPortal(l.jsx(Pn.div,{...r,ref:t}),i):null});Eu.displayName=lw;function cw(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var js=e=>{const{present:t,children:n}=e,r=uw(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=Tn(r.ref,dw(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};js.displayName="Presence";function uw(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=cw(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=Rr(r.current);s.current=a==="mounted"?c:"none"},[a]),ke(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,p=Rr(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&m!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),ke(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const h=Rr(r.current).includes(p.animationName);if(p.target===t&&h&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},m=p=>{p.target===t&&(s.current=Rr(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Rr(e){return(e==null?void 0:e.animationName)||"none"}function dw(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fw="VisuallyHidden",Nu=d.forwardRef((e,t)=>l.jsx(Pn.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Nu.displayName=fw;var pw=Nu,[Lr,jx]=St("Tooltip",[hu]),Vr=hu(),Tu="TooltipProvider",gw=700,Ws="tooltip.open",[hw,Gs]=Lr(Tu),Pu=e=>{const{__scopeTooltip:t,delayDuration:n=gw,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,[i,a]=d.useState(!0),u=d.useRef(!1),c=d.useRef(0);return d.useEffect(()=>{const f=c.current;return()=>window.clearTimeout(f)},[]),l.jsx(hw,{scope:t,isOpenDelayed:i,delayDuration:n,onOpen:d.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:d.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:d.useCallback(f=>{u.current=f},[]),disableHoverableContent:o,children:s})};Pu.displayName=Tu;var Br="Tooltip",[mw,On]=Lr(Br),Au=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,u=Gs(Br,e.__scopeTooltip),c=Vr(t),[f,g]=d.useState(null),m=Qt(),p=d.useRef(0),v=i??u.disableHoverableContent,h=a??u.delayDuration,y=d.useRef(!1),[w=!1,x]=Yt({prop:r,defaultProp:o,onChange:_=>{_?(u.onOpen(),document.dispatchEvent(new CustomEvent(Ws))):u.onClose(),s==null||s(_)}}),S=d.useMemo(()=>w?y.current?"delayed-open":"instant-open":"closed",[w]),E=d.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y.current=!1,x(!0)},[x]),C=d.useCallback(()=>{window.clearTimeout(p.current),p.current=0,x(!1)},[x]),P=d.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,x(!0),p.current=0},h)},[h,x]);return d.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),l.jsx(ow,{...c,children:l.jsx(mw,{scope:t,contentId:m,open:w,stateAttribute:S,trigger:f,onTriggerChange:g,onTriggerEnter:d.useCallback(()=>{u.isOpenDelayed?P():E()},[u.isOpenDelayed,P,E]),onTriggerLeave:d.useCallback(()=>{v?C():(window.clearTimeout(p.current),p.current=0)},[C,v]),onOpen:E,onClose:C,disableHoverableContent:v,children:n})})};Au.displayName=Br;var qs="TooltipTrigger",_u=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=On(qs,n),s=Gs(qs,n),i=Vr(n),a=d.useRef(null),u=Tn(t,a,o.onTriggerChange),c=d.useRef(!1),f=d.useRef(!1),g=d.useCallback(()=>c.current=!1,[]);return d.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),l.jsx(sw,{asChild:!0,...i,children:l.jsx(Pn.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:ut(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:ut(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:ut(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:ut(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:ut(e.onBlur,o.onClose),onClick:ut(e.onClick,o.onClose)})})});_u.displayName=qs;var Ks="TooltipPortal",[vw,yw]=Lr(Ks,{forceMount:void 0}),Fu=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=On(Ks,t);return l.jsx(vw,{scope:t,forceMount:n,children:l.jsx(js,{present:n||s.open,children:l.jsx(Eu,{asChild:!0,container:o,children:r})})})};Fu.displayName=Ks;var un="TooltipContent",Ou=d.forwardRef((e,t)=>{const n=yw(un,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=On(un,e.__scopeTooltip);return l.jsx(js,{present:r||i.open,children:i.disableHoverableContent?l.jsx(Du,{side:o,...s,ref:t}):l.jsx(ww,{side:o,...s,ref:t})})}),ww=d.forwardRef((e,t)=>{const n=On(un,e.__scopeTooltip),r=Gs(un,e.__scopeTooltip),o=d.useRef(null),s=Tn(t,o),[i,a]=d.useState(null),{trigger:u,onClose:c}=n,f=o.current,{onPointerInTransitChange:g}=r,m=d.useCallback(()=>{a(null),g(!1)},[g]),p=d.useCallback((v,h)=>{const y=v.currentTarget,w={x:v.clientX,y:v.clientY},x=Sw(w,y.getBoundingClientRect()),S=Ew(w,x),E=Nw(h.getBoundingClientRect()),C=Pw([...S,...E]);a(C),g(!0)},[g]);return d.useEffect(()=>()=>m(),[m]),d.useEffect(()=>{if(u&&f){const v=y=>p(y,f),h=y=>p(y,u);return u.addEventListener("pointerleave",v),f.addEventListener("pointerleave",h),()=>{u.removeEventListener("pointerleave",v),f.removeEventListener("pointerleave",h)}}},[u,f,p,m]),d.useEffect(()=>{if(i){const v=h=>{const y=h.target,w={x:h.clientX,y:h.clientY},x=(u==null?void 0:u.contains(y))||(f==null?void 0:f.contains(y)),S=!Tw(w,i);x?m():S&&(m(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[u,f,i,c,m]),l.jsx(Du,{...e,ref:s})}),[bw,xw]=Lr(Br,{isInside:!1}),Du=d.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,u=On(un,n),c=Vr(n),{onClose:f}=u;return d.useEffect(()=>(document.addEventListener(Ws,f),()=>document.removeEventListener(Ws,f)),[f]),d.useEffect(()=>{if(u.trigger){const g=m=>{const p=m.target;p!=null&&p.contains(u.trigger)&&f()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[u.trigger,f]),l.jsx(jc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:g=>g.preventDefault(),onDismiss:f,children:l.jsxs(iw,{"data-state":u.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(va,{children:r}),l.jsx(bw,{scope:n,isInside:!0,children:l.jsx(pw,{id:u.contentId,role:"tooltip",children:o||r})})]})})});Ou.displayName=un;var Mu="TooltipArrow",Cw=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Vr(n);return xw(Mu,n).isInside?null:l.jsx(aw,{...o,...r,ref:t})});Cw.displayName=Mu;function Sw(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Ew(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Nw(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Tw(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s].x,u=t[s].y,c=t[i].x,f=t[i].y;u>r!=f>r&&n<(c-a)*(r-u)/(f-u)+a&&(o=!o)}return o}function Pw(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Aw(t)}function Aw(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var _w=Pu,Fw=Au,Ow=_u,Dw=Fu,$u=Ou;const ku=_w,Iu=Fw,Ru=Ow,Xs=d.forwardRef(({className:e,sideOffset:t=4,...n},r)=>l.jsx(Dw,{children:l.jsx($u,{ref:r,sideOffset:t,className:Z("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Xs.displayName=$u.displayName;function Mw({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const $w=d.forwardRef(Mw);var kw=function(e){return function(t,n){var r=D.useRef(!1);e(function(){return function(){r.current=!1}},[]),e(function(){if(!r.current)r.current=!0;else return t()},n)}},Lu=function(e){return typeof e=="function"},Vu=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";const Iw=kw(D.useEffect);function Bu(e){var t=D.useRef(e);return t.current=e,t}var Rw=function(e){Vu&&(Lu(e)||console.error("useUnmount expected parameter is a function, got ".concat(typeof e)));var t=Bu(e);D.useEffect(function(){return function(){t.current()}},[])},zr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Lw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Vw(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var zu=Vw,Bw=typeof zr=="object"&&zr&&zr.Object===Object&&zr,zw=Bw,Hw=zw,Uw=typeof self=="object"&&self&&self.Object===Object&&self,jw=Hw||Uw||Function("return this")(),Hu=jw,Ww=Hu,Gw=function(){return Ww.Date.now()},qw=Gw,Kw=/\s/;function Xw(e){for(var t=e.length;t--&&Kw.test(e.charAt(t)););return t}var Jw=Xw,Yw=Jw,Zw=/^\s+/;function Qw(e){return e&&e.slice(0,Yw(e)+1).replace(Zw,"")}var eb=Qw,tb=Hu,nb=tb.Symbol,Uu=nb,ju=Uu,Wu=Object.prototype,rb=Wu.hasOwnProperty,ob=Wu.toString,Dn=ju?ju.toStringTag:void 0;function sb(e){var t=rb.call(e,Dn),n=e[Dn];try{e[Dn]=void 0;var r=!0}catch{}var o=ob.call(e);return r&&(t?e[Dn]=n:delete e[Dn]),o}var ib=sb,ab=Object.prototype,lb=ab.toString;function cb(e){return lb.call(e)}var ub=cb,Gu=Uu,db=ib,fb=ub,pb="[object Null]",gb="[object Undefined]",qu=Gu?Gu.toStringTag:void 0;function hb(e){return e==null?e===void 0?gb:pb:qu&&qu in Object(e)?db(e):fb(e)}var mb=hb;function vb(e){return e!=null&&typeof e=="object"}var yb=vb,wb=mb,bb=yb,xb="[object Symbol]";function Cb(e){return typeof e=="symbol"||bb(e)&&wb(e)==xb}var Sb=Cb,Eb=eb,Ku=zu,Nb=Sb,Xu=NaN,Tb=/^[-+]0x[0-9a-f]+$/i,Pb=/^0b[01]+$/i,Ab=/^0o[0-7]+$/i,_b=parseInt;function Fb(e){if(typeof e=="number")return e;if(Nb(e))return Xu;if(Ku(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ku(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Eb(e);var n=Pb.test(e);return n||Ab.test(e)?_b(e.slice(2),n?2:8):Tb.test(e)?Xu:+e}var Ob=Fb,Db=zu,Js=qw,Ju=Ob,Mb="Expected a function",$b=Math.max,kb=Math.min;function Ib(e,t,n){var r,o,s,i,a,u,c=0,f=!1,g=!1,m=!0;if(typeof e!="function")throw new TypeError(Mb);t=Ju(t)||0,Db(n)&&(f=!!n.leading,g="maxWait"in n,s=g?$b(Ju(n.maxWait)||0,t):s,m="trailing"in n?!!n.trailing:m);function p(P){var _=r,O=o;return r=o=void 0,c=P,i=e.apply(O,_),i}function v(P){return c=P,a=setTimeout(w,t),f?p(P):i}function h(P){var _=P-u,O=P-c,$=t-_;return g?kb($,s-O):$}function y(P){var _=P-u,O=P-c;return u===void 0||_>=t||_<0||g&&O>=s}function w(){var P=Js();if(y(P))return x(P);a=setTimeout(w,h(P))}function x(P){return a=void 0,m&&r?p(P):(r=o=void 0,i)}function S(){a!==void 0&&clearTimeout(a),c=0,r=u=o=a=void 0}function E(){return a===void 0?i:x(Js())}function C(){var P=Js(),_=y(P);if(r=arguments,o=this,u=P,_){if(a===void 0)return v(u);if(g)return clearTimeout(a),a=setTimeout(w,t),p(u)}return a===void 0&&(a=setTimeout(w,t)),i}return C.cancel=S,C.flush=E,C}var Rb=Ib;const Lb=Lw(Rb);function Vb(){var e=(typeof global>"u"?"undefined":typeof global)=="object"&&global&&global.Object===Object&&global,t=typeof self=="object"&&self&&self.Object===Object&&self;return e||t}Vb()||(global.Date=Date);function Bb(e,t){var n;Vu&&(Lu(e)||console.error("useDebounceFn expected parameter is a function, got ".concat(typeof e)));var r=Bu(e),o=(n=t==null?void 0:t.wait)!==null&&n!==void 0?n:1e3,s=D.useMemo(function(){return Lb(function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return r.current.apply(r,nl([],tl(i),!1))},o,t)},[]);return Rw(function(){s.cancel()}),{run:s,cancel:s.cancel,flush:s.flush}}function zb(e,t,n){var r=tl(D.useState({}),2),o=r[0],s=r[1],i=Bb(function(){s({})},n).run;D.useEffect(function(){return i()},t),Iw(e,[o])}const Hb=D.forwardRef(({onChange:e},t)=>{const n=D.useRef(null),[r,o]=D.useState("");return D.useImperativeHandle(t,()=>({setValue:s=>{var i;o(s),(i=n.current)==null||i.focus()}})),zb(()=>{e==null||e(r)},[r],{wait:300}),l.jsxs(l.Fragment,{children:[l.jsx(_t,{ref:n,type:"text",placeholder:"Search files...",value:r,onChange:s=>o(s.target.value),className:"pr-8"}),r&&l.jsx("button",{onClick:()=>{var s;o(""),(s=n.current)==null||s.focus()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",children:l.jsx($w,{className:"h-5 w-5"})})]})}),Xe={current:!1},Yu="crawl:jobs",Mn="crawl:current_job",Ub=e=>{const[t,n]=D.useState(null),[r,o]=D.useState(0);return D.useEffect(()=>{const s=localStorage.getItem(Mn);if(s){const i=JSON.parse(s);n(i),i.startTime&&o(Math.floor((Date.now()-i.startTime)/1e3))}},[]),D.useEffect(()=>{if(!(t!=null&&t.startTime))return;const s=setInterval(()=>{o(Math.floor((Date.now()-t.startTime)/1e3))},1e3);return()=>clearInterval(s)},[t==null?void 0:t.startTime]),D.useEffect(()=>{if(!(t!=null&&t.id))return;const s=async()=>{try{const u=(await oe.get(`${e}/api/crawl/${t.id}`)).data;n(c=>{if(!c)return null;const f={...c,status:u};return localStorage.setItem(Mn,JSON.stringify(f)),(u.status==="completed"||u.status==="failed")&&setTimeout(()=>{n(null),localStorage.removeItem(Mn)},100),f})}catch(a){console.error("Error polling job status:",a)}},i=setInterval(s,3e3);return s(),()=>clearInterval(i)},[t==null?void 0:t.id,e]),{currentJob:t,elapsedTime:r,setCurrentJob:s=>{s&&!s.startTime&&(s.startTime=Date.now()),n(s),s?localStorage.setItem(Mn,JSON.stringify(s)):localStorage.removeItem(Mn)}}},jb=(e,t,n)=>{const r=[],o=s=>{(e[s]||[]).forEach(a=>{a.name.toLowerCase().includes(t.toLowerCase())&&r.push(a),a.isFolder&&a.key.startsWith(n)&&o(a.key)})};return o(n),r},Hr=(e,t)=>{const n=[],r=o=>{(e[o]||[]).forEach(i=>{n.push(i.key),i.isFolder&&r(i.key)})};return r(t),n},Wb=(e,t)=>{const n=[];return(e[t]||[]).forEach(o=>{n.push(o.key),o.isFolder&&n.push(...Hr(e,o.key))}),n},Gb=(e,t,n=[])=>{const[r,o]=D.useState({}),[s,i]=D.useState(!1),[a,u]=D.useState(null),c=async()=>{i(!0);try{const f=!Xe.current;Xe.current&&(Xe.current=!1);const g=await oe.get(`${e}/api/files`,{params:{cache:f,displayPrefixes:JSON.stringify(n),prefix:t},timeout:3e5});o(g.data),u(null)}catch(f){u(f instanceof Error?f:new Error("Failed to fetch files"))}finally{i(!1)}};return D.useEffect(()=>{c()},[]),{data:r,isLoading:s,error:a,refetch:c}},Ur=e=>{var r,o,s;const t=((s=(o=(r=e==null?void 0:e.name)==null?void 0:r.split("."))==null?void 0:o.pop())==null?void 0:s.toLowerCase())??"";return["txt","md","json","js","ts","jsx","tsx","css","html","xml","yaml","yml"].includes(t||"")},qb=D.memo(({homeLabel:e="Kho tài liệu",apiBaseUrl:t="http://localhost:3000",rootPrefix:n="",asSelector:r=!1,onSelected:o=i=>console.log("Đã chọn:",i),displayPrefixes:s})=>{var xd;const[i,a]=D.useState(""),[u,c]=D.useState(new Set),[f,g]=D.useState(n),[m,p]=D.useState(!1),[v,h]=D.useState(""),[y,w]=D.useState(!1),[x,S]=D.useState(null),[E,C]=D.useState(!1),[P,_]=D.useState(!1),[O,$]=D.useState(!1),[F,G]=D.useState(null),k=D.useRef(null),{toast:R}=As(),[M,q]=D.useState(null),[j,X]=D.useState(""),[K,ee]=D.useState(!1),[ie,de]=D.useState(new Set),[Fe,xe]=D.useState(""),[Be,$t]=D.useState(!1),[we,Ee]=D.useState(!1),[Ye,Oe]=D.useState("rename"),[fn,ht]=D.useState(!1),[mt,ze]=D.useState(""),[kt,pn]=D.useState("1"),[It,Vn]=D.useState(!1),{currentJob:b,elapsedTime:N,setCurrentJob:A}=Ub(t),{data:B={},isLoading:z,error:L,refetch:W}=Gb(t,n,s);D.useEffect(()=>{b!=null&&b.status&&(b.status.status==="completed"?(R({title:"Thu thập website hoàn tất",description:`Đã thu thập thành công ${b.url} với ${b.status.completed} trang`}),Xe.current=!0,W()):b.status.status==="failed"&&R({title:"Thu thập website thất bại",description:`Không thể thu thập ${b.url}. Vui lòng thử lại.`,variant:"destructive"}))},[(xd=b==null?void 0:b.status)==null?void 0:xd.status]);const ne=D.useMemo(()=>B[f]||[],[B,f]),le=D.useMemo(()=>i?jb(B,i,f):ne,[ne,i,f,B]),fe=D.useMemo(()=>{const I={};return le.forEach((V,U)=>{u.has(V.key)&&(I[U]=!0)}),I},[u,le]),vt=I=>{const V=Hr(B,I);if(V.length===0)return u.has(I)?"all":"none";const U=V.filter(re=>u.has(re)).length;return U===0?"none":U===V.length?"all":"partial"},gn=I=>{g(I)},Bn=async(I,V)=>{w(!0);try{const U=`${V}${I}/`;if((await oe.post(`${t}/api/create-folder`,{prefix:U})).status!==200){R({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"});return}Xe.current=!0,await W(),R({title:"Đã tạo thư mục",description:`Đã tạo thành công thư mục "${I}"`}),h(""),p(!1)}catch(U){console.error("Error creating folder:",U),R({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"})}finally{w(!1)}},hn=async(I,V,U)=>{G(U);try{const re=new FormData;re.append("prefix",V),Array.from(I).forEach(pe=>{pe instanceof File&&re.append("files",pe)}),(await oe.post(`${t}/api/upload`,re,{headers:{"Content-Type":"multipart/form-data"}})).status===200&&(Xe.current=!0,await W(),R({title:"Đã tải lên tập tin",description:`Đã tải lên thành công ${I.length} tập tin`}))}catch(re){console.error("Error uploading files:",re),R({title:"Lỗi",description:"Không thể tải lên tập tin",variant:"destructive"})}finally{G(null)}},ui=async I=>{C(!0);try{await oe.delete(`${t}/api/files`,{data:{paths:[I.key]}}),Xe.current=!0,await W(),R({title:"Đã xóa tập tin",description:`Đã xóa thành công "${I.name}"`}),S(null)}catch(V){console.error("Error deleting file:",V),R({title:"Lỗi",description:"Không thể xóa tập tin",variant:"destructive"})}finally{C(!1)}},Wt=I=>{const V=new Set(u),U=typeof I=="function"?I(fe):I;new Set(Object.keys(fe).map(Number)).forEach(se=>{const pe=le[se];pe&&(U[se]||(V.delete(pe.key),pe.isFolder&&Hr(B,pe.key).forEach(De=>V.delete(De))))}),Object.entries(U).forEach(([se,pe])=>{const De=parseInt(se),yt=le[De];yt&&pe&&(V.add(yt.key),yt.isFolder&&Hr(B,yt.key).forEach(pi=>V.add(pi)))}),c(V)},di=async()=>{_(!0);try{const I=Array.from(u).map(V=>{var U;for(const re in B){const se=(U=B[re])==null?void 0:U.find(pe=>pe.key===V);if(se)return se}return null}).filter(V=>V!==null);await oe.delete(`${t}/api/files`,{data:{paths:Array.from(u)}}),Xe.current=!0,await W(),R({title:"Đã xóa tập tin",description:`Đã xóa thành công ${I.length} mục`}),$(!1),c(new Set)}catch(I){console.error("Error deleting files:",I),R({title:"Lỗi",description:"Không thể xóa các tập tin đã chọn",variant:"destructive"})}finally{_(!1)}},Jr=async(I,V)=>{ee(!0);try{const U=I.key;let re;I.isFolder?re=U.split("/").slice(0,-2).join("/")+"/":re=U.substring(0,U.lastIndexOf("/")+1);const se=re+V+(I.isFolder?"/":"");await oe.post(`${t}/api/rename`,{oldPath:U,newPath:se}),Xe.current=!0,await W(),R({title:"Đã đổi tên",description:`Đã đổi tên thành công "${I.name}" thành "${V}"`}),q(null),X("")}catch(U){console.error("Error renaming item:",U),R({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{ee(!1)}},yd=async I=>{de(V=>new Set([...V,...I]));try{const V=await oe.post(`${t}/api/download`,{paths:I},{responseType:"blob"}),U=window.URL.createObjectURL(V.data),re=document.createElement("a");re.href=U;const se=V.headers["Content-Disposition"]||V.headers["content-disposition"],pe=se==null?void 0:se.match(/filename="(.+)"/),De=pe?decodeURIComponent(pe[1]):"download.zip";re.setAttribute("download",De),document.body.appendChild(re),re.click(),document.body.removeChild(re),window.URL.revokeObjectURL(U),R({title:"Bắt đầu tải xuống",description:`Đã bắt đầu tải xuống ${I.length} mục${I.length>1,""}`})}catch(V){console.error("Error downloading files:",V),R({title:"Lỗi",description:"Không thể tải xuống tập tin",variant:"destructive"})}finally{de(V=>{const U=new Set(V);return I.forEach(re=>U.delete(re)),U})}},wd=f?f.replace(n,"").split("/").filter(Boolean):[],yx=()=>Array.from(u).map(I=>{var V;for(const U in B){const re=(V=B[U])==null?void 0:V.find(se=>se.key===I);if(re)return re}return null}).filter(I=>I!==null),bd=D.useMemo(()=>{const I=[{id:"select",header:()=>{const V=Wb(B,f),U=V.length>0&&V.every(se=>u.has(se)),re=V.some(se=>u.has(se));return l.jsx(Bo,{checked:U?!0:re?"indeterminate":!1,onCheckedChange:se=>{if(se){const pe=le.reduce((De,yt,pi)=>(De[pi]=!0,De),{});Wt(pe)}else Wt({})},"aria-label":"Chọn tất cả"})},cell:({row:V})=>{const U=V.original,se=U.isFolder?vt(U.key):u.has(U.key)?"all":"none";return l.jsx("div",{className:"flex items-center",children:l.jsx(Bo,{checked:se==="partial"?"indeterminate":se==="all",onCheckedChange:pe=>{const De={...fe};pe?De[V.index]=!0:delete De[V.index],Wt(De)},"aria-label":"Chọn dòng"})})},enableSorting:!1},{id:"fileName",header:"Tên tập tin",accessorKey:"name",cell:({row:V})=>{const U=V.original,re=U.key.substring(0,U.key.lastIndexOf("/"))||"/",se=i.trim()!==""&&re!==f,pe=re.split("/").filter(Boolean);return l.jsxs("div",{className:"flex flex-col",children:[l.jsxs("div",{className:`flex items-center gap-2 ${U.isFolder?"cursor-pointer hover:text-blue-600":""}`,onClick:()=>{U.isFolder&&gn(U.key)},children:[U.isFolder?l.jsx(Zr,{className:"h-5 w-5 text-blue-500"}):null,U.name]}),se&&l.jsxs("div",{className:"text-sm text-gray-500 flex items-center",children:[l.jsx(Zr,{className:"h-4 w-4 text-gray-500 my-auto"}),l.jsxs("span",{className:"flex items-center ml-1",children:[l.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{gn("")},children:"/"}),pe.map((De,yt)=>l.jsxs("span",{className:"flex items-center",children:[l.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{gn(pe.slice(0,yt+1).join("/")+"/")},children:De}),yt<pe.length-1&&l.jsx("span",{children:"/"})]},yt))]})]})]})}}];return r||I.push({id:"size",header:"Kích thước",accessorKey:"size",cell:({getValue:V,row:U})=>{const re=V();return l.jsx("span",{children:U.original.isFolder?"-":Fg(re)})}},{id:"lastModified",header:"Sửa đổi lần cuối",accessorKey:"lastModified",cell:({row:V})=>{const U=V.original.lastModified;return l.jsx("span",{children:U.toLocaleString()})}},{id:"actions",header:"Hành động",accessorKey:"key",cell:({row:V})=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ae,{variant:"ghost",size:"icon",onClick:()=>yd([V.original.key]),className:"h-8 w-8 p-0",disabled:ie.has(V.original.key),children:ie.has(V.original.key)?l.jsx(be,{className:"h-4 w-4 animate-spin"}):l.jsx(hi,{className:"h-4 w-4"})}),l.jsx(ae,{variant:"ghost",size:"icon",onClick:()=>{q(V.original),X(V.original.name)},className:"h-8 w-8 p-0",children:l.jsx(Md,{className:"h-4 w-4"})}),l.jsx(ae,{variant:"ghost",size:"icon",onClick:()=>S(V.original),className:"h-8 w-8 p-0",children:l.jsx(mi,{className:"h-4 w-4"})})]})}),I},[u,le,fe,ie,r]),fi=_i({data:le,columns:bd,state:{rowSelection:fe},enableRowSelection:!0,onRowSelectionChange:Wt,getCoreRowModel:Ai()}),wx=async I=>{if(Ur(I)){$t(!0);try{const V=await oe.get(`${t}/api/read-text`,{params:{path:I.key}});xe(V.data.content)}catch(V){console.error("Error loading file content:",V),R({title:"Lỗi",description:"Không thể tải nội dung tập tin",variant:"destructive"})}finally{$t(!1)}}},bx=async(I,V)=>{Ee(!0);try{await oe.post(`${t}/api/modify-text`,{path:I.key,content:V}),R({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),Xe.current=!0,await W(),q(null),xe(""),Oe("rename")}catch(U){console.error("Error saving file content:",U),R({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{Ee(!1)}};D.useEffect(()=>{M&&Ur(M)&&(wx(M),Oe("rename"))},[M]);const xx=async(I,V)=>{if(b){R({title:"Đang thu thập website",description:"Vui lòng đợi cho công việc thu thập hiện tại hoàn thành.",variant:"destructive"});return}Vn(!0);try{const{data:U}=await oe.post(`${t}/api/crawl`,{url:I,limit:V,prefix:f});if(U.id){A({id:U.id,url:I,limit:V,prefix:f});const re=localStorage.getItem(Yu),se=re?JSON.parse(re):[];se.some(pe=>pe.id===U.id)||(se.unshift({url:I,id:U.id,limit:V,prefix:f,timestamp:Date.now()}),se.length>20&&(se.length=20),localStorage.setItem(Yu,JSON.stringify(se))),R({title:"Bắt đầu thu thập website",description:`Đã thêm nhiệm vụ thu thập ${I} với giới hạn ${V}. Dữ liệu sẽ có sẵn sau khi thu thập hoàn tất.`}),ht(!1),ze(""),pn("1")}}catch(U){console.error("Error crawling website:",U),R({title:"Lỗi",description:"Không thể bắt đầu thu thập website",variant:"destructive"})}finally{Vn(!1)}};return l.jsxs("div",{className:"space-y-4 s3-explr-container",children:[l.jsx(Pa,{className:"s3-explr-breadcrumb",children:l.jsxs(Aa,{className:"s3-explr-breadcrumb-list",children:[l.jsx(ko,{className:"s3-explr-breadcrumb-item",children:l.jsx(Io,{onClick:()=>g(n),className:"flex items-center gap-1 cursor-pointer s3-explr-breadcrumb-home",children:e})}),wd.map((I,V)=>l.jsxs(l.Fragment,{children:[l.jsx(_a,{className:"s3-explr-breadcrumb-separator"},`sep-${V}`),l.jsx(ko,{className:"s3-explr-breadcrumb-item",children:l.jsx(Io,{onClick:()=>gn(n+wd.slice(0,V+1).join("/")+"/"),className:"cursor-pointer s3-explr-breadcrumb-link",children:I})},`item-${I}`)]}))]})}),l.jsxs("div",{className:"flex items-center space-x-4 s3-explr-toolbar",children:[l.jsx("div",{className:"relative max-w-sm w-full s3-explr-search-container",children:l.jsx(Hb,{ref:k,onChange:I=>a(I)})}),l.jsxs(ae,{variant:"outline",size:"sm",onClick:()=>{Xe.current=!0,W()},disabled:z,className:"flex items-center gap-2 s3-explr-refresh-btn",children:[l.jsx(Ed,{className:`h-4 w-4 s3-explr-refresh-icon ${z?"animate-spin":""}`}),"Làm mới"]}),!r&&l.jsxs(l.Fragment,{children:[u.size>0&&l.jsxs(l.Fragment,{children:[l.jsxs(ae,{variant:"outline",size:"sm",onClick:()=>yd(Array.from(u)),disabled:Array.from(u).some(I=>ie.has(I)),className:"flex items-center gap-2 s3-explr-download-selected-btn",children:[Array.from(u).some(I=>ie.has(I))?l.jsx(be,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}):l.jsx(hi,{className:"h-4 w-4 s3-explr-download-icon"}),"Tải xuống đã chọn (",u.size,")"]}),l.jsxs(zt,{open:O,onOpenChange:$,children:[l.jsx(gr,{asChild:!0,children:l.jsxs(ae,{variant:"destructive",size:"sm",className:"flex items-center gap-2 s3-explr-bulk-delete-btn",children:[l.jsx(mi,{className:"h-4 w-4 s3-explr-trash-icon"}),"Xóa đã chọn (",u.size,")"]})}),l.jsxs(Tt,{className:"s3-explr-dialog-content",children:[l.jsxs(Pt,{className:"s3-explr-dialog-header",children:[l.jsx(At,{className:"s3-explr-dialog-title",children:"Xác nhận xóa hàng loạt"}),l.jsxs(hr,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",u.size," mục đã chọn? Hành động này không thể hoàn tác."]})]}),l.jsxs(En,{className:"s3-explr-dialog-footer",children:[l.jsx(ae,{variant:"outline",onClick:()=>$(!1),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(ae,{variant:"destructive",onClick:di,disabled:P,className:"s3-explr-confirm-delete-btn",children:P?l.jsxs(l.Fragment,{children:[l.jsx(be,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa đã chọn"})]})]})]})]}),l.jsxs(zt,{open:m,onOpenChange:p,children:[l.jsx(gr,{asChild:!0,children:l.jsxs(ae,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-new-folder-btn",disabled:!!s&&!f,children:[l.jsx(Ad,{className:"h-4 w-4 s3-explr-folder-plus-icon"}),"Thư mục mới"]})}),l.jsxs(Tt,{className:"s3-explr-dialog-content",children:[l.jsx(Pt,{className:"s3-explr-dialog-header",children:l.jsx(At,{className:"s3-explr-dialog-title",children:"Tạo thư mục mới"})}),l.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(Ht,{htmlFor:"name",className:"s3-explr-label",children:"Tên thư mục"}),l.jsx(_t,{disabled:y,id:"name",value:v,onChange:I=>h(I.target.value),placeholder:"Nhập tên thư mục",className:"s3-explr-input"})]}),l.jsxs(ae,{onClick:()=>{v.trim()&&Bn(v,f)},disabled:y,className:"s3-explr-create-btn",children:[y&&l.jsx(be,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),y?"Đang tạo...":"Tạo"]})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2 s3-explr-upload-group",children:[l.jsx(ae,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-upload-files-btn",onClick:()=>{const I=document.createElement("input");I.type="file",I.multiple=!0,I.onchange=V=>{const U=V.target.files;U&&hn(U,f,"files")},I.click()},disabled:F!==null||!!s&&!f,children:F==="files"?l.jsxs(l.Fragment,{children:[l.jsx(be,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Td,{className:"h-4 w-4 s3-explr-upload-icon"}),"Tải lên tập tin"]})}),l.jsx(ae,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-upload-folder-btn",onClick:()=>{const I=document.createElement("input");I.type="file",I.multiple=!0,I.webkitdirectory=!0,I.onchange=V=>{const U=V.target.files;U&&hn(U,f,"folder")},I.click()},disabled:F!==null||!!s&&!f,children:F==="folder"?l.jsxs(l.Fragment,{children:[l.jsx(be,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Zr,{className:"h-4 w-4 s3-explr-folder-icon"}),"Tải lên thư mục"]})}),b?l.jsx(ku,{delayDuration:0,children:l.jsxs(Iu,{children:[l.jsx(Ru,{asChild:!0,children:l.jsx("div",{children:l.jsxs(ae,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!0,children:[l.jsx(be,{className:"h-4 w-4 animate-spin s3-explr-loader"}),b.status?l.jsxs(l.Fragment,{children:["Đang thu thập (",b.status.completed,"/",b.status.total,") - ",Math.floor(N/60),":",String(N%60).padStart(2,"0")]}):"Đang thu thập..."]})})}),b.status&&l.jsx(Xs,{side:"right",sideOffset:5,children:l.jsxs("div",{className:"space-y-1 p-2",children:[l.jsxs("p",{className:"font-semibold",children:["Đang thu thập ",b.url]}),l.jsxs("p",{children:["Tiến độ: ",b.status.completed,"/",b.status.total," trang"]}),l.jsxs("p",{children:["Thời gian: ",Math.floor(N/60),":",String(N%60).padStart(2,"0")]}),l.jsxs("p",{children:["Trạng thái:"," ",b.status.status==="scraping"?"Đang thu thập":b.status.status==="completed"?"Hoàn thành":"Thất bại"]})]})})]})}):l.jsxs(zt,{open:fn,onOpenChange:ht,children:[l.jsx(gr,{asChild:!0,children:l.jsxs(ae,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!!s&&!f,children:[l.jsx(Od,{className:"h-4 w-4 s3-explr-globe-icon"}),"Thêm website"]})}),l.jsxs(Tt,{className:"s3-explr-dialog-content",children:[l.jsxs(Pt,{className:"s3-explr-dialog-header",children:[l.jsx(At,{className:"s3-explr-dialog-title",children:"Thêm website"}),l.jsx(hr,{className:"s3-explr-dialog-description",children:"Nhập URL website để thu thập và thêm vào S3."})]}),l.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(Ht,{htmlFor:"websiteUrl",className:"s3-explr-label",children:"URL Website"}),l.jsx(_t,{id:"websiteUrl",value:mt,onChange:I=>ze(I.target.value),placeholder:"https://example.com",type:"url",disabled:It,className:"s3-explr-input"})]}),l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(Ht,{htmlFor:"crawlLimit",className:"s3-explr-label",children:"Giới hạn thu thập"}),l.jsx(_t,{id:"crawlLimit",value:kt,onChange:I=>{const V=I.target.value;/^\d*$/.test(V)&&pn(V)},placeholder:"1",type:"text",disabled:It,className:"s3-explr-input"}),l.jsx("p",{className:"text-sm text-gray-500",children:"Số lượng liên kết cần thu thập (mặc định: 1)"})]})]}),l.jsxs(En,{className:"s3-explr-dialog-footer",children:[l.jsx(ae,{variant:"outline",onClick:()=>{ht(!1),ze(""),pn("1")},disabled:It,className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(ae,{onClick:()=>{mt.trim()&&xx(mt.trim(),parseInt(kt)||1)},disabled:It||!mt.trim(),className:"s3-explr-crawl-btn",children:It?l.jsxs(l.Fragment,{children:[l.jsx(be,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]}):"Bắt đầu thu thập"})]})]})]})]}),l.jsx(zt,{open:!!x,onOpenChange:I=>!I&&S(null),children:l.jsxs(Tt,{className:"s3-explr-dialog-content",children:[l.jsxs(Pt,{className:"s3-explr-dialog-header",children:[l.jsx(At,{className:"s3-explr-dialog-title",children:"Xác nhận xóa"}),l.jsxs(hr,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",x==null?void 0:x.name,"? Hành động này không thể hoàn tác."]})]}),l.jsxs(En,{className:"s3-explr-dialog-footer",children:[l.jsx(ae,{variant:"outline",onClick:()=>S(null),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(ae,{variant:"destructive",onClick:()=>ui(x),disabled:E,className:"s3-explr-confirm-delete-btn",children:E?l.jsxs(l.Fragment,{children:[l.jsx(be,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa"})]})]})}),l.jsx(zt,{open:!!M,onOpenChange:I=>{I||(q(null),X(""),xe(""),Oe("rename"))},children:l.jsxs(Tt,{className:"s3-explr-dialog-content max-w-2xl",children:[l.jsx(Pt,{className:"s3-explr-dialog-header",children:l.jsx(At,{className:"s3-explr-dialog-title",children:M!=null&&M.isFolder?"Đổi tên thư mục":Ur(M)?"Quản lý tập tin":"Đổi tên tập tin"})}),M&&!M.isFolder&&Ur(M)?l.jsxs(ov,{value:Ye,onValueChange:I=>Oe(I),children:[l.jsxs(pc,{className:"grid w-full grid-cols-2",children:[l.jsx(gs,{value:"rename",children:"Đổi tên"}),l.jsx(gs,{value:"edit",children:"Sửa nội dung"})]}),l.jsx(hs,{value:"rename",children:l.jsx("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(Ht,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),l.jsx(_t,{id:"newName",value:j,onChange:I=>X(I.target.value),placeholder:"Nhập tên mới",disabled:K,className:"s3-explr-input"})]})})}),l.jsx(hs,{value:"edit",children:l.jsx("div",{className:"space-y-4 py-4",children:Be?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx(be,{className:"h-6 w-6 animate-spin"})}):l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ht,{htmlFor:"content",className:"s3-explr-label",children:"Nội dung tập tin"}),l.jsx(Cr,{id:"content",value:Fe,onChange:I=>xe(I.target.value),placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:we})]})})})]}):l.jsx("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(Ht,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),l.jsx(_t,{id:"newName",value:j,onChange:I=>X(I.target.value),placeholder:"Nhập tên mới",disabled:K,className:"s3-explr-input"})]})}),l.jsxs(En,{className:"s3-explr-dialog-footer",children:[l.jsx(ae,{variant:"outline",onClick:()=>{q(null),X(""),xe("")},className:"s3-explr-cancel-btn",children:"Hủy"}),Ye==="edit"?l.jsx(ae,{onClick:()=>M&&bx(M,Fe),disabled:we||Be,className:"s3-explr-save-btn",children:we?l.jsxs(l.Fragment,{children:[l.jsx(be,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):l.jsx(ae,{onClick:()=>{j.trim()&&M&&Jr(M,j.trim())},disabled:K||!j.trim()||j.trim()===(M==null?void 0:M.name),className:"s3-explr-rename-btn",children:K?l.jsxs(l.Fragment,{children:[l.jsx(be,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang đổi tên..."]}):"Đổi tên"})]})]})})]})]}),L&&l.jsx("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative s3-explr-error",children:"Đã xảy ra lỗi khi tải danh sách tập tin"}),l.jsx("div",{className:"rounded-md border s3-explr-table-container",children:l.jsxs(mr,{className:"s3-explr-table",children:[l.jsx(vr,{className:"s3-explr-table-header",children:fi.getHeaderGroups().map(I=>l.jsx(Ge,{className:"hover:bg-transparent s3-explr-header-row",children:I.headers.map(V=>l.jsx(et,{className:"s3-explr-header-cell",children:V.isPlaceholder?null:Gn(V.column.columnDef.header,V.getContext())},V.id))},I.id))}),l.jsx(yr,{className:"s3-explr-table-body",children:fi.getRowModel().rows.length===0?l.jsx(Ge,{className:"s3-explr-empty-row",children:l.jsx(Ae,{colSpan:bd.length,className:"h-24 text-center s3-explr-empty-cell",children:i?l.jsxs("div",{className:"text-gray-500 s3-explr-no-results",children:['Không tìm thấy tập tin hoặc thư mục nào khớp với "',i,'"']}):l.jsx("div",{className:"text-gray-500 s3-explr-empty-message",children:z?"Đang tải nội dung thư mục... Vui lòng đợi":"Thư mục này không chứa tập tin hoặc thư mục con nào"})})}):fi.getRowModel().rows.map(I=>l.jsx(Ge,{className:"h-12 s3-explr-row",children:I.getVisibleCells().map(V=>l.jsx(Ae,{className:"align-middle s3-explr-cell",children:Gn(V.column.columnDef.cell,V.getContext())},V.id))},I.id))})]})}),r&&o&&l.jsxs("div",{className:"flex justify-between items-center mt-4 s3-explr-selector-footer",children:[l.jsxs("div",{className:"text-sm text-gray-500 s3-explr-selection-count",children:[u.size," ",(u.size===1,"tập tin")," đã chọn"]}),l.jsx(ae,{variant:"default",onClick:()=>o(yx()),disabled:u.size===0,className:"s3-explr-ok-btn",children:"OK"})]}),!r&&l.jsx(Bc,{})]})});var $n=e=>e.type==="checkbox",jt=e=>e instanceof Date,Te=e=>e==null;const Zu=e=>typeof e=="object";var he=e=>!Te(e)&&!Array.isArray(e)&&Zu(e)&&!jt(e),Kb=e=>he(e)&&e.target?$n(e.target)?e.target.checked:e.target.value:e,Xb=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Jb=(e,t)=>e.has(Xb(t)),Yb=e=>{const t=e.constructor&&e.constructor.prototype;return he(t)&&t.hasOwnProperty("isPrototypeOf")},Ys=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ve(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Ys&&(e instanceof Blob||r))&&(n||he(e)))if(t=n?[]:{},!n&&!Yb(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=Ve(e[o]));else return e;return t}var jr=e=>Array.isArray(e)?e.filter(Boolean):[],ge=e=>e===void 0,H=(e,t,n)=>{if(!t||!he(e))return n;const r=jr(t.split(/[,[\].]+?/)).reduce((o,s)=>Te(o)?o:o[s],e);return ge(r)||r===e?ge(e[t])?n:e[t]:r},ot=e=>typeof e=="boolean",Zs=e=>/^\w*$/.test(e),Qu=e=>jr(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ue=(e,t,n)=>{let r=-1;const o=Zs(t)?[t]:Qu(t),s=o.length,i=s-1;for(;++r<s;){const a=o[r];let u=n;if(r!==i){const c=e[a];u=he(c)||Array.isArray(c)?c:isNaN(+o[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=u,e=e[a]}return e};const ed={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Je={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},pt={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};D.createContext(null);var Zb=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const i=s;return t._proxyFormState[i]!==Je.all&&(t._proxyFormState[i]=!r||Je.all),e[i]}});return o},_e=e=>he(e)&&!Object.keys(e).length,Qb=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return _e(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===Je.all)},Wr=e=>Array.isArray(e)?e:[e];function ex(e){const t=D.useRef(e);t.current=e,D.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}var st=e=>typeof e=="string",tx=(e,t,n,r,o)=>st(e)?(r&&t.watch.add(e),H(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),H(n,s))):(r&&(t.watchAll=!0),n),nx=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},td=e=>({isOnSubmit:!e||e===Je.onSubmit,isOnBlur:e===Je.onBlur,isOnChange:e===Je.onChange,isOnAll:e===Je.all,isOnTouch:e===Je.onTouched}),nd=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const kn=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const s=H(e,o);if(s){const{_f:i,...a}=s;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],o)&&!r)return!0;if(i.ref&&t(i.ref,i.name)&&!r)return!0;if(kn(a,t))break}else if(he(a)&&kn(a,t))break}}};var rx=(e,t,n)=>{const r=Wr(H(e,n));return ue(r,"root",t[n]),ue(e,n,r),e},Qs=e=>e.type==="file",it=e=>typeof e=="function",Gr=e=>{if(!Ys)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},qr=e=>st(e),ei=e=>e.type==="radio",Kr=e=>e instanceof RegExp;const rd={value:!1,isValid:!1},od={value:!0,isValid:!0};var sd=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ge(e[0].attributes.value)?ge(e[0].value)||e[0].value===""?od:{value:e[0].value,isValid:!0}:od:rd}return rd};const id={isValid:!1,value:null};var ad=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,id):id;function ld(e,t,n="validate"){if(qr(e)||Array.isArray(e)&&e.every(qr)||ot(e)&&!e)return{type:n,message:qr(e)?e:"",ref:t}}var dn=e=>he(e)&&!Kr(e)?e:{value:e,message:""},cd=async(e,t,n,r,o)=>{const{ref:s,refs:i,required:a,maxLength:u,minLength:c,min:f,max:g,pattern:m,validate:p,name:v,valueAsNumber:h,mount:y,disabled:w}=e._f,x=H(t,v);if(!y||w)return{};const S=i?i[0]:s,E=k=>{r&&S.reportValidity&&(S.setCustomValidity(ot(k)?"":k||""),S.reportValidity())},C={},P=ei(s),_=$n(s),O=P||_,$=(h||Qs(s))&&ge(s.value)&&ge(x)||Gr(s)&&s.value===""||x===""||Array.isArray(x)&&!x.length,F=nx.bind(null,v,n,C),G=(k,R,M,q=pt.maxLength,j=pt.minLength)=>{const X=k?R:M;C[v]={type:k?q:j,message:X,ref:s,...F(k?q:j,X)}};if(o?!Array.isArray(x)||!x.length:a&&(!O&&($||Te(x))||ot(x)&&!x||_&&!sd(i).isValid||P&&!ad(i).isValid)){const{value:k,message:R}=qr(a)?{value:!!a,message:a}:dn(a);if(k&&(C[v]={type:pt.required,message:R,ref:S,...F(pt.required,R)},!n))return E(R),C}if(!$&&(!Te(f)||!Te(g))){let k,R;const M=dn(g),q=dn(f);if(!Te(x)&&!isNaN(x)){const j=s.valueAsNumber||x&&+x;Te(M.value)||(k=j>M.value),Te(q.value)||(R=j<q.value)}else{const j=s.valueAsDate||new Date(x),X=ie=>new Date(new Date().toDateString()+" "+ie),K=s.type=="time",ee=s.type=="week";st(M.value)&&x&&(k=K?X(x)>X(M.value):ee?x>M.value:j>new Date(M.value)),st(q.value)&&x&&(R=K?X(x)<X(q.value):ee?x<q.value:j<new Date(q.value))}if((k||R)&&(G(!!k,M.message,q.message,pt.max,pt.min),!n))return E(C[v].message),C}if((u||c)&&!$&&(st(x)||o&&Array.isArray(x))){const k=dn(u),R=dn(c),M=!Te(k.value)&&x.length>+k.value,q=!Te(R.value)&&x.length<+R.value;if((M||q)&&(G(M,k.message,R.message),!n))return E(C[v].message),C}if(m&&!$&&st(x)){const{value:k,message:R}=dn(m);if(Kr(k)&&!x.match(k)&&(C[v]={type:pt.pattern,message:R,ref:s,...F(pt.pattern,R)},!n))return E(R),C}if(p){if(it(p)){const k=await p(x,t),R=ld(k,S);if(R&&(C[v]={...R,...F(pt.validate,R.message)},!n))return E(R.message),C}else if(he(p)){let k={};for(const R in p){if(!_e(k)&&!n)break;const M=ld(await p[R](x,t),S,R);M&&(k={...M,...F(R,M.message)},E(M.message),n&&(C[v]=k))}if(!_e(k)&&(C[v]={ref:S,...k},!n))return C}}return E(!0),C};function ox(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=ge(e)?r++:e[t[r++]];return e}function sx(e){for(const t in e)if(e.hasOwnProperty(t)&&!ge(e[t]))return!1;return!0}function ye(e,t){const n=Array.isArray(t)?t:Zs(t)?[t]:Qu(t),r=n.length===1?e:ox(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(he(r)&&_e(r)||Array.isArray(r)&&sx(r))&&ye(e,n.slice(0,-1)),e}var ti=()=>{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}},ni=e=>Te(e)||!Zu(e);function Mt(e,t){if(ni(e)||ni(t))return e===t;if(jt(e)&&jt(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const s=e[o];if(!r.includes(o))return!1;if(o!=="ref"){const i=t[o];if(jt(s)&&jt(i)||he(s)&&he(i)||Array.isArray(s)&&Array.isArray(i)?!Mt(s,i):s!==i)return!1}}return!0}var ud=e=>e.type==="select-multiple",ix=e=>ei(e)||$n(e),ri=e=>Gr(e)&&e.isConnected,dd=e=>{for(const t in e)if(it(e[t]))return!0;return!1};function Xr(e,t={}){const n=Array.isArray(e);if(he(e)||n)for(const r in e)Array.isArray(e[r])||he(e[r])&&!dd(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Xr(e[r],t[r])):Te(e[r])||(t[r]=!0);return t}function fd(e,t,n){const r=Array.isArray(e);if(he(e)||r)for(const o in e)Array.isArray(e[o])||he(e[o])&&!dd(e[o])?ge(t)||ni(n[o])?n[o]=Array.isArray(e[o])?Xr(e[o],[]):{...Xr(e[o])}:fd(e[o],Te(t)?{}:t[o],n[o]):n[o]=!Mt(e[o],t[o]);return n}var In=(e,t)=>fd(e,t,Xr(t)),pd=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>ge(e)?e:t?e===""?NaN:e&&+e:n&&st(e)?new Date(e):r?r(e):e;function oi(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return Qs(t)?t.files:ei(t)?ad(e.refs).value:ud(t)?[...t.selectedOptions].map(({value:n})=>n):$n(t)?sd(e.refs).value:pd(ge(t.value)?e.ref.value:t.value,e)}var ax=(e,t,n,r)=>{const o={};for(const s of e){const i=H(t,s);i&&ue(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Rn=e=>ge(e)?e:Kr(e)?e.source:he(e)?Kr(e.value)?e.value.source:e.value:e;const gd="AsyncFunction";var lx=e=>!!e&&!!e.validate&&!!(it(e.validate)&&e.validate.constructor.name===gd||he(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===gd)),cx=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function hd(e,t,n){const r=H(e,n);if(r||Zs(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),i=H(t,s),a=H(e,s);if(i&&!Array.isArray(i)&&n!==s)return{name:n};if(a&&a.type)return{name:s,error:a};o.pop()}return{name:n}}var ux=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,dx=(e,t)=>!jr(H(e,t)).length&&ye(e,t);const fx={mode:Je.onSubmit,reValidateMode:Je.onChange,shouldFocusError:!0};function px(e={}){let t={...fx,...e},n={submitCount:0,isDirty:!1,isLoading:it(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=he(t.defaultValues)||he(t.values)?Ve(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:Ve(o),i={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,c=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},g={values:ti(),array:ti(),state:ti()},m=td(t.mode),p=td(t.reValidateMode),v=t.criteriaMode===Je.all,h=b=>N=>{clearTimeout(c),c=setTimeout(b,N)},y=async b=>{if(!t.disabled&&(f.isValid||b)){const N=t.resolver?_e((await O()).errors):await F(r,!0);N!==n.isValid&&g.state.next({isValid:N})}},w=(b,N)=>{!t.disabled&&(f.isValidating||f.validatingFields)&&((b||Array.from(a.mount)).forEach(A=>{A&&(N?ue(n.validatingFields,A,N):ye(n.validatingFields,A))}),g.state.next({validatingFields:n.validatingFields,isValidating:!_e(n.validatingFields)}))},x=(b,N=[],A,B,z=!0,L=!0)=>{if(B&&A&&!t.disabled){if(i.action=!0,L&&Array.isArray(H(r,b))){const W=A(H(r,b),B.argA,B.argB);z&&ue(r,b,W)}if(L&&Array.isArray(H(n.errors,b))){const W=A(H(n.errors,b),B.argA,B.argB);z&&ue(n.errors,b,W),dx(n.errors,b)}if(f.touchedFields&&L&&Array.isArray(H(n.touchedFields,b))){const W=A(H(n.touchedFields,b),B.argA,B.argB);z&&ue(n.touchedFields,b,W)}f.dirtyFields&&(n.dirtyFields=In(o,s)),g.state.next({name:b,isDirty:k(b,N),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else ue(s,b,N)},S=(b,N)=>{ue(n.errors,b,N),g.state.next({errors:n.errors})},E=b=>{n.errors=b,g.state.next({errors:n.errors,isValid:!1})},C=(b,N,A,B)=>{const z=H(r,b);if(z){const L=H(s,b,ge(A)?H(o,b):A);ge(L)||B&&B.defaultChecked||N?ue(s,b,N?L:oi(z._f)):q(b,L),i.mount&&y()}},P=(b,N,A,B,z)=>{let L=!1,W=!1;const ne={name:b};if(!t.disabled){const le=!!(H(r,b)&&H(r,b)._f&&H(r,b)._f.disabled);if(!A||B){f.isDirty&&(W=n.isDirty,n.isDirty=ne.isDirty=k(),L=W!==ne.isDirty);const fe=le||Mt(H(o,b),N);W=!!(!le&&H(n.dirtyFields,b)),fe||le?ye(n.dirtyFields,b):ue(n.dirtyFields,b,!0),ne.dirtyFields=n.dirtyFields,L=L||f.dirtyFields&&W!==!fe}if(A){const fe=H(n.touchedFields,b);fe||(ue(n.touchedFields,b,A),ne.touchedFields=n.touchedFields,L=L||f.touchedFields&&fe!==A)}L&&z&&g.state.next(ne)}return L?ne:{}},_=(b,N,A,B)=>{const z=H(n.errors,b),L=f.isValid&&ot(N)&&n.isValid!==N;if(t.delayError&&A?(u=h(()=>S(b,A)),u(t.delayError)):(clearTimeout(c),u=null,A?ue(n.errors,b,A):ye(n.errors,b)),(A?!Mt(z,A):z)||!_e(B)||L){const W={...B,...L&&ot(N)?{isValid:N}:{},errors:n.errors,name:b};n={...n,...W},g.state.next(W)}},O=async b=>{w(b,!0);const N=await t.resolver(s,t.context,ax(b||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(b),N},$=async b=>{const{errors:N}=await O(b);if(b)for(const A of b){const B=H(N,A);B?ue(n.errors,A,B):ye(n.errors,A)}else n.errors=N;return N},F=async(b,N,A={valid:!0})=>{for(const B in b){const z=b[B];if(z){const{_f:L,...W}=z;if(L){const ne=a.array.has(L.name),le=z._f&&lx(z._f);le&&f.validatingFields&&w([B],!0);const fe=await cd(z,s,v,t.shouldUseNativeValidation&&!N,ne);if(le&&f.validatingFields&&w([B]),fe[L.name]&&(A.valid=!1,N))break;!N&&(H(fe,L.name)?ne?rx(n.errors,fe,L.name):ue(n.errors,L.name,fe[L.name]):ye(n.errors,L.name))}!_e(W)&&await F(W,N,A)}}return A.valid},G=()=>{for(const b of a.unMount){const N=H(r,b);N&&(N._f.refs?N._f.refs.every(A=>!ri(A)):!ri(N._f.ref))&&we(b)}a.unMount=new Set},k=(b,N)=>!t.disabled&&(b&&N&&ue(s,b,N),!Mt(de(),o)),R=(b,N,A)=>tx(b,a,{...i.mount?s:ge(N)?o:st(b)?{[b]:N}:N},A,N),M=b=>jr(H(i.mount?s:o,b,t.shouldUnregister?H(o,b,[]):[])),q=(b,N,A={})=>{const B=H(r,b);let z=N;if(B){const L=B._f;L&&(!L.disabled&&ue(s,b,pd(N,L)),z=Gr(L.ref)&&Te(N)?"":N,ud(L.ref)?[...L.ref.options].forEach(W=>W.selected=z.includes(W.value)):L.refs?$n(L.ref)?L.refs.length>1?L.refs.forEach(W=>(!W.defaultChecked||!W.disabled)&&(W.checked=Array.isArray(z)?!!z.find(ne=>ne===W.value):z===W.value)):L.refs[0]&&(L.refs[0].checked=!!z):L.refs.forEach(W=>W.checked=W.value===z):Qs(L.ref)?L.ref.value="":(L.ref.value=z,L.ref.type||g.values.next({name:b,values:{...s}})))}(A.shouldDirty||A.shouldTouch)&&P(b,z,A.shouldTouch,A.shouldDirty,!0),A.shouldValidate&&ie(b)},j=(b,N,A)=>{for(const B in N){const z=N[B],L=`${b}.${B}`,W=H(r,L);(a.array.has(b)||he(z)||W&&!W._f)&&!jt(z)?j(L,z,A):q(L,z,A)}},X=(b,N,A={})=>{const B=H(r,b),z=a.array.has(b),L=Ve(N);ue(s,b,L),z?(g.array.next({name:b,values:{...s}}),(f.isDirty||f.dirtyFields)&&A.shouldDirty&&g.state.next({name:b,dirtyFields:In(o,s),isDirty:k(b,L)})):B&&!B._f&&!Te(L)?j(b,L,A):q(b,L,A),nd(b,a)&&g.state.next({...n}),g.values.next({name:i.mount?b:void 0,values:{...s}})},K=async b=>{i.mount=!0;const N=b.target;let A=N.name,B=!0;const z=H(r,A),L=()=>N.type?oi(z._f):Kb(b),W=ne=>{B=Number.isNaN(ne)||jt(ne)&&isNaN(ne.getTime())||Mt(ne,H(s,A,ne))};if(z){let ne,le;const fe=L(),vt=b.type===ed.BLUR||b.type===ed.FOCUS_OUT,gn=!cx(z._f)&&!t.resolver&&!H(n.errors,A)&&!z._f.deps||ux(vt,H(n.touchedFields,A),n.isSubmitted,p,m),Bn=nd(A,a,vt);ue(s,A,fe),vt?(z._f.onBlur&&z._f.onBlur(b),u&&u(0)):z._f.onChange&&z._f.onChange(b);const hn=P(A,fe,vt,!1),ui=!_e(hn)||Bn;if(!vt&&g.values.next({name:A,type:b.type,values:{...s}}),gn)return f.isValid&&(t.mode==="onBlur"?vt&&y():y()),ui&&g.state.next({name:A,...Bn?{}:hn});if(!vt&&Bn&&g.state.next({...n}),t.resolver){const{errors:Wt}=await O([A]);if(W(fe),B){const di=hd(n.errors,r,A),Jr=hd(Wt,r,di.name||A);ne=Jr.error,A=Jr.name,le=_e(Wt)}}else w([A],!0),ne=(await cd(z,s,v,t.shouldUseNativeValidation))[A],w([A]),W(fe),B&&(ne?le=!1:f.isValid&&(le=await F(r,!0)));B&&(z._f.deps&&ie(z._f.deps),_(A,le,ne,hn))}},ee=(b,N)=>{if(H(n.errors,N)&&b.focus)return b.focus(),1},ie=async(b,N={})=>{let A,B;const z=Wr(b);if(t.resolver){const L=await $(ge(b)?b:z);A=_e(L),B=b?!z.some(W=>H(L,W)):A}else b?(B=(await Promise.all(z.map(async L=>{const W=H(r,L);return await F(W&&W._f?{[L]:W}:W)}))).every(Boolean),!(!B&&!n.isValid)&&y()):B=A=await F(r);return g.state.next({...!st(b)||f.isValid&&A!==n.isValid?{}:{name:b},...t.resolver||!b?{isValid:A}:{},errors:n.errors}),N.shouldFocus&&!B&&kn(r,ee,b?z:a.mount),B},de=b=>{const N={...i.mount?s:o};return ge(b)?N:st(b)?H(N,b):b.map(A=>H(N,A))},Fe=(b,N)=>({invalid:!!H((N||n).errors,b),isDirty:!!H((N||n).dirtyFields,b),error:H((N||n).errors,b),isValidating:!!H(n.validatingFields,b),isTouched:!!H((N||n).touchedFields,b)}),xe=b=>{b&&Wr(b).forEach(N=>ye(n.errors,N)),g.state.next({errors:b?n.errors:{}})},Be=(b,N,A)=>{const B=(H(r,b,{_f:{}})._f||{}).ref,z=H(n.errors,b)||{},{ref:L,message:W,type:ne,...le}=z;ue(n.errors,b,{...le,...N,ref:B}),g.state.next({name:b,errors:n.errors,isValid:!1}),A&&A.shouldFocus&&B&&B.focus&&B.focus()},$t=(b,N)=>it(b)?g.values.subscribe({next:A=>b(R(void 0,N),A)}):R(b,N,!0),we=(b,N={})=>{for(const A of b?Wr(b):a.mount)a.mount.delete(A),a.array.delete(A),N.keepValue||(ye(r,A),ye(s,A)),!N.keepError&&ye(n.errors,A),!N.keepDirty&&ye(n.dirtyFields,A),!N.keepTouched&&ye(n.touchedFields,A),!N.keepIsValidating&&ye(n.validatingFields,A),!t.shouldUnregister&&!N.keepDefaultValue&&ye(o,A);g.values.next({values:{...s}}),g.state.next({...n,...N.keepDirty?{isDirty:k()}:{}}),!N.keepIsValid&&y()},Ee=({disabled:b,name:N,field:A,fields:B,value:z})=>{if(ot(b)&&i.mount||b){const L=b?void 0:ge(z)?oi(A?A._f:H(B,N)._f):z;(b||!b&&!ge(L))&&ue(s,N,L),P(N,L,!1,!1,!0)}},Ye=(b,N={})=>{let A=H(r,b);const B=ot(N.disabled)||ot(t.disabled);return ue(r,b,{...A||{},_f:{...A&&A._f?A._f:{ref:{name:b}},name:b,mount:!0,...N}}),a.mount.add(b),A?Ee({field:A,disabled:ot(N.disabled)?N.disabled:t.disabled,name:b,value:N.value}):C(b,!0,N.value),{...B?{disabled:N.disabled||t.disabled}:{},...t.progressive?{required:!!N.required,min:Rn(N.min),max:Rn(N.max),minLength:Rn(N.minLength),maxLength:Rn(N.maxLength),pattern:Rn(N.pattern)}:{},name:b,onChange:K,onBlur:K,ref:z=>{if(z){Ye(b,N),A=H(r,b);const L=ge(z.value)&&z.querySelectorAll&&z.querySelectorAll("input,select,textarea")[0]||z,W=ix(L),ne=A._f.refs||[];if(W?ne.find(le=>le===L):L===A._f.ref)return;ue(r,b,{_f:{...A._f,...W?{refs:[...ne.filter(ri),L,...Array.isArray(H(o,b))?[{}]:[]],ref:{type:L.type,name:b}}:{ref:L}}}),C(b,!1,void 0,L)}else A=H(r,b,{}),A._f&&(A._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(Jb(a.array,b)&&i.action)&&a.unMount.add(b)}}},Oe=()=>t.shouldFocusError&&kn(r,ee,a.mount),fn=b=>{ot(b)&&(g.state.next({disabled:b}),kn(r,(N,A)=>{const B=H(r,A);B&&(N.disabled=B._f.disabled||b,Array.isArray(B._f.refs)&&B._f.refs.forEach(z=>{z.disabled=B._f.disabled||b}))},0,!1))},ht=(b,N)=>async A=>{let B;if(A&&(A.preventDefault&&A.preventDefault(),A.persist&&A.persist()),t.disabled){N&&await N({...n.errors},A);return}let z=Ve(s);if(g.state.next({isSubmitting:!0}),t.resolver){const{errors:L,values:W}=await O();n.errors=L,z=W}else await F(r);if(ye(n.errors,"root"),_e(n.errors)){g.state.next({errors:{}});try{await b(z,A)}catch(L){B=L}}else N&&await N({...n.errors},A),Oe(),setTimeout(Oe);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:_e(n.errors)&&!B,submitCount:n.submitCount+1,errors:n.errors}),B)throw B},mt=(b,N={})=>{H(r,b)&&(ge(N.defaultValue)?X(b,Ve(H(o,b))):(X(b,N.defaultValue),ue(o,b,Ve(N.defaultValue))),N.keepTouched||ye(n.touchedFields,b),N.keepDirty||(ye(n.dirtyFields,b),n.isDirty=N.defaultValue?k(b,Ve(H(o,b))):k()),N.keepError||(ye(n.errors,b),f.isValid&&y()),g.state.next({...n}))},ze=(b,N={})=>{const A=b?Ve(b):o,B=Ve(A),z=_e(b),L=z?o:B;if(N.keepDefaultValues||(o=A),!N.keepValues){if(N.keepDirtyValues){const W=new Set([...a.mount,...Object.keys(In(o,s))]);for(const ne of Array.from(W))H(n.dirtyFields,ne)?ue(L,ne,H(s,ne)):X(ne,H(L,ne))}else{if(Ys&&ge(b))for(const W of a.mount){const ne=H(r,W);if(ne&&ne._f){const le=Array.isArray(ne._f.refs)?ne._f.refs[0]:ne._f.ref;if(Gr(le)){const fe=le.closest("form");if(fe){fe.reset();break}}}}r={}}s=t.shouldUnregister?N.keepDefaultValues?Ve(o):{}:Ve(L),g.array.next({values:{...L}}),g.values.next({values:{...L}})}a={mount:N.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!f.isValid||!!N.keepIsValid||!!N.keepDirtyValues,i.watch=!!t.shouldUnregister,g.state.next({submitCount:N.keepSubmitCount?n.submitCount:0,isDirty:z?!1:N.keepDirty?n.isDirty:!!(N.keepDefaultValues&&!Mt(b,o)),isSubmitted:N.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:z?{}:N.keepDirtyValues?N.keepDefaultValues&&s?In(o,s):n.dirtyFields:N.keepDefaultValues&&b?In(o,b):N.keepDirty?n.dirtyFields:{},touchedFields:N.keepTouched?n.touchedFields:{},errors:N.keepErrors?n.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},kt=(b,N)=>ze(it(b)?b(s):b,N);return{control:{register:Ye,unregister:we,getFieldState:Fe,handleSubmit:ht,setError:Be,_executeSchema:O,_getWatch:R,_getDirty:k,_updateValid:y,_removeUnmounted:G,_updateFieldArray:x,_updateDisabledField:Ee,_getFieldArray:M,_reset:ze,_resetDefaultValues:()=>it(t.defaultValues)&&t.defaultValues().then(b=>{kt(b,t.resetOptions),g.state.next({isLoading:!1})}),_updateFormState:b=>{n={...n,...b}},_disableForm:fn,_subjects:g,_proxyFormState:f,_setErrors:E,get _fields(){return r},get _formValues(){return s},get _state(){return i},set _state(b){i=b},get _defaultValues(){return o},get _names(){return a},set _names(b){a=b},get _formState(){return n},set _formState(b){n=b},get _options(){return t},set _options(b){t={...t,...b}}},trigger:ie,register:Ye,handleSubmit:ht,watch:$t,setValue:X,getValues:de,reset:kt,resetField:mt,clearErrors:xe,unregister:we,setError:Be,setFocus:(b,N={})=>{const A=H(r,b),B=A&&A._f;if(B){const z=B.refs?B.refs[0]:B.ref;z.focus&&(z.focus(),N.shouldSelect&&it(z.select)&&z.select())}},getFieldState:Fe}}function gx(e={}){const t=D.useRef(),n=D.useRef(),[r,o]=D.useState({isDirty:!1,isValidating:!1,isLoading:it(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:it(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...px(e),formState:r});const s=t.current.control;return s._options=e,ex({subject:s._subjects.state,next:i=>{Qb(i,s._proxyFormState,s._updateFormState)&&o({...s._formState})}}),D.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),D.useEffect(()=>{if(s._proxyFormState.isDirty){const i=s._getDirty();i!==r.isDirty&&s._subjects.state.next({isDirty:i})}},[s,r.isDirty]),D.useEffect(()=>{e.values&&!Mt(e.values,n.current)?(s._reset(e.values,s._options.resetOptions),n.current=e.values,o(i=>({...i}))):s._resetDefaultValues()},[e.values,s]),D.useEffect(()=>{e.errors&&s._setErrors(e.errors)},[e.errors,s]),D.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),D.useEffect(()=>{e.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[e.shouldUnregister,s]),D.useMemo(()=>({...t.current,formState:Zb(r,s)}),[r,s])}const md=({className:e,children:t,content:n,side:r})=>{const[o,s]=D.useState(!1);return l.jsx(ku,{delayDuration:0,children:l.jsxs(Iu,{open:o,children:[l.jsx(Ru,{asChild:!0,children:l.jsx("button",{type:"button",className:Z("cursor-pointer",e),onClick:()=>s(!o),onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onTouchStart:()=>s(!o),onKeyDown:i=>{i.preventDefault(),i.key==="Enter"&&s(!o)},children:t})}),l.jsx(Xs,{side:r,className:n?"":"hidden",children:l.jsx("span",{className:"inline-block",children:n})})]})})},si=({className:e,...t})=>l.jsx("nav",{role:"navigation","aria-label":"pagination",className:Z("mx-auto flex w-full justify-center",e),...t});si.displayName="Pagination";const ii=d.forwardRef(({className:e,...t},n)=>l.jsx("ul",{ref:n,className:Z("flex flex-row items-center gap-1",e),...t}));ii.displayName="PaginationContent";const gt=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:Z("",e),...t}));gt.displayName="PaginationItem";const Ln=({className:e,isActive:t,size:n="icon",...r})=>l.jsx("a",{"aria-current":t?"page":void 0,className:Z(Da({variant:t?"outline":"ghost",size:n}),e),...r});Ln.displayName="PaginationLink";const ai=({className:e,...t})=>l.jsxs(Ln,{"aria-label":"Go to previous page",size:"default",className:Z("gap-1 pl-2.5",e),...t,children:[l.jsx(Wp,{className:"h-4 w-4"}),l.jsx("span",{children:"Previous"})]});ai.displayName="PaginationPrevious";const li=({className:e,...t})=>l.jsxs(Ln,{"aria-label":"Go to next page",size:"default",className:Z("gap-1 pr-2.5",e),...t,children:[l.jsx("span",{children:"Next"}),l.jsx(ha,{className:"h-4 w-4"})]});li.displayName="PaginationNext";const ci=({className:e,...t})=>l.jsxs("span",{"aria-hidden":!0,className:Z("flex h-9 w-9 items-center justify-center",e),...t,children:[l.jsx(Gp,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"More pages"})]});ci.displayName="PaginationEllipsis";const hx=(e,t)=>{const[n,r]=D.useState(e);return D.useEffect(()=>{const o=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(o)}},[e,t]),n},mx=({apiBaseUrl:e="http://localhost:3000"})=>{var P,_;const[t,n]=D.useState([]),[r,o]=D.useState(!1),[s,i]=D.useState([]),[a,u]=D.useState(1),[c,f]=D.useState(1),[g,m]=D.useState(null),[p,v]=D.useState(""),h=hx(p,500),y=O=>{const $=O.match(/\d{6}/);if(!$)return{month:"",year:""};const F=$[0],G=F.substring(0,2),k=F.substring(2);return{month:G,year:k}},w=O=>O.map(F=>{let G=(F==null?void 0:F.month)||"",k=(F==null?void 0:F.year)||"";if((!G||!k)&&(F!=null&&F.file_name)){const R=y(F.file_name);G=G||R.month,k=k||R.year}return{id:F==null?void 0:F.id,prefix:(F==null?void 0:F.prefix)||"",model:(F==null?void 0:F.model)||"",fileName:(F==null?void 0:F.file_name)||"",code:(F==null?void 0:F.stock_id)||"",month:G,year:k,content:(F==null?void 0:F.text_summary)||"",status:(F==null?void 0:F.status)||"",note:(F==null?void 0:F.note)||"",lastUpdate:F==null?void 0:F.updated_at,stock_id:F==null?void 0:F.stock_id}}),x=O=>{if(!(O!=null&&O.data))return[];const $=w(O==null?void 0:O.data);n($),f(O.pagination.totalPages)},S=async(O=1,$=15)=>{m(O),o(!0);try{const F=await oe.get(`${e}/api/latest-summaries`,{params:{page:O,limit:$,search:p}});(F==null?void 0:F.status)===200?x(F.data):console.error(F)}catch(F){console.error("Error fetching data:",F)}finally{m(null),o(!1)}};D.useEffect(()=>{h&&u(1),S(a)},[a,h]);const E=D.useMemo(()=>[{id:"code",header:"Mã",accessorKey:"code",cell:({row:$})=>l.jsx("span",{className:"flex flex-col",children:$.original.code})},{id:"month",header:"Tháng",accessorKey:"month",cell:({row:$})=>{const F=$.original.month,G=$.original.year;return l.jsx("span",{className:"flex flex-col",children:`${F.toString().padStart(2,"0")}/${G}`})}},{id:"content",header:"Nội dung",accessorKey:"content",cell:({row:$})=>{const F=$.getValue("content");return l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]",children:F})}},{id:"status",header:"Trạng thái",accessorKey:"status",cell:({row:$})=>{const G=$.original.status!=="unpublish";return l.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0 text-[10px] font-bold ${G?"bg-green-50 text-green-700 ring-1 ring-inset ring-green-600/20":"bg-gray-50 text-gray-600 ring-1 ring-inset ring-gray-500/20"}`,children:G?"PUBLISHED":"UNPUBLISHED"})}},{id:"note",header:"Ghi chú",accessorKey:"note",cell:({row:$})=>l.jsx(md,{content:l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:$.original.note}),children:l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[20dvw]",children:$.original.note})})},{id:"last-update",header:"Cập nhật",accessorKey:"last-update",cell:({row:$})=>{const F=new Date($.original.lastUpdate),G=F.getDate(),k=F.getMonth()+1,R=`ngày ${G} tháng ${k}`;return l.jsx("span",{className:"flex flex-col",children:R})}},{accessorKey:"actions",header:()=>l.jsx("div",{className:"font-medium text-right",children:"Hành động"}),cell:({row:$})=>{const[F,G]=D.useState(!1),[k,R]=D.useState(!1),[M,q]=D.useState(!1),{handleSubmit:j,register:X,reset:K}=gx(),ee=$.original.id,ie=$.getValue("status"),de=$.getValue("content"),[Fe,xe]=D.useState(!1),Be=async()=>{try{xe(!0);const we=ie==="unpublish"?"published":"unpublish",Ee=await oe.patch(`${e}/api/toggle-publish/${ee}`,{id:ee,typeAction:"update",status:ie,idInput:ee,stock_id:$.original.stock_id,prefix:$.original.prefix,model:$.original.model,summary_result:$.original.content,note:$.original.note});Ee.status===200?n(Ye=>Ye.map(Oe=>Oe.id===ee?{...Oe,status:we}:Oe)):console.error("Failed to toggle publish status:",Ee)}catch(we){console.error("Error toggling publish status:",we)}finally{xe(!1)}},$t=async we=>{G(!0);try{const Ee=await oe.patch(`${e}/api/update-summary`,{note:we.note,text_summary:we.content,id:ee});Ee.status===200?(await S(a),R(!1)):console.error("Failed to update summary:",Ee)}catch(Ee){console.error("Error updating summary:",Ee)}return G(!1)};return l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(ae,{variant:"outline",size:"sm",onClick:()=>q(!0),className:"px-2 py-0.5 h-7",children:l.jsx(qp,{className:"h-4 w-4"})}),l.jsx(zt,{open:M,onOpenChange:q,children:l.jsxs(Tt,{className:"max-w-3xl max-h-[80vh]",children:[l.jsx(Pt,{children:l.jsx(At,{children:"Nội dung chi tiết"})}),l.jsx("div",{className:"mt-4 overflow-y-auto max-h-[60vh]",children:l.jsx("div",{className:"whitespace-pre-wrap text-[16px] leading-relaxed",children:de})})]})}),l.jsxs(zt,{open:k,onOpenChange:we=>{R(we),we?K({content:$.original.content,note:$.original.note}):K()},children:[l.jsx(gr,{asChild:!0,children:l.jsx(ae,{variant:"outline",size:"sm",onClick:()=>R(!0),className:"px-2 py-0.5 h-7",children:"Sửa"})}),l.jsx(Tt,{className:"rounded-lg sm:px-3 h-[calc(100dvh-200px)] min-w-[calc(100dvw-112px)]",children:l.jsxs(Pt,{className:"flex flex-col gap-3",children:[l.jsx(At,{className:"max-sm:hidden text-center",children:"Sửa summary"}),l.jsxs("form",{className:"flex flex-col gap-3 h-full justify-between",onSubmit:j($t),children:[l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{children:"Nội dung:"}),l.jsx(Cr,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:$.original.answer||"",rows:10,...X("content")})]}),l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{children:"Ghi chú:"}),l.jsx(Cr,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:$.original.note||"",rows:1,...X("note")})]})]}),l.jsx("div",{className:"flex justify-end",children:l.jsx(ae,{disabled:F,type:"submit",variant:"default",children:F?l.jsx(be,{className:"h-4 w-4 animate-spin"}):"Ok"})})]})]})})]}),l.jsx(ae,{variant:"outline",size:"sm",onClick:Be,disabled:Fe,className:"w-[70px] px-2 py-0.5 h-7",children:Fe?l.jsx(be,{className:"h-4 w-4 animate-spin"}):ie==="unpublish"?"Publish":"Unpublish"})]})}}],[]),C=_i({data:t,columns:E,state:{columnFilters:s},enableRowSelection:!0,onColumnFiltersChange:i,getFilteredRowModel:pf(),getCoreRowModel:Ai()});return l.jsxs("div",{className:"space-y-4 s3-explr-container",children:[l.jsx("div",{className:"flex items-center space-x-4 s3-explr-toolbar",children:l.jsxs("div",{className:"relative max-w-sm",children:[l.jsx(_t,{placeholder:"Tìm kiếm theo mã...",value:p,onChange:O=>v(O.target.value),className:"pr-8"}),p&&l.jsx(ae,{variant:"ghost",size:"sm",className:"absolute right-1 top-1/2 -translate-y-1/2 h-6 w-6 p-0",onClick:()=>v(""),children:l.jsx(Fo,{className:"h-4 w-4"})})]})}),l.jsx("div",{className:"rounded-md border s3-explr-table-container",children:l.jsxs(mr,{className:"s3-explr-table",children:[l.jsx(vr,{className:"s3-explr-table-header",children:C.getHeaderGroups().map(O=>l.jsx(Ge,{className:"hover:bg-transparent s3-explr-header-row",children:O.headers.map($=>l.jsx(et,{className:"s3-explr-header-cell",children:$.isPlaceholder?null:Gn($.column.columnDef.header,$.getContext())},$.id))},O.id))}),l.jsx(yr,{className:"s3-explr-table-body",children:r?l.jsx(Ge,{children:l.jsx(Ae,{colSpan:E.length,className:"h-24 text-center",children:"Đang tải dữ liệu..."})}):(P=C.getRowModel().rows)!=null&&P.length?(_=C.getRowModel().rows)==null?void 0:_.map(O=>l.jsx(Ge,{className:"h-12 s3-explr-row",children:O.getVisibleCells().map($=>l.jsx(Ae,{className:"align-middle s3-explr-cell",children:Gn($.column.columnDef.cell,$.getContext())},$.id))},O.id)):l.jsx(Ge,{children:l.jsx(Ae,{colSpan:E.length,className:"h-24 text-center",children:"Không có kết quả."})})})]})}),l.jsx("div",{className:"mt-4",children:l.jsx(si,{children:l.jsxs(ii,{children:[l.jsx(gt,{children:l.jsx(ai,{onClick:()=>u(O=>Math.max(1,O-1)),className:a===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:c},(O,$)=>$+1).filter(O=>O===1||O===c||Math.abs(O-a)<=1).map((O,$,F)=>l.jsxs(l.Fragment,{children:[$>0&&F[$-1]!==O-1&&l.jsx(gt,{children:l.jsx(ci,{})},O+"..."),l.jsx(gt,{children:l.jsx(Ln,{onClick:()=>u(O),isActive:a===O,className:`cursor-pointer ${r?"pointer-events-none":""}`,children:g===O?l.jsx(be,{className:"h-4 w-4 animate-spin"}):O})},O)]})),l.jsx(gt,{children:l.jsx(li,{onClick:()=>u(O=>Math.min(c,O+1)),className:a===c||g!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})})]})},vd=10,vx=D.memo(({apiBaseUrl:e="http://localhost:3000"})=>{const[t,n]=D.useState(1),[r,o]=D.useState([]),[s,i]=D.useState({total:0,page:1,limit:vd,totalPages:1}),[a,u]=D.useState(!0),[c,f]=D.useState(null),[g,m]=D.useState(new Set),{toast:p}=As(),[v,h]=D.useState(!1),y=async C=>{try{f(C);const P=await oe.get(`${e}/api/jobs`,{params:{page:C.toString(),limit:vd.toString()}});o(P.data.data),i(P.data.pagination)}catch{p({variant:"destructive",title:"Error",description:"Failed to fetch jobs. Please try again."})}finally{f(null),u(!1)}};D.useEffect(()=>{y(t)},[t,e]);const w=async C=>{m(P=>new Set(P).add(C.toString()));try{await oe.post(`${e}/api/retry-job`,{jobId:C}),p({title:"Job Restarted",description:`Job ${C} has been successfully restarted.`}),y(t)}catch{p({variant:"destructive",title:"Retry Failed",description:`Failed to restart job ${C}. Please try again.`})}finally{m(P=>{const _=new Set(P);return _.delete(C.toString()),_})}},x=async()=>{h(!0),n(1),await y(1),h(!1)},S=C=>new Date(C).toLocaleString(),E=C=>{if(C=parseFloat(C),C<60)return`${C.toFixed(2)}s`;const P=Math.floor(C/60),_=(C%60).toFixed(0);return`${P}m ${_}s`};return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[l.jsx(Up,{className:"w-8 h-8 text-primary"}),l.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Job Management"}),l.jsx(ae,{variant:"outline",size:"icon",onClick:x,disabled:v||a,className:"ml-2",children:l.jsx(Kp,{className:`h-4 w-4 ${v?"animate-spin":""}`})})]}),l.jsx("div",{className:"rounded-md border",children:l.jsxs(mr,{children:[l.jsx(vr,{children:l.jsxs(Ge,{children:[l.jsx(et,{children:"ID"}),l.jsx(et,{children:"Tên Công Việc"}),l.jsx(et,{children:"Thời Gian Bắt Đầu"}),l.jsx(et,{children:"Thời Gian Cập Nhật"}),l.jsx(et,{children:"Thời Gian Thực Thi"}),l.jsx(et,{children:"Trạng Thái"}),l.jsx(et,{children:"Thao Tác"})]})}),l.jsx(yr,{children:a&&r.length===0?l.jsx(Ge,{children:l.jsx(Ae,{colSpan:7,className:"text-center py-4",children:l.jsx(be,{className:"w-6 h-6 animate-spin mx-auto"})})}):r.map(C=>{var P,_;return l.jsxs(Ge,{children:[l.jsx(Ae,{className:"!w-[100px]",children:C.id}),l.jsx(Ae,{className:"font-medium",children:(P=C.job_name)==null?void 0:P.replace("Upload file","Summary")}),l.jsx(Ae,{className:"!w-[200px]",children:S(C.created_at)}),l.jsx(Ae,{className:"!w-[200px]",children:S(C.updated_at)}),l.jsx(Ae,{className:"!w-[150px]",children:E(C.execution_time_seconds)}),l.jsx(Ae,{className:"!w-[200px]",children:l.jsx(md,{content:C.status==="fail"&&C.error?l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:C.error}):null,children:l.jsx("div",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]
137
+ ${C.status==="done"?"bg-green-100 text-green-800":C.status==="fail"?"bg-red-100 text-red-800":"bg-yellow-100 text-yellow-800"}`,children:C.status==="fail"?"FAILED":(_=C.status)==null?void 0:_.toUpperCase()})})}),l.jsx(Ae,{className:"!w-[200px]",children:C.status==="fail"?l.jsx(ae,{variant:"outline",size:"sm",onClick:()=>w(C.id),disabled:g.has(C.id.toString()),className:"h-[32px]",children:g.has(C.id.toString())?l.jsxs(l.Fragment,{children:[l.jsx(be,{className:"mr-2 h-4 w-4 animate-spin"}),"Đang thử lại..."]}):"Thử Lại"}):l.jsx("div",{className:"h-[32px]"})})]},C.id)})})]})}),l.jsx("div",{className:"mt-4",children:l.jsx(si,{children:l.jsxs(ii,{children:[l.jsx(gt,{children:l.jsx(ai,{onClick:()=>n(C=>Math.max(1,C-1)),className:t===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:s.totalPages},(C,P)=>P+1).filter(C=>C===1||C===s.totalPages||Math.abs(C-t)<=1).map((C,P,_)=>l.jsxs(l.Fragment,{children:[P>0&&_[P-1]!==C-1&&l.jsx(gt,{children:l.jsx(ci,{})},C+"..."),l.jsx(gt,{children:l.jsx(Ln,{onClick:()=>n(C),isActive:t===C,className:`cursor-pointer ${c!==null?"pointer-events-none":""}`,children:c===C?l.jsx(be,{className:"h-4 w-4 animate-spin"}):C})},C)]})),l.jsx(gt,{children:l.jsx(li,{onClick:()=>n(C=>Math.min(s.totalPages,C+1)),className:t===s.totalPages||c!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})}),l.jsx(Bc,{})]})});He.Job=vx,He.S3Explorer=qb,He.Summary=mx,Object.defineProperty(He,Symbol.toStringTag,{value:"Module"})});
133
138
  //# sourceMappingURL=s3-explorer.umd.cjs.map