dccxx-s3-explorer 1.0.31 → 1.0.32
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 +4191 -4087
- package/dist/s3-explorer.js.map +1 -1
- package/dist/s3-explorer.umd.cjs +41 -36
- package/dist/s3-explorer.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/s3-explorer.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Ge,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):(Ge=typeof globalThis<"u"?globalThis:Ge||self,l(Ge.S3Explorer={},Ge.jsxRuntime,Ge.React,Ge.ReactDOM))})(this,function(Ge,l,A,
|
|
1
|
+
(function(Ge,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):(Ge=typeof globalThis<"u"?globalThis:Ge||self,l(Ge.S3Explorer={},Ge.jsxRuntime,Ge.React,Ge.ReactDOM))})(this,function(Ge,l,A,po){"use strict";function Pi(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=Pi(A),Qn=Pi(po);function Md({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 Ai=d.forwardRef(Md);function Id({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 kd=d.forwardRef(Id);function $d({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"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 Ld=d.forwardRef($d);function Rd({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 Vd=d.forwardRef(Rd);function Bd({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 go=d.forwardRef(Bd);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:"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 Hd=d.forwardRef(zd);function Ud({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 jd=d.forwardRef(Ud);function Wd({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 Gd=d.forwardRef(Wd);function qd({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 _i=d.forwardRef(qd);/**
|
|
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 Nt(e,t){return typeof e=="function"?e(t):e}function $e(e,t){return n=>{t.setState(r=>({...r,[e]:Nt(n,r[e])}))}}function er(e){return e instanceof Function}function Kd(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Xd(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 Y(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,h=g/16,p=(v,m)=>{for(v=String(v);v.length<m;)v=" "+v;return v};console.info(`%c⏱ ${p(g,5)} /${p(f,5)} ms`,`
|
|
11
11
|
font-size: .6rem;
|
|
12
12
|
font-weight: bold;
|
|
13
|
-
color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function 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 Kd(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 Xd(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 g=m;for(const h of u.split(".")){var v;g=(v=g)==null?void 0:v[h],process.env.NODE_ENV!=="production"&&g===void 0&&console.warn(`"${h}" in deeply nested key "${u}" returned undefined.`)}return g}: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 p={id:`${String(c)}`,accessorFn:f,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:Z(()=>[!0],()=>{var m;return[p,...(m=p.columns)==null?void 0:m.flatMap(g=>g.getFlatColumns())]},Q(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:Z(()=>[e._getOrderColumnsFn()],m=>{var g;if((g=p.columns)!=null&&g.length){let v=p.columns.flatMap(h=>h.getLeafColumns());return m(v)}return[p]},Q(e.options,"debugColumns","column.getLeafColumns"))};for(const m of e._features)m.createColumn==null||m.createColumn(p,e);return p}const Ne="debugHeaders";function Pi(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 Jd={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(p=>n.find(m=>m.id===p)).filter(Boolean))!=null?s:[],u=(i=o==null?void 0:o.map(p=>n.find(m=>m.id===p)).filter(Boolean))!=null?i:[],c=n.filter(p=>!(r!=null&&r.includes(p.id))&&!(o!=null&&o.includes(p.id)));return Qn(t,[...a,...c,...u],e)},Q(e.options,Ne,"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))),Qn(t,n,e,"center")),Q(e.options,Ne,"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 Qn(t,s,e,"left")},Q(e.options,Ne,"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 Qn(t,s,e,"right")},Q(e.options,Ne,"getRightHeaderGroups")),e.getFooterGroups=Z(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Q(e.options,Ne,"getFooterGroups")),e.getLeftFooterGroups=Z(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Q(e.options,Ne,"getLeftFooterGroups")),e.getCenterFooterGroups=Z(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Q(e.options,Ne,"getCenterFooterGroups")),e.getRightFooterGroups=Z(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Q(e.options,Ne,"getRightFooterGroups")),e.getFlatHeaders=Z(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Q(e.options,Ne,"getFlatHeaders")),e.getLeftFlatHeaders=Z(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Q(e.options,Ne,"getLeftFlatHeaders")),e.getCenterFlatHeaders=Z(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Q(e.options,Ne,"getCenterFlatHeaders")),e.getRightFlatHeaders=Z(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Q(e.options,Ne,"getRightFlatHeaders")),e.getCenterLeafHeaders=Z(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Q(e.options,Ne,"getCenterLeafHeaders")),e.getLeftLeafHeaders=Z(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Q(e.options,Ne,"getLeftLeafHeaders")),e.getRightLeafHeaders=Z(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Q(e.options,Ne,"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,Ne,"getLeafHeaders"))}};function Qn(e,t,n,r){var o,s;let i=0;const a=function(m,g){g===void 0&&(g=1),i=Math.max(i,g),m.filter(v=>v.getIsVisible()).forEach(v=>{var h;(h=v.columns)!=null&&h.length&&a(v.columns,g+1)},0)};a(e);let u=[];const c=(m,g)=>{const v={depth:g,id:[r,`${g}`].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=Pi(n,S,{id:[r,g,S.id,y==null?void 0:y.id].filter(Boolean).join("_"),isPlaceholder:E,placeholderId:E?`${h.filter(P=>P.column===S).length}`:void 0,depth:g,index:h.length});x.subHeaders.push(y),h.push(x)}v.headers.push(y),y.headerGroup=v}),u.push(v),g>0&&c(h,g-1)},f=t.map((m,g)=>Pi(n,m,{depth:i,index:g}));c(f,i-1),u.reverse();const p=m=>m.filter(v=>v.column.getIsVisible()).map(v=>{let h=0,y=0,w=[0];v.subHeaders&&v.subHeaders.length?(w=[],p(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 p((o=(s=u[0])==null?void 0:s.headers)!=null?o:[]),u}const po=(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:()=>qd(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=>Kd(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},Yd={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()}}},Ai=(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))};Ai.autoRemove=e=>qe(e);const _i=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};_i.autoRemove=e=>qe(e);const Fi=(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())};Fi.autoRemove=e=>qe(e);const Oi=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};Oi.autoRemove=e=>qe(e)||!(e!=null&&e.length);const Di=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});Di.autoRemove=e=>qe(e)||!(e!=null&&e.length);const Mi=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});Mi.autoRemove=e=>qe(e)||!(e!=null&&e.length);const Ii=(e,t,n)=>e.getValue(t)===n;Ii.autoRemove=e=>qe(e);const ki=(e,t,n)=>e.getValue(t)==n;ki.autoRemove=e=>qe(e);const go=(e,t,n)=>{let[r,o]=n;const s=e.getValue(t);return s>=r&&s<=o};go.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]},go.autoRemove=e=>qe(e)||qe(e[0])&&qe(e[1]);const ht={includesString:Ai,includesStringSensitive:_i,equalsString:Fi,arrIncludes:Oi,arrIncludesAll:Di,arrIncludesSome:Mi,equals:Ii,weakEquals:ki,inNumberRange:go};function qe(e){return e==null||e===""}const Zd={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"?ht.includesString:typeof r=="number"?ht.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?ht.equals:Array.isArray(r)?ht.arrIncludes:ht.weakEquals},e.getFilterFn=()=>{var n,r;return Zn(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:ht[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=Pt(n,s?s.value:void 0);if($i(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=Pt(t,o))==null?void 0:s.filter(i=>{const a=n.find(u=>u.id===i.id);if(a){const u=a.getFilterFn();if($i(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 $i(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const ho={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(!Gd(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},Qd={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 ho.sum;if(Object.prototype.toString.call(r)==="[object Date]")return ho.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Zn(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:ho[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 ef(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 tf={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:$e("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Z(n=>[Nn(t,n)],n=>n.findIndex(r=>r.id===e.id),Q(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=Nn(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=Nn(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 ef(s,n,r)},Q(e.options,"debugTable","_getOrderColumnsFn"))}},mo=()=>({left:[],right:[]}),nf={getInitialState:e=>({columnPinning:mo(),...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(p=>!(r!=null&&r.includes(p))),right:[...((u=o==null?void 0:o.right)!=null?u:[]).filter(p=>!(r!=null&&r.includes(p))),...r]}}if(n==="left"){var c,f;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(p=>!(r!=null&&r.includes(p))),...r],right:((f=o==null?void 0:o.right)!=null?f:[]).filter(p=>!(r!=null&&r.includes(p)))}}return{left:((s=o==null?void 0:o.left)!=null?s:[]).filter(p=>!(r!=null&&r.includes(p))),right:((i=o==null?void 0:o.right)!=null?i:[]).filter(p=>!(r!=null&&r.includes(p)))}})},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?mo():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:mo())},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"))}},er={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},vo=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),rf={getDefaultColumnDef:()=>er,getInitialState:e=>({columnSizing:{},columnSizingInfo:vo(),...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:er.minSize,(r=s??e.columnDef.size)!=null?r:er.size),(o=e.columnDef.maxSize)!=null?o:er.maxSize)},e.getStart=Z(n=>[n,Nn(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,Nn(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(),yo(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=yo(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(I=>{let[D,q]=I;c[D]=Math.round(Math.max(q+q*O,0)*100)/100}),{...S,deltaOffset:F,deltaPercentage:O}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(S=>({...S,...c})))},p=w=>f("move",w),m=w=>{f("end",w),t.setColumnSizingInfo(b=>({...b,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},g=n||typeof document<"u"?document:null,v={moveHandler:w=>p(w.clientX),upHandler:w=>{g==null||g.removeEventListener("mousemove",v.moveHandler),g==null||g.removeEventListener("mouseup",v.upHandler),m(w.clientX)}},h={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),p(w.touches[0].clientX),!1),upHandler:w=>{var b;g==null||g.removeEventListener("touchmove",h.moveHandler),g==null||g.removeEventListener("touchend",h.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),m((b=w.touches[0])==null?void 0:b.clientX)}},y=of()?{passive:!1}:!1;yo(s)?(g==null||g.addEventListener("touchmove",h.moveHandler,y),g==null||g.addEventListener("touchend",h.upHandler,y)):(g==null||g.addEventListener("mousemove",v.moveHandler,y),g==null||g.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?vo():(n=e.initialState.columnSizingInfo)!=null?n:vo())},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 tr=null;function of(){if(typeof tr=="boolean")return tr;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 tr=e,tr}function yo(e){return e.type==="touchstart"}const sf={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=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 Nn(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const af={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()}}},lf={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=()=>ht.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Zn(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:ht[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},cf={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()}}}},wo=0,bo=10,xo=()=>({pageIndex:wo,pageSize:bo}),uf={getInitialState:e=>({...e,pagination:{...xo(),...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=>Pt(r,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?xo():(o=e.initialState.pagination)!=null?o:xo())},e.setPageIndex=r=>{e.setPagination(o=>{let s=Pt(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?wo:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?o:wo)},e.resetPageSize=r=>{var o,s;e.setPageSize(r?bo:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?o:bo)},e.setPageSize=r=>{e.setPagination(o=>{const s=Math.max(1,Pt(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=Pt(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}}},Co=()=>({top:[],bottom:[]}),df={getInitialState:e=>({rowPinning:Co(),...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 p,m;return{top:((p=u==null?void 0:u.top)!=null?p:[]).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 g,v;return{top:[...((g=u==null?void 0:u.top)!=null?g:[]).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?Co():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Co())},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:$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=>{So(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?Eo(e,n):{rows:[],flatRows:[],rowsById:{}},Q(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=Z(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Eo(e,n):{rows:[],flatRows:[],rowsById:{}},Q(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=Z(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Eo(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 So(a,e.id,n,(i=r==null?void 0:r.selectChildren)!=null?i:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return No(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return To(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return To(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)}}}},So=(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=>So(e,a.id,n,r,o))};function Eo(e,t){const n=e.getState().rowSelection,r=[],o={},s=function(i,a){return i.map(u=>{var c;const f=No(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 No(e,t){var n;return(n=t[e.id])!=null?n:!1}function To(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()&&(No(i,t)?s=!0:o=!1),i.subRows&&i.subRows.length)){const a=To(i,t);a==="all"?s=!0:(a==="some"&&(s=!0),o=!1)}}),o?"all":s?"some":!1}const Po=/([0-9]+)/gm,pf=(e,t,n)=>Li(At(e.getValue(n)).toLowerCase(),At(t.getValue(n)).toLowerCase()),gf=(e,t,n)=>Li(At(e.getValue(n)),At(t.getValue(n))),hf=(e,t,n)=>Ao(At(e.getValue(n)).toLowerCase(),At(t.getValue(n)).toLowerCase()),mf=(e,t,n)=>Ao(At(e.getValue(n)),At(t.getValue(n))),vf=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},yf=(e,t,n)=>Ao(e.getValue(n),t.getValue(n));function Ao(e,t){return e===t?0:e>t?1:-1}function At(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Li(e,t){const n=e.split(Po).filter(Boolean),r=t.split(Po).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 Tn={alphanumeric:pf,alphanumericCaseSensitive:gf,text:hf,textCaseSensitive:mf,datetime:vf,basic:yf},wf=[Jd,sf,tf,nf,Yd,Zd,af,lf,{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 Tn.datetime;if(typeof s=="string"&&(r=!0,s.split(Po).length>1))return Tn.alphanumeric}return r?Tn.text:Tn.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return Zn(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:Tn[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(g=>g.id===e.id),u=i==null?void 0:i.findIndex(g=>g.id===e.id);let c=[],f,p=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:p}],c.splice(0,c.length-((m=t.options.maxMultiSortColCount)!=null?m:Number.MAX_SAFE_INTEGER))}else f==="toggle"?c=i.map(g=>g.id===e.id?{...g,desc:p}:g):f==="remove"?c=i.filter(g=>g.id!==e.id):c=[{id:e.id,desc:p}];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())}},Qd,cf,uf,df,ff,rf];function bf(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...wf,...(t=e._features)!=null?t:[]];let o={_features:r};const s=o._features.reduce((m,g)=>Object.assign(m,g.getDefaultOptions==null?void 0:g.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 g;u=(g=m.getInitialState==null?void 0:m.getInitialState(u))!=null?g:u});const c=[];let f=!1;const p={_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(g=>setTimeout(()=>{throw g})))},reset:()=>{o.setState(o.initialState)},setOptions:m=>{const g=Pt(m,o.options);o.options=i(g)},getState:()=>o.options.state,setState:m=>{o.options.onStateChange==null||o.options.onStateChange(m)},_getRowId:(m,g,v)=>{var h;return(h=o.options.getRowId==null?void 0:o.options.getRowId(m,g,v))!=null?h:`${v?[v.id,g].join("."):g}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(m,g)=>{let v=(g?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 g;return m=(g=m)!=null?g:{},{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 g=function(v,h,y){return y===void 0&&(y=0),v.map(w=>{const b=Xd(o,w,y,h),S=w;return b.columns=S.columns?g(S.columns,b,y+1):[],b})};return g(m)},Q(e,"debugColumns","getAllColumns")),getAllFlatColumns:Z(()=>[o.getAllColumns()],m=>m.flatMap(g=>g.getFlatColumns()),Q(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:Z(()=>[o.getAllFlatColumns()],m=>m.reduce((g,v)=>(g[v.id]=v,g),{}),Q(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:Z(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(m,g)=>{let v=m.flatMap(h=>h.getLeafColumns());return g(v)},Q(e,"debugColumns","getAllLeafColumns")),getColumn:m=>{const g=o._getAllFlatColumnsById()[m];return process.env.NODE_ENV!=="production"&&!g&&console.error(`[Table] Column with id '${m}' does not exist.`),g}};Object.assign(o,p);for(let m=0;m<o._features.length;m++){const g=o._features[m];g==null||g.createTable==null||g.createTable(o)}return o}function Ri(){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=po(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 xf(e,t,n){return n.options.filterFromLeafRows?Cf(e,t,n):Sf(e,t,n)}function Cf(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 p;let g=u[m];const v=po(n,g.id,g.original,g.index,g.depth,void 0,g.parentId);if(v.columnFilters=g.columnFilters,(p=g.subRows)!=null&&p.length&&c<i){if(v.subRows=a(g.subRows,c+1),g=v,t(g)&&!v.subRows.length){f.push(g),s[g.id]=g,o.push(g);continue}if(t(g)||v.subRows.length){f.push(g),s[g.id]=g,o.push(g);continue}}else g=v,t(g)&&(f.push(g),s[g.id]=g,o.push(g))}return f};return{rows:a(e),flatRows:o,rowsById:s}}function Sf(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 g=u[m];if(t(g)){var p;if((p=g.subRows)!=null&&p.length&&c<i){const h=po(n,g.id,g.original,g.index,g.depth,void 0,g.parentId);h.subRows=a(g.subRows,c+1),g=h}f.push(g),o.push(g),s[g.id]=g}}return f};return{rows:a(e),flatRows:o,rowsById:s}}function Ef(){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 g;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:(g=h.resolveFilterValue==null?void 0:h.resolveFilterValue(m.value))!=null?g: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 g;s.push({id:m.id,filterFn:a,resolvedValue:(g=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?g:r})}));let c,f;for(let m=0;m<t.flatRows.length;m++){const g=t.flatRows[m];if(g.columnFilters={},o.length)for(let v=0;v<o.length;v++){c=o[v];const h=c.id;g.columnFilters[h]=c.filterFn(g,h,c.resolvedValue,y=>{g.columnFiltersMeta[h]=y})}if(s.length){for(let v=0;v<s.length;v++){f=s[v];const h=f.id;if(f.filterFn(g,h,f.resolvedValue,y=>{g.columnFiltersMeta[h]=y})){g.columnFilters.__global__=!0;break}}g.columnFilters.__global__!==!0&&(g.columnFilters.__global__=!1)}}const p=m=>{for(let g=0;g<i.length;g++)if(m.columnFilters[i[g]]===!1)return!1;return!0};return xf(t.rows,p,e)},Q(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}/**
|
|
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()))}/**
|
|
14
14
|
* react-table
|
|
15
15
|
*
|
|
16
16
|
* Copyright (c) TanStack
|
|
@@ -19,92 +19,97 @@
|
|
|
19
19
|
* LICENSE.md file in the root directory of this source tree.
|
|
20
20
|
*
|
|
21
21
|
* @license MIT
|
|
22
|
-
*/function nr(e,t){return e?Nf(e)?d.createElement(e,t):e:null}function Nf(e){return Tf(e)||typeof e=="function"||Pf(e)}function Tf(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Pf(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Vi(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=d.useState(()=>({current:bf(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 Bi(e,t){return function(){return e.apply(t,arguments)}}const{toString:Af}=Object.prototype,{getPrototypeOf:_o}=Object,rr=(e=>t=>{const n=Af.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ke=e=>(e=e.toLowerCase(),t=>rr(t)===e),or=e=>t=>typeof t===e,{isArray:Yt}=Array,Pn=or("undefined");function _f(e){return e!==null&&!Pn(e)&&e.constructor!==null&&!Pn(e.constructor)&&Le(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const zi=Ke("ArrayBuffer");function Ff(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&zi(e.buffer),t}const Of=or("string"),Le=or("function"),Hi=or("number"),sr=e=>e!==null&&typeof e=="object",Df=e=>e===!0||e===!1,ir=e=>{if(rr(e)!=="object")return!1;const t=_o(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Mf=Ke("Date"),If=Ke("File"),kf=Ke("Blob"),$f=Ke("FileList"),Lf=e=>sr(e)&&Le(e.pipe),Rf=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Le(e.append)&&((t=rr(e))==="formdata"||t==="object"&&Le(e.toString)&&e.toString()==="[object FormData]"))},Vf=Ke("URLSearchParams"),[Bf,zf,Hf,Uf]=["ReadableStream","Request","Response","Headers"].map(Ke),jf=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function An(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),Yt(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 Ui(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,ji=e=>!Pn(e)&&e!==zt;function Fo(){const{caseless:e}=ji(this)&&this||{},t={},n=(r,o)=>{const s=e&&Ui(t,o)||o;ir(t[s])&&ir(r)?t[s]=Fo(t[s],r):ir(r)?t[s]=Fo({},r):Yt(r)?t[s]=r.slice():t[s]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&An(arguments[r],n);return t}const Wf=(e,t,n,{allOwnKeys:r}={})=>(An(t,(o,s)=>{n&&Le(o)?e[s]=Bi(o,n):e[s]=o},{allOwnKeys:r}),e),Gf=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),qf=(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)},Kf=(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&&_o(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Xf=(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},Jf=e=>{if(!e)return null;if(Yt(e))return e;let t=e.length;if(!Hi(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Yf=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&_o(Uint8Array)),Zf=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=r.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},Qf=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},ep=Ke("HTMLFormElement"),tp=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),Wi=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),np=Ke("RegExp"),Gi=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};An(n,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(r[s]=i||o)}),Object.defineProperties(e,r)},rp=e=>{Gi(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+"'")})}})},op=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return Yt(e)?r(e):r(String(e).split(t)),n},sp=()=>{},ip=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Oo="abcdefghijklmnopqrstuvwxyz",qi="0123456789",Ki={DIGIT:qi,ALPHA:Oo,ALPHA_DIGIT:Oo+Oo.toUpperCase()+qi},ap=(e=16,t=Ki.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function lp(e){return!!(e&&Le(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const cp=e=>{const t=new Array(10),n=(r,o)=>{if(sr(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const s=Yt(r)?[]:{};return An(r,(i,a)=>{const u=n(i,o+1);!Pn(u)&&(s[a]=u)}),t[o]=void 0,s}}return r};return n(e,0)},up=Ke("AsyncFunction"),dp=e=>e&&(sr(e)||Le(e))&&Le(e.then)&&Le(e.catch),Xi=((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)),fp=typeof queueMicrotask<"u"?queueMicrotask.bind(zt):typeof process<"u"&&process.nextTick||Xi,T={isArray:Yt,isArrayBuffer:zi,isBuffer:_f,isFormData:Rf,isArrayBufferView:Ff,isString:Of,isNumber:Hi,isBoolean:Df,isObject:sr,isPlainObject:ir,isReadableStream:Bf,isRequest:zf,isResponse:Hf,isHeaders:Uf,isUndefined:Pn,isDate:Mf,isFile:If,isBlob:kf,isRegExp:np,isFunction:Le,isStream:Lf,isURLSearchParams:Vf,isTypedArray:Yf,isFileList:$f,forEach:An,merge:Fo,extend:Wf,trim:jf,stripBOM:Gf,inherits:qf,toFlatObject:Kf,kindOf:rr,kindOfTest:Ke,endsWith:Xf,toArray:Jf,forEachEntry:Zf,matchAll:Qf,isHTMLForm:ep,hasOwnProperty:Wi,hasOwnProp:Wi,reduceDescriptors:Gi,freezeMethods:rp,toObjectSet:op,toCamelCase:tp,noop:sp,toFiniteNumber:ip,findKey:Ui,global:zt,isContextDefined:ji,ALPHABET:Ki,generateString:ap,isSpecCompliantForm:lp,toJSONObject:cp,isAsyncFn:up,isThenable:dp,setImmediate:Xi,asap:fp};function ne(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(ne,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 Ji=ne.prototype,Yi={};["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=>{Yi[e]={value:e}}),Object.defineProperties(ne,Yi),Object.defineProperty(Ji,"isAxiosError",{value:!0}),ne.from=(e,t,n,r,o,s)=>{const i=Object.create(Ji);return T.toFlatObject(e,i,function(u){return u!==Error.prototype},a=>a!=="isAxiosError"),ne.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const pp=null;function Do(e){return T.isPlainObject(e)||T.isArray(e)}function Zi(e){return T.endsWith(e,"[]")?e.slice(0,-2):e}function Qi(e,t,n){return e?e.concat(t).map(function(o,s){return o=Zi(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function gp(e){return T.isArray(e)&&!e.some(Do)}const hp=T.toFlatObject(T,{},null,function(t){return/^is[A-Z]/.test(t)});function ar(e,t,n){if(!T.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=T.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,y){return!T.isUndefined(y[h])});const r=n.metaTokens,o=n.visitor||f,s=n.dots,i=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&T.isSpecCompliantForm(t);if(!T.isFunction(o))throw new TypeError("visitor must be a function");function c(v){if(v===null)return"";if(T.isDate(v))return v.toISOString();if(!u&&T.isBlob(v))throw new ne("Blob is not supported. Use a Buffer instead.");return T.isArrayBuffer(v)||T.isTypedArray(v)?u&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function f(v,h,y){let w=v;if(v&&!y&&typeof v=="object"){if(T.endsWith(h,"{}"))h=r?h:h.slice(0,-2),v=JSON.stringify(v);else if(T.isArray(v)&&gp(v)||(T.isFileList(v)||T.endsWith(h,"[]"))&&(w=T.toArray(v)))return h=Zi(h),w.forEach(function(S,E){!(T.isUndefined(S)||S===null)&&t.append(i===!0?Qi([h],E,s):i===null?h:h+"[]",c(S))}),!1}return Do(v)?!0:(t.append(Qi(y,h,s),c(v)),!1)}const p=[],m=Object.assign(hp,{defaultVisitor:f,convertValue:c,isVisitable:Do});function g(v,h){if(!T.isUndefined(v)){if(p.indexOf(v)!==-1)throw Error("Circular reference detected in "+h.join("."));p.push(v),T.forEach(v,function(w,b){(!(T.isUndefined(w)||w===null)&&o.call(t,w,T.isString(b)?b.trim():b,h,m))===!0&&g(w,h?h.concat(b):[b])}),p.pop()}}if(!T.isObject(e))throw new TypeError("data must be an object");return g(e),t}function ea(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Mo(e,t){this._pairs=[],e&&ar(e,this,t)}const ta=Mo.prototype;ta.append=function(t,n){this._pairs.push([t,n])},ta.toString=function(t){const n=t?function(r){return t.call(this,r,ea)}:ea;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function mp(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function na(e,t,n){if(!t)return e;const r=n&&n.encode||mp;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 Mo(t,n).toString(r),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class ra{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 oa={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},vp={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Mo,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Io=typeof window<"u"&&typeof document<"u",ko=typeof navigator=="object"&&navigator||void 0,yp=Io&&(!ko||["ReactNative","NativeScript","NS"].indexOf(ko.product)<0),wp=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",bp=Io&&window.location.href||"http://localhost",Te={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Io,hasStandardBrowserEnv:yp,hasStandardBrowserWebWorkerEnv:wp,navigator:ko,origin:bp},Symbol.toStringTag,{value:"Module"})),...vp};function xp(e,t){return ar(e,new Te.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,s){return Te.isNode&&T.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function Cp(e){return T.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Sp(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 sa(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]=Sp(o[i])),!a)}if(T.isFormData(e)&&T.isFunction(e.entries)){const n={};return T.forEachEntry(e,(r,o)=>{t(Cp(r),o,n,0)}),n}return null}function Ep(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 _n={transitional:oa,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(sa(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 xp(t,this.formSerializer).toString();if((a=T.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return ar(a?{"files[]":t}:t,u&&new u,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),Ep(t)):t}],transformResponse:[function(t){const n=this.transitional||_n.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"?ne.from(a,ne.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:Te.classes.FormData,Blob:Te.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=>{_n.headers[e]={}});const Np=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"]),Tp=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[ia]=this[ia]={accessors:{}}).accessors,o=this.prototype;function s(i){const a=Fn(i);r[a]||(Fp(o,i),r[a]=!0)}return T.isArray(t)?t.forEach(s):s(t),this}}Oe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),T.reduceDescriptors(Oe.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),T.freezeMethods(Oe);function Lo(e,t){const n=this||_n,r=t||n,o=Oe.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 aa(e){return!!(e&&e.__CANCEL__)}function Zt(e,t,n){ne.call(this,e??"canceled",ne.ERR_CANCELED,t,n),this.name="CanceledError"}T.inherits(Zt,ne,{__CANCEL__:!0});function la(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ne("Request failed with status code "+n.status,[ne.ERR_BAD_REQUEST,ne.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Op(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Dp(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 p=s,m=0;for(;p!==o;)m+=n[p++],p=p%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),c-i<t)return;const g=f&&c-f;return g?Math.round(m*1e3/g):void 0}}function Mp(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(),p=f-n;p>=r?i(c,f):(o=c,s||(s=setTimeout(()=>{s=null,i(o)},r-p)))},()=>o&&i(o)]}const cr=(e,t,n=3)=>{let r=0;const o=Dp(50,250);return Mp(s=>{const i=s.loaded,a=s.lengthComputable?s.total:void 0,u=i-r,c=o(u),f=i<=a;r=i;const p={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(p)},n)},ca=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ua=e=>(...t)=>T.asap(()=>e(...t)),Ip=Te.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Te.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Te.origin),Te.navigator&&/(msie|trident)/i.test(Te.navigator.userAgent)):()=>!0,kp=Te.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 $p(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Lp(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function da(e,t){return e&&!$p(t)?Lp(e,t):t}const fa=e=>e instanceof Oe?{...e}:e;function Ht(e,t){t=t||{};const n={};function r(c,f,p,m){return T.isPlainObject(c)&&T.isPlainObject(f)?T.merge.call({caseless:m},c,f):T.isPlainObject(f)?T.merge({},f):T.isArray(f)?f.slice():f}function o(c,f,p,m){if(T.isUndefined(f)){if(!T.isUndefined(c))return r(void 0,c,p,m)}else return r(c,f,p,m)}function s(c,f){if(!T.isUndefined(f))return r(void 0,f)}function i(c,f){if(T.isUndefined(f)){if(!T.isUndefined(c))return r(void 0,c)}else return r(void 0,f)}function a(c,f,p){if(p in t)return r(c,f);if(p 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,p)=>o(fa(c),fa(f),p,!0)};return T.forEach(Object.keys(Object.assign({},e,t)),function(f){const p=u[f]||o,m=p(e[f],t[f],f);T.isUndefined(m)&&p!==a||(n[f]=m)}),n}const pa=e=>{const t=Ht({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;t.headers=i=Oe.from(i),t.url=na(da(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(Te.hasStandardBrowserEnv||Te.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((u=i.getContentType())!==!1){const[c,...f]=u?u.split(";").map(p=>p.trim()).filter(Boolean):[];i.setContentType([c||"multipart/form-data",...f].join("; "))}}if(Te.hasStandardBrowserEnv&&(r&&T.isFunction(r)&&(r=r(t)),r||r!==!1&&Ip(t.url))){const c=o&&s&&kp.read(s);c&&i.set(o,c)}return t},Rp=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const o=pa(e);let s=o.data;const i=Oe.from(o.headers).normalize();let{responseType:a,onUploadProgress:u,onDownloadProgress:c}=o,f,p,m,g,v;function h(){g&&g(),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=Oe.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};la(function(F){n(F),h()},function(F){r(F),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 ne("Request aborted",ne.ECONNABORTED,e,y)),y=null)},y.onerror=function(){r(new ne("Network Error",ne.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||oa;o.timeoutErrorMessage&&(E=o.timeoutErrorMessage),r(new ne(E,x.clarifyTimeoutError?ne.ETIMEDOUT:ne.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&&([m,v]=cr(c,!0),y.addEventListener("progress",m)),u&&y.upload&&([p,g]=cr(u),y.upload.addEventListener("progress",p),y.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(f=S=>{y&&(r(!S||S.type?new Zt(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=Op(o.url);if(b&&Te.protocols.indexOf(b)===-1){r(new ne("Unsupported protocol "+b+":",ne.ERR_BAD_REQUEST,e));return}y.send(s||null)})},Vp=(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 ne?f:new Zt(f instanceof Error?f.message:f))}};let i=t&&setTimeout(()=>{i=null,s(new ne(`timeout ${t} of ms exceeded`,ne.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}},Bp=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},zp=async function*(e,t){for await(const n of Hp(e))yield*Bp(n,t)},Hp=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()}},ga=(e,t,n,r)=>{const o=zp(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 p=f.byteLength;if(n){let m=s+=p;n(m)}u.enqueue(new Uint8Array(f))}catch(c){throw a(c),c}},cancel(u){return a(u),o.return()}},{highWaterMark:2})},ur=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ha=ur&&typeof ReadableStream=="function",Up=ur&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),ma=(e,...t)=>{try{return!!e(...t)}catch{return!1}},jp=ha&&ma(()=>{let e=!1;const t=new Request(Te.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),va=64*1024,Ro=ha&&ma(()=>T.isReadableStream(new Response("").body)),dr={stream:Ro&&(e=>e.body)};ur&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!dr[t]&&(dr[t]=T.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new ne(`Response type '${t}' is not supported`,ne.ERR_NOT_SUPPORT,r)})})})(new Response);const Wp=async e=>{if(e==null)return 0;if(T.isBlob(e))return e.size;if(T.isSpecCompliantForm(e))return(await new Request(Te.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 Up(e)).byteLength},Gp=async(e,t)=>{const n=T.toFiniteNumber(e.getContentLength());return n??Wp(t)},Vo={http:pp,xhr:Rp,fetch:ur&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:s,timeout:i,onDownloadProgress:a,onUploadProgress:u,responseType:c,headers:f,withCredentials:p="same-origin",fetchOptions:m}=pa(e);c=c?(c+"").toLowerCase():"text";let g=Vp([o,s&&s.toAbortSignal()],i),v;const h=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let y;try{if(u&&jp&&n!=="get"&&n!=="head"&&(y=await Gp(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]=ca(y,cr(ua(u)));r=ga(x.body,va,F,O)}}T.isString(p)||(p=p?"include":"omit");const w="credentials"in Request.prototype;v=new Request(t,{...m,signal:g,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:w?p:void 0});let b=await fetch(v);const S=Ro&&(c==="stream"||c==="response");if(Ro&&(a||S&&h)){const x={};["status","statusText","headers"].forEach(I=>{x[I]=b[I]});const P=T.toFiniteNumber(b.headers.get("content-length")),[F,O]=a&&ca(P,cr(ua(a),!0))||[];b=new Response(ga(b.body,va,F,()=>{O&&O(),h&&h()}),x)}c=c||"text";let E=await dr[T.findKey(dr,c)||"text"](b,e);return!S&&h&&h(),await new Promise((x,P)=>{la(x,P,{data:E,headers:Oe.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 ne("Network Error",ne.ERR_NETWORK,e,v),{cause:w.cause||w}):ne.from(w,w&&w.code,e,v)}})};T.forEach(Vo,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ya=e=>`- ${e}`,qp=e=>T.isFunction(e)||e===null||e===!1,wa={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,!qp(n)&&(r=Vo[(i=String(n)).toLowerCase()],r===void 0))throw new ne(`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=Ht(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&
|
|
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]&&Ap[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},ca=Symbol("internals");function Dn(e){return e&&String(e).trim().toLowerCase()}function ur(e){return e===!1||e==null?e:T.isArray(e)?e.map(ur):String(e)}function Fp(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 Op=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ro(e,t,n,r,o){if(T.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!T.isString(t)){if(T.isString(r))return t.indexOf(r)!==-1;if(T.isRegExp(r))return r.test(t)}}function Dp(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Mp(e,t){const n=T.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,s,i){return this[r].call(this,t,o,s,i)},configurable:!0})})}class Me{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function s(a,u,c){const f=Dn(u);if(!f)throw new Error("header name must be a non-empty string");const g=T.findKey(o,f);(!g||o[g]===void 0||c===!0||c===void 0&&o[g]!==!1)&&(o[g||u]=ur(a))}const i=(a,u)=>T.forEach(a,(c,f)=>s(c,f,u));if(T.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(T.isString(t)&&(t=t.trim())&&!Op(t))i(_p(t),n);else if(T.isHeaders(t))for(const[a,u]of t.entries())s(u,a,r);else t!=null&&s(n,t,r);return this}get(t,n){if(t=Dn(t),t){const r=T.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return Fp(o);if(T.isFunction(n))return n.call(this,o,r);if(T.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Dn(t),t){const r=T.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Ro(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function s(i){if(i=Dn(i),i){const a=T.findKey(r,i);a&&(!n||Ro(r,r[a],a,n))&&(delete r[a],o=!0)}}return T.isArray(t)?t.forEach(s):s(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const s=n[r];(!t||Ro(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const n=this,r={};return T.forEach(this,(o,s)=>{const i=T.findKey(r,s);if(i){n[i]=ur(o),delete n[s];return}const a=t?Dp(s):String(s).trim();a!==s&&delete n[s],n[a]=ur(o),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return T.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&T.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
24
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[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(xa).join(`
|
|
26
|
+
`):" "+xa(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:zo};function Ho(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Qt(null,e)}function Sa(e){return Ho(e),e.headers=Me.from(e.headers),e.data=Vo.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ca.getAdapter(e.adapter||On.adapter)(e).then(function(r){return Ho(e),r.data=Vo.call(e,e.transformResponse,r),r.headers=Me.from(r.headers),r},function(r){return ua(r)||(Ho(e),r&&r.response&&(r.response.data=Vo.call(e,e.transformResponse,r.response),r.response.headers=Me.from(r.response.headers))),Promise.reject(r)})}const Ea="1.7.9",gr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{gr[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Na={};gr.transitional=function(t,n,r){function o(s,i){return"[Axios v"+Ea+"] 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&&!Na[i]&&(Na[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}},gr.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Yp(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 hr={assertOptions:Yp,validators:gr},rt=hr.validators;class Ut{constructor(t){this.defaults=t,this.interceptors={request:new ia,response:new ia}}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=Ht(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&hr.assertOptions(r,{silentJSONParsing:rt.transitional(rt.boolean),forcedJSONParsing:rt.transitional(rt.boolean),clarifyTimeoutError:rt.transitional(rt.boolean)},!1),o!=null&&(T.isFunction(o)?n.paramsSerializer={serialize:o}:hr.assertOptions(o,{encode:rt.function,serialize:rt.function},!0)),hr.assertOptions(n,{baseUrl:rt.spelling("baseURL"),withXsrfToken:rt.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=s&&T.merge(s.common,s[n.method]);s&&T.forEach(["delete","get","head","post","put","patch","common"],v=>{delete s[v]}),n.headers=Me.concat(i,s);const a=[];let u=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(u=u&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let f,g=0,h;if(!u){const v=[Sa.bind(this),void 0];for(v.unshift.apply(v,a),v.push.apply(v,c),h=v.length,f=Promise.resolve(n);g<h;)f=f.then(v[g++],v[g++]);return f}h=a.length;let p=n;for(g=0;g<h;){const v=a[g++],m=a[g++];try{p=v(p)}catch(y){m.call(this,y);break}}try{f=Sa.call(this,p)}catch(v){return Promise.reject(v)}for(g=0,h=c.length;g<h;)f=f.then(c[g++],c[g++]);return f}getUri(t){t=Ht(this.defaults,t);const n=ga(t.baseURL,t.url);return sa(n,t.params,t.paramsSerializer)}}T.forEach(["delete","get","head","options"],function(t){Ut.prototype[t]=function(n,r){return this.request(Ht(r||{},{method:t,url:n,data:(r||{}).data}))}}),T.forEach(["post","put","patch"],function(t){function n(r){return function(s,i,a){return this.request(Ht(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}Ut.prototype[t]=n(),Ut.prototype[t+"Form"]=n(!0)});class Uo{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(a=>{r.subscribe(a),s=a}).then(o);return i.cancel=function(){r.unsubscribe(s)},i},t(function(s,i,a){r.reason||(r.reason=new Qt(s,i,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Uo(function(o){t=o}),cancel:t}}}function Zp(e){return function(n){return e.apply(null,n)}}function Qp(e){return T.isObject(e)&&e.isAxiosError===!0}const jo={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(jo).forEach(([e,t])=>{jo[t]=e});function Ta(e){const t=new Ut(e),n=Ui(Ut.prototype.request,t);return T.extend(n,Ut.prototype,t,{allOwnKeys:!0}),T.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return Ta(Ht(e,o))},n}const se=Ta(On);se.Axios=Ut,se.CanceledError=Qt,se.CancelToken=Uo,se.isCancel=ua,se.VERSION=Ea,se.toFormData=cr,se.AxiosError=re,se.Cancel=se.CanceledError,se.all=function(t){return Promise.all(t)},se.spread=Zp,se.isAxiosError=Qp,se.mergeConfig=Ht,se.AxiosHeaders=Me,se.formToJSON=e=>la(T.isHTMLForm(e)?new FormData(e):e),se.getAdapter=Ca.getAdapter,se.HttpStatusCode=jo,se.default=se;/**
|
|
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 eg=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Pa=(...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 tg={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 ng=A.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},u)=>A.createElement("svg",{ref:u,...tg,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Pa("lucide",o),...a},[...i.map(([c,f])=>A.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 He=(e,t)=>{const n=A.forwardRef(({className:r,...o},s)=>A.createElement(ng,{ref:s,iconNode:t,className:Pa(`lucide-${eg(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 Wo=He("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 rg=He("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 og=He("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 sg=He("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 Aa=He("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 ig=He("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 ag=He("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
|
|
87
|
+
*/const ve=He("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 lg=He("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 cg=He("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 Uo=Xe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),lg={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"},cg=e=>e==="SummaryOfSuggestedAI"||e==="KeywordAISuggestion"||e==="SuggestedAICategories",jo=e=>e==="fullPath"||e==="createAt"||e==="creator"||e==="creatorId"||e==="DataSource"||e==="AccessLevel"||e==="category"||e==="fileName",ug=(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 Ta(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function dg(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Ta(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():Ta(e[o],null)}}}}var Qt=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(Wo,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Wo,{...r,ref:t,children:n})});Qt.displayName="Slot";var Wo=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=gg(n);return d.cloneElement(n,{...pg(r,n.props),ref:t?dg(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Wo.displayName="SlotClone";var Pa=({children:e})=>l.jsx(l.Fragment,{children:e});function fg(e){return d.isValidElement(e)&&e.type===Pa}function pg(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 gg(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 Aa(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=Aa(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function _a(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Aa(e))&&(r&&(r+=" "),r+=t);return r}const Go="-",hg=e=>{const t=vg(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(Go);return a[0]===""&&a.length!==1&&a.shift(),Fa(a,t)||mg(i)},getConflictingClassGroupIds:(i,a)=>{const u=n[i]||[];return a&&r[i]?[...u,...r[i]]:u}}},Fa=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Fa(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Go);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},Oa=/^\[(.+)\]$/,mg=e=>{if(Oa.test(e)){const t=Oa.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},vg=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return wg(Object.entries(e.classGroups),n).forEach(([s,i])=>{qo(i,r,s,t)}),r},qo=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Da(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(yg(o)){qo(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{qo(i,Da(t,s),n,r)})})},Da=(e,t)=>{let n=e;return t.split(Go).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},yg=e=>e.isThemeGetter,wg=(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,bg=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)}}},Ma="!",xg=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,p;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==="/"){p=y;continue}}w==="["?c++:w==="]"&&c--}const m=u.length===0?a:a.substring(f),g=m.startsWith(Ma),v=g?m.substring(1):m,h=p&&p>f?p-f:void 0;return{modifiers:u,hasImportantModifier:g,baseClassName:v,maybePostfixModifierPosition:h}};return n?a=>n({className:a,parseClassName:i}):i},Cg=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},Sg=e=>({cache:bg(e.cacheSize),parseClassName:xg(e),...hg(e)}),Eg=/\s+/,Ng=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(Eg);let a="";for(let u=i.length-1;u>=0;u-=1){const c=i[u],{modifiers:f,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:g}=n(c);let v=!!g,h=r(v?m.substring(0,g):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=Cg(f).join(":"),w=p?y+Ma: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 Tg(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Ia(t))&&(r&&(r+=" "),r+=n);return r}const Ia=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ia(e[r]))&&(n&&(n+=" "),n+=t);return n};function Pg(e,...t){let n,r,o,s=i;function i(u){const c=t.reduce((f,p)=>p(f),e());return n=Sg(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=Ng(u,n);return o(u,f),f}return function(){return s(Tg.apply(null,arguments))}}const de=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},ka=/^\[(?:([a-z-]+):)?(.+)\]$/i,Ag=/^\d+\/\d+$/,_g=new Set(["px","full","screen"]),Fg=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Og=/\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$/,Dg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Mg=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ig=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,mt=e=>en(e)||_g.has(e)||Ag.test(e),_t=e=>tn(e,"length",Hg),en=e=>!!e&&!Number.isNaN(Number(e)),Ko=e=>tn(e,"number",en),On=e=>!!e&&Number.isInteger(Number(e)),kg=e=>e.endsWith("%")&&en(e.slice(0,-1)),re=e=>ka.test(e),Ft=e=>Fg.test(e),$g=new Set(["length","size","percentage"]),Lg=e=>tn(e,$g,$a),Rg=e=>tn(e,"position",$a),Vg=new Set(["image","url"]),Bg=e=>tn(e,Vg,jg),zg=e=>tn(e,"",Ug),Dn=()=>!0,tn=(e,t,n)=>{const r=ka.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Hg=e=>Og.test(e)&&!Dg.test(e),$a=()=>!1,Ug=e=>Mg.test(e),jg=e=>Ig.test(e),Wg=Pg(()=>{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"),p=de("invert"),m=de("gap"),g=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"),P=de("skew"),F=de("space"),O=de("translate"),I=()=>["auto","contain","none"],D=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",re,t],k=()=>[re,t],z=()=>["",mt,_t],R=()=>["auto",en,re],J=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>["start","end","center","between","around","evenly","stretch"],Y=()=>["","0",re],le=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ue=()=>[en,re];return{cacheSize:500,separator:":",theme:{colors:[Dn],spacing:[mt,_t],blur:["none","",Ft,re],brightness:ue(),borderColor:[e],borderRadius:["none","","full",Ft,re],borderSpacing:k(),borderWidth:z(),contrast:ue(),grayscale:Y(),hueRotate:ue(),invert:Y(),gap:k(),gradientColorStops:[e],gradientColorStopPositions:[kg,_t],inset:q(),margin:q(),opacity:ue(),padding:k(),saturate:ue(),scale:ue(),sepia:Y(),skew:ue(),space:k(),translate:k()},classGroups:{aspect:[{aspect:["auto","square","video",re]}],container:["container"],columns:[{columns:[Ft]}],"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(),re]}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],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",On,re]}],basis:[{basis:q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",re]}],grow:[{grow:Y()}],shrink:[{shrink:Y()}],order:[{order:["first","last","none",On,re]}],"grid-cols":[{"grid-cols":[Dn]}],"col-start-end":[{col:["auto",{span:["full",On,re]},re]}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":[Dn]}],"row-start-end":[{row:["auto",{span:[On,re]},re]}],"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",re]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",re]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[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",re,t]}],"min-w":[{"min-w":[re,t,"min","max","fit"]}],"max-w":[{"max-w":[re,t,"none","full","min","max","fit","prose",{screen:[Ft]},Ft]}],h:[{h:[re,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[re,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[re,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[re,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ft,_t]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ko]}],"font-family":[{font:[Dn]}],"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",re]}],"line-clamp":[{"line-clamp":["none",en,Ko]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",mt,re]}],"list-image":[{"list-image":["none",re]}],"list-style-type":[{list:["none","disc","decimal",re]}],"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:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",mt,_t]}],"underline-offset":[{"underline-offset":["auto",mt,re]}],"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",re]}],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",re]}],"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(),Rg]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Lg]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Bg]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],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:[...B(),"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:B()}],"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:["",...B()]}],"outline-offset":[{"outline-offset":[mt,re]}],"outline-w":[{outline:[mt,_t]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[mt,_t]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ft,zg]}],"shadow-color":[{shadow:[Dn]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...U(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Ft,re]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[p]}],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":[p]}],"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",re]}],duration:[{duration:ue()}],ease:[{ease:["linear","in","out","in-out",re]}],delay:[{delay:ue()}],animate:[{animate:["none","spin","ping","pulse","bounce",re]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[On,re]}],"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",re]}],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",re]}],"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",re]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[mt,_t,Ko]}],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 te(...e){return Wg(_a(e))}const Gg=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]}`},La=d.forwardRef(({className:e,...t},n)=>l.jsx("nav",{ref:n,"aria-label":"breadcrumb",className:te("s3-explr-ui-breadcrumb",e),...t}));La.displayName="Breadcrumb";const Ra=d.forwardRef(({className:e,...t},n)=>l.jsx("ol",{ref:n,className:te("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}));Ra.displayName="BreadcrumbList";const Xo=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:te("inline-flex items-center gap-1.5","s3-explr-ui-breadcrumb-item",e),...t}));Xo.displayName="BreadcrumbItem";const Jo=d.forwardRef(({asChild:e,className:t,...n},r)=>{const o=e?Qt:"a";return l.jsx(o,{ref:r,className:te("transition-colors hover:text-foreground","s3-explr-ui-breadcrumb-link",t),...n})});Jo.displayName="BreadcrumbLink";const qg=d.forwardRef(({className:e,...t},n)=>l.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:te("font-normal text-foreground","s3-explr-ui-breadcrumb-page",e),...t}));qg.displayName="BreadcrumbPage";const Va=({children:e,className:t,...n})=>l.jsx("li",{role:"presentation","aria-hidden":"true",className:te("[&>svg]:w-3.5 [&>svg]:h-3.5","s3-explr-ui-breadcrumb-separator",t),...n,children:e??l.jsx(Na,{})});Va.displayName="BreadcrumbSeparator";const Ba=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,za=_a,Yo=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return za(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],p=s==null?void 0:s[c];if(f===null)return null;const m=Ba(f)||Ba(p);return o[c][m]}),a=n&&Object.entries(n).reduce((c,f)=>{let[p,m]=f;return m===void 0||(c[p]=m),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:p,className:m,...g}=f;return Object.entries(g).every(v=>{let[h,y]=v;return Array.isArray(y)?y.includes({...s,...a}[h]):{...s,...a}[h]===y})?[...c,p,m]:c},[]);return za(e,i,u,n==null?void 0:n.class,n==null?void 0:n.className)},Ha=Yo("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?Qt:"button";return l.jsx(i,{className:te(Ha({variant:t,size:n,className:e})),ref:s,...o})});ie.displayName="Button";function Kg(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function gr(...e){return t=>e.forEach(n=>Kg(n,t))}function ze(...e){return d.useCallback(gr(...e),e)}function Xg(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 Ot(e,t=[]){let n=[];function r(s,i){const a=d.createContext(i),u=n.length;n=[...n,i];const c=p=>{var w;const{scope:m,children:g,...v}=p,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:g})};c.displayName=s+"Provider";function f(p,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||a,v=d.useContext(g);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${p}\` 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,Jg(o,...t)]}function Jg(...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 p=u(s)[`__scope${c}`];return{...a,...p}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function we(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 nn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Yg({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=Ae(n),u=d.useCallback(c=>{if(s){const p=typeof c=="function"?c(e):c;p!==e&&a(p)}else o(c)},[s,e,o,a]);return[i,u]}function Yg({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 Zg(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 Ua(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 Qg(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var rn=e=>{const{present:t,children:n}=e,r=eh(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=ze(r.ref,th(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};rn.displayName="Presence";function eh(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=Qg(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=hr(r.current);s.current=a==="mounted"?c:"none"},[a]),Re(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,g=hr(c);e?u("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Re(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,p=g=>{const h=hr(r.current).includes(g.animationName);if(g.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=g=>{g.target===t&&(s.current=hr(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function hr(e){return(e==null?void 0:e.animationName)||"none"}function th(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 ja=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(rh);if(s){const i=s.props.children,a=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return l.jsx(Zo,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Zo,{...r,ref:t,children:n})});ja.displayName="Slot";var Zo=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=sh(n);return d.cloneElement(n,{...oh(r,n.props),ref:t?gr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Zo.displayName="SlotClone";var nh=({children:e})=>l.jsx(l.Fragment,{children:e});function rh(e){return d.isValidElement(e)&&e.type===nh}function oh(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 ih=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],be=ih.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?ja: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 Wa(e,t){e&&Yn.flushSync(()=>e.dispatchEvent(t))}var Qo="Checkbox",[ah,uC]=Ot(Qo),[lh,ch]=ah(Qo),Ga=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:u="on",onCheckedChange:c,form:f,...p}=e,[m,g]=d.useState(null),v=ze(t,E=>g(E)),h=d.useRef(!1),y=m?f||!!m.closest("form"):!0,[w=!1,b]=nn({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(lh,{scope:n,state:w,disabled:a,children:[l.jsx(be.button,{type:"button",role:"checkbox","aria-checked":Dt(w)?"mixed":w,"aria-required":i,"data-state":Xa(w),"data-disabled":a?"":void 0,disabled:a,value:u,...p,ref:v,onKeyDown:we(e.onKeyDown,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:we(e.onClick,E=>{b(x=>Dt(x)?!0:!x),y&&(h.current=E.isPropagationStopped(),h.current||E.stopPropagation())})}),y&&l.jsx(uh,{control:m,bubbles:!h.current,name:r,value:u,checked:w,required:i,disabled:a,form:f,style:{transform:"translateX(-100%)"},defaultChecked:Dt(s)?!1:s})]})});Ga.displayName=Qo;var qa="CheckboxIndicator",Ka=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=ch(qa,n);return l.jsx(rn,{present:r||Dt(s.state)||s.state===!0,children:l.jsx(be.span,{"data-state":Xa(s.state),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Ka.displayName=qa;var uh=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...s}=e,i=d.useRef(null),a=Zg(n),u=Ua(t);d.useEffect(()=>{const f=i.current,p=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(p,"checked").set;if(a!==n&&g){const v=new Event("click",{bubbles:r});f.indeterminate=Dt(n),g.call(f,Dt(n)?!1:n),f.dispatchEvent(v)}},[a,n,r]);const c=d.useRef(Dt(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 Dt(e){return e==="indeterminate"}function Xa(e){return Dt(e)?"indeterminate":e?"checked":"unchecked"}var Ja=Ga,dh=Ka;const es=d.forwardRef(({className:e,...t},n)=>l.jsx(Ja,{ref:n,className:te("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(dh,{className:te("s3-explr-ui-checkbox-indicator flex items-center justify-center text-current"),children:l.jsx(tg,{className:"s3-explr-ui-checkbox-check h-4 w-4"})})}));es.displayName=Ja.displayName;var fh=d.useId||(()=>{}),ph=0;function on(e){const[t,n]=d.useState(fh());return Re(()=>{e||n(r=>r??String(ph++))},[e]),e||(t?`radix-${t}`:"")}function Ya(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 gh="DismissableLayer",ts="dismissableLayer.update",hh="dismissableLayer.pointerDownOutside",mh="dismissableLayer.focusOutside",Za,Qa=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ns=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,c=d.useContext(Qa),[f,p]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=d.useState({}),v=ze(t,F=>p(F)),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=yh(F=>{const O=F.target,I=[...c.branches].some(D=>D.contains(O));!E||I||(o==null||o(F),i==null||i(F),F.defaultPrevented||a==null||a())},m),P=wh(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())},m);return Ya(F=>{b===c.layers.size-1&&(r==null||r(F),!F.defaultPrevented&&a&&(F.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Za=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),tl(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Za)}},[f,m,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),tl())},[f,c]),d.useEffect(()=>{const F=()=>g({});return document.addEventListener(ts,F),()=>document.removeEventListener(ts,F)},[]),l.jsx(be.div,{...u,ref:v,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:we(e.onFocusCapture,P.onFocusCapture),onBlurCapture:we(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:we(e.onPointerDownCapture,x.onPointerDownCapture)})});ns.displayName=gh;var vh="DismissableLayerBranch",el=d.forwardRef((e,t)=>{const n=d.useContext(Qa),r=d.useRef(null),o=ze(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(be.div,{...e,ref:o})});el.displayName=vh;function yh(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(){nl(hh,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 wh(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&&nl(mh,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 tl(){const e=new CustomEvent(ts);document.dispatchEvent(e)}function nl(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?Wa(o,s):o.dispatchEvent(s)}var bh=ns,xh=el,rs="focusScope.autoFocusOnMount",os="focusScope.autoFocusOnUnmount",rl={bubbles:!1,cancelable:!0},Ch="FocusScope",ol=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),p=d.useRef(null),m=ze(t,h=>u(h)),g=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let h=function(S){if(g.paused||!a)return;const E=S.target;a.contains(E)?p.current=E:Mt(p.current,{select:!0})},y=function(S){if(g.paused||!a)return;const E=S.relatedTarget;E!==null&&(a.contains(E)||Mt(p.current,{select:!0}))},w=function(S){if(document.activeElement===document.body)for(const x of S)x.removedNodes.length>0&&Mt(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,g.paused]),d.useEffect(()=>{if(a){al.add(g);const h=document.activeElement;if(!a.contains(h)){const w=new CustomEvent(rs,rl);a.addEventListener(rs,c),a.dispatchEvent(w),w.defaultPrevented||(Sh(Ah(sl(a)),{select:!0}),document.activeElement===h&&Mt(a))}return()=>{a.removeEventListener(rs,c),setTimeout(()=>{const w=new CustomEvent(os,rl);a.addEventListener(os,f),a.dispatchEvent(w),w.defaultPrevented||Mt(h??document.body,{select:!0}),a.removeEventListener(os,f),al.remove(g)},0)}}},[a,c,f,g]);const v=d.useCallback(h=>{if(!n&&!r||g.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]=Eh(b);S&&E?!h.shiftKey&&w===E?(h.preventDefault(),n&&Mt(S,{select:!0})):h.shiftKey&&w===S&&(h.preventDefault(),n&&Mt(E,{select:!0})):w===b&&h.preventDefault()}},[n,r,g.paused]);return l.jsx(be.div,{tabIndex:-1,...i,ref:m,onKeyDown:v})});ol.displayName=Ch;function Sh(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Mt(r,{select:t}),document.activeElement!==n)return}function Eh(e){const t=sl(e),n=il(t,e),r=il(t.reverse(),e);return[n,r]}function sl(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 il(e,t){for(const n of e)if(!Nh(n,{upTo:t}))return n}function Nh(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 Th(e){return e instanceof HTMLInputElement&&"select"in e}function Mt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Th(e)&&t&&e.select()}}var al=Ph();function Ph(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ll(e,t),e.unshift(t)},remove(t){var n;e=ll(e,t),(n=e[0])==null||n.resume()}}}function ll(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ah(e){return e.filter(t=>t.tagName!=="A")}var _h="Portal",ss=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?uo.createPortal(l.jsx(be.div,{...r,ref:t}),i):null});ss.displayName=_h;var is=0;function Fh(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??cl()),document.body.insertAdjacentElement("beforeend",e[1]??cl()),is++,()=>{is===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),is--}},[])}function cl(){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 ul(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 dl(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 fl(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 mr="right-scroll-bar-position",vr="width-before-scroll-bar",Oh="with-scroll-bars-hidden",Dh="--removed-body-scroll-bar-size";function as(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Mh(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 Ih=typeof window<"u"?d.useLayoutEffect:d.useEffect,pl=new WeakMap;function kh(e,t){var n=Mh(null,function(r){return e.forEach(function(o){return as(o,r)})});return Ih(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)||as(a,null)}),s.forEach(function(a){o.has(a)||as(a,i)})}pl.set(n,e)},[e]),n}function $h(e){return e}function Lh(e,t){t===void 0&&(t=$h);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 Rh(e){e===void 0&&(e={});var t=Lh(null);return t.options=ot({async:!0,ssr:!1},e),t}var gl=function(e){var t=e.sideCar,n=ul(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))};gl.isSideCarExport=!0;function Vh(e,t){return e.useMedium(t),gl}var hl=Rh(),ls=function(){},yr=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:ls,onWheelCapture:ls,onTouchMoveCapture:ls}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,u=e.className,c=e.removeScrollBar,f=e.enabled,p=e.shards,m=e.sideCar,g=e.noIsolation,v=e.inert,h=e.allowPinchZoom,y=e.as,w=y===void 0?"div":y,b=e.gapMode,S=ul(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=m,x=kh([n,t]),P=ot(ot({},S),o);return d.createElement(d.Fragment,null,f&&d.createElement(E,{sideCar:hl,removeScrollBar:c,shards:p,noIsolation:g,inert:v,setCallbacks:s,allowPinchZoom:!!h,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))});yr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},yr.classNames={fullWidth:vr,zeroRight:mr};var Bh=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function zh(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Bh();return t&&e.setAttribute("nonce",t),e}function Hh(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Uh(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var jh=function(){var e=0,t=null;return{add:function(n){e==0&&(t=zh())&&(Hh(t,n),Uh(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Wh=function(){var e=jh();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ml=function(){var e=Wh(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Gh={left:0,top:0,right:0,gap:0},cs=function(e){return parseInt(e||"",10)||0},qh=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[cs(n),cs(r),cs(o)]},Kh=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Gh;var t=qh(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])}},Xh=ml(),sn="data-scroll-locked",Jh=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
103
|
-
|
|
102
|
+
*/const ug=He("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
|
+
* @license lucide-react v0.468.0 - ISC
|
|
104
|
+
*
|
|
105
|
+
* This source code is licensed under the ISC license.
|
|
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(Ih,` {
|
|
104
109
|
overflow: hidden `).concat(r,`;
|
|
105
110
|
padding-right: `).concat(a,"px ").concat(r,`;
|
|
106
111
|
}
|
|
107
|
-
body[`).concat(
|
|
112
|
+
body[`).concat(an,`] {
|
|
108
113
|
overflow: hidden `).concat(r,`;
|
|
109
114
|
overscroll-behavior: contain;
|
|
110
115
|
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
@@ -117,32 +122,32 @@
|
|
|
117
122
|
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
118
123
|
}
|
|
119
124
|
|
|
120
|
-
.`).concat(
|
|
125
|
+
.`).concat(yr,` {
|
|
121
126
|
right: `).concat(a,"px ").concat(r,`;
|
|
122
127
|
}
|
|
123
128
|
|
|
124
|
-
.`).concat(
|
|
129
|
+
.`).concat(wr,` {
|
|
125
130
|
margin-right: `).concat(a,"px ").concat(r,`;
|
|
126
131
|
}
|
|
127
132
|
|
|
128
|
-
.`).concat(
|
|
133
|
+
.`).concat(yr," .").concat(yr,` {
|
|
129
134
|
right: 0 `).concat(r,`;
|
|
130
135
|
}
|
|
131
136
|
|
|
132
|
-
.`).concat(
|
|
137
|
+
.`).concat(wr," .").concat(wr,` {
|
|
133
138
|
margin-right: 0 `).concat(r,`;
|
|
134
139
|
}
|
|
135
140
|
|
|
136
|
-
body[`).concat(
|
|
137
|
-
`).concat(
|
|
141
|
+
body[`).concat(an,`] {
|
|
142
|
+
`).concat(kh,": ").concat(a,`px;
|
|
138
143
|
}
|
|
139
|
-
`)},
|
|
144
|
+
`)},bl=function(){var e=parseInt(document.body.getAttribute(an)||"0",10);return isFinite(e)?e:0},em=function(){d.useEffect(function(){return document.body.setAttribute(an,(bl()+1).toString()),function(){var e=bl()-1;e<=0?document.body.removeAttribute(an):document.body.setAttribute(an,e.toString())}},[])},tm=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;em();var s=d.useMemo(function(){return Yh(o)},[o]);return d.createElement(Zh,{styles:Qh(s,!t,o,n?"":"!important")})},ps=!1;if(typeof window<"u")try{var xr=Object.defineProperty({},"passive",{get:function(){return ps=!0,!0}});window.addEventListener("test",xr,xr),window.removeEventListener("test",xr,xr)}catch{ps=!1}var ln=ps?{passive:!1}:!1,nm=function(e){return e.tagName==="TEXTAREA"},xl=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!nm(e)&&n[t]==="visible")},rm=function(e){return xl(e,"overflowY")},om=function(e){return xl(e,"overflowX")},Cl=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Sl(e,r);if(o){var s=El(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},sm=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},im=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Sl=function(e,t){return e==="v"?rm(t):om(t)},El=function(e,t){return e==="v"?sm(t):im(t)},am=function(e,t){return e==="h"&&t==="rtl"?-1:1},lm=function(e,t,n,r,o){var s=am(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,u=t.contains(a),c=!1,f=i>0,g=0,h=0;do{var p=El(e,a),v=p[0],m=p[1],y=p[2],w=m-y-s*v;(v||w)&&Sl(e,a)&&(g+=w,h+=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(h)<1||!o))&&(c=!0),c},Cr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Nl=function(e){return[e.deltaX,e.deltaY]},Tl=function(e){return e&&"current"in e?e.current:e},cm=function(e,t){return e[0]===t[0]&&e[1]===t[1]},um=function(e){return`
|
|
140
145
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
141
146
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
142
|
-
`)},lm=0,ln=[];function cm(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(lm++)[0],s=d.useState(ml)[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=fl([e.lockRef.current],(e.shards||[]).map(Sl),!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=br(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,P=h.target,F=Math.abs(S)>Math.abs(E)?"h":"v";if("touches"in h&&F==="h"&&P.type==="range")return!1;var O=wl(F,P);if(!O)return!0;if(O?x=F:(x=F==="v"?"h":"v",O=wl(F,P)),!O)return!1;if(!r.current&&"changedTouches"in h&&(S||E)&&(r.current=x),!x)return!0;var I=r.current||x;return sm(I,y,h,I==="h"?S:E,!0)},[]),u=d.useCallback(function(h){var y=h;if(!(!ln.length||ln[ln.length-1]!==s)){var w="deltaY"in y?Cl(y):br(y),b=t.current.filter(function(x){return x.name===y.type&&(x.target===y.target||y.target===x.shadowParent)&&im(x.delta,w)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var S=(i.current.shards||[]).map(Sl).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:um(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=br(h),r.current=void 0},[]),p=d.useCallback(function(h){c(h.type,Cl(h),h.target,a(h,e.lockRef.current))},[]),m=d.useCallback(function(h){c(h.type,br(h),h.target,a(h,e.lockRef.current))},[]);d.useEffect(function(){return ln.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",u,an),document.addEventListener("touchmove",u,an),document.addEventListener("touchstart",f,an),function(){ln=ln.filter(function(h){return h!==s}),document.removeEventListener("wheel",u,an),document.removeEventListener("touchmove",u,an),document.removeEventListener("touchstart",f,an)}},[]);var g=e.removeScrollBar,v=e.inert;return d.createElement(d.Fragment,null,v?d.createElement(s,{styles:am(o)}):null,g?d.createElement(Zh,{gapMode:e.gapMode}):null)}function um(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const dm=Vh(hl,cm);var El=d.forwardRef(function(e,t){return d.createElement(yr,ot({},e,{ref:t,sideCar:dm}))});El.classNames=yr.classNames;var fm=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},cn=new WeakMap,xr=new WeakMap,Cr={},ds=0,Nl=function(e){return e&&(e.host||Nl(e.parentNode))},pm=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Nl(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})},gm=function(e,t,n,r){var o=pm(t,Array.isArray(e)?e:[e]);Cr[n]||(Cr[n]=new WeakMap);var s=Cr[n],i=[],a=new Set,u=new Set(o),c=function(p){!p||a.has(p)||(a.add(p),c(p.parentNode))};o.forEach(c);var f=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(m){if(a.has(m))f(m);else try{var g=m.getAttribute(r),v=g!==null&&g!=="false",h=(cn.get(m)||0)+1,y=(s.get(m)||0)+1;cn.set(m,h),s.set(m,y),i.push(m),h===1&&v&&xr.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(),ds++,function(){i.forEach(function(p){var m=cn.get(p)-1,g=s.get(p)-1;cn.set(p,m),s.set(p,g),m||(xr.has(p)||p.removeAttribute(r),xr.delete(p)),g||p.removeAttribute(n)}),ds--,ds||(cn=new WeakMap,cn=new WeakMap,xr=new WeakMap,Cr={})}},hm=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]"))),gm(r,o,n,"aria-hidden")):function(){return null}},Tl=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(vm);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(fs,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(fs,{...r,ref:t,children:n})});Tl.displayName="Slot";var fs=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=wm(n);return d.cloneElement(n,{...ym(r,n.props),ref:t?gr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});fs.displayName="SlotClone";var mm=({children:e})=>l.jsx(l.Fragment,{children:e});function vm(e){return d.isValidElement(e)&&e.type===mm}function ym(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function wm(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 ps="Dialog",[Pl,dC]=Ot(ps),[bm,Je]=Pl(ps),Al=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]=nn({prop:r,defaultProp:o,onChange:s});return l.jsx(bm,{scope:t,triggerRef:a,contentRef:u,contentId:on(),titleId:on(),descriptionId:on(),open:c,onOpenChange:f,onOpenToggle:d.useCallback(()=>f(p=>!p),[f]),modal:i,children:n})};Al.displayName=ps;var _l="DialogTrigger",Fl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Je(_l,n),s=ze(t,o.triggerRef);return l.jsx(be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ms(o.open),...r,ref:s,onClick:we(e.onClick,o.onOpenToggle)})});Fl.displayName=_l;var gs="DialogPortal",[xm,Ol]=Pl(gs,{forceMount:void 0}),Dl=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=Je(gs,t);return l.jsx(xm,{scope:t,forceMount:n,children:d.Children.map(r,i=>l.jsx(rn,{present:n||s.open,children:l.jsx(ss,{asChild:!0,container:o,children:i})}))})};Dl.displayName=gs;var Sr="DialogOverlay",Ml=d.forwardRef((e,t)=>{const n=Ol(Sr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Je(Sr,e.__scopeDialog);return s.modal?l.jsx(rn,{present:r||s.open,children:l.jsx(Cm,{...o,ref:t})}):null});Ml.displayName=Sr;var Cm=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Je(Sr,n);return l.jsx(El,{as:Tl,allowPinchZoom:!0,shards:[o.contentRef],children:l.jsx(be.div,{"data-state":ms(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),jt="DialogContent",Il=d.forwardRef((e,t)=>{const n=Ol(jt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Je(jt,e.__scopeDialog);return l.jsx(rn,{present:r||s.open,children:s.modal?l.jsx(Sm,{...o,ref:t}):l.jsx(Em,{...o,ref:t})})});Il.displayName=jt;var Sm=d.forwardRef((e,t)=>{const n=Je(jt,e.__scopeDialog),r=d.useRef(null),o=ze(t,n.contentRef,r);return d.useEffect(()=>{const s=r.current;if(s)return hm(s)},[]),l.jsx(kl,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:we(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:we(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:we(e.onFocusOutside,s=>s.preventDefault())})}),Em=d.forwardRef((e,t)=>{const n=Je(jt,e.__scopeDialog),r=d.useRef(!1),o=d.useRef(!1);return l.jsx(kl,{...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()}})}),kl=d.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=Je(jt,n),u=d.useRef(null),c=ze(t,u);return Fh(),l.jsxs(l.Fragment,{children:[l.jsx(ol,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(ns,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ms(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(Nm,{titleId:a.titleId}),l.jsx(Pm,{contentRef:u,descriptionId:a.descriptionId})]})]})}),hs="DialogTitle",$l=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Je(hs,n);return l.jsx(be.h2,{id:o.titleId,...r,ref:t})});$l.displayName=hs;var Ll="DialogDescription",Rl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Je(Ll,n);return l.jsx(be.p,{id:o.descriptionId,...r,ref:t})});Rl.displayName=Ll;var Vl="DialogClose",Bl=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Je(Vl,n);return l.jsx(be.button,{type:"button",...r,ref:t,onClick:we(e.onClick,()=>o.onOpenChange(!1))})});Bl.displayName=Vl;function ms(e){return e?"open":"closed"}var zl="DialogTitleWarning",[fC,Hl]=Xg(zl,{contentName:jt,titleName:hs,docsSlug:"dialog"}),Nm=({titleId:e})=>{const t=Hl(zl),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
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.
|
|
143
148
|
|
|
144
149
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
145
150
|
|
|
146
|
-
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},Tm="DialogDescriptionWarning",Pm=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Hl(Tm).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},Am=Al,_m=Fl,Fm=Dl,Ul=Ml,jl=Il,Wl=$l,Gl=Rl,Om=Bl;const It=Am,Er=_m,Dm=Fm,ql=d.forwardRef(({className:e,...t},n)=>l.jsx(Ul,{ref:n,className:te("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}));ql.displayName=Ul.displayName;const vt=d.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(Dm,{children:[l.jsx(ql,{}),l.jsxs(jl,{ref:r,className:te("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(Om,{className:te("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(Uo,{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"})]})]})]}));vt.displayName=jl.displayName;const yt=({className:e,...t})=>l.jsx("div",{className:te("s3-explr-ui-dialog-header flex flex-col space-y-1.5 text-center sm:text-left",e),...t});yt.displayName="DialogHeader";const un=({className:e,...t})=>l.jsx("div",{className:te("s3-explr-ui-dialog-footer flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});un.displayName="DialogFooter";const wt=d.forwardRef(({className:e,...t},n)=>l.jsx(Wl,{ref:n,className:te("s3-explr-ui-dialog-title text-lg font-semibold leading-none tracking-tight",e),...t}));wt.displayName=Wl.displayName;const Mn=d.forwardRef(({className:e,...t},n)=>l.jsx(Gl,{ref:n,className:te("s3-explr-ui-dialog-description text-sm text-muted-foreground",e),...t}));Mn.displayName=Gl.displayName;const kt=d.forwardRef(({className:e,type:t,...n},r)=>l.jsx("input",{type:t,className:te("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}));kt.displayName="Input";var Mm="Label",Kl=d.forwardRef((e,t)=>l.jsx(be.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())}}));Kl.displayName=Mm;var Xl=Kl;const Im=Yo("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(Xl,{ref:o,className:te(Im({variant:t,size:n}),e),...r}));Wt.displayName=Xl.displayName;const Nr=d.forwardRef(({className:e,...t},n)=>l.jsx("div",{className:te("relative w-full overflow-auto","s3-explr-ui-table-container"),children:l.jsx("table",{ref:n,className:te("w-full caption-bottom text-sm","s3-explr-ui-table",e),...t})}));Nr.displayName="Table";const Tr=d.forwardRef(({className:e,...t},n)=>l.jsx("thead",{ref:n,className:te("[&_tr]:border-b","s3-explr-ui-table-header",e),...t}));Tr.displayName="TableHeader";const Pr=d.forwardRef(({className:e,...t},n)=>l.jsx("tbody",{ref:n,className:te("[&_tr:last-child]:border-0","s3-explr-ui-table-body",e),...t}));Pr.displayName="TableBody";const km=d.forwardRef(({className:e,...t},n)=>l.jsx("tfoot",{ref:n,className:te("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0","s3-explr-ui-table-footer",e),...t}));km.displayName="TableFooter";const Ye=d.forwardRef(({className:e,...t},n)=>l.jsx("tr",{ref:n,className:te("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted","s3-explr-ui-table-row",e),...t}));Ye.displayName="TableRow";const st=d.forwardRef(({className:e,...t},n)=>l.jsx("th",{ref:n,className:te("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 De=d.forwardRef(({className:e,...t},n)=>l.jsx("td",{ref:n,className:te("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-cell",e),...t}));De.displayName="TableCell";const $m=d.forwardRef(({className:e,...t},n)=>l.jsx("caption",{ref:n,className:te("mt-4 text-sm text-muted-foreground","s3-explr-ui-table-caption",e),...t}));$m.displayName="TableCaption";function vs(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 dn(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 Jl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ys(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Jl(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Jl(e[o],null)}}}}function ws(...e){return d.useCallback(ys(...e),e)}var bs=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Rm);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(xs,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(xs,{...r,ref:t,children:n})});bs.displayName="Slot";var xs=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Bm(n);return d.cloneElement(n,{...Vm(r,n.props),ref:t?ys(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});xs.displayName="SlotClone";var Lm=({children:e})=>l.jsx(l.Fragment,{children:e});function Rm(e){return d.isValidElement(e)&&e.type===Lm}function Vm(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 Bm(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 zm(e){const t=e+"CollectionProvider",[n,r]=Ot(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=g=>{const{scope:v,children:h}=g,y=A.useRef(null),w=A.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:h})};i.displayName=t;const a=e+"CollectionSlot",u=A.forwardRef((g,v)=>{const{scope:h,children:y}=g,w=s(a,h),b=ws(v,w.collectionRef);return l.jsx(bs,{ref:b,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",p=A.forwardRef((g,v)=>{const{scope:h,children:y,...w}=g,b=A.useRef(null),S=ws(v,b),E=s(c,h);return A.useEffect(()=>(E.itemMap.set(b,{ref:b,...w}),()=>void E.itemMap.delete(b))),l.jsx(bs,{[f]:"",ref:S,children:y})});p.displayName=c;function m(g){const v=s(e+"CollectionConsumer",g);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:p},m,r]}var Yl=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Um);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(Cs,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Cs,{...r,ref:t,children:n})});Yl.displayName="Slot";var Cs=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Wm(n);return d.cloneElement(n,{...jm(r,n.props),ref:t?ys(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Cs.displayName="SlotClone";var Hm=({children:e})=>l.jsx(l.Fragment,{children:e});function Um(e){return d.isValidElement(e)&&e.type===Hm}function jm(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{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 Wm(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 Gm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Zl=Gm.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Yl: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}},{}),qm=d.createContext(void 0);function Ql(e){const t=d.useContext(qm);return e||t||"ltr"}var Ss="rovingFocusGroup.onEntryFocus",Km={bubbles:!1,cancelable:!0},Ar="RovingFocusGroup",[Es,ec,Xm]=zm(Ar),[Jm,tc]=Ot(Ar,[Xm]),[Ym,Zm]=Jm(Ar),nc=d.forwardRef((e,t)=>l.jsx(Es.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Es.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Qm,{...e,ref:t})})}));nc.displayName=Ar;var Qm=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,...p}=e,m=d.useRef(null),g=ws(t,m),v=Ql(s),[h=null,y]=nn({prop:i,defaultProp:a,onChange:u}),[w,b]=d.useState(!1),S=Ae(c),E=ec(n),x=d.useRef(!1),[P,F]=d.useState(0);return d.useEffect(()=>{const O=m.current;if(O)return O.addEventListener(Ss,S),()=>O.removeEventListener(Ss,S)},[S]),l.jsx(Ym,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:h,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(Zl.div,{tabIndex:w||P===0?-1:0,"data-orientation":r,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:dn(e.onMouseDown,()=>{x.current=!0}),onFocus:dn(e.onFocus,O=>{const I=!x.current;if(O.target===O.currentTarget&&I&&!w){const D=new CustomEvent(Ss,Km);if(O.currentTarget.dispatchEvent(D),!D.defaultPrevented){const q=E().filter(B=>B.focusable),k=q.find(B=>B.active),z=q.find(B=>B.id===h),J=[k,z,...q].filter(Boolean).map(B=>B.ref.current);sc(J,f)}}x.current=!1}),onBlur:dn(e.onBlur,()=>b(!1))})})}),rc="RovingFocusGroupItem",oc=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...i}=e,a=on(),u=s||a,c=Zm(rc,n),f=c.currentTabStopId===u,p=ec(n),{onFocusableItemAdd:m,onFocusableItemRemove:g}=c;return d.useEffect(()=>{if(r)return m(),()=>g()},[r,m,g]),l.jsx(Es.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:l.jsx(Zl.span,{tabIndex:f?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:dn(e.onMouseDown,v=>{r?c.onItemFocus(u):v.preventDefault()}),onFocus:dn(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:dn(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const h=nv(v,c.orientation,c.dir);if(h!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let w=p().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?rv(w,b+1):w.slice(b+1)}setTimeout(()=>sc(w))}})})})});oc.displayName=rc;var ev={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tv(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function nv(e,t,n){const r=tv(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ev[r]}function sc(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function rv(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ov=nc,sv=oc;function ic(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function iv(...e){return t=>{let n=!1;const r=e.map(o=>{const s=ic(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():ic(e[o],null)}}}}function av(...e){return d.useCallback(iv(...e),e)}function lv(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var ac=e=>{const{present:t,children:n}=e,r=cv(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=av(r.ref,uv(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};ac.displayName="Presence";function cv(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=lv(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=_r(r.current);s.current=a==="mounted"?c:"none"},[a]),Re(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,g=_r(c);e?u("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Re(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,p=g=>{const h=_r(r.current).includes(g.animationName);if(g.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=g=>{g.target===t&&(s.current=_r(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function _r(e){return(e==null?void 0:e.animationName)||"none"}function uv(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function lc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function dv(...e){return t=>{let n=!1;const r=e.map(o=>{const s=lc(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():lc(e[o],null)}}}}var cc=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(Ns,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(Ns,{...r,ref:t,children:n})});cc.displayName="Slot";var Ns=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=hv(n);return d.cloneElement(n,{...gv(r,n.props),ref:t?dv(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});Ns.displayName="SlotClone";var fv=({children:e})=>l.jsx(l.Fragment,{children:e});function pv(e){return d.isValidElement(e)&&e.type===fv}function gv(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 hv(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 mv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Fr=mv.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?cc: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}},{}),Ts="Tabs",[vv,pC]=Ot(Ts,[tc]),uc=tc(),[yv,Ps]=vv(Ts),dc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:u="automatic",...c}=e,f=Ql(a),[p,m]=nn({prop:r,onChange:o,defaultProp:s});return l.jsx(yv,{scope:n,baseId:on(),value:p,onValueChange:m,orientation:i,dir:f,activationMode:u,children:l.jsx(Fr.div,{dir:f,"data-orientation":i,...c,ref:t})})});dc.displayName=Ts;var fc="TabsList",pc=d.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=Ps(fc,n),i=uc(n);return l.jsx(ov,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:l.jsx(Fr.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});pc.displayName=fc;var gc="TabsTrigger",hc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=Ps(gc,n),a=uc(n),u=yc(i.baseId,r),c=wc(i.baseId,r),f=r===i.value;return l.jsx(sv,{asChild:!0,...a,focusable:!o,active:f,children:l.jsx(Fr.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:vs(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?i.onValueChange(r):p.preventDefault()}),onKeyDown:vs(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&i.onValueChange(r)}),onFocus:vs(e.onFocus,()=>{const p=i.activationMode!=="manual";!f&&!o&&p&&i.onValueChange(r)})})})});hc.displayName=gc;var mc="TabsContent",vc=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=Ps(mc,n),u=yc(a.baseId,r),c=wc(a.baseId,r),f=r===a.value,p=d.useRef(f);return d.useEffect(()=>{const m=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(m)},[]),l.jsx(ac,{present:o||f,children:({present:m})=>l.jsx(Fr.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:p.current?"0s":void 0},children:m&&s})})});vc.displayName=mc;function yc(e,t){return`${e}-trigger-${t}`}function wc(e,t){return`${e}-content-${t}`}var wv=dc,bc=pc,xc=hc,Cc=vc;const bv=wv,Sc=d.forwardRef(({className:e,...t},n)=>l.jsx(bc,{ref:n,className:te("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Sc.displayName=bc.displayName;const Or=d.forwardRef(({className:e,...t},n)=>l.jsx(xc,{ref:n,className:te("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}));Or.displayName=xc.displayName;const Dr=d.forwardRef(({className:e,...t},n)=>l.jsx(Cc,{ref:n,className:te("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Dr.displayName=Cc.displayName;const In=d.forwardRef(({className:e,...t},n)=>l.jsx("textarea",{className:te("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}));In.displayName="Textarea";function xv(e,t=[]){let n=[];function r(s,i){const a=d.createContext(i),u=n.length;n=[...n,i];function c(p){const{scope:m,children:g,...v}=p,h=(m==null?void 0:m[e][u])||a,y=d.useMemo(()=>v,Object.values(v));return l.jsx(h.Provider,{value:y,children:g})}function f(p,m){const g=(m==null?void 0:m[e][u])||a,v=d.useContext(g);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${p}\` 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,Cv(o,...t)]}function Cv(...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 p=u(s)[`__scope${c}`];return{...a,...p}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var As=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Ev);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(_s,{...r,ref:t,children:d.isValidElement(i)?d.cloneElement(i,void 0,a):null})}return l.jsx(_s,{...r,ref:t,children:n})});As.displayName="Slot";var _s=d.forwardRef((e,t)=>{const{children:n,...r}=e;if(d.isValidElement(n)){const o=Tv(n);return d.cloneElement(n,{...Nv(r,n.props),ref:t?gr(t,o):o})}return d.Children.count(n)>1?d.Children.only(null):null});_s.displayName="SlotClone";var Sv=({children:e})=>l.jsx(l.Fragment,{children:e});function Ev(e){return d.isValidElement(e)&&e.type===Sv}function Nv(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 Tv(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 Pv(e){const t=e+"CollectionProvider",[n,r]=xv(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=g=>{const{scope:v,children:h}=g,y=A.useRef(null),w=A.useRef(new Map).current;return l.jsx(o,{scope:v,itemMap:w,collectionRef:y,children:h})};i.displayName=t;const a=e+"CollectionSlot",u=A.forwardRef((g,v)=>{const{scope:h,children:y}=g,w=s(a,h),b=ze(v,w.collectionRef);return l.jsx(As,{ref:b,children:y})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",p=A.forwardRef((g,v)=>{const{scope:h,children:y,...w}=g,b=A.useRef(null),S=ze(v,b),E=s(c,h);return A.useEffect(()=>(E.itemMap.set(b,{ref:b,...w}),()=>void E.itemMap.delete(b))),l.jsx(As,{[f]:"",ref:S,children:y})});p.displayName=c;function m(g){const v=s(e+"CollectionConsumer",g);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:p},m,r]}var Av="VisuallyHidden",Fs=d.forwardRef((e,t)=>l.jsx(be.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}}));Fs.displayName=Av;var Os="ToastProvider",[Ds,_v,Fv]=Pv("Toast"),[Ec,gC]=Ot("Toast",[Fv]),[Ov,Mr]=Ec(Os),Nc=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),p=d.useRef(!1),m=d.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Os}\`. Expected non-empty \`string\`.`),l.jsx(Ds.Provider,{scope:t,children:l.jsx(Ov,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:s,toastCount:c,viewport:a,onViewportChange:u,onToastAdd:d.useCallback(()=>f(g=>g+1),[]),onToastRemove:d.useCallback(()=>f(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:m,children:i})})};Nc.displayName=Os;var Tc="ToastViewport",Dv=["F8"],Ms="toast.viewportPause",Is="toast.viewportResume",Pc=d.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=Dv,label:o="Notifications ({hotkey})",...s}=e,i=Mr(Tc,n),a=_v(n),u=d.useRef(null),c=d.useRef(null),f=d.useRef(null),p=d.useRef(null),m=ze(t,p,i.onViewportChange),g=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=p.current)==null||S.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),d.useEffect(()=>{const y=u.current,w=p.current;if(v&&y&&w){const b=()=>{if(!i.isClosePausedRef.current){const P=new CustomEvent(Ms);w.dispatchEvent(P),i.isClosePausedRef.current=!0}},S=()=>{if(i.isClosePausedRef.current){const P=new CustomEvent(Is);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 h=d.useCallback(({tabbingDirection:y})=>{const b=a().map(S=>{const E=S.ref.current,x=[E,...Wv(E)];return y==="forwards"?x:x.reverse()});return(y==="forwards"?b.reverse():b).flat()},[a]);return d.useEffect(()=>{const y=p.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,I=b.shiftKey;if(b.target===y&&I){(x=c.current)==null||x.focus();return}const k=h({tabbingDirection:I?"backwards":"forwards"}),z=k.findIndex(R=>R===O);Ls(k.slice(z+1))?b.preventDefault():I?(P=c.current)==null||P.focus():(F=f.current)==null||F.focus()}};return y.addEventListener("keydown",w),()=>y.removeEventListener("keydown",w)}},[a,h]),l.jsxs(xh,{ref:u,role:"region","aria-label":o.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&l.jsx(ks,{ref:c,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"forwards"});Ls(y)}}),l.jsx(Ds.Slot,{scope:n,children:l.jsx(be.ol,{tabIndex:-1,...s,ref:m})}),v&&l.jsx(ks,{ref:f,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"backwards"});Ls(y)}})]})});Pc.displayName=Tc;var Ac="ToastFocusProxy",ks=d.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,s=Mr(Ac,n);return l.jsx(Fs,{"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()}})});ks.displayName=Ac;var Ir="Toast",Mv="toast.swipeStart",Iv="toast.swipeMove",kv="toast.swipeCancel",$v="toast.swipeEnd",_c=d.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:s,...i}=e,[a=!0,u]=nn({prop:r,defaultProp:o,onChange:s});return l.jsx(rn,{present:n||a,children:l.jsx(Vv,{open:a,...i,ref:t,onClose:()=>u(!1),onPause:Ae(e.onPause),onResume:Ae(e.onResume),onSwipeStart:we(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:we(e.onSwipeMove,c=>{const{x:f,y:p}=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",`${p}px`)}),onSwipeCancel:we(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:we(e.onSwipeEnd,c=>{const{x:f,y:p}=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",`${p}px`),u(!1)})})})});_c.displayName=Ir;var[Lv,Rv]=Ec(Ir,{onClose(){}}),Vv=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:p,onSwipeCancel:m,onSwipeEnd:g,...v}=e,h=Mr(Ir,n),[y,w]=d.useState(null),b=ze(t,R=>w(R)),S=d.useRef(null),E=d.useRef(null),x=o||h.duration,P=d.useRef(0),F=d.useRef(x),O=d.useRef(0),{onToastAdd:I,onToastRemove:D}=h,q=Ae(()=>{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(O.current),P.current=new Date().getTime(),O.current=window.setTimeout(q,R))},[q]);d.useEffect(()=>{const R=h.viewport;if(R){const J=()=>{k(F.current),c==null||c()},B=()=>{const U=new Date().getTime()-P.current;F.current=F.current-U,window.clearTimeout(O.current),u==null||u()};return R.addEventListener(Ms,B),R.addEventListener(Is,J),()=>{R.removeEventListener(Ms,B),R.removeEventListener(Is,J)}}},[h.viewport,x,u,c,k]),d.useEffect(()=>{s&&!h.isClosePausedRef.current&&k(x)},[s,x,h.isClosePausedRef,k]),d.useEffect(()=>(I(),()=>D()),[I,D]);const z=d.useMemo(()=>y?$c(y):null,[y]);return h.viewport?l.jsxs(l.Fragment,{children:[z&&l.jsx(Bv,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:z}),l.jsx(Lv,{scope:n,onClose:q,children:Yn.createPortal(l.jsx(Ds.ItemSlot,{scope:n,children:l.jsx(bh,{asChild:!0,onEscapeKeyDown:we(a,()=>{h.isFocusedToastEscapeKeyDownRef.current||q(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(be.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:we(e.onKeyDown,R=>{R.key==="Escape"&&(a==null||a(R.nativeEvent),R.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,q()))}),onPointerDown:we(e.onPointerDown,R=>{R.button===0&&(S.current={x:R.clientX,y:R.clientY})}),onPointerMove:we(e.onPointerMove,R=>{if(!S.current)return;const J=R.clientX-S.current.x,B=R.clientY-S.current.y,U=!!E.current,K=["left","right"].includes(h.swipeDirection),Y=["left","up"].includes(h.swipeDirection)?Math.min:Math.max,le=K?Y(0,J):0,ue=K?0:Y(0,B),Ee=R.pointerType==="touch"?10:2,Ie={x:le,y:ue},Ue={originalEvent:R,delta:Ie};U?(E.current=Ie,kr(Iv,p,Ue,{discrete:!1})):Lc(Ie,h.swipeDirection,Ee)?(E.current=Ie,kr(Mv,f,Ue,{discrete:!1}),R.target.setPointerCapture(R.pointerId)):(Math.abs(J)>Ee||Math.abs(B)>Ee)&&(S.current=null)}),onPointerUp:we(e.onPointerUp,R=>{const J=E.current,B=R.target;if(B.hasPointerCapture(R.pointerId)&&B.releasePointerCapture(R.pointerId),E.current=null,S.current=null,J){const U=R.currentTarget,K={originalEvent:R,delta:J};Lc(J,h.swipeDirection,h.swipeThreshold)?kr($v,g,K,{discrete:!0}):kr(kv,m,K,{discrete:!0}),U.addEventListener("click",Y=>Y.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),Bv=e=>{const{__scopeToast:t,children:n,...r}=e,o=Mr(Ir,t),[s,i]=d.useState(!1),[a,u]=d.useState(!1);return Uv(()=>i(!0)),d.useEffect(()=>{const c=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:l.jsx(ss,{asChild:!0,children:l.jsx(Fs,{...r,children:s&&l.jsxs(l.Fragment,{children:[o.label," ",n]})})})},zv="ToastTitle",Fc=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(be.div,{...r,ref:t})});Fc.displayName=zv;var Hv="ToastDescription",Oc=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(be.div,{...r,ref:t})});Oc.displayName=Hv;var Dc="ToastAction",Mc=d.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?l.jsx(kc,{altText:n,asChild:!0,children:l.jsx($s,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Dc}\`. Expected non-empty \`string\`.`),null)});Mc.displayName=Dc;var Ic="ToastClose",$s=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=Rv(Ic,n);return l.jsx(kc,{asChild:!0,children:l.jsx(be.button,{type:"button",...r,ref:t,onClick:we(e.onClick,o.onClose)})})});$s.displayName=Ic;var kc=d.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return l.jsx(be.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function $c(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),jv(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(...$c(r))}}),t}function kr(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?Wa(o,s):o.dispatchEvent(s)}var Lc=(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 Uv(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 jv(e){return e.nodeType===e.ELEMENT_NODE}function Wv(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 Ls(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var Gv=Nc,Rc=Pc,Vc=_c,Bc=Fc,zc=Oc,Hc=Mc,Uc=$s;const qv=Gv,jc=d.forwardRef(({className:e,...t},n)=>l.jsx(Rc,{ref:n,className:te("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}));jc.displayName=Rc.displayName;const Kv=Yo("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"}}),Wc=d.forwardRef(({className:e,variant:t,...n},r)=>l.jsx(Vc,{ref:r,className:te(Kv({variant:t}),e),...n}));Wc.displayName=Vc.displayName;const Xv=d.forwardRef(({className:e,...t},n)=>l.jsx(Hc,{ref:n,className:te("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}));Xv.displayName=Hc.displayName;const Gc=d.forwardRef(({className:e,...t},n)=>l.jsx(Uc,{ref:n,className:te("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(Uo,{className:"s3-explr-ui-toast-close-icon h-4 w-4"})}));Gc.displayName=Uc.displayName;const qc=d.forwardRef(({className:e,...t},n)=>l.jsx(Bc,{ref:n,className:te("s3-explr-ui-toast-title text-sm font-semibold [&+div]:text-xs",e),...t}));qc.displayName=Bc.displayName;const Kc=d.forwardRef(({className:e,...t},n)=>l.jsx(zc,{ref:n,className:te("s3-explr-ui-toast-description text-sm opacity-90",e),...t}));Kc.displayName=zc.displayName;const Jv=1,Yv=1e6;let Rs=0;function Zv(){return Rs=(Rs+1)%Number.MAX_SAFE_INTEGER,Rs.toString()}const Vs=new Map,Xc=e=>{if(Vs.has(e))return;const t=setTimeout(()=>{Vs.delete(e),kn({type:"REMOVE_TOAST",toastId:e})},Yv);Vs.set(e,t)},Qv=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Jv)};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?Xc(n):e.toasts.forEach(r=>{Xc(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)}}},$r=[];let Lr={toasts:[]};function kn(e){Lr=Qv(Lr,e),$r.forEach(t=>{t(Lr)})}function ey({...e}){const t=Zv(),n=o=>kn({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>kn({type:"DISMISS_TOAST",toastId:t});return kn({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function Rr(){const[e,t]=d.useState(Lr);return d.useEffect(()=>($r.push(t),()=>{const n=$r.indexOf(t);n>-1&&$r.splice(n,1)}),[e]),{...e,toast:ey,dismiss:n=>kn({type:"DISMISS_TOAST",toastId:n})}}function Jc(){const{toasts:e}=Rr();return l.jsxs(qv,{children:[e.map(function({id:t,title:n,description:r,action:o,...s}){return l.jsxs(Wc,{...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(qc,{className:"s3-explr-ui-toast-title",children:n}),r&&l.jsx(Kc,{className:"s3-explr-ui-toast-description",children:r})]}),o&&l.jsx("div",{className:"s3-explr-ui-toast-action",children:o}),l.jsx(Gc,{className:"s3-explr-ui-toast-close"})]},t)}),l.jsx(jc,{className:"s3-explr-ui-toast-viewport"})]})}function bt(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 Yc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ty(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Yc(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():Yc(e[o],null)}}}}function $n(...e){return d.useCallback(ty(...e),e)}var ny=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ln=ny.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Qt: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 ry(e,t){e&&Yn.flushSync(()=>e.dispatchEvent(t))}var oy="DismissableLayer",Bs="dismissableLayer.update",sy="dismissableLayer.pointerDownOutside",iy="dismissableLayer.focusOutside",Zc,Qc=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),eu=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,c=d.useContext(Qc),[f,p]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=d.useState({}),v=$n(t,F=>p(F)),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=cy(F=>{const O=F.target,I=[...c.branches].some(D=>D.contains(O));!E||I||(o==null||o(F),i==null||i(F),F.defaultPrevented||a==null||a())},m),P=uy(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())},m);return Ya(F=>{b===c.layers.size-1&&(r==null||r(F),!F.defaultPrevented&&a&&(F.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Zc=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),tu(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Zc)}},[f,m,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),tu())},[f,c]),d.useEffect(()=>{const F=()=>g({});return document.addEventListener(Bs,F),()=>document.removeEventListener(Bs,F)},[]),l.jsx(Ln.div,{...u,ref:v,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:bt(e.onFocusCapture,P.onFocusCapture),onBlurCapture:bt(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:bt(e.onPointerDownCapture,x.onPointerDownCapture)})});eu.displayName=oy;var ay="DismissableLayerBranch",ly=d.forwardRef((e,t)=>{const n=d.useContext(Qc),r=d.useRef(null),o=$n(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(Ln.div,{...e,ref:o})});ly.displayName=ay;function cy(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(){nu(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 uy(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&&nu(iy,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 tu(){const e=new CustomEvent(Bs);document.dispatchEvent(e)}function nu(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?ry(o,s):o.dispatchEvent(s)}const dy=["top","right","bottom","left"],$t=Math.min,Ve=Math.max,Vr=Math.round,Br=Math.floor,it=e=>({x:e,y:e}),fy={left:"right",right:"left",bottom:"top",top:"bottom"},py={start:"end",end:"start"};function zs(e,t,n){return Ve(e,$t(t,n))}function xt(e,t){return typeof e=="function"?e(t):e}function Ct(e){return e.split("-")[0]}function fn(e){return e.split("-")[1]}function Hs(e){return e==="x"?"y":"x"}function Us(e){return e==="y"?"height":"width"}function Lt(e){return["top","bottom"].includes(Ct(e))?"y":"x"}function js(e){return Hs(Lt(e))}function gy(e,t,n){n===void 0&&(n=!1);const r=fn(e),o=js(e),s=Us(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=zr(i)),[i,zr(i)]}function hy(e){const t=zr(e);return[Ws(e),t,Ws(t)]}function Ws(e){return e.replace(/start|end/g,t=>py[t])}function my(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 vy(e,t,n,r){const o=fn(e);let s=my(Ct(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Ws)))),s}function zr(e){return e.replace(/left|right|bottom|top/g,t=>fy[t])}function yy(e){return{top:0,right:0,bottom:0,left:0,...e}}function ru(e){return typeof e!="number"?yy(e):{top:e,right:e,bottom:e,left:e}}function Hr(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 ou(e,t,n){let{reference:r,floating:o}=e;const s=Lt(t),i=js(t),a=Us(i),u=Ct(t),c=s==="y",f=r.x+r.width/2-o.width/2,p=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let g;switch(u){case"top":g={x:f,y:r.y-o.height};break;case"bottom":g={x:f,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:p};break;case"left":g={x:r.x-o.width,y:p};break;default:g={x:r.x,y:r.y}}switch(fn(t)){case"start":g[i]-=m*(n&&c?-1:1);break;case"end":g[i]+=m*(n&&c?-1:1);break}return g}const wy=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:p}=ou(c,r,u),m=r,g={},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:p,initialPlacement:r,placement:m,strategy:o,middlewareData:g,rects:c,platform:i,elements:{reference:e,floating:t}});f=b??f,p=S??p,g={...g,[y]:{...g[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:p}=ou(c,m,u)),h=-1)}return{x:f,y:p,placement:m,strategy:o,middlewareData:g}};async function Rn(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:p="floating",altBoundary:m=!1,padding:g=0}=xt(t,e),v=ru(g),y=a[m?p==="floating"?"reference":"floating":p],w=Hr(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=p==="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=Hr(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 by=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}=xt(e,t)||{};if(c==null)return{};const p=ru(f),m={x:n,y:r},g=js(o),v=Us(g),h=await i.getDimensions(c),y=g==="y",w=y?"top":"left",b=y?"bottom":"right",S=y?"clientHeight":"clientWidth",E=s.reference[v]+s.reference[g]-m[g]-s.floating[v],x=m[g]-s.reference[g],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,I=F/2-h[v]/2-1,D=$t(p[w],I),q=$t(p[b],I),k=D,z=F-h[v]-q,R=F/2-h[v]/2+O,J=zs(k,R,z),B=!u.arrow&&fn(o)!=null&&R!==J&&s.reference[v]/2-(R<k?D:q)-h[v]/2<0,U=B?R<k?R-k:R-z:0;return{[g]:m[g]+U,data:{[g]:J,centerOffset:R-J-U,...B&&{alignmentOffset:U}},reset:B}}}),xy=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:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:h=!0,...y}=xt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=Ct(o),b=Lt(a),S=Ct(a)===a,E=await(u.isRTL==null?void 0:u.isRTL(c.floating)),x=m||(S||!h?[zr(a)]:hy(a)),P=v!=="none";!m&&P&&x.push(...vy(a,h,v,E));const F=[a,...x],O=await Rn(t,y),I=[];let D=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&I.push(O[w]),p){const R=gy(o,i,E);I.push(O[R[0]],O[R[1]])}if(D=[...D,{placement:o,overflows:I}],!I.every(R=>R<=0)){var q,k;const R=(((q=s.flip)==null?void 0:q.index)||0)+1,J=F[R];if(J)return{data:{index:R,overflows:D},reset:{placement:J}};let B=(k=D.filter(U=>U.overflows[0]<=0).sort((U,K)=>U.overflows[1]-K.overflows[1])[0])==null?void 0:k.placement;if(!B)switch(g){case"bestFit":{var z;const U=(z=D.filter(K=>{if(P){const Y=Lt(K.placement);return Y===b||Y==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(Y=>Y>0).reduce((Y,le)=>Y+le,0)]).sort((K,Y)=>K[1]-Y[1])[0])==null?void 0:z[0];U&&(B=U);break}case"initialPlacement":B=a;break}if(o!==B)return{reset:{placement:B}}}return{}}}};function su(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function iu(e){return dy.some(t=>e[t]>=0)}const Cy=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=xt(e,t);switch(r){case"referenceHidden":{const s=await Rn(t,{...o,elementContext:"reference"}),i=su(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:iu(i)}}}case"escaped":{const s=await Rn(t,{...o,altBoundary:!0}),i=su(s,n.floating);return{data:{escapedOffsets:i,escaped:iu(i)}}}default:return{}}}}};async function Sy(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Ct(n),a=fn(n),u=Lt(n)==="y",c=["left","top"].includes(i)?-1:1,f=s&&u?-1:1,p=xt(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:v}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return a&&typeof v=="number"&&(g=a==="end"?v*-1:v),u?{x:g*f,y:m*c}:{x:m*c,y:g*f}}const Ey=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 Sy(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}}}}},Ny=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}=xt(e,t),c={x:n,y:r},f=await Rn(t,u),p=Lt(Ct(o)),m=Hs(p);let g=c[m],v=c[p];if(s){const y=m==="y"?"top":"left",w=m==="y"?"bottom":"right",b=g+f[y],S=g-f[w];g=zs(b,g,S)}if(i){const y=p==="y"?"top":"left",w=p==="y"?"bottom":"right",b=v+f[y],S=v-f[w];v=zs(b,v,S)}const h=a.fn({...t,[m]:g,[p]:v});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[m]:s,[p]:i}}}}}},Ty=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}=xt(e,t),f={x:n,y:r},p=Lt(o),m=Hs(p);let g=f[m],v=f[p];const h=xt(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;g<E?g=E:g>x&&(g=x)}if(c){var w,b;const S=m==="y"?"width":"height",E=["top","left"].includes(Ct(o)),x=s.reference[p]-s.floating[S]+(E&&((w=i.offset)==null?void 0:w[p])||0)+(E?0:y.crossAxis),P=s.reference[p]+s.reference[S]+(E?0:((b=i.offset)==null?void 0:b[p])||0)-(E?y.crossAxis:0);v<x?v=x:v>P&&(v=P)}return{[m]:g,[p]:v}}}},Py=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}=xt(e,t),f=await Rn(t,c),p=Ct(o),m=fn(o),g=Lt(o)==="y",{width:v,height:h}=s.floating;let y,w;p==="top"||p==="bottom"?(y=p,w=m===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(w=p,y=m==="end"?"top":"bottom");const b=h-f.top-f.bottom,S=v-f.left-f.right,E=$t(h-f[y],b),x=$t(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&&!m){const D=Ve(f.left,0),q=Ve(f.right,0),k=Ve(f.top,0),z=Ve(f.bottom,0);g?O=v-2*(D!==0||q!==0?D+q:Ve(f.left,f.right)):F=h-2*(k!==0||z!==0?k+z:Ve(f.top,f.bottom))}await u({...t,availableWidth:O,availableHeight:F});const I=await i.getDimensions(a.floating);return v!==I.width||h!==I.height?{reset:{rects:!0}}:{}}}};function Ur(){return typeof window<"u"}function pn(e){return au(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=(au(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function au(e){return Ur()?e instanceof Node||e instanceof Be(e).Node:!1}function Ze(e){return Ur()?e instanceof Element||e instanceof Be(e).Element:!1}function lt(e){return Ur()?e instanceof HTMLElement||e instanceof Be(e).HTMLElement:!1}function lu(e){return!Ur()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Be(e).ShadowRoot}function Vn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Qe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Ay(e){return["table","td","th"].includes(pn(e))}function jr(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Gs(e){const t=qs(),n=Ze(e)?Qe(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 _y(e){let t=Rt(e);for(;lt(t)&&!gn(t);){if(Gs(t))return t;if(jr(t))return null;t=Rt(t)}return null}function qs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function gn(e){return["html","body","#document"].includes(pn(e))}function Qe(e){return Be(e).getComputedStyle(e)}function Wr(e){return Ze(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Rt(e){if(pn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||lu(e)&&e.host||at(e);return lu(t)?t.host:t}function cu(e){const t=Rt(e);return gn(t)?e.ownerDocument?e.ownerDocument.body:e.body:lt(t)&&Vn(t)?t:cu(t)}function Bn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=cu(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Be(o);if(s){const a=Ks(i);return t.concat(i,i.visualViewport||[],Vn(o)?o:[],a&&n?Bn(a):[])}return t.concat(o,Bn(o,[],n))}function Ks(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function uu(e){const t=Qe(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=Vr(n)!==s||Vr(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Xs(e){return Ze(e)?e:e.contextElement}function hn(e){const t=Xs(e);if(!lt(t))return it(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=uu(t);let i=(s?Vr(n.width):n.width)/r,a=(s?Vr(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Fy=it(0);function du(e){const t=Be(e);return!qs()||!t.visualViewport?Fy:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Oy(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=Xs(e);let i=it(1);t&&(r?Ze(r)&&(i=hn(r)):i=hn(e));const a=Oy(s,n,r)?du(s):it(0);let u=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,f=o.width/i.x,p=o.height/i.y;if(s){const m=Be(s),g=r&&Ze(r)?Be(r):r;let v=m,h=Ks(v);for(;h&&r&&g!==v;){const y=hn(h),w=h.getBoundingClientRect(),b=Qe(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,p*=y.y,u+=S,c+=E,v=Be(h),h=Ks(v)}}return Hr({width:f,height:p,x:u,y:c})}function Js(e,t){const n=Wr(e).scrollLeft;return t?t.left+n:Gt(at(e)).left+n}function fu(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Js(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function Dy(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=at(r),a=t?jr(t.floating):!1;if(r===i||a&&s)return n;let u={scrollLeft:0,scrollTop:0},c=it(1);const f=it(0),p=lt(r);if((p||!p&&!s)&&((pn(r)!=="body"||Vn(i))&&(u=Wr(r)),lt(r))){const g=Gt(r);c=hn(r),f.x=g.x+r.clientLeft,f.y=g.y+r.clientTop}const m=i&&!p&&!s?fu(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+m.x,y:n.y*c.y-u.scrollTop*c.y+f.y+m.y}}function My(e){return Array.from(e.getClientRects())}function Iy(e){const t=at(e),n=Wr(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+Js(e);const a=-n.scrollTop;return Qe(r).direction==="rtl"&&(i+=Ve(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function ky(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=qs();(!c||c&&t==="fixed")&&(a=o.offsetLeft,u=o.offsetTop)}return{width:s,height:i,x:a,y:u}}function $y(e,t){const n=Gt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=lt(e)?hn(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 pu(e,t,n){let r;if(t==="viewport")r=ky(e,n);else if(t==="document")r=Iy(at(e));else if(Ze(t))r=$y(t,n);else{const o=du(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Hr(r)}function gu(e,t){const n=Rt(e);return n===t||!Ze(n)||gn(n)?!1:Qe(n).position==="fixed"||gu(n,t)}function Ly(e,t){const n=t.get(e);if(n)return n;let r=Bn(e,[],!1).filter(a=>Ze(a)&&pn(a)!=="body"),o=null;const s=Qe(e).position==="fixed";let i=s?Rt(e):e;for(;Ze(i)&&!gn(i);){const a=Qe(i),u=Gs(i);!u&&a.position==="fixed"&&(o=null),(s?!u&&!o:!u&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Vn(i)&&!u&&gu(e,i))?r=r.filter(f=>f!==i):o=a,i=Rt(i)}return t.set(e,r),r}function Ry(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?jr(t)?[]:Ly(t,this._c):[].concat(n),r],a=i[0],u=i.reduce((c,f)=>{const p=pu(t,f,o);return c.top=Ve(p.top,c.top),c.right=$t(p.right,c.right),c.bottom=$t(p.bottom,c.bottom),c.left=Ve(p.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 Vy(e){const{width:t,height:n}=uu(e);return{width:t,height:n}}function By(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((pn(t)!=="body"||Vn(o))&&(a=Wr(t)),r){const m=Gt(t,!0,s,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else o&&(u.x=Js(o));const c=o&&!r&&!s?fu(o,a):it(0),f=i.left+a.scrollLeft-u.x-c.x,p=i.top+a.scrollTop-u.y-c.y;return{x:f,y:p,width:i.width,height:i.height}}function Ys(e){return Qe(e).position==="static"}function hu(e,t){if(!lt(e)||Qe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return at(e)===n&&(n=n.ownerDocument.body),n}function mu(e,t){const n=Be(e);if(jr(e))return n;if(!lt(e)){let o=Rt(e);for(;o&&!gn(o);){if(Ze(o)&&!Ys(o))return o;o=Rt(o)}return n}let r=hu(e,t);for(;r&&Ay(r)&&Ys(r);)r=hu(r,t);return r&&gn(r)&&Ys(r)&&!Gs(r)?n:r||_y(e)||n}const zy=async function(e){const t=this.getOffsetParent||mu,n=this.getDimensions,r=await n(e.floating);return{reference:By(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Hy(e){return Qe(e).direction==="rtl"}const Uy={convertOffsetParentRelativeRectToViewportRelativeRect:Dy,getDocumentElement:at,getClippingRect:Ry,getOffsetParent:mu,getElementRects:zy,getClientRects:My,getDimensions:Vy,getScale:hn,isElement:Ze,isRTL:Hy};function jy(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:p,height:m}=e.getBoundingClientRect();if(a||t(),!p||!m)return;const g=Br(f),v=Br(o.clientWidth-(c+p)),h=Br(o.clientHeight-(f+m)),y=Br(c),b={rootMargin:-g+"px "+-v+"px "+-h+"px "+-y+"px",threshold:Ve(0,$t(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 Wy(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=Xs(e),f=o||s?[...c?Bn(c):[],...Bn(t)]:[];f.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const p=c&&a?jy(c,n):null;let m=-1,g=null;i&&(g=new ResizeObserver(w=>{let[b]=w;b&&b.target===c&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var S;(S=g)==null||S.observe(t)})),n()}),c&&!u&&g.observe(c),g.observe(t));let v,h=u?Gt(e):null;u&&y();function y(){const w=Gt(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)}),p==null||p(),(w=g)==null||w.disconnect(),g=null,u&&cancelAnimationFrame(v)}}const Gy=Ey,qy=Ny,Ky=xy,Xy=Py,Jy=Cy,vu=by,Yy=Ty,Zy=(e,t,n)=>{const r=new Map,o={platform:Uy,...n},s={...o.platform,_c:r};return wy(e,t,{...o,platform:s})};var Gr=typeof document<"u"?A.useLayoutEffect:A.useEffect;function qr(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(!qr(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)&&!qr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function yu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function wu(e,t){const n=yu(e);return Math.round(t*n)/n}function Zs(e){const t=d.useRef(e);return Gr(()=>{t.current=e}),t}function Qy(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,p]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=d.useState(r);qr(m,r)||g(r);const[v,h]=d.useState(null),[y,w]=d.useState(null),b=d.useCallback(K=>{K!==P.current&&(P.current=K,h(K))},[]),S=d.useCallback(K=>{K!==F.current&&(F.current=K,w(K))},[]),E=s||v,x=i||y,P=d.useRef(null),F=d.useRef(null),O=d.useRef(f),I=u!=null,D=Zs(u),q=Zs(o),k=Zs(c),z=d.useCallback(()=>{if(!P.current||!F.current)return;const K={placement:t,strategy:n,middleware:m};q.current&&(K.platform=q.current),Zy(P.current,F.current,K).then(Y=>{const le={...Y,isPositioned:k.current!==!1};R.current&&!qr(O.current,le)&&(O.current=le,Yn.flushSync(()=>{p(le)}))})},[m,t,n,q,k]);Gr(()=>{c===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,p(K=>({...K,isPositioned:!1})))},[c]);const R=d.useRef(!1);Gr(()=>(R.current=!0,()=>{R.current=!1}),[]),Gr(()=>{if(E&&(P.current=E),x&&(F.current=x),E&&x){if(D.current)return D.current(E,x,z);z()}},[E,x,z,D,I]);const J=d.useMemo(()=>({reference:P,floating:F,setReference:b,setFloating:S}),[b,S]),B=d.useMemo(()=>({reference:E,floating:x}),[E,x]),U=d.useMemo(()=>{const K={position:n,left:0,top:0};if(!B.floating)return K;const Y=wu(B.floating,f.x),le=wu(B.floating,f.y);return a?{...K,transform:"translate("+Y+"px, "+le+"px)",...yu(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:le}},[n,a,B.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:z,refs:J,elements:B,floatingStyles:U}),[f,z,J,B,U])}const ew=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?vu({element:r.current,padding:o}).fn(n):{}:r?vu({element:r,padding:o}).fn(n):{}}}},tw=(e,t)=>({...Gy(e),options:[e,t]}),nw=(e,t)=>({...qy(e),options:[e,t]}),rw=(e,t)=>({...Yy(e),options:[e,t]}),ow=(e,t)=>({...Ky(e),options:[e,t]}),sw=(e,t)=>({...Xy(e),options:[e,t]}),iw=(e,t)=>({...Jy(e),options:[e,t]}),aw=(e,t)=>({...ew(e),options:[e,t]});var lw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],cw=lw.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Qt: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}},{}),uw="Arrow",bu=d.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return l.jsx(cw.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"})})});bu.displayName=uw;var dw=bu;function xu(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=xu(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():xu(e[o],null)}}}}function Cu(...e){return d.useCallback(fw(...e),e)}var pw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Su=pw.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,a=s?Qt: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}},{}),Qs="Popper",[Eu,Nu]=Ot(Qs),[gw,Tu]=Eu(Qs),Pu=e=>{const{__scopePopper:t,children:n}=e,[r,o]=d.useState(null);return l.jsx(gw,{scope:t,anchor:r,onAnchorChange:o,children:n})};Pu.displayName=Qs;var Au="PopperAnchor",_u=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Tu(Au,n),i=d.useRef(null),a=Cu(t,i);return d.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:l.jsx(Su.div,{...o,ref:a})});_u.displayName=Au;var ei="PopperContent",[hw,mw]=Eu(ei),Fu=d.forwardRef((e,t)=>{var Ce,tt,je,nt,ft,Xt;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:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:v,...h}=e,y=Tu(ei,n),[w,b]=d.useState(null),S=Cu(t,Pe=>b(Pe)),[E,x]=d.useState(null),P=Ua(E),F=(P==null?void 0:P.width)??0,O=(P==null?void 0:P.height)??0,I=r+(s!=="center"?"-"+s:""),D=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},q=Array.isArray(c)?c:[c],k=q.length>0,z={padding:D,boundary:q.filter(yw),altBoundary:k},{refs:R,floatingStyles:J,placement:B,isPositioned:U,middlewareData:K}=Qy({strategy:"fixed",placement:I,whileElementsMounted:(...Pe)=>Wy(...Pe,{animationFrame:g==="always"}),elements:{reference:y.anchor},middleware:[tw({mainAxis:o+O,alignmentAxis:i}),u&&nw({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?rw():void 0,...z}),u&&ow({...z}),sw({...z,apply:({elements:Pe,rects:pt,availableWidth:Cn,availableHeight:Bt})=>{const{width:io,height:C}=pt.reference,N=Pe.floating.style;N.setProperty("--radix-popper-available-width",`${Cn}px`),N.setProperty("--radix-popper-available-height",`${Bt}px`),N.setProperty("--radix-popper-anchor-width",`${io}px`),N.setProperty("--radix-popper-anchor-height",`${C}px`)}}),E&&aw({element:E,padding:a}),ww({arrowWidth:F,arrowHeight:O}),m&&iw({strategy:"referenceHidden",...z})]}),[Y,le]=Mu(B),ue=Ae(v);Re(()=>{U&&(ue==null||ue())},[U,ue]);const Ee=(Ce=K.arrow)==null?void 0:Ce.x,Ie=(tt=K.arrow)==null?void 0:tt.y,Ue=((je=K.arrow)==null?void 0:je.centerOffset)!==0,[Nt,Se]=d.useState();return Re(()=>{w&&Se(window.getComputedStyle(w).zIndex)},[w]),l.jsx("div",{ref:R.setFloating,"data-radix-popper-content-wrapper":"",style:{...J,transform:U?J.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Nt,"--radix-popper-transform-origin":[(nt=K.transformOrigin)==null?void 0:nt.x,(ft=K.transformOrigin)==null?void 0:ft.y].join(" "),...((Xt=K.hide)==null?void 0:Xt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(hw,{scope:n,placedSide:Y,onArrowChange:x,arrowX:Ee,arrowY:Ie,shouldHideArrow:Ue,children:l.jsx(Su.div,{"data-side":Y,"data-align":le,...h,ref:S,style:{...h.style,animation:U?void 0:"none"}})})})});Fu.displayName=ei;var Ou="PopperArrow",vw={top:"bottom",right:"left",bottom:"top",left:"right"},Du=d.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=mw(Ou,r),i=vw[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(dw,{...o,ref:n,style:{...o.style,display:"block"}})})});Du.displayName=Ou;function yw(e){return e!==null}var ww=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]=Mu(n),p={start:"0%",center:"50%",end:"100%"}[f],m=(((w=o.arrow)==null?void 0:w.x)??0)+a/2,g=(((b=o.arrow)==null?void 0:b.y)??0)+u/2;let v="",h="";return c==="bottom"?(v=i?p:`${m}px`,h=`${-u}px`):c==="top"?(v=i?p:`${m}px`,h=`${r.floating.height+u}px`):c==="right"?(v=`${-u}px`,h=i?p:`${g}px`):c==="left"&&(v=`${r.floating.width+u}px`,h=i?p:`${g}px`),{data:{x:v,y:h}}}});function Mu(e){const[t,n="center"]=e.split("-");return[t,n]}var bw=Pu,xw=_u,Cw=Fu,Sw=Du,Ew="Portal",Iu=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?uo.createPortal(l.jsx(Ln.div,{...r,ref:t}),i):null});Iu.displayName=Ew;function Nw(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var ti=e=>{const{present:t,children:n}=e,r=Tw(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=$n(r.ref,Pw(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};ti.displayName="Presence";function Tw(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,u]=Nw(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=Kr(r.current);s.current=a==="mounted"?c:"none"},[a]),Re(()=>{const c=r.current,f=o.current;if(f!==e){const m=s.current,g=Kr(c);e?u("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Re(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,p=g=>{const h=Kr(r.current).includes(g.animationName);if(g.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=g=>{g.target===t&&(s.current=Kr(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Kr(e){return(e==null?void 0:e.animationName)||"none"}function Pw(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 Aw="VisuallyHidden",ku=d.forwardRef((e,t)=>l.jsx(Ln.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}}));ku.displayName=Aw;var _w=ku,[Xr,hC]=Ot("Tooltip",[Nu]),Jr=Nu(),$u="TooltipProvider",Fw=700,ni="tooltip.open",[Ow,ri]=Xr($u),Lu=e=>{const{__scopeTooltip:t,delayDuration:n=Fw,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(Ow,{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})};Lu.displayName=$u;var Yr="Tooltip",[Dw,zn]=Xr(Yr),Ru=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,u=ri(Yr,e.__scopeTooltip),c=Jr(t),[f,p]=d.useState(null),m=on(),g=d.useRef(0),v=i??u.disableHoverableContent,h=a??u.delayDuration,y=d.useRef(!1),[w=!1,b]=nn({prop:r,defaultProp:o,onChange:F=>{F?(u.onOpen(),document.dispatchEvent(new CustomEvent(ni))):u.onClose(),s==null||s(F)}}),S=d.useMemo(()=>w?y.current?"delayed-open":"instant-open":"closed",[w]),E=d.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,b(!0)},[b]),x=d.useCallback(()=>{window.clearTimeout(g.current),g.current=0,b(!1)},[b]),P=d.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,b(!0),g.current=0},h)},[h,b]);return d.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),l.jsx(bw,{...c,children:l.jsx(Dw,{scope:t,contentId:m,open:w,stateAttribute:S,trigger:f,onTriggerChange:p,onTriggerEnter:d.useCallback(()=>{u.isOpenDelayed?P():E()},[u.isOpenDelayed,P,E]),onTriggerLeave:d.useCallback(()=>{v?x():(window.clearTimeout(g.current),g.current=0)},[x,v]),onOpen:E,onClose:x,disableHoverableContent:v,children:n})})};Ru.displayName=Yr;var oi="TooltipTrigger",Vu=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=zn(oi,n),s=ri(oi,n),i=Jr(n),a=d.useRef(null),u=$n(t,a,o.onTriggerChange),c=d.useRef(!1),f=d.useRef(!1),p=d.useCallback(()=>c.current=!1,[]);return d.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),l.jsx(xw,{asChild:!0,...i,children:l.jsx(Ln.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:bt(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:bt(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:bt(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:bt(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:bt(e.onBlur,o.onClose),onClick:bt(e.onClick,o.onClose)})})});Vu.displayName=oi;var si="TooltipPortal",[Mw,Iw]=Xr(si,{forceMount:void 0}),Bu=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=zn(si,t);return l.jsx(Mw,{scope:t,forceMount:n,children:l.jsx(ti,{present:n||s.open,children:l.jsx(Iu,{asChild:!0,container:o,children:r})})})};Bu.displayName=si;var mn="TooltipContent",zu=d.forwardRef((e,t)=>{const n=Iw(mn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=zn(mn,e.__scopeTooltip);return l.jsx(ti,{present:r||i.open,children:i.disableHoverableContent?l.jsx(Hu,{side:o,...s,ref:t}):l.jsx(kw,{side:o,...s,ref:t})})}),kw=d.forwardRef((e,t)=>{const n=zn(mn,e.__scopeTooltip),r=ri(mn,e.__scopeTooltip),o=d.useRef(null),s=$n(t,o),[i,a]=d.useState(null),{trigger:u,onClose:c}=n,f=o.current,{onPointerInTransitChange:p}=r,m=d.useCallback(()=>{a(null),p(!1)},[p]),g=d.useCallback((v,h)=>{const y=v.currentTarget,w={x:v.clientX,y:v.clientY},b=Vw(w,y.getBoundingClientRect()),S=Bw(w,b),E=zw(h.getBoundingClientRect()),x=Uw([...S,...E]);a(x),p(!0)},[p]);return d.useEffect(()=>()=>m(),[m]),d.useEffect(()=>{if(u&&f){const v=y=>g(y,f),h=y=>g(y,u);return u.addEventListener("pointerleave",v),f.addEventListener("pointerleave",h),()=>{u.removeEventListener("pointerleave",v),f.removeEventListener("pointerleave",h)}}},[u,f,g,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=!Hw(w,i);b?m():S&&(m(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[u,f,i,c,m]),l.jsx(Hu,{...e,ref:s})}),[$w,Lw]=Xr(Yr,{isInside:!1}),Hu=d.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,u=zn(mn,n),c=Jr(n),{onClose:f}=u;return d.useEffect(()=>(document.addEventListener(ni,f),()=>document.removeEventListener(ni,f)),[f]),d.useEffect(()=>{if(u.trigger){const p=m=>{const g=m.target;g!=null&&g.contains(u.trigger)&&f()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[u.trigger,f]),l.jsx(eu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:p=>p.preventDefault(),onDismiss:f,children:l.jsxs(Cw,{"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(Pa,{children:r}),l.jsx($w,{scope:n,isInside:!0,children:l.jsx(_w,{id:u.contentId,role:"tooltip",children:o||r})})]})})});zu.displayName=mn;var Uu="TooltipArrow",Rw=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Jr(n);return Lw(Uu,n).isInside?null:l.jsx(Sw,{...o,...r,ref:t})});Rw.displayName=Uu;function Vw(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 Bw(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 zw(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 Hw(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 Uw(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),jw(t)}function jw(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 Ww=Lu,Gw=Ru,qw=Vu,Kw=Bu,ju=zu;const vn=Ww,yn=Gw,wn=qw,qt=d.forwardRef(({className:e,sideOffset:t=4,...n},r)=>l.jsx(Kw,{children:l.jsx(ju,{ref:r,sideOffset:t,className:te("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=ju.displayName;function Xw({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 Jw=d.forwardRef(Xw);var Yw=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)}},Wu=function(e){return typeof e=="function"},Gu=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";const Zw=Yw(A.useEffect);function qu(e){var t=A.useRef(e);return t.current=e,t}var Qw=function(e){Gu&&(Wu(e)||console.error("useUnmount expected parameter is a function, got ".concat(typeof e)));var t=qu(e);A.useEffect(function(){return function(){t.current()}},[])},Zr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function eb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function tb(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Ku=tb,nb=typeof Zr=="object"&&Zr&&Zr.Object===Object&&Zr,rb=nb,ob=rb,sb=typeof self=="object"&&self&&self.Object===Object&&self,ib=ob||sb||Function("return this")(),Xu=ib,ab=Xu,lb=function(){return ab.Date.now()},cb=lb,ub=/\s/;function db(e){for(var t=e.length;t--&&ub.test(e.charAt(t)););return t}var fb=db,pb=fb,gb=/^\s+/;function hb(e){return e&&e.slice(0,pb(e)+1).replace(gb,"")}var mb=hb,vb=Xu,yb=vb.Symbol,Ju=yb,Yu=Ju,Zu=Object.prototype,wb=Zu.hasOwnProperty,bb=Zu.toString,Hn=Yu?Yu.toStringTag:void 0;function xb(e){var t=wb.call(e,Hn),n=e[Hn];try{e[Hn]=void 0;var r=!0}catch{}var o=bb.call(e);return r&&(t?e[Hn]=n:delete e[Hn]),o}var Cb=xb,Sb=Object.prototype,Eb=Sb.toString;function Nb(e){return Eb.call(e)}var Tb=Nb,Qu=Ju,Pb=Cb,Ab=Tb,_b="[object Null]",Fb="[object Undefined]",ed=Qu?Qu.toStringTag:void 0;function Ob(e){return e==null?e===void 0?Fb:_b:ed&&ed in Object(e)?Pb(e):Ab(e)}var Db=Ob;function Mb(e){return e!=null&&typeof e=="object"}var Ib=Mb,kb=Db,$b=Ib,Lb="[object Symbol]";function Rb(e){return typeof e=="symbol"||$b(e)&&kb(e)==Lb}var Vb=Rb,Bb=mb,td=Ku,zb=Vb,nd=NaN,Hb=/^[-+]0x[0-9a-f]+$/i,Ub=/^0b[01]+$/i,jb=/^0o[0-7]+$/i,Wb=parseInt;function Gb(e){if(typeof e=="number")return e;if(zb(e))return nd;if(td(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=td(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Bb(e);var n=Ub.test(e);return n||jb.test(e)?Wb(e.slice(2),n?2:8):Hb.test(e)?nd:+e}var qb=Gb,Kb=Ku,ii=cb,rd=qb,Xb="Expected a function",Jb=Math.max,Yb=Math.min;function Zb(e,t,n){var r,o,s,i,a,u,c=0,f=!1,p=!1,m=!0;if(typeof e!="function")throw new TypeError(Xb);t=rd(t)||0,Kb(n)&&(f=!!n.leading,p="maxWait"in n,s=p?Jb(rd(n.maxWait)||0,t):s,m="trailing"in n?!!n.trailing:m);function g(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?g(P):i}function h(P){var F=P-u,O=P-c,I=t-F;return p?Yb(I,s-O):I}function y(P){var F=P-u,O=P-c;return u===void 0||F>=t||F<0||p&&O>=s}function w(){var P=ii();if(y(P))return b(P);a=setTimeout(w,h(P))}function b(P){return a=void 0,m&&r?g(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(ii())}function x(){var P=ii(),F=y(P);if(r=arguments,o=this,u=P,F){if(a===void 0)return v(u);if(p)return clearTimeout(a),a=setTimeout(w,t),g(u)}return a===void 0&&(a=setTimeout(w,t)),i}return x.cancel=S,x.flush=E,x}var Qb=Zb;const ex=eb(Qb);function tx(){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}tx()||(global.Date=Date);function nx(e,t){var n;Gu&&(Wu(e)||console.error("useDebounceFn expected parameter is a function, got ".concat(typeof e)));var r=qu(e),o=(n=t==null?void 0:t.wait)!==null&&n!==void 0?n:1e3,s=A.useMemo(function(){return ex(function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return r.current.apply(r,fl([],dl(i),!1))},o,t)},[]);return Qw(function(){s.cancel()}),{run:s,cancel:s.cancel,flush:s.flush}}function rx(e,t,n){var r=dl(A.useState({}),2),o=r[0],s=r[1],i=nx(function(){s({})},n).run;A.useEffect(function(){return i()},t),Zw(e,[o])}const ox=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()}})),rx(()=>{e==null||e(r)},[r],{wait:300}),l.jsxs(l.Fragment,{children:[l.jsx(kt,{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(Jw,{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]=A.useState({}),[c,f]=A.useState(!1),[p,m]=A.useState(!1),[g,v]=A.useState(""),{toast:h}=Rr();A.useEffect(()=>{e&&y(g)},[g,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:g}),i.current=!0,await s(),h({title:"Đã đổi tên",description:`Đã đổi tên thành công "${o.name}" thành "${g}"`}),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(It,{open:e,onOpenChange:S=>{S||(t(!1),r(null),v(""))},children:l.jsxs(vt,{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(yt,{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"}),g.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(wt,{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"," ",g===""?"Root":g," )"]})]}),l.jsx(Mn,{className:"text-gray-600 w-full h-[50dvh] max-h-[500px] overflow-hidden overflow-y-auto",children:p?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(un,{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},od="crawl:jobs",bn="crawl:current_job",ix=e=>{const[t,n]=A.useState(null),[r,o]=A.useState(0);return A.useEffect(()=>{const s=localStorage.getItem(bn);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 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(bn,JSON.stringify(f)),(u.status==="completed"||u.status==="failed")&&setTimeout(()=>{n(null),localStorage.removeItem(bn)},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(bn,JSON.stringify(s)):localStorage.removeItem(bn)}}},ax=(e,t,n)=>{const r=[],o=s=>{(e[s]||[]).forEach(a=>{a.name.toLowerCase().includes(t.toLowerCase())&&r.push(a),a.isFolder&&a.key.startsWith(n)&&o(a.key)})};return o(n),r},Qr=(e,t)=>{const n=[],r=o=>{(e[o]||[]).forEach(i=>{n.push(i.key),i.isFolder&&r(i.key)})};return r(t),n},lx=(e,t)=>{const n=[];return(e[t]||[]).forEach(o=>{n.push(o.key),o.isFolder&&n.push(...Qr(e,o.key))}),n},cx=(e,t,n=[])=>{const[r,o]=A.useState({}),[s,i]=A.useState(!1),[a,u]=A.useState(null),c=A.useRef(t);A.useEffect(()=>{c.current=t},[t]);const f=async()=>{i(!0);try{const p=!_e.current;_e.current&&(_e.current=!1);const m=await oe.get(`${e}/api/files`,{params:{cache:p,displayPrefixes:JSON.stringify(n),prefix:c.current},timeout:3e5});o(m.data),u(null)}catch(p){u(p instanceof Error?p:new Error("Failed to fetch files"))}finally{i(!1)}};return A.useEffect(()=>{f()},[]),{data:r,isLoading:s,error:a,refetch:f}},Un=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||"")},ux=A.memo(({homeLabel:e="Kho tài liệu",apiBaseUrl:t="https://s3-explorer.cmcts1.studio.ai.vn",rootPrefix:n="",asSelector:r=!1,onSelected:o=a=>console.log("Đã chọn:",a),displayPrefixes:s,preSelectedFiles:i})=>{var Fd;const[a,u]=A.useState(""),[c,f]=A.useState(new Set),[p,m]=A.useState(n),[g,v]=A.useState(null),[h,y]=A.useState(!1),[w,b]=A.useState(""),[S,E]=A.useState(!1),[x,P]=A.useState(null),[F,O]=A.useState(null),[I,D]=A.useState(!1),[q,k]=A.useState(!1),[z,R]=A.useState(null),J=A.useRef(null),{toast:B}=Rr(),[U,K]=A.useState(null),[Y,le]=A.useState(null),[ue,Ee]=A.useState(""),[Ie,Ue]=A.useState(!1),[Nt,Se]=A.useState(!1),[Ce,tt]=A.useState(new Set),[je,nt]=A.useState(""),[ft,Xt]=A.useState(!1),[Pe,pt]=A.useState(!1),[Cn,Bt]=A.useState("rename"),[io,C]=A.useState(!1),[N,_]=A.useState(""),[H,V]=A.useState("1"),[L,X]=A.useState(!1),[se,me]=A.useState(!1),[ve,gt]=A.useState(!1),[ao,Sn]=A.useState(!1),{currentJob:ce,elapsedTime:En,setCurrentJob:Xn}=ix(t),bi=g||n,{data:ke,isLoading:xi,error:kx,refetch:We}=cx(t,bi,s);A.useEffect(()=>{const M=new Set(i);f(M)},[]),A.useEffect(()=>{ce!=null&&ce.status&&(ce.status.status==="completed"?(B({title:"Thu thập website hoàn tất",description:`Đã thu thập thành công ${ce.url} với ${ce.status.completed} trang`}),_e.current=!0,We()):ce.status.status==="failed"&&B({title:"Thu thập website thất bại",description:`Không thể thu thập ${ce.url}. Vui lòng thử lại.`,variant:"destructive"}))},[(Fd=ce==null?void 0:ce.status)==null?void 0:Fd.status]);const Nd=A.useMemo(()=>ke[p]||[],[ke,p]),Jt=A.useMemo(()=>a?ax(ke,a,p):Nd,[Nd,a,p,ke]),Jn=A.useMemo(()=>{const M={};return Jt.forEach(($,j)=>{c.has($.key)&&(M[j]=!0)}),M},[c,Jt]),$x=M=>{const $=Qr(ke,M);if($.length===0)return c.has(M)?"all":"none";const j=$.filter(G=>c.has(G)).length;return j===0?"none":j===$.length?"all":"partial"},lo=M=>{Sn(!0),v(M),m(M)};A.useEffect(()=>{ao&&(_e.current=!0,We().finally(()=>Sn(!1)))},[ao]);const Lx=async(M,$)=>{E(!0);try{const j=`${$}${M}/`;if((await oe.post(`${t}/api/create-folder`,{prefix:j})).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}"`}),b(""),y(!1)}catch(j){console.error("Error creating folder:",j),B({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"})}finally{E(!1)}},Td=async(M,$,j)=>{R(j),me(!0);try{let G=localStorage.getItem("dataLogin"),ee;try{G&&(G=JSON.parse(G),ee=G.user)}catch{G=null}if(ee&&(ee==null?void 0:ee.role)!=="MASTER_ADMIN"&&ug(M,B))return;const ae=new FormData;ae.append("prefix",$),Array.from(M).forEach(ge=>ae.append("files",ge)),ee!=null&&ee.id&&(console.log("🚀 ~ uploadFiles ~ user:",ee),ae.append("metadata",JSON.stringify({creator:ee.username,creatorId:ee.id,DataSource:"Tệp tải lên"}))),await oe.post(`${t}/api/upload`,ae,{headers:{"Content-Type":"multipart/form-data"}}),v($),_e.current=!0,await We()}catch(G){console.error("Lỗi tải lên:",G)}finally{R(null),me(!1)}},Rx=async M=>{var $;gt(!0);try{await oe.delete(`${t}/api/files`,{data:{paths:[M.key]}});const j=(($=M.key)==null?void 0:$.replace(/^(.*?)(\/.*)?$/,(G,ee,ae)=>!ae||ae==="/"?"":ee+"/"))||"";v(j),_e.current=!0,B({title:"Đã xóa tập tin",description:`Đã xóa thành công "${M.name}"`}),P(null)}catch(j){console.error("Error deleting file:",j),B({title:"Lỗi",description:"Không thể xóa tập tin",variant:"destructive"})}finally{gt(!1),await We()}},co=M=>{const $=new Set(c),j=typeof M=="function"?M(Jn):M;new Set(Object.keys(Jn).map(Number)).forEach(ee=>{const ae=Jt[ee];ae&&(j[ee]||($.delete(ae.key),ae.isFolder&&Qr(ke,ae.key).forEach(ge=>$.delete(ge))))}),Object.entries(j).forEach(([ee,ae])=>{const ge=parseInt(ee),Tt=Jt[ge];Tt&&ae&&($.add(Tt.key),Tt.isFolder&&Qr(ke,Tt.key).forEach(Si=>$.add(Si)))}),f($)},Vx=async()=>{var M;D(!0);try{const $=Array.from(c),j=$.map(ee=>Object.values(ke).flat().find(ae=>ae.key===ee)).filter(ee=>ee!==void 0);if(j.length===0){B({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:$}});const G=((M=j[0])==null?void 0:M.key.replace(/^(.*?)(\/.*)?$/,(ee,ae,ge)=>!ge||ge==="/"?"":ae+"/"))||"";v(G),_e.current=!0,We(),B({title:"Đã xóa tập tin",description:`Đã xóa thành công ${j.length} mục`}),k(!1),f(new Set)}catch($){console.error("Error deleting files:",$),B({title:"Lỗi",description:"Không thể xóa các tập tin đã chọn",variant:"destructive"})}finally{D(!1)}},Bx=async(M,$)=>{Se(!0);try{const j=M.key;let G;M.isFolder?G=j.split("/").slice(0,-2).join("/")+"/":G=j.substring(0,j.lastIndexOf("/")+1);const ee=G+$+(M.isFolder?"/":"");await oe.post(`${t}/api/rename`,{oldPath:j,newPath:ee}),_e.current=!0,await We(),B({title:"Đã đổi tên",description:`Đã đổi tên thành công "${M.name}" thành "${$}"`}),K(null),Ee(""),le(null)}catch(j){console.error("Error renaming item:",j),B({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{Se(!1)}},Pd=async M=>{tt($=>new Set([...$,...M]));try{const $=await oe.post(`${t}/api/download`,{paths:M},{responseType:"blob"}),j=window.URL.createObjectURL($.data),G=document.createElement("a");G.href=j;const ee=$.headers["Content-Disposition"]||$.headers["content-disposition"],ae=ee==null?void 0:ee.match(/filename="(.+)"/),ge=ae?decodeURIComponent(ae[1]):"download.zip";G.setAttribute("download",ge),document.body.appendChild(G),G.click(),document.body.removeChild(G),window.URL.revokeObjectURL(j),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($){console.error("Error downloading files:",$),B({title:"Lỗi",description:"Không thể tải xuống tập tin",variant:"destructive"})}finally{tt($=>{const j=new Set($);return M.forEach(G=>j.delete(G)),j})}},Ad=p?p.replace(n,"").split("/").filter(Boolean):[],zx=()=>Array.from(c).map(M=>{var $;for(const j in ke){const G=($=ke[j])==null?void 0:$.find(ee=>ee.key===M);if(G)return G}return null}).filter(M=>M!==null),_d=A.useMemo(()=>{const M=[{id:"select",header:()=>{const $=lx(ke,p),j=$.length>0&&$.every(ee=>c.has(ee)),G=$.some(ee=>c.has(ee));return l.jsx(es,{checked:j?!0:G?"indeterminate":!1,onCheckedChange:ee=>{if(ee){const ae=Jt.reduce((ge,Tt,Si)=>(ge[Si]=!0,ge),{});co(ae)}else co({})},"aria-label":"Chọn tất cả"})},cell:({row:$})=>{const j=$.original,ee=j.isFolder?$x(j.key):c.has(j.key)?"all":"none";return l.jsx("div",{className:"flex items-center",children:l.jsx(es,{checked:ee==="partial"?"indeterminate":ee==="all",onCheckedChange:ae=>{const ge={...Jn};ae?ge[$.index]=!0:delete ge[$.index],co(ge)},"aria-label":"Chọn dòng"})})},enableSorting:!1},{id:"fileName",header:"Tên tập tin",accessorKey:"name",cell:({row:$})=>{const j=$.original,G=j.key.substring(0,j.key.lastIndexOf("/"))||"/",ee=a.trim()!==""&&G!==p,ae=G.split("/").filter(Boolean);return l.jsxs("div",{className:"flex flex-col",children:[l.jsxs("div",{className:`flex items-center gap-2 ${j.isFolder?"cursor-pointer hover:text-blue-600":""}`,onClick:()=>{j.isFolder&&lo(j.key)},children:[j.isFolder?l.jsx(fo,{className:"h-5 w-5 text-blue-500"}):null,j.name]}),ee&&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:()=>{lo("")},children:"/"}),ae.map((ge,Tt)=>l.jsxs("span",{className:"flex items-center",children:[l.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{lo(ae.slice(0,Tt+1).join("/")+"/")},children:ge}),Tt<ae.length-1&&l.jsx("span",{children:"/"})]},Tt))]})]})]})}}];return r||M.push({id:"size",header:"Kích thước",accessorKey:"size",cell:({getValue:$,row:j})=>{const G=$();return l.jsx("span",{children:j.original.isFolder?"-":Gg(G)})}},{id:"lastModified",header:"Sửa đổi lần cuối",accessorKey:"lastModified",cell:({row:$})=>{const j=$.original.lastModified;return l.jsx("span",{children:j.toLocaleString()})}},{id:"actions",header:"Hành động",accessorKey:"key",cell:({row:$})=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(vn,{children:l.jsxs(yn,{children:[l.jsx(wn,{asChild:!0,children:l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>Pd([$.original.key]),className:"h-8 w-8 p-0",disabled:Ce.has($.original.key),children:Ce.has($.original.key)?l.jsx(ye,{className:"h-4 w-4 animate-spin"}):l.jsx(Ni,{className:"h-4 w-4"})})}),l.jsx(qt,{children:"Tải xuống"})]})}),l.jsx(vn,{children:l.jsxs(yn,{children:[l.jsx(wn,{asChild:!0,children:l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>{K($.original),Ee($.original.name)},className:"h-8 w-8 p-0",children:l.jsx(Hd,{className:"h-4 w-4"})})}),l.jsx(qt,{children:"Đổi tên"})]})}),l.jsx(vn,{children:l.jsxs(yn,{children:[l.jsx(wn,{asChild:!0,children:l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>{Ue(!0),O($.original)},className:"h-8 w-8 p-0",children:l.jsx(sg,{className:"h-4 w-4"})})}),l.jsx(qt,{children:"Di chuyển"})]})}),l.jsx(vn,{children:l.jsxs(yn,{children:[l.jsx(wn,{asChild:!0,children:l.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>P($.original),className:"h-8 w-8 p-0",children:l.jsx(Ti,{className:"h-4 w-4"})})}),l.jsx(qt,{children:"Xóa"})]})})]})}),M},[c,Jt,Jn,Ce,r]),Ci=Vi({data:Jt,columns:_d,state:{rowSelection:Jn},enableRowSelection:!0,onRowSelectionChange:co,getCoreRowModel:Ri()}),Hx=async M=>{var $,j;Xt(!0);try{if(Un(M)){const G=await oe.get(`${t}/api/read-text`,{params:{path:M.key}});nt(G.data.content)}try{const G=await oe.get(`${t}/api/read-json`,{params:{path:M.key+".metadata.json"}}),ee=((j=($=G==null?void 0:G.data)==null?void 0:$.content)==null?void 0:j.metadataAttributes)||null;return le({fullPath:U==null?void 0:U.key,...ee})}catch{return le("Lỗi phân tích siêu dữ liệu")}}catch(G){console.error("Error loading file content:",G),B({title:"Lỗi",description:"Không thể tải nội dung tập tin",variant:"destructive"})}finally{Xt(!1)}},Ux=async(M,$)=>{pt(!0);try{await oe.post(`${t}/api/modify-text`,{path:M.key,content:$}),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(),K(null),nt(""),Bt("rename")}catch(j){console.error("Error saving file content:",j),B({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{pt(!1)}},jx=async M=>{pt(!0);try{console.log("🚀 ~ saveJsonFile ~ metadataForEdit:",Y),await oe.post(`${t}/api/modify-json`,{path:M.key+".metadata.json",content:{metadataAttributes:Y}}),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(),K(null),nt(""),Bt("rename")}catch($){console.error("Error saving file content:",$),B({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{pt(!1)}};A.useEffect(()=>{U&&(U.isFolder||Hx(U),Bt("rename"))},[U]);const Wx=async(M,$)=>{var j;if(ce){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}X(!0);try{const{data:G}=await oe.post(`${t}/api/crawl`,{url:M,limit:$,prefix:p});if(G.id){Xn({id:G.id,url:M,limit:$,prefix:p,taskId:((j=G.task)==null?void 0:j.id)||""});const ee=localStorage.getItem(od),ae=ee?JSON.parse(ee):[];ae.some(ge=>ge.id===G.id)||(ae.unshift({url:M,id:G.id,limit:$,prefix:p,timestamp:Date.now()}),ae.length>20&&(ae.length=20),localStorage.setItem(od,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 ${$}. Dữ liệu sẽ có sẵn sau khi thu thập hoàn tất.`}),C(!1),_(""),V("1")}}catch(G){console.error("Error crawling website:",G),B({title:"Lỗi",description:"Không thể bắt đầu thu thập website",variant:"destructive"})}finally{X(!1)}},Gx=async()=>{try{if(!(ce!=null&&ce.id))return;Xn(null),localStorage.removeItem(bn),B({title:"Đã dừng thu thập",description:`Đã dừng thu thập website ${ce.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(La,{className:"s3-explr-breadcrumb",children:l.jsxs(Ra,{className:"s3-explr-breadcrumb-list",children:[l.jsx(Xo,{className:"s3-explr-breadcrumb-item",children:l.jsx(Jo,{onClick:()=>{v(""),m(""),_e.current=!0,setTimeout(()=>{We()},0)},className:"flex items-center gap-1 cursor-pointer s3-explr-breadcrumb-home",children:e})}),Ad.map((M,$)=>l.jsxs(l.Fragment,{children:[l.jsx(Va,{className:"s3-explr-breadcrumb-separator"},`sep-${$}`),l.jsx(Xo,{className:"s3-explr-breadcrumb-item",children:l.jsx(Jo,{onClick:()=>lo(n+Ad.slice(0,$+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(ox,{ref:J,onChange:M=>u(M)})}),l.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>{v(p),_e.current=!0,We()},disabled:xi,className:"flex items-center gap-2 s3-explr-refresh-btn",children:[l.jsx(Md,{className:`h-4 w-4 s3-explr-refresh-icon ${xi?"animate-spin":""}`}),"Làm mới"]}),!r&&l.jsxs(l.Fragment,{children:[c.size>0&&l.jsxs(l.Fragment,{children:[l.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>Pd(Array.from(c)),disabled:Array.from(c).some(M=>Ce.has(M)),className:"flex items-center gap-2 s3-explr-download-selected-btn",children:[Array.from(c).some(M=>Ce.has(M))?l.jsx(ye,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}):l.jsx(Ni,{className:"h-4 w-4 s3-explr-download-icon"}),"Tải xuống đã chọn (",c.size,")"]}),l.jsxs(It,{open:q,onOpenChange:k,children:[l.jsx(Er,{asChild:!0,children:l.jsxs(ie,{variant:"destructive",size:"sm",className:"flex items-center gap-2 s3-explr-bulk-delete-btn",children:[l.jsx(Ti,{className:"h-4 w-4 s3-explr-trash-icon"}),"Xóa đã chọn (",c.size,")"]})}),l.jsxs(vt,{className:"s3-explr-dialog-content",children:[l.jsxs(yt,{className:"s3-explr-dialog-header",children:[l.jsx(wt,{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 ",c.size," mục đã chọn? Hành động này không thể hoàn tác."]})]}),l.jsxs(un,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>k(!1),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(ie,{variant:"destructive",onClick:Vx,disabled:I,className:"s3-explr-confirm-delete-btn",children:I?l.jsxs(l.Fragment,{children:[l.jsx(ye,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa đã chọn"})]})]})]})]}),l.jsxs(It,{open:h,onOpenChange:y,children:[l.jsx(Er,{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(Ld,{className:"h-4 w-4 s3-explr-folder-plus-icon"}),"Thư mục mới"]})}),l.jsxs(vt,{className:"s3-explr-dialog-content",children:[l.jsx(yt,{className:"s3-explr-dialog-header",children:l.jsx(wt,{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(kt,{disabled:S,id:"name",value:w,onChange:M=>b(M.target.value),placeholder:"Nhập tên thư mục",className:"s3-explr-input"})]}),l.jsxs(ie,{onClick:()=>{w.trim()&&Lx(w,p)},disabled:S,className:"s3-explr-create-btn",children:[S&&l.jsx(ye,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),S?"Đ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=$=>{const j=$.target.files;j&&Td(j,p,"files")},M.click()},disabled:z!==null||!!s&&!p,children:z==="files"?l.jsxs(l.Fragment,{children:[l.jsx(ye,{className:"h-4 w-4 animate-spin mr-2 s3-explr-loader"}),"Đang tải lên..."]}):l.jsxs(l.Fragment,{children:[l.jsx(kd,{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=$=>{const j=$.target.files;j&&Td(j,p,"folder")},M.click()},disabled:z!==null||!!s&&!p,children:z==="folder"?l.jsxs(l.Fragment,{children:[l.jsx(ye,{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"]})}),ce?l.jsx(vn,{delayDuration:0,children:l.jsxs(yn,{children:[l.jsx(wn,{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(ye,{className:"h-4 w-4 animate-spin s3-explr-loader"}),ce.status?l.jsxs(l.Fragment,{children:["Đang thu thập (",ce.status.completed,"/",ce.status.total,") - ",Math.floor(En/60),":",String(En%60).padStart(2,"0")]}):"Đang thu thập..."]}),l.jsxs(ie,{variant:"destructive",size:"sm",onClick:()=>void Gx(),className:"flex items-center gap-2",children:[l.jsx("span",{className:"sr-only",children:"Dừng thu thập"}),l.jsx(jd,{className:"h-4 w-4"})]})]})}),ce.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 ",ce.url]}),l.jsxs("p",{children:["Tiến độ: ",ce.status.completed,"/",ce.status.total," trang"]}),l.jsxs("p",{children:["Thời gian: ",Math.floor(En/60),":",String(En%60).padStart(2,"0")]}),l.jsxs("p",{children:["Trạng thái:"," ",ce.status.status==="scraping"?"Đang thu thập":ce.status.status==="completed"?"Hoàn thành":"Thất bại"]})]})})]})}):l.jsxs(It,{open:io,onOpenChange:C,children:[l.jsx(Er,{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(Bd,{className:"h-4 w-4 s3-explr-globe-icon"}),"Thêm website"]})}),l.jsxs(vt,{className:"s3-explr-dialog-content",children:[l.jsxs(yt,{className:"s3-explr-dialog-header",children:[l.jsx(wt,{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(Wt,{htmlFor:"websiteUrl",className:"s3-explr-label",children:"URL Website"}),l.jsx(kt,{id:"websiteUrl",value:N,onChange:M=>_(M.target.value),placeholder:"https://example.com",type:"url",disabled:L,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(kt,{id:"crawlLimit",value:H,onChange:M=>{const $=M.target.value;/^\d*$/.test($)&&V($)},placeholder:"1",type:"text",disabled:L,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(un,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>{C(!1),_(""),V("1")},disabled:L,className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(ie,{onClick:()=>{N.trim()&&Wx(N.trim(),parseInt(H)||1)},disabled:L||!N.trim(),className:"s3-explr-crawl-btn",children:L?l.jsxs(l.Fragment,{children:[l.jsx(ye,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]}):"Bắt đầu thu thập"})]})]})]})]}),l.jsx(It,{open:!!x,onOpenChange:M=>!M&&P(null),children:l.jsxs(vt,{className:"s3-explr-dialog-content",children:[l.jsxs(yt,{className:"s3-explr-dialog-header",children:[l.jsx(wt,{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 ",x==null?void 0:x.name,"? Hành động này không thể hoàn tác."]})]}),l.jsxs(un,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>P(null),className:"s3-explr-cancel-btn",children:"Hủy"}),l.jsx(ie,{variant:"destructive",onClick:()=>Rx(x),disabled:ve,className:"s3-explr-confirm-delete-btn",children:ve?l.jsxs(l.Fragment,{children:[l.jsx(ye,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa"})]})]})}),l.jsx(It,{open:!!U,onOpenChange:M=>{M||(K(null),le(null),Ee(""),nt(""),Bt("rename"))},children:l.jsxs(vt,{className:"s3-explr-dialog-content max-w-5xl w-[90%]",children:[l.jsx(yt,{className:"s3-explr-dialog-header",children:l.jsx(wt,{className:"s3-explr-dialog-title",children:U!=null&&U.isFolder?"Đổi tên thư mục":Un(U)?"Quản lý tập tin":"Đổi tên tập tin"})}),U&&l.jsxs(bv,{value:Cn,onValueChange:M=>Bt(M),children:[l.jsxs(Sc,{"aria-checked":!Un(U),"aria-disabled":U.isFolder,className:"grid w-full grid-cols-3 aria-checked:grid-cols-2 aria-disabled:grid-cols-1",children:[l.jsx(Or,{value:"rename",children:"Đổi tên"}),!U.isFolder&&l.jsxs(l.Fragment,{children:[Un(U)&&l.jsx(Or,{value:"edit",children:"Sửa nội dung"}),l.jsx(Or,{value:"edit-metadata",children:"Sửa metadata file"})]})]}),l.jsx(Dr,{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(kt,{id:"newName",value:ue,onChange:M=>Ee(M.target.value),placeholder:"Nhập tên mới",disabled:Nt,className:"s3-explr-input"})]})})}),!U.isFolder&&l.jsxs(l.Fragment,{children:[Un(U)&&l.jsx(Dr,{value:"edit",children:l.jsx("div",{className:"space-y-4 py-4",children:ft?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx(ye,{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(In,{id:"content",value:je,onChange:M=>nt(M.target.value),placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:Pe})]})})}),l.jsx(Dr,{value:"edit-metadata",children:l.jsx("div",{className:"space-y-4 py-4",children:ft?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx(ye,{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:Y&&typeof Y=="object"&&Object.entries(Y).map(([M,$])=>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:[lg[M]||M,jo(M)&&l.jsx(ig,{className:"h-[12px] w-[12px] text-red-500"})]}),cg(M)?l.jsx(In,{id:M,value:typeof $=="string"?$:JSON.stringify($),onChange:j=>{const G={...Y,[M]:j.target.value};le(G)},placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:Pe||jo(M)}):l.jsx(kt,{id:M,value:typeof $=="string"?$:JSON.stringify($),onChange:j=>{const G={...Y,[M]:j.target.value};le(G)},placeholder:"Nhập nội dung",className:"s3-explr-input",disabled:Pe||jo(M)})]},M))})})})]})]}),l.jsxs(un,{className:"s3-explr-dialog-footer",children:[l.jsx(ie,{variant:"outline",onClick:()=>{K(null),le(null),Ee(""),nt("")},className:"s3-explr-cancel-btn",children:"Hủy"}),Cn==="edit"?l.jsx(ie,{onClick:()=>U&&Ux(U,je),disabled:Pe||ft,className:"s3-explr-save-btn",children:Pe?l.jsxs(l.Fragment,{children:[l.jsx(ye,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):Cn==="edit-metadata"?l.jsx(ie,{onClick:()=>Y&&typeof Y=="object"&&U&&jx(U),disabled:Pe||ft,className:"s3-explr-save-btn",children:Pe?l.jsxs(l.Fragment,{children:[l.jsx(ye,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):l.jsx(ie,{onClick:()=>{ue.trim()&&U&&Bx(U,ue.trim())},disabled:Nt||!ue.trim()||ue.trim()===(U==null?void 0:U.name),className:"s3-explr-rename-btn",children:Nt?l.jsxs(l.Fragment,{children:[l.jsx(ye,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang đổi tên..."]}):"Đổi tên"})]})]})}),F&&Ie&&l.jsx(sx,{openDialogRename:Ie,setOpenDialogRename:Ue,apiBaseUrl:t,setFileToMove:O,fileToMove:F,refreshFiles:We,ignoreCache:_e})]})]}),kx&&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(Nr,{className:"s3-explr-table",children:[l.jsx(Tr,{className:"s3-explr-table-header",children:Ci.getHeaderGroups().map(M=>l.jsx(Ye,{className:"hover:bg-transparent s3-explr-header-row",children:M.headers.map($=>l.jsx(st,{className:"s3-explr-header-cell",children:$.isPlaceholder?null:nr($.column.columnDef.header,$.getContext())},$.id))},M.id))}),l.jsx(Pr,{className:"s3-explr-table-body",children:Ci.getRowModel().rows.length===0?l.jsx(Ye,{className:"s3-explr-empty-row",children:l.jsx(De,{colSpan:_d.length,className:"h-24 text-center s3-explr-empty-cell",children:a?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 "',a,'"']}):l.jsx("div",{className:"text-gray-500 s3-explr-empty-message",children:xi?"Đ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"})})}):Ci.getRowModel().rows.map(M=>l.jsx(Ye,{className:"h-12 s3-explr-row",children:M.getVisibleCells().map($=>l.jsx(De,{className:"align-middle s3-explr-cell",children:nr($.column.columnDef.cell,$.getContext())},$.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:[c.size," ",(c.size===1,"tập tin")," đã chọn"]}),l.jsx(ie,{variant:"default",onClick:()=>o(zx()),disabled:c.size===0,className:"s3-explr-ok-btn",children:"OK"})]}),!r&&l.jsx(Jc,{})]})});var jn=e=>e.type==="checkbox",Kt=e=>e instanceof Date,Fe=e=>e==null;const sd=e=>typeof e=="object";var he=e=>!Fe(e)&&!Array.isArray(e)&&sd(e)&&!Kt(e),dx=e=>he(e)&&e.target?jn(e.target)?e.target.checked:e.target.value:e,fx=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,px=(e,t)=>e.has(fx(t)),gx=e=>{const t=e.constructor&&e.constructor.prototype;return he(t)&&t.hasOwnProperty("isPrototypeOf")},ai=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function He(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(!(ai&&(e instanceof Blob||r))&&(n||he(e)))if(t=n?[]:{},!n&&!gx(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=He(e[o]));else return e;return t}var eo=e=>Array.isArray(e)?e.filter(Boolean):[],pe=e=>e===void 0,W=(e,t,n)=>{if(!t||!he(e))return n;const r=eo(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",li=e=>/^\w*$/.test(e),id=e=>eo(e.replace(/["|']|\]/g,"").split(/\.|\[/)),fe=(e,t,n)=>{let r=-1;const o=li(t)?[t]:id(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 ad={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},et={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},St={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};A.createContext(null);var hx=(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]!==et.all&&(t._proxyFormState[i]=!r||et.all),e[i]}});return o},Me=e=>he(e)&&!Object.keys(e).length,mx=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return Me(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===et.all)},to=e=>Array.isArray(e)?e:[e];function vx(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",yx=(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),wx=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},ld=e=>({isOnSubmit:!e||e===et.onSubmit,isOnBlur:e===et.onBlur,isOnChange:e===et.onChange,isOnAll:e===et.all,isOnTouch:e===et.onTouched}),cd=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Wn=(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(Wn(a,t))break}else if(he(a)&&Wn(a,t))break}}};var bx=(e,t,n)=>{const r=to(W(e,n));return fe(r,"root",t[n]),fe(e,n,r),e},ci=e=>e.type==="file",dt=e=>typeof e=="function",no=e=>{if(!ai)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ro=e=>ut(e),ui=e=>e.type==="radio",oo=e=>e instanceof RegExp;const ud={value:!1,isValid:!1},dd={value:!0,isValid:!0};var fd=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===""?dd:{value:e[0].value,isValid:!0}:dd:ud}return ud};const pd={isValid:!1,value:null};var gd=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,pd):pd;function hd(e,t,n="validate"){if(ro(e)||Array.isArray(e)&&e.every(ro)||ct(e)&&!e)return{type:n,message:ro(e)?e:"",ref:t}}var xn=e=>he(e)&&!oo(e)?e:{value:e,message:""},md=async(e,t,n,r,o)=>{const{ref:s,refs:i,required:a,maxLength:u,minLength:c,min:f,max:p,pattern:m,validate:g,name:v,valueAsNumber:h,mount:y,disabled:w}=e._f,b=W(t,v);if(!y||w)return{};const S=i?i[0]:s,E=k=>{r&&S.reportValidity&&(S.setCustomValidity(ct(k)?"":k||""),S.reportValidity())},x={},P=ui(s),F=jn(s),O=P||F,I=(h||ci(s))&&pe(s.value)&&pe(b)||no(s)&&s.value===""||b===""||Array.isArray(b)&&!b.length,D=wx.bind(null,v,n,x),q=(k,z,R,J=St.maxLength,B=St.minLength)=>{const U=k?z:R;x[v]={type:k?J:B,message:U,ref:s,...D(k?J:B,U)}};if(o?!Array.isArray(b)||!b.length:a&&(!O&&(I||Fe(b))||ct(b)&&!b||F&&!fd(i).isValid||P&&!gd(i).isValid)){const{value:k,message:z}=ro(a)?{value:!!a,message:a}:xn(a);if(k&&(x[v]={type:St.required,message:z,ref:S,...D(St.required,z)},!n))return E(z),x}if(!I&&(!Fe(f)||!Fe(p))){let k,z;const R=xn(p),J=xn(f);if(!Fe(b)&&!isNaN(b)){const B=s.valueAsNumber||b&&+b;Fe(R.value)||(k=B>R.value),Fe(J.value)||(z=B<J.value)}else{const B=s.valueAsDate||new Date(b),U=le=>new Date(new Date().toDateString()+" "+le),K=s.type=="time",Y=s.type=="week";ut(R.value)&&b&&(k=K?U(b)>U(R.value):Y?b>R.value:B>new Date(R.value)),ut(J.value)&&b&&(z=K?U(b)<U(J.value):Y?b<J.value:B<new Date(J.value))}if((k||z)&&(q(!!k,R.message,J.message,St.max,St.min),!n))return E(x[v].message),x}if((u||c)&&!I&&(ut(b)||o&&Array.isArray(b))){const k=xn(u),z=xn(c),R=!Fe(k.value)&&b.length>+k.value,J=!Fe(z.value)&&b.length<+z.value;if((R||J)&&(q(R,k.message,z.message),!n))return E(x[v].message),x}if(m&&!I&&ut(b)){const{value:k,message:z}=xn(m);if(oo(k)&&!b.match(k)&&(x[v]={type:St.pattern,message:z,ref:s,...D(St.pattern,z)},!n))return E(z),x}if(g){if(dt(g)){const k=await g(b,t),z=hd(k,S);if(z&&(x[v]={...z,...D(St.validate,z.message)},!n))return E(z.message),x}else if(he(g)){let k={};for(const z in g){if(!Me(k)&&!n)break;const R=hd(await g[z](b,t),S,z);R&&(k={...R,...D(z,R.message)},E(R.message),n&&(x[v]=k))}if(!Me(k)&&(x[v]={ref:S,...k},!n))return x}}return E(!0),x};function xx(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 Cx(e){for(const t in e)if(e.hasOwnProperty(t)&&!pe(e[t]))return!1;return!0}function xe(e,t){const n=Array.isArray(t)?t:li(t)?[t]:id(t),r=n.length===1?e:xx(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(he(r)&&Me(r)||Array.isArray(r)&&Cx(r))&&xe(e,n.slice(0,-1)),e}var di=()=>{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=[]}}},fi=e=>Fe(e)||!sd(e);function Vt(e,t){if(fi(e)||fi(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)?!Vt(s,i):s!==i)return!1}}return!0}var vd=e=>e.type==="select-multiple",Sx=e=>ui(e)||jn(e),pi=e=>no(e)&&e.isConnected,yd=e=>{for(const t in e)if(dt(e[t]))return!0;return!1};function so(e,t={}){const n=Array.isArray(e);if(he(e)||n)for(const r in e)Array.isArray(e[r])||he(e[r])&&!yd(e[r])?(t[r]=Array.isArray(e[r])?[]:{},so(e[r],t[r])):Fe(e[r])||(t[r]=!0);return t}function wd(e,t,n){const r=Array.isArray(e);if(he(e)||r)for(const o in e)Array.isArray(e[o])||he(e[o])&&!yd(e[o])?pe(t)||fi(n[o])?n[o]=Array.isArray(e[o])?so(e[o],[]):{...so(e[o])}:wd(e[o],Fe(t)?{}:t[o],n[o]):n[o]=!Vt(e[o],t[o]);return n}var Gn=(e,t)=>wd(e,t,so(t)),bd=(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 gi(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return ci(t)?t.files:ui(t)?gd(e.refs).value:vd(t)?[...t.selectedOptions].map(({value:n})=>n):jn(t)?fd(e.refs).value:bd(pe(t.value)?e.ref.value:t.value,e)}var Ex=(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}},qn=e=>pe(e)?e:oo(e)?e.source:he(e)?oo(e.value)?e.value.source:e.value:e;const xd="AsyncFunction";var Nx=e=>!!e&&!!e.validate&&!!(dt(e.validate)&&e.validate.constructor.name===xd||he(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===xd)),Tx=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Cd(e,t,n){const r=W(e,n);if(r||li(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 Px=(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,Ax=(e,t)=>!eo(W(e,t)).length&&xe(e,t);const _x={mode:et.onSubmit,reValidateMode:et.onChange,shouldFocusError:!0};function Fx(e={}){let t={..._x,...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)?He(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:He(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},p={values:di(),array:di(),state:di()},m=ld(t.mode),g=ld(t.reValidateMode),v=t.criteriaMode===et.all,h=C=>N=>{clearTimeout(c),c=setTimeout(C,N)},y=async C=>{if(!t.disabled&&(f.isValid||C)){const N=t.resolver?Me((await O()).errors):await D(r,!0);N!==n.isValid&&p.state.next({isValid:N})}},w=(C,N)=>{!t.disabled&&(f.isValidating||f.validatingFields)&&((C||Array.from(a.mount)).forEach(_=>{_&&(N?fe(n.validatingFields,_,N):xe(n.validatingFields,_))}),p.state.next({validatingFields:n.validatingFields,isValidating:!Me(n.validatingFields)}))},b=(C,N=[],_,H,V=!0,L=!0)=>{if(H&&_&&!t.disabled){if(i.action=!0,L&&Array.isArray(W(r,C))){const X=_(W(r,C),H.argA,H.argB);V&&fe(r,C,X)}if(L&&Array.isArray(W(n.errors,C))){const X=_(W(n.errors,C),H.argA,H.argB);V&&fe(n.errors,C,X),Ax(n.errors,C)}if(f.touchedFields&&L&&Array.isArray(W(n.touchedFields,C))){const X=_(W(n.touchedFields,C),H.argA,H.argB);V&&fe(n.touchedFields,C,X)}f.dirtyFields&&(n.dirtyFields=Gn(o,s)),p.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),p.state.next({errors:n.errors})},E=C=>{n.errors=C,p.state.next({errors:n.errors,isValid:!1})},x=(C,N,_,H)=>{const V=W(r,C);if(V){const L=W(s,C,pe(_)?W(o,C):_);pe(L)||H&&H.defaultChecked||N?fe(s,C,N?L:gi(V._f)):J(C,L),i.mount&&y()}},P=(C,N,_,H,V)=>{let L=!1,X=!1;const se={name:C};if(!t.disabled){const me=!!(W(r,C)&&W(r,C)._f&&W(r,C)._f.disabled);if(!_||H){f.isDirty&&(X=n.isDirty,n.isDirty=se.isDirty=k(),L=X!==se.isDirty);const ve=me||Vt(W(o,C),N);X=!!(!me&&W(n.dirtyFields,C)),ve||me?xe(n.dirtyFields,C):fe(n.dirtyFields,C,!0),se.dirtyFields=n.dirtyFields,L=L||f.dirtyFields&&X!==!ve}if(_){const ve=W(n.touchedFields,C);ve||(fe(n.touchedFields,C,_),se.touchedFields=n.touchedFields,L=L||f.touchedFields&&ve!==_)}L&&V&&p.state.next(se)}return L?se:{}},F=(C,N,_,H)=>{const V=W(n.errors,C),L=f.isValid&&ct(N)&&n.isValid!==N;if(t.delayError&&_?(u=h(()=>S(C,_)),u(t.delayError)):(clearTimeout(c),u=null,_?fe(n.errors,C,_):xe(n.errors,C)),(_?!Vt(V,_):V)||!Me(H)||L){const X={...H,...L&&ct(N)?{isValid:N}:{},errors:n.errors,name:C};n={...n,...X},p.state.next(X)}},O=async C=>{w(C,!0);const N=await t.resolver(s,t.context,Ex(C||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(C),N},I=async C=>{const{errors:N}=await O(C);if(C)for(const _ of C){const H=W(N,_);H?fe(n.errors,_,H):xe(n.errors,_)}else n.errors=N;return N},D=async(C,N,_={valid:!0})=>{for(const H in C){const V=C[H];if(V){const{_f:L,...X}=V;if(L){const se=a.array.has(L.name),me=V._f&&Nx(V._f);me&&f.validatingFields&&w([H],!0);const ve=await md(V,s,v,t.shouldUseNativeValidation&&!N,se);if(me&&f.validatingFields&&w([H]),ve[L.name]&&(_.valid=!1,N))break;!N&&(W(ve,L.name)?se?bx(n.errors,ve,L.name):fe(n.errors,L.name,ve[L.name]):xe(n.errors,L.name))}!Me(X)&&await D(X,N,_)}}return _.valid},q=()=>{for(const C of a.unMount){const N=W(r,C);N&&(N._f.refs?N._f.refs.every(_=>!pi(_)):!pi(N._f.ref))&&Se(C)}a.unMount=new Set},k=(C,N)=>!t.disabled&&(C&&N&&fe(s,C,N),!Vt(ue(),o)),z=(C,N,_)=>yx(C,a,{...i.mount?s:pe(N)?o:ut(C)?{[C]:N}:N},_,N),R=C=>eo(W(i.mount?s:o,C,t.shouldUnregister?W(o,C,[]):[])),J=(C,N,_={})=>{const H=W(r,C);let V=N;if(H){const L=H._f;L&&(!L.disabled&&fe(s,C,bd(N,L)),V=no(L.ref)&&Fe(N)?"":N,vd(L.ref)?[...L.ref.options].forEach(X=>X.selected=V.includes(X.value)):L.refs?jn(L.ref)?L.refs.length>1?L.refs.forEach(X=>(!X.defaultChecked||!X.disabled)&&(X.checked=Array.isArray(V)?!!V.find(se=>se===X.value):V===X.value)):L.refs[0]&&(L.refs[0].checked=!!V):L.refs.forEach(X=>X.checked=X.value===V):ci(L.ref)?L.ref.value="":(L.ref.value=V,L.ref.type||p.values.next({name:C,values:{...s}})))}(_.shouldDirty||_.shouldTouch)&&P(C,V,_.shouldTouch,_.shouldDirty,!0),_.shouldValidate&&le(C)},B=(C,N,_)=>{for(const H in N){const V=N[H],L=`${C}.${H}`,X=W(r,L);(a.array.has(C)||he(V)||X&&!X._f)&&!Kt(V)?B(L,V,_):J(L,V,_)}},U=(C,N,_={})=>{const H=W(r,C),V=a.array.has(C),L=He(N);fe(s,C,L),V?(p.array.next({name:C,values:{...s}}),(f.isDirty||f.dirtyFields)&&_.shouldDirty&&p.state.next({name:C,dirtyFields:Gn(o,s),isDirty:k(C,L)})):H&&!H._f&&!Fe(L)?B(C,L,_):J(C,L,_),cd(C,a)&&p.state.next({...n}),p.values.next({name:i.mount?C:void 0,values:{...s}})},K=async C=>{i.mount=!0;const N=C.target;let _=N.name,H=!0;const V=W(r,_),L=()=>N.type?gi(V._f):dx(C),X=se=>{H=Number.isNaN(se)||Kt(se)&&isNaN(se.getTime())||Vt(se,W(s,_,se))};if(V){let se,me;const ve=L(),gt=C.type===ad.BLUR||C.type===ad.FOCUS_OUT,ao=!Tx(V._f)&&!t.resolver&&!W(n.errors,_)&&!V._f.deps||Px(gt,W(n.touchedFields,_),n.isSubmitted,g,m),Sn=cd(_,a,gt);fe(s,_,ve),gt?(V._f.onBlur&&V._f.onBlur(C),u&&u(0)):V._f.onChange&&V._f.onChange(C);const ce=P(_,ve,gt,!1),En=!Me(ce)||Sn;if(!gt&&p.values.next({name:_,type:C.type,values:{...s}}),ao)return f.isValid&&(t.mode==="onBlur"?gt&&y():y()),En&&p.state.next({name:_,...Sn?{}:ce});if(!gt&&Sn&&p.state.next({...n}),t.resolver){const{errors:Xn}=await O([_]);if(X(ve),H){const bi=Cd(n.errors,r,_),ke=Cd(Xn,r,bi.name||_);se=ke.error,_=ke.name,me=Me(Xn)}}else w([_],!0),se=(await md(V,s,v,t.shouldUseNativeValidation))[_],w([_]),X(ve),H&&(se?me=!1:f.isValid&&(me=await D(r,!0)));H&&(V._f.deps&&le(V._f.deps),F(_,me,se,ce))}},Y=(C,N)=>{if(W(n.errors,N)&&C.focus)return C.focus(),1},le=async(C,N={})=>{let _,H;const V=to(C);if(t.resolver){const L=await I(pe(C)?C:V);_=Me(L),H=C?!V.some(X=>W(L,X)):_}else C?(H=(await Promise.all(V.map(async L=>{const X=W(r,L);return await D(X&&X._f?{[L]:X}:X)}))).every(Boolean),!(!H&&!n.isValid)&&y()):H=_=await D(r);return p.state.next({...!ut(C)||f.isValid&&_!==n.isValid?{}:{name:C},...t.resolver||!C?{isValid:_}:{},errors:n.errors}),N.shouldFocus&&!H&&Wn(r,Y,C?V:a.mount),H},ue=C=>{const N={...i.mount?s:o};return pe(C)?N:ut(C)?W(N,C):C.map(_=>W(N,_))},Ee=(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)}),Ie=C=>{C&&to(C).forEach(N=>xe(n.errors,N)),p.state.next({errors:C?n.errors:{}})},Ue=(C,N,_)=>{const H=(W(r,C,{_f:{}})._f||{}).ref,V=W(n.errors,C)||{},{ref:L,message:X,type:se,...me}=V;fe(n.errors,C,{...me,...N,ref:H}),p.state.next({name:C,errors:n.errors,isValid:!1}),_&&_.shouldFocus&&H&&H.focus&&H.focus()},Nt=(C,N)=>dt(C)?p.values.subscribe({next:_=>C(z(void 0,N),_)}):z(C,N,!0),Se=(C,N={})=>{for(const _ of C?to(C):a.mount)a.mount.delete(_),a.array.delete(_),N.keepValue||(xe(r,_),xe(s,_)),!N.keepError&&xe(n.errors,_),!N.keepDirty&&xe(n.dirtyFields,_),!N.keepTouched&&xe(n.touchedFields,_),!N.keepIsValidating&&xe(n.validatingFields,_),!t.shouldUnregister&&!N.keepDefaultValue&&xe(o,_);p.values.next({values:{...s}}),p.state.next({...n,...N.keepDirty?{isDirty:k()}:{}}),!N.keepIsValid&&y()},Ce=({disabled:C,name:N,field:_,fields:H,value:V})=>{if(ct(C)&&i.mount||C){const L=C?void 0:pe(V)?gi(_?_._f:W(H,N)._f):V;(C||!C&&!pe(L))&&fe(s,N,L),P(N,L,!1,!1,!0)}},tt=(C,N={})=>{let _=W(r,C);const H=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),_?Ce({field:_,disabled:ct(N.disabled)?N.disabled:t.disabled,name:C,value:N.value}):x(C,!0,N.value),{...H?{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:K,onBlur:K,ref:V=>{if(V){tt(C,N),_=W(r,C);const L=pe(V.value)&&V.querySelectorAll&&V.querySelectorAll("input,select,textarea")[0]||V,X=Sx(L),se=_._f.refs||[];if(X?se.find(me=>me===L):L===_._f.ref)return;fe(r,C,{_f:{..._._f,...X?{refs:[...se.filter(pi),L,...Array.isArray(W(o,C))?[{}]:[]],ref:{type:L.type,name:C}}:{ref:L}}}),x(C,!1,void 0,L)}else _=W(r,C,{}),_._f&&(_._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(px(a.array,C)&&i.action)&&a.unMount.add(C)}}},je=()=>t.shouldFocusError&&Wn(r,Y,a.mount),nt=C=>{ct(C)&&(p.state.next({disabled:C}),Wn(r,(N,_)=>{const H=W(r,_);H&&(N.disabled=H._f.disabled||C,Array.isArray(H._f.refs)&&H._f.refs.forEach(V=>{V.disabled=H._f.disabled||C}))},0,!1))},ft=(C,N)=>async _=>{let H;if(_&&(_.preventDefault&&_.preventDefault(),_.persist&&_.persist()),t.disabled){N&&await N({...n.errors},_);return}let V=He(s);if(p.state.next({isSubmitting:!0}),t.resolver){const{errors:L,values:X}=await O();n.errors=L,V=X}else await D(r);if(xe(n.errors,"root"),Me(n.errors)){p.state.next({errors:{}});try{await C(V,_)}catch(L){H=L}}else N&&await N({...n.errors},_),je(),setTimeout(je);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Me(n.errors)&&!H,submitCount:n.submitCount+1,errors:n.errors}),H)throw H},Xt=(C,N={})=>{W(r,C)&&(pe(N.defaultValue)?U(C,He(W(o,C))):(U(C,N.defaultValue),fe(o,C,He(N.defaultValue))),N.keepTouched||xe(n.touchedFields,C),N.keepDirty||(xe(n.dirtyFields,C),n.isDirty=N.defaultValue?k(C,He(W(o,C))):k()),N.keepError||(xe(n.errors,C),f.isValid&&y()),p.state.next({...n}))},Pe=(C,N={})=>{const _=C?He(C):o,H=He(_),V=Me(C),L=V?o:H;if(N.keepDefaultValues||(o=_),!N.keepValues){if(N.keepDirtyValues){const X=new Set([...a.mount,...Object.keys(Gn(o,s))]);for(const se of Array.from(X))W(n.dirtyFields,se)?fe(L,se,W(s,se)):U(se,W(L,se))}else{if(ai&&pe(C))for(const X of a.mount){const se=W(r,X);if(se&&se._f){const me=Array.isArray(se._f.refs)?se._f.refs[0]:se._f.ref;if(no(me)){const ve=me.closest("form");if(ve){ve.reset();break}}}}r={}}s=t.shouldUnregister?N.keepDefaultValues?He(o):{}:He(L),p.array.next({values:{...L}}),p.values.next({values:{...L}})}a={mount:N.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!f.isValid||!!N.keepIsValid||!!N.keepDirtyValues,i.watch=!!t.shouldUnregister,p.state.next({submitCount:N.keepSubmitCount?n.submitCount:0,isDirty:V?!1:N.keepDirty?n.isDirty:!!(N.keepDefaultValues&&!Vt(C,o)),isSubmitted:N.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:V?{}:N.keepDirtyValues?N.keepDefaultValues&&s?Gn(o,s):n.dirtyFields:N.keepDefaultValues&&C?Gn(o,C):N.keepDirty?n.dirtyFields:{},touchedFields:N.keepTouched?n.touchedFields:{},errors:N.keepErrors?n.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},pt=(C,N)=>Pe(dt(C)?C(s):C,N);return{control:{register:tt,unregister:Se,getFieldState:Ee,handleSubmit:ft,setError:Ue,_executeSchema:O,_getWatch:z,_getDirty:k,_updateValid:y,_removeUnmounted:q,_updateFieldArray:b,_updateDisabledField:Ce,_getFieldArray:R,_reset:Pe,_resetDefaultValues:()=>dt(t.defaultValues)&&t.defaultValues().then(C=>{pt(C,t.resetOptions),p.state.next({isLoading:!1})}),_updateFormState:C=>{n={...n,...C}},_disableForm:nt,_subjects:p,_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:tt,handleSubmit:ft,watch:Nt,setValue:U,getValues:ue,reset:pt,resetField:Xt,clearErrors:Ie,unregister:Se,setError:Ue,setFocus:(C,N={})=>{const _=W(r,C),H=_&&_._f;if(H){const V=H.refs?H.refs[0]:H.ref;V.focus&&(V.focus(),N.shouldSelect&&dt(V.select)&&V.select())}},getFieldState:Ee}}function Ox(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={...Fx(e),formState:r});const s=t.current.control;return s._options=e,vx({subject:s._subjects.state,next:i=>{mx(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&&!Vt(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:hx(r,s)}),[r,s])}const Sd=({className:e,children:t,content:n,side:r})=>{const[o,s]=A.useState(!1);return l.jsx(vn,{delayDuration:0,children:l.jsxs(yn,{open:o,children:[l.jsx(wn,{asChild:!0,children:l.jsx("button",{type:"button",className:te("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})})]})})},hi=({className:e,...t})=>l.jsx("nav",{role:"navigation","aria-label":"pagination",className:te("mx-auto flex w-full justify-center",e),...t});hi.displayName="Pagination";const mi=d.forwardRef(({className:e,...t},n)=>l.jsx("ul",{ref:n,className:te("flex flex-row items-center gap-1",e),...t}));mi.displayName="PaginationContent";const Et=d.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:te("",e),...t}));Et.displayName="PaginationItem";const Kn=({className:e,isActive:t,size:n="icon",...r})=>l.jsx("a",{"aria-current":t?"page":void 0,className:te(Ha({variant:t?"outline":"ghost",size:n}),e),...r});Kn.displayName="PaginationLink";const vi=({className:e,...t})=>l.jsxs(Kn,{"aria-label":"Go to previous page",size:"default",className:te("gap-1 pl-2.5",e),...t,children:[l.jsx(ng,{className:"h-4 w-4"}),l.jsx("span",{children:"Previous"})]});vi.displayName="PaginationPrevious";const yi=({className:e,...t})=>l.jsxs(Kn,{"aria-label":"Go to next page",size:"default",className:te("gap-1 pr-2.5",e),...t,children:[l.jsx("span",{children:"Next"}),l.jsx(Na,{className:"h-4 w-4"})]});yi.displayName="PaginationNext";const wi=({className:e,...t})=>l.jsxs("span",{"aria-hidden":!0,className:te("flex h-9 w-9 items-center justify-center",e),...t,children:[l.jsx(rg,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"More pages"})]});wi.displayName="PaginationEllipsis";const Dx=(e,t)=>{const[n,r]=A.useState(e);return A.useEffect(()=>{const o=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(o)}},[e,t]),n},Mx=({apiBaseUrl:e="https://s3-explorer.cmcts1.studio.ai.vn"})=>{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),[p,m]=A.useState(null),[g,v]=A.useState(""),h=Dx(g,500),y=O=>{const I=O.match(/\d{6}/);if(!I)return{month:"",year:""};const D=I[0],q=D.substring(0,2),k=D.substring(2);return{month:q,year:k}},w=O=>O.map(D=>{let q=(D==null?void 0:D.month)||"",k=(D==null?void 0:D.year)||"";if((!q||!k)&&(D!=null&&D.file_name)){const z=y(D.file_name);q=q||z.month,k=k||z.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:q,year:k,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 I=w(O==null?void 0:O.data);n(I),f(O.pagination.totalPages)},S=async(O=1,I=15)=>{m(O),o(!0);try{const D=await oe.get(`${e}/api/latest-summaries`,{params:{page:O,limit:I,search:g}});(D==null?void 0:D.status)===200?b(D.data):console.error(D)}catch(D){console.error("Error fetching data:",D)}finally{m(null),o(!1)}};A.useEffect(()=>{h&&u(1),S(a)},[a,h]);const E=A.useMemo(()=>[{id:"code",header:"Mã",accessorKey:"code",cell:({row:I})=>l.jsx("span",{className:"flex flex-col",children:I.original.code})},{id:"month",header:"Tháng",accessorKey:"month",cell:({row:I})=>{const D=I.original.month,q=I.original.year;return l.jsx("span",{className:"flex flex-col",children:`${D.toString().padStart(2,"0")}/${q}`})}},{id:"content",header:"Nội dung",accessorKey:"content",cell:({row:I})=>{const D=I.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:I})=>{const q=I.original.status!=="unpublish";return l.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0 text-[10px] font-bold ${q?"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:q?"PUBLISHED":"UNPUBLISHED"})}},{id:"note",header:"Ghi chú",accessorKey:"note",cell:({row:I})=>l.jsx(Sd,{content:l.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:I.original.note}),children:l.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[20dvw]",children:I.original.note})})},{id:"last-update",header:"Cập nhật",accessorKey:"last-update",cell:({row:I})=>{const D=new Date(I.original.lastUpdate),q=D.getDate(),k=D.getMonth()+1,z=`ngày ${q} tháng ${k}`;return l.jsx("span",{className:"flex flex-col",children:z})}},{accessorKey:"actions",header:()=>l.jsx("div",{className:"font-medium text-right",children:"Hành động"}),cell:({row:I})=>{const[D,q]=A.useState(!1),[k,z]=A.useState(!1),[R,J]=A.useState(!1),{handleSubmit:B,register:U,reset:K}=Ox(),Y=I.original.id,le=I.getValue("status"),ue=I.getValue("content"),[Ee,Ie]=A.useState(!1),Ue=async()=>{try{Ie(!0);const Se=le==="unpublish"?"published":"unpublish",Ce=await oe.patch(`${e}/api/toggle-publish/${Y}`,{id:Y,typeAction:"update",status:le,idInput:Y,stock_id:I.original.stock_id,prefix:I.original.prefix,model:I.original.model,summary_result:I.original.content,note:I.original.note});Ce.status===200?n(tt=>tt.map(je=>je.id===Y?{...je,status:Se}:je)):console.error("Failed to toggle publish status:",Ce)}catch(Se){console.error("Error toggling publish status:",Se)}finally{Ie(!1)}},Nt=async Se=>{q(!0);try{const Ce=await oe.patch(`${e}/api/update-summary`,{note:Se.note,text_summary:Se.content,id:Y});Ce.status===200?(await S(a),z(!1)):console.error("Failed to update summary:",Ce)}catch(Ce){console.error("Error updating summary:",Ce)}return q(!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(og,{className:"h-4 w-4"})}),l.jsx(It,{open:R,onOpenChange:J,children:l.jsxs(vt,{className:"max-w-3xl max-h-[80vh]",children:[l.jsx(yt,{children:l.jsx(wt,{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:ue})})]})}),l.jsxs(It,{open:k,onOpenChange:Se=>{z(Se),Se?K({content:I.original.content,note:I.original.note}):K()},children:[l.jsx(Er,{asChild:!0,children:l.jsx(ie,{variant:"outline",size:"sm",onClick:()=>z(!0),className:"px-2 py-0.5 h-7",children:"Sửa"})}),l.jsx(vt,{className:"rounded-lg sm:px-3 h-[calc(100dvh-200px)] min-w-[calc(100dvw-112px)]",children:l.jsxs(yt,{className:"flex flex-col gap-3",children:[l.jsx(wt,{className:"max-sm:hidden text-center",children:"Sửa summary"}),l.jsxs("form",{className:"flex flex-col gap-3 h-full justify-between",onSubmit:B(Nt),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(In,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:I.original.answer||"",rows:10,...U("content")})]}),l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{children:"Ghi chú:"}),l.jsx(In,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:I.original.note||"",rows:1,...U("note")})]})]}),l.jsx("div",{className:"flex justify-end",children:l.jsx(ie,{disabled:D,type:"submit",variant:"default",children:D?l.jsx(ye,{className:"h-4 w-4 animate-spin"}):"Ok"})})]})]})})]}),l.jsx(ie,{variant:"outline",size:"sm",onClick:Ue,disabled:Ee,className:"w-[70px] px-2 py-0.5 h-7",children:Ee?l.jsx(ye,{className:"h-4 w-4 animate-spin"}):le==="unpublish"?"Publish":"Unpublish"})]})}}],[]),x=Vi({data:t,columns:E,state:{columnFilters:s},enableRowSelection:!0,onColumnFiltersChange:i,getFilteredRowModel:Ef(),getCoreRowModel:Ri()});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(kt,{placeholder:"Tìm kiếm theo mã...",value:g,onChange:O=>v(O.target.value),className:"pr-8"}),g&&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(Uo,{className:"h-4 w-4"})})]})}),l.jsx("div",{className:"rounded-md border s3-explr-table-container",children:l.jsxs(Nr,{className:"s3-explr-table",children:[l.jsx(Tr,{className:"s3-explr-table-header",children:x.getHeaderGroups().map(O=>l.jsx(Ye,{className:"hover:bg-transparent s3-explr-header-row",children:O.headers.map(I=>l.jsx(st,{className:"s3-explr-header-cell",children:I.isPlaceholder?null:nr(I.column.columnDef.header,I.getContext())},I.id))},O.id))}),l.jsx(Pr,{className:"s3-explr-table-body",children:r?l.jsx(Ye,{children:l.jsx(De,{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(Ye,{className:"h-12 s3-explr-row",children:O.getVisibleCells().map(I=>l.jsx(De,{className:"align-middle s3-explr-cell",children:nr(I.column.columnDef.cell,I.getContext())},I.id))},O.id)):l.jsx(Ye,{children:l.jsx(De,{colSpan:E.length,className:"h-24 text-center",children:"Không có kết quả."})})})]})}),l.jsx("div",{className:"mt-4",children:l.jsx(hi,{children:l.jsxs(mi,{children:[l.jsx(Et,{children:l.jsx(vi,{onClick:()=>u(O=>Math.max(1,O-1)),className:a===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:c},(O,I)=>I+1).filter(O=>O===1||O===c||Math.abs(O-a)<=1).map((O,I,D)=>l.jsxs(l.Fragment,{children:[I>0&&D[I-1]!==O-1&&l.jsx(Et,{children:l.jsx(wi,{})},O+"..."),l.jsx(Et,{children:l.jsx(Kn,{onClick:()=>u(O),isActive:a===O,className:`cursor-pointer ${r?"pointer-events-none":""}`,children:p===O?l.jsx(ye,{className:"h-4 w-4 animate-spin"}):O})},O)]})),l.jsx(Et,{children:l.jsx(yi,{onClick:()=>u(O=>Math.min(c,O+1)),className:a===c||p!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})})]})},Ed=10,Ix=A.memo(({apiBaseUrl:e="https://s3-explorer.cmcts1.studio.ai.vn"})=>{const[t,n]=A.useState(1),[r,o]=A.useState([]),[s,i]=A.useState({total:0,page:1,limit:Ed,totalPages:1}),[a,u]=A.useState(!0),[c,f]=A.useState(null),[p,m]=A.useState(new Set),{toast:g}=Rr(),[v,h]=A.useState(!1),y=async x=>{try{f(x);const P=await oe.get(`${e}/api/jobs`,{params:{page:x.toString(),limit:Ed.toString()}});o(P.data.data),i(P.data.pagination)}catch{g({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=>{m(P=>new Set(P).add(x.toString()));try{await oe.post(`${e}/api/retry-job`,{jobId:x}),g({title:"Job Restarted",description:`Job ${x} has been successfully restarted.`}),y(t)}catch{g({variant:"destructive",title:"Retry Failed",description:`Failed to restart job ${x}. Please try again.`})}finally{m(P=>{const F=new Set(P);return F.delete(x.toString()),F})}},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 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(eg,{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(ag,{className:`h-4 w-4 ${v?"animate-spin":""}`})})]}),l.jsx("div",{className:"rounded-md border",children:l.jsxs(Nr,{children:[l.jsx(Tr,{children:l.jsxs(Ye,{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(Pr,{children:a&&r.length===0?l.jsx(Ye,{children:l.jsx(De,{colSpan:7,className:"text-center py-4",children:l.jsx(ye,{className:"w-6 h-6 animate-spin mx-auto"})})}):r.map(x=>{var P,F;return l.jsxs(Ye,{children:[l.jsx(De,{className:"!w-[100px]",children:x.id}),l.jsx(De,{className:"font-medium",children:(P=x.job_name)==null?void 0:P.replace("Upload file","Summary")}),l.jsx(De,{className:"!w-[200px]",children:S(x.created_at)}),l.jsx(De,{className:"!w-[200px]",children:S(x.updated_at)}),l.jsx(De,{className:"!w-[150px]",children:E(x.execution_time_seconds)}),l.jsx(De,{className:"!w-[200px]",children:l.jsx(Sd,{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]
|
|
147
|
-
${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":(F=x.status)==null?void 0:F.toUpperCase()})})}),l.jsx(
|
|
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":(F=x.status)==null?void 0:F.toUpperCase()})})}),l.jsx(Ie,{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(yi,{children:l.jsxs(wi,{children:[l.jsx(St,{children:l.jsx(bi,{onClick:()=>n(x=>Math.max(1,x-1)),className:t===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:s.totalPages},(x,P)=>P+1).filter(x=>x===1||x===s.totalPages||Math.abs(x-t)<=1).map((x,P,F)=>l.jsxs(l.Fragment,{children:[P>0&&F[P-1]!==x-1&&l.jsx(St,{children:l.jsx(Ci,{})},x+"..."),l.jsx(St,{children:l.jsx(Jn,{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(St,{children:l.jsx(xi,{onClick:()=>n(x=>Math.min(s.totalPages,x+1)),className:t===s.totalPages||c!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})}),l.jsx(Qc,{})]})});Ge.Job=$x,Ge.S3Explorer=fx,Ge.Summary=kx,Object.defineProperty(Ge,Symbol.toStringTag,{value:"Module"})});
|
|
148
153
|
//# sourceMappingURL=s3-explorer.umd.cjs.map
|