dccxx-s3-explorer 1.0.32 → 1.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/s3-explorer.js +4045 -3921
- package/dist/s3-explorer.js.map +1 -1
- package/dist/s3-explorer.umd.cjs +37 -37
- package/dist/s3-explorer.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/s3-explorer.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(Je,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):(Je=typeof globalThis<"u"?globalThis:Je||self,l(Je.S3Explorer={},Je.jsxRuntime,Je.React,Je.ReactDOM))})(this,function(Je,l,T,_o){"use strict";function Ri(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=Ri(T),lr=Ri(_o);function Xd({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 Vi=d.forwardRef(Xd);function Jd({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 Yd=d.forwardRef(Jd);function Zd({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 Qd=d.forwardRef(Zd);function ef({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 tf=d.forwardRef(ef);function nf({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 Fo=d.forwardRef(nf);function rf({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 of=d.forwardRef(rf);function sf({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 af=d.forwardRef(sf);function lf({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:"M5.25 7.5A2.25 2.25 0 0 1 7.5 5.25h9a2.25 2.25 0 0 1 2.25 2.25v9a2.25 2.25 0 0 1-2.25 2.25h-9a2.25 2.25 0 0 1-2.25-2.25v-9Z"}))}const cf=d.forwardRef(lf);function uf({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 Bi=d.forwardRef(uf);/**
|
|
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
|
|
10
|
+
*/function At(e,t){return typeof e=="function"?e(t):e}function Re(e,t){return n=>{t.setState(r=>({...r,[e]:At(n,r[e])}))}}function cr(e){return e instanceof Function}function df(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function ff(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 Z(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*h,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function Z(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 Jd(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:Y(()=>[e,n,t,s],(i,a,u,c)=>({table:i,column:a,row:u,cell:c,getValue:c.getValue,renderValue:c.renderValue}),Z(e.options,"debugCells","cell.getContext"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(s,n,t,e)},{}),s}function Yd(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=h=>{let p=h;for(const m of u.split(".")){var v;p=(v=p)==null?void 0:v[m],process.env.NODE_ENV!=="production"&&p===void 0&&console.warn(`"${m}" in deeply nested key "${u}" returned undefined.`)}return p}:f=h=>h[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:Y(()=>[!0],()=>{var h;return[g,...(h=g.columns)==null?void 0:h.flatMap(p=>p.getFlatColumns())]},Z(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:Y(()=>[e._getOrderColumnsFn()],h=>{var p;if((p=g.columns)!=null&&p.length){let v=g.columns.flatMap(m=>m.getLeafColumns());return h(v)}return[g]},Z(e.options,"debugColumns","column.getLeafColumns"))};for(const h of e._features)h.createColumn==null||h.createColumn(g,e);return g}const Te="debugHeaders";function Fi(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 Zd={createTable:e=>{e.getHeaderGroups=Y(()=>[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(h=>h.id===g)).filter(Boolean))!=null?s:[],u=(i=o==null?void 0:o.map(g=>n.find(h=>h.id===g)).filter(Boolean))!=null?i:[],c=n.filter(g=>!(r!=null&&r.includes(g.id))&&!(o!=null&&o.includes(g.id)));return tr(t,[...a,...c,...u],e)},Z(e.options,Te,"getHeaderGroups")),e.getCenterHeaderGroups=Y(()=>[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))),tr(t,n,e,"center")),Z(e.options,Te,"getCenterHeaderGroups")),e.getLeftHeaderGroups=Y(()=>[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 tr(t,s,e,"left")},Z(e.options,Te,"getLeftHeaderGroups")),e.getRightHeaderGroups=Y(()=>[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 tr(t,s,e,"right")},Z(e.options,Te,"getRightHeaderGroups")),e.getFooterGroups=Y(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Z(e.options,Te,"getFooterGroups")),e.getLeftFooterGroups=Y(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Z(e.options,Te,"getLeftFooterGroups")),e.getCenterFooterGroups=Y(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Z(e.options,Te,"getCenterFooterGroups")),e.getRightFooterGroups=Y(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Z(e.options,Te,"getRightFooterGroups")),e.getFlatHeaders=Y(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Z(e.options,Te,"getFlatHeaders")),e.getLeftFlatHeaders=Y(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Z(e.options,Te,"getLeftFlatHeaders")),e.getCenterFlatHeaders=Y(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Z(e.options,Te,"getCenterFlatHeaders")),e.getRightFlatHeaders=Y(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Z(e.options,Te,"getRightFlatHeaders")),e.getCenterLeafHeaders=Y(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Z(e.options,Te,"getCenterLeafHeaders")),e.getLeftLeafHeaders=Y(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Z(e.options,Te,"getLeftLeafHeaders")),e.getRightLeafHeaders=Y(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Z(e.options,Te,"getRightLeafHeaders")),e.getLeafHeaders=Y(()=>[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()},Z(e.options,Te,"getLeafHeaders"))}};function tr(e,t,n,r){var o,s;let i=0;const a=function(h,p){p===void 0&&(p=1),i=Math.max(i,p),h.filter(v=>v.getIsVisible()).forEach(v=>{var m;(m=v.columns)!=null&&m.length&&a(v.columns,p+1)},0)};a(e);let u=[];const c=(h,p)=>{const v={depth:p,id:[r,`${p}`].filter(Boolean).join("_"),headers:[]},m=[];h.forEach(y=>{const w=[...m].reverse()[0],b=y.column.depth===v.depth;let S,E=!1;if(b&&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 x=Fi(n,S,{id:[r,p,S.id,y==null?void 0:y.id].filter(Boolean).join("_"),isPlaceholder:E,placeholderId:E?`${m.filter(P=>P.column===S).length}`:void 0,depth:p,index:m.length});x.subHeaders.push(y),m.push(x)}v.headers.push(y),y.headerGroup=v}),u.push(v),p>0&&c(m,p-1)},f=t.map((h,p)=>Fi(n,h,{depth:i,index:p}));c(f,i-1),u.reverse();const g=h=>h.filter(v=>v.column.getIsVisible()).map(v=>{let m=0,y=0,w=[0];v.subHeaders&&v.subHeaders.length?(w=[],g(v.subHeaders).forEach(S=>{let{colSpan:E,rowSpan:x}=S;m+=E,w.push(x)})):m=1;const b=Math.min(...w);return y=y+b,v.colSpan=m,v.rowSpan=y,{colSpan:m,rowSpan:y}});return g((o=(s=u[0])==null?void 0:s.headers)!=null?o:[]),u}const ho=(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:()=>Xd(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:Y(()=>[e.getAllLeafColumns()],u=>u.map(c=>Jd(e,a,c,c.id)),Z(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:Y(()=>[a.getAllCells()],u=>u.reduce((c,f)=>(c[f.column.id]=f,c),{}),Z(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},Qd={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()}}},Oi=(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))};Oi.autoRemove=e=>qe(e);const Di=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};Di.autoRemove=e=>qe(e);const Mi=(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())};Mi.autoRemove=e=>qe(e);const Ii=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};Ii.autoRemove=e=>qe(e)||!(e!=null&&e.length);const ki=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});ki.autoRemove=e=>qe(e)||!(e!=null&&e.length);const $i=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});$i.autoRemove=e=>qe(e)||!(e!=null&&e.length);const Li=(e,t,n)=>e.getValue(t)===n;Li.autoRemove=e=>qe(e);const Ri=(e,t,n)=>e.getValue(t)==n;Ri.autoRemove=e=>qe(e);const mo=(e,t,n)=>{let[r,o]=n;const s=e.getValue(t);return s>=r&&s<=o};mo.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]},mo.autoRemove=e=>qe(e)||qe(e[0])&&qe(e[1]);const gt={includesString:Oi,includesStringSensitive:Di,equalsString:Mi,arrIncludes:Ii,arrIncludesAll:ki,arrIncludesSome:$i,equals:Li,weakEquals:Ri,inNumberRange:mo};function qe(e){return e==null||e===""}const ef={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:$e("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"?gt.includesString:typeof r=="number"?gt.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?gt.equals:Array.isArray(r)?gt.arrIncludes:gt.weakEquals},e.getFilterFn=()=>{var n,r;return er(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:gt[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=Nt(n,s?s.value:void 0);if(Vi(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=Nt(t,o))==null?void 0:s.filter(i=>{const a=n.find(u=>u.id===i.id);if(a){const u=a.getFilterFn();if(Vi(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 Vi(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const vo={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},tf={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:$e("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 vo.sum;if(Object.prototype.toString.call(r)==="[object Date]")return vo.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return er(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:vo[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 nf(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 rf={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:$e("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Y(n=>[Pn(t,n)],n=>n.findIndex(r=>r.id===e.id),Z(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=Pn(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=Pn(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=Y(()=>[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 nf(s,n,r)},Z(e.options,"debugTable","_getOrderColumnsFn"))}},yo=()=>({left:[],right:[]}),of={getInitialState:e=>({columnPinning:yo(),...e}),getDefaultOptions:e=>({onColumnPinningChange:$e("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=Y(()=>[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))},Z(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=Y(()=>[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"})),Z(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=Y(()=>[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"})),Z(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?yo():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:yo())},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=Y(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Z(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=Y(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Z(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=Y(()=>[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))},Z(e.options,"debugColumns","getCenterLeafColumns"))}},nr={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},wo=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),sf={getDefaultColumnDef:()=>nr,getInitialState:e=>({columnSizing:{},columnSizingInfo:wo(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:$e("columnSizing",e),onColumnSizingInfoChange:$e("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:nr.minSize,(r=s??e.columnDef.size)!=null?r:nr.size),(o=e.columnDef.maxSize)!=null?o:nr.maxSize)},e.getStart=Y(n=>[n,Pn(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,s)=>o+s.getSize(),0),Z(t.options,"debugColumns","getStart")),e.getAfter=Y(n=>[n,Pn(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,s)=>o+s.getSize(),0),Z(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(),bo(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=bo(s)?Math.round(s.touches[0].clientX):s.clientX,c={},f=(w,b)=>{typeof b=="number"&&(t.setColumnSizingInfo(S=>{var E,x;const P=t.options.columnResizeDirection==="rtl"?-1:1,F=(b-((E=S==null?void 0:S.startOffset)!=null?E:0))*P,O=Math.max(F/((x=S==null?void 0:S.startSize)!=null?x:0),-.999999);return S.columnSizingStart.forEach(k=>{let[D,G]=k;c[D]=Math.round(Math.max(G+G*O,0)*100)/100}),{...S,deltaOffset:F,deltaPercentage:O}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(S=>({...S,...c})))},g=w=>f("move",w),h=w=>{f("end",w),t.setColumnSizingInfo(b=>({...b,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),h(w.clientX)}},m={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),g(w.touches[0].clientX),!1),upHandler:w=>{var b;p==null||p.removeEventListener("touchmove",m.moveHandler),p==null||p.removeEventListener("touchend",m.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),h((b=w.touches[0])==null?void 0:b.clientX)}},y=af()?{passive:!1}:!1;bo(s)?(p==null||p.addEventListener("touchmove",m.moveHandler,y),p==null||p.addEventListener("touchend",m.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?wo():(n=e.initialState.columnSizingInfo)!=null?n:wo())},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 rr=null;function af(){if(typeof rr=="boolean")return rr;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 rr=e,rr}function bo(e){return e.type==="touchstart"}const lf={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:$e("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=Y(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Z(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=Y(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],Z(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>Y(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),Z(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 Pn(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const cf={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()}}},uf={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:$e("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=()=>gt.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return er(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:gt[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},df={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:$e("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()}}}},xo=0,Co=10,So=()=>({pageIndex:xo,pageSize:Co}),ff={getInitialState:e=>({...e,pagination:{...So(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:$e("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=>Nt(r,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?So():(o=e.initialState.pagination)!=null?o:So())},e.setPageIndex=r=>{e.setPagination(o=>{let s=Nt(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?xo:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?o:xo)},e.resetPageSize=r=>{var o,s;e.setPageSize(r?Co:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?o:Co)},e.setPageSize=r=>{e.setPagination(o=>{const s=Math.max(1,Nt(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=Nt(r,(s=e.options.pageCount)!=null?s:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...o,pageCount:i}}),e.getPageOptions=Y(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((s,i)=>i)),o},Z(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}}},Eo=()=>({top:[],bottom:[]}),pf={getInitialState:e=>({rowPinning:Eo(),...e}),getDefaultOptions:e=>({onRowPinningChange:$e("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,h;return{top:((g=u==null?void 0:u.top)!=null?g:[]).filter(m=>!(a!=null&&a.has(m))),bottom:[...((h=u==null?void 0:u.bottom)!=null?h:[]).filter(m=>!(a!=null&&a.has(m))),...Array.from(a)]}}if(n==="top"){var p,v;return{top:[...((p=u==null?void 0:u.top)!=null?p:[]).filter(m=>!(a!=null&&a.has(m))),...Array.from(a)],bottom:((v=u==null?void 0:u.bottom)!=null?v:[]).filter(m=>!(a!=null&&a.has(m)))}}return{top:((c=u==null?void 0:u.top)!=null?c:[]).filter(m=>!(a!=null&&a.has(m))),bottom:((f=u==null?void 0:u.bottom)!=null?f:[]).filter(m=>!(a!=null&&a.has(m)))}})},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?Eo():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Eo())},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=Y(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Z(e.options,"debugRows","getTopRows")),e.getBottomRows=Y(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Z(e.options,"debugRows","getBottomRows")),e.getCenterRows=Y(()=>[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))},Z(e.options,"debugRows","getCenterRows"))}},gf={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:$e("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=>{No(o,s.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Y(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?To(e,n):{rows:[],flatRows:[],rowsById:{}},Z(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=Y(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?To(e,n):{rows:[],flatRows:[],rowsById:{}},Z(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=Y(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?To(e,n):{rows:[],flatRows:[],rowsById:{}},Z(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 No(a,e.id,n,(i=r==null?void 0:r.selectChildren)!=null?i:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Po(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Ao(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Ao(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)}}}},No=(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=>No(e,a.id,n,r,o))};function To(e,t){const n=e.getState().rowSelection,r=[],o={},s=function(i,a){return i.map(u=>{var c;const f=Po(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 Po(e,t){var n;return(n=t[e.id])!=null?n:!1}function Ao(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()&&(Po(i,t)?s=!0:o=!1),i.subRows&&i.subRows.length)){const a=Ao(i,t);a==="all"?s=!0:(a==="some"&&(s=!0),o=!1)}}),o?"all":s?"some":!1}const _o=/([0-9]+)/gm,hf=(e,t,n)=>Bi(Tt(e.getValue(n)).toLowerCase(),Tt(t.getValue(n)).toLowerCase()),mf=(e,t,n)=>Bi(Tt(e.getValue(n)),Tt(t.getValue(n))),vf=(e,t,n)=>Fo(Tt(e.getValue(n)).toLowerCase(),Tt(t.getValue(n)).toLowerCase()),yf=(e,t,n)=>Fo(Tt(e.getValue(n)),Tt(t.getValue(n))),wf=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},bf=(e,t,n)=>Fo(e.getValue(n),t.getValue(n));function Fo(e,t){return e===t?0:e>t?1:-1}function Tt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Bi(e,t){const n=e.split(_o).filter(Boolean),r=t.split(_o).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 An={alphanumeric:hf,alphanumericCaseSensitive:mf,text:vf,textCaseSensitive:yf,datetime:wf,basic:bf},xf=[Zd,lf,rf,of,Qd,ef,cf,uf,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:$e("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 An.datetime;if(typeof s=="string"&&(r=!0,s.split(_o).length>1))return An.alphanumeric}return r?An.text:An.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 er(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:An[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 h;c=[...i,{id:e.id,desc:g}],c.splice(0,c.length-((h=t.options.maxMultiSortColCount)!=null?h: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())}},tf,df,ff,pf,gf,sf];function Cf(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...xf,...(t=e._features)!=null?t:[]];let o={_features:r};const s=o._features.reduce((h,p)=>Object.assign(h,p.getDefaultOptions==null?void 0:p.getDefaultOptions(o)),{}),i=h=>o.options.mergeOptions?o.options.mergeOptions(s,h):{...s,...h};let u={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(h=>{var p;u=(p=h.getInitialState==null?void 0:h.getInitialState(u))!=null?p:u});const c=[];let f=!1;const g={_features:r,options:{...s,...e},initialState:u,_queue:h=>{c.push(h),f||(f=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();f=!1}).catch(p=>setTimeout(()=>{throw p})))},reset:()=>{o.setState(o.initialState)},setOptions:h=>{const p=Nt(h,o.options);o.options=i(p)},getState:()=>o.options.state,setState:h=>{o.options.onStateChange==null||o.options.onStateChange(h)},_getRowId:(h,p,v)=>{var m;return(m=o.options.getRowId==null?void 0:o.options.getRowId(h,p,v))!=null?m:`${v?[v.id,p].join("."):p}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(h,p)=>{let v=(p?o.getPrePaginationRowModel():o.getRowModel()).rowsById[h];if(!v&&(v=o.getCoreRowModel().rowsById[h],!v))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${h}`):new Error;return v},_getDefaultColumnDef:Y(()=>[o.options.defaultColumn],h=>{var p;return h=(p=h)!=null?p:{},{header:v=>{const m=v.header.column.columnDef;return m.accessorKey?m.accessorKey:m.accessorFn?m.id:null},cell:v=>{var m,y;return(m=(y=v.renderValue())==null||y.toString==null?void 0:y.toString())!=null?m:null},...o._features.reduce((v,m)=>Object.assign(v,m.getDefaultColumnDef==null?void 0:m.getDefaultColumnDef()),{}),...h}},Z(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:Y(()=>[o._getColumnDefs()],h=>{const p=function(v,m,y){return y===void 0&&(y=0),v.map(w=>{const b=Yd(o,w,y,m),S=w;return b.columns=S.columns?p(S.columns,b,y+1):[],b})};return p(h)},Z(e,"debugColumns","getAllColumns")),getAllFlatColumns:Y(()=>[o.getAllColumns()],h=>h.flatMap(p=>p.getFlatColumns()),Z(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:Y(()=>[o.getAllFlatColumns()],h=>h.reduce((p,v)=>(p[v.id]=v,p),{}),Z(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:Y(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(h,p)=>{let v=h.flatMap(m=>m.getLeafColumns());return p(v)},Z(e,"debugColumns","getAllLeafColumns")),getColumn:h=>{const p=o._getAllFlatColumnsById()[h];return process.env.NODE_ENV!=="production"&&!p&&console.error(`[Table] Column with id '${h}' does not exist.`),p}};Object.assign(o,g);for(let h=0;h<o._features.length;h++){const p=o._features[h];p==null||p.createTable==null||p.createTable(o)}return o}function zi(){return e=>Y(()=>[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=ho(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},Z(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Sf(e,t,n){return n.options.filterFromLeafRows?Ef(e,t,n):Nf(e,t,n)}function Ef(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 h=0;h<u.length;h++){var g;let p=u[h];const v=ho(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 Nf(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 h=0;h<u.length;h++){let p=u[h];if(t(p)){var g;if((g=p.subRows)!=null&&g.length&&c<i){const m=ho(n,p.id,p.original,p.index,p.depth,void 0,p.parentId);m.subRows=a(p.subRows,c+1),p=m}f.push(p),o.push(p),s[p.id]=p}}return f};return{rows:a(e),flatRows:o,rowsById:s}}function Tf(){return e=>Y(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let h=0;h<t.flatRows.length;h++)t.flatRows[h].columnFilters={},t.flatRows[h].columnFiltersMeta={};return t}const o=[],s=[];(n??[]).forEach(h=>{var p;const v=e.getColumn(h.id);if(!v)return;const m=v.getFilterFn();if(!m){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:h.id,filterFn:m,resolvedValue:(p=m.resolveFilterValue==null?void 0:m.resolveFilterValue(h.value))!=null?p:h.value})});const i=(n??[]).map(h=>h.id),a=e.getGlobalFilterFn(),u=e.getAllLeafColumns().filter(h=>h.getCanGlobalFilter());r&&a&&u.length&&(i.push("__global__"),u.forEach(h=>{var p;s.push({id:h.id,filterFn:a,resolvedValue:(p=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?p:r})}));let c,f;for(let h=0;h<t.flatRows.length;h++){const p=t.flatRows[h];if(p.columnFilters={},o.length)for(let v=0;v<o.length;v++){c=o[v];const m=c.id;p.columnFilters[m]=c.filterFn(p,m,c.resolvedValue,y=>{p.columnFiltersMeta[m]=y})}if(s.length){for(let v=0;v<s.length;v++){f=s[v];const m=f.id;if(f.filterFn(p,m,f.resolvedValue,y=>{p.columnFiltersMeta[m]=y})){p.columnFilters.__global__=!0;break}}p.columnFilters.__global__!==!0&&(p.columnFilters.__global__=!1)}}const g=h=>{for(let p=0;p<i.length;p++)if(h.columnFilters[i[p]]===!1)return!1;return!0};return Sf(t.rows,g,e)},Z(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Pf(){return e=>Y(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],s=r.filter(u=>{var c;return(c=e.getColumn(u.id))==null?void 0:c.getCanSort()}),i={};s.forEach(u=>{const c=e.getColumn(u.id);c&&(i[u.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=u=>{const c=u.map(f=>({...f}));return c.sort((f,g)=>{for(let p=0;p<s.length;p+=1){var h;const v=s[p],m=i[v.id],y=m.sortUndefined,w=(h=v==null?void 0:v.desc)!=null?h:!1;let b=0;if(y){const S=f.getValue(v.id),E=g.getValue(v.id),x=S===void 0,P=E===void 0;if(x||P){if(y==="first")return x?-1:1;if(y==="last")return x?1:-1;b=x&&P?0:x?y:-y}}if(b===0&&(b=m.sortingFn(f,g,v.id)),b!==0)return w&&(b*=-1),m.invertSorting&&(b*=-1),b}return f.index-g.index}),c.forEach(f=>{var g;o.push(f),(g=f.subRows)!=null&&g.length&&(f.subRows=a(f.subRows))}),c};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},Z(e.options,"debugTable","getSortedRowModel",()=>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 Q(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 pf(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:Z(()=>[e,n,t,s],(i,a,u,c)=>({table:i,column:a,row:u,cell:c,getValue:c.getValue,renderValue:c.renderValue}),Q(e.options,"debugCells","cell.getContext"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(s,n,t,e)},{}),s}function gf(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:Z(()=>[!0],()=>{var m;return[g,...(m=g.columns)==null?void 0:m.flatMap(p=>p.getFlatColumns())]},Q(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:Z(()=>[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]},Q(e.options,"debugColumns","column.getLeafColumns"))};for(const m of e._features)m.createColumn==null||m.createColumn(g,e);return g}const Pe="debugHeaders";function Hi(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 hf={createTable:e=>{e.getHeaderGroups=Z(()=>[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 ur(t,[...a,...c,...u],e)},Q(e.options,Pe,"getHeaderGroups")),e.getCenterHeaderGroups=Z(()=>[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))),ur(t,n,e,"center")),Q(e.options,Pe,"getCenterHeaderGroups")),e.getLeftHeaderGroups=Z(()=>[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 ur(t,s,e,"left")},Q(e.options,Pe,"getLeftHeaderGroups")),e.getRightHeaderGroups=Z(()=>[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 ur(t,s,e,"right")},Q(e.options,Pe,"getRightHeaderGroups")),e.getFooterGroups=Z(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Q(e.options,Pe,"getFooterGroups")),e.getLeftFooterGroups=Z(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Q(e.options,Pe,"getLeftFooterGroups")),e.getCenterFooterGroups=Z(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Q(e.options,Pe,"getCenterFooterGroups")),e.getRightFooterGroups=Z(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Q(e.options,Pe,"getRightFooterGroups")),e.getFlatHeaders=Z(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Q(e.options,Pe,"getFlatHeaders")),e.getLeftFlatHeaders=Z(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Q(e.options,Pe,"getLeftFlatHeaders")),e.getCenterFlatHeaders=Z(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Q(e.options,Pe,"getCenterFlatHeaders")),e.getRightFlatHeaders=Z(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Q(e.options,Pe,"getRightFlatHeaders")),e.getCenterLeafHeaders=Z(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Q(e.options,Pe,"getCenterLeafHeaders")),e.getLeftLeafHeaders=Z(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Q(e.options,Pe,"getLeftLeafHeaders")),e.getRightLeafHeaders=Z(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Q(e.options,Pe,"getRightLeafHeaders")),e.getLeafHeaders=Z(()=>[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()},Q(e.options,Pe,"getLeafHeaders"))}};function ur(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],b=y.column.depth===v.depth;let S,E=!1;if(b&&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 x=Hi(n,S,{id:[r,p,S.id,y==null?void 0:y.id].filter(Boolean).join("_"),isPlaceholder:E,placeholderId:E?`${h.filter(_=>_.column===S).length}`:void 0,depth:p,index:h.length});x.subHeaders.push(y),h.push(x)}v.headers.push(y),y.headerGroup=v}),u.push(v),p>0&&c(h,p-1)},f=t.map((m,p)=>Hi(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:x}=S;h+=E,w.push(x)})):h=1;const b=Math.min(...w);return y=y+b,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 Oo=(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:()=>ff(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:Z(()=>[e.getAllLeafColumns()],u=>u.map(c=>pf(e,a,c,c.id)),Q(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:Z(()=>[a.getAllCells()],u=>u.reduce((c,f)=>(c[f.column.id]=f,c),{}),Q(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},mf={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()}}},zi=(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))};zi.autoRemove=e=>Ye(e);const Ui=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};Ui.autoRemove=e=>Ye(e);const ji=(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())};ji.autoRemove=e=>Ye(e);const Wi=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};Wi.autoRemove=e=>Ye(e)||!(e!=null&&e.length);const Gi=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});Gi.autoRemove=e=>Ye(e)||!(e!=null&&e.length);const qi=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});qi.autoRemove=e=>Ye(e)||!(e!=null&&e.length);const Ki=(e,t,n)=>e.getValue(t)===n;Ki.autoRemove=e=>Ye(e);const Xi=(e,t,n)=>e.getValue(t)==n;Xi.autoRemove=e=>Ye(e);const Do=(e,t,n)=>{let[r,o]=n;const s=e.getValue(t);return s>=r&&s<=o};Do.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]},Do.autoRemove=e=>Ye(e)||Ye(e[0])&&Ye(e[1]);const xt={includesString:zi,includesStringSensitive:Ui,equalsString:ji,arrIncludes:Wi,arrIncludesAll:Gi,arrIncludesSome:qi,equals:Ki,weakEquals:Xi,inNumberRange:Do};function Ye(e){return e==null||e===""}const vf={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Re("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"?xt.includesString:typeof r=="number"?xt.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?xt.equals:Array.isArray(r)?xt.arrIncludes:xt.weakEquals},e.getFilterFn=()=>{var n,r;return cr(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:xt[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=At(n,s?s.value:void 0);if(Ji(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=At(t,o))==null?void 0:s.filter(i=>{const a=n.find(u=>u.id===i.id);if(a){const u=a.getFilterFn();if(Ji(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 Ji(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Mo={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(!df(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},yf={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:Re("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 Mo.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Mo.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return cr(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:Mo[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 wf(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 bf={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Re("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Z(n=>[Dn(t,n)],n=>n.findIndex(r=>r.id===e.id),Q(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=Dn(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=Dn(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=Z(()=>[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 wf(s,n,r)},Q(e.options,"debugTable","_getOrderColumnsFn"))}},Io=()=>({left:[],right:[]}),xf={getInitialState:e=>({columnPinning:Io(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Re("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=Z(()=>[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))},Q(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=Z(()=>[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"})),Q(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=Z(()=>[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"})),Q(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?Io():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Io())},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=Z(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Q(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=Z(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Q(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=Z(()=>[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))},Q(e.options,"debugColumns","getCenterLeafColumns"))}},dr={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},$o=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Cf={getDefaultColumnDef:()=>dr,getInitialState:e=>({columnSizing:{},columnSizingInfo:$o(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Re("columnSizing",e),onColumnSizingInfoChange:Re("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:dr.minSize,(r=s??e.columnDef.size)!=null?r:dr.size),(o=e.columnDef.maxSize)!=null?o:dr.maxSize)},e.getStart=Z(n=>[n,Dn(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,s)=>o+s.getSize(),0),Q(t.options,"debugColumns","getStart")),e.getAfter=Z(n=>[n,Dn(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,s)=>o+s.getSize(),0),Q(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(),ko(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=ko(s)?Math.round(s.touches[0].clientX):s.clientX,c={},f=(w,b)=>{typeof b=="number"&&(t.setColumnSizingInfo(S=>{var E,x;const _=t.options.columnResizeDirection==="rtl"?-1:1,O=(b-((E=S==null?void 0:S.startOffset)!=null?E:0))*_,D=Math.max(O/((x=S==null?void 0:S.startSize)!=null?x:0),-.999999);return S.columnSizingStart.forEach($=>{let[M,K]=$;c[M]=Math.round(Math.max(K+K*D,0)*100)/100}),{...S,deltaOffset:O,deltaPercentage:D}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(S=>({...S,...c})))},g=w=>f("move",w),m=w=>{f("end",w),t.setColumnSizingInfo(b=>({...b,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 b;p==null||p.removeEventListener("touchmove",h.moveHandler),p==null||p.removeEventListener("touchend",h.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),m((b=w.touches[0])==null?void 0:b.clientX)}},y=Sf()?{passive:!1}:!1;ko(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?$o():(n=e.initialState.columnSizingInfo)!=null?n:$o())},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 fr=null;function Sf(){if(typeof fr=="boolean")return fr;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 fr=e,fr}function ko(e){return e.type==="touchstart"}const Ef={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Re("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=Z(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Q(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=Z(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],Q(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>Z(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),Q(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 Dn(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const Nf={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()}}},Tf={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Re("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=()=>xt.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return cr(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:xt[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Pf={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Re("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()}}}},Lo=0,Ro=10,Vo=()=>({pageIndex:Lo,pageSize:Ro}),Af={getInitialState:e=>({...e,pagination:{...Vo(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Re("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=>At(r,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Vo():(o=e.initialState.pagination)!=null?o:Vo())},e.setPageIndex=r=>{e.setPagination(o=>{let s=At(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?Lo:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?o:Lo)},e.resetPageSize=r=>{var o,s;e.setPageSize(r?Ro:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?o:Ro)},e.setPageSize=r=>{e.setPagination(o=>{const s=Math.max(1,At(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=At(r,(s=e.options.pageCount)!=null?s:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...o,pageCount:i}}),e.getPageOptions=Z(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((s,i)=>i)),o},Q(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}}},Bo=()=>({top:[],bottom:[]}),_f={getInitialState:e=>({rowPinning:Bo(),...e}),getDefaultOptions:e=>({onRowPinningChange:Re("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?Bo():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Bo())},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=Z(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Q(e.options,"debugRows","getTopRows")),e.getBottomRows=Z(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Q(e.options,"debugRows","getBottomRows")),e.getCenterRows=Z(()=>[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))},Q(e.options,"debugRows","getCenterRows"))}},Ff={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Re("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=>{Ho(o,s.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Z(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?zo(e,n):{rows:[],flatRows:[],rowsById:{}},Q(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=Z(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?zo(e,n):{rows:[],flatRows:[],rowsById:{}},Q(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=Z(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?zo(e,n):{rows:[],flatRows:[],rowsById:{}},Q(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 Ho(a,e.id,n,(i=r==null?void 0:r.selectChildren)!=null?i:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Uo(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return jo(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return jo(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)}}}},Ho=(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=>Ho(e,a.id,n,r,o))};function zo(e,t){const n=e.getState().rowSelection,r=[],o={},s=function(i,a){return i.map(u=>{var c;const f=Uo(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 Uo(e,t){var n;return(n=t[e.id])!=null?n:!1}function jo(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()&&(Uo(i,t)?s=!0:o=!1),i.subRows&&i.subRows.length)){const a=jo(i,t);a==="all"?s=!0:(a==="some"&&(s=!0),o=!1)}}),o?"all":s?"some":!1}const Wo=/([0-9]+)/gm,Of=(e,t,n)=>Yi(_t(e.getValue(n)).toLowerCase(),_t(t.getValue(n)).toLowerCase()),Df=(e,t,n)=>Yi(_t(e.getValue(n)),_t(t.getValue(n))),Mf=(e,t,n)=>Go(_t(e.getValue(n)).toLowerCase(),_t(t.getValue(n)).toLowerCase()),If=(e,t,n)=>Go(_t(e.getValue(n)),_t(t.getValue(n))),$f=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},kf=(e,t,n)=>Go(e.getValue(n),t.getValue(n));function Go(e,t){return e===t?0:e>t?1:-1}function _t(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Yi(e,t){const n=e.split(Wo).filter(Boolean),r=t.split(Wo).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 Mn={alphanumeric:Of,alphanumericCaseSensitive:Df,text:Mf,textCaseSensitive:If,datetime:$f,basic:kf},Lf=[hf,Ef,bf,xf,mf,vf,Nf,Tf,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Re("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 Mn.datetime;if(typeof s=="string"&&(r=!0,s.split(Wo).length>1))return Mn.alphanumeric}return r?Mn.text:Mn.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 cr(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:Mn[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())}},yf,Pf,Af,_f,Ff,Cf];function Rf(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=At(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:Z(()=>[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}},Q(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:Z(()=>[o._getColumnDefs()],m=>{const p=function(v,h,y){return y===void 0&&(y=0),v.map(w=>{const b=gf(o,w,y,h),S=w;return b.columns=S.columns?p(S.columns,b,y+1):[],b})};return p(m)},Q(e,"debugColumns","getAllColumns")),getAllFlatColumns:Z(()=>[o.getAllColumns()],m=>m.flatMap(p=>p.getFlatColumns()),Q(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:Z(()=>[o.getAllFlatColumns()],m=>m.reduce((p,v)=>(p[v.id]=v,p),{}),Q(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:Z(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(m,p)=>{let v=m.flatMap(h=>h.getLeafColumns());return p(v)},Q(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 Zi(){return e=>Z(()=>[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=Oo(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},Q(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Vf(e,t,n){return n.options.filterFromLeafRows?Bf(e,t,n):Hf(e,t,n)}function Bf(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=Oo(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 Hf(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=Oo(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 zf(){return e=>Z(()=>[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 Vf(t.rows,g,e)},Q(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Uf(){return e=>Z(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],s=r.filter(u=>{var c;return(c=e.getColumn(u.id))==null?void 0:c.getCanSort()}),i={};s.forEach(u=>{const c=e.getColumn(u.id);c&&(i[u.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=u=>{const c=u.map(f=>({...f}));return c.sort((f,g)=>{for(let p=0;p<s.length;p+=1){var m;const v=s[p],h=i[v.id],y=h.sortUndefined,w=(m=v==null?void 0:v.desc)!=null?m:!1;let b=0;if(y){const S=f.getValue(v.id),E=g.getValue(v.id),x=S===void 0,_=E===void 0;if(x||_){if(y==="first")return x?-1:1;if(y==="last")return x?1:-1;b=x&&_?0:x?y:-y}}if(b===0&&(b=h.sortingFn(f,g,v.id)),b!==0)return w&&(b*=-1),h.invertSorting&&(b*=-1),b}return f.index-g.index}),c.forEach(f=>{var g;o.push(f),(g=f.subRows)!=null&&g.length&&(f.subRows=a(f.subRows))}),c};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},Q(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
14
14
|
* react-table
|
|
15
15
|
*
|
|
16
16
|
* Copyright (c) TanStack
|
|
@@ -19,97 +19,97 @@
|
|
|
19
19
|
* LICENSE.md file in the root directory of this source tree.
|
|
20
20
|
*
|
|
21
21
|
* @license MIT
|
|
22
|
-
*/function or(e,t){return e?Af(e)?d.createElement(e,t):e:null}function Af(e){return _f(e)||typeof e=="function"||Ff(e)}function _f(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Ff(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Hi(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 Ui(e,t){return function(){return e.apply(t,arguments)}}const{toString:Of}=Object.prototype,{getPrototypeOf:Oo}=Object,sr=(e=>t=>{const n=Of.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ke=e=>(e=e.toLowerCase(),t=>sr(t)===e),ir=e=>t=>typeof t===e,{isArray:Zt}=Array,_n=ir("undefined");function Df(e){return e!==null&&!_n(e)&&e.constructor!==null&&!_n(e.constructor)&&Le(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ji=Ke("ArrayBuffer");function Mf(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ji(e.buffer),t}const If=ir("string"),Le=ir("function"),Wi=ir("number"),ar=e=>e!==null&&typeof e=="object",kf=e=>e===!0||e===!1,lr=e=>{if(sr(e)!=="object")return!1;const t=Oo(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},$f=Ke("Date"),Lf=Ke("File"),Rf=Ke("Blob"),Vf=Ke("FileList"),Bf=e=>ar(e)&&Le(e.pipe),zf=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Le(e.append)&&((t=sr(e))==="formdata"||t==="object"&&Le(e.toString)&&e.toString()==="[object FormData]"))},Hf=Ke("URLSearchParams"),[Uf,jf,Wf,Gf]=["ReadableStream","Request","Response","Headers"].map(Ke),qf=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Fn(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),Zt(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 Gi(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 zt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,qi=e=>!_n(e)&&e!==zt;function Do(){const{caseless:e}=qi(this)&&this||{},t={},n=(r,o)=>{const s=e&&Gi(t,o)||o;lr(t[s])&&lr(r)?t[s]=Do(t[s],r):lr(r)?t[s]=Do({},r):Zt(r)?t[s]=r.slice():t[s]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&Fn(arguments[r],n);return t}const Kf=(e,t,n,{allOwnKeys:r}={})=>(Fn(t,(o,s)=>{n&&Le(o)?e[s]=Ui(o,n):e[s]=o},{allOwnKeys:r}),e),Xf=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Jf=(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)},Yf=(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&&Oo(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Zf=(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},Qf=e=>{if(!e)return null;if(Zt(e))return e;let t=e.length;if(!Wi(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},ep=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Oo(Uint8Array)),tp=(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])}},np=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},rp=Ke("HTMLFormElement"),op=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),sp=Ke("RegExp"),Xi=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Fn(n,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(r[s]=i||o)}),Object.defineProperties(e,r)},ip=e=>{Xi(e,(t,n)=>{if(Le(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Le(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},ap=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return Zt(e)?r(e):r(String(e).split(t)),n},lp=()=>{},cp=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Mo="abcdefghijklmnopqrstuvwxyz",Ji="0123456789",Yi={DIGIT:Ji,ALPHA:Mo,ALPHA_DIGIT:Mo+Mo.toUpperCase()+Ji},up=(e=16,t=Yi.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function dp(e){return!!(e&&Le(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const fp=e=>{const t=new Array(10),n=(r,o)=>{if(ar(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const s=Zt(r)?[]:{};return Fn(r,(i,a)=>{const u=n(i,o+1);!_n(u)&&(s[a]=u)}),t[o]=void 0,s}}return r};return n(e,0)},pp=Ke("AsyncFunction"),gp=e=>e&&(ar(e)||Le(e))&&Le(e.then)&&Le(e.catch),Zi=((e,t)=>e?setImmediate:t?((n,r)=>(zt.addEventListener("message",({source:o,data:s})=>{o===zt&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),zt.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Le(zt.postMessage)),hp=typeof queueMicrotask<"u"?queueMicrotask.bind(zt):typeof process<"u"&&process.nextTick||Zi,T={isArray:Zt,isArrayBuffer:ji,isBuffer:Df,isFormData:zf,isArrayBufferView:Mf,isString:If,isNumber:Wi,isBoolean:kf,isObject:ar,isPlainObject:lr,isReadableStream:Uf,isRequest:jf,isResponse:Wf,isHeaders:Gf,isUndefined:_n,isDate:$f,isFile:Lf,isBlob:Rf,isRegExp:sp,isFunction:Le,isStream:Bf,isURLSearchParams:Hf,isTypedArray:ep,isFileList:Vf,forEach:Fn,merge:Do,extend:Kf,trim:qf,stripBOM:Xf,inherits:Jf,toFlatObject:Yf,kindOf:sr,kindOfTest:Ke,endsWith:Zf,toArray:Qf,forEachEntry:tp,matchAll:np,isHTMLForm:rp,hasOwnProperty:Ki,hasOwnProp:Ki,reduceDescriptors:Xi,freezeMethods:ip,toObjectSet:ap,toCamelCase:op,noop:lp,toFiniteNumber:cp,findKey:Gi,global:zt,isContextDefined:qi,ALPHABET:Yi,generateString:up,isSpecCompliantForm:dp,toJSONObject:fp,isAsyncFn:pp,isThenable:gp,setImmediate:Zi,asap:hp};function re(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(re,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 Qi=re.prototype,ea={};["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=>{ea[e]={value:e}}),Object.defineProperties(re,ea),Object.defineProperty(Qi,"isAxiosError",{value:!0}),re.from=(e,t,n,r,o,s)=>{const i=Object.create(Qi);return T.toFlatObject(e,i,function(u){return u!==Error.prototype},a=>a!=="isAxiosError"),re.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const mp=null;function Io(e){return T.isPlainObject(e)||T.isArray(e)}function ta(e){return T.endsWith(e,"[]")?e.slice(0,-2):e}function na(e,t,n){return e?e.concat(t).map(function(o,s){return o=ta(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function vp(e){return T.isArray(e)&&!e.some(Io)}const yp=T.toFlatObject(T,{},null,function(t){return/^is[A-Z]/.test(t)});function cr(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(m,y){return!T.isUndefined(y[m])});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 re("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,m,y){let w=v;if(v&&!y&&typeof v=="object"){if(T.endsWith(m,"{}"))m=r?m:m.slice(0,-2),v=JSON.stringify(v);else if(T.isArray(v)&&vp(v)||(T.isFileList(v)||T.endsWith(m,"[]"))&&(w=T.toArray(v)))return m=ta(m),w.forEach(function(S,E){!(T.isUndefined(S)||S===null)&&t.append(i===!0?na([m],E,s):i===null?m:m+"[]",c(S))}),!1}return Io(v)?!0:(t.append(na(y,m,s),c(v)),!1)}const g=[],h=Object.assign(yp,{defaultVisitor:f,convertValue:c,isVisitable:Io});function p(v,m){if(!T.isUndefined(v)){if(g.indexOf(v)!==-1)throw Error("Circular reference detected in "+m.join("."));g.push(v),T.forEach(v,function(w,b){(!(T.isUndefined(w)||w===null)&&o.call(t,w,T.isString(b)?b.trim():b,m,h))===!0&&p(w,m?m.concat(b):[b])}),g.pop()}}if(!T.isObject(e))throw new TypeError("data must be an object");return p(e),t}function ra(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function ko(e,t){this._pairs=[],e&&cr(e,this,t)}const oa=ko.prototype;oa.append=function(t,n){this._pairs.push([t,n])},oa.toString=function(t){const n=t?function(r){return t.call(this,r,ra)}:ra;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function wp(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function sa(e,t,n){if(!t)return e;const r=n&&n.encode||wp;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 ko(t,n).toString(r),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class ia{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 aa={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},bp={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:ko,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},$o=typeof window<"u"&&typeof document<"u",Lo=typeof navigator=="object"&&navigator||void 0,xp=$o&&(!Lo||["ReactNative","NativeScript","NS"].indexOf(Lo.product)<0),Cp=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Sp=$o&&window.location.href||"http://localhost",Pe={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:$o,hasStandardBrowserEnv:xp,hasStandardBrowserWebWorkerEnv:Cp,navigator:Lo,origin:Sp},Symbol.toStringTag,{value:"Module"})),...bp};function Ep(e,t){return cr(e,new Pe.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,s){return Pe.isNode&&T.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function Np(e){return T.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Tp(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}function la(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]=Tp(o[i])),!a)}if(T.isFormData(e)&&T.isFunction(e.entries)){const n={};return T.forEachEntry(e,(r,o)=>{t(Np(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 On={transitional:aa,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(la(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 Ep(t,this.formSerializer).toString();if((a=T.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return cr(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||On.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"?re.from(a,re.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:Pe.classes.FormData,Blob:Pe.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=>{On.headers[e]={}});const Ap=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"]),_p=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]&&
|
|
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[ca]=this[ca]={accessors:{}}).accessors,o=this.prototype;function s(i){const a=Dn(i);r[a]||(Mp(o,i),r[a]=!0)}return T.isArray(t)?t.forEach(s):s(t),this}}Me.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),T.reduceDescriptors(Me.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),T.freezeMethods(Me);function Vo(e,t){const n=this||On,r=t||n,o=Me.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 ua(e){return!!(e&&e.__CANCEL__)}function Qt(e,t,n){re.call(this,e??"canceled",re.ERR_CANCELED,t,n),this.name="CanceledError"}T.inherits(Qt,re,{__CANCEL__:!0});function da(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new re("Request failed with status code "+n.status,[re.ERR_BAD_REQUEST,re.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Ip(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function kp(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,h=0;for(;g!==o;)h+=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(h*1e3/p):void 0}}function $p(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 dr=(e,t,n=3)=>{let r=0;const o=kp(50,250);return $p(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)},fa=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},pa=e=>(...t)=>T.asap(()=>e(...t)),Lp=Pe.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Pe.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Pe.origin),Pe.navigator&&/(msie|trident)/i.test(Pe.navigator.userAgent)):()=>!0,Rp=Pe.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 Vp(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Bp(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ga(e,t){return e&&!Vp(t)?Bp(e,t):t}const ha=e=>e instanceof Me?{...e}:e;function Ht(e,t){t=t||{};const n={};function r(c,f,g,h){return T.isPlainObject(c)&&T.isPlainObject(f)?T.merge.call({caseless:h},c,f):T.isPlainObject(f)?T.merge({},f):T.isArray(f)?f.slice():f}function o(c,f,g,h){if(T.isUndefined(f)){if(!T.isUndefined(c))return r(void 0,c,g,h)}else return r(c,f,g,h)}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(ha(c),ha(f),g,!0)};return T.forEach(Object.keys(Object.assign({},e,t)),function(f){const g=u[f]||o,h=g(e[f],t[f],f);T.isUndefined(h)&&g!==a||(n[f]=h)}),n}const ma=e=>{const t=Ht({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;t.headers=i=Me.from(i),t.url=sa(ga(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(Pe.hasStandardBrowserEnv||Pe.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(Pe.hasStandardBrowserEnv&&(r&&T.isFunction(r)&&(r=r(t)),r||r!==!1&&Lp(t.url))){const c=o&&s&&Rp.read(s);c&&i.set(o,c)}return t},zp=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const o=ma(e);let s=o.data;const i=Me.from(o.headers).normalize();let{responseType:a,onUploadProgress:u,onDownloadProgress:c}=o,f,g,h,p,v;function m(){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=Me.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),x={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:S,config:e,request:y};da(function(F){n(F),m()},function(F){r(F),m()},x),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 re("Request aborted",re.ECONNABORTED,e,y)),y=null)},y.onerror=function(){r(new re("Network Error",re.ERR_NETWORK,e,y)),y=null},y.ontimeout=function(){let E=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const x=o.transitional||aa;o.timeoutErrorMessage&&(E=o.timeoutErrorMessage),r(new re(E,x.clarifyTimeoutError?re.ETIMEDOUT:re.ECONNABORTED,e,y)),y=null},s===void 0&&i.setContentType(null),"setRequestHeader"in y&&T.forEach(i.toJSON(),function(E,x){y.setRequestHeader(x,E)}),T.isUndefined(o.withCredentials)||(y.withCredentials=!!o.withCredentials),a&&a!=="json"&&(y.responseType=o.responseType),c&&([h,v]=dr(c,!0),y.addEventListener("progress",h)),u&&y.upload&&([g,p]=dr(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 b=Ip(o.url);if(b&&Pe.protocols.indexOf(b)===-1){r(new re("Unsupported protocol "+b+":",re.ERR_BAD_REQUEST,e));return}y.send(s||null)})},Hp=(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 re?f:new Qt(f instanceof Error?f.message:f))}};let i=t&&setTimeout(()=>{i=null,s(new re(`timeout ${t} of ms exceeded`,re.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}},Up=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},jp=async function*(e,t){for await(const n of Wp(e))yield*Up(n,t)},Wp=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()}},va=(e,t,n,r)=>{const o=jp(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 h=s+=g;n(h)}u.enqueue(new Uint8Array(f))}catch(c){throw a(c),c}},cancel(u){return a(u),o.return()}},{highWaterMark:2})},fr=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ya=fr&&typeof ReadableStream=="function",Gp=fr&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),wa=(e,...t)=>{try{return!!e(...t)}catch{return!1}},qp=ya&&wa(()=>{let e=!1;const t=new Request(Pe.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),ba=64*1024,Bo=ya&&wa(()=>T.isReadableStream(new Response("").body)),pr={stream:Bo&&(e=>e.body)};fr&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!pr[t]&&(pr[t]=T.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new re(`Response type '${t}' is not supported`,re.ERR_NOT_SUPPORT,r)})})})(new Response);const Kp=async e=>{if(e==null)return 0;if(T.isBlob(e))return e.size;if(T.isSpecCompliantForm(e))return(await new Request(Pe.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 Gp(e)).byteLength},Xp=async(e,t)=>{const n=T.toFiniteNumber(e.getContentLength());return n??Kp(t)},zo={http:mp,xhr:zp,fetch:fr&&(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:h}=ma(e);c=c?(c+"").toLowerCase():"text";let p=Hp([o,s&&s.toAbortSignal()],i),v;const m=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(u&&qp&&n!=="get"&&n!=="head"&&(y=await Xp(f,r))!==0){let x=new Request(t,{method:"POST",body:r,duplex:"half"}),P;if(T.isFormData(r)&&(P=x.headers.get("content-type"))&&f.setContentType(P),x.body){const[F,O]=fa(y,dr(pa(u)));r=va(x.body,ba,F,O)}}T.isString(g)||(g=g?"include":"omit");const w="credentials"in Request.prototype;v=new Request(t,{...h,signal:p,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:w?g:void 0});let b=await fetch(v);const S=Bo&&(c==="stream"||c==="response");if(Bo&&(a||S&&m)){const x={};["status","statusText","headers"].forEach(k=>{x[k]=b[k]});const P=T.toFiniteNumber(b.headers.get("content-length")),[F,O]=a&&fa(P,dr(pa(a),!0))||[];b=new Response(va(b.body,ba,F,()=>{O&&O(),m&&m()}),x)}c=c||"text";let E=await pr[T.findKey(pr,c)||"text"](b,e);return!S&&m&&m(),await new Promise((x,P)=>{da(x,P,{data:E,headers:Me.from(b.headers),status:b.status,statusText:b.statusText,config:e,request:v})})}catch(w){throw m&&m(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new re("Network Error",re.ERR_NETWORK,e,v),{cause:w.cause||w}):re.from(w,w&&w.code,e,v)}})};T.forEach(zo,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const xa=e=>`- ${e}`,Jp=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,!Jp(n)&&(r=zo[(i=String(n)).toLowerCase()],r===void 0))throw new re(`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
|
-
`+s.map(
|
|
26
|
-
`):" "+
|
|
27
|
-
`+s):r.stack=s}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=
|
|
22
|
+
*/function pr(e,t){return e?jf(e)?d.createElement(e,t):e:null}function jf(e){return Wf(e)||typeof e=="function"||Gf(e)}function Wf(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Gf(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Qi(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=d.useState(()=>({current:Rf(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 ea(e,t){return function(){return e.apply(t,arguments)}}const{toString:qf}=Object.prototype,{getPrototypeOf:qo}=Object,gr=(e=>t=>{const n=qf.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ze=e=>(e=e.toLowerCase(),t=>gr(t)===e),hr=e=>t=>typeof t===e,{isArray:rn}=Array,In=hr("undefined");function Kf(e){return e!==null&&!In(e)&&e.constructor!==null&&!In(e.constructor)&&Ve(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ta=Ze("ArrayBuffer");function Xf(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ta(e.buffer),t}const Jf=hr("string"),Ve=hr("function"),na=hr("number"),mr=e=>e!==null&&typeof e=="object",Yf=e=>e===!0||e===!1,vr=e=>{if(gr(e)!=="object")return!1;const t=qo(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Zf=Ze("Date"),Qf=Ze("File"),ep=Ze("Blob"),tp=Ze("FileList"),np=e=>mr(e)&&Ve(e.pipe),rp=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ve(e.append)&&((t=gr(e))==="formdata"||t==="object"&&Ve(e.toString)&&e.toString()==="[object FormData]"))},op=Ze("URLSearchParams"),[sp,ip,ap,lp]=["ReadableStream","Request","Response","Headers"].map(Ze),cp=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function $n(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),rn(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 ra(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 jt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,oa=e=>!In(e)&&e!==jt;function Ko(){const{caseless:e}=oa(this)&&this||{},t={},n=(r,o)=>{const s=e&&ra(t,o)||o;vr(t[s])&&vr(r)?t[s]=Ko(t[s],r):vr(r)?t[s]=Ko({},r):rn(r)?t[s]=r.slice():t[s]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&$n(arguments[r],n);return t}const up=(e,t,n,{allOwnKeys:r}={})=>($n(t,(o,s)=>{n&&Ve(o)?e[s]=ea(o,n):e[s]=o},{allOwnKeys:r}),e),dp=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),fp=(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)},pp=(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&&qo(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},gp=(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},hp=e=>{if(!e)return null;if(rn(e))return e;let t=e.length;if(!na(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},mp=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&qo(Uint8Array)),vp=(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])}},yp=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},wp=Ze("HTMLFormElement"),bp=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),sa=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),xp=Ze("RegExp"),ia=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};$n(n,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(r[s]=i||o)}),Object.defineProperties(e,r)},Cp=e=>{ia(e,(t,n)=>{if(Ve(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Ve(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+"'")})}})},Sp=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return rn(e)?r(e):r(String(e).split(t)),n},Ep=()=>{},Np=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Xo="abcdefghijklmnopqrstuvwxyz",aa="0123456789",la={DIGIT:aa,ALPHA:Xo,ALPHA_DIGIT:Xo+Xo.toUpperCase()+aa},Tp=(e=16,t=la.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function Pp(e){return!!(e&&Ve(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Ap=e=>{const t=new Array(10),n=(r,o)=>{if(mr(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const s=rn(r)?[]:{};return $n(r,(i,a)=>{const u=n(i,o+1);!In(u)&&(s[a]=u)}),t[o]=void 0,s}}return r};return n(e,0)},_p=Ze("AsyncFunction"),Fp=e=>e&&(mr(e)||Ve(e))&&Ve(e.then)&&Ve(e.catch),ca=((e,t)=>e?setImmediate:t?((n,r)=>(jt.addEventListener("message",({source:o,data:s})=>{o===jt&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),jt.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ve(jt.postMessage)),Op=typeof queueMicrotask<"u"?queueMicrotask.bind(jt):typeof process<"u"&&process.nextTick||ca,P={isArray:rn,isArrayBuffer:ta,isBuffer:Kf,isFormData:rp,isArrayBufferView:Xf,isString:Jf,isNumber:na,isBoolean:Yf,isObject:mr,isPlainObject:vr,isReadableStream:sp,isRequest:ip,isResponse:ap,isHeaders:lp,isUndefined:In,isDate:Zf,isFile:Qf,isBlob:ep,isRegExp:xp,isFunction:Ve,isStream:np,isURLSearchParams:op,isTypedArray:mp,isFileList:tp,forEach:$n,merge:Ko,extend:up,trim:cp,stripBOM:dp,inherits:fp,toFlatObject:pp,kindOf:gr,kindOfTest:Ze,endsWith:gp,toArray:hp,forEachEntry:vp,matchAll:yp,isHTMLForm:wp,hasOwnProperty:sa,hasOwnProp:sa,reduceDescriptors:ia,freezeMethods:Cp,toObjectSet:Sp,toCamelCase:bp,noop:Ep,toFiniteNumber:Np,findKey:ra,global:jt,isContextDefined:oa,ALPHABET:la,generateString:Tp,isSpecCompliantForm:Pp,toJSONObject:Ap,isAsyncFn:_p,isThenable:Fp,setImmediate:ca,asap:Op};function re(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)}P.inherits(re,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:P.toJSONObject(this.config),code:this.code,status:this.status}}});const ua=re.prototype,da={};["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=>{da[e]={value:e}}),Object.defineProperties(re,da),Object.defineProperty(ua,"isAxiosError",{value:!0}),re.from=(e,t,n,r,o,s)=>{const i=Object.create(ua);return P.toFlatObject(e,i,function(u){return u!==Error.prototype},a=>a!=="isAxiosError"),re.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const Dp=null;function Jo(e){return P.isPlainObject(e)||P.isArray(e)}function fa(e){return P.endsWith(e,"[]")?e.slice(0,-2):e}function pa(e,t,n){return e?e.concat(t).map(function(o,s){return o=fa(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function Mp(e){return P.isArray(e)&&!e.some(Jo)}const Ip=P.toFlatObject(P,{},null,function(t){return/^is[A-Z]/.test(t)});function yr(e,t,n){if(!P.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=P.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,y){return!P.isUndefined(y[h])});const r=n.metaTokens,o=n.visitor||f,s=n.dots,i=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&P.isSpecCompliantForm(t);if(!P.isFunction(o))throw new TypeError("visitor must be a function");function c(v){if(v===null)return"";if(P.isDate(v))return v.toISOString();if(!u&&P.isBlob(v))throw new re("Blob is not supported. Use a Buffer instead.");return P.isArrayBuffer(v)||P.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(P.endsWith(h,"{}"))h=r?h:h.slice(0,-2),v=JSON.stringify(v);else if(P.isArray(v)&&Mp(v)||(P.isFileList(v)||P.endsWith(h,"[]"))&&(w=P.toArray(v)))return h=fa(h),w.forEach(function(S,E){!(P.isUndefined(S)||S===null)&&t.append(i===!0?pa([h],E,s):i===null?h:h+"[]",c(S))}),!1}return Jo(v)?!0:(t.append(pa(y,h,s),c(v)),!1)}const g=[],m=Object.assign(Ip,{defaultVisitor:f,convertValue:c,isVisitable:Jo});function p(v,h){if(!P.isUndefined(v)){if(g.indexOf(v)!==-1)throw Error("Circular reference detected in "+h.join("."));g.push(v),P.forEach(v,function(w,b){(!(P.isUndefined(w)||w===null)&&o.call(t,w,P.isString(b)?b.trim():b,h,m))===!0&&p(w,h?h.concat(b):[b])}),g.pop()}}if(!P.isObject(e))throw new TypeError("data must be an object");return p(e),t}function ga(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Yo(e,t){this._pairs=[],e&&yr(e,this,t)}const ha=Yo.prototype;ha.append=function(t,n){this._pairs.push([t,n])},ha.toString=function(t){const n=t?function(r){return t.call(this,r,ga)}:ga;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function $p(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ma(e,t,n){if(!t)return e;const r=n&&n.encode||$p;P.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(o?s=o(t,n):s=P.isURLSearchParams(t)?t.toString():new Yo(t,n).toString(r),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class va{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){P.forEach(this.handlers,function(r){r!==null&&t(r)})}}const ya={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},kp={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Yo,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Zo=typeof window<"u"&&typeof document<"u",Qo=typeof navigator=="object"&&navigator||void 0,Lp=Zo&&(!Qo||["ReactNative","NativeScript","NS"].indexOf(Qo.product)<0),Rp=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Vp=Zo&&window.location.href||"http://localhost",Ae={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Zo,hasStandardBrowserEnv:Lp,hasStandardBrowserWebWorkerEnv:Rp,navigator:Qo,origin:Vp},Symbol.toStringTag,{value:"Module"})),...kp};function Bp(e,t){return yr(e,new Ae.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,s){return Ae.isNode&&P.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function Hp(e){return P.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function zp(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 wa(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&&P.isArray(o)?o.length:i,u?(P.hasOwnProp(o,i)?o[i]=[o[i],r]:o[i]=r,!a):((!o[i]||!P.isObject(o[i]))&&(o[i]=[]),t(n,r,o[i],s)&&P.isArray(o[i])&&(o[i]=zp(o[i])),!a)}if(P.isFormData(e)&&P.isFunction(e.entries)){const n={};return P.forEachEntry(e,(r,o)=>{t(Hp(r),o,n,0)}),n}return null}function Up(e,t,n){if(P.isString(e))try{return(t||JSON.parse)(e),P.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const kn={transitional:ya,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=P.isObject(t);if(s&&P.isHTMLForm(t)&&(t=new FormData(t)),P.isFormData(t))return o?JSON.stringify(wa(t)):t;if(P.isArrayBuffer(t)||P.isBuffer(t)||P.isStream(t)||P.isFile(t)||P.isBlob(t)||P.isReadableStream(t))return t;if(P.isArrayBufferView(t))return t.buffer;if(P.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 Bp(t,this.formSerializer).toString();if((a=P.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return yr(a?{"files[]":t}:t,u&&new u,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),Up(t)):t}],transformResponse:[function(t){const n=this.transitional||kn.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(P.isResponse(t)||P.isReadableStream(t))return t;if(t&&P.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"?re.from(a,re.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:Ae.classes.FormData,Blob:Ae.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};P.forEach(["delete","get","head","post","put","patch"],e=>{kn.headers[e]={}});const jp=P.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"]),Wp=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]&&jp[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},ba=Symbol("internals");function Ln(e){return e&&String(e).trim().toLowerCase()}function wr(e){return e===!1||e==null?e:P.isArray(e)?e.map(wr):String(e)}function Gp(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 qp=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function es(e,t,n,r,o){if(P.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!P.isString(t)){if(P.isString(r))return t.indexOf(r)!==-1;if(P.isRegExp(r))return r.test(t)}}function Kp(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Xp(e,t){const n=P.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 $e{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function s(a,u,c){const f=Ln(u);if(!f)throw new Error("header name must be a non-empty string");const g=P.findKey(o,f);(!g||o[g]===void 0||c===!0||c===void 0&&o[g]!==!1)&&(o[g||u]=wr(a))}const i=(a,u)=>P.forEach(a,(c,f)=>s(c,f,u));if(P.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(P.isString(t)&&(t=t.trim())&&!qp(t))i(Wp(t),n);else if(P.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=Ln(t),t){const r=P.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return Gp(o);if(P.isFunction(n))return n.call(this,o,r);if(P.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Ln(t),t){const r=P.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||es(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function s(i){if(i=Ln(i),i){const a=P.findKey(r,i);a&&(!n||es(r,r[a],a,n))&&(delete r[a],o=!0)}}return P.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||es(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const n=this,r={};return P.forEach(this,(o,s)=>{const i=P.findKey(r,s);if(i){n[i]=wr(o),delete n[s];return}const a=t?Kp(s):String(s).trim();a!==s&&delete n[s],n[a]=wr(o),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return P.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&P.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[ba]=this[ba]={accessors:{}}).accessors,o=this.prototype;function s(i){const a=Ln(i);r[a]||(Xp(o,i),r[a]=!0)}return P.isArray(t)?t.forEach(s):s(t),this}}$e.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),P.reduceDescriptors($e.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),P.freezeMethods($e);function ts(e,t){const n=this||kn,r=t||n,o=$e.from(r.headers);let s=r.data;return P.forEach(e,function(a){s=a.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function xa(e){return!!(e&&e.__CANCEL__)}function on(e,t,n){re.call(this,e??"canceled",re.ERR_CANCELED,t,n),this.name="CanceledError"}P.inherits(on,re,{__CANCEL__:!0});function Ca(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new re("Request failed with status code "+n.status,[re.ERR_BAD_REQUEST,re.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Jp(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Yp(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 Zp(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 br=(e,t,n=3)=>{let r=0;const o=Yp(50,250);return Zp(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)},Sa=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ea=e=>(...t)=>P.asap(()=>e(...t)),Qp=Ae.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ae.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ae.origin),Ae.navigator&&/(msie|trident)/i.test(Ae.navigator.userAgent)):()=>!0,eg=Ae.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];P.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),P.isString(r)&&i.push("path="+r),P.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 tg(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function ng(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Na(e,t){return e&&!tg(t)?ng(e,t):t}const Ta=e=>e instanceof $e?{...e}:e;function Wt(e,t){t=t||{};const n={};function r(c,f,g,m){return P.isPlainObject(c)&&P.isPlainObject(f)?P.merge.call({caseless:m},c,f):P.isPlainObject(f)?P.merge({},f):P.isArray(f)?f.slice():f}function o(c,f,g,m){if(P.isUndefined(f)){if(!P.isUndefined(c))return r(void 0,c,g,m)}else return r(c,f,g,m)}function s(c,f){if(!P.isUndefined(f))return r(void 0,f)}function i(c,f){if(P.isUndefined(f)){if(!P.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(Ta(c),Ta(f),g,!0)};return P.forEach(Object.keys(Object.assign({},e,t)),function(f){const g=u[f]||o,m=g(e[f],t[f],f);P.isUndefined(m)&&g!==a||(n[f]=m)}),n}const Pa=e=>{const t=Wt({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;t.headers=i=$e.from(i),t.url=ma(Na(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(P.isFormData(n)){if(Ae.hasStandardBrowserEnv||Ae.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(Ae.hasStandardBrowserEnv&&(r&&P.isFunction(r)&&(r=r(t)),r||r!==!1&&Qp(t.url))){const c=o&&s&&eg.read(s);c&&i.set(o,c)}return t},rg=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const o=Pa(e);let s=o.data;const i=$e.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=$e.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),x={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:S,config:e,request:y};Ca(function(O){n(O),h()},function(O){r(O),h()},x),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 re("Request aborted",re.ECONNABORTED,e,y)),y=null)},y.onerror=function(){r(new re("Network Error",re.ERR_NETWORK,e,y)),y=null},y.ontimeout=function(){let E=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const x=o.transitional||ya;o.timeoutErrorMessage&&(E=o.timeoutErrorMessage),r(new re(E,x.clarifyTimeoutError?re.ETIMEDOUT:re.ECONNABORTED,e,y)),y=null},s===void 0&&i.setContentType(null),"setRequestHeader"in y&&P.forEach(i.toJSON(),function(E,x){y.setRequestHeader(x,E)}),P.isUndefined(o.withCredentials)||(y.withCredentials=!!o.withCredentials),a&&a!=="json"&&(y.responseType=o.responseType),c&&([m,v]=br(c,!0),y.addEventListener("progress",m)),u&&y.upload&&([g,p]=br(u),y.upload.addEventListener("progress",g),y.upload.addEventListener("loadend",p)),(o.cancelToken||o.signal)&&(f=S=>{y&&(r(!S||S.type?new on(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 b=Jp(o.url);if(b&&Ae.protocols.indexOf(b)===-1){r(new re("Unsupported protocol "+b+":",re.ERR_BAD_REQUEST,e));return}y.send(s||null)})},og=(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 re?f:new on(f instanceof Error?f.message:f))}};let i=t&&setTimeout(()=>{i=null,s(new re(`timeout ${t} of ms exceeded`,re.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=()=>P.asap(a),u}},sg=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},ig=async function*(e,t){for await(const n of ag(e))yield*sg(n,t)},ag=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()}},Aa=(e,t,n,r)=>{const o=ig(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})},xr=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",_a=xr&&typeof ReadableStream=="function",lg=xr&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Fa=(e,...t)=>{try{return!!e(...t)}catch{return!1}},cg=_a&&Fa(()=>{let e=!1;const t=new Request(Ae.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Oa=64*1024,ns=_a&&Fa(()=>P.isReadableStream(new Response("").body)),Cr={stream:ns&&(e=>e.body)};xr&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Cr[t]&&(Cr[t]=P.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new re(`Response type '${t}' is not supported`,re.ERR_NOT_SUPPORT,r)})})})(new Response);const ug=async e=>{if(e==null)return 0;if(P.isBlob(e))return e.size;if(P.isSpecCompliantForm(e))return(await new Request(Ae.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(P.isArrayBufferView(e)||P.isArrayBuffer(e))return e.byteLength;if(P.isURLSearchParams(e)&&(e=e+""),P.isString(e))return(await lg(e)).byteLength},dg=async(e,t)=>{const n=P.toFiniteNumber(e.getContentLength());return n??ug(t)},rs={http:Dp,xhr:rg,fetch:xr&&(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}=Pa(e);c=c?(c+"").toLowerCase():"text";let p=og([o,s&&s.toAbortSignal()],i),v;const h=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(u&&cg&&n!=="get"&&n!=="head"&&(y=await dg(f,r))!==0){let x=new Request(t,{method:"POST",body:r,duplex:"half"}),_;if(P.isFormData(r)&&(_=x.headers.get("content-type"))&&f.setContentType(_),x.body){const[O,D]=Sa(y,br(Ea(u)));r=Aa(x.body,Oa,O,D)}}P.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 b=await fetch(v);const S=ns&&(c==="stream"||c==="response");if(ns&&(a||S&&h)){const x={};["status","statusText","headers"].forEach($=>{x[$]=b[$]});const _=P.toFiniteNumber(b.headers.get("content-length")),[O,D]=a&&Sa(_,br(Ea(a),!0))||[];b=new Response(Aa(b.body,Oa,O,()=>{D&&D(),h&&h()}),x)}c=c||"text";let E=await Cr[P.findKey(Cr,c)||"text"](b,e);return!S&&h&&h(),await new Promise((x,_)=>{Ca(x,_,{data:E,headers:$e.from(b.headers),status:b.status,statusText:b.statusText,config:e,request:v})})}catch(w){throw h&&h(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new re("Network Error",re.ERR_NETWORK,e,v),{cause:w.cause||w}):re.from(w,w&&w.code,e,v)}})};P.forEach(rs,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Da=e=>`- ${e}`,fg=e=>P.isFunction(e)||e===null||e===!1,Ma={getAdapter:e=>{e=P.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,!fg(n)&&(r=rs[(i=String(n)).toLowerCase()],r===void 0))throw new re(`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
|
+
`+s.map(Da).join(`
|
|
26
|
+
`):" "+Da(s[0]):"as no adapter specified";throw new re("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:rs};function os(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new on(null,e)}function Ia(e){return os(e),e.headers=$e.from(e.headers),e.data=ts.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ma.getAdapter(e.adapter||kn.adapter)(e).then(function(r){return os(e),r.data=ts.call(e,e.transformResponse,r),r.headers=$e.from(r.headers),r},function(r){return xa(r)||(os(e),r&&r.response&&(r.response.data=ts.call(e,e.transformResponse,r.response),r.response.headers=$e.from(r.response.headers))),Promise.reject(r)})}const $a="1.7.9",Sr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Sr[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const ka={};Sr.transitional=function(t,n,r){function o(s,i){return"[Axios v"+$a+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,a)=>{if(t===!1)throw new re(o(i," has been removed"+(n?" in "+n:"")),re.ERR_DEPRECATED);return n&&!ka[i]&&(ka[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}},Sr.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function pg(e,t,n){if(typeof e!="object")throw new re("options must be an object",re.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 re("option "+s+" must be "+u,re.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new re("Unknown option "+s,re.ERR_BAD_OPTION)}}const Er={assertOptions:pg,validators:Sr},at=Er.validators;class Gt{constructor(t){this.defaults=t,this.interceptors={request:new va,response:new va}}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=Wt(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&Er.assertOptions(r,{silentJSONParsing:at.transitional(at.boolean),forcedJSONParsing:at.transitional(at.boolean),clarifyTimeoutError:at.transitional(at.boolean)},!1),o!=null&&(P.isFunction(o)?n.paramsSerializer={serialize:o}:Er.assertOptions(o,{encode:at.function,serialize:at.function},!0)),Er.assertOptions(n,{baseUrl:at.spelling("baseURL"),withXsrfToken:at.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=s&&P.merge(s.common,s[n.method]);s&&P.forEach(["delete","get","head","post","put","patch","common"],v=>{delete s[v]}),n.headers=$e.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=[Ia.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=Ia.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=Wt(this.defaults,t);const n=Na(t.baseURL,t.url);return ma(n,t.params,t.paramsSerializer)}}P.forEach(["delete","get","head","options"],function(t){Gt.prototype[t]=function(n,r){return this.request(Wt(r||{},{method:t,url:n,data:(r||{}).data}))}}),P.forEach(["post","put","patch"],function(t){function n(r){return function(s,i,a){return this.request(Wt(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}Gt.prototype[t]=n(),Gt.prototype[t+"Form"]=n(!0)});class ss{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 on(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 ss(function(o){t=o}),cancel:t}}}function gg(e){return function(n){return e.apply(null,n)}}function hg(e){return P.isObject(e)&&e.isAxiosError===!0}const is={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(is).forEach(([e,t])=>{is[t]=e});function La(e){const t=new Gt(e),n=ea(Gt.prototype.request,t);return P.extend(n,Gt.prototype,t,{allOwnKeys:!0}),P.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return La(Wt(e,o))},n}const oe=La(kn);oe.Axios=Gt,oe.CanceledError=on,oe.CancelToken=ss,oe.isCancel=xa,oe.VERSION=$a,oe.toFormData=yr,oe.AxiosError=re,oe.Cancel=oe.CanceledError,oe.all=function(t){return Promise.all(t)},oe.spread=gg,oe.isAxiosError=hg,oe.mergeConfig=Wt,oe.AxiosHeaders=$e,oe.formToJSON=e=>wa(P.isHTMLForm(e)?new FormData(e):e),oe.getAdapter=Ma.getAdapter,oe.HttpStatusCode=is,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.
|
|
31
31
|
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
-
*/const
|
|
32
|
+
*/const mg=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ra=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
33
33
|
* @license lucide-react v0.468.0 - ISC
|
|
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
|
|
37
|
+
*/var vg={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
|
|
42
|
+
*/const yg=T.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},u)=>T.createElement("svg",{ref:u,...vg,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Ra("lucide",o),...a},[...i.map(([c,f])=>T.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
|
|
47
|
+
*/const Ge=(e,t)=>{const n=T.forwardRef(({className:r,...o},s)=>T.createElement(yg,{ref:s,iconNode:t,className:Ra(`lucide-${mg(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
|
|
52
|
+
*/const as=Ge("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
|
|
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
|
|
57
|
+
*/const wg=Ge("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"}]]);/**
|
|
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
|
|
62
|
+
*/const bg=Ge("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
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
|
|
67
|
+
*/const xg=Ge("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
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
|
|
72
|
+
*/const Va=Ge("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
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
|
|
77
|
+
*/const Cg=Ge("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"}]]);/**
|
|
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
|
|
82
|
+
*/const Sg=Ge("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"}]]);/**
|
|
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 ve=
|
|
87
|
+
*/const ve=Ge("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
88
88
|
* @license lucide-react v0.468.0 - ISC
|
|
89
89
|
*
|
|
90
90
|
* This source code is licensed under the ISC license.
|
|
91
91
|
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
-
*/const
|
|
92
|
+
*/const Eg=Ge("MoveUpRight",[["path",{d:"M13 5H19V11",key:"1n1gyv"}],["path",{d:"M19 5L5 19",key:"72u4yj"}]]);/**
|
|
93
93
|
* @license lucide-react v0.468.0 - ISC
|
|
94
94
|
*
|
|
95
95
|
* This source code is licensed under the ISC license.
|
|
96
96
|
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
-
*/const
|
|
97
|
+
*/const Ng=Ge("PenOff",[["path",{d:"m10 10-6.157 6.162a2 2 0 0 0-.5.833l-1.322 4.36a.5.5 0 0 0 .622.624l4.358-1.323a2 2 0 0 0 .83-.5L14 13.982",key:"bjo8r8"}],["path",{d:"m12.829 7.172 4.359-4.346a1 1 0 1 1 3.986 3.986l-4.353 4.353",key:"16h5ne"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
98
98
|
* @license lucide-react v0.468.0 - ISC
|
|
99
99
|
*
|
|
100
100
|
* This source code is licensed under the ISC license.
|
|
101
101
|
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
-
*/const
|
|
102
|
+
*/const Tg=Ge("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"}]]);/**
|
|
103
103
|
* @license lucide-react v0.468.0 - ISC
|
|
104
104
|
*
|
|
105
105
|
* This source code is licensed under the ISC license.
|
|
106
106
|
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
-
*/const Go=He("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),dg={category:"Thư mục gốc",fileName:"Tên tệp",fullPath:"Đường dẫn đầy đủ",createAt:"Ngày tạo",creator:"Người tạo",creatorId:"ID người tạo",DataSource:"Nguồn dữ liệu",SuggestedAICategories:"Danh mục AI gợi ý",KeywordAISuggestion:"Từ khóa AI gợi ý",SummaryOfSuggestedAI:"Tóm tắt AI gợi ý",AccessLevel:"Cấp độ truy cập"},fg=e=>e==="SummaryOfSuggestedAI"||e==="KeywordAISuggestion"||e==="SuggestedAICategories",qo=e=>e==="fullPath"||e==="createAt"||e==="creator"||e==="creatorId"||e==="DataSource"||e==="AccessLevel"||e==="category"||e==="fileName",pg=(e,t)=>{if(e.length>30)return t({title:"Lỗi tải lên",description:"Bạn chỉ có thể tải lên tối đa 30 tệp.",variant:"destructive"}),!0;for(let o=0;o<e.length;o++){const s=e[o];if(s&&s.size>20971520)return t({title:"Lỗi tải lên",description:`Tệp ${s.name} vượt quá giới hạn kích thước 20MB.`,variant:"destructive"}),!0}return!1};function _a(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function gg(...e){return t=>{let n=!1;const r=e.map(o=>{const s=_a(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():_a(e[o],null)}}}}var en=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(hg);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(Ko,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Ko,{...r,ref:t,children:n})});en.displayName="Slot";var Ko=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=vg(n);return d.cloneElement(n,{...mg(r,n.props),ref:t?gg(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Ko.displayName="SlotClone";var Fa=({children:e})=>l.jsx(l.Fragment,{children:e});function hg(e){return d.isValidElement(e)&&e.type===Fa}function mg(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 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)}function Oa(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=Oa(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Da(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Oa(e))&&(r&&(r+=" "),r+=t);return r}const Xo="-",yg=e=>{const t=bg(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(Xo);return a[0]===""&&a.length!==1&&a.shift(),Ma(a,t)||wg(i)},getConflictingClassGroupIds:(i,a)=>{const u=n[i]||[];return a&&r[i]?[...u,...r[i]]:u}}},Ma=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Ma(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Xo);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},Ia=/^\[(.+)\]$/,wg=e=>{if(Ia.test(e)){const t=Ia.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},bg=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Cg(Object.entries(e.classGroups),n).forEach(([s,i])=>{Jo(i,r,s,t)}),r},Jo=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:ka(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(xg(o)){Jo(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{Jo(i,ka(t,s),n,r)})})},ka=(e,t)=>{let n=e;return t.split(Xo).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},xg=e=>e.isThemeGetter,Cg=(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,Sg=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)}}},$a="!",Eg=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 h=u.length===0?a:a.substring(f),p=h.startsWith($a),v=p?h.substring(1):h,m=g&&g>f?g-f:void 0;return{modifiers:u,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:m}};return n?a=>n({className:a,parseClassName:i}):i},Ng=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},Tg=e=>({cache:Sg(e.cacheSize),parseClassName:Eg(e),...yg(e)}),Pg=/\s+/,Ag=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(Pg);let a="";for(let u=i.length-1;u>=0;u-=1){const c=i[u],{modifiers:f,hasImportantModifier:g,baseClassName:h,maybePostfixModifierPosition:p}=n(c);let v=!!p,m=r(v?h.substring(0,p):h);if(!m){if(!v){a=c+(a.length>0?" "+a:a);continue}if(m=r(h),!m){a=c+(a.length>0?" "+a:a);continue}v=!1}const y=Ng(f).join(":"),w=g?y+$a:y,b=w+m;if(s.includes(b))continue;s.push(b);const S=o(m,v);for(let E=0;E<S.length;++E){const x=S[E];s.push(w+x)}a=c+(a.length>0?" "+a:a)}return a};function _g(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=La(t))&&(r&&(r+=" "),r+=n);return r}const La=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=La(e[r]))&&(n&&(n+=" "),n+=t);return n};function Fg(e,...t){let n,r,o,s=i;function i(u){const c=t.reduce((f,g)=>g(f),e());return n=Tg(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=Ag(u,n);return o(u,f),f}return function(){return s(_g.apply(null,arguments))}}const de=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ra=/^\[(?:([a-z-]+):)?(.+)\]$/i,Og=/^\d+\/\d+$/,Dg=new Set(["px","full","screen"]),Mg=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ig=/\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$/,kg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,$g=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Lg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ht=e=>tn(e)||Dg.has(e)||Og.test(e),Pt=e=>nn(e,"length",Wg),tn=e=>!!e&&!Number.isNaN(Number(e)),Yo=e=>nn(e,"number",tn),Mn=e=>!!e&&Number.isInteger(Number(e)),Rg=e=>e.endsWith("%")&&tn(e.slice(0,-1)),oe=e=>Ra.test(e),At=e=>Mg.test(e),Vg=new Set(["length","size","percentage"]),Bg=e=>nn(e,Vg,Va),zg=e=>nn(e,"position",Va),Hg=new Set(["image","url"]),Ug=e=>nn(e,Hg,qg),jg=e=>nn(e,"",Gg),In=()=>!0,nn=(e,t,n)=>{const r=Ra.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Wg=e=>Ig.test(e)&&!kg.test(e),Va=()=>!1,Gg=e=>$g.test(e),qg=e=>Lg.test(e),Kg=Fg(()=>{const e=de("colors"),t=de("spacing"),n=de("blur"),r=de("brightness"),o=de("borderColor"),s=de("borderRadius"),i=de("borderSpacing"),a=de("borderWidth"),u=de("contrast"),c=de("grayscale"),f=de("hueRotate"),g=de("invert"),h=de("gap"),p=de("gradientColorStops"),v=de("gradientColorStopPositions"),m=de("inset"),y=de("margin"),w=de("opacity"),b=de("padding"),S=de("saturate"),E=de("scale"),x=de("sepia"),P=de("skew"),F=de("space"),O=de("translate"),k=()=>["auto","contain","none"],D=()=>["auto","hidden","clip","visible","scroll"],G=()=>["auto",oe,t],$=()=>[oe,t],U=()=>["",ht,Pt],L=()=>["auto",tn,oe],X=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],q=()=>["solid","dashed","dotted","double","none"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],B=()=>["start","end","center","between","around","evenly","stretch"],j=()=>["","0",oe],le=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ce=()=>[tn,oe];return{cacheSize:500,separator:":",theme:{colors:[In],spacing:[ht,Pt],blur:["none","",At,oe],brightness:ce(),borderColor:[e],borderRadius:["none","","full",At,oe],borderSpacing:$(),borderWidth:U(),contrast:ce(),grayscale:j(),hueRotate:ce(),invert:j(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[Rg,Pt],inset:G(),margin:G(),opacity:ce(),padding:$(),saturate:ce(),scale:ce(),sepia:j(),skew:ce(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",oe]}],container:["container"],columns:[{columns:[At]}],"break-after":[{"break-after":le()}],"break-before":[{"break-before":le()}],"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:[...X(),oe]}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Mn,oe]}],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",oe]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",Mn,oe]}],"grid-cols":[{"grid-cols":[In]}],"col-start-end":[{col:["auto",{span:["full",Mn,oe]},oe]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[In]}],"row-start-end":[{row:["auto",{span:[Mn,oe]},oe]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",oe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",oe]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...B()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...B(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...B(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],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":[F]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[F]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",oe,t]}],"min-w":[{"min-w":[oe,t,"min","max","fit"]}],"max-w":[{"max-w":[oe,t,"none","full","min","max","fit","prose",{screen:[At]},At]}],h:[{h:[oe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[oe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[oe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[oe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",At,Pt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Yo]}],"font-family":[{font:[In]}],"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",oe]}],"line-clamp":[{"line-clamp":["none",tn,Yo]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ht,oe]}],"list-image":[{"list-image":["none",oe]}],"list-style-type":[{list:["none","disc","decimal",oe]}],"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:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ht,Pt]}],"underline-offset":[{"underline-offset":["auto",ht,oe]}],"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",oe]}],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",oe]}],"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:[...X(),zg]}],"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"]},Ug]}],"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:[...q(),"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:q()}],"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:["",...q()]}],"outline-offset":[{"outline-offset":[ht,oe]}],"outline-w":[{outline:[ht,Pt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[ht,Pt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",At,jg]}],"shadow-color":[{shadow:[In]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...te(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":te()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",At,oe]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[g]}],saturate:[{saturate:[S]}],sepia:[{sepia:[x]}],"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":[x]}],"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",oe]}],duration:[{duration:ce()}],ease:[{ease:["linear","in","out","in-out",oe]}],delay:[{delay:ce()}],animate:[{animate:["none","spin","ping","pulse","bounce",oe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Mn,oe]}],"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",oe]}],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",oe]}],"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",oe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ht,Pt,Yo]}],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 ee(...e){return Kg(Da(e))}const Xg=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]}`},Ba=d.forwardRef(({className:e,...t},n)=>l.jsx("nav",{ref:n,"aria-label":"breadcrumb",className:ee("s3-explr-ui-breadcrumb",e),...t}));Ba.displayName="Breadcrumb";const za=d.forwardRef(({className:e,...t},n)=>l.jsx("ol",{ref:n,className:ee("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}));za.displayName="BreadcrumbList";const Zo=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:ee("inline-flex items-center gap-1.5","s3-explr-ui-breadcrumb-item",e),...t}));Zo.displayName="BreadcrumbItem";const Qo=d.forwardRef(({asChild:e,className:t,...n},r)=>{const o=e?en:"a";return l.jsx(o,{ref:r,className:ee("transition-colors hover:text-foreground","s3-explr-ui-breadcrumb-link",t),...n})});Qo.displayName="BreadcrumbLink";const Jg=d.forwardRef(({className:e,...t},n)=>l.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:ee("font-normal text-foreground","s3-explr-ui-breadcrumb-page",e),...t}));Jg.displayName="BreadcrumbPage";const Ha=({children:e,className:t,...n})=>l.jsx("li",{role:"presentation","aria-hidden":"true",className:ee("[&>svg]:w-3.5 [&>svg]:h-3.5","s3-explr-ui-breadcrumb-separator",t),...n,children:e??l.jsx(Aa,{})});Ha.displayName="BreadcrumbSeparator";const Ua=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ja=Da,es=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return ja(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 h=Ua(f)||Ua(g);return o[c][h]}),a=n&&Object.entries(n).reduce((c,f)=>{let[g,h]=f;return h===void 0||(c[g]=h),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:g,className:h,...p}=f;return Object.entries(p).every(v=>{let[m,y]=v;return Array.isArray(y)?y.includes({...s,...a}[m]):{...s,...a}[m]===y})?[...c,g,h]:c},[]);return ja(e,i,u,n==null?void 0:n.class,n==null?void 0:n.className)},Wa=es("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"}}),ie=d.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?en:"button";return l.jsx(i,{className:ee(Wa({variant:t,size:n,className:e})),ref:s,...o})});ie.displayName="Button";function Yg(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function mr(...e){return t=>e.forEach(n=>Yg(n,t))}function Ue(...e){return d.useCallback(mr(...e),e)}function Zg(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 _t(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:h,children:p,...v}=g,m=((w=h==null?void 0:h[e])==null?void 0:w[u])||a,y=d.useMemo(()=>v,Object.values(v));return l.jsx(m.Provider,{value:y,children:p})};c.displayName=s+"Provider";function f(g,h){var m;const p=((m=h==null?void 0:h[e])==null?void 0:m[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,Qg(o,...t)]}function Qg(...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 ye(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 Ae(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 rn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=eh({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=Ae(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 eh({defaultProp:e,onChange:t}){const n=d.useState(e),[r]=n,o=d.useRef(r),s=Ae(t);return d.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}function th(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 Re=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{};function Ga(e){const[t,n]=d.useState(void 0);return Re(()=>{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 nh(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var on=e=>{const{present:t,children:n}=e,r=rh(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=Ue(r.ref,oh(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};on.displayName="Presence";function rh(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=nh(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=vr(r.current);s.current=a==="mounted"?c:"none"},[a]),Re(()=>{const c=r.current,f=o.current;if(f!==e){const h=s.current,p=vr(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Re(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const m=vr(r.current).includes(p.animationName);if(p.target===t&&m&&(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)})}},h=p=>{p.target===t&&(s.current=vr(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",h),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 vr(e){return(e==null?void 0:e.animationName)||"none"}function oh(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 qa=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(ih);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(ts,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(ts,{...r,ref:t,children:n})});qa.displayName="Slot";var ts=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=lh(n);return d.cloneElement(n,{...ah(r,n.props),ref:t?mr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});ts.displayName="SlotClone";var sh=({children:e})=>l.jsx(l.Fragment,{children:e});function ih(e){return d.isValidElement(e)&&e.type===sh}function ah(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 lh(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 ch=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],we=ch.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?qa: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&&Qn.flushSync(()=>e.dispatchEvent(t))}var ns="Checkbox",[uh,pC]=_t(ns),[dh,fh]=uh(ns),Xa=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,[h,p]=d.useState(null),v=Ue(t,E=>p(E)),m=d.useRef(!1),y=h?f||!!h.closest("form"):!0,[w=!1,b]=rn({prop:o,defaultProp:s,onChange:c}),S=d.useRef(w);return d.useEffect(()=>{const E=h==null?void 0:h.form;if(E){const x=()=>b(S.current);return E.addEventListener("reset",x),()=>E.removeEventListener("reset",x)}},[h,b]),l.jsxs(dh,{scope:n,state:w,disabled:a,children:[l.jsx(we.button,{type:"button",role:"checkbox","aria-checked":Ft(w)?"mixed":w,"aria-required":i,"data-state":Za(w),"data-disabled":a?"":void 0,disabled:a,value:u,...g,ref:v,onKeyDown:ye(e.onKeyDown,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:ye(e.onClick,E=>{b(x=>Ft(x)?!0:!x),y&&(m.current=E.isPropagationStopped(),m.current||E.stopPropagation())})}),y&&l.jsx(ph,{control:h,bubbles:!m.current,name:r,value:u,checked:w,required:i,disabled:a,form:f,style:{transform:"translateX(-100%)"},defaultChecked:Ft(s)?!1:s})]})});Xa.displayName=ns;var Ja="CheckboxIndicator",Ya=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=fh(Ja,n);return l.jsx(on,{present:r||Ft(s.state)||s.state===!0,children:l.jsx(we.span,{"data-state":Za(s.state),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Ya.displayName=Ja;var ph=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...s}=e,i=d.useRef(null),a=th(n),u=Ga(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=Ft(n),p.call(f,Ft(n)?!1:n),f.dispatchEvent(v)}},[a,n,r]);const c=d.useRef(Ft(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 Ft(e){return e==="indeterminate"}function Za(e){return Ft(e)?"indeterminate":e?"checked":"unchecked"}var Qa=Xa,gh=Ya;const rs=d.forwardRef(({className:e,...t},n)=>l.jsx(Qa,{ref:n,className:ee("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(gh,{className:ee("s3-explr-ui-checkbox-indicator flex items-center justify-center text-current"),children:l.jsx(og,{className:"s3-explr-ui-checkbox-check h-4 w-4"})})}));rs.displayName=Qa.displayName;var hh=d.useId||(()=>{}),mh=0;function sn(e){const[t,n]=d.useState(hh());return Re(()=>{e||n(r=>r??String(mh++))},[e]),e||(t?`radix-${t}`:"")}function el(e,t=globalThis==null?void 0:globalThis.document){const n=Ae(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 vh="DismissableLayer",os="dismissableLayer.update",yh="dismissableLayer.pointerDownOutside",wh="dismissableLayer.focusOutside",tl,nl=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ss=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,c=d.useContext(nl),[f,g]=d.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=d.useState({}),v=Ue(t,F=>g(F)),m=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=m.indexOf(y),b=f?m.indexOf(f):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,E=b>=w,x=xh(F=>{const O=F.target,k=[...c.branches].some(D=>D.contains(O));!E||k||(o==null||o(F),i==null||i(F),F.defaultPrevented||a==null||a())},h),P=Ch(F=>{const O=F.target;[...c.branches].some(D=>D.contains(O))||(s==null||s(F),i==null||i(F),F.defaultPrevented||a==null||a())},h);return el(F=>{b===c.layers.size-1&&(r==null||r(F),!F.defaultPrevented&&a&&(F.preventDefault(),a()))},h),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(tl=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),ol(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=tl)}},[f,h,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),ol())},[f,c]),d.useEffect(()=>{const F=()=>p({});return document.addEventListener(os,F),()=>document.removeEventListener(os,F)},[]),l.jsx(we.div,{...u,ref:v,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:ye(e.onFocusCapture,P.onFocusCapture),onBlurCapture:ye(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:ye(e.onPointerDownCapture,x.onPointerDownCapture)})});ss.displayName=vh;var bh="DismissableLayerBranch",rl=d.forwardRef((e,t)=>{const n=d.useContext(nl),r=d.useRef(null),o=Ue(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(we.div,{...e,ref:o})});rl.displayName=bh;function xh(e,t=globalThis==null?void 0:globalThis.document){const n=Ae(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){sl(yh,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 Ch(e,t=globalThis==null?void 0:globalThis.document){const n=Ae(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&sl(wh,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 ol(){const e=new CustomEvent(os);document.dispatchEvent(e)}function sl(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 Sh=ss,Eh=rl,is="focusScope.autoFocusOnMount",as="focusScope.autoFocusOnUnmount",il={bubbles:!1,cancelable:!0},Nh="FocusScope",al=d.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,u]=d.useState(null),c=Ae(o),f=Ae(s),g=d.useRef(null),h=Ue(t,m=>u(m)),p=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let m=function(S){if(p.paused||!a)return;const E=S.target;a.contains(E)?g.current=E:Ot(g.current,{select:!0})},y=function(S){if(p.paused||!a)return;const E=S.relatedTarget;E!==null&&(a.contains(E)||Ot(g.current,{select:!0}))},w=function(S){if(document.activeElement===document.body)for(const x of S)x.removedNodes.length>0&&Ot(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const b=new MutationObserver(w);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),b.disconnect()}}},[r,a,p.paused]),d.useEffect(()=>{if(a){ul.add(p);const m=document.activeElement;if(!a.contains(m)){const w=new CustomEvent(is,il);a.addEventListener(is,c),a.dispatchEvent(w),w.defaultPrevented||(Th(Oh(ll(a)),{select:!0}),document.activeElement===m&&Ot(a))}return()=>{a.removeEventListener(is,c),setTimeout(()=>{const w=new CustomEvent(as,il);a.addEventListener(as,f),a.dispatchEvent(w),w.defaultPrevented||Ot(m??document.body,{select:!0}),a.removeEventListener(as,f),ul.remove(p)},0)}}},[a,c,f,p]);const v=d.useCallback(m=>{if(!n&&!r||p.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,w=document.activeElement;if(y&&w){const b=m.currentTarget,[S,E]=Ph(b);S&&E?!m.shiftKey&&w===E?(m.preventDefault(),n&&Ot(S,{select:!0})):m.shiftKey&&w===S&&(m.preventDefault(),n&&Ot(E,{select:!0})):w===b&&m.preventDefault()}},[n,r,p.paused]);return l.jsx(we.div,{tabIndex:-1,...i,ref:h,onKeyDown:v})});al.displayName=Nh;function Th(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ot(r,{select:t}),document.activeElement!==n)return}function Ph(e){const t=ll(e),n=cl(t,e),r=cl(t.reverse(),e);return[n,r]}function ll(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 cl(e,t){for(const n of e)if(!Ah(n,{upTo:t}))return n}function Ah(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 _h(e){return e instanceof HTMLInputElement&&"select"in e}function Ot(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&_h(e)&&t&&e.select()}}var ul=Fh();function Fh(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=dl(e,t),e.unshift(t)},remove(t){var n;e=dl(e,t),(n=e[0])==null||n.resume()}}}function dl(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Oh(e){return e.filter(t=>t.tagName!=="A")}var Dh="Portal",ls=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);Re(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?po.createPortal(l.jsx(we.div,{...r,ref:t}),i):null});ls.displayName=Dh;var cs=0;function Mh(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??fl()),document.body.insertAdjacentElement("beforeend",e[1]??fl()),cs++,()=>{cs===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),cs--}},[])}function fl(){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 ot=function(){return ot=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},ot.apply(this,arguments)};function pl(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 gl(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 hl(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 yr="right-scroll-bar-position",wr="width-before-scroll-bar",Ih="with-scroll-bars-hidden",kh="--removed-body-scroll-bar-size";function us(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function $h(e,t){var n=A.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 Lh=typeof window<"u"?d.useLayoutEffect:d.useEffect,ml=new WeakMap;function Rh(e,t){var n=$h(null,function(r){return e.forEach(function(o){return us(o,r)})});return Lh(function(){var r=ml.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||us(a,null)}),s.forEach(function(a){o.has(a)||us(a,i)})}ml.set(n,e)},[e]),n}function Vh(e){return e}function Bh(e,t){t===void 0&&(t=Vh);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 zh(e){e===void 0&&(e={});var t=Bh(null);return t.options=ot({async:!0,ssr:!1},e),t}var vl=function(e){var t=e.sideCar,n=pl(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,ot({},n))};vl.isSideCarExport=!0;function Hh(e,t){return e.useMedium(t),vl}var yl=zh(),ds=function(){},br=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:ds,onWheelCapture:ds,onTouchMoveCapture:ds}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,u=e.className,c=e.removeScrollBar,f=e.enabled,g=e.shards,h=e.sideCar,p=e.noIsolation,v=e.inert,m=e.allowPinchZoom,y=e.as,w=y===void 0?"div":y,b=e.gapMode,S=pl(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=h,x=Rh([n,t]),P=ot(ot({},S),o);return d.createElement(d.Fragment,null,f&&d.createElement(E,{sideCar:yl,removeScrollBar:c,shards:g,noIsolation:p,inert:v,setCallbacks:s,allowPinchZoom:!!m,lockRef:n,gapMode:b}),i?d.cloneElement(d.Children.only(a),ot(ot({},P),{ref:x})):d.createElement(w,ot({},P,{className:u,ref:x}),a))});br.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},br.classNames={fullWidth:wr,zeroRight:yr};var Uh=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function jh(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Uh();return t&&e.setAttribute("nonce",t),e}function Wh(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Gh(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var qh=function(){var e=0,t=null;return{add:function(n){e==0&&(t=jh())&&(Wh(t,n),Gh(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Kh=function(){var e=qh();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},wl=function(){var e=Kh(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Xh={left:0,top:0,right:0,gap:0},fs=function(e){return parseInt(e||"",10)||0},Jh=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[fs(n),fs(r),fs(o)]},Yh=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Xh;var t=Jh(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])}},Zh=wl(),an="data-scroll-locked",Qh=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
108
|
-
.`.concat(
|
|
107
|
+
*/const ls=Ge("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Pg={category:"Thư mục gốc",fileName:"Tên tệp",fullPath:"Đường dẫn đầy đủ",createAt:"Ngày tạo",creator:"Người tạo",creatorId:"ID người tạo",DataSource:"Nguồn dữ liệu",SuggestedAICategories:"Danh mục AI gợi ý",KeywordAISuggestion:"Từ khóa AI gợi ý",SummaryOfSuggestedAI:"Tóm tắt AI gợi ý",AccessLevel:"Cấp độ truy cập"},Ag=e=>e==="SummaryOfSuggestedAI"||e==="KeywordAISuggestion"||e==="SuggestedAICategories",cs=e=>e==="fullPath"||e==="createAt"||e==="creator"||e==="creatorId"||e==="DataSource"||e==="AccessLevel"||e==="category"||e==="fileName";function Ba(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function _g(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Ba(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():Ba(e[o],null)}}}}var sn=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Fg);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})});sn.displayName="Slot";var us=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Dg(n);return d.cloneElement(n,{...Og(r,n.props),ref:t?_g(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});us.displayName="SlotClone";var Ha=({children:e})=>l.jsx(l.Fragment,{children:e});function Fg(e){return d.isValidElement(e)&&e.type===Ha}function Og(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 Dg(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 za(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=za(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ua(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=za(e))&&(r&&(r+=" "),r+=t);return r}const ds="-",Mg=e=>{const t=$g(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(ds);return a[0]===""&&a.length!==1&&a.shift(),ja(a,t)||Ig(i)},getConflictingClassGroupIds:(i,a)=>{const u=n[i]||[];return a&&r[i]?[...u,...r[i]]:u}}},ja=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?ja(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(ds);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},Wa=/^\[(.+)\]$/,Ig=e=>{if(Wa.test(e)){const t=Wa.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},$g=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Lg(Object.entries(e.classGroups),n).forEach(([s,i])=>{fs(i,r,s,t)}),r},fs=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Ga(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(kg(o)){fs(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{fs(i,Ga(t,s),n,r)})})},Ga=(e,t)=>{let n=e;return t.split(ds).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},kg=e=>e.isThemeGetter,Lg=(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)}}},qa="!",Vg=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(qa),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},Bg=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},Hg=e=>({cache:Rg(e.cacheSize),parseClassName:Vg(e),...Mg(e)}),zg=/\s+/,Ug=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(zg);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=Bg(f).join(":"),w=g?y+qa:y,b=w+h;if(s.includes(b))continue;s.push(b);const S=o(h,v);for(let E=0;E<S.length;++E){const x=S[E];s.push(w+x)}a=c+(a.length>0?" "+a:a)}return a};function jg(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Ka(t))&&(r&&(r+=" "),r+=n);return r}const Ka=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ka(e[r]))&&(n&&(n+=" "),n+=t);return n};function Wg(e,...t){let n,r,o,s=i;function i(u){const c=t.reduce((f,g)=>g(f),e());return n=Hg(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=Ug(u,n);return o(u,f),f}return function(){return s(jg.apply(null,arguments))}}const de=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Xa=/^\[(?:([a-z-]+):)?(.+)\]$/i,Gg=/^\d+\/\d+$/,qg=new Set(["px","full","screen"]),Kg=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Xg=/\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$/,Jg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Yg=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ct=e=>an(e)||qg.has(e)||Gg.test(e),Ft=e=>ln(e,"length",ih),an=e=>!!e&&!Number.isNaN(Number(e)),ps=e=>ln(e,"number",an),Rn=e=>!!e&&Number.isInteger(Number(e)),Qg=e=>e.endsWith("%")&&an(e.slice(0,-1)),se=e=>Xa.test(e),Ot=e=>Kg.test(e),eh=new Set(["length","size","percentage"]),th=e=>ln(e,eh,Ja),nh=e=>ln(e,"position",Ja),rh=new Set(["image","url"]),oh=e=>ln(e,rh,lh),sh=e=>ln(e,"",ah),Vn=()=>!0,ln=(e,t,n)=>{const r=Xa.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},ih=e=>Xg.test(e)&&!Jg.test(e),Ja=()=>!1,ah=e=>Yg.test(e),lh=e=>Zg.test(e),ch=Wg(()=>{const e=de("colors"),t=de("spacing"),n=de("blur"),r=de("brightness"),o=de("borderColor"),s=de("borderRadius"),i=de("borderSpacing"),a=de("borderWidth"),u=de("contrast"),c=de("grayscale"),f=de("hueRotate"),g=de("invert"),m=de("gap"),p=de("gradientColorStops"),v=de("gradientColorStopPositions"),h=de("inset"),y=de("margin"),w=de("opacity"),b=de("padding"),S=de("saturate"),E=de("scale"),x=de("sepia"),_=de("skew"),O=de("space"),D=de("translate"),$=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],K=()=>["auto",se,t],k=()=>[se,t],U=()=>["",Ct,Ft],R=()=>["auto",an,se],J=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],q=()=>["solid","dashed","dotted","double","none"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],H=()=>["start","end","center","between","around","evenly","stretch"],j=()=>["","0",se],le=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ce=()=>[an,se];return{cacheSize:500,separator:":",theme:{colors:[Vn],spacing:[Ct,Ft],blur:["none","",Ot,se],brightness:ce(),borderColor:[e],borderRadius:["none","","full",Ot,se],borderSpacing:k(),borderWidth:U(),contrast:ce(),grayscale:j(),hueRotate:ce(),invert:j(),gap:k(),gradientColorStops:[e],gradientColorStopPositions:[Qg,Ft],inset:K(),margin:K(),opacity:ce(),padding:k(),saturate:ce(),scale:ce(),sepia:j(),skew:ce(),space:k(),translate:k()},classGroups:{aspect:[{aspect:["auto","square","video",se]}],container:["container"],columns:[{columns:[Ot]}],"break-after":[{"break-after":le()}],"break-before":[{"break-before":le()}],"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:[...J(),se]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],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",Rn,se]}],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",se]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",Rn,se]}],"grid-cols":[{"grid-cols":[Vn]}],"col-start-end":[{col:["auto",{span:["full",Rn,se]},se]}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":[Vn]}],"row-start-end":[{row:["auto",{span:[Rn,se]},se]}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",se]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",se]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...H()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...H(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...H(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],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":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",se,t]}],"min-w":[{"min-w":[se,t,"min","max","fit"]}],"max-w":[{"max-w":[se,t,"none","full","min","max","fit","prose",{screen:[Ot]},Ot]}],h:[{h:[se,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[se,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[se,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[se,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ot,Ft]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ps]}],"font-family":[{font:[Vn]}],"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",se]}],"line-clamp":[{"line-clamp":["none",an,ps]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ct,se]}],"list-image":[{"list-image":["none",se]}],"list-style-type":[{list:["none","disc","decimal",se]}],"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:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ct,Ft]}],"underline-offset":[{"underline-offset":["auto",Ct,se]}],"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",se]}],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",se]}],"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:[...J(),nh]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",th]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},oh]}],"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:[...q(),"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:q()}],"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:["",...q()]}],"outline-offset":[{"outline-offset":[Ct,se]}],"outline-w":[{outline:[Ct,Ft]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[Ct,Ft]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ot,sh]}],"shadow-color":[{shadow:[Vn]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...te(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":te()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Ot,se]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[g]}],saturate:[{saturate:[S]}],sepia:[{sepia:[x]}],"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":[x]}],"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",se]}],duration:[{duration:ce()}],ease:[{ease:["linear","in","out","in-out",se]}],delay:[{delay:ce()}],animate:[{animate:["none","spin","ping","pulse","bounce",se]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Rn,se]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",se]}],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",se]}],"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",se]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ct,Ft,ps]}],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 ee(...e){return ch(Ua(e))}const uh=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]}`},Ya=d.forwardRef(({className:e,...t},n)=>l.jsx("nav",{ref:n,"aria-label":"breadcrumb",className:ee("s3-explr-ui-breadcrumb",e),...t}));Ya.displayName="Breadcrumb";const Za=d.forwardRef(({className:e,...t},n)=>l.jsx("ol",{ref:n,className:ee("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}));Za.displayName="BreadcrumbList";const gs=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:ee("inline-flex items-center gap-1.5","s3-explr-ui-breadcrumb-item",e),...t}));gs.displayName="BreadcrumbItem";const hs=d.forwardRef(({asChild:e,className:t,...n},r)=>{const o=e?sn:"a";return l.jsx(o,{ref:r,className:ee("transition-colors hover:text-foreground","s3-explr-ui-breadcrumb-link",t),...n})});hs.displayName="BreadcrumbLink";const dh=d.forwardRef(({className:e,...t},n)=>l.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:ee("font-normal text-foreground","s3-explr-ui-breadcrumb-page",e),...t}));dh.displayName="BreadcrumbPage";const Qa=({children:e,className:t,...n})=>l.jsx("li",{role:"presentation","aria-hidden":"true",className:ee("[&>svg]:w-3.5 [&>svg]:h-3.5","s3-explr-ui-breadcrumb-separator",t),...n,children:e??l.jsx(Va,{})});Qa.displayName="BreadcrumbSeparator";const el=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,tl=Ua,ms=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return tl(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=el(f)||el(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 tl(e,i,u,n==null?void 0:n.class,n==null?void 0:n.className)},nl=ms("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"}}),ie=d.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?sn:"button";return l.jsx(i,{className:ee(nl({variant:t,size:n,className:e})),ref:s,...o})});ie.displayName="Button";function fh(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Nr(...e){return t=>e.forEach(n=>fh(n,t))}function qe(...e){return d.useCallback(Nr(...e),e)}function ph(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 Dt(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,gh(o,...t)]}function gh(...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 ye(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 _e(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 cn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=hh({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=_e(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 hh({defaultProp:e,onChange:t}){const n=d.useState(e),[r]=n,o=d.useRef(r),s=_e(t);return d.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}function mh(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 Be=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{};function rl(e){const[t,n]=d.useState(void 0);return Be(()=>{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 vh(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var un=e=>{const{present:t,children:n}=e,r=yh(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=qe(r.ref,wh(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};un.displayName="Presence";function yh(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=vh(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=Tr(r.current);s.current=a==="mounted"?c:"none"},[a]),Be(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,p=Tr(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]),Be(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const h=Tr(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=Tr(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 Tr(e){return(e==null?void 0:e.animationName)||"none"}function wh(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 ol=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(xh);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})});ol.displayName="Slot";var vs=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Sh(n);return d.cloneElement(n,{...Ch(r,n.props),ref:t?Nr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});vs.displayName="SlotClone";var bh=({children:e})=>l.jsx(l.Fragment,{children:e});function xh(e){return d.isValidElement(e)&&e.type===bh}function Ch(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 Sh(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 Eh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],we=Eh.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?ol: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 sl(e,t){e&&lr.flushSync(()=>e.dispatchEvent(t))}var ys="Checkbox",[Nh,FC]=Dt(ys),[Th,Ph]=Nh(ys),il=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=qe(t,E=>p(E)),h=d.useRef(!1),y=m?f||!!m.closest("form"):!0,[w=!1,b]=cn({prop:o,defaultProp:s,onChange:c}),S=d.useRef(w);return d.useEffect(()=>{const E=m==null?void 0:m.form;if(E){const x=()=>b(S.current);return E.addEventListener("reset",x),()=>E.removeEventListener("reset",x)}},[m,b]),l.jsxs(Th,{scope:n,state:w,disabled:a,children:[l.jsx(we.button,{type:"button",role:"checkbox","aria-checked":Mt(w)?"mixed":w,"aria-required":i,"data-state":cl(w),"data-disabled":a?"":void 0,disabled:a,value:u,...g,ref:v,onKeyDown:ye(e.onKeyDown,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:ye(e.onClick,E=>{b(x=>Mt(x)?!0:!x),y&&(h.current=E.isPropagationStopped(),h.current||E.stopPropagation())})}),y&&l.jsx(Ah,{control:m,bubbles:!h.current,name:r,value:u,checked:w,required:i,disabled:a,form:f,style:{transform:"translateX(-100%)"},defaultChecked:Mt(s)?!1:s})]})});il.displayName=ys;var al="CheckboxIndicator",ll=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=Ph(al,n);return l.jsx(un,{present:r||Mt(s.state)||s.state===!0,children:l.jsx(we.span,{"data-state":cl(s.state),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});ll.displayName=al;var Ah=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...s}=e,i=d.useRef(null),a=mh(n),u=rl(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=Mt(n),p.call(f,Mt(n)?!1:n),f.dispatchEvent(v)}},[a,n,r]);const c=d.useRef(Mt(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 Mt(e){return e==="indeterminate"}function cl(e){return Mt(e)?"indeterminate":e?"checked":"unchecked"}var ul=il,_h=ll;const ws=d.forwardRef(({className:e,...t},n)=>l.jsx(ul,{ref:n,className:ee("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(_h,{className:ee("s3-explr-ui-checkbox-indicator flex items-center justify-center text-current"),children:l.jsx(bg,{className:"s3-explr-ui-checkbox-check h-4 w-4"})})}));ws.displayName=ul.displayName;var Fh=d.useId||(()=>{}),Oh=0;function dn(e){const[t,n]=d.useState(Fh());return Be(()=>{e||n(r=>r??String(Oh++))},[e]),e||(t?`radix-${t}`:"")}function dl(e,t=globalThis==null?void 0:globalThis.document){const n=_e(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 Dh="DismissableLayer",bs="dismissableLayer.update",Mh="dismissableLayer.pointerDownOutside",Ih="dismissableLayer.focusOutside",fl,pl=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),xs=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,c=d.useContext(pl),[f,g]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=d.useState({}),v=qe(t,O=>g(O)),h=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=h.indexOf(y),b=f?h.indexOf(f):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,E=b>=w,x=kh(O=>{const D=O.target,$=[...c.branches].some(M=>M.contains(D));!E||$||(o==null||o(O),i==null||i(O),O.defaultPrevented||a==null||a())},m),_=Lh(O=>{const D=O.target;[...c.branches].some(M=>M.contains(D))||(s==null||s(O),i==null||i(O),O.defaultPrevented||a==null||a())},m);return dl(O=>{b===c.layers.size-1&&(r==null||r(O),!O.defaultPrevented&&a&&(O.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(fl=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),hl(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=fl)}},[f,m,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),hl())},[f,c]),d.useEffect(()=>{const O=()=>p({});return document.addEventListener(bs,O),()=>document.removeEventListener(bs,O)},[]),l.jsx(we.div,{...u,ref:v,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:ye(e.onFocusCapture,_.onFocusCapture),onBlurCapture:ye(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:ye(e.onPointerDownCapture,x.onPointerDownCapture)})});xs.displayName=Dh;var $h="DismissableLayerBranch",gl=d.forwardRef((e,t)=>{const n=d.useContext(pl),r=d.useRef(null),o=qe(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(we.div,{...e,ref:o})});gl.displayName=$h;function kh(e,t=globalThis==null?void 0:globalThis.document){const n=_e(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){ml(Mh,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 Lh(e,t=globalThis==null?void 0:globalThis.document){const n=_e(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&ml(Ih,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 hl(){const e=new CustomEvent(bs);document.dispatchEvent(e)}function ml(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?sl(o,s):o.dispatchEvent(s)}var Rh=xs,Vh=gl,Cs="focusScope.autoFocusOnMount",Ss="focusScope.autoFocusOnUnmount",vl={bubbles:!1,cancelable:!0},Bh="FocusScope",yl=d.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,u]=d.useState(null),c=_e(o),f=_e(s),g=d.useRef(null),m=qe(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:It(g.current,{select:!0})},y=function(S){if(p.paused||!a)return;const E=S.relatedTarget;E!==null&&(a.contains(E)||It(g.current,{select:!0}))},w=function(S){if(document.activeElement===document.body)for(const x of S)x.removedNodes.length>0&&It(a)};document.addEventListener("focusin",h),document.addEventListener("focusout",y);const b=new MutationObserver(w);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),b.disconnect()}}},[r,a,p.paused]),d.useEffect(()=>{if(a){xl.add(p);const h=document.activeElement;if(!a.contains(h)){const w=new CustomEvent(Cs,vl);a.addEventListener(Cs,c),a.dispatchEvent(w),w.defaultPrevented||(Hh(Gh(wl(a)),{select:!0}),document.activeElement===h&&It(a))}return()=>{a.removeEventListener(Cs,c),setTimeout(()=>{const w=new CustomEvent(Ss,vl);a.addEventListener(Ss,f),a.dispatchEvent(w),w.defaultPrevented||It(h??document.body,{select:!0}),a.removeEventListener(Ss,f),xl.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 b=h.currentTarget,[S,E]=zh(b);S&&E?!h.shiftKey&&w===E?(h.preventDefault(),n&&It(S,{select:!0})):h.shiftKey&&w===S&&(h.preventDefault(),n&&It(E,{select:!0})):w===b&&h.preventDefault()}},[n,r,p.paused]);return l.jsx(we.div,{tabIndex:-1,...i,ref:m,onKeyDown:v})});yl.displayName=Bh;function Hh(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(It(r,{select:t}),document.activeElement!==n)return}function zh(e){const t=wl(e),n=bl(t,e),r=bl(t.reverse(),e);return[n,r]}function wl(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 bl(e,t){for(const n of e)if(!Uh(n,{upTo:t}))return n}function Uh(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 jh(e){return e instanceof HTMLInputElement&&"select"in e}function It(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&jh(e)&&t&&e.select()}}var xl=Wh();function Wh(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Cl(e,t),e.unshift(t)},remove(t){var n;e=Cl(e,t),(n=e[0])==null||n.resume()}}}function Cl(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Gh(e){return e.filter(t=>t.tagName!=="A")}var qh="Portal",Es=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);Be(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?_o.createPortal(l.jsx(we.div,{...r,ref:t}),i):null});Es.displayName=qh;var Ns=0;function Kh(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Sl()),document.body.insertAdjacentElement("beforeend",e[1]??Sl()),Ns++,()=>{Ns===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ns--}},[])}function Sl(){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 lt=function(){return lt=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},lt.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 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 Tl(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 Pr="right-scroll-bar-position",Ar="width-before-scroll-bar",Xh="with-scroll-bars-hidden",Jh="--removed-body-scroll-bar-size";function Ts(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Yh(e,t){var n=T.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 Zh=typeof window<"u"?d.useLayoutEffect:d.useEffect,Pl=new WeakMap;function Qh(e,t){var n=Yh(null,function(r){return e.forEach(function(o){return Ts(o,r)})});return Zh(function(){var r=Pl.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Ts(a,null)}),s.forEach(function(a){o.has(a)||Ts(a,i)})}Pl.set(n,e)},[e]),n}function em(e){return e}function tm(e,t){t===void 0&&(t=em);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 nm(e){e===void 0&&(e={});var t=tm(null);return t.options=lt({async:!0,ssr:!1},e),t}var Al=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,lt({},n))};Al.isSideCarExport=!0;function rm(e,t){return e.useMedium(t),Al}var _l=nm(),Ps=function(){},_r=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:Ps,onWheelCapture:Ps,onTouchMoveCapture:Ps}),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,b=e.gapMode,S=El(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=m,x=Qh([n,t]),_=lt(lt({},S),o);return d.createElement(d.Fragment,null,f&&d.createElement(E,{sideCar:_l,removeScrollBar:c,shards:g,noIsolation:p,inert:v,setCallbacks:s,allowPinchZoom:!!h,lockRef:n,gapMode:b}),i?d.cloneElement(d.Children.only(a),lt(lt({},_),{ref:x})):d.createElement(w,lt({},_,{className:u,ref:x}),a))});_r.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},_r.classNames={fullWidth:Ar,zeroRight:Pr};var om=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function sm(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=om();return t&&e.setAttribute("nonce",t),e}function im(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function am(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var lm=function(){var e=0,t=null;return{add:function(n){e==0&&(t=sm())&&(im(t,n),am(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},cm=function(){var e=lm();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Fl=function(){var e=cm(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},um={left:0,top:0,right:0,gap:0},As=function(e){return parseInt(e||"",10)||0},dm=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[As(n),As(r),As(o)]},fm=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return um;var t=dm(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])}},pm=Fl(),fn="data-scroll-locked",gm=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
108
|
+
.`.concat(Xh,` {
|
|
109
109
|
overflow: hidden `).concat(r,`;
|
|
110
110
|
padding-right: `).concat(a,"px ").concat(r,`;
|
|
111
111
|
}
|
|
112
|
-
body[`).concat(
|
|
112
|
+
body[`).concat(fn,`] {
|
|
113
113
|
overflow: hidden `).concat(r,`;
|
|
114
114
|
overscroll-behavior: contain;
|
|
115
115
|
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
@@ -122,32 +122,32 @@
|
|
|
122
122
|
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
.`).concat(
|
|
125
|
+
.`).concat(Pr,` {
|
|
126
126
|
right: `).concat(a,"px ").concat(r,`;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
.`).concat(
|
|
129
|
+
.`).concat(Ar,` {
|
|
130
130
|
margin-right: `).concat(a,"px ").concat(r,`;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
.`).concat(
|
|
133
|
+
.`).concat(Pr," .").concat(Pr,` {
|
|
134
134
|
right: 0 `).concat(r,`;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
.`).concat(
|
|
137
|
+
.`).concat(Ar," .").concat(Ar,` {
|
|
138
138
|
margin-right: 0 `).concat(r,`;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
body[`).concat(
|
|
142
|
-
`).concat(
|
|
141
|
+
body[`).concat(fn,`] {
|
|
142
|
+
`).concat(Jh,": ").concat(a,`px;
|
|
143
143
|
}
|
|
144
|
-
`)},
|
|
144
|
+
`)},Ol=function(){var e=parseInt(document.body.getAttribute(fn)||"0",10);return isFinite(e)?e:0},hm=function(){d.useEffect(function(){return document.body.setAttribute(fn,(Ol()+1).toString()),function(){var e=Ol()-1;e<=0?document.body.removeAttribute(fn):document.body.setAttribute(fn,e.toString())}},[])},mm=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;hm();var s=d.useMemo(function(){return fm(o)},[o]);return d.createElement(pm,{styles:gm(s,!t,o,n?"":"!important")})},_s=!1;if(typeof window<"u")try{var Fr=Object.defineProperty({},"passive",{get:function(){return _s=!0,!0}});window.addEventListener("test",Fr,Fr),window.removeEventListener("test",Fr,Fr)}catch{_s=!1}var pn=_s?{passive:!1}:!1,vm=function(e){return e.tagName==="TEXTAREA"},Dl=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!vm(e)&&n[t]==="visible")},ym=function(e){return Dl(e,"overflowY")},wm=function(e){return Dl(e,"overflowX")},Ml=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Il(e,r);if(o){var s=$l(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},bm=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},xm=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Il=function(e,t){return e==="v"?ym(t):wm(t)},$l=function(e,t){return e==="v"?bm(t):xm(t)},Cm=function(e,t){return e==="h"&&t==="rtl"?-1:1},Sm=function(e,t,n,r,o){var s=Cm(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=$l(e,a),v=p[0],h=p[1],y=p[2],w=h-y-s*v;(v||w)&&Il(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},Or=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},kl=function(e){return[e.deltaX,e.deltaY]},Ll=function(e){return e&&"current"in e?e.current:e},Em=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Nm=function(e){return`
|
|
145
145
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
146
146
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
147
|
-
`)},dm=0,cn=[];function fm(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(dm++)[0],s=d.useState(wl)[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 m=hl([e.lockRef.current],(e.shards||[]).map(Tl),!0).filter(Boolean);return m.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=d.useCallback(function(m,y){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!i.current.allowPinchZoom;var w=Cr(m),b=n.current,S="deltaX"in m?m.deltaX:b[0]-w[0],E="deltaY"in m?m.deltaY:b[1]-w[1],x,P=m.target,F=Math.abs(S)>Math.abs(E)?"h":"v";if("touches"in m&&F==="h"&&P.type==="range")return!1;var O=Cl(F,P);if(!O)return!0;if(O?x=F:(x=F==="v"?"h":"v",O=Cl(F,P)),!O)return!1;if(!r.current&&"changedTouches"in m&&(S||E)&&(r.current=x),!x)return!0;var k=r.current||x;return lm(k,y,m,k==="h"?S:E,!0)},[]),u=d.useCallback(function(m){var y=m;if(!(!cn.length||cn[cn.length-1]!==s)){var w="deltaY"in y?Nl(y):Cr(y),b=t.current.filter(function(x){return x.name===y.type&&(x.target===y.target||y.target===x.shadowParent)&&cm(x.delta,w)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var S=(i.current.shards||[]).map(Tl).filter(Boolean).filter(function(x){return x.contains(y.target)}),E=S.length>0?a(y,S[0]):!i.current.noIsolation;E&&y.cancelable&&y.preventDefault()}}},[]),c=d.useCallback(function(m,y,w,b){var S={name:m,delta:y,target:w,should:b,shadowParent:pm(w)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(E){return E!==S})},1)},[]),f=d.useCallback(function(m){n.current=Cr(m),r.current=void 0},[]),g=d.useCallback(function(m){c(m.type,Nl(m),m.target,a(m,e.lockRef.current))},[]),h=d.useCallback(function(m){c(m.type,Cr(m),m.target,a(m,e.lockRef.current))},[]);d.useEffect(function(){return cn.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:h}),document.addEventListener("wheel",u,ln),document.addEventListener("touchmove",u,ln),document.addEventListener("touchstart",f,ln),function(){cn=cn.filter(function(m){return m!==s}),document.removeEventListener("wheel",u,ln),document.removeEventListener("touchmove",u,ln),document.removeEventListener("touchstart",f,ln)}},[]);var p=e.removeScrollBar,v=e.inert;return d.createElement(d.Fragment,null,v?d.createElement(s,{styles:um(o)}):null,p?d.createElement(tm,{gapMode:e.gapMode}):null)}function pm(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const gm=Hh(yl,fm);var Pl=d.forwardRef(function(e,t){return d.createElement(br,ot({},e,{ref:t,sideCar:gm}))});Pl.classNames=br.classNames;var hm=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},un=new WeakMap,Sr=new WeakMap,Er={},gs=0,Al=function(e){return e&&(e.host||Al(e.parentNode))},mm=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Al(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})},vm=function(e,t,n,r){var o=mm(t,Array.isArray(e)?e:[e]);Er[n]||(Er[n]=new WeakMap);var s=Er[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(h){if(a.has(h))f(h);else try{var p=h.getAttribute(r),v=p!==null&&p!=="false",m=(un.get(h)||0)+1,y=(s.get(h)||0)+1;un.set(h,m),s.set(h,y),i.push(h),m===1&&v&&Sr.set(h,!0),y===1&&h.setAttribute(n,"true"),v||h.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",h,w)}})};return f(t),a.clear(),gs++,function(){i.forEach(function(g){var h=un.get(g)-1,p=s.get(g)-1;un.set(g,h),s.set(g,p),h||(Sr.has(g)||g.removeAttribute(r),Sr.delete(g)),p||g.removeAttribute(n)}),gs--,gs||(un=new WeakMap,un=new WeakMap,Sr=new WeakMap,Er={})}},ym=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=hm(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),vm(r,o,n,"aria-hidden")):function(){return null}},_l=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(bm);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(hs,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(hs,{...r,ref:t,children:n})});_l.displayName="Slot";var hs=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Cm(n);return d.cloneElement(n,{...xm(r,n.props),ref:t?mr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});hs.displayName="SlotClone";var wm=({children:e})=>l.jsx(l.Fragment,{children:e});function bm(e){return d.isValidElement(e)&&e.type===wm}function xm(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 Cm(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 ms="Dialog",[Fl,gC]=_t(ms),[Sm,Xe]=Fl(ms),Ol=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]=rn({prop:r,defaultProp:o,onChange:s});return l.jsx(Sm,{scope:t,triggerRef:a,contentRef:u,contentId:sn(),titleId:sn(),descriptionId:sn(),open:c,onOpenChange:f,onOpenToggle:d.useCallback(()=>f(g=>!g),[f]),modal:i,children:n})};Ol.displayName=ms;var Dl="DialogTrigger",Ml=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Xe(Dl,n),s=Ue(t,o.triggerRef);return l.jsx(we.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ws(o.open),...r,ref:s,onClick:ye(e.onClick,o.onOpenToggle)})});Ml.displayName=Dl;var vs="DialogPortal",[Em,Il]=Fl(vs,{forceMount:void 0}),kl=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=Xe(vs,t);return l.jsx(Em,{scope:t,forceMount:n,children:d.Children.map(r,i=>l.jsx(on,{present:n||s.open,children:l.jsx(ls,{asChild:!0,container:o,children:i})}))})};kl.displayName=vs;var Nr="DialogOverlay",$l=d.forwardRef((e,t)=>{const n=Il(Nr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Xe(Nr,e.__scopeDialog);return s.modal?l.jsx(on,{present:r||s.open,children:l.jsx(Nm,{...o,ref:t})}):null});$l.displayName=Nr;var Nm=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Xe(Nr,n);return l.jsx(Pl,{as:_l,allowPinchZoom:!0,shards:[o.contentRef],children:l.jsx(we.div,{"data-state":ws(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),jt="DialogContent",Ll=d.forwardRef((e,t)=>{const n=Il(jt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Xe(jt,e.__scopeDialog);return l.jsx(on,{present:r||s.open,children:s.modal?l.jsx(Tm,{...o,ref:t}):l.jsx(Pm,{...o,ref:t})})});Ll.displayName=jt;var Tm=d.forwardRef((e,t)=>{const n=Xe(jt,e.__scopeDialog),r=d.useRef(null),o=Ue(t,n.contentRef,r);return d.useEffect(()=>{const s=r.current;if(s)return ym(s)},[]),l.jsx(Rl,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ye(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:ye(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:ye(e.onFocusOutside,s=>s.preventDefault())})}),Pm=d.forwardRef((e,t)=>{const n=Xe(jt,e.__scopeDialog),r=d.useRef(!1),o=d.useRef(!1);return l.jsx(Rl,{...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()}})}),Rl=d.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=Xe(jt,n),u=d.useRef(null),c=Ue(t,u);return Mh(),l.jsxs(l.Fragment,{children:[l.jsx(al,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(ss,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ws(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(Am,{titleId:a.titleId}),l.jsx(Fm,{contentRef:u,descriptionId:a.descriptionId})]})]})}),ys="DialogTitle",Vl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Xe(ys,n);return l.jsx(we.h2,{id:o.titleId,...r,ref:t})});Vl.displayName=ys;var Bl="DialogDescription",zl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Xe(Bl,n);return l.jsx(we.p,{id:o.descriptionId,...r,ref:t})});zl.displayName=Bl;var Hl="DialogClose",Ul=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Xe(Hl,n);return l.jsx(we.button,{type:"button",...r,ref:t,onClick:ye(e.onClick,()=>o.onOpenChange(!1))})});Ul.displayName=Hl;function ws(e){return e?"open":"closed"}var jl="DialogTitleWarning",[hC,Wl]=Zg(jl,{contentName:jt,titleName:ys,docsSlug:"dialog"}),Am=({titleId:e})=>{const t=Wl(jl),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
147
|
+
`)},Tm=0,gn=[];function Pm(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(Tm++)[0],s=d.useState(Fl)[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=Tl([e.lockRef.current],(e.shards||[]).map(Ll),!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=Or(h),b=n.current,S="deltaX"in h?h.deltaX:b[0]-w[0],E="deltaY"in h?h.deltaY:b[1]-w[1],x,_=h.target,O=Math.abs(S)>Math.abs(E)?"h":"v";if("touches"in h&&O==="h"&&_.type==="range")return!1;var D=Ml(O,_);if(!D)return!0;if(D?x=O:(x=O==="v"?"h":"v",D=Ml(O,_)),!D)return!1;if(!r.current&&"changedTouches"in h&&(S||E)&&(r.current=x),!x)return!0;var $=r.current||x;return Sm($,y,h,$==="h"?S:E,!0)},[]),u=d.useCallback(function(h){var y=h;if(!(!gn.length||gn[gn.length-1]!==s)){var w="deltaY"in y?kl(y):Or(y),b=t.current.filter(function(x){return x.name===y.type&&(x.target===y.target||y.target===x.shadowParent)&&Em(x.delta,w)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var S=(i.current.shards||[]).map(Ll).filter(Boolean).filter(function(x){return x.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,b){var S={name:h,delta:y,target:w,should:b,shadowParent:Am(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=Or(h),r.current=void 0},[]),g=d.useCallback(function(h){c(h.type,kl(h),h.target,a(h,e.lockRef.current))},[]),m=d.useCallback(function(h){c(h.type,Or(h),h.target,a(h,e.lockRef.current))},[]);d.useEffect(function(){return gn.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:m}),document.addEventListener("wheel",u,pn),document.addEventListener("touchmove",u,pn),document.addEventListener("touchstart",f,pn),function(){gn=gn.filter(function(h){return h!==s}),document.removeEventListener("wheel",u,pn),document.removeEventListener("touchmove",u,pn),document.removeEventListener("touchstart",f,pn)}},[]);var p=e.removeScrollBar,v=e.inert;return d.createElement(d.Fragment,null,v?d.createElement(s,{styles:Nm(o)}):null,p?d.createElement(mm,{gapMode:e.gapMode}):null)}function Am(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const _m=rm(_l,Pm);var Rl=d.forwardRef(function(e,t){return d.createElement(_r,lt({},e,{ref:t,sideCar:_m}))});Rl.classNames=_r.classNames;var Fm=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},hn=new WeakMap,Dr=new WeakMap,Mr={},Fs=0,Vl=function(e){return e&&(e.host||Vl(e.parentNode))},Om=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Vl(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})},Dm=function(e,t,n,r){var o=Om(t,Array.isArray(e)?e:[e]);Mr[n]||(Mr[n]=new WeakMap);var s=Mr[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=(hn.get(m)||0)+1,y=(s.get(m)||0)+1;hn.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(),Fs++,function(){i.forEach(function(g){var m=hn.get(g)-1,p=s.get(g)-1;hn.set(g,m),s.set(g,p),m||(Dr.has(g)||g.removeAttribute(r),Dr.delete(g)),p||g.removeAttribute(n)}),Fs--,Fs||(hn=new WeakMap,hn=new WeakMap,Dr=new WeakMap,Mr={})}},Mm=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Fm(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Dm(r,o,n,"aria-hidden")):function(){return null}},Bl=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find($m);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(Os,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Os,{...r,ref:t,children:n})});Bl.displayName="Slot";var Os=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Lm(n);return d.cloneElement(n,{...km(r,n.props),ref:t?Nr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Os.displayName="SlotClone";var Im=({children:e})=>l.jsx(l.Fragment,{children:e});function $m(e){return d.isValidElement(e)&&e.type===Im}function km(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 Lm(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 Ds="Dialog",[Hl,OC]=Dt(Ds),[Rm,Qe]=Hl(Ds),zl=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]=cn({prop:r,defaultProp:o,onChange:s});return l.jsx(Rm,{scope:t,triggerRef:a,contentRef:u,contentId:dn(),titleId:dn(),descriptionId:dn(),open:c,onOpenChange:f,onOpenToggle:d.useCallback(()=>f(g=>!g),[f]),modal:i,children:n})};zl.displayName=Ds;var Ul="DialogTrigger",jl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Qe(Ul,n),s=qe(t,o.triggerRef);return l.jsx(we.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":$s(o.open),...r,ref:s,onClick:ye(e.onClick,o.onOpenToggle)})});jl.displayName=Ul;var Ms="DialogPortal",[Vm,Wl]=Hl(Ms,{forceMount:void 0}),Gl=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=Qe(Ms,t);return l.jsx(Vm,{scope:t,forceMount:n,children:d.Children.map(r,i=>l.jsx(un,{present:n||s.open,children:l.jsx(Es,{asChild:!0,container:o,children:i})}))})};Gl.displayName=Ms;var Ir="DialogOverlay",ql=d.forwardRef((e,t)=>{const n=Wl(Ir,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Qe(Ir,e.__scopeDialog);return s.modal?l.jsx(un,{present:r||s.open,children:l.jsx(Bm,{...o,ref:t})}):null});ql.displayName=Ir;var Bm=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Qe(Ir,n);return l.jsx(Rl,{as:Bl,allowPinchZoom:!0,shards:[o.contentRef],children:l.jsx(we.div,{"data-state":$s(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),qt="DialogContent",Kl=d.forwardRef((e,t)=>{const n=Wl(qt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Qe(qt,e.__scopeDialog);return l.jsx(un,{present:r||s.open,children:s.modal?l.jsx(Hm,{...o,ref:t}):l.jsx(zm,{...o,ref:t})})});Kl.displayName=qt;var Hm=d.forwardRef((e,t)=>{const n=Qe(qt,e.__scopeDialog),r=d.useRef(null),o=qe(t,n.contentRef,r);return d.useEffect(()=>{const s=r.current;if(s)return Mm(s)},[]),l.jsx(Xl,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ye(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:ye(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:ye(e.onFocusOutside,s=>s.preventDefault())})}),zm=d.forwardRef((e,t)=>{const n=Qe(qt,e.__scopeDialog),r=d.useRef(!1),o=d.useRef(!1);return l.jsx(Xl,{...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()}})}),Xl=d.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=Qe(qt,n),u=d.useRef(null),c=qe(t,u);return Kh(),l.jsxs(l.Fragment,{children:[l.jsx(yl,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(xs,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":$s(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(Um,{titleId:a.titleId}),l.jsx(Wm,{contentRef:u,descriptionId:a.descriptionId})]})]})}),Is="DialogTitle",Jl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Qe(Is,n);return l.jsx(we.h2,{id:o.titleId,...r,ref:t})});Jl.displayName=Is;var Yl="DialogDescription",Zl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Qe(Yl,n);return l.jsx(we.p,{id:o.descriptionId,...r,ref:t})});Zl.displayName=Yl;var Ql="DialogClose",ec=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Qe(Ql,n);return l.jsx(we.button,{type:"button",...r,ref:t,onClick:ye(e.onClick,()=>o.onOpenChange(!1))})});ec.displayName=Ql;function $s(e){return e?"open":"closed"}var tc="DialogTitleWarning",[DC,nc]=ph(tc,{contentName:qt,titleName:Is,docsSlug:"dialog"}),Um=({titleId:e})=>{const t=nc(tc),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
148
148
|
|
|
149
149
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
150
150
|
|
|
151
|
-
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},_m="DialogDescriptionWarning",Fm=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Wl(_m).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},Om=Ol,Dm=Ml,Mm=kl,Gl=$l,ql=Ll,Kl=Vl,Xl=zl,Im=Ul;const Dt=Om,Tr=Dm,km=Mm,Jl=d.forwardRef(({className:e,...t},n)=>l.jsx(Gl,{ref:n,className:ee("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}));Jl.displayName=Gl.displayName;const mt=d.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(km,{children:[l.jsx(Jl,{}),l.jsxs(ql,{ref:r,className:ee("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(Im,{className:ee("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(Go,{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"})]})]})]}));mt.displayName=ql.displayName;const vt=({className:e,...t})=>l.jsx("div",{className:ee("s3-explr-ui-dialog-header flex flex-col space-y-1.5 text-center sm:text-left",e),...t});vt.displayName="DialogHeader";const dn=({className:e,...t})=>l.jsx("div",{className:ee("s3-explr-ui-dialog-footer flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});dn.displayName="DialogFooter";const yt=d.forwardRef(({className:e,...t},n)=>l.jsx(Kl,{ref:n,className:ee("s3-explr-ui-dialog-title text-lg font-semibold leading-none tracking-tight",e),...t}));yt.displayName=Kl.displayName;const kn=d.forwardRef(({className:e,...t},n)=>l.jsx(Xl,{ref:n,className:ee("s3-explr-ui-dialog-description text-sm text-muted-foreground",e),...t}));kn.displayName=Xl.displayName;const Mt=d.forwardRef(({className:e,type:t,...n},r)=>l.jsx("input",{type:t,className:ee("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}));Mt.displayName="Input";var $m="Label",Yl=d.forwardRef((e,t)=>l.jsx(we.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())}}));Yl.displayName=$m;var Zl=Yl;const Lm=es("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"}}),Wt=d.forwardRef(({className:e,variant:t,size:n,...r},o)=>l.jsx(Zl,{ref:o,className:ee(Lm({variant:t,size:n}),e),...r}));Wt.displayName=Zl.displayName;const Pr=d.forwardRef(({className:e,...t},n)=>l.jsx("div",{className:ee("relative w-full overflow-auto","s3-explr-ui-table-container"),children:l.jsx("table",{ref:n,className:ee("w-full caption-bottom text-sm","s3-explr-ui-table",e),...t})}));Pr.displayName="Table";const Ar=d.forwardRef(({className:e,...t},n)=>l.jsx("thead",{ref:n,className:ee("[&_tr]:border-b","s3-explr-ui-table-header",e),...t}));Ar.displayName="TableHeader";const _r=d.forwardRef(({className:e,...t},n)=>l.jsx("tbody",{ref:n,className:ee("[&_tr:last-child]:border-0","s3-explr-ui-table-body",e),...t}));_r.displayName="TableBody";const Rm=d.forwardRef(({className:e,...t},n)=>l.jsx("tfoot",{ref:n,className:ee("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0","s3-explr-ui-table-footer",e),...t}));Rm.displayName="TableFooter";const Je=d.forwardRef(({className:e,...t},n)=>l.jsx("tr",{ref:n,className:ee("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted","s3-explr-ui-table-row",e),...t}));Je.displayName="TableRow";const st=d.forwardRef(({className:e,...t},n)=>l.jsx("th",{ref:n,className:ee("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}));st.displayName="TableHead";const Ie=d.forwardRef(({className:e,...t},n)=>l.jsx("td",{ref:n,className:ee("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-cell",e),...t}));Ie.displayName="TableCell";const Vm=d.forwardRef(({className:e,...t},n)=>l.jsx("caption",{ref:n,className:ee("mt-4 text-sm text-muted-foreground","s3-explr-ui-table-caption",e),...t}));Vm.displayName="TableCaption";function bs(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 fn(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 Ql(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function xs(...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)}}}}function Cs(...e){return d.useCallback(xs(...e),e)}var Ss=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(zm);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(Es,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Es,{...r,ref:t,children:n})});Ss.displayName="Slot";var Es=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Um(n);return d.cloneElement(n,{...Hm(r,n.props),ref:t?xs(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Es.displayName="SlotClone";var Bm=({children:e})=>l.jsx(l.Fragment,{children:e});function zm(e){return d.isValidElement(e)&&e.type===Bm}function Hm(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 Um(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 jm(e){const t=e+"CollectionProvider",[n,r]=_t(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:m}=p,y=A.useRef(null),w=A.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:m})};i.displayName=t;const a=e+"CollectionSlot",u=A.forwardRef((p,v)=>{const{scope:m,children:y}=p,w=s(a,m),b=Cs(v,w.collectionRef);return l.jsx(Ss,{ref:b,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",g=A.forwardRef((p,v)=>{const{scope:m,children:y,...w}=p,b=A.useRef(null),S=Cs(v,b),E=s(c,m);return A.useEffect(()=>(E.itemMap.set(b,{ref:b,...w}),()=>void E.itemMap.delete(b))),l.jsx(Ss,{[f]:"",ref:S,children:y})});g.displayName=c;function h(p){const v=s(e+"CollectionConsumer",p);return A.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((E,x)=>w.indexOf(E.ref.current)-w.indexOf(x.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:g},h,r]}var ec=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Gm);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(Ns,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Ns,{...r,ref:t,children:n})});ec.displayName="Slot";var Ns=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Km(n);return d.cloneElement(n,{...qm(r,n.props),ref:t?xs(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Ns.displayName="SlotClone";var Wm=({children:e})=>l.jsx(l.Fragment,{children:e});function Gm(e){return d.isValidElement(e)&&e.type===Wm}function qm(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 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)}var Xm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],tc=Xm.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}},{}),Jm=d.createContext(void 0);function nc(e){const t=d.useContext(Jm);return e||t||"ltr"}var Ts="rovingFocusGroup.onEntryFocus",Ym={bubbles:!1,cancelable:!0},Fr="RovingFocusGroup",[Ps,rc,Zm]=jm(Fr),[Qm,oc]=_t(Fr,[Zm]),[ev,tv]=Qm(Fr),sc=d.forwardRef((e,t)=>l.jsx(Ps.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Ps.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(nv,{...e,ref:t})})}));sc.displayName=Fr;var nv=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,h=d.useRef(null),p=Cs(t,h),v=nc(s),[m=null,y]=rn({prop:i,defaultProp:a,onChange:u}),[w,b]=d.useState(!1),S=Ae(c),E=rc(n),x=d.useRef(!1),[P,F]=d.useState(0);return d.useEffect(()=>{const O=h.current;if(O)return O.addEventListener(Ts,S),()=>O.removeEventListener(Ts,S)},[S]),l.jsx(ev,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:m,onItemFocus:d.useCallback(O=>y(O),[y]),onItemShiftTab:d.useCallback(()=>b(!0),[]),onFocusableItemAdd:d.useCallback(()=>F(O=>O+1),[]),onFocusableItemRemove:d.useCallback(()=>F(O=>O-1),[]),children:l.jsx(tc.div,{tabIndex:w||P===0?-1:0,"data-orientation":r,...g,ref:p,style:{outline:"none",...e.style},onMouseDown:fn(e.onMouseDown,()=>{x.current=!0}),onFocus:fn(e.onFocus,O=>{const k=!x.current;if(O.target===O.currentTarget&&k&&!w){const D=new CustomEvent(Ts,Ym);if(O.currentTarget.dispatchEvent(D),!D.defaultPrevented){const G=E().filter(q=>q.focusable),$=G.find(q=>q.active),U=G.find(q=>q.id===m),X=[$,U,...G].filter(Boolean).map(q=>q.ref.current);lc(X,f)}}x.current=!1}),onBlur:fn(e.onBlur,()=>b(!1))})})}),ic="RovingFocusGroupItem",ac=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...i}=e,a=sn(),u=s||a,c=tv(ic,n),f=c.currentTabStopId===u,g=rc(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=c;return d.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),l.jsx(Ps.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:l.jsx(tc.span,{tabIndex:f?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:fn(e.onMouseDown,v=>{r?c.onItemFocus(u):v.preventDefault()}),onFocus:fn(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:fn(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const m=sv(v,c.orientation,c.dir);if(m!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let w=g().filter(b=>b.focusable).map(b=>b.ref.current);if(m==="last")w.reverse();else if(m==="prev"||m==="next"){m==="prev"&&w.reverse();const b=w.indexOf(v.currentTarget);w=c.loop?iv(w,b+1):w.slice(b+1)}setTimeout(()=>lc(w))}})})})});ac.displayName=ic;var rv={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ov(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function sv(e,t,n){const r=ov(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return rv[r]}function lc(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function iv(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var av=sc,lv=ac;function cc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function cv(...e){return t=>{let n=!1;const r=e.map(o=>{const s=cc(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():cc(e[o],null)}}}}function uv(...e){return d.useCallback(cv(...e),e)}function dv(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var uc=e=>{const{present:t,children:n}=e,r=fv(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=uv(r.ref,pv(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};uc.displayName="Presence";function fv(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=dv(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=Or(r.current);s.current=a==="mounted"?c:"none"},[a]),Re(()=>{const c=r.current,f=o.current;if(f!==e){const h=s.current,p=Or(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Re(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const m=Or(r.current).includes(p.animationName);if(p.target===t&&m&&(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)})}},h=p=>{p.target===t&&(s.current=Or(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",h),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 Or(e){return(e==null?void 0:e.animationName)||"none"}function pv(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 dc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function gv(...e){return t=>{let n=!1;const r=e.map(o=>{const s=dc(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():dc(e[o],null)}}}}var fc=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(mv);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})});fc.displayName="Slot";var As=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=yv(n);return d.cloneElement(n,{...vv(r,n.props),ref:t?gv(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});As.displayName="SlotClone";var hv=({children:e})=>l.jsx(l.Fragment,{children:e});function mv(e){return d.isValidElement(e)&&e.type===hv}function vv(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 yv(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 wv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Dr=wv.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?fc: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}},{}),_s="Tabs",[bv,mC]=_t(_s,[oc]),pc=oc(),[xv,Fs]=bv(_s),gc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:u="automatic",...c}=e,f=nc(a),[g,h]=rn({prop:r,onChange:o,defaultProp:s});return l.jsx(xv,{scope:n,baseId:sn(),value:g,onValueChange:h,orientation:i,dir:f,activationMode:u,children:l.jsx(Dr.div,{dir:f,"data-orientation":i,...c,ref:t})})});gc.displayName=_s;var hc="TabsList",mc=d.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=Fs(hc,n),i=pc(n);return l.jsx(av,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:l.jsx(Dr.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});mc.displayName=hc;var vc="TabsTrigger",yc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=Fs(vc,n),a=pc(n),u=xc(i.baseId,r),c=Cc(i.baseId,r),f=r===i.value;return l.jsx(lv,{asChild:!0,...a,focusable:!o,active:f,children:l.jsx(Dr.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:bs(e.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?i.onValueChange(r):g.preventDefault()}),onKeyDown:bs(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&i.onValueChange(r)}),onFocus:bs(e.onFocus,()=>{const g=i.activationMode!=="manual";!f&&!o&&g&&i.onValueChange(r)})})})});yc.displayName=vc;var wc="TabsContent",bc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=Fs(wc,n),u=xc(a.baseId,r),c=Cc(a.baseId,r),f=r===a.value,g=d.useRef(f);return d.useEffect(()=>{const h=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(h)},[]),l.jsx(uc,{present:o||f,children:({present:h})=>l.jsx(Dr.div,{"data-state":f?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":u,hidden:!h,id:c,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:h&&s})})});bc.displayName=wc;function xc(e,t){return`${e}-trigger-${t}`}function Cc(e,t){return`${e}-content-${t}`}var Cv=gc,Sc=mc,Ec=yc,Nc=bc;const Sv=Cv,Tc=d.forwardRef(({className:e,...t},n)=>l.jsx(Sc,{ref:n,className:ee("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Tc.displayName=Sc.displayName;const Mr=d.forwardRef(({className:e,...t},n)=>l.jsx(Ec,{ref:n,className:ee("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}));Mr.displayName=Ec.displayName;const Ir=d.forwardRef(({className:e,...t},n)=>l.jsx(Nc,{ref:n,className:ee("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Ir.displayName=Nc.displayName;const $n=d.forwardRef(({className:e,...t},n)=>l.jsx("textarea",{className:ee("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}));$n.displayName="Textarea";function Ev(e,t=[]){let n=[];function r(s,i){const a=d.createContext(i),u=n.length;n=[...n,i];function c(g){const{scope:h,children:p,...v}=g,m=(h==null?void 0:h[e][u])||a,y=d.useMemo(()=>v,Object.values(v));return l.jsx(m.Provider,{value:y,children:p})}function f(g,h){const p=(h==null?void 0:h[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,Nv(o,...t)]}function Nv(...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 Os=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Pv);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})});Os.displayName="Slot";var Ds=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=_v(n);return d.cloneElement(n,{...Av(r,n.props),ref:t?mr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Ds.displayName="SlotClone";var Tv=({children:e})=>l.jsx(l.Fragment,{children:e});function Pv(e){return d.isValidElement(e)&&e.type===Tv}function Av(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 _v(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 Fv(e){const t=e+"CollectionProvider",[n,r]=Ev(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:m}=p,y=A.useRef(null),w=A.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:m})};i.displayName=t;const a=e+"CollectionSlot",u=A.forwardRef((p,v)=>{const{scope:m,children:y}=p,w=s(a,m),b=Ue(v,w.collectionRef);return l.jsx(Os,{ref:b,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",g=A.forwardRef((p,v)=>{const{scope:m,children:y,...w}=p,b=A.useRef(null),S=Ue(v,b),E=s(c,m);return A.useEffect(()=>(E.itemMap.set(b,{ref:b,...w}),()=>void E.itemMap.delete(b))),l.jsx(Os,{[f]:"",ref:S,children:y})});g.displayName=c;function h(p){const v=s(e+"CollectionConsumer",p);return A.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((E,x)=>w.indexOf(E.ref.current)-w.indexOf(x.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:g},h,r]}var Ov="VisuallyHidden",Ms=d.forwardRef((e,t)=>l.jsx(we.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}}));Ms.displayName=Ov;var Is="ToastProvider",[ks,Dv,Mv]=Fv("Toast"),[Pc,vC]=_t("Toast",[Mv]),[Iv,kr]=Pc(Is),Ac=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),h=d.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Is}\`. Expected non-empty \`string\`.`),l.jsx(ks.Provider,{scope:t,children:l.jsx(Iv,{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:h,children:i})})};Ac.displayName=Is;var _c="ToastViewport",kv=["F8"],$s="toast.viewportPause",Ls="toast.viewportResume",Fc=d.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=kv,label:o="Notifications ({hotkey})",...s}=e,i=kr(_c,n),a=Dv(n),u=d.useRef(null),c=d.useRef(null),f=d.useRef(null),g=d.useRef(null),h=Ue(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 b=()=>{if(!i.isClosePausedRef.current){const P=new CustomEvent($s);w.dispatchEvent(P),i.isClosePausedRef.current=!0}},S=()=>{if(i.isClosePausedRef.current){const P=new CustomEvent(Ls);w.dispatchEvent(P),i.isClosePausedRef.current=!1}},E=P=>{!y.contains(P.relatedTarget)&&S()},x=()=>{y.contains(document.activeElement)||S()};return y.addEventListener("focusin",b),y.addEventListener("focusout",E),y.addEventListener("pointermove",b),y.addEventListener("pointerleave",x),window.addEventListener("blur",b),window.addEventListener("focus",S),()=>{y.removeEventListener("focusin",b),y.removeEventListener("focusout",E),y.removeEventListener("pointermove",b),y.removeEventListener("pointerleave",x),window.removeEventListener("blur",b),window.removeEventListener("focus",S)}}},[v,i.isClosePausedRef]);const m=d.useCallback(({tabbingDirection:y})=>{const b=a().map(S=>{const E=S.ref.current,x=[E,...Kv(E)];return y==="forwards"?x:x.reverse()});return(y==="forwards"?b.reverse():b).flat()},[a]);return d.useEffect(()=>{const y=g.current;if(y){const w=b=>{var x,P,F;const S=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!S){const O=document.activeElement,k=b.shiftKey;if(b.target===y&&k){(x=c.current)==null||x.focus();return}const $=m({tabbingDirection:k?"backwards":"forwards"}),U=$.findIndex(L=>L===O);Bs($.slice(U+1))?b.preventDefault():k?(P=c.current)==null||P.focus():(F=f.current)==null||F.focus()}};return y.addEventListener("keydown",w),()=>y.removeEventListener("keydown",w)}},[a,m]),l.jsxs(Eh,{ref:u,role:"region","aria-label":o.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&l.jsx(Rs,{ref:c,onFocusFromOutsideViewport:()=>{const y=m({tabbingDirection:"forwards"});Bs(y)}}),l.jsx(ks.Slot,{scope:n,children:l.jsx(we.ol,{tabIndex:-1,...s,ref:h})}),v&&l.jsx(Rs,{ref:f,onFocusFromOutsideViewport:()=>{const y=m({tabbingDirection:"backwards"});Bs(y)}})]})});Fc.displayName=_c;var Oc="ToastFocusProxy",Rs=d.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,s=kr(Oc,n);return l.jsx(Ms,{"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()}})});Rs.displayName=Oc;var $r="Toast",$v="toast.swipeStart",Lv="toast.swipeMove",Rv="toast.swipeCancel",Vv="toast.swipeEnd",Dc=d.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:s,...i}=e,[a=!0,u]=rn({prop:r,defaultProp:o,onChange:s});return l.jsx(on,{present:n||a,children:l.jsx(Hv,{open:a,...i,ref:t,onClose:()=>u(!1),onPause:Ae(e.onPause),onResume:Ae(e.onResume),onSwipeStart:ye(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ye(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:ye(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:ye(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)})})})});Dc.displayName=$r;var[Bv,zv]=Pc($r,{onClose(){}}),Hv=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:h,onSwipeEnd:p,...v}=e,m=kr($r,n),[y,w]=d.useState(null),b=Ue(t,L=>w(L)),S=d.useRef(null),E=d.useRef(null),x=o||m.duration,P=d.useRef(0),F=d.useRef(x),O=d.useRef(0),{onToastAdd:k,onToastRemove:D}=m,G=Ae(()=>{var X;(y==null?void 0:y.contains(document.activeElement))&&((X=m.viewport)==null||X.focus()),i()}),$=d.useCallback(L=>{!L||L===1/0||(window.clearTimeout(O.current),P.current=new Date().getTime(),O.current=window.setTimeout(G,L))},[G]);d.useEffect(()=>{const L=m.viewport;if(L){const X=()=>{$(F.current),c==null||c()},q=()=>{const te=new Date().getTime()-P.current;F.current=F.current-te,window.clearTimeout(O.current),u==null||u()};return L.addEventListener($s,q),L.addEventListener(Ls,X),()=>{L.removeEventListener($s,q),L.removeEventListener(Ls,X)}}},[m.viewport,x,u,c,$]),d.useEffect(()=>{s&&!m.isClosePausedRef.current&&$(x)},[s,x,m.isClosePausedRef,$]),d.useEffect(()=>(k(),()=>D()),[k,D]);const U=d.useMemo(()=>y?Vc(y):null,[y]);return m.viewport?l.jsxs(l.Fragment,{children:[U&&l.jsx(Uv,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:U}),l.jsx(Bv,{scope:n,onClose:G,children:Qn.createPortal(l.jsx(ks.ItemSlot,{scope:n,children:l.jsx(Sh,{asChild:!0,onEscapeKeyDown:ye(a,()=>{m.isFocusedToastEscapeKeyDownRef.current||G(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(we.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":m.swipeDirection,...v,ref:b,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ye(e.onKeyDown,L=>{L.key==="Escape"&&(a==null||a(L.nativeEvent),L.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,G()))}),onPointerDown:ye(e.onPointerDown,L=>{L.button===0&&(S.current={x:L.clientX,y:L.clientY})}),onPointerMove:ye(e.onPointerMove,L=>{if(!S.current)return;const X=L.clientX-S.current.x,q=L.clientY-S.current.y,te=!!E.current,B=["left","right"].includes(m.swipeDirection),j=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,le=B?j(0,X):0,ce=B?0:j(0,q),xe=L.pointerType==="touch"?10:2,Ee={x:le,y:ce},Oe={originalEvent:L,delta:Ee};te?(E.current=Ee,Lr(Lv,g,Oe,{discrete:!1})):Bc(Ee,m.swipeDirection,xe)?(E.current=Ee,Lr($v,f,Oe,{discrete:!1}),L.target.setPointerCapture(L.pointerId)):(Math.abs(X)>xe||Math.abs(q)>xe)&&(S.current=null)}),onPointerUp:ye(e.onPointerUp,L=>{const X=E.current,q=L.target;if(q.hasPointerCapture(L.pointerId)&&q.releasePointerCapture(L.pointerId),E.current=null,S.current=null,X){const te=L.currentTarget,B={originalEvent:L,delta:X};Bc(X,m.swipeDirection,m.swipeThreshold)?Lr(Vv,p,B,{discrete:!0}):Lr(Rv,h,B,{discrete:!0}),te.addEventListener("click",j=>j.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),Uv=e=>{const{__scopeToast:t,children:n,...r}=e,o=kr($r,t),[s,i]=d.useState(!1),[a,u]=d.useState(!1);return Gv(()=>i(!0)),d.useEffect(()=>{const c=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:l.jsx(ls,{asChild:!0,children:l.jsx(Ms,{...r,children:s&&l.jsxs(l.Fragment,{children:[o.label," ",n]})})})},jv="ToastTitle",Mc=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(we.div,{...r,ref:t})});Mc.displayName=jv;var Wv="ToastDescription",Ic=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(we.div,{...r,ref:t})});Ic.displayName=Wv;var kc="ToastAction",$c=d.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?l.jsx(Rc,{altText:n,asChild:!0,children:l.jsx(Vs,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${kc}\`. Expected non-empty \`string\`.`),null)});$c.displayName=kc;var Lc="ToastClose",Vs=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=zv(Lc,n);return l.jsx(Rc,{asChild:!0,children:l.jsx(we.button,{type:"button",...r,ref:t,onClick:ye(e.onClick,o.onClose)})})});Vs.displayName=Lc;var Rc=d.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return l.jsx(we.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function Vc(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),qv(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(...Vc(r))}}),t}function Lr(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 Bc=(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 Gv(e=()=>{}){const t=Ae(e);Re(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function qv(e){return e.nodeType===e.ELEMENT_NODE}function Kv(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 Bs(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var Xv=Ac,zc=Fc,Hc=Dc,Uc=Mc,jc=Ic,Wc=$c,Gc=Vs;const Jv=Xv,qc=d.forwardRef(({className:e,...t},n)=>l.jsx(zc,{ref:n,className:ee("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}));qc.displayName=zc.displayName;const Yv=es("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(Hc,{ref:r,className:ee(Yv({variant:t}),e),...n}));Kc.displayName=Hc.displayName;const Zv=d.forwardRef(({className:e,...t},n)=>l.jsx(Wc,{ref:n,className:ee("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}));Zv.displayName=Wc.displayName;const Xc=d.forwardRef(({className:e,...t},n)=>l.jsx(Gc,{ref:n,className:ee("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(Go,{className:"s3-explr-ui-toast-close-icon h-4 w-4"})}));Xc.displayName=Gc.displayName;const Jc=d.forwardRef(({className:e,...t},n)=>l.jsx(Uc,{ref:n,className:ee("s3-explr-ui-toast-title text-sm font-semibold [&+div]:text-xs",e),...t}));Jc.displayName=Uc.displayName;const Yc=d.forwardRef(({className:e,...t},n)=>l.jsx(jc,{ref:n,className:ee("s3-explr-ui-toast-description text-sm opacity-90",e),...t}));Yc.displayName=jc.displayName;const Qv=1,ey=1e6;let zs=0;function ty(){return zs=(zs+1)%Number.MAX_SAFE_INTEGER,zs.toString()}const Hs=new Map,Zc=e=>{if(Hs.has(e))return;const t=setTimeout(()=>{Hs.delete(e),Ln({type:"REMOVE_TOAST",toastId:e})},ey);Hs.set(e,t)},ny=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Qv)};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?Zc(n):e.toasts.forEach(r=>{Zc(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)}}},Rr=[];let Vr={toasts:[]};function Ln(e){Vr=ny(Vr,e),Rr.forEach(t=>{t(Vr)})}function ry({...e}){const t=ty(),n=o=>Ln({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>Ln({type:"DISMISS_TOAST",toastId:t});return Ln({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function Br(){const[e,t]=d.useState(Vr);return d.useEffect(()=>(Rr.push(t),()=>{const n=Rr.indexOf(t);n>-1&&Rr.splice(n,1)}),[e]),{...e,toast:ry,dismiss:n=>Ln({type:"DISMISS_TOAST",toastId:n})}}function Qc(){const{toasts:e}=Br();return l.jsxs(Jv,{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(Jc,{className:"s3-explr-ui-toast-title",children:n}),r&&l.jsx(Yc,{className:"s3-explr-ui-toast-description",children:r})]}),o&&l.jsx("div",{className:"s3-explr-ui-toast-action",children:o}),l.jsx(Xc,{className:"s3-explr-ui-toast-close"})]},t)}),l.jsx(qc,{className:"s3-explr-ui-toast-viewport"})]})}function wt(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 eu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function oy(...e){return t=>{let n=!1;const r=e.map(o=>{const s=eu(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():eu(e[o],null)}}}}function Rn(...e){return d.useCallback(oy(...e),e)}var sy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Vn=sy.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?en: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 iy(e,t){e&&Qn.flushSync(()=>e.dispatchEvent(t))}var ay="DismissableLayer",Us="dismissableLayer.update",ly="dismissableLayer.pointerDownOutside",cy="dismissableLayer.focusOutside",tu,nu=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ru=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,c=d.useContext(nu),[f,g]=d.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=d.useState({}),v=Rn(t,F=>g(F)),m=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=m.indexOf(y),b=f?m.indexOf(f):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,E=b>=w,x=fy(F=>{const O=F.target,k=[...c.branches].some(D=>D.contains(O));!E||k||(o==null||o(F),i==null||i(F),F.defaultPrevented||a==null||a())},h),P=py(F=>{const O=F.target;[...c.branches].some(D=>D.contains(O))||(s==null||s(F),i==null||i(F),F.defaultPrevented||a==null||a())},h);return el(F=>{b===c.layers.size-1&&(r==null||r(F),!F.defaultPrevented&&a&&(F.preventDefault(),a()))},h),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(tu=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),ou(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=tu)}},[f,h,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),ou())},[f,c]),d.useEffect(()=>{const F=()=>p({});return document.addEventListener(Us,F),()=>document.removeEventListener(Us,F)},[]),l.jsx(Vn.div,{...u,ref:v,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:wt(e.onFocusCapture,P.onFocusCapture),onBlurCapture:wt(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:wt(e.onPointerDownCapture,x.onPointerDownCapture)})});ru.displayName=ay;var uy="DismissableLayerBranch",dy=d.forwardRef((e,t)=>{const n=d.useContext(nu),r=d.useRef(null),o=Rn(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(Vn.div,{...e,ref:o})});dy.displayName=uy;function fy(e,t=globalThis==null?void 0:globalThis.document){const n=Ae(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){su(ly,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 py(e,t=globalThis==null?void 0:globalThis.document){const n=Ae(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&su(cy,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 ou(){const e=new CustomEvent(Us);document.dispatchEvent(e)}function su(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?iy(o,s):o.dispatchEvent(s)}const gy=["top","right","bottom","left"],It=Math.min,Ve=Math.max,zr=Math.round,Hr=Math.floor,it=e=>({x:e,y:e}),hy={left:"right",right:"left",bottom:"top",top:"bottom"},my={start:"end",end:"start"};function js(e,t,n){return Ve(e,It(t,n))}function bt(e,t){return typeof e=="function"?e(t):e}function xt(e){return e.split("-")[0]}function pn(e){return e.split("-")[1]}function Ws(e){return e==="x"?"y":"x"}function Gs(e){return e==="y"?"height":"width"}function kt(e){return["top","bottom"].includes(xt(e))?"y":"x"}function qs(e){return Ws(kt(e))}function vy(e,t,n){n===void 0&&(n=!1);const r=pn(e),o=qs(e),s=Gs(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Ur(i)),[i,Ur(i)]}function yy(e){const t=Ur(e);return[Ks(e),t,Ks(t)]}function Ks(e){return e.replace(/start|end/g,t=>my[t])}function wy(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 by(e,t,n,r){const o=pn(e);let s=wy(xt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Ks)))),s}function Ur(e){return e.replace(/left|right|bottom|top/g,t=>hy[t])}function xy(e){return{top:0,right:0,bottom:0,left:0,...e}}function iu(e){return typeof e!="number"?xy(e):{top:e,right:e,bottom:e,left:e}}function jr(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 au(e,t,n){let{reference:r,floating:o}=e;const s=kt(t),i=qs(t),a=Gs(i),u=xt(t),c=s==="y",f=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,h=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(pn(t)){case"start":p[i]-=h*(n&&c?-1:1);break;case"end":p[i]+=h*(n&&c?-1:1);break}return p}const Cy=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}=au(c,r,u),h=r,p={},v=0;for(let m=0;m<a.length;m++){const{name:y,fn:w}=a[m],{x:b,y:S,data:E,reset:x}=await w({x:f,y:g,initialPlacement:r,placement:h,strategy:o,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});f=b??f,g=S??g,p={...p,[y]:{...p[y],...E}},x&&v<=50&&(v++,typeof x=="object"&&(x.placement&&(h=x.placement),x.rects&&(c=x.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):x.rects),{x:f,y:g}=au(c,h,u)),m=-1)}return{x:f,y:g,placement:h,strategy:o,middlewareData:p}};async function Bn(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:h=!1,padding:p=0}=bt(t,e),v=iu(p),y=a[h?g==="floating"?"reference":"floating":g],w=jr(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})),b=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},x=jr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:S,strategy:u}):b);return{top:(w.top-x.top+v.top)/E.y,bottom:(x.bottom-w.bottom+v.bottom)/E.y,left:(w.left-x.left+v.left)/E.x,right:(x.right-w.right+v.right)/E.x}}const Sy=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}=bt(e,t)||{};if(c==null)return{};const g=iu(f),h={x:n,y:r},p=qs(o),v=Gs(p),m=await i.getDimensions(c),y=p==="y",w=y?"top":"left",b=y?"bottom":"right",S=y?"clientHeight":"clientWidth",E=s.reference[v]+s.reference[p]-h[p]-s.floating[v],x=h[p]-s.reference[p],P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let F=P?P[S]:0;(!F||!await(i.isElement==null?void 0:i.isElement(P)))&&(F=a.floating[S]||s.floating[v]);const O=E/2-x/2,k=F/2-m[v]/2-1,D=It(g[w],k),G=It(g[b],k),$=D,U=F-m[v]-G,L=F/2-m[v]/2+O,X=js($,L,U),q=!u.arrow&&pn(o)!=null&&L!==X&&s.reference[v]/2-(L<$?D:G)-m[v]/2<0,te=q?L<$?L-$:L-U:0;return{[p]:h[p]+te,data:{[p]:X,centerOffset:L-X-te,...q&&{alignmentOffset:te}},reset:q}}}),Ey=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:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...y}=bt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=xt(o),b=kt(a),S=xt(a)===a,E=await(u.isRTL==null?void 0:u.isRTL(c.floating)),x=h||(S||!m?[Ur(a)]:yy(a)),P=v!=="none";!h&&P&&x.push(...by(a,m,v,E));const F=[a,...x],O=await Bn(t,y),k=[];let D=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&k.push(O[w]),g){const L=vy(o,i,E);k.push(O[L[0]],O[L[1]])}if(D=[...D,{placement:o,overflows:k}],!k.every(L=>L<=0)){var G,$;const L=(((G=s.flip)==null?void 0:G.index)||0)+1,X=F[L];if(X)return{data:{index:L,overflows:D},reset:{placement:X}};let q=($=D.filter(te=>te.overflows[0]<=0).sort((te,B)=>te.overflows[1]-B.overflows[1])[0])==null?void 0:$.placement;if(!q)switch(p){case"bestFit":{var U;const te=(U=D.filter(B=>{if(P){const j=kt(B.placement);return j===b||j==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(j=>j>0).reduce((j,le)=>j+le,0)]).sort((B,j)=>B[1]-j[1])[0])==null?void 0:U[0];te&&(q=te);break}case"initialPlacement":q=a;break}if(o!==q)return{reset:{placement:q}}}return{}}}};function lu(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cu(e){return gy.some(t=>e[t]>=0)}const Ny=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=bt(e,t);switch(r){case"referenceHidden":{const s=await Bn(t,{...o,elementContext:"reference"}),i=lu(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:cu(i)}}}case"escaped":{const s=await Bn(t,{...o,altBoundary:!0}),i=lu(s,n.floating);return{data:{escapedOffsets:i,escaped:cu(i)}}}default:return{}}}}};async function Ty(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=xt(n),a=pn(n),u=kt(n)==="y",c=["left","top"].includes(i)?-1:1,f=s&&u?-1:1,g=bt(t,e);let{mainAxis:h,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:h*c}:{x:h*c,y:p*f}}const Py=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 Ty(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}}}}},Ay=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:b}=y;return{x:w,y:b}}},...u}=bt(e,t),c={x:n,y:r},f=await Bn(t,u),g=kt(xt(o)),h=Ws(g);let p=c[h],v=c[g];if(s){const y=h==="y"?"top":"left",w=h==="y"?"bottom":"right",b=p+f[y],S=p-f[w];p=js(b,p,S)}if(i){const y=g==="y"?"top":"left",w=g==="y"?"bottom":"right",b=v+f[y],S=v-f[w];v=js(b,v,S)}const m=a.fn({...t,[h]:p,[g]:v});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:s,[g]:i}}}}}},_y=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}=bt(e,t),f={x:n,y:r},g=kt(o),h=Ws(g);let p=f[h],v=f[g];const m=bt(a,t),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(u){const S=h==="y"?"height":"width",E=s.reference[h]-s.floating[S]+y.mainAxis,x=s.reference[h]+s.reference[S]-y.mainAxis;p<E?p=E:p>x&&(p=x)}if(c){var w,b;const S=h==="y"?"width":"height",E=["top","left"].includes(xt(o)),x=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:((b=i.offset)==null?void 0:b[g])||0)-(E?y.crossAxis:0);v<x?v=x:v>P&&(v=P)}return{[h]:p,[g]:v}}}},Fy=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}=bt(e,t),f=await Bn(t,c),g=xt(o),h=pn(o),p=kt(o)==="y",{width:v,height:m}=s.floating;let y,w;g==="top"||g==="bottom"?(y=g,w=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(w=g,y=h==="end"?"top":"bottom");const b=m-f.top-f.bottom,S=v-f.left-f.right,E=It(m-f[y],b),x=It(v-f[w],S),P=!t.middlewareData.shift;let F=E,O=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(F=b),P&&!h){const D=Ve(f.left,0),G=Ve(f.right,0),$=Ve(f.top,0),U=Ve(f.bottom,0);p?O=v-2*(D!==0||G!==0?D+G:Ve(f.left,f.right)):F=m-2*($!==0||U!==0?$+U:Ve(f.top,f.bottom))}await u({...t,availableWidth:O,availableHeight:F});const k=await i.getDimensions(a.floating);return v!==k.width||m!==k.height?{reset:{rects:!0}}:{}}}};function Wr(){return typeof window<"u"}function gn(e){return uu(e)?(e.nodeName||"").toLowerCase():"#document"}function Be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function at(e){var t;return(t=(uu(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function uu(e){return Wr()?e instanceof Node||e instanceof Be(e).Node:!1}function Ye(e){return Wr()?e instanceof Element||e instanceof Be(e).Element:!1}function lt(e){return Wr()?e instanceof HTMLElement||e instanceof Be(e).HTMLElement:!1}function du(e){return!Wr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Be(e).ShadowRoot}function zn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ze(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Oy(e){return["table","td","th"].includes(gn(e))}function Gr(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Xs(e){const t=Js(),n=Ye(e)?Ze(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 Dy(e){let t=$t(e);for(;lt(t)&&!hn(t);){if(Xs(t))return t;if(Gr(t))return null;t=$t(t)}return null}function Js(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function hn(e){return["html","body","#document"].includes(gn(e))}function Ze(e){return Be(e).getComputedStyle(e)}function qr(e){return Ye(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $t(e){if(gn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||du(e)&&e.host||at(e);return du(t)?t.host:t}function fu(e){const t=$t(e);return hn(t)?e.ownerDocument?e.ownerDocument.body:e.body:lt(t)&&zn(t)?t:fu(t)}function Hn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=fu(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Be(o);if(s){const a=Ys(i);return t.concat(i,i.visualViewport||[],zn(o)?o:[],a&&n?Hn(a):[])}return t.concat(o,Hn(o,[],n))}function Ys(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function pu(e){const t=Ze(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=lt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=zr(n)!==s||zr(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Zs(e){return Ye(e)?e:e.contextElement}function mn(e){const t=Zs(e);if(!lt(t))return it(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=pu(t);let i=(s?zr(n.width):n.width)/r,a=(s?zr(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const My=it(0);function gu(e){const t=Be(e);return!Js()||!t.visualViewport?My:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Iy(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Be(e)?!1:t}function Gt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Zs(e);let i=it(1);t&&(r?Ye(r)&&(i=mn(r)):i=mn(e));const a=Iy(s,n,r)?gu(s):it(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 h=Be(s),p=r&&Ye(r)?Be(r):r;let v=h,m=Ys(v);for(;m&&r&&p!==v;){const y=mn(m),w=m.getBoundingClientRect(),b=Ze(m),S=w.left+(m.clientLeft+parseFloat(b.paddingLeft))*y.x,E=w.top+(m.clientTop+parseFloat(b.paddingTop))*y.y;u*=y.x,c*=y.y,f*=y.x,g*=y.y,u+=S,c+=E,v=Be(m),m=Ys(v)}}return jr({width:f,height:g,x:u,y:c})}function Qs(e,t){const n=qr(e).scrollLeft;return t?t.left+n:Gt(at(e)).left+n}function hu(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Qs(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function ky(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=at(r),a=t?Gr(t.floating):!1;if(r===i||a&&s)return n;let u={scrollLeft:0,scrollTop:0},c=it(1);const f=it(0),g=lt(r);if((g||!g&&!s)&&((gn(r)!=="body"||zn(i))&&(u=qr(r)),lt(r))){const p=Gt(r);c=mn(r),f.x=p.x+r.clientLeft,f.y=p.y+r.clientTop}const h=i&&!g&&!s?hu(i,u,!0):it(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+f.x+h.x,y:n.y*c.y-u.scrollTop*c.y+f.y+h.y}}function $y(e){return Array.from(e.getClientRects())}function Ly(e){const t=at(e),n=qr(e),r=e.ownerDocument.body,o=Ve(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Ve(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Qs(e);const a=-n.scrollTop;return Ze(r).direction==="rtl"&&(i+=Ve(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function Ry(e,t){const n=Be(e),r=at(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=Js();(!c||c&&t==="fixed")&&(a=o.offsetLeft,u=o.offsetTop)}return{width:s,height:i,x:a,y:u}}function Vy(e,t){const n=Gt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=lt(e)?mn(e):it(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 mu(e,t,n){let r;if(t==="viewport")r=Ry(e,n);else if(t==="document")r=Ly(at(e));else if(Ye(t))r=Vy(t,n);else{const o=gu(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return jr(r)}function vu(e,t){const n=$t(e);return n===t||!Ye(n)||hn(n)?!1:Ze(n).position==="fixed"||vu(n,t)}function By(e,t){const n=t.get(e);if(n)return n;let r=Hn(e,[],!1).filter(a=>Ye(a)&&gn(a)!=="body"),o=null;const s=Ze(e).position==="fixed";let i=s?$t(e):e;for(;Ye(i)&&!hn(i);){const a=Ze(i),u=Xs(i);!u&&a.position==="fixed"&&(o=null),(s?!u&&!o:!u&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||zn(i)&&!u&&vu(e,i))?r=r.filter(f=>f!==i):o=a,i=$t(i)}return t.set(e,r),r}function zy(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Gr(t)?[]:By(t,this._c):[].concat(n),r],a=i[0],u=i.reduce((c,f)=>{const g=mu(t,f,o);return c.top=Ve(g.top,c.top),c.right=It(g.right,c.right),c.bottom=It(g.bottom,c.bottom),c.left=Ve(g.left,c.left),c},mu(t,a,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Hy(e){const{width:t,height:n}=pu(e);return{width:t,height:n}}function Uy(e,t,n){const r=lt(t),o=at(t),s=n==="fixed",i=Gt(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const u=it(0);if(r||!r&&!s)if((gn(t)!=="body"||zn(o))&&(a=qr(t)),r){const h=Gt(t,!0,s,t);u.x=h.x+t.clientLeft,u.y=h.y+t.clientTop}else o&&(u.x=Qs(o));const c=o&&!r&&!s?hu(o,a):it(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 ei(e){return Ze(e).position==="static"}function yu(e,t){if(!lt(e)||Ze(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return at(e)===n&&(n=n.ownerDocument.body),n}function wu(e,t){const n=Be(e);if(Gr(e))return n;if(!lt(e)){let o=$t(e);for(;o&&!hn(o);){if(Ye(o)&&!ei(o))return o;o=$t(o)}return n}let r=yu(e,t);for(;r&&Oy(r)&&ei(r);)r=yu(r,t);return r&&hn(r)&&ei(r)&&!Xs(r)?n:r||Dy(e)||n}const jy=async function(e){const t=this.getOffsetParent||wu,n=this.getDimensions,r=await n(e.floating);return{reference:Uy(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Wy(e){return Ze(e).direction==="rtl"}const Gy={convertOffsetParentRelativeRectToViewportRelativeRect:ky,getDocumentElement:at,getClippingRect:zy,getOffsetParent:wu,getElementRects:jy,getClientRects:$y,getDimensions:Hy,getScale:mn,isElement:Ye,isRTL:Wy};function qy(e,t){let n=null,r;const o=at(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:h}=e.getBoundingClientRect();if(a||t(),!g||!h)return;const p=Hr(f),v=Hr(o.clientWidth-(c+g)),m=Hr(o.clientHeight-(f+h)),y=Hr(c),b={rootMargin:-p+"px "+-v+"px "+-m+"px "+-y+"px",threshold:Ve(0,It(1,u))||1};let S=!0;function E(x){const P=x[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,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,b)}n.observe(e)}return i(!0),s}function Ky(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=Zs(e),f=o||s?[...c?Hn(c):[],...Hn(t)]:[];f.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const g=c&&a?qy(c,n):null;let h=-1,p=null;i&&(p=new ResizeObserver(w=>{let[b]=w;b&&b.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var S;(S=p)==null||S.observe(t)})),n()}),c&&!u&&p.observe(c),p.observe(t));let v,m=u?Gt(e):null;u&&y();function y(){const w=Gt(e);m&&(w.x!==m.x||w.y!==m.y||w.width!==m.width||w.height!==m.height)&&n(),m=w,v=requestAnimationFrame(y)}return n(),()=>{var w;f.forEach(b=>{o&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),g==null||g(),(w=p)==null||w.disconnect(),p=null,u&&cancelAnimationFrame(v)}}const Xy=Py,Jy=Ay,Yy=Ey,Zy=Fy,Qy=Ny,bu=Sy,ew=_y,tw=(e,t,n)=>{const r=new Map,o={platform:Gy,...n},s={...o.platform,_c:r};return Cy(e,t,{...o,platform:s})};var Kr=typeof document<"u"?A.useLayoutEffect:A.useEffect;function Xr(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(!Xr(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)&&!Xr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function xu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Cu(e,t){const n=xu(e);return Math.round(t*n)/n}function ti(e){const t=d.useRef(e);return Kr(()=>{t.current=e}),t}function nw(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}),[h,p]=d.useState(r);Xr(h,r)||p(r);const[v,m]=d.useState(null),[y,w]=d.useState(null),b=d.useCallback(B=>{B!==P.current&&(P.current=B,m(B))},[]),S=d.useCallback(B=>{B!==F.current&&(F.current=B,w(B))},[]),E=s||v,x=i||y,P=d.useRef(null),F=d.useRef(null),O=d.useRef(f),k=u!=null,D=ti(u),G=ti(o),$=ti(c),U=d.useCallback(()=>{if(!P.current||!F.current)return;const B={placement:t,strategy:n,middleware:h};G.current&&(B.platform=G.current),tw(P.current,F.current,B).then(j=>{const le={...j,isPositioned:$.current!==!1};L.current&&!Xr(O.current,le)&&(O.current=le,Qn.flushSync(()=>{g(le)}))})},[h,t,n,G,$]);Kr(()=>{c===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,g(B=>({...B,isPositioned:!1})))},[c]);const L=d.useRef(!1);Kr(()=>(L.current=!0,()=>{L.current=!1}),[]),Kr(()=>{if(E&&(P.current=E),x&&(F.current=x),E&&x){if(D.current)return D.current(E,x,U);U()}},[E,x,U,D,k]);const X=d.useMemo(()=>({reference:P,floating:F,setReference:b,setFloating:S}),[b,S]),q=d.useMemo(()=>({reference:E,floating:x}),[E,x]),te=d.useMemo(()=>{const B={position:n,left:0,top:0};if(!q.floating)return B;const j=Cu(q.floating,f.x),le=Cu(q.floating,f.y);return a?{...B,transform:"translate("+j+"px, "+le+"px)",...xu(q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:le}},[n,a,q.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:U,refs:X,elements:q,floatingStyles:te}),[f,U,X,q,te])}const rw=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?bu({element:r.current,padding:o}).fn(n):{}:r?bu({element:r,padding:o}).fn(n):{}}}},ow=(e,t)=>({...Xy(e),options:[e,t]}),sw=(e,t)=>({...Jy(e),options:[e,t]}),iw=(e,t)=>({...ew(e),options:[e,t]}),aw=(e,t)=>({...Yy(e),options:[e,t]}),lw=(e,t)=>({...Zy(e),options:[e,t]}),cw=(e,t)=>({...Qy(e),options:[e,t]}),uw=(e,t)=>({...rw(e),options:[e,t]});var dw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],fw=dw.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?en: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}},{}),pw="Arrow",Su=d.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return l.jsx(fw.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"})})});Su.displayName=pw;var gw=Su;function Eu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function hw(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Eu(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():Eu(e[o],null)}}}}function Nu(...e){return d.useCallback(hw(...e),e)}var mw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Tu=mw.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?en: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}},{}),ni="Popper",[Pu,Au]=_t(ni),[vw,_u]=Pu(ni),Fu=e=>{const{__scopePopper:t,children:n}=e,[r,o]=d.useState(null);return l.jsx(vw,{scope:t,anchor:r,onAnchorChange:o,children:n})};Fu.displayName=ni;var Ou="PopperAnchor",Du=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=_u(Ou,n),i=d.useRef(null),a=Nu(t,i);return d.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:l.jsx(Tu.div,{...o,ref:a})});Du.displayName=Ou;var ri="PopperContent",[yw,ww]=Pu(ri),Mu=d.forwardRef((e,t)=>{var Ne,et,De,Xt,Vt,tt;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:h=!1,updatePositionStrategy:p="optimized",onPlaced:v,...m}=e,y=_u(ri,n),[w,b]=d.useState(null),S=Nu(t,ze=>b(ze)),[E,x]=d.useState(null),P=Ga(E),F=(P==null?void 0:P.width)??0,O=(P==null?void 0:P.height)??0,k=r+(s!=="center"?"-"+s:""),D=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},G=Array.isArray(c)?c:[c],$=G.length>0,U={padding:D,boundary:G.filter(xw),altBoundary:$},{refs:L,floatingStyles:X,placement:q,isPositioned:te,middlewareData:B}=nw({strategy:"fixed",placement:k,whileElementsMounted:(...ze)=>Ky(...ze,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[ow({mainAxis:o+O,alignmentAxis:i}),u&&sw({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?iw():void 0,...U}),u&&aw({...U}),lw({...U,apply:({elements:ze,rects:Bt,availableWidth:ft,availableHeight:Jt})=>{const{width:Sn,height:C}=Bt.reference,N=ze.floating.style;N.setProperty("--radix-popper-available-width",`${ft}px`),N.setProperty("--radix-popper-available-height",`${Jt}px`),N.setProperty("--radix-popper-anchor-width",`${Sn}px`),N.setProperty("--radix-popper-anchor-height",`${C}px`)}}),E&&uw({element:E,padding:a}),Cw({arrowWidth:F,arrowHeight:O}),h&&cw({strategy:"referenceHidden",...U})]}),[j,le]=$u(q),ce=Ae(v);Re(()=>{te&&(ce==null||ce())},[te,ce]);const xe=(Ne=B.arrow)==null?void 0:Ne.x,Ee=(et=B.arrow)==null?void 0:et.y,Oe=((De=B.arrow)==null?void 0:De.centerOffset)!==0,[Rt,Se]=d.useState();return Re(()=>{w&&Se(window.getComputedStyle(w).zIndex)},[w]),l.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...X,transform:te?X.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Rt,"--radix-popper-transform-origin":[(Xt=B.transformOrigin)==null?void 0:Xt.x,(Vt=B.transformOrigin)==null?void 0:Vt.y].join(" "),...((tt=B.hide)==null?void 0:tt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(yw,{scope:n,placedSide:j,onArrowChange:x,arrowX:xe,arrowY:Ee,shouldHideArrow:Oe,children:l.jsx(Tu.div,{"data-side":j,"data-align":le,...m,ref:S,style:{...m.style,animation:te?void 0:"none"}})})})});Mu.displayName=ri;var Iu="PopperArrow",bw={top:"bottom",right:"left",bottom:"top",left:"right"},ku=d.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=ww(Iu,r),i=bw[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(gw,{...o,ref:n,style:{...o.style,display:"block"}})})});ku.displayName=Iu;function xw(e){return e!==null}var Cw=e=>({name:"transformOrigin",options:e,fn(t){var y,w,b;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]=$u(n),g={start:"0%",center:"50%",end:"100%"}[f],h=(((w=o.arrow)==null?void 0:w.x)??0)+a/2,p=(((b=o.arrow)==null?void 0:b.y)??0)+u/2;let v="",m="";return c==="bottom"?(v=i?g:`${h}px`,m=`${-u}px`):c==="top"?(v=i?g:`${h}px`,m=`${r.floating.height+u}px`):c==="right"?(v=`${-u}px`,m=i?g:`${p}px`):c==="left"&&(v=`${r.floating.width+u}px`,m=i?g:`${p}px`),{data:{x:v,y:m}}}});function $u(e){const[t,n="center"]=e.split("-");return[t,n]}var Sw=Fu,Ew=Du,Nw=Mu,Tw=ku,Pw="Portal",Lu=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);Re(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?po.createPortal(l.jsx(Vn.div,{...r,ref:t}),i):null});Lu.displayName=Pw;function Aw(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var oi=e=>{const{present:t,children:n}=e,r=_w(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=Rn(r.ref,Fw(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};oi.displayName="Presence";function _w(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=Aw(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=Jr(r.current);s.current=a==="mounted"?c:"none"},[a]),Re(()=>{const c=r.current,f=o.current;if(f!==e){const h=s.current,p=Jr(c);e?u("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Re(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const m=Jr(r.current).includes(p.animationName);if(p.target===t&&m&&(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)})}},h=p=>{p.target===t&&(s.current=Jr(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",h),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 Jr(e){return(e==null?void 0:e.animationName)||"none"}function Fw(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 Ow="VisuallyHidden",Ru=d.forwardRef((e,t)=>l.jsx(Vn.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}}));Ru.displayName=Ow;var Dw=Ru,[Yr,yC]=_t("Tooltip",[Au]),Zr=Au(),Vu="TooltipProvider",Mw=700,si="tooltip.open",[Iw,ii]=Yr(Vu),Bu=e=>{const{__scopeTooltip:t,delayDuration:n=Mw,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(Iw,{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})};Bu.displayName=Vu;var Qr="Tooltip",[kw,Un]=Yr(Qr),zu=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,u=ii(Qr,e.__scopeTooltip),c=Zr(t),[f,g]=d.useState(null),h=sn(),p=d.useRef(0),v=i??u.disableHoverableContent,m=a??u.delayDuration,y=d.useRef(!1),[w=!1,b]=rn({prop:r,defaultProp:o,onChange:F=>{F?(u.onOpen(),document.dispatchEvent(new CustomEvent(si))):u.onClose(),s==null||s(F)}}),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,b(!0)},[b]),x=d.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b(!1)},[b]),P=d.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,b(!0),p.current=0},m)},[m,b]);return d.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),l.jsx(Sw,{...c,children:l.jsx(kw,{scope:t,contentId:h,open:w,stateAttribute:S,trigger:f,onTriggerChange:g,onTriggerEnter:d.useCallback(()=>{u.isOpenDelayed?P():E()},[u.isOpenDelayed,P,E]),onTriggerLeave:d.useCallback(()=>{v?x():(window.clearTimeout(p.current),p.current=0)},[x,v]),onOpen:E,onClose:x,disableHoverableContent:v,children:n})})};zu.displayName=Qr;var ai="TooltipTrigger",Hu=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Un(ai,n),s=ii(ai,n),i=Zr(n),a=d.useRef(null),u=Rn(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(Ew,{asChild:!0,...i,children:l.jsx(Vn.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:wt(e.onPointerMove,h=>{h.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:wt(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:wt(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:wt(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:wt(e.onBlur,o.onClose),onClick:wt(e.onClick,o.onClose)})})});Hu.displayName=ai;var li="TooltipPortal",[$w,Lw]=Yr(li,{forceMount:void 0}),Uu=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=Un(li,t);return l.jsx($w,{scope:t,forceMount:n,children:l.jsx(oi,{present:n||s.open,children:l.jsx(Lu,{asChild:!0,container:o,children:r})})})};Uu.displayName=li;var vn="TooltipContent",ju=d.forwardRef((e,t)=>{const n=Lw(vn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=Un(vn,e.__scopeTooltip);return l.jsx(oi,{present:r||i.open,children:i.disableHoverableContent?l.jsx(Wu,{side:o,...s,ref:t}):l.jsx(Rw,{side:o,...s,ref:t})})}),Rw=d.forwardRef((e,t)=>{const n=Un(vn,e.__scopeTooltip),r=ii(vn,e.__scopeTooltip),o=d.useRef(null),s=Rn(t,o),[i,a]=d.useState(null),{trigger:u,onClose:c}=n,f=o.current,{onPointerInTransitChange:g}=r,h=d.useCallback(()=>{a(null),g(!1)},[g]),p=d.useCallback((v,m)=>{const y=v.currentTarget,w={x:v.clientX,y:v.clientY},b=Hw(w,y.getBoundingClientRect()),S=Uw(w,b),E=jw(m.getBoundingClientRect()),x=Gw([...S,...E]);a(x),g(!0)},[g]);return d.useEffect(()=>()=>h(),[h]),d.useEffect(()=>{if(u&&f){const v=y=>p(y,f),m=y=>p(y,u);return u.addEventListener("pointerleave",v),f.addEventListener("pointerleave",m),()=>{u.removeEventListener("pointerleave",v),f.removeEventListener("pointerleave",m)}}},[u,f,p,h]),d.useEffect(()=>{if(i){const v=m=>{const y=m.target,w={x:m.clientX,y:m.clientY},b=(u==null?void 0:u.contains(y))||(f==null?void 0:f.contains(y)),S=!Ww(w,i);b?h():S&&(h(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[u,f,i,c,h]),l.jsx(Wu,{...e,ref:s})}),[Vw,Bw]=Yr(Qr,{isInside:!1}),Wu=d.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,u=Un(vn,n),c=Zr(n),{onClose:f}=u;return d.useEffect(()=>(document.addEventListener(si,f),()=>document.removeEventListener(si,f)),[f]),d.useEffect(()=>{if(u.trigger){const g=h=>{const p=h.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(ru,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:g=>g.preventDefault(),onDismiss:f,children:l.jsxs(Nw,{"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(Fa,{children:r}),l.jsx(Vw,{scope:n,isInside:!0,children:l.jsx(Dw,{id:u.contentId,role:"tooltip",children:o||r})})]})})});ju.displayName=vn;var Gu="TooltipArrow",zw=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Zr(n);return Bw(Gu,n).isInside?null:l.jsx(Tw,{...o,...r,ref:t})});zw.displayName=Gu;function Hw(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 Uw(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 jw(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 Ww(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 Gw(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),qw(t)}function qw(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 Kw=Bu,Xw=zu,Jw=Hu,Yw=Uu,qu=ju;const yn=Kw,wn=Xw,bn=Jw,qt=d.forwardRef(({className:e,sideOffset:t=4,...n},r)=>l.jsx(Yw,{children:l.jsx(qu,{ref:r,sideOffset:t,className:ee("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})}));qt.displayName=qu.displayName;function Zw({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 Qw=d.forwardRef(Zw);var eb=function(e){return function(t,n){var r=A.useRef(!1);e(function(){return function(){r.current=!1}},[]),e(function(){if(!r.current)r.current=!0;else return t()},n)}},Ku=function(e){return typeof e=="function"},Xu=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";const tb=eb(A.useEffect);function Ju(e){var t=A.useRef(e);return t.current=e,t}var nb=function(e){Xu&&(Ku(e)||console.error("useUnmount expected parameter is a function, got ".concat(typeof e)));var t=Ju(e);A.useEffect(function(){return function(){t.current()}},[])},eo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ob(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Yu=ob,sb=typeof eo=="object"&&eo&&eo.Object===Object&&eo,ib=sb,ab=ib,lb=typeof self=="object"&&self&&self.Object===Object&&self,cb=ab||lb||Function("return this")(),Zu=cb,ub=Zu,db=function(){return ub.Date.now()},fb=db,pb=/\s/;function gb(e){for(var t=e.length;t--&&pb.test(e.charAt(t)););return t}var hb=gb,mb=hb,vb=/^\s+/;function yb(e){return e&&e.slice(0,mb(e)+1).replace(vb,"")}var wb=yb,bb=Zu,xb=bb.Symbol,Qu=xb,ed=Qu,td=Object.prototype,Cb=td.hasOwnProperty,Sb=td.toString,jn=ed?ed.toStringTag:void 0;function Eb(e){var t=Cb.call(e,jn),n=e[jn];try{e[jn]=void 0;var r=!0}catch{}var o=Sb.call(e);return r&&(t?e[jn]=n:delete e[jn]),o}var Nb=Eb,Tb=Object.prototype,Pb=Tb.toString;function Ab(e){return Pb.call(e)}var _b=Ab,nd=Qu,Fb=Nb,Ob=_b,Db="[object Null]",Mb="[object Undefined]",rd=nd?nd.toStringTag:void 0;function Ib(e){return e==null?e===void 0?Mb:Db:rd&&rd in Object(e)?Fb(e):Ob(e)}var kb=Ib;function $b(e){return e!=null&&typeof e=="object"}var Lb=$b,Rb=kb,Vb=Lb,Bb="[object Symbol]";function zb(e){return typeof e=="symbol"||Vb(e)&&Rb(e)==Bb}var Hb=zb,Ub=wb,od=Yu,jb=Hb,sd=NaN,Wb=/^[-+]0x[0-9a-f]+$/i,Gb=/^0b[01]+$/i,qb=/^0o[0-7]+$/i,Kb=parseInt;function Xb(e){if(typeof e=="number")return e;if(jb(e))return sd;if(od(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=od(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Ub(e);var n=Gb.test(e);return n||qb.test(e)?Kb(e.slice(2),n?2:8):Wb.test(e)?sd:+e}var Jb=Xb,Yb=Yu,ci=fb,id=Jb,Zb="Expected a function",Qb=Math.max,ex=Math.min;function tx(e,t,n){var r,o,s,i,a,u,c=0,f=!1,g=!1,h=!0;if(typeof e!="function")throw new TypeError(Zb);t=id(t)||0,Yb(n)&&(f=!!n.leading,g="maxWait"in n,s=g?Qb(id(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h);function p(P){var F=r,O=o;return r=o=void 0,c=P,i=e.apply(O,F),i}function v(P){return c=P,a=setTimeout(w,t),f?p(P):i}function m(P){var F=P-u,O=P-c,k=t-F;return g?ex(k,s-O):k}function y(P){var F=P-u,O=P-c;return u===void 0||F>=t||F<0||g&&O>=s}function w(){var P=ci();if(y(P))return b(P);a=setTimeout(w,m(P))}function b(P){return a=void 0,h&&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:b(ci())}function x(){var P=ci(),F=y(P);if(r=arguments,o=this,u=P,F){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 x.cancel=S,x.flush=E,x}var nx=tx;const rx=rb(nx);function ox(){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}ox()||(global.Date=Date);function sx(e,t){var n;Xu&&(Ku(e)||console.error("useDebounceFn expected parameter is a function, got ".concat(typeof e)));var r=Ju(e),o=(n=t==null?void 0:t.wait)!==null&&n!==void 0?n:1e3,s=A.useMemo(function(){return rx(function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return r.current.apply(r,hl([],gl(i),!1))},o,t)},[]);return nb(function(){s.cancel()}),{run:s,cancel:s.cancel,flush:s.flush}}function ix(e,t,n){var r=gl(A.useState({}),2),o=r[0],s=r[1],i=sx(function(){s({})},n).run;A.useEffect(function(){return i()},t),tb(e,[o])}const ax=A.forwardRef(({onChange:e},t)=>{const n=A.useRef(null),[r,o]=A.useState("");return A.useImperativeHandle(t,()=>({setValue:s=>{var i;o(s),(i=n.current)==null||i.focus()}})),ix(()=>{e==null||e(r)},[r],{wait:300}),l.jsxs(l.Fragment,{children:[l.jsx(Mt,{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(Qw,{className:"h-5 w-5"})})]})}),lx=({openDialogRename:e,setOpenDialogRename:t,apiBaseUrl:n,setFileToMove:r,fileToMove:o,refreshFiles:s,ignoreCache:i})=>{var b;const[a,u]=A.useState({}),[c,f]=A.useState(!1),[g,h]=A.useState(!1),[p,v]=A.useState(""),{toast:m}=Br();A.useEffect(()=>{e&&y(p)},[p,e]);const y=async S=>{try{h(!0);const E=await se.get(`${n}/api/list-s3-folders?prefix=${S}`);u(E==null?void 0:E.data)}catch{m({title:"Error",description:"Unable to load S3 folder list",variant:"destructive"})}finally{h(!1)}},w=async()=>{f(!0);try{const S=o.key;await se.post(`${n}/api/move`,{oldPath:S,newPath:p}),i.current=!0,await s(),m({title:"Đã đổi tên",description:`Đã đổi tên thành công "${o.name}" thành "${p}"`}),t(!1),r(null),v("")}catch(S){console.error("Error renaming item:",S),m({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{f(!1)}};return l.jsx(Dt,{open:e,onOpenChange:S=>{S||(t(!1),r(null),v(""))},children:l.jsxs(mt,{className:"max-h-[700px] pb-3 px-1 s3-explr-input-group max-w-5xl w-[90%] p-6 bg-white rounded-lg shadow-lg",children:[l.jsxs(vt,{className:"mb-4 w-full h-full",children:[l.jsx("nav",{className:"mb-4",children:l.jsxs("ul",{className:"flex items-center space-x-2 text-sm text-gray-600",children:[l.jsx("li",{className:"cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>v(""),children:"Root"}),p.split("/").map((S,E,x)=>l.jsx("li",{className:"cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>v(S==="Root"?"":x.slice(0,E+1).join("/")+"/"),children:S},E))]})}),l.jsxs(yt,{className:"text-xl font-semibold text-gray-800",children:["Di chuyển"," ",l.jsxs("span",{className:"text-sm text-gray-500",children:["( file Hoặc folder sẽ được di chuyển đến thư mục"," ",p===""?"Root":p," )"]})]}),l.jsx(kn,{className:"text-gray-600 w-full h-[50dvh] max-h-[500px] overflow-hidden overflow-y-auto",children:g?l.jsx("div",{className:"flex justify-center items-center py-4",children:l.jsx("div",{className:"loader ease-linear rounded-full border-4 border-t-4 border-gray-200 h-12 w-12"})}):l.jsx("ul",{className:"space-y-2",children:(b=Object.keys(a))==null?void 0:b.map(S=>l.jsx("li",{className:"cursor-pointer hover:bg-gray-100 p-2 rounded transition-colors",onClick:()=>v(S),children:S},S))})})]}),l.jsxs(dn,{className:"flex justify-end space-x-2",children:[l.jsx(ie,{variant:"outline",onClick:()=>t(!1),className:"px-4 py-2 rounded border border-gray-300 text-gray-700 hover:bg-gray-100 transition-colors",children:"Cancel"}),l.jsx(ie,{onClick:w,disabled:c,className:"s3-explr-crawl-btn",children:"Move"})]})]})})},_e={current:!1},ad="crawl:jobs",xn="crawl:current_job",cx=e=>{const[t,n]=A.useState(null),[r,o]=A.useState(0);return A.useEffect(()=>{const s=localStorage.getItem(xn);if(s){const i=JSON.parse(s);n(i),i!=null&&i.startTime&&o(Math.floor((Date.now()-i.startTime)/1e3))}},[]),A.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]),A.useEffect(()=>{if(!(t!=null&&t.id))return;const s=async()=>{try{const u=(await se.get(`${e}/api/crawl/${t.id}?taskId=${t.taskId}`)).data;n(c=>{if(!c)return null;const f={...c,status:u};return localStorage.setItem(xn,JSON.stringify(f)),(u.status==="completed"||u.status==="failed")&&setTimeout(()=>{n(null),localStorage.removeItem(xn)},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(xn,JSON.stringify(s)):localStorage.removeItem(xn)}}},to=(e,t)=>{const n=[],r=o=>{(e[o]||[]).forEach(i=>{n.push(i.key),i.isFolder&&r(i.key)})};return r(t),n},ux=(e,t)=>{const n=[];return(e[t]||[]).forEach(o=>{n.push(o.key),o.isFolder&&n.push(...to(e,o.key))}),n},dx=(e,t,n=[],r)=>{const[o,s]=A.useState({}),[i,a]=A.useState(!1),[u,c]=A.useState(null),f=A.useRef(t);A.useEffect(()=>{f.current=t},[t]);const g=async()=>{a(!0);try{const p=!_e.current;_e.current&&(_e.current=!1);const v=await se.get(`${e}/api/files`,{params:{cache:p,displayPrefixes:JSON.stringify(n),prefix:f.current},timeout:3e5});s(v.data),c(null)}catch(p){c(p instanceof Error?p:new Error("Failed to fetch files"))}finally{a(!1)}};A.useEffect(()=>{g()},[]);const h=async p=>{try{if(!p)return;a(!0);const v=await se.get(`${e}/api/search-db?query=${p}`,{timeout:3e5});return s({[t]:v.data}),v}catch(v){c(v instanceof Error?v:new Error("Failed to fetch files"))}finally{a(!1)}};return A.useEffect(()=>{!r&&!i&&g(),r&&!i&&h(r)},[r]),{data:o,isLoading:i,error:u,refetch:g}},Wn=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||"")},fx=A.memo(({homeLabel:e="Kho tài liệu",apiBaseUrl:t="http://localhost:3002",rootPrefix:n="",asSelector:r=!1,onSelected:o=a=>console.log("Đã chọn:",a),displayPrefixes:s,preSelectedFiles:i})=>{var Dd;const[a,u]=A.useState([]),[c,f]=A.useState(""),[g,h]=A.useState(new Set),[p,v]=A.useState(n),[m,y]=A.useState(null),[w,b]=A.useState(!1),[S,E]=A.useState(""),[x,P]=A.useState(!1),[F,O]=A.useState(null),[k,D]=A.useState(null),[G,$]=A.useState(!1),[U,L]=A.useState(!1),[X,q]=A.useState(null),te=A.useRef(null),{toast:B}=Br(),[j,le]=A.useState(null),[ce,xe]=A.useState(null),[Ee,Oe]=A.useState(""),[Rt,Se]=A.useState(!1),[Ne,et]=A.useState(!1),[De,Xt]=A.useState(new Set),[Vt,tt]=A.useState(""),[ze,Bt]=A.useState(!1),[ft,Jt]=A.useState(!1),[Sn,C]=A.useState("rename"),[N,_]=A.useState(!1),[z,V]=A.useState(""),[R,J]=A.useState("1"),[ne,me]=A.useState(!1),[Ce,pt]=A.useState(!1),[lo,En]=A.useState(!1),[Nn,co]=A.useState(!1),{currentJob:ue,elapsedTime:Tn,setCurrentJob:Yn}=cx(t),Lx=m||n,{data:nt,isLoading:Si,error:Rx,refetch:We}=dx(t,Lx,s,c);A.useEffect(()=>{const M=new Set(i);h(M)},[]),A.useEffect(()=>{ue!=null&&ue.status&&(ue.status.status==="completed"?(B({title:"Thu thập website hoàn tất",description:`Đã thu thập thành công ${ue.url} với ${ue.status.completed} trang`}),_e.current=!0,We()):ue.status.status==="failed"&&B({title:"Thu thập website thất bại",description:`Không thể thu thập ${ue.url}. Vui lòng thử lại.`,variant:"destructive"}))},[(Dd=ue==null?void 0:ue.status)==null?void 0:Dd.status]);const Ei=A.useMemo(()=>nt[p]||[],[nt,p]);console.log({data:Ei,fileSystem:nt});const Yt=A.useMemo(()=>Ei,[Ei,p,nt]),Zn=A.useMemo(()=>{const M={};return Yt.forEach((I,H)=>{g.has(I.key)&&(M[H]=!0)}),M},[g,Yt]),Vx=M=>{const I=to(nt,M);if(I.length===0)return g.has(M)?"all":"none";const H=I.filter(K=>g.has(K)).length;return H===0?"none":H===I.length?"all":"partial"},uo=M=>{p!==M&&(co(!0),y(M),v(M),h(new Set))};A.useEffect(()=>{Nn&&(_e.current=!0,We().finally(()=>co(!1)))},[Nn]);const Bx=async(M,I)=>{P(!0);try{const H=`${I}${M}/`;if((await se.post(`${t}/api/create-folder`,{prefix:H})).status!==200){B({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"});return}_e.current=!0,await We(),B({title:"Đã tạo thư mục",description:`Đã tạo thành công thư mục "${M}"`}),E(""),b(!1)}catch(H){console.error("Error creating folder:",H),B({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"})}finally{P(!1)}},Ad=async(M,I,H)=>{q(H),pt(!0);try{let K=localStorage.getItem("dataLogin"),Q;try{K&&(K=JSON.parse(K),Q=K.user)}catch{K=null}if(Q&&(Q==null?void 0:Q.role)!=="MASTER_ADMIN"&&pg(M,B))return;const ae=new FormData;ae.append("prefix",I),Array.from(M).forEach(ge=>ae.append("files",ge)),Q!=null&&Q.id&&(console.log("🚀 ~ uploadFiles ~ user:",Q),ae.append("metadata",JSON.stringify({creator:Q.username,creatorId:Q.id,DataSource:"Tệp tải lên"}))),await se.post(`${t}/api/upload`,ae,{headers:{"Content-Type":"multipart/form-data"}}),y(I),_e.current=!0,await We()}catch(K){console.error("Lỗi tải lên:",K)}finally{q(null),pt(!1)}},zx=async M=>{var I;En(!0);try{await se.delete(`${t}/api/files`,{data:{paths:[M.key]}});const H=((I=M.key)==null?void 0:I.replace(/^(.*?)(\/.*)?$/,(K,Q,ae)=>!ae||ae==="/"?"":Q+"/"))||"";y(H),_e.current=!0,B({title:"Đã xóa tập tin",description:`Đã xóa thành công "${M.name}"`}),O(null)}catch(H){console.error("Error deleting file:",H),B({title:"Lỗi",description:"Không thể xóa tập tin",variant:"destructive"})}finally{En(!1),await We()}},fo=M=>{const I=new Set(g),H=typeof M=="function"?M(Zn):M;new Set(Object.keys(Zn).map(Number)).forEach(Q=>{const ae=Yt[Q];ae&&(H[Q]||(I.delete(ae.key),ae.isFolder&&to(nt,ae.key).forEach(ge=>I.delete(ge))))}),Object.entries(H).forEach(([Q,ae])=>{const ge=parseInt(Q),Et=Yt[ge];Et&&ae&&(I.add(Et.key),Et.isFolder&&to(nt,Et.key).forEach(Ti=>I.add(Ti)))}),h(I)},Hx=async()=>{var M;$(!0);try{const I=Array.from(g),H=I.map(Q=>Object.values(nt).flat().find(ae=>ae.key===Q)).filter(Q=>Q!==void 0);if(H.length===0){B({title:"Lỗi",description:"Không có tập tin nào được chọn để xóa",variant:"destructive"});return}await se.delete(`${t}/api/files`,{data:{paths:I}});const K=((M=H[0])==null?void 0:M.key.replace(/^(.*?)(\/.*)?$/,(Q,ae,ge)=>!ge||ge==="/"?"":ae+"/"))||"";y(K),_e.current=!0,We(),B({title:"Đã xóa tập tin",description:`Đã xóa thành công ${H.length} mục`}),L(!1),h(new Set)}catch(I){console.error("Error deleting files:",I),B({title:"Lỗi",description:"Không thể xóa các tập tin đã chọn",variant:"destructive"})}finally{$(!1)}},Ux=async(M,I)=>{et(!0);try{const H=M.key;let K;M.isFolder?K=H.split("/").slice(0,-2).join("/")+"/":K=H.substring(0,H.lastIndexOf("/")+1);const Q=K+I+(M.isFolder?"/":"");await se.post(`${t}/api/rename`,{oldPath:H,newPath:Q}),_e.current=!0,await We(),B({title:"Đã đổi tên",description:`Đã đổi tên thành công "${M.name}" thành "${I}"`}),le(null),Oe(""),xe(null)}catch(H){console.error("Error renaming item:",H),B({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{et(!1)}},_d=async M=>{Xt(I=>new Set([...I,...M]));try{const I=await se.post(`${t}/api/download`,{paths:M},{responseType:"blob"}),H=window.URL.createObjectURL(I.data),K=document.createElement("a");K.href=H;const Q=I.headers["Content-Disposition"]||I.headers["content-disposition"],ae=Q==null?void 0:Q.match(/filename="(.+)"/),ge=ae?decodeURIComponent(ae[1]):"download.zip";K.setAttribute("download",ge),document.body.appendChild(K),K.click(),document.body.removeChild(K),window.URL.revokeObjectURL(H),B({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),B({title:"Lỗi",description:"Không thể tải xuống tập tin",variant:"destructive"})}finally{Xt(I=>{const H=new Set(I);return M.forEach(K=>H.delete(K)),H})}},Fd=p?p.replace(n,"").split("/").filter(Boolean):[],jx=()=>Array.from(g).map(M=>{var I;for(const H in nt){const K=(I=nt[H])==null?void 0:I.find(Q=>Q.key===M);if(K)return K}return null}).filter(M=>M!==null),Od=A.useMemo(()=>{const M=[{id:"select",header:()=>{const I=ux(nt,p),H=I.length>0&&I.every(Q=>g.has(Q)),K=I.some(Q=>g.has(Q));return l.jsx(rs,{checked:H?!0:K?"indeterminate":!1,onCheckedChange:Q=>{if(Q){const ae=Yt.reduce((ge,Et,Ti)=>(ge[Ti]=!0,ge),{});fo(ae)}else fo({})},"aria-label":"Chọn tất cả"})},cell:({row:I})=>{const H=I.original,Q=H.isFolder?Vx(H.key):g.has(H.key)?"all":"none";return l.jsx("div",{className:"flex items-center",children:l.jsx(rs,{checked:Q==="partial"?"indeterminate":Q==="all",onCheckedChange:ae=>{const ge={...Zn};ae?ge[I.index]=!0:delete ge[I.index],fo(ge)},"aria-label":"Chọn dòng"})})},enableSorting:!1},{id:"fileName",header:({column:I})=>l.jsxs(ie,{variant:"ghost",onClick:()=>I.toggleSorting(I.getIsSorted()==="asc"),children:["Tên tập tin",l.jsx(Wo,{})]}),accessorKey:"name",cell:({row:I})=>{const H=I.original,K=H.key.substring(0,H.key.lastIndexOf("/"))||"/",Q=c.trim()!==""&&K!==p,ae=K.split("/").filter(Boolean);return l.jsxs("div",{className:"flex flex-col",children:[l.jsxs("div",{className:`flex items-center gap-2 ${H.isFolder?"cursor-pointer hover:text-blue-600":""}`,onClick:()=>{H.isFolder&&(h(new Set),uo(H.key))},children:[H.isFolder?l.jsx(go,{className:"h-5 w-5 text-blue-500"}):null,H.name]}),Q&&l.jsxs("div",{className:"text-sm text-gray-500 flex items-center",children:[l.jsx(go,{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:()=>{uo("")},children:"/"}),ae.map((ge,Et)=>l.jsxs("span",{className:"flex items-center",children:[l.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{uo(ae.slice(0,Et+1).join("/")+"/")},children:ge}),Et<ae.length-1&&l.jsx("span",{children:"/"})]},Et))]})]})]})}}];return r||M.push({id:"size",header:({column:I})=>l.jsxs(ie,{variant:"ghost",onClick:()=>I.toggleSorting(I.getIsSorted()==="asc"),children:["Kích thước",l.jsx(Wo,{})]}),accessorKey:"size",cell:({getValue:I,row:H})=>{const K=I();return l.jsx("span",{children:H.original.isFolder?"-":Xg(K)})}},{id:"lastModified",header:({column:I})=>l.jsxs(ie,{variant:"ghost",onClick:()=>I.toggleSorting(I.getIsSorted()==="asc"),children:["Sửa đổi lần cuối",l.jsx(Wo,{})]}),accessorKey:"lastModified",cell:({row:I})=>{const H=I.original.lastModified;return l.jsx("span",{children:H.toLocaleString()})}},{id:"actions",header:()=>l.jsx("span",{children:"Hành động"}),accessorKey:"key",cell:({row:I})=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(yn,{children:l.jsxs(wn,{children:[l.jsx(bn,{asChild:!0,children:l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>_d([I.original.key]),className:"h-8 w-8 p-0",disabled:De.has(I.original.key),children:De.has(I.original.key)?l.jsx(ve,{className:"h-4 w-4 animate-spin"}):l.jsx(Ai,{className:"h-4 w-4"})})}),l.jsx(qt,{children:"Tải xuống"})]})}),l.jsx(yn,{children:l.jsxs(wn,{children:[l.jsx(bn,{asChild:!0,children:l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>{le(I.original),Oe(I.original.name)},className:"h-8 w-8 p-0",children:l.jsx(jd,{className:"h-4 w-4"})})}),l.jsx(qt,{children:"Đổi tên"})]})}),l.jsx(yn,{children:l.jsxs(wn,{children:[l.jsx(bn,{asChild:!0,children:l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>{Se(!0),D(I.original)},className:"h-8 w-8 p-0",children:l.jsx(lg,{className:"h-4 w-4"})})}),l.jsx(qt,{children:"Di chuyển"})]})}),l.jsx(yn,{children:l.jsxs(wn,{children:[l.jsx(bn,{asChild:!0,children:l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>O(I.original),className:"h-8 w-8 p-0",children:l.jsx(_i,{className:"h-4 w-4"})})}),l.jsx(qt,{children:"Xóa"})]})})]})}),M},[g,Yt,Zn,De,r]),Ni=Hi({data:Yt,columns:Od,state:{rowSelection:Zn,sorting:a},onSortingChange:u,enableRowSelection:!0,onRowSelectionChange:fo,getCoreRowModel:zi(),getSortedRowModel:Pf()}),Wx=async M=>{var I,H;Bt(!0);try{if(Wn(M)){const K=await se.get(`${t}/api/read-text`,{params:{path:M.key}});tt(K.data.content)}try{const K=await se.get(`${t}/api/read-json`,{params:{path:M.key+".metadata.json"}}),Q=((H=(I=K==null?void 0:K.data)==null?void 0:I.content)==null?void 0:H.metadataAttributes)||null;return xe({fullPath:j==null?void 0:j.key,...Q})}catch{return xe("Lỗi phân tích siêu dữ liệu")}}catch(K){console.error("Error loading file content:",K),B({title:"Lỗi",description:"Không thể tải nội dung tập tin",variant:"destructive"})}finally{Bt(!1)}},Gx=async(M,I)=>{Jt(!0);try{await se.post(`${t}/api/modify-text`,{path:M.key,content:I}),B({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),_e.current=!0,await We(),le(null),tt(""),C("rename")}catch(H){console.error("Error saving file content:",H),B({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{Jt(!1)}},qx=async M=>{Jt(!0);try{console.log("🚀 ~ saveJsonFile ~ metadataForEdit:",ce),await se.post(`${t}/api/modify-json`,{path:M.key+".metadata.json",content:{metadataAttributes:ce}}),B({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),_e.current=!0,await We(),le(null),tt(""),C("rename")}catch(I){console.error("Error saving file content:",I),B({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{Jt(!1)}};A.useEffect(()=>{j&&(j.isFolder||Wx(j),C("rename"))},[j]);const Kx=async(M,I)=>{var H;if(ue){B({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}me(!0);try{const{data:K}=await se.post(`${t}/api/crawl`,{url:M,limit:I,prefix:p});if(K.id){Yn({id:K.id,url:M,limit:I,prefix:p,taskId:((H=K.task)==null?void 0:H.id)||""});const Q=localStorage.getItem(ad),ae=Q?JSON.parse(Q):[];ae.some(ge=>ge.id===K.id)||(ae.unshift({url:M,id:K.id,limit:I,prefix:p,timestamp:Date.now()}),ae.length>20&&(ae.length=20),localStorage.setItem(ad,JSON.stringify(ae))),B({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.`}),_(!1),V(""),J("1")}}catch(K){console.error("Error crawling website:",K),B({title:"Lỗi",description:"Không thể bắt đầu thu thập website",variant:"destructive"})}finally{me(!1)}},Xx=async()=>{try{if(!(ue!=null&&ue.id))return;Yn(null),localStorage.removeItem(xn),B({title:"Đã dừng thu thập",description:`Đã dừng thu thập website ${ue.url}`})}catch(M){console.error("Error stopping job:",M),B({title:"Lỗi",description:"Không thể dừng thu thập website",variant:"destructive"})}};return l.jsxs("div",{className:"space-y-4 s3-explr-container",children:[l.jsx(Ba,{className:"s3-explr-breadcrumb",children:l.jsxs(za,{className:"s3-explr-breadcrumb-list",children:[l.jsx(Zo,{className:"s3-explr-breadcrumb-item",children:l.jsx(Qo,{onClick:()=>{p!==""&&h(new Set),y(""),v(""),_e.current=!0,setTimeout(()=>{We()},0)},className:"flex items-center gap-1 cursor-pointer s3-explr-breadcrumb-home",children:e})}),Fd.map((M,I)=>l.jsxs(l.Fragment,{children:[l.jsx(Ha,{className:"s3-explr-breadcrumb-separator"},`sep-${I}`),l.jsx(Zo,{className:"s3-explr-breadcrumb-item",children:l.jsx(Qo,{onClick:()=>uo(n+Fd.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(ax,{ref:te,onChange:M=>f(M)})}),l.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>{y(p),_e.current=!0,We()},disabled:Si,className:"flex items-center gap-2 s3-explr-refresh-btn",children:[l.jsx(kd,{className:`h-4 w-4 s3-explr-refresh-icon ${Si?"animate-spin":""}`}),"Làm mới"]}),!r&&l.jsxs(l.Fragment,{children:[g.size>0&&l.jsxs(l.Fragment,{children:[l.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>_d(Array.from(g)),disabled:Array.from(g).some(M=>De.has(M)),className:"flex items-center gap-2 s3-explr-download-selected-btn",children:[Array.from(g).some(M=>De.has(M))?l.jsx(ve,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}):l.jsx(Ai,{className:"h-4 w-4 s3-explr-download-icon"}),"Tải xuống đã chọn (",g.size,")"]}),l.jsxs(Dt,{open:U,onOpenChange:L,children:[l.jsx(Tr,{asChild:!0,children:l.jsxs(ie,{variant:"destructive",size:"sm",className:"flex items-center gap-2 s3-explr-bulk-delete-btn",children:[l.jsx(_i,{className:"h-4 w-4 s3-explr-trash-icon"}),"Xóa đã chọn (",g.size,")"]})}),l.jsxs(mt,{className:"s3-explr-dialog-content",children:[l.jsxs(vt,{className:"s3-explr-dialog-header",children:[l.jsx(yt,{className:"s3-explr-dialog-title",children:"Xác nhận xóa hàng loạt"}),l.jsxs(kn,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",g.size," mục đã chọn? Hành động này không thể hoàn tác."]})]}),l.jsxs(dn,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>L(!1),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(ie,{variant:"destructive",onClick:Hx,disabled:G,className:"s3-explr-confirm-delete-btn",children:G?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa đã chọn"})]})]})]})]}),l.jsxs(Dt,{open:w,onOpenChange:b,children:[l.jsx(Tr,{asChild:!0,children:l.jsxs(ie,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-new-folder-btn",disabled:!!s&&!p,children:[l.jsx(Vd,{className:"h-4 w-4 s3-explr-folder-plus-icon"}),"Thư mục mới"]})}),l.jsxs(mt,{className:"s3-explr-dialog-content",children:[l.jsx(vt,{className:"s3-explr-dialog-header",children:l.jsx(yt,{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(Wt,{htmlFor:"name",className:"s3-explr-label",children:"Tên thư mục"}),l.jsx(Mt,{disabled:x,id:"name",value:S,onChange:M=>E(M.target.value),placeholder:"Nhập tên thư mục",className:"s3-explr-input"})]}),l.jsxs(ie,{onClick:()=>{S.trim()&&Bx(S,p)},disabled:x,className:"s3-explr-create-btn",children:[x&&l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),x?"Đang tạo...":"Tạo"]})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2 s3-explr-upload-group",children:[l.jsx(ie,{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 H=I.target.files;H&&Ad(H,p,"files")},M.click()},disabled:X!==null||!!s&&!p,children:X==="files"?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Ld,{className:"h-4 w-4 s3-explr-upload-icon"}),"Tải lên tập tin"]})}),l.jsx(ie,{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 H=I.target.files;H&&Ad(H,p,"folder")},M.click()},disabled:X!==null||!!s&&!p,children:X==="folder"?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(go,{className:"h-4 w-4 s3-explr-folder-icon"}),"Tải lên thư mục"]})}),ue?l.jsx(yn,{delayDuration:0,children:l.jsxs(wn,{children:[l.jsx(bn,{asChild:!0,children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(ie,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!0,children:[l.jsx(ve,{className:"h-4 w-4 animate-spin s3-explr-loader"}),ue.status?l.jsxs(l.Fragment,{children:["Đang thu thập (",ue.status.completed,"/",ue.status.total,") - ",Math.floor(Tn/60),":",String(Tn%60).padStart(2,"0")]}):"Đang thu thập..."]}),l.jsxs(ie,{variant:"destructive",size:"sm",onClick:()=>void Xx(),className:"flex items-center gap-2",children:[l.jsx("span",{className:"sr-only",children:"Dừng thu thập"}),l.jsx(Gd,{className:"h-4 w-4"})]})]})}),ue.status&&l.jsx(qt,{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 ",ue.url]}),l.jsxs("p",{children:["Tiến độ: ",ue.status.completed,"/",ue.status.total," trang"]}),l.jsxs("p",{children:["Thời gian: ",Math.floor(Tn/60),":",String(Tn%60).padStart(2,"0")]}),l.jsxs("p",{children:["Trạng thái:"," ",ue.status.status==="scraping"?"Đang thu thập":ue.status.status==="completed"?"Hoàn thành":"Thất bại"]})]})})]})}):l.jsxs(Dt,{open:N,onOpenChange:_,children:[l.jsx(Tr,{asChild:!0,children:l.jsxs(ie,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!!s&&!p,children:[l.jsx(Hd,{className:"h-4 w-4 s3-explr-globe-icon"}),"Thêm website"]})}),l.jsxs(mt,{className:"s3-explr-dialog-content",children:[l.jsxs(vt,{className:"s3-explr-dialog-header",children:[l.jsx(yt,{className:"s3-explr-dialog-title",children:"Thêm website"}),l.jsx(kn,{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(Wt,{htmlFor:"websiteUrl",className:"s3-explr-label",children:"URL Website"}),l.jsx(Mt,{id:"websiteUrl",value:z,onChange:M=>V(M.target.value),placeholder:"https://example.com",type:"url",disabled:ne,className:"s3-explr-input"})]}),l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(Wt,{htmlFor:"crawlLimit",className:"s3-explr-label",children:"Giới hạn thu thập"}),l.jsx(Mt,{id:"crawlLimit",value:R,onChange:M=>{const I=M.target.value;/^\d*$/.test(I)&&J(I)},placeholder:"1",type:"text",disabled:ne,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(dn,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>{_(!1),V(""),J("1")},disabled:ne,className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(ie,{onClick:()=>{z.trim()&&Kx(z.trim(),parseInt(R)||1)},disabled:ne||!z.trim(),className:"s3-explr-crawl-btn",children:ne?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]}):"Bắt đầu thu thập"})]})]})]})]}),l.jsx(Dt,{open:!!F,onOpenChange:M=>!M&&O(null),children:l.jsxs(mt,{className:"s3-explr-dialog-content",children:[l.jsxs(vt,{className:"s3-explr-dialog-header",children:[l.jsx(yt,{className:"s3-explr-dialog-title",children:"Xác nhận xóa"}),l.jsxs(kn,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",F==null?void 0:F.name,"? Hành động này không thể hoàn tác."]})]}),l.jsxs(dn,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>O(null),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(ie,{variant:"destructive",onClick:()=>zx(F),disabled:lo,className:"s3-explr-confirm-delete-btn",children:lo?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa"})]})]})}),l.jsx(Dt,{open:!!j,onOpenChange:M=>{M||(le(null),xe(null),Oe(""),tt(""),C("rename"))},children:l.jsxs(mt,{className:"s3-explr-dialog-content max-w-5xl w-[90%]",children:[l.jsx(vt,{className:"s3-explr-dialog-header",children:l.jsx(yt,{className:"s3-explr-dialog-title",children:j!=null&&j.isFolder?"Đổi tên thư mục":Wn(j)?"Quản lý tập tin":"Đổi tên tập tin"})}),j&&l.jsxs(Sv,{value:Sn,onValueChange:M=>C(M),children:[l.jsxs(Tc,{"aria-checked":!Wn(j),"aria-disabled":j.isFolder,className:"grid w-full grid-cols-3 aria-checked:grid-cols-2 aria-disabled:grid-cols-1",children:[l.jsx(Mr,{value:"rename",children:"Đổi tên"}),!j.isFolder&&l.jsxs(l.Fragment,{children:[Wn(j)&&l.jsx(Mr,{value:"edit",children:"Sửa nội dung"}),l.jsx(Mr,{value:"edit-metadata",children:"Sửa metadata file"})]})]}),l.jsx(Ir,{value:"rename",children:l.jsx("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:l.jsxs("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1 s3-explr-input-group",children:[l.jsx(Wt,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),l.jsx(Mt,{id:"newName",value:Ee,onChange:M=>Oe(M.target.value),placeholder:"Nhập tên mới",disabled:Ne,className:"s3-explr-input"})]})})}),!j.isFolder&&l.jsxs(l.Fragment,{children:[Wn(j)&&l.jsx(Ir,{value:"edit",children:l.jsx("div",{className:"space-y-4 py-4",children:ze?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx(ve,{className:"h-6 w-6 animate-spin"})}):l.jsxs("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1",children:[l.jsx(Wt,{htmlFor:"content",className:"s3-explr-label",children:"Nội dung tập tin"}),l.jsx($n,{id:"content",value:Vt,onChange:M=>tt(M.target.value),placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:ft})]})})}),l.jsx(Ir,{value:"edit-metadata",children:l.jsx("div",{className:"space-y-4 py-4",children:ze?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx(ve,{className:"h-6 w-6 animate-spin"})}):l.jsx("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1",children:ce&&typeof ce=="object"&&Object.entries(ce).map(([M,I])=>l.jsxs("div",{className:"pb-3 flex flex-col gap-2",children:[l.jsxs(Wt,{htmlFor:M,className:"s3-explr-label flex items-center gap-1",children:[dg[M]||M,qo(M)&&l.jsx(cg,{className:"h-[12px] w-[12px] text-red-500"})]}),fg(M)?l.jsx($n,{id:M,value:typeof I=="string"?I:JSON.stringify(I),onChange:H=>{const K={...ce,[M]:H.target.value};xe(K)},placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:ft||qo(M)}):l.jsx(Mt,{id:M,value:typeof I=="string"?I:JSON.stringify(I),onChange:H=>{const K={...ce,[M]:H.target.value};xe(K)},placeholder:"Nhập nội dung",className:"s3-explr-input",disabled:ft||qo(M)})]},M))})})})]})]}),l.jsxs(dn,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>{le(null),xe(null),Oe(""),tt("")},className:"s3-explr-cancel-btn",children:"Hủy"}),Sn==="edit"?l.jsx(ie,{onClick:()=>j&&Gx(j,Vt),disabled:ft||ze,className:"s3-explr-save-btn",children:ft?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):Sn==="edit-metadata"?l.jsx(ie,{onClick:()=>ce&&typeof ce=="object"&&j&&qx(j),disabled:ft||ze,className:"s3-explr-save-btn",children:ft?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):l.jsx(ie,{onClick:()=>{Ee.trim()&&j&&Ux(j,Ee.trim())},disabled:Ne||!Ee.trim()||Ee.trim()===(j==null?void 0:j.name),className:"s3-explr-rename-btn",children:Ne?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang đổi tên..."]}):"Đổi tên"})]})]})}),k&&Rt&&l.jsx(lx,{openDialogRename:Rt,setOpenDialogRename:Se,apiBaseUrl:t,setFileToMove:D,fileToMove:k,refreshFiles:We,ignoreCache:_e})]})]}),Rx&&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(Pr,{className:"s3-explr-table",children:[l.jsx(Ar,{className:"s3-explr-table-header",children:Ni.getHeaderGroups().map(M=>l.jsx(Je,{className:"hover:bg-transparent s3-explr-header-row",children:M.headers.map(I=>l.jsx(st,{className:"s3-explr-header-cell",children:I.isPlaceholder?null:or(I.column.columnDef.header,I.getContext())},I.id))},M.id))}),l.jsx(_r,{className:"s3-explr-table-body",children:Ni.getRowModel().rows.length===0?l.jsx(Je,{className:"s3-explr-empty-row",children:l.jsx(Ie,{colSpan:Od.length,className:"h-24 text-center s3-explr-empty-cell",children:c?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 "',c,'"']}):l.jsx("div",{className:"text-gray-500 s3-explr-empty-message",children:Si?"Đ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"})})}):Ni.getRowModel().rows.map(M=>l.jsx(Je,{className:"h-12 s3-explr-row",children:M.getVisibleCells().map(I=>l.jsx(Ie,{className:"align-middle s3-explr-cell",children:or(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:[g.size," ",(g.size===1,"tập tin")," đã chọn"]}),l.jsx(ie,{variant:"default",onClick:()=>o(jx()),disabled:g.size===0,className:"s3-explr-ok-btn",children:"OK"})]}),!r&&l.jsx(Qc,{})]})});var Gn=e=>e.type==="checkbox",Kt=e=>e instanceof Date,Fe=e=>e==null;const ld=e=>typeof e=="object";var he=e=>!Fe(e)&&!Array.isArray(e)&&ld(e)&&!Kt(e),px=e=>he(e)&&e.target?Gn(e.target)?e.target.checked:e.target.value:e,gx=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,hx=(e,t)=>e.has(gx(t)),mx=e=>{const t=e.constructor&&e.constructor.prototype;return he(t)&&t.hasOwnProperty("isPrototypeOf")},ui=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function je(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(!(ui&&(e instanceof Blob||r))&&(n||he(e)))if(t=n?[]:{},!n&&!mx(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=je(e[o]));else return e;return t}var no=e=>Array.isArray(e)?e.filter(Boolean):[],pe=e=>e===void 0,W=(e,t,n)=>{if(!t||!he(e))return n;const r=no(t.split(/[,[\].]+?/)).reduce((o,s)=>Fe(o)?o:o[s],e);return pe(r)||r===e?pe(e[t])?n:e[t]:r},ct=e=>typeof e=="boolean",di=e=>/^\w*$/.test(e),cd=e=>no(e.replace(/["|']|\]/g,"").split(/\.|\[/)),fe=(e,t,n)=>{let r=-1;const o=di(t)?[t]:cd(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 ud={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Qe={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"};A.createContext(null);var vx=(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]!==Qe.all&&(t._proxyFormState[i]=!r||Qe.all),e[i]}});return o},ke=e=>he(e)&&!Object.keys(e).length,yx=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return ke(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===Qe.all)},ro=e=>Array.isArray(e)?e:[e];function wx(e){const t=A.useRef(e);t.current=e,A.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}var ut=e=>typeof e=="string",bx=(e,t,n,r,o)=>ut(e)?(r&&t.watch.add(e),W(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),W(n,s))):(r&&(t.watchAll=!0),n),xx=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},dd=e=>({isOnSubmit:!e||e===Qe.onSubmit,isOnBlur:e===Qe.onBlur,isOnChange:e===Qe.onChange,isOnAll:e===Qe.all,isOnTouch:e===Qe.onTouched}),fd=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const qn=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const s=W(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(qn(a,t))break}else if(he(a)&&qn(a,t))break}}};var Cx=(e,t,n)=>{const r=ro(W(e,n));return fe(r,"root",t[n]),fe(e,n,r),e},fi=e=>e.type==="file",dt=e=>typeof e=="function",oo=e=>{if(!ui)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},so=e=>ut(e),pi=e=>e.type==="radio",io=e=>e instanceof RegExp;const pd={value:!1,isValid:!1},gd={value:!0,isValid:!0};var hd=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&&!pe(e[0].attributes.value)?pe(e[0].value)||e[0].value===""?gd:{value:e[0].value,isValid:!0}:gd:pd}return pd};const md={isValid:!1,value:null};var vd=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,md):md;function yd(e,t,n="validate"){if(so(e)||Array.isArray(e)&&e.every(so)||ct(e)&&!e)return{type:n,message:so(e)?e:"",ref:t}}var Cn=e=>he(e)&&!io(e)?e:{value:e,message:""},wd=async(e,t,n,r,o)=>{const{ref:s,refs:i,required:a,maxLength:u,minLength:c,min:f,max:g,pattern:h,validate:p,name:v,valueAsNumber:m,mount:y,disabled:w}=e._f,b=W(t,v);if(!y||w)return{};const S=i?i[0]:s,E=$=>{r&&S.reportValidity&&(S.setCustomValidity(ct($)?"":$||""),S.reportValidity())},x={},P=pi(s),F=Gn(s),O=P||F,k=(m||fi(s))&&pe(s.value)&&pe(b)||oo(s)&&s.value===""||b===""||Array.isArray(b)&&!b.length,D=xx.bind(null,v,n,x),G=($,U,L,X=Ct.maxLength,q=Ct.minLength)=>{const te=$?U:L;x[v]={type:$?X:q,message:te,ref:s,...D($?X:q,te)}};if(o?!Array.isArray(b)||!b.length:a&&(!O&&(k||Fe(b))||ct(b)&&!b||F&&!hd(i).isValid||P&&!vd(i).isValid)){const{value:$,message:U}=so(a)?{value:!!a,message:a}:Cn(a);if($&&(x[v]={type:Ct.required,message:U,ref:S,...D(Ct.required,U)},!n))return E(U),x}if(!k&&(!Fe(f)||!Fe(g))){let $,U;const L=Cn(g),X=Cn(f);if(!Fe(b)&&!isNaN(b)){const q=s.valueAsNumber||b&&+b;Fe(L.value)||($=q>L.value),Fe(X.value)||(U=q<X.value)}else{const q=s.valueAsDate||new Date(b),te=le=>new Date(new Date().toDateString()+" "+le),B=s.type=="time",j=s.type=="week";ut(L.value)&&b&&($=B?te(b)>te(L.value):j?b>L.value:q>new Date(L.value)),ut(X.value)&&b&&(U=B?te(b)<te(X.value):j?b<X.value:q<new Date(X.value))}if(($||U)&&(G(!!$,L.message,X.message,Ct.max,Ct.min),!n))return E(x[v].message),x}if((u||c)&&!k&&(ut(b)||o&&Array.isArray(b))){const $=Cn(u),U=Cn(c),L=!Fe($.value)&&b.length>+$.value,X=!Fe(U.value)&&b.length<+U.value;if((L||X)&&(G(L,$.message,U.message),!n))return E(x[v].message),x}if(h&&!k&&ut(b)){const{value:$,message:U}=Cn(h);if(io($)&&!b.match($)&&(x[v]={type:Ct.pattern,message:U,ref:s,...D(Ct.pattern,U)},!n))return E(U),x}if(p){if(dt(p)){const $=await p(b,t),U=yd($,S);if(U&&(x[v]={...U,...D(Ct.validate,U.message)},!n))return E(U.message),x}else if(he(p)){let $={};for(const U in p){if(!ke($)&&!n)break;const L=yd(await p[U](b,t),S,U);L&&($={...L,...D(U,L.message)},E(L.message),n&&(x[v]=$))}if(!ke($)&&(x[v]={ref:S,...$},!n))return x}}return E(!0),x};function Sx(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=pe(e)?r++:e[t[r++]];return e}function Ex(e){for(const t in e)if(e.hasOwnProperty(t)&&!pe(e[t]))return!1;return!0}function be(e,t){const n=Array.isArray(t)?t:di(t)?[t]:cd(t),r=n.length===1?e:Sx(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(he(r)&&ke(r)||Array.isArray(r)&&Ex(r))&&be(e,n.slice(0,-1)),e}var gi=()=>{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=[]}}},hi=e=>Fe(e)||!ld(e);function Lt(e,t){if(hi(e)||hi(t))return e===t;if(Kt(e)&&Kt(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(Kt(s)&&Kt(i)||he(s)&&he(i)||Array.isArray(s)&&Array.isArray(i)?!Lt(s,i):s!==i)return!1}}return!0}var bd=e=>e.type==="select-multiple",Nx=e=>pi(e)||Gn(e),mi=e=>oo(e)&&e.isConnected,xd=e=>{for(const t in e)if(dt(e[t]))return!0;return!1};function ao(e,t={}){const n=Array.isArray(e);if(he(e)||n)for(const r in e)Array.isArray(e[r])||he(e[r])&&!xd(e[r])?(t[r]=Array.isArray(e[r])?[]:{},ao(e[r],t[r])):Fe(e[r])||(t[r]=!0);return t}function Cd(e,t,n){const r=Array.isArray(e);if(he(e)||r)for(const o in e)Array.isArray(e[o])||he(e[o])&&!xd(e[o])?pe(t)||hi(n[o])?n[o]=Array.isArray(e[o])?ao(e[o],[]):{...ao(e[o])}:Cd(e[o],Fe(t)?{}:t[o],n[o]):n[o]=!Lt(e[o],t[o]);return n}var Kn=(e,t)=>Cd(e,t,ao(t)),Sd=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>pe(e)?e:t?e===""?NaN:e&&+e:n&&ut(e)?new Date(e):r?r(e):e;function vi(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return fi(t)?t.files:pi(t)?vd(e.refs).value:bd(t)?[...t.selectedOptions].map(({value:n})=>n):Gn(t)?hd(e.refs).value:Sd(pe(t.value)?e.ref.value:t.value,e)}var Tx=(e,t,n,r)=>{const o={};for(const s of e){const i=W(t,s);i&&fe(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Xn=e=>pe(e)?e:io(e)?e.source:he(e)?io(e.value)?e.value.source:e.value:e;const Ed="AsyncFunction";var Px=e=>!!e&&!!e.validate&&!!(dt(e.validate)&&e.validate.constructor.name===Ed||he(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Ed)),Ax=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Nd(e,t,n){const r=W(e,n);if(r||di(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),i=W(t,s),a=W(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 _x=(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,Fx=(e,t)=>!no(W(e,t)).length&&be(e,t);const Ox={mode:Qe.onSubmit,reValidateMode:Qe.onChange,shouldFocusError:!0};function Dx(e={}){let t={...Ox,...e},n={submitCount:0,isDirty:!1,isLoading:dt(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)?je(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:je(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:gi(),array:gi(),state:gi()},h=dd(t.mode),p=dd(t.reValidateMode),v=t.criteriaMode===Qe.all,m=C=>N=>{clearTimeout(c),c=setTimeout(C,N)},y=async C=>{if(!t.disabled&&(f.isValid||C)){const N=t.resolver?ke((await O()).errors):await D(r,!0);N!==n.isValid&&g.state.next({isValid:N})}},w=(C,N)=>{!t.disabled&&(f.isValidating||f.validatingFields)&&((C||Array.from(a.mount)).forEach(_=>{_&&(N?fe(n.validatingFields,_,N):be(n.validatingFields,_))}),g.state.next({validatingFields:n.validatingFields,isValidating:!ke(n.validatingFields)}))},b=(C,N=[],_,z,V=!0,R=!0)=>{if(z&&_&&!t.disabled){if(i.action=!0,R&&Array.isArray(W(r,C))){const J=_(W(r,C),z.argA,z.argB);V&&fe(r,C,J)}if(R&&Array.isArray(W(n.errors,C))){const J=_(W(n.errors,C),z.argA,z.argB);V&&fe(n.errors,C,J),Fx(n.errors,C)}if(f.touchedFields&&R&&Array.isArray(W(n.touchedFields,C))){const J=_(W(n.touchedFields,C),z.argA,z.argB);V&&fe(n.touchedFields,C,J)}f.dirtyFields&&(n.dirtyFields=Kn(o,s)),g.state.next({name:C,isDirty:$(C,N),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else fe(s,C,N)},S=(C,N)=>{fe(n.errors,C,N),g.state.next({errors:n.errors})},E=C=>{n.errors=C,g.state.next({errors:n.errors,isValid:!1})},x=(C,N,_,z)=>{const V=W(r,C);if(V){const R=W(s,C,pe(_)?W(o,C):_);pe(R)||z&&z.defaultChecked||N?fe(s,C,N?R:vi(V._f)):X(C,R),i.mount&&y()}},P=(C,N,_,z,V)=>{let R=!1,J=!1;const ne={name:C};if(!t.disabled){const me=!!(W(r,C)&&W(r,C)._f&&W(r,C)._f.disabled);if(!_||z){f.isDirty&&(J=n.isDirty,n.isDirty=ne.isDirty=$(),R=J!==ne.isDirty);const Ce=me||Lt(W(o,C),N);J=!!(!me&&W(n.dirtyFields,C)),Ce||me?be(n.dirtyFields,C):fe(n.dirtyFields,C,!0),ne.dirtyFields=n.dirtyFields,R=R||f.dirtyFields&&J!==!Ce}if(_){const Ce=W(n.touchedFields,C);Ce||(fe(n.touchedFields,C,_),ne.touchedFields=n.touchedFields,R=R||f.touchedFields&&Ce!==_)}R&&V&&g.state.next(ne)}return R?ne:{}},F=(C,N,_,z)=>{const V=W(n.errors,C),R=f.isValid&&ct(N)&&n.isValid!==N;if(t.delayError&&_?(u=m(()=>S(C,_)),u(t.delayError)):(clearTimeout(c),u=null,_?fe(n.errors,C,_):be(n.errors,C)),(_?!Lt(V,_):V)||!ke(z)||R){const J={...z,...R&&ct(N)?{isValid:N}:{},errors:n.errors,name:C};n={...n,...J},g.state.next(J)}},O=async C=>{w(C,!0);const N=await t.resolver(s,t.context,Tx(C||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(C),N},k=async C=>{const{errors:N}=await O(C);if(C)for(const _ of C){const z=W(N,_);z?fe(n.errors,_,z):be(n.errors,_)}else n.errors=N;return N},D=async(C,N,_={valid:!0})=>{for(const z in C){const V=C[z];if(V){const{_f:R,...J}=V;if(R){const ne=a.array.has(R.name),me=V._f&&Px(V._f);me&&f.validatingFields&&w([z],!0);const Ce=await wd(V,s,v,t.shouldUseNativeValidation&&!N,ne);if(me&&f.validatingFields&&w([z]),Ce[R.name]&&(_.valid=!1,N))break;!N&&(W(Ce,R.name)?ne?Cx(n.errors,Ce,R.name):fe(n.errors,R.name,Ce[R.name]):be(n.errors,R.name))}!ke(J)&&await D(J,N,_)}}return _.valid},G=()=>{for(const C of a.unMount){const N=W(r,C);N&&(N._f.refs?N._f.refs.every(_=>!mi(_)):!mi(N._f.ref))&&Se(C)}a.unMount=new Set},$=(C,N)=>!t.disabled&&(C&&N&&fe(s,C,N),!Lt(ce(),o)),U=(C,N,_)=>bx(C,a,{...i.mount?s:pe(N)?o:ut(C)?{[C]:N}:N},_,N),L=C=>no(W(i.mount?s:o,C,t.shouldUnregister?W(o,C,[]):[])),X=(C,N,_={})=>{const z=W(r,C);let V=N;if(z){const R=z._f;R&&(!R.disabled&&fe(s,C,Sd(N,R)),V=oo(R.ref)&&Fe(N)?"":N,bd(R.ref)?[...R.ref.options].forEach(J=>J.selected=V.includes(J.value)):R.refs?Gn(R.ref)?R.refs.length>1?R.refs.forEach(J=>(!J.defaultChecked||!J.disabled)&&(J.checked=Array.isArray(V)?!!V.find(ne=>ne===J.value):V===J.value)):R.refs[0]&&(R.refs[0].checked=!!V):R.refs.forEach(J=>J.checked=J.value===V):fi(R.ref)?R.ref.value="":(R.ref.value=V,R.ref.type||g.values.next({name:C,values:{...s}})))}(_.shouldDirty||_.shouldTouch)&&P(C,V,_.shouldTouch,_.shouldDirty,!0),_.shouldValidate&&le(C)},q=(C,N,_)=>{for(const z in N){const V=N[z],R=`${C}.${z}`,J=W(r,R);(a.array.has(C)||he(V)||J&&!J._f)&&!Kt(V)?q(R,V,_):X(R,V,_)}},te=(C,N,_={})=>{const z=W(r,C),V=a.array.has(C),R=je(N);fe(s,C,R),V?(g.array.next({name:C,values:{...s}}),(f.isDirty||f.dirtyFields)&&_.shouldDirty&&g.state.next({name:C,dirtyFields:Kn(o,s),isDirty:$(C,R)})):z&&!z._f&&!Fe(R)?q(C,R,_):X(C,R,_),fd(C,a)&&g.state.next({...n}),g.values.next({name:i.mount?C:void 0,values:{...s}})},B=async C=>{i.mount=!0;const N=C.target;let _=N.name,z=!0;const V=W(r,_),R=()=>N.type?vi(V._f):px(C),J=ne=>{z=Number.isNaN(ne)||Kt(ne)&&isNaN(ne.getTime())||Lt(ne,W(s,_,ne))};if(V){let ne,me;const Ce=R(),pt=C.type===ud.BLUR||C.type===ud.FOCUS_OUT,lo=!Ax(V._f)&&!t.resolver&&!W(n.errors,_)&&!V._f.deps||_x(pt,W(n.touchedFields,_),n.isSubmitted,p,h),En=fd(_,a,pt);fe(s,_,Ce),pt?(V._f.onBlur&&V._f.onBlur(C),u&&u(0)):V._f.onChange&&V._f.onChange(C);const Nn=P(_,Ce,pt,!1),co=!ke(Nn)||En;if(!pt&&g.values.next({name:_,type:C.type,values:{...s}}),lo)return f.isValid&&(t.mode==="onBlur"?pt&&y():y()),co&&g.state.next({name:_,...En?{}:Nn});if(!pt&&En&&g.state.next({...n}),t.resolver){const{errors:ue}=await O([_]);if(J(Ce),z){const Tn=Nd(n.errors,r,_),Yn=Nd(ue,r,Tn.name||_);ne=Yn.error,_=Yn.name,me=ke(ue)}}else w([_],!0),ne=(await wd(V,s,v,t.shouldUseNativeValidation))[_],w([_]),J(Ce),z&&(ne?me=!1:f.isValid&&(me=await D(r,!0)));z&&(V._f.deps&&le(V._f.deps),F(_,me,ne,Nn))}},j=(C,N)=>{if(W(n.errors,N)&&C.focus)return C.focus(),1},le=async(C,N={})=>{let _,z;const V=ro(C);if(t.resolver){const R=await k(pe(C)?C:V);_=ke(R),z=C?!V.some(J=>W(R,J)):_}else C?(z=(await Promise.all(V.map(async R=>{const J=W(r,R);return await D(J&&J._f?{[R]:J}:J)}))).every(Boolean),!(!z&&!n.isValid)&&y()):z=_=await D(r);return g.state.next({...!ut(C)||f.isValid&&_!==n.isValid?{}:{name:C},...t.resolver||!C?{isValid:_}:{},errors:n.errors}),N.shouldFocus&&!z&&qn(r,j,C?V:a.mount),z},ce=C=>{const N={...i.mount?s:o};return pe(C)?N:ut(C)?W(N,C):C.map(_=>W(N,_))},xe=(C,N)=>({invalid:!!W((N||n).errors,C),isDirty:!!W((N||n).dirtyFields,C),error:W((N||n).errors,C),isValidating:!!W(n.validatingFields,C),isTouched:!!W((N||n).touchedFields,C)}),Ee=C=>{C&&ro(C).forEach(N=>be(n.errors,N)),g.state.next({errors:C?n.errors:{}})},Oe=(C,N,_)=>{const z=(W(r,C,{_f:{}})._f||{}).ref,V=W(n.errors,C)||{},{ref:R,message:J,type:ne,...me}=V;fe(n.errors,C,{...me,...N,ref:z}),g.state.next({name:C,errors:n.errors,isValid:!1}),_&&_.shouldFocus&&z&&z.focus&&z.focus()},Rt=(C,N)=>dt(C)?g.values.subscribe({next:_=>C(U(void 0,N),_)}):U(C,N,!0),Se=(C,N={})=>{for(const _ of C?ro(C):a.mount)a.mount.delete(_),a.array.delete(_),N.keepValue||(be(r,_),be(s,_)),!N.keepError&&be(n.errors,_),!N.keepDirty&&be(n.dirtyFields,_),!N.keepTouched&&be(n.touchedFields,_),!N.keepIsValidating&&be(n.validatingFields,_),!t.shouldUnregister&&!N.keepDefaultValue&&be(o,_);g.values.next({values:{...s}}),g.state.next({...n,...N.keepDirty?{isDirty:$()}:{}}),!N.keepIsValid&&y()},Ne=({disabled:C,name:N,field:_,fields:z,value:V})=>{if(ct(C)&&i.mount||C){const R=C?void 0:pe(V)?vi(_?_._f:W(z,N)._f):V;(C||!C&&!pe(R))&&fe(s,N,R),P(N,R,!1,!1,!0)}},et=(C,N={})=>{let _=W(r,C);const z=ct(N.disabled)||ct(t.disabled);return fe(r,C,{..._||{},_f:{..._&&_._f?_._f:{ref:{name:C}},name:C,mount:!0,...N}}),a.mount.add(C),_?Ne({field:_,disabled:ct(N.disabled)?N.disabled:t.disabled,name:C,value:N.value}):x(C,!0,N.value),{...z?{disabled:N.disabled||t.disabled}:{},...t.progressive?{required:!!N.required,min:Xn(N.min),max:Xn(N.max),minLength:Xn(N.minLength),maxLength:Xn(N.maxLength),pattern:Xn(N.pattern)}:{},name:C,onChange:B,onBlur:B,ref:V=>{if(V){et(C,N),_=W(r,C);const R=pe(V.value)&&V.querySelectorAll&&V.querySelectorAll("input,select,textarea")[0]||V,J=Nx(R),ne=_._f.refs||[];if(J?ne.find(me=>me===R):R===_._f.ref)return;fe(r,C,{_f:{..._._f,...J?{refs:[...ne.filter(mi),R,...Array.isArray(W(o,C))?[{}]:[]],ref:{type:R.type,name:C}}:{ref:R}}}),x(C,!1,void 0,R)}else _=W(r,C,{}),_._f&&(_._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(hx(a.array,C)&&i.action)&&a.unMount.add(C)}}},De=()=>t.shouldFocusError&&qn(r,j,a.mount),Xt=C=>{ct(C)&&(g.state.next({disabled:C}),qn(r,(N,_)=>{const z=W(r,_);z&&(N.disabled=z._f.disabled||C,Array.isArray(z._f.refs)&&z._f.refs.forEach(V=>{V.disabled=z._f.disabled||C}))},0,!1))},Vt=(C,N)=>async _=>{let z;if(_&&(_.preventDefault&&_.preventDefault(),_.persist&&_.persist()),t.disabled){N&&await N({...n.errors},_);return}let V=je(s);if(g.state.next({isSubmitting:!0}),t.resolver){const{errors:R,values:J}=await O();n.errors=R,V=J}else await D(r);if(be(n.errors,"root"),ke(n.errors)){g.state.next({errors:{}});try{await C(V,_)}catch(R){z=R}}else N&&await N({...n.errors},_),De(),setTimeout(De);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ke(n.errors)&&!z,submitCount:n.submitCount+1,errors:n.errors}),z)throw z},tt=(C,N={})=>{W(r,C)&&(pe(N.defaultValue)?te(C,je(W(o,C))):(te(C,N.defaultValue),fe(o,C,je(N.defaultValue))),N.keepTouched||be(n.touchedFields,C),N.keepDirty||(be(n.dirtyFields,C),n.isDirty=N.defaultValue?$(C,je(W(o,C))):$()),N.keepError||(be(n.errors,C),f.isValid&&y()),g.state.next({...n}))},ze=(C,N={})=>{const _=C?je(C):o,z=je(_),V=ke(C),R=V?o:z;if(N.keepDefaultValues||(o=_),!N.keepValues){if(N.keepDirtyValues){const J=new Set([...a.mount,...Object.keys(Kn(o,s))]);for(const ne of Array.from(J))W(n.dirtyFields,ne)?fe(R,ne,W(s,ne)):te(ne,W(R,ne))}else{if(ui&&pe(C))for(const J of a.mount){const ne=W(r,J);if(ne&&ne._f){const me=Array.isArray(ne._f.refs)?ne._f.refs[0]:ne._f.ref;if(oo(me)){const Ce=me.closest("form");if(Ce){Ce.reset();break}}}}r={}}s=t.shouldUnregister?N.keepDefaultValues?je(o):{}:je(R),g.array.next({values:{...R}}),g.values.next({values:{...R}})}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:V?!1:N.keepDirty?n.isDirty:!!(N.keepDefaultValues&&!Lt(C,o)),isSubmitted:N.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:V?{}:N.keepDirtyValues?N.keepDefaultValues&&s?Kn(o,s):n.dirtyFields:N.keepDefaultValues&&C?Kn(o,C):N.keepDirty?n.dirtyFields:{},touchedFields:N.keepTouched?n.touchedFields:{},errors:N.keepErrors?n.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Bt=(C,N)=>ze(dt(C)?C(s):C,N);return{control:{register:et,unregister:Se,getFieldState:xe,handleSubmit:Vt,setError:Oe,_executeSchema:O,_getWatch:U,_getDirty:$,_updateValid:y,_removeUnmounted:G,_updateFieldArray:b,_updateDisabledField:Ne,_getFieldArray:L,_reset:ze,_resetDefaultValues:()=>dt(t.defaultValues)&&t.defaultValues().then(C=>{Bt(C,t.resetOptions),g.state.next({isLoading:!1})}),_updateFormState:C=>{n={...n,...C}},_disableForm:Xt,_subjects:g,_proxyFormState:f,_setErrors:E,get _fields(){return r},get _formValues(){return s},get _state(){return i},set _state(C){i=C},get _defaultValues(){return o},get _names(){return a},set _names(C){a=C},get _formState(){return n},set _formState(C){n=C},get _options(){return t},set _options(C){t={...t,...C}}},trigger:le,register:et,handleSubmit:Vt,watch:Rt,setValue:te,getValues:ce,reset:Bt,resetField:tt,clearErrors:Ee,unregister:Se,setError:Oe,setFocus:(C,N={})=>{const _=W(r,C),z=_&&_._f;if(z){const V=z.refs?z.refs[0]:z.ref;V.focus&&(V.focus(),N.shouldSelect&&dt(V.select)&&V.select())}},getFieldState:xe}}function Mx(e={}){const t=A.useRef(),n=A.useRef(),[r,o]=A.useState({isDirty:!1,isValidating:!1,isLoading:dt(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:dt(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...Dx(e),formState:r});const s=t.current.control;return s._options=e,wx({subject:s._subjects.state,next:i=>{yx(i,s._proxyFormState,s._updateFormState)&&o({...s._formState})}}),A.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),A.useEffect(()=>{if(s._proxyFormState.isDirty){const i=s._getDirty();i!==r.isDirty&&s._subjects.state.next({isDirty:i})}},[s,r.isDirty]),A.useEffect(()=>{e.values&&!Lt(e.values,n.current)?(s._reset(e.values,s._options.resetOptions),n.current=e.values,o(i=>({...i}))):s._resetDefaultValues()},[e.values,s]),A.useEffect(()=>{e.errors&&s._setErrors(e.errors)},[e.errors,s]),A.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()}),A.useEffect(()=>{e.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[e.shouldUnregister,s]),A.useMemo(()=>({...t.current,formState:vx(r,s)}),[r,s])}const Td=({className:e,children:t,content:n,side:r})=>{const[o,s]=A.useState(!1);return l.jsx(yn,{delayDuration:0,children:l.jsxs(wn,{open:o,children:[l.jsx(bn,{asChild:!0,children:l.jsx("button",{type:"button",className:ee("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(qt,{side:r,className:n?"":"hidden",children:l.jsx("span",{className:"inline-block",children:n})})]})})},yi=({className:e,...t})=>l.jsx("nav",{role:"navigation","aria-label":"pagination",className:ee("mx-auto flex w-full justify-center",e),...t});yi.displayName="Pagination";const wi=d.forwardRef(({className:e,...t},n)=>l.jsx("ul",{ref:n,className:ee("flex flex-row items-center gap-1",e),...t}));wi.displayName="PaginationContent";const St=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:ee("",e),...t}));St.displayName="PaginationItem";const Jn=({className:e,isActive:t,size:n="icon",...r})=>l.jsx("a",{"aria-current":t?"page":void 0,className:ee(Wa({variant:t?"outline":"ghost",size:n}),e),...r});Jn.displayName="PaginationLink";const bi=({className:e,...t})=>l.jsxs(Jn,{"aria-label":"Go to previous page",size:"default",className:ee("gap-1 pl-2.5",e),...t,children:[l.jsx(sg,{className:"h-4 w-4"}),l.jsx("span",{children:"Previous"})]});bi.displayName="PaginationPrevious";const xi=({className:e,...t})=>l.jsxs(Jn,{"aria-label":"Go to next page",size:"default",className:ee("gap-1 pr-2.5",e),...t,children:[l.jsx("span",{children:"Next"}),l.jsx(Aa,{className:"h-4 w-4"})]});xi.displayName="PaginationNext";const Ci=({className:e,...t})=>l.jsxs("span",{"aria-hidden":!0,className:ee("flex h-9 w-9 items-center justify-center",e),...t,children:[l.jsx(ig,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"More pages"})]});Ci.displayName="PaginationEllipsis";const Ix=(e,t)=>{const[n,r]=A.useState(e);return A.useEffect(()=>{const o=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(o)}},[e,t]),n},kx=({apiBaseUrl:e="http://localhost:3002"})=>{var P,F;const[t,n]=A.useState([]),[r,o]=A.useState(!1),[s,i]=A.useState([]),[a,u]=A.useState(1),[c,f]=A.useState(1),[g,h]=A.useState(null),[p,v]=A.useState(""),m=Ix(p,500),y=O=>{const k=O.match(/\d{6}/);if(!k)return{month:"",year:""};const D=k[0],G=D.substring(0,2),$=D.substring(2);return{month:G,year:$}},w=O=>O.map(D=>{let G=(D==null?void 0:D.month)||"",$=(D==null?void 0:D.year)||"";if((!G||!$)&&(D!=null&&D.file_name)){const U=y(D.file_name);G=G||U.month,$=$||U.year}return{id:D==null?void 0:D.id,prefix:(D==null?void 0:D.prefix)||"",model:(D==null?void 0:D.model)||"",fileName:(D==null?void 0:D.file_name)||"",code:(D==null?void 0:D.stock_id)||"",month:G,year:$,content:(D==null?void 0:D.text_summary)||"",status:(D==null?void 0:D.status)||"",note:(D==null?void 0:D.note)||"",lastUpdate:D==null?void 0:D.updated_at,stock_id:D==null?void 0:D.stock_id}}),b=O=>{if(!(O!=null&&O.data))return[];const k=w(O==null?void 0:O.data);n(k),f(O.pagination.totalPages)},S=async(O=1,k=15)=>{h(O),o(!0);try{const D=await se.get(`${e}/api/latest-summaries`,{params:{page:O,limit:k,search:p}});(D==null?void 0:D.status)===200?b(D.data):console.error(D)}catch(D){console.error("Error fetching data:",D)}finally{h(null),o(!1)}};A.useEffect(()=>{m&&u(1),S(a)},[a,m]);const E=A.useMemo(()=>[{id:"code",header:"Mã",accessorKey:"code",cell:({row:k})=>l.jsx("span",{className:"flex flex-col",children:k.original.code})},{id:"month",header:"Tháng",accessorKey:"month",cell:({row:k})=>{const D=k.original.month,G=k.original.year;return l.jsx("span",{className:"flex flex-col",children:`${D.toString().padStart(2,"0")}/${G}`})}},{id:"content",header:"Nội dung",accessorKey:"content",cell:({row:k})=>{const D=k.getValue("content");return l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]",children:D})}},{id:"status",header:"Trạng thái",accessorKey:"status",cell:({row:k})=>{const G=k.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:k})=>l.jsx(Td,{content:l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:k.original.note}),children:l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[20dvw]",children:k.original.note})})},{id:"last-update",header:"Cập nhật",accessorKey:"last-update",cell:({row:k})=>{const D=new Date(k.original.lastUpdate),G=D.getDate(),$=D.getMonth()+1,U=`ngày ${G} tháng ${$}`;return l.jsx("span",{className:"flex flex-col",children:U})}},{accessorKey:"actions",header:()=>l.jsx("div",{className:"font-medium text-right",children:"Hành động"}),cell:({row:k})=>{const[D,G]=A.useState(!1),[$,U]=A.useState(!1),[L,X]=A.useState(!1),{handleSubmit:q,register:te,reset:B}=Mx(),j=k.original.id,le=k.getValue("status"),ce=k.getValue("content"),[xe,Ee]=A.useState(!1),Oe=async()=>{try{Ee(!0);const Se=le==="unpublish"?"published":"unpublish",Ne=await se.patch(`${e}/api/toggle-publish/${j}`,{id:j,typeAction:"update",status:le,idInput:j,stock_id:k.original.stock_id,prefix:k.original.prefix,model:k.original.model,summary_result:k.original.content,note:k.original.note});Ne.status===200?n(et=>et.map(De=>De.id===j?{...De,status:Se}:De)):console.error("Failed to toggle publish status:",Ne)}catch(Se){console.error("Error toggling publish status:",Se)}finally{Ee(!1)}},Rt=async Se=>{G(!0);try{const Ne=await se.patch(`${e}/api/update-summary`,{note:Se.note,text_summary:Se.content,id:j});Ne.status===200?(await S(a),U(!1)):console.error("Failed to update summary:",Ne)}catch(Ne){console.error("Error updating summary:",Ne)}return G(!1)};return l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(ie,{variant:"outline",size:"sm",onClick:()=>X(!0),className:"px-2 py-0.5 h-7",children:l.jsx(ag,{className:"h-4 w-4"})}),l.jsx(Dt,{open:L,onOpenChange:X,children:l.jsxs(mt,{className:"max-w-3xl max-h-[80vh]",children:[l.jsx(vt,{children:l.jsx(yt,{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:ce})})]})}),l.jsxs(Dt,{open:$,onOpenChange:Se=>{U(Se),Se?B({content:k.original.content,note:k.original.note}):B()},children:[l.jsx(Tr,{asChild:!0,children:l.jsx(ie,{variant:"outline",size:"sm",onClick:()=>U(!0),className:"px-2 py-0.5 h-7",children:"Sửa"})}),l.jsx(mt,{className:"rounded-lg sm:px-3 h-[calc(100dvh-200px)] min-w-[calc(100dvw-112px)]",children:l.jsxs(vt,{className:"flex flex-col gap-3",children:[l.jsx(yt,{className:"max-sm:hidden text-center",children:"Sửa summary"}),l.jsxs("form",{className:"flex flex-col gap-3 h-full justify-between",onSubmit:q(Rt),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($n,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:k.original.answer||"",rows:10,...te("content")})]}),l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{children:"Ghi chú:"}),l.jsx($n,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:k.original.note||"",rows:1,...te("note")})]})]}),l.jsx("div",{className:"flex justify-end",children:l.jsx(ie,{disabled:D,type:"submit",variant:"default",children:D?l.jsx(ve,{className:"h-4 w-4 animate-spin"}):"Ok"})})]})]})})]}),l.jsx(ie,{variant:"outline",size:"sm",onClick:Oe,disabled:xe,className:"w-[70px] px-2 py-0.5 h-7",children:xe?l.jsx(ve,{className:"h-4 w-4 animate-spin"}):le==="unpublish"?"Publish":"Unpublish"})]})}}],[]),x=Hi({data:t,columns:E,state:{columnFilters:s},enableRowSelection:!0,onColumnFiltersChange:i,getFilteredRowModel:Tf(),getCoreRowModel:zi()});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(Mt,{placeholder:"Tìm kiếm theo mã...",value:p,onChange:O=>v(O.target.value),className:"pr-8"}),p&&l.jsx(ie,{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(Go,{className:"h-4 w-4"})})]})}),l.jsx("div",{className:"rounded-md border s3-explr-table-container",children:l.jsxs(Pr,{className:"s3-explr-table",children:[l.jsx(Ar,{className:"s3-explr-table-header",children:x.getHeaderGroups().map(O=>l.jsx(Je,{className:"hover:bg-transparent s3-explr-header-row",children:O.headers.map(k=>l.jsx(st,{className:"s3-explr-header-cell",children:k.isPlaceholder?null:or(k.column.columnDef.header,k.getContext())},k.id))},O.id))}),l.jsx(_r,{className:"s3-explr-table-body",children:r?l.jsx(Je,{children:l.jsx(Ie,{colSpan:E.length,className:"h-24 text-center",children:"Đang tải dữ liệu..."})}):(P=x.getRowModel().rows)!=null&&P.length?(F=x.getRowModel().rows)==null?void 0:F.map(O=>l.jsx(Je,{className:"h-12 s3-explr-row",children:O.getVisibleCells().map(k=>l.jsx(Ie,{className:"align-middle s3-explr-cell",children:or(k.column.columnDef.cell,k.getContext())},k.id))},O.id)):l.jsx(Je,{children:l.jsx(Ie,{colSpan:E.length,className:"h-24 text-center",children:"Không có kết quả."})})})]})}),l.jsx("div",{className:"mt-4",children:l.jsx(yi,{children:l.jsxs(wi,{children:[l.jsx(St,{children:l.jsx(bi,{onClick:()=>u(O=>Math.max(1,O-1)),className:a===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:c},(O,k)=>k+1).filter(O=>O===1||O===c||Math.abs(O-a)<=1).map((O,k,D)=>l.jsxs(l.Fragment,{children:[k>0&&D[k-1]!==O-1&&l.jsx(St,{children:l.jsx(Ci,{})},O+"..."),l.jsx(St,{children:l.jsx(Jn,{onClick:()=>u(O),isActive:a===O,className:`cursor-pointer ${r?"pointer-events-none":""}`,children:g===O?l.jsx(ve,{className:"h-4 w-4 animate-spin"}):O})},O)]})),l.jsx(St,{children:l.jsx(xi,{onClick:()=>u(O=>Math.min(c,O+1)),className:a===c||g!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})})]})},Pd=10,$x=A.memo(({apiBaseUrl:e="http://localhost:3002"})=>{const[t,n]=A.useState(1),[r,o]=A.useState([]),[s,i]=A.useState({total:0,page:1,limit:Pd,totalPages:1}),[a,u]=A.useState(!0),[c,f]=A.useState(null),[g,h]=A.useState(new Set),{toast:p}=Br(),[v,m]=A.useState(!1),y=async x=>{try{f(x);const P=await se.get(`${e}/api/jobs`,{params:{page:x.toString(),limit:Pd.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)}};A.useEffect(()=>{y(t)},[t,e]);const w=async x=>{h(P=>new Set(P).add(x.toString()));try{await se.post(`${e}/api/retry-job`,{jobId:x}),p({title:"Job Restarted",description:`Job ${x} has been successfully restarted.`}),y(t)}catch{p({variant:"destructive",title:"Retry Failed",description:`Failed to restart job ${x}. Please try again.`})}finally{h(P=>{const F=new Set(P);return F.delete(x.toString()),F})}},b=async()=>{m(!0),n(1),await y(1),m(!1)},S=x=>new Date(x).toLocaleString(),E=x=>{if(x=parseFloat(x),x<60)return`${x.toFixed(2)}s`;const P=Math.floor(x/60),F=(x%60).toFixed(0);return`${P}m ${F}s`};return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[l.jsx(rg,{className:"w-8 h-8 text-primary"}),l.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Job Management"}),l.jsx(ie,{variant:"outline",size:"icon",onClick:b,disabled:v||a,className:"ml-2",children:l.jsx(ug,{className:`h-4 w-4 ${v?"animate-spin":""}`})})]}),l.jsx("div",{className:"rounded-md border",children:l.jsxs(Pr,{children:[l.jsx(Ar,{children:l.jsxs(Je,{children:[l.jsx(st,{children:"ID"}),l.jsx(st,{children:"Tên Công Việc"}),l.jsx(st,{children:"Thời Gian Bắt Đầu"}),l.jsx(st,{children:"Thời Gian Cập Nhật"}),l.jsx(st,{children:"Thời Gian Thực Thi"}),l.jsx(st,{children:"Trạng Thái"}),l.jsx(st,{children:"Thao Tác"})]})}),l.jsx(_r,{children:a&&r.length===0?l.jsx(Je,{children:l.jsx(Ie,{colSpan:7,className:"text-center py-4",children:l.jsx(ve,{className:"w-6 h-6 animate-spin mx-auto"})})}):r.map(x=>{var P,F;return l.jsxs(Je,{children:[l.jsx(Ie,{className:"!w-[100px]",children:x.id}),l.jsx(Ie,{className:"font-medium",children:(P=x.job_name)==null?void 0:P.replace("Upload file","Summary")}),l.jsx(Ie,{className:"!w-[200px]",children:S(x.created_at)}),l.jsx(Ie,{className:"!w-[200px]",children:S(x.updated_at)}),l.jsx(Ie,{className:"!w-[150px]",children:E(x.execution_time_seconds)}),l.jsx(Ie,{className:"!w-[200px]",children:l.jsx(Td,{content:x.status==="fail"&&x.error?l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:x.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]
|
|
152
|
-
${x.status==="done"?"bg-green-100 text-green-800":x.status==="fail"?"bg-red-100 text-red-800":"bg-yellow-100 text-yellow-800"}`,children:x.status==="fail"?"FAILED":(
|
|
151
|
+
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},jm="DialogDescriptionWarning",Wm=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${nc(jm).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},Gm=zl,qm=jl,Km=Gl,rc=ql,oc=Kl,sc=Jl,ic=Zl,Xm=ec;const St=Gm,$r=qm,Jm=Km,ac=d.forwardRef(({className:e,...t},n)=>l.jsx(rc,{ref:n,className:ee("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}));ac.displayName=rc.displayName;const ct=d.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(Jm,{children:[l.jsx(ac,{}),l.jsxs(oc,{ref:r,className:ee("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(Xm,{className:ee("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(ls,{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"})]})]})]}));ct.displayName=oc.displayName;const ut=({className:e,...t})=>l.jsx("div",{className:ee("s3-explr-ui-dialog-header flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ut.displayName="DialogHeader";const Kt=({className:e,...t})=>l.jsx("div",{className:ee("s3-explr-ui-dialog-footer flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Kt.displayName="DialogFooter";const dt=d.forwardRef(({className:e,...t},n)=>l.jsx(sc,{ref:n,className:ee("s3-explr-ui-dialog-title text-lg font-semibold leading-none tracking-tight",e),...t}));dt.displayName=sc.displayName;const mn=d.forwardRef(({className:e,...t},n)=>l.jsx(ic,{ref:n,className:ee("s3-explr-ui-dialog-description text-sm text-muted-foreground",e),...t}));mn.displayName=ic.displayName;const $t=d.forwardRef(({className:e,type:t,...n},r)=>l.jsx("input",{type:t,className:ee("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 Ym="Label",lc=d.forwardRef((e,t)=>l.jsx(we.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())}}));lc.displayName=Ym;var cc=lc;const Zm=ms("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"}}),Xt=d.forwardRef(({className:e,variant:t,size:n,...r},o)=>l.jsx(cc,{ref:o,className:ee(Zm({variant:t,size:n}),e),...r}));Xt.displayName=cc.displayName;const kr=({className:e,...t})=>l.jsx("nav",{role:"navigation","aria-label":"pagination",className:ee("mx-auto flex w-full justify-center",e),...t});kr.displayName="Pagination";const Lr=d.forwardRef(({className:e,...t},n)=>l.jsx("ul",{ref:n,className:ee("flex flex-row items-center gap-1",e),...t}));Lr.displayName="PaginationContent";const et=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:ee("",e),...t}));et.displayName="PaginationItem";const vn=({className:e,isActive:t,size:n="icon",...r})=>l.jsx("a",{"aria-current":t?"page":void 0,className:ee(nl({variant:t?"outline":"ghost",size:n}),e),...r});vn.displayName="PaginationLink";const Rr=({className:e,...t})=>l.jsxs(vn,{"aria-label":"Go to previous page",size:"default",className:ee("gap-1 pl-2.5",e),...t,children:[l.jsx(xg,{className:"h-4 w-4"}),l.jsx("span",{children:"Previous"})]});Rr.displayName="PaginationPrevious";const Vr=({className:e,...t})=>l.jsxs(vn,{"aria-label":"Go to next page",size:"default",className:ee("gap-1 pr-2.5",e),...t,children:[l.jsx("span",{children:"Next"}),l.jsx(Va,{className:"h-4 w-4"})]});Vr.displayName="PaginationNext";const Br=({className:e,...t})=>l.jsxs("span",{"aria-hidden":!0,className:ee("flex h-9 w-9 items-center justify-center",e),...t,children:[l.jsx(Cg,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"More pages"})]});Br.displayName="PaginationEllipsis";const Hr=d.forwardRef(({className:e,...t},n)=>l.jsx("div",{className:ee("relative w-full overflow-auto","s3-explr-ui-table-container"),children:l.jsx("table",{ref:n,className:ee("w-full caption-bottom text-sm","s3-explr-ui-table",e),...t})}));Hr.displayName="Table";const zr=d.forwardRef(({className:e,...t},n)=>l.jsx("thead",{ref:n,className:ee("[&_tr]:border-b","s3-explr-ui-table-header",e),...t}));zr.displayName="TableHeader";const Ur=d.forwardRef(({className:e,...t},n)=>l.jsx("tbody",{ref:n,className:ee("[&_tr:last-child]:border-0","s3-explr-ui-table-body",e),...t}));Ur.displayName="TableBody";const Qm=d.forwardRef(({className:e,...t},n)=>l.jsx("tfoot",{ref:n,className:ee("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0","s3-explr-ui-table-footer",e),...t}));Qm.displayName="TableFooter";const tt=d.forwardRef(({className:e,...t},n)=>l.jsx("tr",{ref:n,className:ee("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted","s3-explr-ui-table-row",e),...t}));tt.displayName="TableRow";const ft=d.forwardRef(({className:e,...t},n)=>l.jsx("th",{ref:n,className:ee("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}));ft.displayName="TableHead";const ke=d.forwardRef(({className:e,...t},n)=>l.jsx("td",{ref:n,className:ee("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-cell",e),...t}));ke.displayName="TableCell";const ev=d.forwardRef(({className:e,...t},n)=>l.jsx("caption",{ref:n,className:ee("mt-4 text-sm text-muted-foreground","s3-explr-ui-table-caption",e),...t}));ev.displayName="TableCaption";function ks(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 yn(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 uc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ls(...e){return t=>{let n=!1;const r=e.map(o=>{const s=uc(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():uc(e[o],null)}}}}function Rs(...e){return d.useCallback(Ls(...e),e)}var Vs=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(nv);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(Bs,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Bs,{...r,ref:t,children:n})});Vs.displayName="Slot";var Bs=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=ov(n);return d.cloneElement(n,{...rv(r,n.props),ref:t?Ls(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Bs.displayName="SlotClone";var tv=({children:e})=>l.jsx(l.Fragment,{children:e});function nv(e){return d.isValidElement(e)&&e.type===tv}function rv(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 ov(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 sv(e){const t=e+"CollectionProvider",[n,r]=Dt(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:h}=p,y=T.useRef(null),w=T.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:h})};i.displayName=t;const a=e+"CollectionSlot",u=T.forwardRef((p,v)=>{const{scope:h,children:y}=p,w=s(a,h),b=Rs(v,w.collectionRef);return l.jsx(Vs,{ref:b,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",g=T.forwardRef((p,v)=>{const{scope:h,children:y,...w}=p,b=T.useRef(null),S=Rs(v,b),E=s(c,h);return T.useEffect(()=>(E.itemMap.set(b,{ref:b,...w}),()=>void E.itemMap.delete(b))),l.jsx(Vs,{[f]:"",ref:S,children:y})});g.displayName=c;function m(p){const v=s(e+"CollectionConsumer",p);return T.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((E,x)=>w.indexOf(E.ref.current)-w.indexOf(x.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:g},m,r]}var dc=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(Hs,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Hs,{...r,ref:t,children:n})});dc.displayName="Slot";var Hs=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?Ls(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Hs.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)}var uv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],fc=uv.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?dc: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}},{}),dv=d.createContext(void 0);function pc(e){const t=d.useContext(dv);return e||t||"ltr"}var zs="rovingFocusGroup.onEntryFocus",fv={bubbles:!1,cancelable:!0},jr="RovingFocusGroup",[Us,gc,pv]=sv(jr),[gv,hc]=Dt(jr,[pv]),[hv,mv]=gv(jr),mc=d.forwardRef((e,t)=>l.jsx(Us.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Us.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(vv,{...e,ref:t})})}));mc.displayName=jr;var vv=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=Rs(t,m),v=pc(s),[h=null,y]=cn({prop:i,defaultProp:a,onChange:u}),[w,b]=d.useState(!1),S=_e(c),E=gc(n),x=d.useRef(!1),[_,O]=d.useState(0);return d.useEffect(()=>{const D=m.current;if(D)return D.addEventListener(zs,S),()=>D.removeEventListener(zs,S)},[S]),l.jsx(hv,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:h,onItemFocus:d.useCallback(D=>y(D),[y]),onItemShiftTab:d.useCallback(()=>b(!0),[]),onFocusableItemAdd:d.useCallback(()=>O(D=>D+1),[]),onFocusableItemRemove:d.useCallback(()=>O(D=>D-1),[]),children:l.jsx(fc.div,{tabIndex:w||_===0?-1:0,"data-orientation":r,...g,ref:p,style:{outline:"none",...e.style},onMouseDown:yn(e.onMouseDown,()=>{x.current=!0}),onFocus:yn(e.onFocus,D=>{const $=!x.current;if(D.target===D.currentTarget&&$&&!w){const M=new CustomEvent(zs,fv);if(D.currentTarget.dispatchEvent(M),!M.defaultPrevented){const K=E().filter(q=>q.focusable),k=K.find(q=>q.active),U=K.find(q=>q.id===h),J=[k,U,...K].filter(Boolean).map(q=>q.ref.current);wc(J,f)}}x.current=!1}),onBlur:yn(e.onBlur,()=>b(!1))})})}),vc="RovingFocusGroupItem",yc=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...i}=e,a=dn(),u=s||a,c=mv(vc,n),f=c.currentTabStopId===u,g=gc(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(fc.span,{tabIndex:f?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:yn(e.onMouseDown,v=>{r?c.onItemFocus(u):v.preventDefault()}),onFocus:yn(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:yn(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const h=bv(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(b=>b.focusable).map(b=>b.ref.current);if(h==="last")w.reverse();else if(h==="prev"||h==="next"){h==="prev"&&w.reverse();const b=w.indexOf(v.currentTarget);w=c.loop?xv(w,b+1):w.slice(b+1)}setTimeout(()=>wc(w))}})})})});yc.displayName=vc;var yv={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function wv(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function bv(e,t,n){const r=wv(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return yv[r]}function wc(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function xv(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Cv=mc,Sv=yc;function bc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ev(...e){return t=>{let n=!1;const r=e.map(o=>{const s=bc(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():bc(e[o],null)}}}}function Nv(...e){return d.useCallback(Ev(...e),e)}function Tv(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var xc=e=>{const{present:t,children:n}=e,r=Pv(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=Nv(r.ref,Av(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};xc.displayName="Presence";function Pv(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=Tv(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=Wr(r.current);s.current=a==="mounted"?c:"none"},[a]),Be(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,p=Wr(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]),Be(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const h=Wr(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=Wr(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 Wr(e){return(e==null?void 0:e.animationName)||"none"}function Av(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 Cc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function _v(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Cc(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():Cc(e[o],null)}}}}var Sc=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Ov);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(js,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(js,{...r,ref:t,children:n})});Sc.displayName="Slot";var js=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Mv(n);return d.cloneElement(n,{...Dv(r,n.props),ref:t?_v(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});js.displayName="SlotClone";var Fv=({children:e})=>l.jsx(l.Fragment,{children:e});function Ov(e){return d.isValidElement(e)&&e.type===Fv}function Dv(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 Mv(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 Iv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Gr=Iv.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Sc: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}},{}),Ws="Tabs",[$v,MC]=Dt(Ws,[hc]),Ec=hc(),[kv,Gs]=$v(Ws),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=pc(a),[g,m]=cn({prop:r,onChange:o,defaultProp:s});return l.jsx(kv,{scope:n,baseId:dn(),value:g,onValueChange:m,orientation:i,dir:f,activationMode:u,children:l.jsx(Gr.div,{dir:f,"data-orientation":i,...c,ref:t})})});Nc.displayName=Ws;var Tc="TabsList",Pc=d.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=Gs(Tc,n),i=Ec(n);return l.jsx(Cv,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:l.jsx(Gr.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});Pc.displayName=Tc;var Ac="TabsTrigger",_c=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=Gs(Ac,n),a=Ec(n),u=Dc(i.baseId,r),c=Mc(i.baseId,r),f=r===i.value;return l.jsx(Sv,{asChild:!0,...a,focusable:!o,active:f,children:l.jsx(Gr.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:ks(e.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?i.onValueChange(r):g.preventDefault()}),onKeyDown:ks(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&i.onValueChange(r)}),onFocus:ks(e.onFocus,()=>{const g=i.activationMode!=="manual";!f&&!o&&g&&i.onValueChange(r)})})})});_c.displayName=Ac;var Fc="TabsContent",Oc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=Gs(Fc,n),u=Dc(a.baseId,r),c=Mc(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(xc,{present:o||f,children:({present:m})=>l.jsx(Gr.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})})});Oc.displayName=Fc;function Dc(e,t){return`${e}-trigger-${t}`}function Mc(e,t){return`${e}-content-${t}`}var Lv=Nc,Ic=Pc,$c=_c,kc=Oc;const Rv=Lv,Lc=d.forwardRef(({className:e,...t},n)=>l.jsx(Ic,{ref:n,className:ee("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Lc.displayName=Ic.displayName;const qr=d.forwardRef(({className:e,...t},n)=>l.jsx($c,{ref:n,className:ee("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}));qr.displayName=$c.displayName;const Kr=d.forwardRef(({className:e,...t},n)=>l.jsx(kc,{ref:n,className:ee("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Kr.displayName=kc.displayName;const Bn=d.forwardRef(({className:e,...t},n)=>l.jsx("textarea",{className:ee("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}));Bn.displayName="Textarea";function Vv(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,Bv(o,...t)]}function Bv(...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 qs=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(zv);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(Ks,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Ks,{...r,ref:t,children:n})});qs.displayName="Slot";var Ks=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=jv(n);return d.cloneElement(n,{...Uv(r,n.props),ref:t?Nr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Ks.displayName="SlotClone";var Hv=({children:e})=>l.jsx(l.Fragment,{children:e});function zv(e){return d.isValidElement(e)&&e.type===Hv}function Uv(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 jv(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 Wv(e){const t=e+"CollectionProvider",[n,r]=Vv(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:h}=p,y=T.useRef(null),w=T.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:h})};i.displayName=t;const a=e+"CollectionSlot",u=T.forwardRef((p,v)=>{const{scope:h,children:y}=p,w=s(a,h),b=qe(v,w.collectionRef);return l.jsx(qs,{ref:b,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",g=T.forwardRef((p,v)=>{const{scope:h,children:y,...w}=p,b=T.useRef(null),S=qe(v,b),E=s(c,h);return T.useEffect(()=>(E.itemMap.set(b,{ref:b,...w}),()=>void E.itemMap.delete(b))),l.jsx(qs,{[f]:"",ref:S,children:y})});g.displayName=c;function m(p){const v=s(e+"CollectionConsumer",p);return T.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((E,x)=>w.indexOf(E.ref.current)-w.indexOf(x.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:g},m,r]}var Gv="VisuallyHidden",Xs=d.forwardRef((e,t)=>l.jsx(we.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}}));Xs.displayName=Gv;var Js="ToastProvider",[Ys,qv,Kv]=Wv("Toast"),[Rc,IC]=Dt("Toast",[Kv]),[Xv,Xr]=Rc(Js),Vc=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 \`${Js}\`. Expected non-empty \`string\`.`),l.jsx(Ys.Provider,{scope:t,children:l.jsx(Xv,{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})})};Vc.displayName=Js;var Bc="ToastViewport",Jv=["F8"],Zs="toast.viewportPause",Qs="toast.viewportResume",Hc=d.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=Jv,label:o="Notifications ({hotkey})",...s}=e,i=Xr(Bc,n),a=qv(n),u=d.useRef(null),c=d.useRef(null),f=d.useRef(null),g=d.useRef(null),m=qe(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 b=()=>{if(!i.isClosePausedRef.current){const _=new CustomEvent(Zs);w.dispatchEvent(_),i.isClosePausedRef.current=!0}},S=()=>{if(i.isClosePausedRef.current){const _=new CustomEvent(Qs);w.dispatchEvent(_),i.isClosePausedRef.current=!1}},E=_=>{!y.contains(_.relatedTarget)&&S()},x=()=>{y.contains(document.activeElement)||S()};return y.addEventListener("focusin",b),y.addEventListener("focusout",E),y.addEventListener("pointermove",b),y.addEventListener("pointerleave",x),window.addEventListener("blur",b),window.addEventListener("focus",S),()=>{y.removeEventListener("focusin",b),y.removeEventListener("focusout",E),y.removeEventListener("pointermove",b),y.removeEventListener("pointerleave",x),window.removeEventListener("blur",b),window.removeEventListener("focus",S)}}},[v,i.isClosePausedRef]);const h=d.useCallback(({tabbingDirection:y})=>{const b=a().map(S=>{const E=S.ref.current,x=[E,...cy(E)];return y==="forwards"?x:x.reverse()});return(y==="forwards"?b.reverse():b).flat()},[a]);return d.useEffect(()=>{const y=g.current;if(y){const w=b=>{var x,_,O;const S=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!S){const D=document.activeElement,$=b.shiftKey;if(b.target===y&&$){(x=c.current)==null||x.focus();return}const k=h({tabbingDirection:$?"backwards":"forwards"}),U=k.findIndex(R=>R===D);ni(k.slice(U+1))?b.preventDefault():$?(_=c.current)==null||_.focus():(O=f.current)==null||O.focus()}};return y.addEventListener("keydown",w),()=>y.removeEventListener("keydown",w)}},[a,h]),l.jsxs(Vh,{ref:u,role:"region","aria-label":o.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&l.jsx(ei,{ref:c,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"forwards"});ni(y)}}),l.jsx(Ys.Slot,{scope:n,children:l.jsx(we.ol,{tabIndex:-1,...s,ref:m})}),v&&l.jsx(ei,{ref:f,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"backwards"});ni(y)}})]})});Hc.displayName=Bc;var zc="ToastFocusProxy",ei=d.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,s=Xr(zc,n);return l.jsx(Xs,{"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()}})});ei.displayName=zc;var Jr="Toast",Yv="toast.swipeStart",Zv="toast.swipeMove",Qv="toast.swipeCancel",ey="toast.swipeEnd",Uc=d.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:s,...i}=e,[a=!0,u]=cn({prop:r,defaultProp:o,onChange:s});return l.jsx(un,{present:n||a,children:l.jsx(ry,{open:a,...i,ref:t,onClose:()=>u(!1),onPause:_e(e.onPause),onResume:_e(e.onResume),onSwipeStart:ye(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ye(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:ye(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:ye(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)})})})});Uc.displayName=Jr;var[ty,ny]=Rc(Jr,{onClose(){}}),ry=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=Xr(Jr,n),[y,w]=d.useState(null),b=qe(t,R=>w(R)),S=d.useRef(null),E=d.useRef(null),x=o||h.duration,_=d.useRef(0),O=d.useRef(x),D=d.useRef(0),{onToastAdd:$,onToastRemove:M}=h,K=_e(()=>{var J;(y==null?void 0:y.contains(document.activeElement))&&((J=h.viewport)==null||J.focus()),i()}),k=d.useCallback(R=>{!R||R===1/0||(window.clearTimeout(D.current),_.current=new Date().getTime(),D.current=window.setTimeout(K,R))},[K]);d.useEffect(()=>{const R=h.viewport;if(R){const J=()=>{k(O.current),c==null||c()},q=()=>{const te=new Date().getTime()-_.current;O.current=O.current-te,window.clearTimeout(D.current),u==null||u()};return R.addEventListener(Zs,q),R.addEventListener(Qs,J),()=>{R.removeEventListener(Zs,q),R.removeEventListener(Qs,J)}}},[h.viewport,x,u,c,k]),d.useEffect(()=>{s&&!h.isClosePausedRef.current&&k(x)},[s,x,h.isClosePausedRef,k]),d.useEffect(()=>($(),()=>M()),[$,M]);const U=d.useMemo(()=>y?Jc(y):null,[y]);return h.viewport?l.jsxs(l.Fragment,{children:[U&&l.jsx(oy,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:U}),l.jsx(ty,{scope:n,onClose:K,children:lr.createPortal(l.jsx(Ys.ItemSlot,{scope:n,children:l.jsx(Rh,{asChild:!0,onEscapeKeyDown:ye(a,()=>{h.isFocusedToastEscapeKeyDownRef.current||K(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(we.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":h.swipeDirection,...v,ref:b,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ye(e.onKeyDown,R=>{R.key==="Escape"&&(a==null||a(R.nativeEvent),R.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,K()))}),onPointerDown:ye(e.onPointerDown,R=>{R.button===0&&(S.current={x:R.clientX,y:R.clientY})}),onPointerMove:ye(e.onPointerMove,R=>{if(!S.current)return;const J=R.clientX-S.current.x,q=R.clientY-S.current.y,te=!!E.current,H=["left","right"].includes(h.swipeDirection),j=["left","up"].includes(h.swipeDirection)?Math.min:Math.max,le=H?j(0,J):0,ce=H?0:j(0,q),xe=R.pointerType==="touch"?10:2,Ne={x:le,y:ce},Oe={originalEvent:R,delta:Ne};te?(E.current=Ne,Yr(Zv,g,Oe,{discrete:!1})):Yc(Ne,h.swipeDirection,xe)?(E.current=Ne,Yr(Yv,f,Oe,{discrete:!1}),R.target.setPointerCapture(R.pointerId)):(Math.abs(J)>xe||Math.abs(q)>xe)&&(S.current=null)}),onPointerUp:ye(e.onPointerUp,R=>{const J=E.current,q=R.target;if(q.hasPointerCapture(R.pointerId)&&q.releasePointerCapture(R.pointerId),E.current=null,S.current=null,J){const te=R.currentTarget,H={originalEvent:R,delta:J};Yc(J,h.swipeDirection,h.swipeThreshold)?Yr(ey,p,H,{discrete:!0}):Yr(Qv,m,H,{discrete:!0}),te.addEventListener("click",j=>j.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),oy=e=>{const{__scopeToast:t,children:n,...r}=e,o=Xr(Jr,t),[s,i]=d.useState(!1),[a,u]=d.useState(!1);return ay(()=>i(!0)),d.useEffect(()=>{const c=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:l.jsx(Es,{asChild:!0,children:l.jsx(Xs,{...r,children:s&&l.jsxs(l.Fragment,{children:[o.label," ",n]})})})},sy="ToastTitle",jc=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(we.div,{...r,ref:t})});jc.displayName=sy;var iy="ToastDescription",Wc=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(we.div,{...r,ref:t})});Wc.displayName=iy;var Gc="ToastAction",qc=d.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?l.jsx(Xc,{altText:n,asChild:!0,children:l.jsx(ti,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Gc}\`. Expected non-empty \`string\`.`),null)});qc.displayName=Gc;var Kc="ToastClose",ti=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=ny(Kc,n);return l.jsx(Xc,{asChild:!0,children:l.jsx(we.button,{type:"button",...r,ref:t,onClick:ye(e.onClick,o.onClose)})})});ti.displayName=Kc;var Xc=d.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return l.jsx(we.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function Jc(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),ly(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(...Jc(r))}}),t}function Yr(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?sl(o,s):o.dispatchEvent(s)}var Yc=(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 ay(e=()=>{}){const t=_e(e);Be(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function ly(e){return e.nodeType===e.ELEMENT_NODE}function cy(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 ni(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var uy=Vc,Zc=Hc,Qc=Uc,eu=jc,tu=Wc,nu=qc,ru=ti;const dy=uy,ou=d.forwardRef(({className:e,...t},n)=>l.jsx(Zc,{ref:n,className:ee("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}));ou.displayName=Zc.displayName;const fy=ms("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"}}),su=d.forwardRef(({className:e,variant:t,...n},r)=>l.jsx(Qc,{ref:r,className:ee(fy({variant:t}),e),...n}));su.displayName=Qc.displayName;const py=d.forwardRef(({className:e,...t},n)=>l.jsx(nu,{ref:n,className:ee("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}));py.displayName=nu.displayName;const iu=d.forwardRef(({className:e,...t},n)=>l.jsx(ru,{ref:n,className:ee("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity duration-200 ease-in-out 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 font-bold",e),"toast-close":"",...t,children:l.jsx(ls,{className:"s3-explr-ui-toast-close-icon h-4 w-4"})}));iu.displayName=ru.displayName;const au=d.forwardRef(({className:e,...t},n)=>l.jsx(eu,{ref:n,className:ee("s3-explr-ui-toast-title text-sm font-semibold [&+div]:text-xs",e),...t}));au.displayName=eu.displayName;const lu=d.forwardRef(({className:e,...t},n)=>l.jsx(tu,{ref:n,className:ee("text-sm opacity-90 font-bold",e),...t}));lu.displayName=tu.displayName;const gy=1,hy=1e6;let ri=0;function my(){return ri=(ri+1)%Number.MAX_SAFE_INTEGER,ri.toString()}const oi=new Map,cu=e=>{if(oi.has(e))return;const t=setTimeout(()=>{oi.delete(e),Hn({type:"REMOVE_TOAST",toastId:e})},hy);oi.set(e,t)},vy=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,gy)};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?cu(n):e.toasts.forEach(r=>{cu(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)}}},Zr=[];let Qr={toasts:[]};function Hn(e){Qr=vy(Qr,e),Zr.forEach(t=>{t(Qr)})}function yy({...e}){const t=my(),n=o=>Hn({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>Hn({type:"DISMISS_TOAST",toastId:t});return Hn({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function eo(){const[e,t]=d.useState(Qr);return d.useEffect(()=>(Zr.push(t),()=>{const n=Zr.indexOf(t);n>-1&&Zr.splice(n,1)}),[e]),{...e,toast:yy,dismiss:n=>Hn({type:"DISMISS_TOAST",toastId:n})}}function uu(){const{toasts:e}=eo();return l.jsxs(dy,{children:[e.map(function({id:t,title:n,description:r,action:o,...s}){return l.jsxs(su,{...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(au,{className:"s3-explr-ui-toast-title",children:n}),r&&l.jsx(lu,{className:"s3-explr-ui-toast-description",children:r})]}),o&&l.jsx("div",{className:"s3-explr-ui-toast-action",children:o}),l.jsx(iu,{className:"s3-explr-ui-toast-close"})]},t)}),l.jsx(ou,{className:"s3-explr-ui-toast-viewport"})]})}function Et(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 du(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function wy(...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 zn(...e){return d.useCallback(wy(...e),e)}var by=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Un=by.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?sn: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 xy(e,t){e&&lr.flushSync(()=>e.dispatchEvent(t))}var Cy="DismissableLayer",si="dismissableLayer.update",Sy="dismissableLayer.pointerDownOutside",Ey="dismissableLayer.focusOutside",fu,pu=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gu=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,c=d.useContext(pu),[f,g]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=d.useState({}),v=zn(t,O=>g(O)),h=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=h.indexOf(y),b=f?h.indexOf(f):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,E=b>=w,x=Py(O=>{const D=O.target,$=[...c.branches].some(M=>M.contains(D));!E||$||(o==null||o(O),i==null||i(O),O.defaultPrevented||a==null||a())},m),_=Ay(O=>{const D=O.target;[...c.branches].some(M=>M.contains(D))||(s==null||s(O),i==null||i(O),O.defaultPrevented||a==null||a())},m);return dl(O=>{b===c.layers.size-1&&(r==null||r(O),!O.defaultPrevented&&a&&(O.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(fu=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),hu(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=fu)}},[f,m,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),hu())},[f,c]),d.useEffect(()=>{const O=()=>p({});return document.addEventListener(si,O),()=>document.removeEventListener(si,O)},[]),l.jsx(Un.div,{...u,ref:v,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:Et(e.onFocusCapture,_.onFocusCapture),onBlurCapture:Et(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:Et(e.onPointerDownCapture,x.onPointerDownCapture)})});gu.displayName=Cy;var Ny="DismissableLayerBranch",Ty=d.forwardRef((e,t)=>{const n=d.useContext(pu),r=d.useRef(null),o=zn(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(Un.div,{...e,ref:o})});Ty.displayName=Ny;function Py(e,t=globalThis==null?void 0:globalThis.document){const n=_e(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){mu(Sy,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 Ay(e,t=globalThis==null?void 0:globalThis.document){const n=_e(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&mu(Ey,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 hu(){const e=new CustomEvent(si);document.dispatchEvent(e)}function mu(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?xy(o,s):o.dispatchEvent(s)}const _y=["top","right","bottom","left"],kt=Math.min,He=Math.max,to=Math.round,no=Math.floor,pt=e=>({x:e,y:e}),Fy={left:"right",right:"left",bottom:"top",top:"bottom"},Oy={start:"end",end:"start"};function ii(e,t,n){return He(e,kt(t,n))}function Nt(e,t){return typeof e=="function"?e(t):e}function Tt(e){return e.split("-")[0]}function wn(e){return e.split("-")[1]}function ai(e){return e==="x"?"y":"x"}function li(e){return e==="y"?"height":"width"}function Lt(e){return["top","bottom"].includes(Tt(e))?"y":"x"}function ci(e){return ai(Lt(e))}function Dy(e,t,n){n===void 0&&(n=!1);const r=wn(e),o=ci(e),s=li(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=ro(i)),[i,ro(i)]}function My(e){const t=ro(e);return[ui(e),t,ui(t)]}function ui(e){return e.replace(/start|end/g,t=>Oy[t])}function Iy(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 $y(e,t,n,r){const o=wn(e);let s=Iy(Tt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(ui)))),s}function ro(e){return e.replace(/left|right|bottom|top/g,t=>Fy[t])}function ky(e){return{top:0,right:0,bottom:0,left:0,...e}}function vu(e){return typeof e!="number"?ky(e):{top:e,right:e,bottom:e,left:e}}function oo(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 yu(e,t,n){let{reference:r,floating:o}=e;const s=Lt(t),i=ci(t),a=li(i),u=Tt(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(wn(t)){case"start":p[i]-=m*(n&&c?-1:1);break;case"end":p[i]+=m*(n&&c?-1:1);break}return p}const Ly=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}=yu(c,r,u),m=r,p={},v=0;for(let h=0;h<a.length;h++){const{name:y,fn:w}=a[h],{x:b,y:S,data:E,reset:x}=await w({x:f,y:g,initialPlacement:r,placement:m,strategy:o,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});f=b??f,g=S??g,p={...p,[y]:{...p[y],...E}},x&&v<=50&&(v++,typeof x=="object"&&(x.placement&&(m=x.placement),x.rects&&(c=x.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):x.rects),{x:f,y:g}=yu(c,m,u)),h=-1)}return{x:f,y:g,placement:m,strategy:o,middlewareData:p}};async function jn(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}=Nt(t,e),v=vu(p),y=a[m?g==="floating"?"reference":"floating":g],w=oo(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})),b=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},x=oo(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:S,strategy:u}):b);return{top:(w.top-x.top+v.top)/E.y,bottom:(x.bottom-w.bottom+v.bottom)/E.y,left:(w.left-x.left+v.left)/E.x,right:(x.right-w.right+v.right)/E.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}=Nt(e,t)||{};if(c==null)return{};const g=vu(f),m={x:n,y:r},p=ci(o),v=li(p),h=await i.getDimensions(c),y=p==="y",w=y?"top":"left",b=y?"bottom":"right",S=y?"clientHeight":"clientWidth",E=s.reference[v]+s.reference[p]-m[p]-s.floating[v],x=m[p]-s.reference[p],_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let O=_?_[S]:0;(!O||!await(i.isElement==null?void 0:i.isElement(_)))&&(O=a.floating[S]||s.floating[v]);const D=E/2-x/2,$=O/2-h[v]/2-1,M=kt(g[w],$),K=kt(g[b],$),k=M,U=O-h[v]-K,R=O/2-h[v]/2+D,J=ii(k,R,U),q=!u.arrow&&wn(o)!=null&&R!==J&&s.reference[v]/2-(R<k?M:K)-h[v]/2<0,te=q?R<k?R-k:R-U:0;return{[p]:m[p]+te,data:{[p]:J,centerOffset:R-J-te,...q&&{alignmentOffset:te}},reset:q}}}),Vy=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}=Nt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=Tt(o),b=Lt(a),S=Tt(a)===a,E=await(u.isRTL==null?void 0:u.isRTL(c.floating)),x=m||(S||!h?[ro(a)]:My(a)),_=v!=="none";!m&&_&&x.push(...$y(a,h,v,E));const O=[a,...x],D=await jn(t,y),$=[];let M=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&$.push(D[w]),g){const R=Dy(o,i,E);$.push(D[R[0]],D[R[1]])}if(M=[...M,{placement:o,overflows:$}],!$.every(R=>R<=0)){var K,k;const R=(((K=s.flip)==null?void 0:K.index)||0)+1,J=O[R];if(J)return{data:{index:R,overflows:M},reset:{placement:J}};let q=(k=M.filter(te=>te.overflows[0]<=0).sort((te,H)=>te.overflows[1]-H.overflows[1])[0])==null?void 0:k.placement;if(!q)switch(p){case"bestFit":{var U;const te=(U=M.filter(H=>{if(_){const j=Lt(H.placement);return j===b||j==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(j=>j>0).reduce((j,le)=>j+le,0)]).sort((H,j)=>H[1]-j[1])[0])==null?void 0:U[0];te&&(q=te);break}case"initialPlacement":q=a;break}if(o!==q)return{reset:{placement:q}}}return{}}}};function wu(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bu(e){return _y.some(t=>e[t]>=0)}const By=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Nt(e,t);switch(r){case"referenceHidden":{const s=await jn(t,{...o,elementContext:"reference"}),i=wu(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:bu(i)}}}case"escaped":{const s=await jn(t,{...o,altBoundary:!0}),i=wu(s,n.floating);return{data:{escapedOffsets:i,escaped:bu(i)}}}default:return{}}}}};async function Hy(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Tt(n),a=wn(n),u=Lt(n)==="y",c=["left","top"].includes(i)?-1:1,f=s&&u?-1:1,g=Nt(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 zy=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 Hy(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}}}}},Uy=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:b}=y;return{x:w,y:b}}},...u}=Nt(e,t),c={x:n,y:r},f=await jn(t,u),g=Lt(Tt(o)),m=ai(g);let p=c[m],v=c[g];if(s){const y=m==="y"?"top":"left",w=m==="y"?"bottom":"right",b=p+f[y],S=p-f[w];p=ii(b,p,S)}if(i){const y=g==="y"?"top":"left",w=g==="y"?"bottom":"right",b=v+f[y],S=v-f[w];v=ii(b,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}}}}}},jy=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}=Nt(e,t),f={x:n,y:r},g=Lt(o),m=ai(g);let p=f[m],v=f[g];const h=Nt(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,x=s.reference[m]+s.reference[S]-y.mainAxis;p<E?p=E:p>x&&(p=x)}if(c){var w,b;const S=m==="y"?"width":"height",E=["top","left"].includes(Tt(o)),x=s.reference[g]-s.floating[S]+(E&&((w=i.offset)==null?void 0:w[g])||0)+(E?0:y.crossAxis),_=s.reference[g]+s.reference[S]+(E?0:((b=i.offset)==null?void 0:b[g])||0)-(E?y.crossAxis:0);v<x?v=x:v>_&&(v=_)}return{[m]:p,[g]:v}}}},Wy=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}=Nt(e,t),f=await jn(t,c),g=Tt(o),m=wn(o),p=Lt(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 b=h-f.top-f.bottom,S=v-f.left-f.right,E=kt(h-f[y],b),x=kt(v-f[w],S),_=!t.middlewareData.shift;let O=E,D=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=b),_&&!m){const M=He(f.left,0),K=He(f.right,0),k=He(f.top,0),U=He(f.bottom,0);p?D=v-2*(M!==0||K!==0?M+K:He(f.left,f.right)):O=h-2*(k!==0||U!==0?k+U:He(f.top,f.bottom))}await u({...t,availableWidth:D,availableHeight:O});const $=await i.getDimensions(a.floating);return v!==$.width||h!==$.height?{reset:{rects:!0}}:{}}}};function so(){return typeof window<"u"}function bn(e){return xu(e)?(e.nodeName||"").toLowerCase():"#document"}function ze(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gt(e){var t;return(t=(xu(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function xu(e){return so()?e instanceof Node||e instanceof ze(e).Node:!1}function nt(e){return so()?e instanceof Element||e instanceof ze(e).Element:!1}function ht(e){return so()?e instanceof HTMLElement||e instanceof ze(e).HTMLElement:!1}function Cu(e){return!so()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ze(e).ShadowRoot}function Wn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=rt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Gy(e){return["table","td","th"].includes(bn(e))}function io(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function di(e){const t=fi(),n=nt(e)?rt(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 qy(e){let t=Rt(e);for(;ht(t)&&!xn(t);){if(di(t))return t;if(io(t))return null;t=Rt(t)}return null}function fi(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function xn(e){return["html","body","#document"].includes(bn(e))}function rt(e){return ze(e).getComputedStyle(e)}function ao(e){return nt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Rt(e){if(bn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Cu(e)&&e.host||gt(e);return Cu(t)?t.host:t}function Su(e){const t=Rt(e);return xn(t)?e.ownerDocument?e.ownerDocument.body:e.body:ht(t)&&Wn(t)?t:Su(t)}function Gn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Su(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=ze(o);if(s){const a=pi(i);return t.concat(i,i.visualViewport||[],Wn(o)?o:[],a&&n?Gn(a):[])}return t.concat(o,Gn(o,[],n))}function pi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Eu(e){const t=rt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ht(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=to(n)!==s||to(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function gi(e){return nt(e)?e:e.contextElement}function Cn(e){const t=gi(e);if(!ht(t))return pt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Eu(t);let i=(s?to(n.width):n.width)/r,a=(s?to(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Ky=pt(0);function Nu(e){const t=ze(e);return!fi()||!t.visualViewport?Ky:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Xy(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ze(e)?!1:t}function Jt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=gi(e);let i=pt(1);t&&(r?nt(r)&&(i=Cn(r)):i=Cn(e));const a=Xy(s,n,r)?Nu(s):pt(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=ze(s),p=r&&nt(r)?ze(r):r;let v=m,h=pi(v);for(;h&&r&&p!==v;){const y=Cn(h),w=h.getBoundingClientRect(),b=rt(h),S=w.left+(h.clientLeft+parseFloat(b.paddingLeft))*y.x,E=w.top+(h.clientTop+parseFloat(b.paddingTop))*y.y;u*=y.x,c*=y.y,f*=y.x,g*=y.y,u+=S,c+=E,v=ze(h),h=pi(v)}}return oo({width:f,height:g,x:u,y:c})}function hi(e,t){const n=ao(e).scrollLeft;return t?t.left+n:Jt(gt(e)).left+n}function Tu(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:hi(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function Jy(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=gt(r),a=t?io(t.floating):!1;if(r===i||a&&s)return n;let u={scrollLeft:0,scrollTop:0},c=pt(1);const f=pt(0),g=ht(r);if((g||!g&&!s)&&((bn(r)!=="body"||Wn(i))&&(u=ao(r)),ht(r))){const p=Jt(r);c=Cn(r),f.x=p.x+r.clientLeft,f.y=p.y+r.clientTop}const m=i&&!g&&!s?Tu(i,u,!0):pt(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 Yy(e){return Array.from(e.getClientRects())}function Zy(e){const t=gt(e),n=ao(e),r=e.ownerDocument.body,o=He(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=He(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+hi(e);const a=-n.scrollTop;return rt(r).direction==="rtl"&&(i+=He(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function Qy(e,t){const n=ze(e),r=gt(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=fi();(!c||c&&t==="fixed")&&(a=o.offsetLeft,u=o.offsetTop)}return{width:s,height:i,x:a,y:u}}function ew(e,t){const n=Jt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=ht(e)?Cn(e):pt(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 Pu(e,t,n){let r;if(t==="viewport")r=Qy(e,n);else if(t==="document")r=Zy(gt(e));else if(nt(t))r=ew(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 oo(r)}function Au(e,t){const n=Rt(e);return n===t||!nt(n)||xn(n)?!1:rt(n).position==="fixed"||Au(n,t)}function tw(e,t){const n=t.get(e);if(n)return n;let r=Gn(e,[],!1).filter(a=>nt(a)&&bn(a)!=="body"),o=null;const s=rt(e).position==="fixed";let i=s?Rt(e):e;for(;nt(i)&&!xn(i);){const a=rt(i),u=di(i);!u&&a.position==="fixed"&&(o=null),(s?!u&&!o:!u&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Wn(i)&&!u&&Au(e,i))?r=r.filter(f=>f!==i):o=a,i=Rt(i)}return t.set(e,r),r}function nw(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?io(t)?[]:tw(t,this._c):[].concat(n),r],a=i[0],u=i.reduce((c,f)=>{const g=Pu(t,f,o);return c.top=He(g.top,c.top),c.right=kt(g.right,c.right),c.bottom=kt(g.bottom,c.bottom),c.left=He(g.left,c.left),c},Pu(t,a,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function rw(e){const{width:t,height:n}=Eu(e);return{width:t,height:n}}function ow(e,t,n){const r=ht(t),o=gt(t),s=n==="fixed",i=Jt(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const u=pt(0);if(r||!r&&!s)if((bn(t)!=="body"||Wn(o))&&(a=ao(t)),r){const m=Jt(t,!0,s,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else o&&(u.x=hi(o));const c=o&&!r&&!s?Tu(o,a):pt(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 mi(e){return rt(e).position==="static"}function _u(e,t){if(!ht(e)||rt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return gt(e)===n&&(n=n.ownerDocument.body),n}function Fu(e,t){const n=ze(e);if(io(e))return n;if(!ht(e)){let o=Rt(e);for(;o&&!xn(o);){if(nt(o)&&!mi(o))return o;o=Rt(o)}return n}let r=_u(e,t);for(;r&&Gy(r)&&mi(r);)r=_u(r,t);return r&&xn(r)&&mi(r)&&!di(r)?n:r||qy(e)||n}const sw=async function(e){const t=this.getOffsetParent||Fu,n=this.getDimensions,r=await n(e.floating);return{reference:ow(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function iw(e){return rt(e).direction==="rtl"}const aw={convertOffsetParentRelativeRectToViewportRelativeRect:Jy,getDocumentElement:gt,getClippingRect:nw,getOffsetParent:Fu,getElementRects:sw,getClientRects:Yy,getDimensions:rw,getScale:Cn,isElement:nt,isRTL:iw};function lw(e,t){let n=null,r;const o=gt(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=no(f),v=no(o.clientWidth-(c+g)),h=no(o.clientHeight-(f+m)),y=no(c),b={rootMargin:-p+"px "+-v+"px "+-h+"px "+-y+"px",threshold:He(0,kt(1,u))||1};let S=!0;function E(x){const _=x[0].intersectionRatio;if(_!==u){if(!S)return i();_?i(!1,_):r=setTimeout(()=>{i(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(E,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,b)}n.observe(e)}return i(!0),s}function cw(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=gi(e),f=o||s?[...c?Gn(c):[],...Gn(t)]:[];f.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const g=c&&a?lw(c,n):null;let m=-1,p=null;i&&(p=new ResizeObserver(w=>{let[b]=w;b&&b.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?Jt(e):null;u&&y();function y(){const w=Jt(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(b=>{o&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),g==null||g(),(w=p)==null||w.disconnect(),p=null,u&&cancelAnimationFrame(v)}}const uw=zy,dw=Uy,fw=Vy,pw=Wy,gw=By,Ou=Ry,hw=jy,mw=(e,t,n)=>{const r=new Map,o={platform:aw,...n},s={...o.platform,_c:r};return Ly(e,t,{...o,platform:s})};var lo=typeof document<"u"?T.useLayoutEffect:T.useEffect;function co(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(!co(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)&&!co(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Du(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Mu(e,t){const n=Du(e);return Math.round(t*n)/n}function vi(e){const t=d.useRef(e);return lo(()=>{t.current=e}),t}function vw(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);co(m,r)||p(r);const[v,h]=d.useState(null),[y,w]=d.useState(null),b=d.useCallback(H=>{H!==_.current&&(_.current=H,h(H))},[]),S=d.useCallback(H=>{H!==O.current&&(O.current=H,w(H))},[]),E=s||v,x=i||y,_=d.useRef(null),O=d.useRef(null),D=d.useRef(f),$=u!=null,M=vi(u),K=vi(o),k=vi(c),U=d.useCallback(()=>{if(!_.current||!O.current)return;const H={placement:t,strategy:n,middleware:m};K.current&&(H.platform=K.current),mw(_.current,O.current,H).then(j=>{const le={...j,isPositioned:k.current!==!1};R.current&&!co(D.current,le)&&(D.current=le,lr.flushSync(()=>{g(le)}))})},[m,t,n,K,k]);lo(()=>{c===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,g(H=>({...H,isPositioned:!1})))},[c]);const R=d.useRef(!1);lo(()=>(R.current=!0,()=>{R.current=!1}),[]),lo(()=>{if(E&&(_.current=E),x&&(O.current=x),E&&x){if(M.current)return M.current(E,x,U);U()}},[E,x,U,M,$]);const J=d.useMemo(()=>({reference:_,floating:O,setReference:b,setFloating:S}),[b,S]),q=d.useMemo(()=>({reference:E,floating:x}),[E,x]),te=d.useMemo(()=>{const H={position:n,left:0,top:0};if(!q.floating)return H;const j=Mu(q.floating,f.x),le=Mu(q.floating,f.y);return a?{...H,transform:"translate("+j+"px, "+le+"px)",...Du(q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:le}},[n,a,q.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:U,refs:J,elements:q,floatingStyles:te}),[f,U,J,q,te])}const yw=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?Ou({element:r.current,padding:o}).fn(n):{}:r?Ou({element:r,padding:o}).fn(n):{}}}},ww=(e,t)=>({...uw(e),options:[e,t]}),bw=(e,t)=>({...dw(e),options:[e,t]}),xw=(e,t)=>({...hw(e),options:[e,t]}),Cw=(e,t)=>({...fw(e),options:[e,t]}),Sw=(e,t)=>({...pw(e),options:[e,t]}),Ew=(e,t)=>({...gw(e),options:[e,t]}),Nw=(e,t)=>({...yw(e),options:[e,t]});var Tw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Pw=Tw.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?sn: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}},{}),Aw="Arrow",Iu=d.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return l.jsx(Pw.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"})})});Iu.displayName=Aw;var _w=Iu;function $u(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Fw(...e){return t=>{let n=!1;const r=e.map(o=>{const s=$u(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():$u(e[o],null)}}}}function ku(...e){return d.useCallback(Fw(...e),e)}var Ow=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Lu=Ow.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?sn: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}},{}),yi="Popper",[Ru,Vu]=Dt(yi),[Dw,Bu]=Ru(yi),Hu=e=>{const{__scopePopper:t,children:n}=e,[r,o]=d.useState(null);return l.jsx(Dw,{scope:t,anchor:r,onAnchorChange:o,children:n})};Hu.displayName=yi;var zu="PopperAnchor",Uu=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Bu(zu,n),i=d.useRef(null),a=ku(t,i);return d.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:l.jsx(Lu.div,{...o,ref:a})});Uu.displayName=zu;var wi="PopperContent",[Mw,Iw]=Ru(wi),ju=d.forwardRef((e,t)=>{var Te,st,De,Qt,Ht,it;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=Bu(wi,n),[w,b]=d.useState(null),S=ku(t,je=>b(je)),[E,x]=d.useState(null),_=rl(E),O=(_==null?void 0:_.width)??0,D=(_==null?void 0:_.height)??0,$=r+(s!=="center"?"-"+s:""),M=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},K=Array.isArray(c)?c:[c],k=K.length>0,U={padding:M,boundary:K.filter(kw),altBoundary:k},{refs:R,floatingStyles:J,placement:q,isPositioned:te,middlewareData:H}=vw({strategy:"fixed",placement:$,whileElementsMounted:(...je)=>cw(...je,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[ww({mainAxis:o+D,alignmentAxis:i}),u&&bw({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?xw():void 0,...U}),u&&Cw({...U}),Sw({...U,apply:({elements:je,rects:zt,availableWidth:wt,availableHeight:en})=>{const{width:_n,height:C}=zt.reference,N=je.floating.style;N.setProperty("--radix-popper-available-width",`${wt}px`),N.setProperty("--radix-popper-available-height",`${en}px`),N.setProperty("--radix-popper-anchor-width",`${_n}px`),N.setProperty("--radix-popper-anchor-height",`${C}px`)}}),E&&Nw({element:E,padding:a}),Lw({arrowWidth:O,arrowHeight:D}),m&&Ew({strategy:"referenceHidden",...U})]}),[j,le]=qu(q),ce=_e(v);Be(()=>{te&&(ce==null||ce())},[te,ce]);const xe=(Te=H.arrow)==null?void 0:Te.x,Ne=(st=H.arrow)==null?void 0:st.y,Oe=((De=H.arrow)==null?void 0:De.centerOffset)!==0,[Bt,Ee]=d.useState();return Be(()=>{w&&Ee(window.getComputedStyle(w).zIndex)},[w]),l.jsx("div",{ref:R.setFloating,"data-radix-popper-content-wrapper":"",style:{...J,transform:te?J.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Bt,"--radix-popper-transform-origin":[(Qt=H.transformOrigin)==null?void 0:Qt.x,(Ht=H.transformOrigin)==null?void 0:Ht.y].join(" "),...((it=H.hide)==null?void 0:it.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(Mw,{scope:n,placedSide:j,onArrowChange:x,arrowX:xe,arrowY:Ne,shouldHideArrow:Oe,children:l.jsx(Lu.div,{"data-side":j,"data-align":le,...h,ref:S,style:{...h.style,animation:te?void 0:"none"}})})})});ju.displayName=wi;var Wu="PopperArrow",$w={top:"bottom",right:"left",bottom:"top",left:"right"},Gu=d.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=Iw(Wu,r),i=$w[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(_w,{...o,ref:n,style:{...o.style,display:"block"}})})});Gu.displayName=Wu;function kw(e){return e!==null}var Lw=e=>({name:"transformOrigin",options:e,fn(t){var y,w,b;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]=qu(n),g={start:"0%",center:"50%",end:"100%"}[f],m=(((w=o.arrow)==null?void 0:w.x)??0)+a/2,p=(((b=o.arrow)==null?void 0:b.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 qu(e){const[t,n="center"]=e.split("-");return[t,n]}var Rw=Hu,Vw=Uu,Bw=ju,Hw=Gu,zw="Portal",Ku=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);Be(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?_o.createPortal(l.jsx(Un.div,{...r,ref:t}),i):null});Ku.displayName=zw;function Uw(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var bi=e=>{const{present:t,children:n}=e,r=jw(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=zn(r.ref,Ww(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};bi.displayName="Presence";function jw(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=Uw(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=uo(r.current);s.current=a==="mounted"?c:"none"},[a]),Be(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,p=uo(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]),Be(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,g=p=>{const h=uo(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=uo(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 uo(e){return(e==null?void 0:e.animationName)||"none"}function Ww(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 Gw="VisuallyHidden",Xu=d.forwardRef((e,t)=>l.jsx(Un.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}}));Xu.displayName=Gw;var qw=Xu,[fo,$C]=Dt("Tooltip",[Vu]),po=Vu(),Ju="TooltipProvider",Kw=700,xi="tooltip.open",[Xw,Ci]=fo(Ju),Yu=e=>{const{__scopeTooltip:t,delayDuration:n=Kw,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(Xw,{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})};Yu.displayName=Ju;var go="Tooltip",[Jw,qn]=fo(go),Zu=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,u=Ci(go,e.__scopeTooltip),c=po(t),[f,g]=d.useState(null),m=dn(),p=d.useRef(0),v=i??u.disableHoverableContent,h=a??u.delayDuration,y=d.useRef(!1),[w=!1,b]=cn({prop:r,defaultProp:o,onChange:O=>{O?(u.onOpen(),document.dispatchEvent(new CustomEvent(xi))):u.onClose(),s==null||s(O)}}),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,b(!0)},[b]),x=d.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b(!1)},[b]),_=d.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,b(!0),p.current=0},h)},[h,b]);return d.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),l.jsx(Rw,{...c,children:l.jsx(Jw,{scope:t,contentId:m,open:w,stateAttribute:S,trigger:f,onTriggerChange:g,onTriggerEnter:d.useCallback(()=>{u.isOpenDelayed?_():E()},[u.isOpenDelayed,_,E]),onTriggerLeave:d.useCallback(()=>{v?x():(window.clearTimeout(p.current),p.current=0)},[x,v]),onOpen:E,onClose:x,disableHoverableContent:v,children:n})})};Zu.displayName=go;var Si="TooltipTrigger",Qu=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=qn(Si,n),s=Ci(Si,n),i=po(n),a=d.useRef(null),u=zn(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(Vw,{asChild:!0,...i,children:l.jsx(Un.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:Et(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:Et(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:Et(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Et(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:Et(e.onBlur,o.onClose),onClick:Et(e.onClick,o.onClose)})})});Qu.displayName=Si;var Ei="TooltipPortal",[Yw,Zw]=fo(Ei,{forceMount:void 0}),ed=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=qn(Ei,t);return l.jsx(Yw,{scope:t,forceMount:n,children:l.jsx(bi,{present:n||s.open,children:l.jsx(Ku,{asChild:!0,container:o,children:r})})})};ed.displayName=Ei;var Sn="TooltipContent",td=d.forwardRef((e,t)=>{const n=Zw(Sn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=qn(Sn,e.__scopeTooltip);return l.jsx(bi,{present:r||i.open,children:i.disableHoverableContent?l.jsx(nd,{side:o,...s,ref:t}):l.jsx(Qw,{side:o,...s,ref:t})})}),Qw=d.forwardRef((e,t)=>{const n=qn(Sn,e.__scopeTooltip),r=Ci(Sn,e.__scopeTooltip),o=d.useRef(null),s=zn(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},b=rb(w,y.getBoundingClientRect()),S=ob(w,b),E=sb(h.getBoundingClientRect()),x=ab([...S,...E]);a(x),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},b=(u==null?void 0:u.contains(y))||(f==null?void 0:f.contains(y)),S=!ib(w,i);b?m():S&&(m(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[u,f,i,c,m]),l.jsx(nd,{...e,ref:s})}),[eb,tb]=fo(go,{isInside:!1}),nd=d.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,u=qn(Sn,n),c=po(n),{onClose:f}=u;return d.useEffect(()=>(document.addEventListener(xi,f),()=>document.removeEventListener(xi,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(gu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:g=>g.preventDefault(),onDismiss:f,children:l.jsxs(Bw,{"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(Ha,{children:r}),l.jsx(eb,{scope:n,isInside:!0,children:l.jsx(qw,{id:u.contentId,role:"tooltip",children:o||r})})]})})});td.displayName=Sn;var rd="TooltipArrow",nb=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=po(n);return tb(rd,n).isInside?null:l.jsx(Hw,{...o,...r,ref:t})});nb.displayName=rd;function rb(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 ob(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 sb(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 ib(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 ab(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),lb(t)}function lb(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 cb=Yu,ub=Zu,db=Qu,fb=ed,od=td;const En=cb,Nn=ub,Tn=db,Yt=d.forwardRef(({className:e,sideOffset:t=4,...n},r)=>l.jsx(fb,{children:l.jsx(od,{ref:r,sideOffset:t,className:ee("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})}));Yt.displayName=od.displayName;function pb({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 gb=d.forwardRef(pb);var hb=function(e){return function(t,n){var r=T.useRef(!1);e(function(){return function(){r.current=!1}},[]),e(function(){if(!r.current)r.current=!0;else return t()},n)}},sd=function(e){return typeof e=="function"},id=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";const mb=hb(T.useEffect);function ad(e){var t=T.useRef(e);return t.current=e,t}var vb=function(e){id&&(sd(e)||console.error("useUnmount expected parameter is a function, got ".concat(typeof e)));var t=ad(e);T.useEffect(function(){return function(){t.current()}},[])},ho=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function wb(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ld=wb,bb=typeof ho=="object"&&ho&&ho.Object===Object&&ho,xb=bb,Cb=xb,Sb=typeof self=="object"&&self&&self.Object===Object&&self,Eb=Cb||Sb||Function("return this")(),cd=Eb,Nb=cd,Tb=function(){return Nb.Date.now()},Pb=Tb,Ab=/\s/;function _b(e){for(var t=e.length;t--&&Ab.test(e.charAt(t)););return t}var Fb=_b,Ob=Fb,Db=/^\s+/;function Mb(e){return e&&e.slice(0,Ob(e)+1).replace(Db,"")}var Ib=Mb,$b=cd,kb=$b.Symbol,ud=kb,dd=ud,fd=Object.prototype,Lb=fd.hasOwnProperty,Rb=fd.toString,Kn=dd?dd.toStringTag:void 0;function Vb(e){var t=Lb.call(e,Kn),n=e[Kn];try{e[Kn]=void 0;var r=!0}catch{}var o=Rb.call(e);return r&&(t?e[Kn]=n:delete e[Kn]),o}var Bb=Vb,Hb=Object.prototype,zb=Hb.toString;function Ub(e){return zb.call(e)}var jb=Ub,pd=ud,Wb=Bb,Gb=jb,qb="[object Null]",Kb="[object Undefined]",gd=pd?pd.toStringTag:void 0;function Xb(e){return e==null?e===void 0?Kb:qb:gd&&gd in Object(e)?Wb(e):Gb(e)}var Jb=Xb;function Yb(e){return e!=null&&typeof e=="object"}var Zb=Yb,Qb=Jb,ex=Zb,tx="[object Symbol]";function nx(e){return typeof e=="symbol"||ex(e)&&Qb(e)==tx}var rx=nx,ox=Ib,hd=ld,sx=rx,md=NaN,ix=/^[-+]0x[0-9a-f]+$/i,ax=/^0b[01]+$/i,lx=/^0o[0-7]+$/i,cx=parseInt;function ux(e){if(typeof e=="number")return e;if(sx(e))return md;if(hd(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=hd(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=ox(e);var n=ax.test(e);return n||lx.test(e)?cx(e.slice(2),n?2:8):ix.test(e)?md:+e}var dx=ux,fx=ld,Ni=Pb,vd=dx,px="Expected a function",gx=Math.max,hx=Math.min;function mx(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(px);t=vd(t)||0,fx(n)&&(f=!!n.leading,g="maxWait"in n,s=g?gx(vd(n.maxWait)||0,t):s,m="trailing"in n?!!n.trailing:m);function p(_){var O=r,D=o;return r=o=void 0,c=_,i=e.apply(D,O),i}function v(_){return c=_,a=setTimeout(w,t),f?p(_):i}function h(_){var O=_-u,D=_-c,$=t-O;return g?hx($,s-D):$}function y(_){var O=_-u,D=_-c;return u===void 0||O>=t||O<0||g&&D>=s}function w(){var _=Ni();if(y(_))return b(_);a=setTimeout(w,h(_))}function b(_){return a=void 0,m&&r?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:b(Ni())}function x(){var _=Ni(),O=y(_);if(r=arguments,o=this,u=_,O){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 x.cancel=S,x.flush=E,x}var vx=mx;const yx=yb(vx);function wx(){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}wx()||(global.Date=Date);function bx(e,t){var n;id&&(sd(e)||console.error("useDebounceFn expected parameter is a function, got ".concat(typeof e)));var r=ad(e),o=(n=t==null?void 0:t.wait)!==null&&n!==void 0?n:1e3,s=T.useMemo(function(){return yx(function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return r.current.apply(r,Tl([],Nl(i),!1))},o,t)},[]);return vb(function(){s.cancel()}),{run:s,cancel:s.cancel,flush:s.flush}}function xx(e,t,n){var r=Nl(T.useState({}),2),o=r[0],s=r[1],i=bx(function(){s({})},n).run;T.useEffect(function(){return i()},t),mb(e,[o])}const Cx=T.forwardRef(({onChange:e},t)=>{const n=T.useRef(null),[r,o]=T.useState("");return T.useImperativeHandle(t,()=>({setValue:s=>{var i;o(s),(i=n.current)==null||i.focus()}})),xx(()=>{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(gb,{className:"h-5 w-5"})})]})}),Sx=({openDialogRename:e,setOpenDialogRename:t,apiBaseUrl:n,setFileToMove:r,fileToMove:o,refreshFiles:s,ignoreCache:i})=>{var b;const[a,u]=T.useState({}),[c,f]=T.useState(!1),[g,m]=T.useState(!1),[p,v]=T.useState(""),{toast:h}=eo();T.useEffect(()=>{e&&y(p)},[p,e]);const y=async S=>{try{m(!0);const E=await oe.get(`${n}/api/list-s3-folders?prefix=${S}`);u(E==null?void 0:E.data)}catch{h({title:"Error",description:"Unable to load S3 folder list",variant:"destructive"})}finally{m(!1)}},w=async()=>{f(!0);try{const S=o.key;await oe.post(`${n}/api/move`,{oldPath:S,newPath:p}),i.current=!0,await s(),h({title:"Đã đổi tên",description:`Đã đổi tên thành công "${o.name}" thành "${p}"`}),t(!1),r(null),v("")}catch(S){console.error("Error renaming item:",S),h({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{f(!1)}};return l.jsx(St,{open:e,onOpenChange:S=>{S||(t(!1),r(null),v(""))},children:l.jsxs(ct,{className:"max-h-[700px] pb-3 px-1 s3-explr-input-group max-w-5xl w-[90%] p-6 bg-white rounded-lg shadow-lg",children:[l.jsxs(ut,{className:"mb-4 w-full h-full",children:[l.jsx("nav",{className:"mb-4",children:l.jsxs("ul",{className:"flex items-center space-x-2 text-sm text-gray-600",children:[l.jsx("li",{className:"cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>v(""),children:"Root"}),p.split("/").map((S,E,x)=>l.jsx("li",{className:"cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>v(S==="Root"?"":x.slice(0,E+1).join("/")+"/"),children:S},E))]})}),l.jsxs(dt,{className:"text-xl font-semibold text-gray-800",children:["Di chuyển"," ",l.jsxs("span",{className:"text-sm text-gray-500",children:["( file Hoặc folder sẽ được di chuyển đến thư mục"," ",p===""?"Root":p," )"]})]}),l.jsx(mn,{className:"text-gray-600 w-full h-[50dvh] max-h-[500px] overflow-hidden overflow-y-auto",children:g?l.jsx("div",{className:"flex justify-center items-center py-4",children:l.jsx("div",{className:"loader ease-linear rounded-full border-4 border-t-4 border-gray-200 h-12 w-12"})}):l.jsx("ul",{className:"space-y-2",children:(b=Object.keys(a))==null?void 0:b.map(S=>l.jsx("li",{className:"cursor-pointer hover:bg-gray-100 p-2 rounded transition-colors",onClick:()=>v(S),children:S},S))})})]}),l.jsxs(Kt,{className:"flex justify-end space-x-2",children:[l.jsx(ie,{variant:"outline",onClick:()=>t(!1),className:"px-4 py-2 rounded border border-gray-300 text-gray-700 hover:bg-gray-100 transition-colors",children:"Cancel"}),l.jsx(ie,{onClick:w,disabled:c,className:"s3-explr-crawl-btn",children:"Move"})]})]})})},Ue={current:!1},yd="crawl:jobs",Pn="crawl:current_job",Ex=e=>{const[t,n]=T.useState(null),[r,o]=T.useState(0);return T.useEffect(()=>{const s=localStorage.getItem(Pn);if(s){const i=JSON.parse(s);n(i),i!=null&&i.startTime&&o(Math.floor((Date.now()-i.startTime)/1e3))}},[]),T.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]),T.useEffect(()=>{if(!(t!=null&&t.id))return;const s=async()=>{try{const u=(await oe.get(`${e}/api/crawl/${t.id}?taskId=${t.taskId}`)).data;n(c=>{if(!c)return null;const f={...c,status:u};return localStorage.setItem(Pn,JSON.stringify(f)),(u.status==="completed"||u.status==="failed")&&setTimeout(()=>{n(null),localStorage.removeItem(Pn)},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(Pn,JSON.stringify(s)):localStorage.removeItem(Pn)}}},mo=(e,t)=>{const n=[],r=o=>{(e[o]||[]).forEach(i=>{n.push(i.key),i.isFolder&&r(i.key)})};return r(t),n},Nx=(e,t)=>{const n=[];return(e[t]||[]).forEach(o=>{n.push(o.key),o.isFolder&&n.push(...mo(e,o.key))}),n},Tx=(e,t,n=[],r,o,s)=>{const[i,a]=T.useState({}),[u,c]=T.useState(!1),[f,g]=T.useState(null),[m,p]=T.useState(0),v=T.useRef(t);T.useEffect(()=>{v.current=t},[t]);const h=async()=>{c(!0);try{const w=await oe.get(`${e}/api/files`,{params:{cache:!1,displayPrefixes:JSON.stringify(n),prefix:v.current},timeout:3e5});a(w.data),g(null)}catch(w){g(w instanceof Error?w:new Error("Failed to fetch files"))}finally{c(!1),p(0),s("")}};T.useEffect(()=>{h()},[]);const y=async w=>{var b,S;try{if(!w)return;c(!0);const E=await oe.get(`${e}/api/search-db?query=${w}&rootPrefix=${t}&offset=${(o-1)*20}&limit=20`,{timeout:3e5});return a({[t]:((b=E==null?void 0:E.data)==null?void 0:b.result)||[]}),p(((S=E==null?void 0:E.data)==null?void 0:S.estimatedTotalHits)||0),E}catch(E){g(E instanceof Error?E:new Error("Failed to fetch files"))}finally{c(!1)}};return T.useEffect(()=>{!r&&!u&&h(),r&&!u&&y(r)},[r,o]),{data:i,isLoading:u,error:f,estimatedTotalHits:m,refetch:h}},Xn=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||"")},Px=T.memo(({homeLabel:e="Kho tài liệu",apiBaseUrl:t="http://localhost:3002",rootPrefix:n="",asSelector:r=!1,onSelected:o=a=>console.log("Đã chọn:",a),displayPrefixes:s,preSelectedFiles:i})=>{var Wd;const[a,u]=T.useState([]),[c,f]=T.useState(""),[g,m]=T.useState(new Set),[p,v]=T.useState(n),[h,y]=T.useState(null),[w,b]=T.useState(!1),[S,E]=T.useState(""),[x,_]=T.useState(!1),[O,D]=T.useState(null),[$,M]=T.useState(null),[K,k]=T.useState(!1),[U,R]=T.useState(!1),[J,q]=T.useState(null),te=T.useRef(null),{toast:H}=eo(),[j,le]=T.useState(null),[ce,xe]=T.useState(null),[Ne,Oe]=T.useState(""),[Bt,Ee]=T.useState(!1),[Te,st]=T.useState(!1),[De,Qt]=T.useState(new Set),[Ht,it]=T.useState(""),[je,zt]=T.useState(!1),[wt,en]=T.useState(!1),[_n,C]=T.useState("rename"),[N,F]=T.useState(!1),[z,B]=T.useState(""),[V,Y]=T.useState("1"),[ne,me]=T.useState(!1),[Ce,Me]=T.useState(!1),[So,Fn]=T.useState(!1),[Ie,er]=T.useState(1),[tr,Eo]=T.useState(!1),{currentJob:ue,elapsedTime:No,setCurrentJob:Vd}=Ex(t),[nr,rr]=T.useState(null),[Ii,To]=T.useState(""),[Zx,or]=T.useState(!1),Qx=h||n,{data:bt,isLoading:$i,error:eC,estimatedTotalHits:sr,refetch:We}=Tx(t,Qx,s,c,Ie,f);T.useEffect(()=>{const A=new Set(i);m(A)},[]),T.useEffect(()=>{ue!=null&&ue.status&&(ue.status.status==="completed"?(H({title:"Thu thập website hoàn tất",description:`Đã thu thập thành công ${ue.url} với ${ue.status.completed} trang`}),Ue.current=!0,We()):ue.status.status==="failed"&&H({title:"Thu thập website thất bại",description:`Không thể thu thập ${ue.url}. Vui lòng thử lại.`,variant:"destructive"}))},[(Wd=ue==null?void 0:ue.status)==null?void 0:Wd.status]);const Bd=T.useMemo(()=>bt[p]||[],[bt,p]),tn=T.useMemo(()=>Bd,[Bd,p,bt]),ir=T.useMemo(()=>{const A={};return tn.forEach((I,L)=>{g.has(I.key)&&(A[L]=!0)}),A},[g,tn]),tC=A=>{const I=mo(bt,A);if(I.length===0)return g.has(A)?"all":"none";const L=I.filter(W=>g.has(W)).length;return L===0?"none":L===I.length?"all":"partial"},Po=A=>{p!==A&&(Eo(!0),y(A),v(A),m(new Set))};T.useEffect(()=>{tr&&(Ue.current=!0,We().finally(()=>Eo(!1)))},[tr]);const nC=async(A,I)=>{_(!0);try{const L=`${I}${A}/`;if((await oe.post(`${t}/api/create-folder`,{prefix:L})).status!==200){H({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"});return}Ue.current=!0,await We(),H({title:"Đã tạo thư mục",description:`Đã tạo thành công thư mục "${A}"`}),E(""),b(!1)}catch(L){console.error("Error creating folder:",L),H({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"})}finally{_(!1)}},Hd=async(A,I,L)=>{var W,X,ae,ge,Xe,On,Gd,qd,Kd;q(L),Me(!0);try{if(Array.from(A).reduce((Ut,Li)=>Ut+Li.size,0)>=100*1024*1024){H({title:"Lỗi",description:"Tổng kích thước các tập tin vượt quá 100 MB",variant:"destructive"});return}const nn=new FormData;if(L==="folder"&&A[0]){const Ut=A[0].webkitRelativePath.split("/")[0];Ut&&nn.append("folderName",Ut)}nn.append("prefix",I),Array.from(A).forEach(Ut=>nn.append("files",Ut)),Ue.current=!0;const Se=await oe.post(`${t}/api/check-files-existed`,nn,{headers:{"Content-Type":"multipart/form-data"}});if(((W=Se==null?void 0:Se.data)==null?void 0:W.status)===200)await oe.post(`${t}/api/upload`,nn,{headers:{"Content-Type":"multipart/form-data"}}),f(""),y(I),setTimeout(async()=>{q(null),await We(),Me(!1)},500);else{if(((ae=(X=Se==null?void 0:Se.data)==null?void 0:X.names)==null?void 0:ae.length)>0&&!((ge=Se==null?void 0:Se.data)!=null&&ge.isFolder)){const Ut=Array.from(A).filter(Li=>Se.data.names.includes(Li.name));rr(Ut),or(!0)}(Xe=Se==null?void 0:Se.data)!=null&&Xe.isFolder&&((On=Se==null?void 0:Se.data)!=null&&On.name)&&(To((Gd=Se==null?void 0:Se.data)==null?void 0:Gd.name),rr(A),or(!0))}}catch(ar){console.error("Lỗi tải lên:",ar);const nn=((Kd=(qd=ar==null?void 0:ar.response)==null?void 0:qd.data)==null?void 0:Kd.error)||"Không thể tải lên tập tin";H({title:"Lỗi",description:nn,variant:"destructive"}),q(null),Me(!1)}},rC=async()=>{var A,I;try{Me(!0);const L=new FormData;if(nr){q(Ii?"folder":"files"),or(!1);let W=localStorage.getItem("dataLogin"),X;try{W&&(W=JSON.parse(W),X=W.user)}catch{W=null}X!=null&&X.id&&(console.log("🚀 ~ uploadFiles ~ user:",X),L.append("metadata",JSON.stringify({creator:X.username,creatorId:X.id,DataSource:"Tệp tải lên"}))),L.append("prefix",p),Array.from(nr).forEach(ae=>L.append("files",ae)),X!=null&&X.id&&L.append("metadata",JSON.stringify({creator:X.username,creatorId:X.id,DataSource:"Tệp tải lên"})),await oe.post(`${t}/api/upload`,L,{headers:{"Content-Type":"multipart/form-data"}}),f(""),y(p),Ue.current=!0}}catch(L){console.error("Lỗi tải lên:",L);const W=((I=(A=L==null?void 0:L.response)==null?void 0:A.data)==null?void 0:I.error)||"Không thể tải lên tập tin";H({title:"Lỗi",description:W,variant:"destructive"})}finally{setTimeout(async()=>{q(null),await We(),Me(!1),To(""),rr(null)},500)}},oC=async A=>{var I;Fn(!0);try{await oe.delete(`${t}/api/files`,{data:{paths:[A.key]}});const L=((I=A.key)==null?void 0:I.replace(/^(.*?)(\/.*)?$/,(W,X,ae)=>!ae||ae==="/"?"":X+"/"))||"";y(L),Ue.current=!0,H({title:"Đã xóa tập tin",description:`Đã xóa thành công "${A.name}"`}),D(null)}catch(L){console.error("Error deleting file:",L),H({title:"Lỗi",description:"Không thể xóa tập tin",variant:"destructive"})}finally{Fn(!1),await We()}},Ao=A=>{const I=new Set(g),L=typeof A=="function"?A(ir):A;new Set(Object.keys(ir).map(Number)).forEach(X=>{const ae=tn[X];ae&&(L[X]||(I.delete(ae.key),ae.isFolder&&mo(bt,ae.key).forEach(ge=>I.delete(ge))))}),Object.entries(L).forEach(([X,ae])=>{const ge=parseInt(X),Xe=tn[ge];Xe&&ae&&(I.add(Xe.key),Xe.isFolder&&mo(bt,Xe.key).forEach(On=>I.add(On)))}),m(I)},sC=async()=>{var A;k(!0);try{const I=Array.from(g),L=I.map(X=>Object.values(bt).flat().find(ae=>ae.key===X)).filter(X=>X!==void 0);if(L.length===0){H({title:"Lỗi",description:"Không có tập tin nào được chọn để xóa",variant:"destructive"});return}await oe.delete(`${t}/api/files`,{data:{paths:I}});const W=((A=L[0])==null?void 0:A.key.replace(/^(.*?)(\/.*)?$/,(X,ae,ge)=>!ge||ge==="/"?"":ae+"/"))||"";y(W),Ue.current=!0,We(),H({title:"Đã xóa tập tin",description:`Đã xóa thành công ${L.length} mục`}),R(!1),m(new Set)}catch(I){console.error("Error deleting files:",I),H({title:"Lỗi",description:"Không thể xóa các tập tin đã chọn",variant:"destructive"})}finally{k(!1)}},iC=async(A,I)=>{st(!0);try{const L=A.key;let W;A.isFolder?W=L.split("/").slice(0,-2).join("/")+"/":W=L.substring(0,L.lastIndexOf("/")+1);const X=W+I+(A.isFolder?"/":"");await oe.post(`${t}/api/rename`,{oldPath:L,newPath:X}),Ue.current=!0,await We(),H({title:"Đã đổi tên",description:`Đã đổi tên thành công "${A.name}" thành "${I}"`}),le(null),Oe(""),xe(null)}catch(L){console.error("Error renaming item:",L),H({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{st(!1)}},zd=async A=>{Qt(I=>new Set([...I,...A]));try{const I=await oe.post(`${t}/api/download`,{paths:A},{responseType:"blob"}),L=window.URL.createObjectURL(I.data),W=document.createElement("a");W.href=L;const X=I.headers["Content-Disposition"]||I.headers["content-disposition"],ae=X==null?void 0:X.match(/filename="(.+)"/),ge=ae?decodeURIComponent(ae[1]):"download.zip";W.setAttribute("download",ge),document.body.appendChild(W),W.click(),document.body.removeChild(W),window.URL.revokeObjectURL(L),H({title:"Bắt đầu tải xuống",description:`Đã bắt đầu tải xuống ${A.length} mục${A.length>1,""}`})}catch(I){console.error("Error downloading files:",I),H({title:"Lỗi",description:"Không thể tải xuống tập tin",variant:"destructive"})}finally{Qt(I=>{const L=new Set(I);return A.forEach(W=>L.delete(W)),L})}},Ud=p?p.replace(n,"").split("/").filter(Boolean):[],aC=()=>Array.from(g).map(A=>{var I;for(const L in bt){const W=(I=bt[L])==null?void 0:I.find(X=>X.key===A);if(W)return W}return null}).filter(A=>A!==null),jd=T.useMemo(()=>{const A=[{id:"select",header:()=>{const I=Nx(bt,p),L=I.length>0&&I.every(X=>g.has(X)),W=I.some(X=>g.has(X));return l.jsx(ws,{checked:L?!0:W?"indeterminate":!1,onCheckedChange:X=>{if(X){const ae=tn.reduce((ge,Xe,On)=>(ge[On]=!0,ge),{});Ao(ae)}else Ao({})},"aria-label":"Chọn tất cả"})},cell:({row:I})=>{const L=I.original,X=L.isFolder?tC(L.key):g.has(L.key)?"all":"none";return l.jsx("div",{className:"flex items-center",children:l.jsx(ws,{checked:X==="partial"?"indeterminate":X==="all",onCheckedChange:ae=>{const ge={...ir};ae?ge[I.index]=!0:delete ge[I.index],Ao(ge)},"aria-label":"Chọn dòng"})})},enableSorting:!1},{id:"fileName",header:({column:I})=>l.jsxs(ie,{variant:"ghost",onClick:()=>I.toggleSorting(I.getIsSorted()==="asc"),children:["Tên tập tin",l.jsx(as,{})]}),accessorKey:"name",cell:({row:I})=>{const L=I.original,W=L.key.substring(0,L.key.lastIndexOf("/"))||"/",X=c.trim()!==""&&W!==p,ae=W.split("/").filter(Boolean);return l.jsxs("div",{className:"flex flex-col",children:[l.jsxs("div",{className:`flex items-center gap-2 ${L.isFolder?"cursor-pointer hover:text-blue-600":""}`,onClick:()=>{L.isFolder&&(m(new Set),Po(L.key))},children:[L.isFolder?l.jsx(Fo,{className:"h-5 w-5 text-blue-500"}):null,L.name]}),X&&l.jsxs("div",{className:"text-sm text-gray-500 flex items-center",children:[l.jsx(Fo,{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:()=>{Po("")},children:"/"}),ae.map((ge,Xe)=>l.jsxs("span",{className:"flex items-center",children:[l.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{Po(ae.slice(0,Xe+1).join("/")+"/")},children:ge}),Xe<ae.length-1&&l.jsx("span",{children:"/"})]},Xe))]})]})]})}}];return r||A.push({id:"size",header:({column:I})=>l.jsxs(ie,{variant:"ghost",onClick:()=>I.toggleSorting(I.getIsSorted()==="asc"),children:["Kích thước",l.jsx(as,{})]}),accessorKey:"size",cell:({getValue:I,row:L})=>{const W=I();return l.jsx("span",{children:L.original.isFolder?"-":uh(W)})}},{id:"lastModified",header:({column:I})=>l.jsxs(ie,{variant:"ghost",onClick:()=>I.toggleSorting(I.getIsSorted()==="asc"),children:["Sửa đổi lần cuối",l.jsx(as,{})]}),accessorKey:"lastModified",cell:({row:I})=>{const L=I.original.lastModified;return l.jsx("span",{children:L.toLocaleString()})}},{id:"actions",header:()=>l.jsx("span",{children:"Hành động"}),accessorKey:"key",cell:({row:I})=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(En,{children:l.jsxs(Nn,{children:[l.jsx(Tn,{asChild:!0,children:l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>zd([I.original.key]),className:"h-8 w-8 p-0",disabled:De.has(I.original.key),children:De.has(I.original.key)?l.jsx(ve,{className:"h-4 w-4 animate-spin"}):l.jsx(Vi,{className:"h-4 w-4"})})}),l.jsx(Yt,{children:"Tải xuống"})]})}),l.jsx(En,{children:l.jsxs(Nn,{children:[l.jsx(Tn,{asChild:!0,children:l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>{le(I.original),Oe(I.original.name)},className:"h-8 w-8 p-0",children:l.jsx(af,{className:"h-4 w-4"})})}),l.jsx(Yt,{children:"Đổi tên"})]})}),l.jsx(En,{children:l.jsxs(Nn,{children:[l.jsx(Tn,{asChild:!0,children:l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>{Ee(!0),M(I.original)},className:"h-8 w-8 p-0",children:l.jsx(Eg,{className:"h-4 w-4"})})}),l.jsx(Yt,{children:"Di chuyển"})]})}),l.jsx(En,{children:l.jsxs(Nn,{children:[l.jsx(Tn,{asChild:!0,children:l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>D(I.original),className:"h-8 w-8 p-0",children:l.jsx(Bi,{className:"h-4 w-4"})})}),l.jsx(Yt,{children:"Xóa"})]})})]})}),A},[g,tn,ir,De,r]),ki=Qi({data:tn,columns:jd,state:{rowSelection:ir,sorting:a},onSortingChange:u,enableRowSelection:!0,onRowSelectionChange:Ao,getCoreRowModel:Zi(),getSortedRowModel:Uf()}),lC=async A=>{var I,L;zt(!0);try{if(Xn(A)){const W=await oe.get(`${t}/api/read-text`,{params:{path:A.key}});it(W.data.content)}try{const W=await oe.get(`${t}/api/read-json`,{params:{path:A.key+".metadata.json"}}),X=((L=(I=W==null?void 0:W.data)==null?void 0:I.content)==null?void 0:L.metadataAttributes)||null;return xe({fullPath:j==null?void 0:j.key,...X})}catch{return xe("Lỗi phân tích siêu dữ liệu")}}catch(W){console.error("Error loading file content:",W),H({title:"Lỗi",description:"Không thể tải nội dung tập tin",variant:"destructive"})}finally{zt(!1)}},cC=async(A,I)=>{en(!0);try{await oe.post(`${t}/api/modify-text`,{path:A.key,content:I}),H({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),Ue.current=!0,await We(),le(null),it(""),C("rename")}catch(L){console.error("Error saving file content:",L),H({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{en(!1)}},uC=async A=>{en(!0);try{console.log("🚀 ~ saveJsonFile ~ metadataForEdit:",ce),await oe.post(`${t}/api/modify-json`,{path:A.key+".metadata.json",content:{metadataAttributes:ce}}),H({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),Ue.current=!0,await We(),le(null),it(""),C("rename")}catch(I){console.error("Error saving file content:",I),H({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{en(!1)}};T.useEffect(()=>{j&&(j.isFolder||lC(j),C("rename"))},[j]);const dC=async(A,I)=>{var L;if(ue){H({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}me(!0);try{const{data:W}=await oe.post(`${t}/api/crawl`,{url:A,limit:I,prefix:p});if(W.id){Vd({id:W.id,url:A,limit:I,prefix:p,taskId:((L=W.task)==null?void 0:L.id)||""});const X=localStorage.getItem(yd),ae=X?JSON.parse(X):[];ae.some(ge=>ge.id===W.id)||(ae.unshift({url:A,id:W.id,limit:I,prefix:p,timestamp:Date.now()}),ae.length>20&&(ae.length=20),localStorage.setItem(yd,JSON.stringify(ae))),H({title:"Bắt đầu thu thập website",description:`Đã thêm nhiệm vụ thu thập ${A} với giới hạn ${I}. Dữ liệu sẽ có sẵn sau khi thu thập hoàn tất.`}),F(!1),B(""),Y("1")}}catch(W){console.error("Error crawling website:",W),H({title:"Lỗi",description:"Không thể bắt đầu thu thập website",variant:"destructive"})}finally{me(!1)}},fC=async()=>{try{if(!(ue!=null&&ue.id))return;Vd(null),localStorage.removeItem(Pn),H({title:"Đã dừng thu thập",description:`Đã dừng thu thập website ${ue.url}`})}catch(A){console.error("Error stopping job:",A),H({title:"Lỗi",description:"Không thể dừng thu thập website",variant:"destructive"})}};return l.jsxs("div",{className:"space-y-4 s3-explr-container",children:[l.jsx(uu,{}),l.jsx(St,{open:Zx,onOpenChange:A=>{or(A),A||(To(""),rr(null),Me(!1),q(null))},children:l.jsxs(ct,{children:[l.jsxs(ut,{children:[l.jsx(dt,{children:"Cảnh báo trùng lặp"}),l.jsxs(mn,{children:[Ii&&l.jsxs(l.Fragment,{children:["Folder $",Ii," đã có."]}),nr&&nr.length>0&&l.jsxs(l.Fragment,{children:["Những tệp sau bị lặp:",l.jsx("ul",{className:"mt-2 list-disc pl-5 text-sm text-red-600",children:Array.from(nr).map((A,I)=>l.jsx("li",{children:A.name},I))})]})]})]}),l.jsxs(Kt,{children:[l.jsx(ie,{variant:"outline",onClick:()=>{or(!1),To(""),rr(null),Me(!1),q(null)},children:"Bỏ qua"}),l.jsx(ie,{variant:"destructive",onClick:()=>rC(),children:"Ghi đè"})]})]})}),l.jsx(Ya,{className:"s3-explr-breadcrumb",children:l.jsxs(Za,{className:"s3-explr-breadcrumb-list",children:[l.jsx(gs,{className:"s3-explr-breadcrumb-item",children:l.jsx(hs,{onClick:()=>{p!==""&&m(new Set),y(""),v(""),Ue.current=!0,setTimeout(()=>{We()},0)},className:"flex items-center gap-1 cursor-pointer s3-explr-breadcrumb-home",children:e})}),Ud.map((A,I)=>l.jsxs("div",{className:"flex items-center",children:[l.jsx(Qa,{className:"s3-explr-breadcrumb-separator"},`sep-${I}`),l.jsx(gs,{className:"s3-explr-breadcrumb-item",children:l.jsx(hs,{onClick:()=>Po(n+Ud.slice(0,I+1).join("/")+"/"),className:"cursor-pointer s3-explr-breadcrumb-link",children:A})},`item-${A}`)]},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(Cx,{ref:te,onChange:A=>f(A)})}),l.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>{y(p),Ue.current=!0,We()},disabled:$i,className:"flex items-center gap-2 s3-explr-refresh-btn",children:[l.jsx(Yd,{className:`h-4 w-4 s3-explr-refresh-icon ${$i?"animate-spin":""}`}),"Làm mới"]}),!r&&l.jsxs(l.Fragment,{children:[g.size>0&&l.jsxs(l.Fragment,{children:[l.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>zd(Array.from(g)),disabled:Array.from(g).some(A=>De.has(A)),className:"flex items-center gap-2 s3-explr-download-selected-btn",children:[Array.from(g).some(A=>De.has(A))?l.jsx(ve,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}):l.jsx(Vi,{className:"h-4 w-4 s3-explr-download-icon"}),"Tải xuống đã chọn (",g.size,")"]}),l.jsxs(St,{open:U,onOpenChange:R,children:[l.jsx($r,{asChild:!0,children:l.jsxs(ie,{variant:"destructive",size:"sm",className:"flex items-center gap-2 s3-explr-bulk-delete-btn",children:[l.jsx(Bi,{className:"h-4 w-4 s3-explr-trash-icon"}),"Xóa đã chọn (",g.size,")"]})}),l.jsxs(ct,{className:"s3-explr-dialog-content",children:[l.jsxs(ut,{className:"s3-explr-dialog-header",children:[l.jsx(dt,{className:"s3-explr-dialog-title",children:"Xác nhận xóa hàng loạt"}),l.jsxs(mn,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",g.size," mục đã chọn? Hành động này không thể hoàn tác."]})]}),l.jsxs(Kt,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>R(!1),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(ie,{variant:"destructive",onClick:sC,disabled:K,className:"s3-explr-confirm-delete-btn",children:K?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa đã chọn"})]})]})]})]}),l.jsxs(St,{open:w,onOpenChange:b,children:[l.jsx($r,{asChild:!0,children:l.jsxs(ie,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-new-folder-btn",disabled:!!s&&!p,children:[l.jsx(tf,{className:"h-4 w-4 s3-explr-folder-plus-icon"}),"Thư mục mới"]})}),l.jsxs(ct,{className:"s3-explr-dialog-content",children:[l.jsx(ut,{className:"s3-explr-dialog-header",children:l.jsx(dt,{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(Xt,{htmlFor:"name",className:"s3-explr-label",children:"Tên thư mục"}),l.jsx($t,{disabled:x,id:"name",value:S,onChange:A=>E(A.target.value),placeholder:"Nhập tên thư mục",className:"s3-explr-input"})]}),l.jsxs(ie,{onClick:()=>{S.trim()&&nC(S,p)},disabled:x,className:"s3-explr-create-btn",children:[x&&l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),x?"Đang tạo...":"Tạo"]})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2 s3-explr-upload-group",children:[l.jsx(ie,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-upload-files-btn",onClick:()=>{const A=document.createElement("input");A.type="file",A.multiple=!0,A.onchange=I=>{const L=I.target.files;L&&Hd(L,p,"files")},A.click()},disabled:J!==null||!!s&&!p,children:J==="files"?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Qd,{className:"h-4 w-4 s3-explr-upload-icon"}),"Tải lên tập tin"]})}),l.jsx(ie,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-upload-folder-btn",onClick:()=>{const A=document.createElement("input");A.type="file",A.multiple=!0,A.webkitdirectory=!0,A.onchange=I=>{const L=I.target.files;L&&Hd(L,p,"folder")},A.click()},disabled:J!==null||!!s&&!p,children:J==="folder"?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Fo,{className:"h-4 w-4 s3-explr-folder-icon"}),"Tải lên thư mục"]})}),ue?l.jsx(En,{delayDuration:0,children:l.jsxs(Nn,{children:[l.jsx(Tn,{asChild:!0,children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(ie,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!0,children:[l.jsx(ve,{className:"h-4 w-4 animate-spin s3-explr-loader"}),ue.status?l.jsxs(l.Fragment,{children:["Đang thu thập (",ue.status.completed,"/",ue.status.total,") - ",Math.floor(No/60),":",String(No%60).padStart(2,"0")]}):"Đang thu thập..."]}),l.jsxs(ie,{variant:"destructive",size:"sm",onClick:()=>void fC(),className:"flex items-center gap-2",children:[l.jsx("span",{className:"sr-only",children:"Dừng thu thập"}),l.jsx(cf,{className:"h-4 w-4"})]})]})}),ue.status&&l.jsx(Yt,{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 ",ue.url]}),l.jsxs("p",{children:["Tiến độ: ",ue.status.completed,"/",ue.status.total," trang"]}),l.jsxs("p",{children:["Thời gian: ",Math.floor(No/60),":",String(No%60).padStart(2,"0")]}),l.jsxs("p",{children:["Trạng thái:"," ",ue.status.status==="scraping"?"Đang thu thập":ue.status.status==="completed"?"Hoàn thành":"Thất bại"]})]})})]})}):l.jsxs(St,{open:N,onOpenChange:F,children:[l.jsx($r,{asChild:!0,children:l.jsxs(ie,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!!s&&!p,children:[l.jsx(of,{className:"h-4 w-4 s3-explr-globe-icon"}),"Thêm website"]})}),l.jsxs(ct,{className:"s3-explr-dialog-content",children:[l.jsxs(ut,{className:"s3-explr-dialog-header",children:[l.jsx(dt,{className:"s3-explr-dialog-title",children:"Thêm website"}),l.jsx(mn,{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(Xt,{htmlFor:"websiteUrl",className:"s3-explr-label",children:"URL Website"}),l.jsx($t,{id:"websiteUrl",value:z,onChange:A=>B(A.target.value),placeholder:"https://example.com",type:"url",disabled:ne,className:"s3-explr-input"})]}),l.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[l.jsx(Xt,{htmlFor:"crawlLimit",className:"s3-explr-label",children:"Giới hạn thu thập"}),l.jsx($t,{id:"crawlLimit",value:V,onChange:A=>{const I=A.target.value;/^\d*$/.test(I)&&Y(I)},placeholder:"1",type:"text",disabled:ne,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(Kt,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>{F(!1),B(""),Y("1")},disabled:ne,className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(ie,{onClick:()=>{z.trim()&&dC(z.trim(),parseInt(V)||1)},disabled:ne||!z.trim(),className:"s3-explr-crawl-btn",children:ne?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]}):"Bắt đầu thu thập"})]})]})]})]}),l.jsx(St,{open:!!O,onOpenChange:A=>!A&&D(null),children:l.jsxs(ct,{className:"s3-explr-dialog-content",children:[l.jsxs(ut,{className:"s3-explr-dialog-header",children:[l.jsx(dt,{className:"s3-explr-dialog-title",children:"Xác nhận xóa"}),l.jsxs(mn,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",O==null?void 0:O.name,"? Hành động này không thể hoàn tác."]})]}),l.jsxs(Kt,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>D(null),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(ie,{variant:"destructive",onClick:()=>oC(O),disabled:So,className:"s3-explr-confirm-delete-btn",children:So?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa"})]})]})}),l.jsx(St,{open:!!j,onOpenChange:A=>{A||(le(null),xe(null),Oe(""),it(""),C("rename"))},children:l.jsxs(ct,{className:"s3-explr-dialog-content max-w-5xl w-[90%]",children:[l.jsx(ut,{className:"s3-explr-dialog-header",children:l.jsx(dt,{className:"s3-explr-dialog-title",children:j!=null&&j.isFolder?"Đổi tên thư mục":Xn(j)?"Quản lý tập tin":"Đổi tên tập tin"})}),j&&l.jsxs(Rv,{value:_n,onValueChange:A=>C(A),children:[l.jsxs(Lc,{"aria-checked":!Xn(j),"aria-disabled":j.isFolder,className:"grid w-full grid-cols-3 aria-checked:grid-cols-2 aria-disabled:grid-cols-1",children:[l.jsx(qr,{value:"rename",children:"Đổi tên"}),!j.isFolder&&l.jsxs(l.Fragment,{children:[Xn(j)&&l.jsx(qr,{value:"edit",children:"Sửa nội dung"}),l.jsx(qr,{value:"edit-metadata",children:"Sửa metadata file"})]})]}),l.jsx(Kr,{value:"rename",children:l.jsx("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:l.jsxs("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1 s3-explr-input-group",children:[l.jsx(Xt,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),l.jsx($t,{id:"newName",value:Ne,onChange:A=>Oe(A.target.value),placeholder:"Nhập tên mới",disabled:Te,className:"s3-explr-input"})]})})}),!j.isFolder&&l.jsxs(l.Fragment,{children:[Xn(j)&&l.jsx(Kr,{value:"edit",children:l.jsx("div",{className:"space-y-4 py-4",children:je?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx(ve,{className:"h-6 w-6 animate-spin"})}):l.jsxs("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1",children:[l.jsx(Xt,{htmlFor:"content",className:"s3-explr-label",children:"Nội dung tập tin"}),l.jsx(Bn,{id:"content",value:Ht,onChange:A=>it(A.target.value),placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:wt})]})})}),l.jsx(Kr,{value:"edit-metadata",children:l.jsx("div",{className:"space-y-4 py-4",children:je?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx(ve,{className:"h-6 w-6 animate-spin"})}):l.jsx("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1",children:ce&&typeof ce=="object"&&Object.entries(ce).map(([A,I],L)=>l.jsxs("div",{className:"pb-3 flex flex-col gap-2",children:[l.jsxs(Xt,{htmlFor:A,className:"s3-explr-label flex items-center gap-1",children:[Pg[A]||A,cs(A)&&l.jsx(Ng,{className:"h-[12px] w-[12px] text-red-500"})]}),Ag(A)?l.jsx(Bn,{id:A,value:typeof I=="string"?I:JSON.stringify(I),onChange:W=>{const X={...ce,[A]:W.target.value};xe(X)},placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:wt||cs(A)}):l.jsx($t,{id:A,value:typeof I=="string"?I:JSON.stringify(I),onChange:W=>{const X={...ce,[A]:W.target.value};xe(X)},placeholder:"Nhập nội dung",className:"s3-explr-input",disabled:wt||cs(A)})]},L))})})})]})]}),l.jsxs(Kt,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>{le(null),xe(null),Oe(""),it("")},className:"s3-explr-cancel-btn",children:"Hủy"}),_n==="edit"?l.jsx(ie,{onClick:()=>j&&cC(j,Ht),disabled:wt||je,className:"s3-explr-save-btn",children:wt?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):_n==="edit-metadata"?l.jsx(ie,{onClick:()=>ce&&typeof ce=="object"&&j&&uC(j),disabled:wt||je,className:"s3-explr-save-btn",children:wt?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):l.jsx(ie,{onClick:()=>{Ne.trim()&&j&&iC(j,Ne.trim())},disabled:Te||!Ne.trim()||Ne.trim()===(j==null?void 0:j.name),className:"s3-explr-rename-btn",children:Te?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang đổi tên..."]}):"Đổi tên"})]})]})}),$&&Bt&&l.jsx(Sx,{openDialogRename:Bt,setOpenDialogRename:Ee,apiBaseUrl:t,setFileToMove:M,fileToMove:$,refreshFiles:We,ignoreCache:Ue})]})]}),eC&&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(Hr,{className:"s3-explr-table",children:[l.jsx(zr,{className:"s3-explr-table-header",children:ki.getHeaderGroups().map(A=>l.jsx(tt,{className:"hover:bg-transparent s3-explr-header-row",children:A.headers.map(I=>l.jsx(ft,{className:"s3-explr-header-cell",children:I.isPlaceholder?null:pr(I.column.columnDef.header,I.getContext())},I.id))},A.id))}),l.jsx(Ur,{className:"s3-explr-table-body",children:ki.getRowModel().rows.length===0?l.jsx(tt,{className:"s3-explr-empty-row",children:l.jsx(ke,{colSpan:jd.length,className:"h-24 text-center s3-explr-empty-cell",children:c?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 "',c,'"']}):l.jsx("div",{className:"text-gray-500 s3-explr-empty-message",children:$i?"Đ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"})})}):ki.getRowModel().rows.map(A=>l.jsx(tt,{className:"h-12 s3-explr-row",children:A.getVisibleCells().map(I=>l.jsx(ke,{className:"align-middle s3-explr-cell",children:pr(I.column.columnDef.cell,I.getContext())},I.id))},A.id))})]})}),c&&sr!==0&&l.jsx(l.Fragment,{children:l.jsx(kr,{children:l.jsxs(Lr,{children:[l.jsx(Rr,{onClick:()=>er(A=>Math.max(A-1,1)),"aria-disabled":Ie===1,className:"cursor-pointer aria-disabled:pointer-events-none"}),Array.from({length:Math.ceil(sr/20)},(A,I)=>{const L=I+1,W=Math.ceil(sr/20);return W>7&&!(L===1||L===W||L>=Ie-1&&L<=Ie+1)?L===Ie-2&&Ie>4||L===Ie+2&&Ie<W-3?l.jsx(Br,{className:"pointer-events-none",children:"..."},I):null:l.jsx(et,{className:"cursor-pointer",children:l.jsx(vn,{isActive:Ie===L,onClick:()=>er(L),className:`${Ie===L?"bg-blue-500 text-white":"bg-white text-black"} hover:bg-blue-100`,children:L})},I)}),l.jsx(et,{children:l.jsx(Vr,{onClick:()=>er(A=>Math.min(A+1,Math.ceil(sr/20))),"aria-disabled":Ie===Math.ceil(sr/20),className:"cursor-pointer aria-disabled:pointer-events-none"})})]})})}),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:[g.size," ",(g.size===1,"tập tin")," đã chọn"]}),l.jsx(ie,{variant:"default",onClick:()=>o(aC()),disabled:g.size===0,className:"s3-explr-ok-btn",children:"OK"})]})]})});var Jn=e=>e.type==="checkbox",Zt=e=>e instanceof Date,Fe=e=>e==null;const wd=e=>typeof e=="object";var he=e=>!Fe(e)&&!Array.isArray(e)&&wd(e)&&!Zt(e),Ax=e=>he(e)&&e.target?Jn(e.target)?e.target.checked:e.target.value:e,_x=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Fx=(e,t)=>e.has(_x(t)),Ox=e=>{const t=e.constructor&&e.constructor.prototype;return he(t)&&t.hasOwnProperty("isPrototypeOf")},Ti=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ke(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(!(Ti&&(e instanceof Blob||r))&&(n||he(e)))if(t=n?[]:{},!n&&!Ox(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=Ke(e[o]));else return e;return t}var vo=e=>Array.isArray(e)?e.filter(Boolean):[],pe=e=>e===void 0,G=(e,t,n)=>{if(!t||!he(e))return n;const r=vo(t.split(/[,[\].]+?/)).reduce((o,s)=>Fe(o)?o:o[s],e);return pe(r)||r===e?pe(e[t])?n:e[t]:r},mt=e=>typeof e=="boolean",Pi=e=>/^\w*$/.test(e),bd=e=>vo(e.replace(/["|']|\]/g,"").split(/\.|\[/)),fe=(e,t,n)=>{let r=-1;const o=Pi(t)?[t]:bd(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 xd={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ot={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"};T.createContext(null);var Dx=(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]!==ot.all&&(t._proxyFormState[i]=!r||ot.all),e[i]}});return o},Le=e=>he(e)&&!Object.keys(e).length,Mx=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return Le(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===ot.all)},yo=e=>Array.isArray(e)?e:[e];function Ix(e){const t=T.useRef(e);t.current=e,T.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}var vt=e=>typeof e=="string",$x=(e,t,n,r,o)=>vt(e)?(r&&t.watch.add(e),G(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),G(n,s))):(r&&(t.watchAll=!0),n),kx=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},Cd=e=>({isOnSubmit:!e||e===ot.onSubmit,isOnBlur:e===ot.onBlur,isOnChange:e===ot.onChange,isOnAll:e===ot.all,isOnTouch:e===ot.onTouched}),Sd=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Yn=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const s=G(e,o);if(s){const{_f:i,...a}=s;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],o)&&!r)return!0;if(i.ref&&t(i.ref,i.name)&&!r)return!0;if(Yn(a,t))break}else if(he(a)&&Yn(a,t))break}}};var Lx=(e,t,n)=>{const r=yo(G(e,n));return fe(r,"root",t[n]),fe(e,n,r),e},Ai=e=>e.type==="file",yt=e=>typeof e=="function",wo=e=>{if(!Ti)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},bo=e=>vt(e),_i=e=>e.type==="radio",xo=e=>e instanceof RegExp;const Ed={value:!1,isValid:!1},Nd={value:!0,isValid:!0};var Td=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&&!pe(e[0].attributes.value)?pe(e[0].value)||e[0].value===""?Nd:{value:e[0].value,isValid:!0}:Nd:Ed}return Ed};const Pd={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,Pd):Pd;function _d(e,t,n="validate"){if(bo(e)||Array.isArray(e)&&e.every(bo)||mt(e)&&!e)return{type:n,message:bo(e)?e:"",ref:t}}var An=e=>he(e)&&!xo(e)?e:{value:e,message:""},Fd=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,b=G(t,v);if(!y||w)return{};const S=i?i[0]:s,E=k=>{r&&S.reportValidity&&(S.setCustomValidity(mt(k)?"":k||""),S.reportValidity())},x={},_=_i(s),O=Jn(s),D=_||O,$=(h||Ai(s))&&pe(s.value)&&pe(b)||wo(s)&&s.value===""||b===""||Array.isArray(b)&&!b.length,M=kx.bind(null,v,n,x),K=(k,U,R,J=Pt.maxLength,q=Pt.minLength)=>{const te=k?U:R;x[v]={type:k?J:q,message:te,ref:s,...M(k?J:q,te)}};if(o?!Array.isArray(b)||!b.length:a&&(!D&&($||Fe(b))||mt(b)&&!b||O&&!Td(i).isValid||_&&!Ad(i).isValid)){const{value:k,message:U}=bo(a)?{value:!!a,message:a}:An(a);if(k&&(x[v]={type:Pt.required,message:U,ref:S,...M(Pt.required,U)},!n))return E(U),x}if(!$&&(!Fe(f)||!Fe(g))){let k,U;const R=An(g),J=An(f);if(!Fe(b)&&!isNaN(b)){const q=s.valueAsNumber||b&&+b;Fe(R.value)||(k=q>R.value),Fe(J.value)||(U=q<J.value)}else{const q=s.valueAsDate||new Date(b),te=le=>new Date(new Date().toDateString()+" "+le),H=s.type=="time",j=s.type=="week";vt(R.value)&&b&&(k=H?te(b)>te(R.value):j?b>R.value:q>new Date(R.value)),vt(J.value)&&b&&(U=H?te(b)<te(J.value):j?b<J.value:q<new Date(J.value))}if((k||U)&&(K(!!k,R.message,J.message,Pt.max,Pt.min),!n))return E(x[v].message),x}if((u||c)&&!$&&(vt(b)||o&&Array.isArray(b))){const k=An(u),U=An(c),R=!Fe(k.value)&&b.length>+k.value,J=!Fe(U.value)&&b.length<+U.value;if((R||J)&&(K(R,k.message,U.message),!n))return E(x[v].message),x}if(m&&!$&&vt(b)){const{value:k,message:U}=An(m);if(xo(k)&&!b.match(k)&&(x[v]={type:Pt.pattern,message:U,ref:s,...M(Pt.pattern,U)},!n))return E(U),x}if(p){if(yt(p)){const k=await p(b,t),U=_d(k,S);if(U&&(x[v]={...U,...M(Pt.validate,U.message)},!n))return E(U.message),x}else if(he(p)){let k={};for(const U in p){if(!Le(k)&&!n)break;const R=_d(await p[U](b,t),S,U);R&&(k={...R,...M(U,R.message)},E(R.message),n&&(x[v]=k))}if(!Le(k)&&(x[v]={ref:S,...k},!n))return x}}return E(!0),x};function Rx(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=pe(e)?r++:e[t[r++]];return e}function Vx(e){for(const t in e)if(e.hasOwnProperty(t)&&!pe(e[t]))return!1;return!0}function be(e,t){const n=Array.isArray(t)?t:Pi(t)?[t]:bd(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)&&Le(r)||Array.isArray(r)&&Vx(r))&&be(e,n.slice(0,-1)),e}var Fi=()=>{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=[]}}},Oi=e=>Fe(e)||!wd(e);function Vt(e,t){if(Oi(e)||Oi(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)?!Vt(s,i):s!==i)return!1}}return!0}var Od=e=>e.type==="select-multiple",Bx=e=>_i(e)||Jn(e),Di=e=>wo(e)&&e.isConnected,Dd=e=>{for(const t in e)if(yt(e[t]))return!0;return!1};function Co(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])?[]:{},Co(e[r],t[r])):Fe(e[r])||(t[r]=!0);return t}function Md(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])?pe(t)||Oi(n[o])?n[o]=Array.isArray(e[o])?Co(e[o],[]):{...Co(e[o])}:Md(e[o],Fe(t)?{}:t[o],n[o]):n[o]=!Vt(e[o],t[o]);return n}var Zn=(e,t)=>Md(e,t,Co(t)),Id=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>pe(e)?e:t?e===""?NaN:e&&+e:n&&vt(e)?new Date(e):r?r(e):e;function Mi(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return Ai(t)?t.files:_i(t)?Ad(e.refs).value:Od(t)?[...t.selectedOptions].map(({value:n})=>n):Jn(t)?Td(e.refs).value:Id(pe(t.value)?e.ref.value:t.value,e)}var Hx=(e,t,n,r)=>{const o={};for(const s of e){const i=G(t,s);i&&fe(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Qn=e=>pe(e)?e:xo(e)?e.source:he(e)?xo(e.value)?e.value.source:e.value:e;const $d="AsyncFunction";var zx=e=>!!e&&!!e.validate&&!!(yt(e.validate)&&e.validate.constructor.name===$d||he(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===$d)),Ux=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function kd(e,t,n){const r=G(e,n);if(r||Pi(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),i=G(t,s),a=G(e,s);if(i&&!Array.isArray(i)&&n!==s)return{name:n};if(a&&a.type)return{name:s,error:a};o.pop()}return{name:n}}var jx=(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,Wx=(e,t)=>!vo(G(e,t)).length&&be(e,t);const Gx={mode:ot.onSubmit,reValidateMode:ot.onChange,shouldFocusError:!0};function qx(e={}){let t={...Gx,...e},n={submitCount:0,isDirty:!1,isLoading:yt(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)?Ke(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:Ke(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:Fi(),array:Fi(),state:Fi()},m=Cd(t.mode),p=Cd(t.reValidateMode),v=t.criteriaMode===ot.all,h=C=>N=>{clearTimeout(c),c=setTimeout(C,N)},y=async C=>{if(!t.disabled&&(f.isValid||C)){const N=t.resolver?Le((await D()).errors):await M(r,!0);N!==n.isValid&&g.state.next({isValid:N})}},w=(C,N)=>{!t.disabled&&(f.isValidating||f.validatingFields)&&((C||Array.from(a.mount)).forEach(F=>{F&&(N?fe(n.validatingFields,F,N):be(n.validatingFields,F))}),g.state.next({validatingFields:n.validatingFields,isValidating:!Le(n.validatingFields)}))},b=(C,N=[],F,z,B=!0,V=!0)=>{if(z&&F&&!t.disabled){if(i.action=!0,V&&Array.isArray(G(r,C))){const Y=F(G(r,C),z.argA,z.argB);B&&fe(r,C,Y)}if(V&&Array.isArray(G(n.errors,C))){const Y=F(G(n.errors,C),z.argA,z.argB);B&&fe(n.errors,C,Y),Wx(n.errors,C)}if(f.touchedFields&&V&&Array.isArray(G(n.touchedFields,C))){const Y=F(G(n.touchedFields,C),z.argA,z.argB);B&&fe(n.touchedFields,C,Y)}f.dirtyFields&&(n.dirtyFields=Zn(o,s)),g.state.next({name:C,isDirty:k(C,N),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else fe(s,C,N)},S=(C,N)=>{fe(n.errors,C,N),g.state.next({errors:n.errors})},E=C=>{n.errors=C,g.state.next({errors:n.errors,isValid:!1})},x=(C,N,F,z)=>{const B=G(r,C);if(B){const V=G(s,C,pe(F)?G(o,C):F);pe(V)||z&&z.defaultChecked||N?fe(s,C,N?V:Mi(B._f)):J(C,V),i.mount&&y()}},_=(C,N,F,z,B)=>{let V=!1,Y=!1;const ne={name:C};if(!t.disabled){const me=!!(G(r,C)&&G(r,C)._f&&G(r,C)._f.disabled);if(!F||z){f.isDirty&&(Y=n.isDirty,n.isDirty=ne.isDirty=k(),V=Y!==ne.isDirty);const Ce=me||Vt(G(o,C),N);Y=!!(!me&&G(n.dirtyFields,C)),Ce||me?be(n.dirtyFields,C):fe(n.dirtyFields,C,!0),ne.dirtyFields=n.dirtyFields,V=V||f.dirtyFields&&Y!==!Ce}if(F){const Ce=G(n.touchedFields,C);Ce||(fe(n.touchedFields,C,F),ne.touchedFields=n.touchedFields,V=V||f.touchedFields&&Ce!==F)}V&&B&&g.state.next(ne)}return V?ne:{}},O=(C,N,F,z)=>{const B=G(n.errors,C),V=f.isValid&&mt(N)&&n.isValid!==N;if(t.delayError&&F?(u=h(()=>S(C,F)),u(t.delayError)):(clearTimeout(c),u=null,F?fe(n.errors,C,F):be(n.errors,C)),(F?!Vt(B,F):B)||!Le(z)||V){const Y={...z,...V&&mt(N)?{isValid:N}:{},errors:n.errors,name:C};n={...n,...Y},g.state.next(Y)}},D=async C=>{w(C,!0);const N=await t.resolver(s,t.context,Hx(C||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(C),N},$=async C=>{const{errors:N}=await D(C);if(C)for(const F of C){const z=G(N,F);z?fe(n.errors,F,z):be(n.errors,F)}else n.errors=N;return N},M=async(C,N,F={valid:!0})=>{for(const z in C){const B=C[z];if(B){const{_f:V,...Y}=B;if(V){const ne=a.array.has(V.name),me=B._f&&zx(B._f);me&&f.validatingFields&&w([z],!0);const Ce=await Fd(B,s,v,t.shouldUseNativeValidation&&!N,ne);if(me&&f.validatingFields&&w([z]),Ce[V.name]&&(F.valid=!1,N))break;!N&&(G(Ce,V.name)?ne?Lx(n.errors,Ce,V.name):fe(n.errors,V.name,Ce[V.name]):be(n.errors,V.name))}!Le(Y)&&await M(Y,N,F)}}return F.valid},K=()=>{for(const C of a.unMount){const N=G(r,C);N&&(N._f.refs?N._f.refs.every(F=>!Di(F)):!Di(N._f.ref))&&Ee(C)}a.unMount=new Set},k=(C,N)=>!t.disabled&&(C&&N&&fe(s,C,N),!Vt(ce(),o)),U=(C,N,F)=>$x(C,a,{...i.mount?s:pe(N)?o:vt(C)?{[C]:N}:N},F,N),R=C=>vo(G(i.mount?s:o,C,t.shouldUnregister?G(o,C,[]):[])),J=(C,N,F={})=>{const z=G(r,C);let B=N;if(z){const V=z._f;V&&(!V.disabled&&fe(s,C,Id(N,V)),B=wo(V.ref)&&Fe(N)?"":N,Od(V.ref)?[...V.ref.options].forEach(Y=>Y.selected=B.includes(Y.value)):V.refs?Jn(V.ref)?V.refs.length>1?V.refs.forEach(Y=>(!Y.defaultChecked||!Y.disabled)&&(Y.checked=Array.isArray(B)?!!B.find(ne=>ne===Y.value):B===Y.value)):V.refs[0]&&(V.refs[0].checked=!!B):V.refs.forEach(Y=>Y.checked=Y.value===B):Ai(V.ref)?V.ref.value="":(V.ref.value=B,V.ref.type||g.values.next({name:C,values:{...s}})))}(F.shouldDirty||F.shouldTouch)&&_(C,B,F.shouldTouch,F.shouldDirty,!0),F.shouldValidate&&le(C)},q=(C,N,F)=>{for(const z in N){const B=N[z],V=`${C}.${z}`,Y=G(r,V);(a.array.has(C)||he(B)||Y&&!Y._f)&&!Zt(B)?q(V,B,F):J(V,B,F)}},te=(C,N,F={})=>{const z=G(r,C),B=a.array.has(C),V=Ke(N);fe(s,C,V),B?(g.array.next({name:C,values:{...s}}),(f.isDirty||f.dirtyFields)&&F.shouldDirty&&g.state.next({name:C,dirtyFields:Zn(o,s),isDirty:k(C,V)})):z&&!z._f&&!Fe(V)?q(C,V,F):J(C,V,F),Sd(C,a)&&g.state.next({...n}),g.values.next({name:i.mount?C:void 0,values:{...s}})},H=async C=>{i.mount=!0;const N=C.target;let F=N.name,z=!0;const B=G(r,F),V=()=>N.type?Mi(B._f):Ax(C),Y=ne=>{z=Number.isNaN(ne)||Zt(ne)&&isNaN(ne.getTime())||Vt(ne,G(s,F,ne))};if(B){let ne,me;const Ce=V(),Me=C.type===xd.BLUR||C.type===xd.FOCUS_OUT,So=!Ux(B._f)&&!t.resolver&&!G(n.errors,F)&&!B._f.deps||jx(Me,G(n.touchedFields,F),n.isSubmitted,p,m),Fn=Sd(F,a,Me);fe(s,F,Ce),Me?(B._f.onBlur&&B._f.onBlur(C),u&&u(0)):B._f.onChange&&B._f.onChange(C);const Ie=_(F,Ce,Me,!1),er=!Le(Ie)||Fn;if(!Me&&g.values.next({name:F,type:C.type,values:{...s}}),So)return f.isValid&&(t.mode==="onBlur"?Me&&y():y()),er&&g.state.next({name:F,...Fn?{}:Ie});if(!Me&&Fn&&g.state.next({...n}),t.resolver){const{errors:tr}=await D([F]);if(Y(Ce),z){const Eo=kd(n.errors,r,F),ue=kd(tr,r,Eo.name||F);ne=ue.error,F=ue.name,me=Le(tr)}}else w([F],!0),ne=(await Fd(B,s,v,t.shouldUseNativeValidation))[F],w([F]),Y(Ce),z&&(ne?me=!1:f.isValid&&(me=await M(r,!0)));z&&(B._f.deps&&le(B._f.deps),O(F,me,ne,Ie))}},j=(C,N)=>{if(G(n.errors,N)&&C.focus)return C.focus(),1},le=async(C,N={})=>{let F,z;const B=yo(C);if(t.resolver){const V=await $(pe(C)?C:B);F=Le(V),z=C?!B.some(Y=>G(V,Y)):F}else C?(z=(await Promise.all(B.map(async V=>{const Y=G(r,V);return await M(Y&&Y._f?{[V]:Y}:Y)}))).every(Boolean),!(!z&&!n.isValid)&&y()):z=F=await M(r);return g.state.next({...!vt(C)||f.isValid&&F!==n.isValid?{}:{name:C},...t.resolver||!C?{isValid:F}:{},errors:n.errors}),N.shouldFocus&&!z&&Yn(r,j,C?B:a.mount),z},ce=C=>{const N={...i.mount?s:o};return pe(C)?N:vt(C)?G(N,C):C.map(F=>G(N,F))},xe=(C,N)=>({invalid:!!G((N||n).errors,C),isDirty:!!G((N||n).dirtyFields,C),error:G((N||n).errors,C),isValidating:!!G(n.validatingFields,C),isTouched:!!G((N||n).touchedFields,C)}),Ne=C=>{C&&yo(C).forEach(N=>be(n.errors,N)),g.state.next({errors:C?n.errors:{}})},Oe=(C,N,F)=>{const z=(G(r,C,{_f:{}})._f||{}).ref,B=G(n.errors,C)||{},{ref:V,message:Y,type:ne,...me}=B;fe(n.errors,C,{...me,...N,ref:z}),g.state.next({name:C,errors:n.errors,isValid:!1}),F&&F.shouldFocus&&z&&z.focus&&z.focus()},Bt=(C,N)=>yt(C)?g.values.subscribe({next:F=>C(U(void 0,N),F)}):U(C,N,!0),Ee=(C,N={})=>{for(const F of C?yo(C):a.mount)a.mount.delete(F),a.array.delete(F),N.keepValue||(be(r,F),be(s,F)),!N.keepError&&be(n.errors,F),!N.keepDirty&&be(n.dirtyFields,F),!N.keepTouched&&be(n.touchedFields,F),!N.keepIsValidating&&be(n.validatingFields,F),!t.shouldUnregister&&!N.keepDefaultValue&&be(o,F);g.values.next({values:{...s}}),g.state.next({...n,...N.keepDirty?{isDirty:k()}:{}}),!N.keepIsValid&&y()},Te=({disabled:C,name:N,field:F,fields:z,value:B})=>{if(mt(C)&&i.mount||C){const V=C?void 0:pe(B)?Mi(F?F._f:G(z,N)._f):B;(C||!C&&!pe(V))&&fe(s,N,V),_(N,V,!1,!1,!0)}},st=(C,N={})=>{let F=G(r,C);const z=mt(N.disabled)||mt(t.disabled);return fe(r,C,{...F||{},_f:{...F&&F._f?F._f:{ref:{name:C}},name:C,mount:!0,...N}}),a.mount.add(C),F?Te({field:F,disabled:mt(N.disabled)?N.disabled:t.disabled,name:C,value:N.value}):x(C,!0,N.value),{...z?{disabled:N.disabled||t.disabled}:{},...t.progressive?{required:!!N.required,min:Qn(N.min),max:Qn(N.max),minLength:Qn(N.minLength),maxLength:Qn(N.maxLength),pattern:Qn(N.pattern)}:{},name:C,onChange:H,onBlur:H,ref:B=>{if(B){st(C,N),F=G(r,C);const V=pe(B.value)&&B.querySelectorAll&&B.querySelectorAll("input,select,textarea")[0]||B,Y=Bx(V),ne=F._f.refs||[];if(Y?ne.find(me=>me===V):V===F._f.ref)return;fe(r,C,{_f:{...F._f,...Y?{refs:[...ne.filter(Di),V,...Array.isArray(G(o,C))?[{}]:[]],ref:{type:V.type,name:C}}:{ref:V}}}),x(C,!1,void 0,V)}else F=G(r,C,{}),F._f&&(F._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(Fx(a.array,C)&&i.action)&&a.unMount.add(C)}}},De=()=>t.shouldFocusError&&Yn(r,j,a.mount),Qt=C=>{mt(C)&&(g.state.next({disabled:C}),Yn(r,(N,F)=>{const z=G(r,F);z&&(N.disabled=z._f.disabled||C,Array.isArray(z._f.refs)&&z._f.refs.forEach(B=>{B.disabled=z._f.disabled||C}))},0,!1))},Ht=(C,N)=>async F=>{let z;if(F&&(F.preventDefault&&F.preventDefault(),F.persist&&F.persist()),t.disabled){N&&await N({...n.errors},F);return}let B=Ke(s);if(g.state.next({isSubmitting:!0}),t.resolver){const{errors:V,values:Y}=await D();n.errors=V,B=Y}else await M(r);if(be(n.errors,"root"),Le(n.errors)){g.state.next({errors:{}});try{await C(B,F)}catch(V){z=V}}else N&&await N({...n.errors},F),De(),setTimeout(De);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Le(n.errors)&&!z,submitCount:n.submitCount+1,errors:n.errors}),z)throw z},it=(C,N={})=>{G(r,C)&&(pe(N.defaultValue)?te(C,Ke(G(o,C))):(te(C,N.defaultValue),fe(o,C,Ke(N.defaultValue))),N.keepTouched||be(n.touchedFields,C),N.keepDirty||(be(n.dirtyFields,C),n.isDirty=N.defaultValue?k(C,Ke(G(o,C))):k()),N.keepError||(be(n.errors,C),f.isValid&&y()),g.state.next({...n}))},je=(C,N={})=>{const F=C?Ke(C):o,z=Ke(F),B=Le(C),V=B?o:z;if(N.keepDefaultValues||(o=F),!N.keepValues){if(N.keepDirtyValues){const Y=new Set([...a.mount,...Object.keys(Zn(o,s))]);for(const ne of Array.from(Y))G(n.dirtyFields,ne)?fe(V,ne,G(s,ne)):te(ne,G(V,ne))}else{if(Ti&&pe(C))for(const Y of a.mount){const ne=G(r,Y);if(ne&&ne._f){const me=Array.isArray(ne._f.refs)?ne._f.refs[0]:ne._f.ref;if(wo(me)){const Ce=me.closest("form");if(Ce){Ce.reset();break}}}}r={}}s=t.shouldUnregister?N.keepDefaultValues?Ke(o):{}:Ke(V),g.array.next({values:{...V}}),g.values.next({values:{...V}})}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:B?!1:N.keepDirty?n.isDirty:!!(N.keepDefaultValues&&!Vt(C,o)),isSubmitted:N.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:B?{}:N.keepDirtyValues?N.keepDefaultValues&&s?Zn(o,s):n.dirtyFields:N.keepDefaultValues&&C?Zn(o,C):N.keepDirty?n.dirtyFields:{},touchedFields:N.keepTouched?n.touchedFields:{},errors:N.keepErrors?n.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},zt=(C,N)=>je(yt(C)?C(s):C,N);return{control:{register:st,unregister:Ee,getFieldState:xe,handleSubmit:Ht,setError:Oe,_executeSchema:D,_getWatch:U,_getDirty:k,_updateValid:y,_removeUnmounted:K,_updateFieldArray:b,_updateDisabledField:Te,_getFieldArray:R,_reset:je,_resetDefaultValues:()=>yt(t.defaultValues)&&t.defaultValues().then(C=>{zt(C,t.resetOptions),g.state.next({isLoading:!1})}),_updateFormState:C=>{n={...n,...C}},_disableForm:Qt,_subjects:g,_proxyFormState:f,_setErrors:E,get _fields(){return r},get _formValues(){return s},get _state(){return i},set _state(C){i=C},get _defaultValues(){return o},get _names(){return a},set _names(C){a=C},get _formState(){return n},set _formState(C){n=C},get _options(){return t},set _options(C){t={...t,...C}}},trigger:le,register:st,handleSubmit:Ht,watch:Bt,setValue:te,getValues:ce,reset:zt,resetField:it,clearErrors:Ne,unregister:Ee,setError:Oe,setFocus:(C,N={})=>{const F=G(r,C),z=F&&F._f;if(z){const B=z.refs?z.refs[0]:z.ref;B.focus&&(B.focus(),N.shouldSelect&&yt(B.select)&&B.select())}},getFieldState:xe}}function Kx(e={}){const t=T.useRef(),n=T.useRef(),[r,o]=T.useState({isDirty:!1,isValidating:!1,isLoading:yt(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:yt(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...qx(e),formState:r});const s=t.current.control;return s._options=e,Ix({subject:s._subjects.state,next:i=>{Mx(i,s._proxyFormState,s._updateFormState)&&o({...s._formState})}}),T.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),T.useEffect(()=>{if(s._proxyFormState.isDirty){const i=s._getDirty();i!==r.isDirty&&s._subjects.state.next({isDirty:i})}},[s,r.isDirty]),T.useEffect(()=>{e.values&&!Vt(e.values,n.current)?(s._reset(e.values,s._options.resetOptions),n.current=e.values,o(i=>({...i}))):s._resetDefaultValues()},[e.values,s]),T.useEffect(()=>{e.errors&&s._setErrors(e.errors)},[e.errors,s]),T.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()}),T.useEffect(()=>{e.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[e.shouldUnregister,s]),T.useMemo(()=>({...t.current,formState:Dx(r,s)}),[r,s])}const Ld=({className:e,children:t,content:n,side:r})=>{const[o,s]=T.useState(!1);return l.jsx(En,{delayDuration:0,children:l.jsxs(Nn,{open:o,children:[l.jsx(Tn,{asChild:!0,children:l.jsx("button",{type:"button",className:ee("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(Yt,{side:r,className:n?"":"hidden",children:l.jsx("span",{className:"inline-block",children:n})})]})})},Xx=(e,t)=>{const[n,r]=T.useState(e);return T.useEffect(()=>{const o=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(o)}},[e,t]),n},Jx=({apiBaseUrl:e="http://localhost:3002"})=>{var _,O;const[t,n]=T.useState([]),[r,o]=T.useState(!1),[s,i]=T.useState([]),[a,u]=T.useState(1),[c,f]=T.useState(1),[g,m]=T.useState(null),[p,v]=T.useState(""),h=Xx(p,500),y=D=>{const $=D.match(/\d{6}/);if(!$)return{month:"",year:""};const M=$[0],K=M.substring(0,2),k=M.substring(2);return{month:K,year:k}},w=D=>D.map(M=>{let K=(M==null?void 0:M.month)||"",k=(M==null?void 0:M.year)||"";if((!K||!k)&&(M!=null&&M.file_name)){const U=y(M.file_name);K=K||U.month,k=k||U.year}return{id:M==null?void 0:M.id,prefix:(M==null?void 0:M.prefix)||"",model:(M==null?void 0:M.model)||"",fileName:(M==null?void 0:M.file_name)||"",code:(M==null?void 0:M.stock_id)||"",month:K,year:k,content:(M==null?void 0:M.text_summary)||"",status:(M==null?void 0:M.status)||"",note:(M==null?void 0:M.note)||"",lastUpdate:M==null?void 0:M.updated_at,stock_id:M==null?void 0:M.stock_id}}),b=D=>{if(!(D!=null&&D.data))return[];const $=w(D==null?void 0:D.data);n($),f(D.pagination.totalPages)},S=async(D=1,$=15)=>{m(D),o(!0);try{const M=await oe.get(`${e}/api/latest-summaries`,{params:{page:D,limit:$,search:p}});(M==null?void 0:M.status)===200?b(M.data):console.error(M)}catch(M){console.error("Error fetching data:",M)}finally{m(null),o(!1)}};T.useEffect(()=>{h&&u(1),S(a)},[a,h]);const E=T.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 M=$.original.month,K=$.original.year;return l.jsx("span",{className:"flex flex-col",children:`${M.toString().padStart(2,"0")}/${K}`})}},{id:"content",header:"Nội dung",accessorKey:"content",cell:({row:$})=>{const M=$.getValue("content");return l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]",children:M})}},{id:"status",header:"Trạng thái",accessorKey:"status",cell:({row:$})=>{const K=$.original.status!=="unpublish";return l.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0 text-[10px] font-bold ${K?"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:K?"PUBLISHED":"UNPUBLISHED"})}},{id:"note",header:"Ghi chú",accessorKey:"note",cell:({row:$})=>l.jsx(Ld,{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 M=new Date($.original.lastUpdate),K=M.getDate(),k=M.getMonth()+1,U=`ngày ${K} tháng ${k}`;return l.jsx("span",{className:"flex flex-col",children:U})}},{accessorKey:"actions",header:()=>l.jsx("div",{className:"font-medium text-right",children:"Hành động"}),cell:({row:$})=>{const[M,K]=T.useState(!1),[k,U]=T.useState(!1),[R,J]=T.useState(!1),{handleSubmit:q,register:te,reset:H}=Kx(),j=$.original.id,le=$.getValue("status"),ce=$.getValue("content"),[xe,Ne]=T.useState(!1),Oe=async()=>{try{Ne(!0);const Ee=le==="unpublish"?"published":"unpublish",Te=await oe.patch(`${e}/api/toggle-publish/${j}`,{id:j,typeAction:"update",status:le,idInput:j,stock_id:$.original.stock_id,prefix:$.original.prefix,model:$.original.model,summary_result:$.original.content,note:$.original.note});Te.status===200?n(st=>st.map(De=>De.id===j?{...De,status:Ee}:De)):console.error("Failed to toggle publish status:",Te)}catch(Ee){console.error("Error toggling publish status:",Ee)}finally{Ne(!1)}},Bt=async Ee=>{K(!0);try{const Te=await oe.patch(`${e}/api/update-summary`,{note:Ee.note,text_summary:Ee.content,id:j});Te.status===200?(await S(a),U(!1)):console.error("Failed to update summary:",Te)}catch(Te){console.error("Error updating summary:",Te)}return K(!1)};return l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(ie,{variant:"outline",size:"sm",onClick:()=>J(!0),className:"px-2 py-0.5 h-7",children:l.jsx(Sg,{className:"h-4 w-4"})}),l.jsx(St,{open:R,onOpenChange:J,children:l.jsxs(ct,{className:"max-w-3xl max-h-[80vh]",children:[l.jsx(ut,{children:l.jsx(dt,{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:ce})})]})}),l.jsxs(St,{open:k,onOpenChange:Ee=>{U(Ee),Ee?H({content:$.original.content,note:$.original.note}):H()},children:[l.jsx($r,{asChild:!0,children:l.jsx(ie,{variant:"outline",size:"sm",onClick:()=>U(!0),className:"px-2 py-0.5 h-7",children:"Sửa"})}),l.jsx(ct,{className:"rounded-lg sm:px-3 h-[calc(100dvh-200px)] min-w-[calc(100dvw-112px)]",children:l.jsxs(ut,{className:"flex flex-col gap-3",children:[l.jsx(dt,{className:"max-sm:hidden text-center",children:"Sửa summary"}),l.jsxs("form",{className:"flex flex-col gap-3 h-full justify-between",onSubmit:q(Bt),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(Bn,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:$.original.answer||"",rows:10,...te("content")})]}),l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{children:"Ghi chú:"}),l.jsx(Bn,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:$.original.note||"",rows:1,...te("note")})]})]}),l.jsx("div",{className:"flex justify-end",children:l.jsx(ie,{disabled:M,type:"submit",variant:"default",children:M?l.jsx(ve,{className:"h-4 w-4 animate-spin"}):"Ok"})})]})]})})]}),l.jsx(ie,{variant:"outline",size:"sm",onClick:Oe,disabled:xe,className:"w-[70px] px-2 py-0.5 h-7",children:xe?l.jsx(ve,{className:"h-4 w-4 animate-spin"}):le==="unpublish"?"Publish":"Unpublish"})]})}}],[]),x=Qi({data:t,columns:E,state:{columnFilters:s},enableRowSelection:!0,onColumnFiltersChange:i,getFilteredRowModel:zf(),getCoreRowModel:Zi()});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:D=>v(D.target.value),className:"pr-8"}),p&&l.jsx(ie,{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(ls,{className:"h-4 w-4"})})]})}),l.jsx("div",{className:"rounded-md border s3-explr-table-container",children:l.jsxs(Hr,{className:"s3-explr-table",children:[l.jsx(zr,{className:"s3-explr-table-header",children:x.getHeaderGroups().map(D=>l.jsx(tt,{className:"hover:bg-transparent s3-explr-header-row",children:D.headers.map($=>l.jsx(ft,{className:"s3-explr-header-cell",children:$.isPlaceholder?null:pr($.column.columnDef.header,$.getContext())},$.id))},D.id))}),l.jsx(Ur,{className:"s3-explr-table-body",children:r?l.jsx(tt,{children:l.jsx(ke,{colSpan:E.length,className:"h-24 text-center",children:"Đang tải dữ liệu..."})}):(_=x.getRowModel().rows)!=null&&_.length?(O=x.getRowModel().rows)==null?void 0:O.map(D=>l.jsx(tt,{className:"h-12 s3-explr-row",children:D.getVisibleCells().map($=>l.jsx(ke,{className:"align-middle s3-explr-cell",children:pr($.column.columnDef.cell,$.getContext())},$.id))},D.id)):l.jsx(tt,{children:l.jsx(ke,{colSpan:E.length,className:"h-24 text-center",children:"Không có kết quả."})})})]})}),l.jsx("div",{className:"mt-4",children:l.jsx(kr,{children:l.jsxs(Lr,{children:[l.jsx(et,{children:l.jsx(Rr,{onClick:()=>u(D=>Math.max(1,D-1)),className:a===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:c},(D,$)=>$+1).filter(D=>D===1||D===c||Math.abs(D-a)<=1).map((D,$,M)=>l.jsxs(l.Fragment,{children:[$>0&&M[$-1]!==D-1&&l.jsx(et,{children:l.jsx(Br,{})},D+"..."),l.jsx(et,{children:l.jsx(vn,{onClick:()=>u(D),isActive:a===D,className:`cursor-pointer ${r?"pointer-events-none":""}`,children:g===D?l.jsx(ve,{className:"h-4 w-4 animate-spin"}):D})},D)]})),l.jsx(et,{children:l.jsx(Vr,{onClick:()=>u(D=>Math.min(c,D+1)),className:a===c||g!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})})]})},Rd=10,Yx=T.memo(({apiBaseUrl:e="http://localhost:3002"})=>{const[t,n]=T.useState(1),[r,o]=T.useState([]),[s,i]=T.useState({total:0,page:1,limit:Rd,totalPages:1}),[a,u]=T.useState(!0),[c,f]=T.useState(null),[g,m]=T.useState(new Set),{toast:p}=eo(),[v,h]=T.useState(!1),y=async x=>{try{f(x);const _=await oe.get(`${e}/api/jobs`,{params:{page:x.toString(),limit:Rd.toString()}});o(_.data.data),i(_.data.pagination)}catch{p({variant:"destructive",title:"Error",description:"Failed to fetch jobs. Please try again."})}finally{f(null),u(!1)}};T.useEffect(()=>{y(t)},[t,e]);const w=async x=>{m(_=>new Set(_).add(x.toString()));try{await oe.post(`${e}/api/retry-job`,{jobId:x}),p({title:"Job Restarted",description:`Job ${x} has been successfully restarted.`}),y(t)}catch{p({variant:"destructive",title:"Retry Failed",description:`Failed to restart job ${x}. Please try again.`})}finally{m(_=>{const O=new Set(_);return O.delete(x.toString()),O})}},b=async()=>{h(!0),n(1),await y(1),h(!1)},S=x=>new Date(x).toLocaleString(),E=x=>{if(x=parseFloat(x),x<60)return`${x.toFixed(2)}s`;const _=Math.floor(x/60),O=(x%60).toFixed(0);return`${_}m ${O}s`};return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[l.jsx(wg,{className:"w-8 h-8 text-primary"}),l.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Job Management"}),l.jsx(ie,{variant:"outline",size:"icon",onClick:b,disabled:v||a,className:"ml-2",children:l.jsx(Tg,{className:`h-4 w-4 ${v?"animate-spin":""}`})})]}),l.jsx("div",{className:"rounded-md border",children:l.jsxs(Hr,{children:[l.jsx(zr,{children:l.jsxs(tt,{children:[l.jsx(ft,{children:"ID"}),l.jsx(ft,{children:"Tên Công Việc"}),l.jsx(ft,{children:"Thời Gian Bắt Đầu"}),l.jsx(ft,{children:"Thời Gian Cập Nhật"}),l.jsx(ft,{children:"Thời Gian Thực Thi"}),l.jsx(ft,{children:"Trạng Thái"}),l.jsx(ft,{children:"Thao Tác"})]})}),l.jsx(Ur,{children:a&&r.length===0?l.jsx(tt,{children:l.jsx(ke,{colSpan:7,className:"text-center py-4",children:l.jsx(ve,{className:"w-6 h-6 animate-spin mx-auto"})})}):r.map(x=>{var _,O;return l.jsxs(tt,{children:[l.jsx(ke,{className:"!w-[100px]",children:x.id}),l.jsx(ke,{className:"font-medium",children:(_=x.job_name)==null?void 0:_.replace("Upload file","Summary")}),l.jsx(ke,{className:"!w-[200px]",children:S(x.created_at)}),l.jsx(ke,{className:"!w-[200px]",children:S(x.updated_at)}),l.jsx(ke,{className:"!w-[150px]",children:E(x.execution_time_seconds)}),l.jsx(ke,{className:"!w-[200px]",children:l.jsx(Ld,{content:x.status==="fail"&&x.error?l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:x.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]
|
|
152
|
+
${x.status==="done"?"bg-green-100 text-green-800":x.status==="fail"?"bg-red-100 text-red-800":"bg-yellow-100 text-yellow-800"}`,children:x.status==="fail"?"FAILED":(O=x.status)==null?void 0:O.toUpperCase()})})}),l.jsx(ke,{className:"!w-[200px]",children:x.status==="fail"?l.jsx(ie,{variant:"outline",size:"sm",onClick:()=>w(x.id),disabled:g.has(x.id.toString()),className:"h-[32px]",children:g.has(x.id.toString())?l.jsxs(l.Fragment,{children:[l.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin"}),"Đang thử lại..."]}):"Thử Lại"}):l.jsx("div",{className:"h-[32px]"})})]},x.id)})})]})}),l.jsx("div",{className:"mt-4",children:l.jsx(kr,{children:l.jsxs(Lr,{children:[l.jsx(et,{children:l.jsx(Rr,{onClick:()=>n(x=>Math.max(1,x-1)),className:t===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:s.totalPages},(x,_)=>_+1).filter(x=>x===1||x===s.totalPages||Math.abs(x-t)<=1).map((x,_,O)=>l.jsxs(l.Fragment,{children:[_>0&&O[_-1]!==x-1&&l.jsx(et,{children:l.jsx(Br,{})},x+"..."),l.jsx(et,{children:l.jsx(vn,{onClick:()=>n(x),isActive:t===x,className:`cursor-pointer ${c!==null?"pointer-events-none":""}`,children:c===x?l.jsx(ve,{className:"h-4 w-4 animate-spin"}):x})},x)]})),l.jsx(et,{children:l.jsx(Vr,{onClick:()=>n(x=>Math.min(s.totalPages,x+1)),className:t===s.totalPages||c!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})}),l.jsx(uu,{})]})});Je.Job=Yx,Je.S3Explorer=Px,Je.Summary=Jx,Object.defineProperty(Je,Symbol.toStringTag,{value:"Module"})});
|
|
153
153
|
//# sourceMappingURL=s3-explorer.umd.cjs.map
|