@spaceandtimelabs/makeinfinite-ui 0.53.3 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1444 -0
- package/dist/makeinfinite-ui.es.js +45615 -0
- package/dist/makeinfinite-ui.umd.js +363 -0
- package/package.json +2 -1
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
(function(Be,_t){typeof exports=="object"&&typeof module<"u"?_t(exports,require("isomorphic-git"),require("react"),require("@babel/standalone"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","isomorphic-git","react","@babel/standalone","react-dom"],_t):(Be=typeof globalThis<"u"?globalThis:Be||self,_t(Be.MakeInfinite={},Be.git,Be.React,Be.Babel,Be.ReactDOM))})(this,function(Be,_t,x,Kj,Zr){"use strict";var Wse=Object.defineProperty;var Vse=(Be,_t,x)=>_t in Be?Wse(Be,_t,{enumerable:!0,configurable:!0,writable:!0,value:x}):Be[_t]=x;var Pr=(Be,_t,x)=>Vse(Be,typeof _t!="symbol"?_t+"":_t,x);var qj;function xh(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 w=xh(x),Vb=xh(Kj),Xc=xh(Zr);var Jc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function il(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Qc(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var Xj=Jj;function Jj(e){var t,n;if(typeof e!="function")throw new Error("expected a function but got "+e);return function(){return t||(t=!0,n=e.apply(this,arguments)),n}}(function(e){function t(v,b){var _;return v instanceof Buffer?_=v:_=Buffer.from(v.buffer,v.byteOffset,v.byteLength),_.toString(b)}var n=function(v){return Buffer.from(v)};function r(v){for(var b=0,_=Math.min(256*256,v.length+1),C=new Uint16Array(_),N=[],A=0;;){var R=b<v.length;if(!R||A>=_-1){var D=C.subarray(0,A),k=D;if(N.push(String.fromCharCode.apply(null,k)),!R)return N.join("");v=v.subarray(b),b=0,A=0}var F=v[b++];if(!(F&128))C[A++]=F;else if((F&224)===192){var W=v[b++]&63;C[A++]=(F&31)<<6|W}else if((F&240)===224){var W=v[b++]&63,B=v[b++]&63;C[A++]=(F&31)<<12|W<<6|B}else if((F&248)===240){var W=v[b++]&63,B=v[b++]&63,T=v[b++]&63,Q=(F&7)<<18|W<<12|B<<6|T;Q>65535&&(Q-=65536,C[A++]=Q>>>10&1023|55296,Q=56320|Q&1023),C[A++]=Q}}}function o(v){for(var b=0,_=v.length,C=0,N=Math.max(32,_+(_>>>1)+7),A=new Uint8Array(N>>>3<<3);b<_;){var R=v.charCodeAt(b++);if(R>=55296&&R<=56319){if(b<_){var D=v.charCodeAt(b);(D&64512)===56320&&(++b,R=((R&1023)<<10)+(D&1023)+65536)}if(R>=55296&&R<=56319)continue}if(C+4>A.length){N+=8,N*=1+b/v.length*2,N=N>>>3<<3;var k=new Uint8Array(N);k.set(A),A=k}if(R&4294967168)if(!(R&4294965248))A[C++]=R>>>6&31|192;else if(!(R&4294901760))A[C++]=R>>>12&15|224,A[C++]=R>>>6&63|128;else if(!(R&4292870144))A[C++]=R>>>18&7|240,A[C++]=R>>>12&63|128,A[C++]=R>>>6&63|128;else continue;else{A[C++]=R;continue}A[C++]=R&63|128}return A.slice?A.slice(0,C):A.subarray(0,C)}var i="Failed to ",s=function(v,b,_){if(v)throw new Error("".concat(i).concat(b,": the '").concat(_,"' option is unsupported."))},a=typeof Buffer=="function"&&Buffer.from,l=a?n:o;function c(){this.encoding="utf-8"}c.prototype.encode=function(v,b){return s(b&&b.stream,"encode","stream"),l(v)};function d(v){var b;try{var _=new Blob([v],{type:"text/plain;charset=UTF-8"});b=URL.createObjectURL(_);var C=new XMLHttpRequest;return C.open("GET",b,!1),C.send(),C.responseText}finally{b&&URL.revokeObjectURL(b)}}var u=!a&&typeof Blob=="function"&&typeof URL=="function"&&typeof URL.createObjectURL=="function",f=["utf-8","utf8","unicode-1-1-utf-8"],h=r;a?h=t:u&&(h=function(v){try{return d(v)}catch{return r(v)}});var m="construct 'TextDecoder'",p="".concat(i," ").concat(m,": the ");function y(v,b){s(b&&b.fatal,m,"fatal"),v=v||"utf-8";var _;if(a?_=Buffer.isEncoding(v):_=f.indexOf(v.toLowerCase())!==-1,!_)throw new RangeError("".concat(p," encoding label provided ('").concat(v,"') is invalid."));this.encoding=v,this.fatal=!1,this.ignoreBOM=!1}y.prototype.decode=function(v,b){s(b&&b.stream,"decode","stream");var _;return v instanceof Uint8Array?_=v:v.buffer instanceof ArrayBuffer?_=new Uint8Array(v.buffer):_=new Uint8Array(v),h(_,this.encoding)},e.TextEncoder=e.TextEncoder||c,e.TextDecoder=e.TextDecoder||y})(typeof window<"u"?window:Jc);var Qj={encode:e=>new TextEncoder().encode(e),decode:e=>new TextDecoder().decode(e)},Zj=eF;function eF(e,t,n){var r;return function(){if(!t)return e.apply(this,arguments);var o=this,i=arguments,s=n&&!r;if(clearTimeout(r),r=setTimeout(function(){if(r=null,!s)return e.apply(o,i)},t),s)return e.apply(this,arguments)}}function Ub(e){if(e.length===0)return".";let t=Hb(e);return t=t.reduce(oF,[]),Eh(...t)}function tF(...e){let t="";for(let n of e)n.startsWith("/")?t=n:t=Ub(Eh(t,n));return t}function Eh(...e){if(e.length===0)return"";let t=e.join("/");return t=t.replace(/\/{2,}/g,"/"),t}function Hb(e){if(e.length===0)return[];if(e==="/")return["/"];let t=e.split("/");return t[t.length-1]===""&&t.pop(),e[0]==="/"?t[0]="/":t[0]!=="."&&t.unshift("."),t}function nF(e){const t=e.lastIndexOf("/");if(t===-1)throw new Error(`Cannot get dirname of "${e}"`);return t===0?"/":e.slice(0,t)}function rF(e){if(e==="/")throw new Error(`Cannot get basename of "${e}"`);const t=e.lastIndexOf("/");return t===-1?e:e.slice(t+1)}function oF(e,t){if(e.length===0)return e.push(t),e;if(t===".")return e;if(t===".."){if(e.length===1){if(e[0]==="/")throw new Error("Unable to normalize path - traverses above root directory");if(e[0]===".")return e.push(t),e}return e[e.length-1]===".."?(e.push(".."),e):(e.pop(),e)}return e.push(t),e}var Ch={join:Eh,normalize:Ub,split:Hb,basename:rF,dirname:nF,resolve:tF};function sl(e){return class extends Error{constructor(...t){super(...t),this.code=e,this.message?this.message=e+": "+this.message:this.message=e}}}const iF=sl("EEXIST"),sF=sl("ENOENT"),aF=sl("ENOTDIR"),lF=sl("ENOTEMPTY"),cF=sl("ETIMEDOUT");var Gb={EEXIST:iF,ENOENT:sF,ENOTDIR:aF,ENOTEMPTY:lF,ETIMEDOUT:cF};const kn=Ch,{EEXIST:Yb,ENOENT:uF,ENOTDIR:qb,ENOTEMPTY:dF}=Gb,xn=0;var fF=class{constructor(){}_makeRoot(t=new Map){return t.set(xn,{mode:511,type:"dir",size:0,ino:0,mtimeMs:Date.now()}),t}activate(t=null){t===null?this._root=new Map([["/",this._makeRoot()]]):typeof t=="string"?this._root=new Map([["/",this._makeRoot(this.parse(t))]]):this._root=t}get activated(){return!!this._root}deactivate(){this._root=void 0}size(){return this._countInodes(this._root.get("/"))-1}_countInodes(t){let n=1;for(let[r,o]of t)r!==xn&&(n+=this._countInodes(o));return n}autoinc(){return this._maxInode(this._root.get("/"))+1}_maxInode(t){let n=t.get(xn).ino;for(let[r,o]of t)r!==xn&&(n=Math.max(n,this._maxInode(o)));return n}print(t=this._root.get("/")){let n="";const r=(o,i)=>{for(let[s,a]of o){if(s===0)continue;let l=a.get(xn),c=l.mode.toString(8);n+=`${" ".repeat(i)}${s} ${c}`,l.type==="file"?n+=` ${l.size} ${l.mtimeMs}
|
|
2
|
+
`:(n+=`
|
|
3
|
+
`,r(a,i+1))}};return r(t,0),n}parse(t){let n=0;function r(a){const l=++n,c=a.length===1?"dir":"file";let[d,u,f]=a;return d=parseInt(d,8),u=u?parseInt(u):0,f=f?parseInt(f):Date.now(),new Map([[xn,{mode:d,type:c,size:u,mtimeMs:f,ino:l}]])}let o=t.trim().split(`
|
|
4
|
+
`),i=this._makeRoot(),s=[{indent:-1,node:i},{indent:0,node:null}];for(let a of o){let c=a.match(/^\t*/)[0].length;a=a.slice(c);let[d,...u]=a.split(" "),f=r(u);if(c<=s[s.length-1].indent)for(;c<=s[s.length-1].indent;)s.pop();s.push({indent:c,node:f}),s[s.length-2].node.set(d,f)}return i}_lookup(t,n=!0){let r=this._root,o="/",i=kn.split(t);for(let s=0;s<i.length;++s){let a=i[s];if(r=r.get(a),!r)throw new uF(t);if(n||s<i.length-1){const l=r.get(xn);if(l.type==="symlink"){let c=kn.resolve(o,l.target);r=this._lookup(c)}o?o=kn.join(o,a):o=a}}return r}mkdir(t,{mode:n}){if(t==="/")throw new Yb;let r=this._lookup(kn.dirname(t)),o=kn.basename(t);if(r.has(o))throw new Yb;let i=new Map,s={mode:n,type:"dir",size:0,mtimeMs:Date.now(),ino:this.autoinc()};i.set(xn,s),r.set(o,i)}rmdir(t){let n=this._lookup(t);if(n.get(xn).type!=="dir")throw new qb;if(n.size>1)throw new dF;let r=this._lookup(kn.dirname(t)),o=kn.basename(t);r.delete(o)}readdir(t){let n=this._lookup(t);if(n.get(xn).type!=="dir")throw new qb;return[...n.keys()].filter(r=>typeof r=="string")}writeStat(t,n,{mode:r}){let o;try{let c=this.stat(t);r==null&&(r=c.mode),o=c.ino}catch{}r==null&&(r=438),o==null&&(o=this.autoinc());let i=this._lookup(kn.dirname(t)),s=kn.basename(t),a={mode:r,type:"file",size:n,mtimeMs:Date.now(),ino:o},l=new Map;return l.set(xn,a),i.set(s,l),a}unlink(t){let n=this._lookup(kn.dirname(t)),r=kn.basename(t);n.delete(r)}rename(t,n){let r=kn.basename(n),o=this._lookup(t);this._lookup(kn.dirname(n)).set(r,o),this.unlink(t)}stat(t){return this._lookup(t).get(xn)}lstat(t){return this._lookup(t,!1).get(xn)}readlink(t){return this._lookup(t,!1).get(xn).target}symlink(t,n){let r,o;try{let c=this.stat(n);o===null&&(o=c.mode),r=c.ino}catch{}o==null&&(o=40960),r==null&&(r=this.autoinc());let i=this._lookup(kn.dirname(n)),s=kn.basename(n),a={mode:o,type:"symlink",target:t,size:0,mtimeMs:Date.now(),ino:r},l=new Map;return l.set(xn,a),i.set(s,l),a}_du(t){let n=0;for(const[r,o]of t.entries())r===xn?n+=o.size:n+=this._du(o);return n}du(t){let n=this._lookup(t);return this._du(n)}};class Kb{constructor(t="keyval-store",n="keyval"){this.storeName=n,this._dbName=t,this._storeName=n,this._init()}_init(){this._dbp||(this._dbp=new Promise((t,n)=>{const r=indexedDB.open(this._dbName);r.onerror=()=>n(r.error),r.onsuccess=()=>t(r.result),r.onupgradeneeded=()=>{r.result.createObjectStore(this._storeName)}}))}_withIDBStore(t,n){return this._init(),this._dbp.then(r=>new Promise((o,i)=>{const s=r.transaction(this.storeName,t);s.oncomplete=()=>o(),s.onabort=s.onerror=()=>i(s.error),n(s.objectStore(this.storeName))}))}_close(){return this._init(),this._dbp.then(t=>{t.close(),this._dbp=void 0})}}let Nh;function Fi(){return Nh||(Nh=new Kb),Nh}function hF(e,t=Fi()){let n;return t._withIDBStore("readwrite",r=>{n=r.get(e)}).then(()=>n.result)}function pF(e,t,n=Fi()){return n._withIDBStore("readwrite",r=>{r.put(t,e)})}function mF(e,t,n=Fi()){return n._withIDBStore("readwrite",r=>{const o=r.get(e);o.onsuccess=()=>{r.put(t(o.result),e)}})}function gF(e,t=Fi()){return t._withIDBStore("readwrite",n=>{n.delete(e)})}function yF(e=Fi()){return e._withIDBStore("readwrite",t=>{t.clear()})}function wF(e=Fi()){const t=[];return e._withIDBStore("readwrite",n=>{(n.openKeyCursor||n.openCursor).call(n).onsuccess=function(){this.result&&(t.push(this.result.key),this.result.continue())}}).then(()=>t)}function vF(e=Fi()){return e._close()}const Xb=Qc(Object.freeze(Object.defineProperty({__proto__:null,Store:Kb,clear:yF,close:vF,del:gF,get:hF,keys:wF,set:pF,update:mF},Symbol.toStringTag,{value:"Module"}))),ti=Xb;var bF=class{constructor(t,n){this._database=t,this._storename=n,this._store=new ti.Store(this._database,this._storename)}saveSuperblock(t){return ti.set("!root",t,this._store)}loadSuperblock(){return ti.get("!root",this._store)}readFile(t){return ti.get(t,this._store)}writeFile(t,n){return ti.set(t,n,this._store)}unlink(t){return ti.del(t,this._store)}wipe(){return ti.clear(this._store)}close(){return ti.close(this._store)}},_F=class{constructor(t){this._url=t}loadSuperblock(){return fetch(this._url+"/.superblock.txt").then(t=>t.ok?t.text():null)}async readFile(t){const n=await fetch(this._url+t);if(n.status===200)return n.arrayBuffer();throw new Error("ENOENT")}async sizeFile(t){const n=await fetch(this._url+t,{method:"HEAD"});if(n.status===200)return n.headers.get("content-length");throw new Error("ENOENT")}};const al=Xb,SF=e=>new Promise(t=>setTimeout(t,e));var xF=class{constructor(t,n){this._id=Math.random(),this._database=t,this._storename=n,this._store=new al.Store(this._database,this._storename),this._lock=null}async has({margin:t=2e3}={}){if(this._lock&&this._lock.holder===this._id){const n=Date.now();return this._lock.expires>n+t?!0:await this.renew()}else return!1}async renew({ttl:t=5e3}={}){let n;return await al.update("lock",r=>{const i=Date.now()+t;return n=r&&r.holder===this._id,this._lock=n?{holder:this._id,expires:i}:r,this._lock},this._store),n}async acquire({ttl:t=5e3}={}){let n,r,o;if(await al.update("lock",i=>{const s=Date.now(),a=s+t;return r=i&&i.expires<s,n=i===void 0||r,o=i&&i.holder===this._id,this._lock=n?{holder:this._id,expires:a}:i,this._lock},this._store),o)throw new Error("Mutex double-locked");return n}async wait({interval:t=100,limit:n=6e3,ttl:r}={}){for(;n--;){if(await this.acquire({ttl:r}))return!0;await SF(t)}throw new Error("Mutex timeout")}async release({force:t=!1}={}){let n,r,o;if(await al.update("lock",i=>(n=t||i&&i.holder===this._id,r=i===void 0,o=i&&i.holder!==this._id,this._lock=n?void 0:i,this._lock),this._store),await al.close(this._store),!n&&!t){if(r)throw new Error("Mutex double-freed");if(o)throw new Error("Mutex lost ownership")}return n}},EF=class{constructor(t){this._id=Math.random(),this._database=t,this._has=!1,this._release=null}async has(){return this._has}async acquire(){return new Promise(t=>{navigator.locks.request(this._database+"_lock",{ifAvailable:!0},n=>(this._has=!!n,t(!!n),new Promise(r=>{this._release=r})))})}async wait({timeout:t=6e5}={}){return new Promise((n,r)=>{const o=new AbortController;setTimeout(()=>{o.abort(),r(new Error("Mutex timeout"))},t),navigator.locks.request(this._database+"_lock",{signal:o.signal},i=>(this._has=!!i,n(!!i),new Promise(s=>{this._release=s})))})}async release({force:t=!1}={}){this._has=!1,this._release?this._release():t&&navigator.locks.request(this._database+"_lock",{steal:!0},n=>!0)}};const{encode:CF,decode:Jb}=Qj,NF=Zj,RF=fF,{ENOENT:PF,ENOTEMPTY:AF,ETIMEDOUT:TF}=Gb,DF=bF,MF=_F,IF=xF,OF=EF,ll=Ch;var kF=class{constructor(){this.saveSuperblock=NF(()=>{this.flush()},500)}async init(t,{wipe:n,url:r,urlauto:o,fileDbName:i=t,db:s=null,fileStoreName:a=t+"_files",lockDbName:l=t+"_lock",lockStoreName:c=t+"_lock"}={}){this._name=t,this._idb=s||new DF(i,a),this._mutex=navigator.locks?new OF(t):new IF(l,c),this._cache=new RF(t),this._opts={wipe:n,url:r},this._needsWipe=!!n,r&&(this._http=new MF(r),this._urlauto=!!o)}async activate(){if(this._cache.activated)return;this._needsWipe&&(this._needsWipe=!1,await this._idb.wipe(),await this._mutex.release({force:!0})),await this._mutex.has()||await this._mutex.wait();const t=await this._idb.loadSuperblock();if(t)this._cache.activate(t);else if(this._http){const n=await this._http.loadSuperblock();this._cache.activate(n),await this._saveSuperblock()}else this._cache.activate();if(!await this._mutex.has())throw new TF}async deactivate(){await this._mutex.has()&&await this._saveSuperblock(),this._cache.deactivate();try{await this._mutex.release()}catch(t){console.log(t)}await this._idb.close()}async _saveSuperblock(){this._cache.activated&&(this._lastSavedAt=Date.now(),await this._idb.saveSuperblock(this._cache._root))}_writeStat(t,n,r){let o=ll.split(ll.dirname(t)),i=o.shift();for(let s of o){i=ll.join(i,s);try{this._cache.mkdir(i,{mode:511})}catch{}}return this._cache.writeStat(t,n,r)}async readFile(t,n){const{encoding:r}=n;if(r&&r!=="utf8")throw new Error('Only "utf8" encoding is supported in readFile');let o=null,i=null;try{i=this._cache.stat(t),o=await this._idb.readFile(i.ino)}catch(s){if(!this._urlauto)throw s}if(!o&&this._http){let s=this._cache.lstat(t);for(;s.type==="symlink";)t=ll.resolve(ll.dirname(t),s.target),s=this._cache.lstat(t);o=await this._http.readFile(t)}if(o&&((!i||i.size!=o.byteLength)&&(i=await this._writeStat(t,o.byteLength,{mode:i?i.mode:438}),this.saveSuperblock()),r==="utf8"?o=Jb(o):o.toString=()=>Jb(o)),!i)throw new PF(t);return o}async writeFile(t,n,r){const{mode:o,encoding:i="utf8"}=r;if(typeof n=="string"){if(i!=="utf8")throw new Error('Only "utf8" encoding is supported in writeFile');n=CF(n)}const s=await this._cache.writeStat(t,n.byteLength,{mode:o});await this._idb.writeFile(s.ino,n)}async unlink(t,n){const r=this._cache.lstat(t);this._cache.unlink(t),r.type!=="symlink"&&await this._idb.unlink(r.ino)}readdir(t,n){return this._cache.readdir(t)}mkdir(t,n){const{mode:r=511}=n;this._cache.mkdir(t,{mode:r})}rmdir(t,n){if(t==="/")throw new AF;this._cache.rmdir(t)}rename(t,n){this._cache.rename(t,n)}stat(t,n){return this._cache.stat(t)}lstat(t,n){return this._cache.lstat(t)}readlink(t,n){return this._cache.readlink(t)}symlink(t,n){this._cache.symlink(t,n)}async backFile(t,n){let r=await this._http.sizeFile(t);await this._writeStat(t,r,n)}du(t){return this._cache.du(t)}flush(){return this._saveSuperblock()}},LF=class{constructor(t){this.type=t.type,this.mode=t.mode,this.size=t.size,this.ino=t.ino,this.mtimeMs=t.mtimeMs,this.ctimeMs=t.ctimeMs||t.mtimeMs,this.uid=1,this.gid=1,this.dev=1}isFile(){return this.type==="file"}isDirectory(){return this.type==="dir"}isSymbolicLink(){return this.type==="symlink"}};const jF=kF,Qb=LF,Zc=Ch;function eo(e,t,...n){return e=Zc.normalize(e),(typeof t>"u"||typeof t=="function")&&(t={}),typeof t=="string"&&(t={encoding:t}),[e,t,...n]}function FF(e,t,n,...r){return e=Zc.normalize(e),(typeof n>"u"||typeof n=="function")&&(n={}),typeof n=="string"&&(n={encoding:n}),[e,t,n,...r]}function Zb(e,t,...n){return[Zc.normalize(e),Zc.normalize(t),...n]}var $F=class{constructor(t,n={}){this.init=this.init.bind(this),this.readFile=this._wrap(this.readFile,eo,!1),this.writeFile=this._wrap(this.writeFile,FF,!0),this.unlink=this._wrap(this.unlink,eo,!0),this.readdir=this._wrap(this.readdir,eo,!1),this.mkdir=this._wrap(this.mkdir,eo,!0),this.rmdir=this._wrap(this.rmdir,eo,!0),this.rename=this._wrap(this.rename,Zb,!0),this.stat=this._wrap(this.stat,eo,!1),this.lstat=this._wrap(this.lstat,eo,!1),this.readlink=this._wrap(this.readlink,eo,!1),this.symlink=this._wrap(this.symlink,Zb,!0),this.backFile=this._wrap(this.backFile,eo,!0),this.du=this._wrap(this.du,eo,!1),this._deactivationPromise=null,this._deactivationTimeout=null,this._activationPromise=null,this._operations=new Set,t&&this.init(t,n)}async init(...t){return this._initPromiseResolve&&await this._initPromise,this._initPromise=this._init(...t),this._initPromise}async _init(t,n={}){await this._gracefulShutdown(),this._activationPromise&&await this._deactivate(),this._backend&&this._backend.destroy&&await this._backend.destroy(),this._backend=n.backend||new jF,this._backend.init&&await this._backend.init(t,n),this._initPromiseResolve&&(this._initPromiseResolve(),this._initPromiseResolve=null),n.defer||this.stat("/")}async _gracefulShutdown(){this._operations.size>0&&(this._isShuttingDown=!0,await new Promise(t=>this._gracefulShutdownResolve=t),this._isShuttingDown=!1,this._gracefulShutdownResolve=null)}_wrap(t,n,r){return async(...o)=>{o=n(...o);let i={name:t.name,args:o};this._operations.add(i);try{return await this._activate(),await t.apply(this,o)}finally{this._operations.delete(i),r&&this._backend.saveSuperblock(),this._operations.size===0&&(this._deactivationTimeout||clearTimeout(this._deactivationTimeout),this._deactivationTimeout=setTimeout(this._deactivate.bind(this),500))}}}async _activate(){this._initPromise||console.warn(new Error(`Attempted to use LightningFS ${this._name} before it was initialized.`)),await this._initPromise,this._deactivationTimeout&&(clearTimeout(this._deactivationTimeout),this._deactivationTimeout=null),this._deactivationPromise&&await this._deactivationPromise,this._deactivationPromise=null,this._activationPromise||(this._activationPromise=this._backend.activate?this._backend.activate():Promise.resolve()),await this._activationPromise}async _deactivate(){return this._activationPromise&&await this._activationPromise,this._deactivationPromise||(this._deactivationPromise=this._backend.deactivate?this._backend.deactivate():Promise.resolve()),this._activationPromise=null,this._gracefulShutdownResolve&&this._gracefulShutdownResolve(),this._deactivationPromise}async readFile(t,n){return this._backend.readFile(t,n)}async writeFile(t,n,r){return await this._backend.writeFile(t,n,r),null}async unlink(t,n){return await this._backend.unlink(t,n),null}async readdir(t,n){return this._backend.readdir(t,n)}async mkdir(t,n){return await this._backend.mkdir(t,n),null}async rmdir(t,n){return await this._backend.rmdir(t,n),null}async rename(t,n){return await this._backend.rename(t,n),null}async stat(t,n){const r=await this._backend.stat(t,n);return new Qb(r)}async lstat(t,n){const r=await this._backend.lstat(t,n);return new Qb(r)}async readlink(t,n){return this._backend.readlink(t,n)}async symlink(t,n){return await this._backend.symlink(t,n),null}async backFile(t,n){return await this._backend.backFile(t,n),null}async du(t){return this._backend.du(t)}async flush(){return this._backend.flush()}};const zF=Xj,BF=$F;function Wn(e,t){return typeof e=="function"&&(t=e),t=zF(t),[(...r)=>t(null,...r),t]}var WF=class{constructor(...t){this.promises=new BF(...t),this.init=this.init.bind(this),this.readFile=this.readFile.bind(this),this.writeFile=this.writeFile.bind(this),this.unlink=this.unlink.bind(this),this.readdir=this.readdir.bind(this),this.mkdir=this.mkdir.bind(this),this.rmdir=this.rmdir.bind(this),this.rename=this.rename.bind(this),this.stat=this.stat.bind(this),this.lstat=this.lstat.bind(this),this.readlink=this.readlink.bind(this),this.symlink=this.symlink.bind(this),this.backFile=this.backFile.bind(this),this.du=this.du.bind(this),this.flush=this.flush.bind(this)}init(t,n){return this.promises.init(t,n)}readFile(t,n,r){const[o,i]=Wn(n,r);this.promises.readFile(t,n).then(o).catch(i)}writeFile(t,n,r,o){const[i,s]=Wn(r,o);this.promises.writeFile(t,n,r).then(i).catch(s)}unlink(t,n,r){const[o,i]=Wn(n,r);this.promises.unlink(t,n).then(o).catch(i)}readdir(t,n,r){const[o,i]=Wn(n,r);this.promises.readdir(t,n).then(o).catch(i)}mkdir(t,n,r){const[o,i]=Wn(n,r);this.promises.mkdir(t,n).then(o).catch(i)}rmdir(t,n,r){const[o,i]=Wn(n,r);this.promises.rmdir(t,n).then(o).catch(i)}rename(t,n,r){const[o,i]=Wn(r);this.promises.rename(t,n).then(o).catch(i)}stat(t,n,r){const[o,i]=Wn(n,r);this.promises.stat(t).then(o).catch(i)}lstat(t,n,r){const[o,i]=Wn(n,r);this.promises.lstat(t).then(o).catch(i)}readlink(t,n,r){const[o,i]=Wn(n,r);this.promises.readlink(t).then(o).catch(i)}symlink(t,n,r){const[o,i]=Wn(r);this.promises.symlink(t,n).then(o).catch(i)}backFile(t,n,r){const[o,i]=Wn(n,r);this.promises.backFile(t,n).then(o).catch(i)}du(t,n){const[r,o]=Wn(n);this.promises.du(t).then(r).catch(o)}flush(t){const[n,r]=Wn(t);this.promises.flush().then(n).catch(r)}};const VF=il(WF);var ut={},eu={};eu.byteLength=GF,eu.toByteArray=qF,eu.fromByteArray=JF;for(var to=[],pr=[],UF=typeof Uint8Array<"u"?Uint8Array:Array,Rh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Os=0,HF=Rh.length;Os<HF;++Os)to[Os]=Rh[Os],pr[Rh.charCodeAt(Os)]=Os;pr[45]=62,pr[95]=63;function e_(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function GF(e){var t=e_(e),n=t[0],r=t[1];return(n+r)*3/4-r}function YF(e,t,n){return(t+n)*3/4-n}function qF(e){var t,n=e_(e),r=n[0],o=n[1],i=new UF(YF(e,r,o)),s=0,a=o>0?r-4:r,l;for(l=0;l<a;l+=4)t=pr[e.charCodeAt(l)]<<18|pr[e.charCodeAt(l+1)]<<12|pr[e.charCodeAt(l+2)]<<6|pr[e.charCodeAt(l+3)],i[s++]=t>>16&255,i[s++]=t>>8&255,i[s++]=t&255;return o===2&&(t=pr[e.charCodeAt(l)]<<2|pr[e.charCodeAt(l+1)]>>4,i[s++]=t&255),o===1&&(t=pr[e.charCodeAt(l)]<<10|pr[e.charCodeAt(l+1)]<<4|pr[e.charCodeAt(l+2)]>>2,i[s++]=t>>8&255,i[s++]=t&255),i}function KF(e){return to[e>>18&63]+to[e>>12&63]+to[e>>6&63]+to[e&63]}function XF(e,t,n){for(var r,o=[],i=t;i<n;i+=3)r=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(e[i+2]&255),o.push(KF(r));return o.join("")}function JF(e){for(var t,n=e.length,r=n%3,o=[],i=16383,s=0,a=n-r;s<a;s+=i)o.push(XF(e,s,s+i>a?a:s+i));return r===1?(t=e[n-1],o.push(to[t>>2]+to[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],o.push(to[t>>10]+to[t>>4&63]+to[t<<2&63]+"=")),o.join("")}var Ph={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Ph.read=function(e,t,n,r,o){var i,s,a=o*8-r-1,l=(1<<a)-1,c=l>>1,d=-7,u=n?o-1:0,f=n?-1:1,h=e[t+u];for(u+=f,i=h&(1<<-d)-1,h>>=-d,d+=a;d>0;i=i*256+e[t+u],u+=f,d-=8);for(s=i&(1<<-d)-1,i>>=-d,d+=r;d>0;s=s*256+e[t+u],u+=f,d-=8);if(i===0)i=1-c;else{if(i===l)return s?NaN:(h?-1:1)*(1/0);s=s+Math.pow(2,r),i=i-c}return(h?-1:1)*s*Math.pow(2,i-r)},Ph.write=function(e,t,n,r,o,i){var s,a,l,c=i*8-o-1,d=(1<<c)-1,u=d>>1,f=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,m=r?1:-1,p=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=d):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+u>=1?t+=f/l:t+=f*Math.pow(2,1-u),t*l>=2&&(s++,l/=2),s+u>=d?(a=0,s=d):s+u>=1?(a=(t*l-1)*Math.pow(2,o),s=s+u):(a=t*Math.pow(2,u-1)*Math.pow(2,o),s=0));o>=8;e[n+h]=a&255,h+=m,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;e[n+h]=s&255,h+=m,s/=256,c-=8);e[n+h-m]|=p*128};/*!
|
|
5
|
+
* The buffer module from node.js, for the browser.
|
|
6
|
+
*
|
|
7
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
8
|
+
* @license MIT
|
|
9
|
+
*/(function(e){const t=eu,n=Ph,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=b,e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o,a.TYPED_ARRAY_SUPPORT=i(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{const P=new Uint8Array(1),S={foo:function(){return 42}};return Object.setPrototypeOf(S,Uint8Array.prototype),Object.setPrototypeOf(P,S),P.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function s(P){if(P>o)throw new RangeError('The value "'+P+'" is invalid for option "size"');const S=new Uint8Array(P);return Object.setPrototypeOf(S,a.prototype),S}function a(P,S,E){if(typeof P=="number"){if(typeof S=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return u(P)}return l(P,S,E)}a.poolSize=8192;function l(P,S,E){if(typeof P=="string")return f(P,S);if(ArrayBuffer.isView(P))return m(P);if(P==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof P);if(ue(P,ArrayBuffer)||P&&ue(P.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ue(P,SharedArrayBuffer)||P&&ue(P.buffer,SharedArrayBuffer)))return p(P,S,E);if(typeof P=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const I=P.valueOf&&P.valueOf();if(I!=null&&I!==P)return a.from(I,S,E);const U=y(P);if(U)return U;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof P[Symbol.toPrimitive]=="function")return a.from(P[Symbol.toPrimitive]("string"),S,E);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof P)}a.from=function(P,S,E){return l(P,S,E)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function c(P){if(typeof P!="number")throw new TypeError('"size" argument must be of type number');if(P<0)throw new RangeError('The value "'+P+'" is invalid for option "size"')}function d(P,S,E){return c(P),P<=0?s(P):S!==void 0?typeof E=="string"?s(P).fill(S,E):s(P).fill(S):s(P)}a.alloc=function(P,S,E){return d(P,S,E)};function u(P){return c(P),s(P<0?0:v(P)|0)}a.allocUnsafe=function(P){return u(P)},a.allocUnsafeSlow=function(P){return u(P)};function f(P,S){if((typeof S!="string"||S==="")&&(S="utf8"),!a.isEncoding(S))throw new TypeError("Unknown encoding: "+S);const E=_(P,S)|0;let I=s(E);const U=I.write(P,S);return U!==E&&(I=I.slice(0,U)),I}function h(P){const S=P.length<0?0:v(P.length)|0,E=s(S);for(let I=0;I<S;I+=1)E[I]=P[I]&255;return E}function m(P){if(ue(P,Uint8Array)){const S=new Uint8Array(P);return p(S.buffer,S.byteOffset,S.byteLength)}return h(P)}function p(P,S,E){if(S<0||P.byteLength<S)throw new RangeError('"offset" is outside of buffer bounds');if(P.byteLength<S+(E||0))throw new RangeError('"length" is outside of buffer bounds');let I;return S===void 0&&E===void 0?I=new Uint8Array(P):E===void 0?I=new Uint8Array(P,S):I=new Uint8Array(P,S,E),Object.setPrototypeOf(I,a.prototype),I}function y(P){if(a.isBuffer(P)){const S=v(P.length)|0,E=s(S);return E.length===0||P.copy(E,0,0,S),E}if(P.length!==void 0)return typeof P.length!="number"||ye(P.length)?s(0):h(P);if(P.type==="Buffer"&&Array.isArray(P.data))return h(P.data)}function v(P){if(P>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return P|0}function b(P){return+P!=P&&(P=0),a.alloc(+P)}a.isBuffer=function(S){return S!=null&&S._isBuffer===!0&&S!==a.prototype},a.compare=function(S,E){if(ue(S,Uint8Array)&&(S=a.from(S,S.offset,S.byteLength)),ue(E,Uint8Array)&&(E=a.from(E,E.offset,E.byteLength)),!a.isBuffer(S)||!a.isBuffer(E))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(S===E)return 0;let I=S.length,U=E.length;for(let ie=0,Z=Math.min(I,U);ie<Z;++ie)if(S[ie]!==E[ie]){I=S[ie],U=E[ie];break}return I<U?-1:U<I?1:0},a.isEncoding=function(S){switch(String(S).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(S,E){if(!Array.isArray(S))throw new TypeError('"list" argument must be an Array of Buffers');if(S.length===0)return a.alloc(0);let I;if(E===void 0)for(E=0,I=0;I<S.length;++I)E+=S[I].length;const U=a.allocUnsafe(E);let ie=0;for(I=0;I<S.length;++I){let Z=S[I];if(ue(Z,Uint8Array))ie+Z.length>U.length?(a.isBuffer(Z)||(Z=a.from(Z)),Z.copy(U,ie)):Uint8Array.prototype.set.call(U,Z,ie);else if(a.isBuffer(Z))Z.copy(U,ie);else throw new TypeError('"list" argument must be an Array of Buffers');ie+=Z.length}return U};function _(P,S){if(a.isBuffer(P))return P.length;if(ArrayBuffer.isView(P)||ue(P,ArrayBuffer))return P.byteLength;if(typeof P!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof P);const E=P.length,I=arguments.length>2&&arguments[2]===!0;if(!I&&E===0)return 0;let U=!1;for(;;)switch(S){case"ascii":case"latin1":case"binary":return E;case"utf8":case"utf-8":return we(P).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E*2;case"hex":return E>>>1;case"base64":return te(P).length;default:if(U)return I?-1:we(P).length;S=(""+S).toLowerCase(),U=!0}}a.byteLength=_;function C(P,S,E){let I=!1;if((S===void 0||S<0)&&(S=0),S>this.length||((E===void 0||E>this.length)&&(E=this.length),E<=0)||(E>>>=0,S>>>=0,E<=S))return"";for(P||(P="utf8");;)switch(P){case"hex":return re(this,S,E);case"utf8":case"utf-8":return Q(this,S,E);case"ascii":return ee(this,S,E);case"latin1":case"binary":return G(this,S,E);case"base64":return T(this,S,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X(this,S,E);default:if(I)throw new TypeError("Unknown encoding: "+P);P=(P+"").toLowerCase(),I=!0}}a.prototype._isBuffer=!0;function N(P,S,E){const I=P[S];P[S]=P[E],P[E]=I}a.prototype.swap16=function(){const S=this.length;if(S%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let E=0;E<S;E+=2)N(this,E,E+1);return this},a.prototype.swap32=function(){const S=this.length;if(S%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let E=0;E<S;E+=4)N(this,E,E+3),N(this,E+1,E+2);return this},a.prototype.swap64=function(){const S=this.length;if(S%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let E=0;E<S;E+=8)N(this,E,E+7),N(this,E+1,E+6),N(this,E+2,E+5),N(this,E+3,E+4);return this},a.prototype.toString=function(){const S=this.length;return S===0?"":arguments.length===0?Q(this,0,S):C.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(S){if(!a.isBuffer(S))throw new TypeError("Argument must be a Buffer");return this===S?!0:a.compare(this,S)===0},a.prototype.inspect=function(){let S="";const E=e.INSPECT_MAX_BYTES;return S=this.toString("hex",0,E).replace(/(.{2})/g,"$1 ").trim(),this.length>E&&(S+=" ... "),"<Buffer "+S+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(S,E,I,U,ie){if(ue(S,Uint8Array)&&(S=a.from(S,S.offset,S.byteLength)),!a.isBuffer(S))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof S);if(E===void 0&&(E=0),I===void 0&&(I=S?S.length:0),U===void 0&&(U=0),ie===void 0&&(ie=this.length),E<0||I>S.length||U<0||ie>this.length)throw new RangeError("out of range index");if(U>=ie&&E>=I)return 0;if(U>=ie)return-1;if(E>=I)return 1;if(E>>>=0,I>>>=0,U>>>=0,ie>>>=0,this===S)return 0;let Z=ie-U,Re=I-E;const ct=Math.min(Z,Re),ft=this.slice(U,ie),yt=S.slice(E,I);for(let et=0;et<ct;++et)if(ft[et]!==yt[et]){Z=ft[et],Re=yt[et];break}return Z<Re?-1:Re<Z?1:0};function A(P,S,E,I,U){if(P.length===0)return-1;if(typeof E=="string"?(I=E,E=0):E>2147483647?E=2147483647:E<-2147483648&&(E=-2147483648),E=+E,ye(E)&&(E=U?0:P.length-1),E<0&&(E=P.length+E),E>=P.length){if(U)return-1;E=P.length-1}else if(E<0)if(U)E=0;else return-1;if(typeof S=="string"&&(S=a.from(S,I)),a.isBuffer(S))return S.length===0?-1:R(P,S,E,I,U);if(typeof S=="number")return S=S&255,typeof Uint8Array.prototype.indexOf=="function"?U?Uint8Array.prototype.indexOf.call(P,S,E):Uint8Array.prototype.lastIndexOf.call(P,S,E):R(P,[S],E,I,U);throw new TypeError("val must be string, number or Buffer")}function R(P,S,E,I,U){let ie=1,Z=P.length,Re=S.length;if(I!==void 0&&(I=String(I).toLowerCase(),I==="ucs2"||I==="ucs-2"||I==="utf16le"||I==="utf-16le")){if(P.length<2||S.length<2)return-1;ie=2,Z/=2,Re/=2,E/=2}function ct(yt,et){return ie===1?yt[et]:yt.readUInt16BE(et*ie)}let ft;if(U){let yt=-1;for(ft=E;ft<Z;ft++)if(ct(P,ft)===ct(S,yt===-1?0:ft-yt)){if(yt===-1&&(yt=ft),ft-yt+1===Re)return yt*ie}else yt!==-1&&(ft-=ft-yt),yt=-1}else for(E+Re>Z&&(E=Z-Re),ft=E;ft>=0;ft--){let yt=!0;for(let et=0;et<Re;et++)if(ct(P,ft+et)!==ct(S,et)){yt=!1;break}if(yt)return ft}return-1}a.prototype.includes=function(S,E,I){return this.indexOf(S,E,I)!==-1},a.prototype.indexOf=function(S,E,I){return A(this,S,E,I,!0)},a.prototype.lastIndexOf=function(S,E,I){return A(this,S,E,I,!1)};function D(P,S,E,I){E=Number(E)||0;const U=P.length-E;I?(I=Number(I),I>U&&(I=U)):I=U;const ie=S.length;I>ie/2&&(I=ie/2);let Z;for(Z=0;Z<I;++Z){const Re=parseInt(S.substr(Z*2,2),16);if(ye(Re))return Z;P[E+Z]=Re}return Z}function k(P,S,E,I){return Se(we(S,P.length-E),P,E,I)}function F(P,S,E,I){return Se(M(S),P,E,I)}function W(P,S,E,I){return Se(te(S),P,E,I)}function B(P,S,E,I){return Se(q(S,P.length-E),P,E,I)}a.prototype.write=function(S,E,I,U){if(E===void 0)U="utf8",I=this.length,E=0;else if(I===void 0&&typeof E=="string")U=E,I=this.length,E=0;else if(isFinite(E))E=E>>>0,isFinite(I)?(I=I>>>0,U===void 0&&(U="utf8")):(U=I,I=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ie=this.length-E;if((I===void 0||I>ie)&&(I=ie),S.length>0&&(I<0||E<0)||E>this.length)throw new RangeError("Attempt to write outside buffer bounds");U||(U="utf8");let Z=!1;for(;;)switch(U){case"hex":return D(this,S,E,I);case"utf8":case"utf-8":return k(this,S,E,I);case"ascii":case"latin1":case"binary":return F(this,S,E,I);case"base64":return W(this,S,E,I);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,S,E,I);default:if(Z)throw new TypeError("Unknown encoding: "+U);U=(""+U).toLowerCase(),Z=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(P,S,E){return S===0&&E===P.length?t.fromByteArray(P):t.fromByteArray(P.slice(S,E))}function Q(P,S,E){E=Math.min(P.length,E);const I=[];let U=S;for(;U<E;){const ie=P[U];let Z=null,Re=ie>239?4:ie>223?3:ie>191?2:1;if(U+Re<=E){let ct,ft,yt,et;switch(Re){case 1:ie<128&&(Z=ie);break;case 2:ct=P[U+1],(ct&192)===128&&(et=(ie&31)<<6|ct&63,et>127&&(Z=et));break;case 3:ct=P[U+1],ft=P[U+2],(ct&192)===128&&(ft&192)===128&&(et=(ie&15)<<12|(ct&63)<<6|ft&63,et>2047&&(et<55296||et>57343)&&(Z=et));break;case 4:ct=P[U+1],ft=P[U+2],yt=P[U+3],(ct&192)===128&&(ft&192)===128&&(yt&192)===128&&(et=(ie&15)<<18|(ct&63)<<12|(ft&63)<<6|yt&63,et>65535&&et<1114112&&(Z=et))}}Z===null?(Z=65533,Re=1):Z>65535&&(Z-=65536,I.push(Z>>>10&1023|55296),Z=56320|Z&1023),I.push(Z),U+=Re}return Y(I)}const K=4096;function Y(P){const S=P.length;if(S<=K)return String.fromCharCode.apply(String,P);let E="",I=0;for(;I<S;)E+=String.fromCharCode.apply(String,P.slice(I,I+=K));return E}function ee(P,S,E){let I="";E=Math.min(P.length,E);for(let U=S;U<E;++U)I+=String.fromCharCode(P[U]&127);return I}function G(P,S,E){let I="";E=Math.min(P.length,E);for(let U=S;U<E;++U)I+=String.fromCharCode(P[U]);return I}function re(P,S,E){const I=P.length;(!S||S<0)&&(S=0),(!E||E<0||E>I)&&(E=I);let U="";for(let ie=S;ie<E;++ie)U+=xe[P[ie]];return U}function X(P,S,E){const I=P.slice(S,E);let U="";for(let ie=0;ie<I.length-1;ie+=2)U+=String.fromCharCode(I[ie]+I[ie+1]*256);return U}a.prototype.slice=function(S,E){const I=this.length;S=~~S,E=E===void 0?I:~~E,S<0?(S+=I,S<0&&(S=0)):S>I&&(S=I),E<0?(E+=I,E<0&&(E=0)):E>I&&(E=I),E<S&&(E=S);const U=this.subarray(S,E);return Object.setPrototypeOf(U,a.prototype),U};function J(P,S,E){if(P%1!==0||P<0)throw new RangeError("offset is not uint");if(P+S>E)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(S,E,I){S=S>>>0,E=E>>>0,I||J(S,E,this.length);let U=this[S],ie=1,Z=0;for(;++Z<E&&(ie*=256);)U+=this[S+Z]*ie;return U},a.prototype.readUintBE=a.prototype.readUIntBE=function(S,E,I){S=S>>>0,E=E>>>0,I||J(S,E,this.length);let U=this[S+--E],ie=1;for(;E>0&&(ie*=256);)U+=this[S+--E]*ie;return U},a.prototype.readUint8=a.prototype.readUInt8=function(S,E){return S=S>>>0,E||J(S,1,this.length),this[S]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(S,E){return S=S>>>0,E||J(S,2,this.length),this[S]|this[S+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(S,E){return S=S>>>0,E||J(S,2,this.length),this[S]<<8|this[S+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(S,E){return S=S>>>0,E||J(S,4,this.length),(this[S]|this[S+1]<<8|this[S+2]<<16)+this[S+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(S,E){return S=S>>>0,E||J(S,4,this.length),this[S]*16777216+(this[S+1]<<16|this[S+2]<<8|this[S+3])},a.prototype.readBigUInt64LE=Ae(function(S){S=S>>>0,$(S,"offset");const E=this[S],I=this[S+7];(E===void 0||I===void 0)&&j(S,this.length-8);const U=E+this[++S]*2**8+this[++S]*2**16+this[++S]*2**24,ie=this[++S]+this[++S]*2**8+this[++S]*2**16+I*2**24;return BigInt(U)+(BigInt(ie)<<BigInt(32))}),a.prototype.readBigUInt64BE=Ae(function(S){S=S>>>0,$(S,"offset");const E=this[S],I=this[S+7];(E===void 0||I===void 0)&&j(S,this.length-8);const U=E*2**24+this[++S]*2**16+this[++S]*2**8+this[++S],ie=this[++S]*2**24+this[++S]*2**16+this[++S]*2**8+I;return(BigInt(U)<<BigInt(32))+BigInt(ie)}),a.prototype.readIntLE=function(S,E,I){S=S>>>0,E=E>>>0,I||J(S,E,this.length);let U=this[S],ie=1,Z=0;for(;++Z<E&&(ie*=256);)U+=this[S+Z]*ie;return ie*=128,U>=ie&&(U-=Math.pow(2,8*E)),U},a.prototype.readIntBE=function(S,E,I){S=S>>>0,E=E>>>0,I||J(S,E,this.length);let U=E,ie=1,Z=this[S+--U];for(;U>0&&(ie*=256);)Z+=this[S+--U]*ie;return ie*=128,Z>=ie&&(Z-=Math.pow(2,8*E)),Z},a.prototype.readInt8=function(S,E){return S=S>>>0,E||J(S,1,this.length),this[S]&128?(255-this[S]+1)*-1:this[S]},a.prototype.readInt16LE=function(S,E){S=S>>>0,E||J(S,2,this.length);const I=this[S]|this[S+1]<<8;return I&32768?I|4294901760:I},a.prototype.readInt16BE=function(S,E){S=S>>>0,E||J(S,2,this.length);const I=this[S+1]|this[S]<<8;return I&32768?I|4294901760:I},a.prototype.readInt32LE=function(S,E){return S=S>>>0,E||J(S,4,this.length),this[S]|this[S+1]<<8|this[S+2]<<16|this[S+3]<<24},a.prototype.readInt32BE=function(S,E){return S=S>>>0,E||J(S,4,this.length),this[S]<<24|this[S+1]<<16|this[S+2]<<8|this[S+3]},a.prototype.readBigInt64LE=Ae(function(S){S=S>>>0,$(S,"offset");const E=this[S],I=this[S+7];(E===void 0||I===void 0)&&j(S,this.length-8);const U=this[S+4]+this[S+5]*2**8+this[S+6]*2**16+(I<<24);return(BigInt(U)<<BigInt(32))+BigInt(E+this[++S]*2**8+this[++S]*2**16+this[++S]*2**24)}),a.prototype.readBigInt64BE=Ae(function(S){S=S>>>0,$(S,"offset");const E=this[S],I=this[S+7];(E===void 0||I===void 0)&&j(S,this.length-8);const U=(E<<24)+this[++S]*2**16+this[++S]*2**8+this[++S];return(BigInt(U)<<BigInt(32))+BigInt(this[++S]*2**24+this[++S]*2**16+this[++S]*2**8+I)}),a.prototype.readFloatLE=function(S,E){return S=S>>>0,E||J(S,4,this.length),n.read(this,S,!0,23,4)},a.prototype.readFloatBE=function(S,E){return S=S>>>0,E||J(S,4,this.length),n.read(this,S,!1,23,4)},a.prototype.readDoubleLE=function(S,E){return S=S>>>0,E||J(S,8,this.length),n.read(this,S,!0,52,8)},a.prototype.readDoubleBE=function(S,E){return S=S>>>0,E||J(S,8,this.length),n.read(this,S,!1,52,8)};function se(P,S,E,I,U,ie){if(!a.isBuffer(P))throw new TypeError('"buffer" argument must be a Buffer instance');if(S>U||S<ie)throw new RangeError('"value" argument is out of bounds');if(E+I>P.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(S,E,I,U){if(S=+S,E=E>>>0,I=I>>>0,!U){const Re=Math.pow(2,8*I)-1;se(this,S,E,I,Re,0)}let ie=1,Z=0;for(this[E]=S&255;++Z<I&&(ie*=256);)this[E+Z]=S/ie&255;return E+I},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(S,E,I,U){if(S=+S,E=E>>>0,I=I>>>0,!U){const Re=Math.pow(2,8*I)-1;se(this,S,E,I,Re,0)}let ie=I-1,Z=1;for(this[E+ie]=S&255;--ie>=0&&(Z*=256);)this[E+ie]=S/Z&255;return E+I},a.prototype.writeUint8=a.prototype.writeUInt8=function(S,E,I){return S=+S,E=E>>>0,I||se(this,S,E,1,255,0),this[E]=S&255,E+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(S,E,I){return S=+S,E=E>>>0,I||se(this,S,E,2,65535,0),this[E]=S&255,this[E+1]=S>>>8,E+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(S,E,I){return S=+S,E=E>>>0,I||se(this,S,E,2,65535,0),this[E]=S>>>8,this[E+1]=S&255,E+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(S,E,I){return S=+S,E=E>>>0,I||se(this,S,E,4,4294967295,0),this[E+3]=S>>>24,this[E+2]=S>>>16,this[E+1]=S>>>8,this[E]=S&255,E+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(S,E,I){return S=+S,E=E>>>0,I||se(this,S,E,4,4294967295,0),this[E]=S>>>24,this[E+1]=S>>>16,this[E+2]=S>>>8,this[E+3]=S&255,E+4};function L(P,S,E,I,U){oe(S,I,U,P,E,7);let ie=Number(S&BigInt(4294967295));P[E++]=ie,ie=ie>>8,P[E++]=ie,ie=ie>>8,P[E++]=ie,ie=ie>>8,P[E++]=ie;let Z=Number(S>>BigInt(32)&BigInt(4294967295));return P[E++]=Z,Z=Z>>8,P[E++]=Z,Z=Z>>8,P[E++]=Z,Z=Z>>8,P[E++]=Z,E}function ne(P,S,E,I,U){oe(S,I,U,P,E,7);let ie=Number(S&BigInt(4294967295));P[E+7]=ie,ie=ie>>8,P[E+6]=ie,ie=ie>>8,P[E+5]=ie,ie=ie>>8,P[E+4]=ie;let Z=Number(S>>BigInt(32)&BigInt(4294967295));return P[E+3]=Z,Z=Z>>8,P[E+2]=Z,Z=Z>>8,P[E+1]=Z,Z=Z>>8,P[E]=Z,E+8}a.prototype.writeBigUInt64LE=Ae(function(S,E=0){return L(this,S,E,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Ae(function(S,E=0){return ne(this,S,E,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(S,E,I,U){if(S=+S,E=E>>>0,!U){const ct=Math.pow(2,8*I-1);se(this,S,E,I,ct-1,-ct)}let ie=0,Z=1,Re=0;for(this[E]=S&255;++ie<I&&(Z*=256);)S<0&&Re===0&&this[E+ie-1]!==0&&(Re=1),this[E+ie]=(S/Z>>0)-Re&255;return E+I},a.prototype.writeIntBE=function(S,E,I,U){if(S=+S,E=E>>>0,!U){const ct=Math.pow(2,8*I-1);se(this,S,E,I,ct-1,-ct)}let ie=I-1,Z=1,Re=0;for(this[E+ie]=S&255;--ie>=0&&(Z*=256);)S<0&&Re===0&&this[E+ie+1]!==0&&(Re=1),this[E+ie]=(S/Z>>0)-Re&255;return E+I},a.prototype.writeInt8=function(S,E,I){return S=+S,E=E>>>0,I||se(this,S,E,1,127,-128),S<0&&(S=255+S+1),this[E]=S&255,E+1},a.prototype.writeInt16LE=function(S,E,I){return S=+S,E=E>>>0,I||se(this,S,E,2,32767,-32768),this[E]=S&255,this[E+1]=S>>>8,E+2},a.prototype.writeInt16BE=function(S,E,I){return S=+S,E=E>>>0,I||se(this,S,E,2,32767,-32768),this[E]=S>>>8,this[E+1]=S&255,E+2},a.prototype.writeInt32LE=function(S,E,I){return S=+S,E=E>>>0,I||se(this,S,E,4,2147483647,-2147483648),this[E]=S&255,this[E+1]=S>>>8,this[E+2]=S>>>16,this[E+3]=S>>>24,E+4},a.prototype.writeInt32BE=function(S,E,I){return S=+S,E=E>>>0,I||se(this,S,E,4,2147483647,-2147483648),S<0&&(S=4294967295+S+1),this[E]=S>>>24,this[E+1]=S>>>16,this[E+2]=S>>>8,this[E+3]=S&255,E+4},a.prototype.writeBigInt64LE=Ae(function(S,E=0){return L(this,S,E,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Ae(function(S,E=0){return ne(this,S,E,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function fe(P,S,E,I,U,ie){if(E+I>P.length)throw new RangeError("Index out of range");if(E<0)throw new RangeError("Index out of range")}function H(P,S,E,I,U){return S=+S,E=E>>>0,U||fe(P,S,E,4),n.write(P,S,E,I,23,4),E+4}a.prototype.writeFloatLE=function(S,E,I){return H(this,S,E,!0,I)},a.prototype.writeFloatBE=function(S,E,I){return H(this,S,E,!1,I)};function ae(P,S,E,I,U){return S=+S,E=E>>>0,U||fe(P,S,E,8),n.write(P,S,E,I,52,8),E+8}a.prototype.writeDoubleLE=function(S,E,I){return ae(this,S,E,!0,I)},a.prototype.writeDoubleBE=function(S,E,I){return ae(this,S,E,!1,I)},a.prototype.copy=function(S,E,I,U){if(!a.isBuffer(S))throw new TypeError("argument should be a Buffer");if(I||(I=0),!U&&U!==0&&(U=this.length),E>=S.length&&(E=S.length),E||(E=0),U>0&&U<I&&(U=I),U===I||S.length===0||this.length===0)return 0;if(E<0)throw new RangeError("targetStart out of bounds");if(I<0||I>=this.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("sourceEnd out of bounds");U>this.length&&(U=this.length),S.length-E<U-I&&(U=S.length-E+I);const ie=U-I;return this===S&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(E,I,U):Uint8Array.prototype.set.call(S,this.subarray(I,U),E),ie},a.prototype.fill=function(S,E,I,U){if(typeof S=="string"){if(typeof E=="string"?(U=E,E=0,I=this.length):typeof I=="string"&&(U=I,I=this.length),U!==void 0&&typeof U!="string")throw new TypeError("encoding must be a string");if(typeof U=="string"&&!a.isEncoding(U))throw new TypeError("Unknown encoding: "+U);if(S.length===1){const Z=S.charCodeAt(0);(U==="utf8"&&Z<128||U==="latin1")&&(S=Z)}}else typeof S=="number"?S=S&255:typeof S=="boolean"&&(S=Number(S));if(E<0||this.length<E||this.length<I)throw new RangeError("Out of range index");if(I<=E)return this;E=E>>>0,I=I===void 0?this.length:I>>>0,S||(S=0);let ie;if(typeof S=="number")for(ie=E;ie<I;++ie)this[ie]=S;else{const Z=a.isBuffer(S)?S:a.from(S,U),Re=Z.length;if(Re===0)throw new TypeError('The value "'+S+'" is invalid for argument "value"');for(ie=0;ie<I-E;++ie)this[ie+E]=Z[ie%Re]}return this};const V={};function de(P,S,E){V[P]=class extends E{constructor(){super(),Object.defineProperty(this,"message",{value:S.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${P}]`,this.stack,delete this.name}get code(){return P}set code(U){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:U,writable:!0})}toString(){return`${this.name} [${P}]: ${this.message}`}}}de("ERR_BUFFER_OUT_OF_BOUNDS",function(P){return P?`${P} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),de("ERR_INVALID_ARG_TYPE",function(P,S){return`The "${P}" argument must be of type number. Received type ${typeof S}`},TypeError),de("ERR_OUT_OF_RANGE",function(P,S,E){let I=`The value of "${P}" is out of range.`,U=E;return Number.isInteger(E)&&Math.abs(E)>2**32?U=ge(String(E)):typeof E=="bigint"&&(U=String(E),(E>BigInt(2)**BigInt(32)||E<-(BigInt(2)**BigInt(32)))&&(U=ge(U)),U+="n"),I+=` It must be ${S}. Received ${U}`,I},RangeError);function ge(P){let S="",E=P.length;const I=P[0]==="-"?1:0;for(;E>=I+4;E-=3)S=`_${P.slice(E-3,E)}${S}`;return`${P.slice(0,E)}${S}`}function pe(P,S,E){$(S,"offset"),(P[S]===void 0||P[S+E]===void 0)&&j(S,P.length-(E+1))}function oe(P,S,E,I,U,ie){if(P>E||P<S){const Z=typeof S=="bigint"?"n":"";let Re;throw S===0||S===BigInt(0)?Re=`>= 0${Z} and < 2${Z} ** ${(ie+1)*8}${Z}`:Re=`>= -(2${Z} ** ${(ie+1)*8-1}${Z}) and < 2 ** ${(ie+1)*8-1}${Z}`,new V.ERR_OUT_OF_RANGE("value",Re,P)}pe(I,U,ie)}function $(P,S){if(typeof P!="number")throw new V.ERR_INVALID_ARG_TYPE(S,"number",P)}function j(P,S,E){throw Math.floor(P)!==P?($(P,E),new V.ERR_OUT_OF_RANGE("offset","an integer",P)):S<0?new V.ERR_BUFFER_OUT_OF_BOUNDS:new V.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${S}`,P)}const le=/[^+/0-9A-Za-z-_]/g;function ve(P){if(P=P.split("=")[0],P=P.trim().replace(le,""),P.length<2)return"";for(;P.length%4!==0;)P=P+"=";return P}function we(P,S){S=S||1/0;let E;const I=P.length;let U=null;const ie=[];for(let Z=0;Z<I;++Z){if(E=P.charCodeAt(Z),E>55295&&E<57344){if(!U){if(E>56319){(S-=3)>-1&&ie.push(239,191,189);continue}else if(Z+1===I){(S-=3)>-1&&ie.push(239,191,189);continue}U=E;continue}if(E<56320){(S-=3)>-1&&ie.push(239,191,189),U=E;continue}E=(U-55296<<10|E-56320)+65536}else U&&(S-=3)>-1&&ie.push(239,191,189);if(U=null,E<128){if((S-=1)<0)break;ie.push(E)}else if(E<2048){if((S-=2)<0)break;ie.push(E>>6|192,E&63|128)}else if(E<65536){if((S-=3)<0)break;ie.push(E>>12|224,E>>6&63|128,E&63|128)}else if(E<1114112){if((S-=4)<0)break;ie.push(E>>18|240,E>>12&63|128,E>>6&63|128,E&63|128)}else throw new Error("Invalid code point")}return ie}function M(P){const S=[];for(let E=0;E<P.length;++E)S.push(P.charCodeAt(E)&255);return S}function q(P,S){let E,I,U;const ie=[];for(let Z=0;Z<P.length&&!((S-=2)<0);++Z)E=P.charCodeAt(Z),I=E>>8,U=E%256,ie.push(U),ie.push(I);return ie}function te(P){return t.toByteArray(ve(P))}function Se(P,S,E,I){let U;for(U=0;U<I&&!(U+E>=S.length||U>=P.length);++U)S[U+E]=P[U];return U}function ue(P,S){return P instanceof S||P!=null&&P.constructor!=null&&P.constructor.name!=null&&P.constructor.name===S.name}function ye(P){return P!==P}const xe=function(){const P="0123456789abcdef",S=new Array(256);for(let E=0;E<16;++E){const I=E*16;for(let U=0;U<16;++U)S[I+U]=P[E]+P[U]}return S}();function Ae(P){return typeof BigInt>"u"?Ze:P}function Ze(){throw new Error("BigInt not supported")}})(ut);function QF(e){let t=[e];return{next(){return Promise.resolve({done:t.length===0,value:t.pop()})},return(){return t=[],{}},[Symbol.asyncIterator](){return this}}}function ZF(e){return e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]?e[Symbol.iterator]():e.next?e:QF(e)}async function e$(e,t){const n=ZF(e);for(;;){const{value:r,done:o}=await n.next();if(r&&await t(r),o)break}n.return&&n.return()}async function t$(e){let t=0;const n=[];await e$(e,i=>{n.push(i),t+=i.byteLength});const r=new Uint8Array(t);let o=0;for(const i of n)r.set(i,o),o+=i.byteLength;return r}function n$(e){if(e[Symbol.asyncIterator])return e;const t=e.getReader();return{next(){return t.read()},return(){return t.releaseLock(),{}},[Symbol.asyncIterator](){return this}}}async function r$({onProgress:e,url:t,method:n="GET",headers:r={},body:o}){o&&(o=await t$(o));const i=await fetch(t,{method:n,headers:r,body:o}),s=i.body&&i.body.getReader?n$(i.body):[new Uint8Array(await i.arrayBuffer())];r={};for(const[a,l]of i.headers.entries())r[a]=l;return{url:i.url,method:i.method,statusCode:i.status,statusMessage:i.statusText,body:s,headers:r}}var Ah={request:r$},t_={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function o(l,c,d){this.fn=l,this.context=c,this.once=d||!1}function i(l,c,d,u,f){if(typeof d!="function")throw new TypeError("The listener must be a function");var h=new o(d,u||l,f),m=n?n+c:c;return l._events[m]?l._events[m].fn?l._events[m]=[l._events[m],h]:l._events[m].push(h):(l._events[m]=h,l._eventsCount++),l}function s(l,c){--l._eventsCount===0?l._events=new r:delete l._events[c]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var c=[],d,u;if(this._eventsCount===0)return c;for(u in d=this._events)t.call(d,u)&&c.push(n?u.slice(1):u);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(d)):c},a.prototype.listeners=function(c){var d=n?n+c:c,u=this._events[d];if(!u)return[];if(u.fn)return[u.fn];for(var f=0,h=u.length,m=new Array(h);f<h;f++)m[f]=u[f].fn;return m},a.prototype.listenerCount=function(c){var d=n?n+c:c,u=this._events[d];return u?u.fn?1:u.length:0},a.prototype.emit=function(c,d,u,f,h,m){var p=n?n+c:c;if(!this._events[p])return!1;var y=this._events[p],v=arguments.length,b,_;if(y.fn){switch(y.once&&this.removeListener(c,y.fn,void 0,!0),v){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,d),!0;case 3:return y.fn.call(y.context,d,u),!0;case 4:return y.fn.call(y.context,d,u,f),!0;case 5:return y.fn.call(y.context,d,u,f,h),!0;case 6:return y.fn.call(y.context,d,u,f,h,m),!0}for(_=1,b=new Array(v-1);_<v;_++)b[_-1]=arguments[_];y.fn.apply(y.context,b)}else{var C=y.length,N;for(_=0;_<C;_++)switch(y[_].once&&this.removeListener(c,y[_].fn,void 0,!0),v){case 1:y[_].fn.call(y[_].context);break;case 2:y[_].fn.call(y[_].context,d);break;case 3:y[_].fn.call(y[_].context,d,u);break;case 4:y[_].fn.call(y[_].context,d,u,f);break;default:if(!b)for(N=1,b=new Array(v-1);N<v;N++)b[N-1]=arguments[N];y[_].fn.apply(y[_].context,b)}}return!0},a.prototype.on=function(c,d,u){return i(this,c,d,u,!1)},a.prototype.once=function(c,d,u){return i(this,c,d,u,!0)},a.prototype.removeListener=function(c,d,u,f){var h=n?n+c:c;if(!this._events[h])return this;if(!d)return s(this,h),this;var m=this._events[h];if(m.fn)m.fn===d&&(!f||m.once)&&(!u||m.context===u)&&s(this,h);else{for(var p=0,y=[],v=m.length;p<v;p++)(m[p].fn!==d||f&&!m[p].once||u&&m[p].context!==u)&&y.push(m[p]);y.length?this._events[h]=y.length===1?y[0]:y:s(this,h)}return this},a.prototype.removeAllListeners=function(c){var d;return c?(d=n?n+c:c,this._events[d]&&s(this,d)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a})(t_);var o$=t_.exports;const Th=il(o$);let i$=class extends Th{constructor(n){super();Pr(this,qj,"List");Pr(this,"data",new Set);n&&this.push(...n)}toSet(){return new Set(this.data)}toArray(){return Array.from(this.data)}toJSON(){return Array.from(this.data)}toString(){return this.join(",")}_set(n,r,o=!1){if(Math.abs(n)>this.data.size)throw new ReferenceError("Can not set an element outside the bounds of the list");const i=Array.from(this.data);i.splice(n,+o,r),this.data=new Set(i),this.emit("update")}set(n,r){this._set(n,r,!0)}deleteAt(n){if(Math.abs(n)>this.data.size)throw new ReferenceError("Can not delete an element outside the bounds of the list");this.delete(Array.from(this.data).at(n))}insert(n,r=this.data.size){this._set(r,n,!1)}at(n){if(Math.abs(n)>this.data.size)throw new ReferenceError("Can not access an element outside the bounds of the list");return Array.from(this.data).at(n)}pop(){const n=Array.from(this.data).pop();return n!==void 0&&this.delete(n),n}push(...n){for(const r of n)this.add(r);return this.data.size}join(n){return Array.from(this.data).join(n)}splice(n,r,...o){if(Math.abs(n)>this.data.size)throw new ReferenceError("Can not splice elements outside the bounds of the list");const i=Array.from(this.data),s=i.splice(n,r,...o);return this.data=new Set(i),this.emit("update"),s}add(n){return this.data.add(n),this.emit("update"),this.emit("add",n),this}clear(){this.data.clear(),this.emit("update")}delete(n){const r=this.data.delete(n);return this.emit("update"),r}has(n){return this.data.has(n)}get size(){return this.data.size}entries(){return this.toArray().entries()}keys(){return this.toArray().keys()}values(){return this.data.values()}[(qj=Symbol.toStringTag,Symbol.iterator)](){return this.data[Symbol.iterator]()}};function s$(e,t){const n=Object.entries(e);return Object.fromEntries(n.filter(([r,o])=>t(r,o)))}function Dh(e,...t){const n={};for(const r of t.flat())n[r]=e[r];return n}function a$(e,...t){return s$(e,n=>!t.flat().includes(n))}function l$(e){try{return JSON.parse(e),!0}catch{return!1}}function c$(e){const t=[];for(let n=e;n&&!["Function","Object"].includes(n.constructor.name);n=Object.getPrototypeOf(n))t.push(n.constructor.name);return t}function*u$(e){for(let t=e;t;t=Object.getPrototypeOf(t))yield t}function n_(e=new Error){const t=setTimeout(()=>{throw e},5e3);return()=>clearTimeout(t)}function wt(e){throw e&&typeof e=="object"&&c$(e).includes("Error")&&(Error==null||Error.captureStackTrace(e,wt)),e}const r_=Intl.NumberFormat("en",{notation:"compact"});r_.format.bind(r_);function d$(e=0,t=1){return Math.round(Math.random()*(t-e)+e)}function f$(e){return e.at(0).toUpperCase()+e.slice(1)}const h$=new TextEncoder;function ni(e){return h$.encode(e)}const o_=new TextDecoder;function tu(e){if(!e)return"";if(e.buffer instanceof ArrayBuffer&&!e.buffer.resizable)return o_.decode(e);const t=new Uint8Array(e.byteLength);return t.set(e),o_.decode(t)}function p$(e){const t=e.replace(/-/g,""),n=new Uint8Array(16);for(let r=0;r<16;r++)n[r]=parseInt(t.slice(r*2,r*2+2),16);return n}var he;(function(e){e[e.EPERM=1]="EPERM",e[e.ENOENT=2]="ENOENT",e[e.ESRCH=3]="ESRCH",e[e.EINTR=4]="EINTR",e[e.EIO=5]="EIO",e[e.ENXIO=6]="ENXIO",e[e.E2BIG=7]="E2BIG",e[e.ENOEXEC=8]="ENOEXEC",e[e.EBADF=9]="EBADF",e[e.ECHILD=10]="ECHILD",e[e.EAGAIN=11]="EAGAIN",e[e.ENOMEM=12]="ENOMEM",e[e.EACCES=13]="EACCES",e[e.EFAULT=14]="EFAULT",e[e.ENOTBLK=15]="ENOTBLK",e[e.EBUSY=16]="EBUSY",e[e.EEXIST=17]="EEXIST",e[e.EXDEV=18]="EXDEV",e[e.ENODEV=19]="ENODEV",e[e.ENOTDIR=20]="ENOTDIR",e[e.EISDIR=21]="EISDIR",e[e.EINVAL=22]="EINVAL",e[e.ENFILE=23]="ENFILE",e[e.EMFILE=24]="EMFILE",e[e.ETXTBSY=26]="ETXTBSY",e[e.EFBIG=27]="EFBIG",e[e.ENOSPC=28]="ENOSPC",e[e.ESPIPE=29]="ESPIPE",e[e.EROFS=30]="EROFS",e[e.EMLINK=31]="EMLINK",e[e.EPIPE=32]="EPIPE",e[e.EDOM=33]="EDOM",e[e.ERANGE=34]="ERANGE",e[e.EDEADLK=35]="EDEADLK",e[e.ENAMETOOLONG=36]="ENAMETOOLONG",e[e.ENOLCK=37]="ENOLCK",e[e.ENOSYS=38]="ENOSYS",e[e.ENOTEMPTY=39]="ENOTEMPTY",e[e.ELOOP=40]="ELOOP",e[e.ENOMSG=42]="ENOMSG",e[e.EIDRM=43]="EIDRM",e[e.ECHRNG=44]="ECHRNG",e[e.EL2NSYNC=45]="EL2NSYNC",e[e.EL3HLT=46]="EL3HLT",e[e.EL3RST=47]="EL3RST",e[e.ENRNG=48]="ENRNG",e[e.EUNATCH=49]="EUNATCH",e[e.ECSI=50]="ECSI",e[e.EL2HLT=51]="EL2HLT",e[e.EBADE=52]="EBADE",e[e.EBADR=53]="EBADR",e[e.EXFULL=54]="EXFULL",e[e.ENOANO=55]="ENOANO",e[e.EBADRQC=56]="EBADRQC",e[e.EBADSLT=57]="EBADSLT",e[e.EBFONT=59]="EBFONT",e[e.ENOSTR=60]="ENOSTR",e[e.ENODATA=61]="ENODATA",e[e.ETIME=62]="ETIME",e[e.ENOSR=63]="ENOSR",e[e.ENONET=64]="ENONET",e[e.ENOPKG=65]="ENOPKG",e[e.EREMOTE=66]="EREMOTE",e[e.ENOLINK=67]="ENOLINK",e[e.EADV=68]="EADV",e[e.ESRMNT=69]="ESRMNT",e[e.ECOMM=70]="ECOMM",e[e.EPROTO=71]="EPROTO",e[e.EMULTIHOP=72]="EMULTIHOP",e[e.EDOTDOT=73]="EDOTDOT",e[e.EBADMSG=74]="EBADMSG",e[e.EOVERFLOW=75]="EOVERFLOW",e[e.ENOTUNIQ=76]="ENOTUNIQ",e[e.EBADFD=77]="EBADFD",e[e.EREMCHG=78]="EREMCHG",e[e.ELIBACC=79]="ELIBACC",e[e.ELIBBAD=80]="ELIBBAD",e[e.ELIBSCN=81]="ELIBSCN",e[e.ELIBMAX=82]="ELIBMAX",e[e.ELIBEXEC=83]="ELIBEXEC",e[e.EILSEQ=84]="EILSEQ",e[e.ERESTART=85]="ERESTART",e[e.ESTRPIPE=86]="ESTRPIPE",e[e.EUSERS=87]="EUSERS",e[e.ENOTSOCK=88]="ENOTSOCK",e[e.EDESTADDRREQ=89]="EDESTADDRREQ",e[e.EMSGSIZE=90]="EMSGSIZE",e[e.EPROTOTYPE=91]="EPROTOTYPE",e[e.ENOPROTOOPT=92]="ENOPROTOOPT",e[e.EPROTONOSUPPORT=93]="EPROTONOSUPPORT",e[e.ESOCKTNOSUPPORT=94]="ESOCKTNOSUPPORT",e[e.ENOTSUP=95]="ENOTSUP",e[e.EPFNOSUPPORT=96]="EPFNOSUPPORT",e[e.EAFNOSUPPORT=97]="EAFNOSUPPORT",e[e.EADDRINUSE=98]="EADDRINUSE",e[e.EADDRNOTAVAIL=99]="EADDRNOTAVAIL",e[e.ENETDOWN=100]="ENETDOWN",e[e.ENETUNREACH=101]="ENETUNREACH",e[e.ENETRESET=102]="ENETRESET",e[e.ECONNABORTED=103]="ECONNABORTED",e[e.ECONNRESET=104]="ECONNRESET",e[e.ENOBUFS=105]="ENOBUFS",e[e.EISCONN=106]="EISCONN",e[e.ENOTCONN=107]="ENOTCONN",e[e.ESHUTDOWN=108]="ESHUTDOWN",e[e.ETOOMANYREFS=109]="ETOOMANYREFS",e[e.ETIMEDOUT=110]="ETIMEDOUT",e[e.ECONNREFUSED=111]="ECONNREFUSED",e[e.EHOSTDOWN=112]="EHOSTDOWN",e[e.EHOSTUNREACH=113]="EHOSTUNREACH",e[e.EALREADY=114]="EALREADY",e[e.EINPROGRESS=115]="EINPROGRESS",e[e.ESTALE=116]="ESTALE",e[e.EEUCLEAN=117]="EEUCLEAN",e[e.ENOTNAM=118]="ENOTNAM",e[e.ENAVAIL=119]="ENAVAIL",e[e.EISNAM=120]="EISNAM",e[e.EREMOTEIO=121]="EREMOTEIO",e[e.EDQUOT=122]="EDQUOT",e[e.ENOMEDIUM=123]="ENOMEDIUM",e[e.EMEDIUMTYPE=124]="EMEDIUMTYPE",e[e.ECANCELED=125]="ECANCELED",e[e.ENOKEY=126]="ENOKEY",e[e.EKEYEXPIRED=127]="EKEYEXPIRED",e[e.EKEYREVOKED=128]="EKEYREVOKED",e[e.EKEYREJECTED=129]="EKEYREJECTED",e[e.EOWNERDEAD=130]="EOWNERDEAD",e[e.ENOTRECOVERABLE=131]="ENOTRECOVERABLE",e[e.ERFKILL=132]="ERFKILL",e[e.EHWPOISON=133]="EHWPOISON"})(he||(he={}));const nu={[he.EPERM]:"Operation not permitted",[he.ENOENT]:"No such file or directory",[he.ESRCH]:"No such process",[he.EINTR]:"Interrupted system call",[he.EIO]:"Input/output error",[he.ENXIO]:"No such device or address",[he.E2BIG]:"Argument list too long",[he.ENOEXEC]:"Exec format error",[he.EBADF]:"Bad file descriptor",[he.ECHILD]:"No child processes",[he.EAGAIN]:"Resource temporarily unavailable",[he.ENOMEM]:"Out of memory",[he.EACCES]:"Permission denied",[he.EFAULT]:"Bad address",[he.ENOTBLK]:"Block device required",[he.EBUSY]:"Resource busy or locked",[he.EEXIST]:"File exists",[he.EXDEV]:"Invalid cross-device link",[he.ENODEV]:"No such device",[he.ENOTDIR]:"File is not a directory",[he.EISDIR]:"File is a directory",[he.EINVAL]:"Invalid argument",[he.ENFILE]:"Too many open files in system",[he.EMFILE]:"Too many open files",[he.ETXTBSY]:"Text file busy",[he.EFBIG]:"File is too big",[he.ENOSPC]:"No space left on disk",[he.ESPIPE]:"Illegal seek",[he.EROFS]:"Cannot modify a read-only file system",[he.EMLINK]:"Too many links",[he.EPIPE]:"Broken pipe",[he.EDOM]:"Numerical argument out of domain",[he.ERANGE]:"Numerical result out of range",[he.EDEADLK]:"Resource deadlock would occur",[he.ENAMETOOLONG]:"File name too long",[he.ENOLCK]:"No locks available",[he.ENOSYS]:"Function not implemented",[he.ENOTEMPTY]:"Directory is not empty",[he.ELOOP]:"Too many levels of symbolic links",[he.ENOMSG]:"No message of desired type",[he.EIDRM]:"Identifier removed",[he.ECHRNG]:"Channel number out of range",[he.EL2NSYNC]:"Level 2 not synchronized",[he.EL3HLT]:"Level 3 halted",[he.EL3RST]:"Level 3 reset",[he.ENRNG]:"Link number out of range",[he.EUNATCH]:"Protocol driver not attached",[he.ECSI]:"No CSI structure available",[he.EL2HLT]:"Level 2 halted",[he.EBADE]:"Invalid exchange",[he.EBADR]:"Invalid request descriptor",[he.EXFULL]:"Exchange full",[he.ENOANO]:"No anode",[he.EBADRQC]:"Invalid request code",[he.EBADSLT]:"Invalid slot",[he.EBFONT]:"Bad font file format",[he.ENOSTR]:"Device not a stream",[he.ENODATA]:"No data available",[he.ETIME]:"Timer expired",[he.ENOSR]:"Out of streams resources",[he.ENONET]:"Machine is not on the network",[he.ENOPKG]:"Package not installed",[he.EREMOTE]:"Object is remote",[he.ENOLINK]:"Link has been severed",[he.EADV]:"Advertise error",[he.ESRMNT]:"Srmount error",[he.ECOMM]:"Communication error on send",[he.EPROTO]:"Protocol error",[he.EMULTIHOP]:"Multihop attempted",[he.EDOTDOT]:"RFS specific error",[he.EBADMSG]:"Bad message",[he.EOVERFLOW]:"Value too large for defined data type",[he.ENOTUNIQ]:"Name not unique on network",[he.EBADFD]:"File descriptor in bad state",[he.EREMCHG]:"Remote address changed",[he.ELIBACC]:"Can not access a needed shared library",[he.ELIBBAD]:"Accessing a corrupted shared library",[he.ELIBSCN]:".lib section in a.out corrupted",[he.ELIBMAX]:"Attempting to link in too many shared libraries",[he.ELIBEXEC]:"Cannot exec a shared library directly",[he.EILSEQ]:"Invalid or incomplete multibyte or wide character",[he.ERESTART]:"Interrupted system call should be restarted",[he.ESTRPIPE]:"Streams pipe error",[he.EUSERS]:"Too many users",[he.ENOTSOCK]:"Socket operation on non-socket",[he.EDESTADDRREQ]:"Destination address required",[he.EMSGSIZE]:"Message too long",[he.EPROTOTYPE]:"Protocol wrong type for socket",[he.ENOPROTOOPT]:"Protocol not available",[he.EPROTONOSUPPORT]:"Protocol not supported",[he.ESOCKTNOSUPPORT]:"Socket type not supported",[he.ENOTSUP]:"Operation is not supported",[he.EPFNOSUPPORT]:"Protocol family not supported",[he.EAFNOSUPPORT]:"Address family not supported by protocol",[he.EADDRINUSE]:"Address already in use",[he.EADDRNOTAVAIL]:"Cannot assign requested address",[he.ENETDOWN]:"Network is down",[he.ENETUNREACH]:"Network is unreachable",[he.ENETRESET]:"Network dropped connection on reset",[he.ECONNABORTED]:"Software caused connection abort",[he.ECONNRESET]:"Connection reset by peer",[he.ENOBUFS]:"No buffer space available",[he.EISCONN]:"Transport endpoint is already connected",[he.ENOTCONN]:"Transport endpoint is not connected",[he.ESHUTDOWN]:"Cannot send after transport endpoint shutdown",[he.ETOOMANYREFS]:"Too many references: cannot splice",[he.ETIMEDOUT]:"Connection timed out",[he.ECONNREFUSED]:"Connection refused",[he.EHOSTDOWN]:"Host is down",[he.EHOSTUNREACH]:"No route to host",[he.EALREADY]:"Operation already in progress",[he.EINPROGRESS]:"Operation now in progress",[he.ESTALE]:"Stale file handle",[he.EEUCLEAN]:"Structure needs cleaning",[he.ENOTNAM]:"Not a XENIX named type file",[he.ENAVAIL]:"No XENIX semaphores available",[he.EISNAM]:"Is a named type file",[he.EREMOTEIO]:"Remote I/O error",[he.EDQUOT]:"Disk quota exceeded",[he.ENOMEDIUM]:"No medium found",[he.EMEDIUMTYPE]:"Wrong medium type",[he.ECANCELED]:"Operation canceled",[he.ENOKEY]:"Required key not available",[he.EKEYEXPIRED]:"Key has expired",[he.EKEYREVOKED]:"Key has been revoked",[he.EKEYREJECTED]:"Key was rejected by service",[he.EOWNERDEAD]:"Owner died",[he.ENOTRECOVERABLE]:"State not recoverable",[he.ERFKILL]:"Operation not possible due to RF-kill",[he.EHWPOISON]:"Memory page has hardware error"};function fn(e){let t=`${e.code}: ${nu[e.errno]}, ${e.syscall}`;return e.path&&(t+=` '${e.path}'`),e.dest&&(t+=` -> '${e.dest}'`),e.message&&e.message!==nu[e.errno]&&(t+=` (${e.message})`),e.message=t,e}class Wt extends Error{constructor(n,r,o={}){var s;const i=he[n];r===!1&&(r=`${i}: ${nu[n]}, ${o.syscall}`,o.path&&(r+=` '${o.path}'`),o.dest&&(r+=` -> '${o.dest}'`));super(r);Pr(this,"errno");Pr(this,"code");Pr(this,"path");Pr(this,"dest");Pr(this,"syscall");this.errno=n,this.code=i,Object.assign(this,a$(o,"message")),(s=Error.captureStackTrace)==null||s.call(Error,this,this.constructor)}toString(){return this.message}toJSON(){const n={errno:this.errno,code:this.code,stack:this.stack,message:this.message};return this.path&&(n.path=this.path),this.dest&&(n.dest=this.dest),this.syscall&&(n.syscall=this.syscall),n}static fromJSON(n){const r=n.syscall?new Wt(n.errno,!1,n):new Wt(n.errno,n.message);return r.stack=n.stack,r}}function me(e,t,n,r){var i;typeof t=="string"&&(t={syscall:t,path:n,dest:r});const o=new Wt(he[e],!1,t??{});return(i=Error.captureStackTrace)==null||i.call(Error,o,me),o}function Ce(e,t){var r;const n=new Wt(he[e],t??nu[he[e]]);return(r=Error.captureStackTrace)==null||r.call(Error,n,Ce),n}function $t(e,t,n){const r=typeof e=="string"?{syscall:e}:e;return t&&(r.path=t),function(o){throw Object.assign(o,r),fn(o),o}}var Xe;(function(e){e[e.EMERG=0]="EMERG",e[e.ALERT=1]="ALERT",e[e.CRIT=2]="CRIT",e[e.ERR=3]="ERR",e[e.WARN=4]="WARN",e[e.NOTICE=5]="NOTICE",e[e.INFO=6]="INFO",e[e.DEBUG=7]="DEBUG"})(Xe||(Xe={}));const m$=new i$;function g$(e,t){const n={level:e,message:t,timestamp:new Date,elapsedMs:performance.now()};m$.add(n),x$(n)}function ri(e){return function(t){return g$(e,t.toString()),t}}ri(Xe.EMERG);const y$=ri(Xe.ALERT),mr=ri(Xe.CRIT),cn=ri(Xe.ERR),En=ri(Xe.WARN),i_=ri(Xe.NOTICE),Mh=ri(Xe.INFO),$i=ri(Xe.DEBUG);function w$(e,t){return`\x1B[${t}m${e}\x1B[0m`}function v$(e,t){const n="["+(e.elapsedMs/1e3).toFixed(3).padStart(10)+"] ";switch(t){case"ansi":return[w$(n,"2;37")];case"css":return["%c"+n,"opacity: 0.8; color: white;"];default:return[n]}}Xe.EMERG+"",Xe.ALERT+"",Xe.CRIT+"",Xe.ERR+"",Xe.WARN+"",Xe.NOTICE+"",Xe.INFO+"",Xe.DEBUG+"",Xe.EMERG+"",Xe.ALERT+"",Xe.CRIT+"",Xe.ERR+"",Xe.WARN+"",Xe.NOTICE+"",Xe.INFO+"",Xe.DEBUG+"",Xe.EMERG+"",Xe.ALERT+"",Xe.CRIT+"",Xe.ERR+"",Xe.WARN+"",Xe.NOTICE+"",Xe.INFO+"",Xe.DEBUG+"",Xe.EMERG+"",Xe.ALERT+"",Xe.CRIT+"",Xe.ERR+"",Xe.WARN+"",Xe.NOTICE+"",Xe.INFO+"",Xe.DEBUG+"";let b$=e=>[...v$(e),e.message];function _$(e){const t=b$(e);return typeof t=="string"?[t]:Array.from(t)}let S$=console.error;function x$(e){e.level>E$||S$(..._$(e))}let E$=Xe.ALERT;function Ih(e){return e!=null&&typeof e=="object"&&"create"in e&&typeof e.create=="function"}function C$(e,t){return Object.defineProperty(t,"prototype",{value:void 0}),Object.defineProperty(t,"name",{value:e}),t}function N$(e,t){if(typeof t!="object"||t===null)throw cn(Ce("EINVAL","Invalid options"));for(const[n,r]of Object.entries(e.options)){const o=t==null?void 0:t[n];if(o==null){if(!r.required){$i("Using default for option: "+n);continue}throw cn(Ce("EINVAL","Missing required option: "+n))}const i=(c,d=o)=>{var u;return typeof c=="function"?Symbol.hasInstance in c&&c.prototype?o instanceof c:c(o):typeof o===c||((u=o==null?void 0:o.constructor)===null||u===void 0?void 0:u.name)===c};if(Array.isArray(r.type)?r.type.some(c=>i(c)):i(r.type))continue;const s=typeof o=="object"&&"constructor"in o?o.constructor.name:typeof o,a=c=>typeof c=="function"?c.name!="type"?c.name:c.toString():c,l=Array.isArray(r.type)?`one of ${r.type.map(a).join(", ")}`:a(r.type);throw cn(Ce("EINVAL",`Incorrect type for "${n}": ${s} (expected ${l})`))}}function R$(e){return e!=null&&typeof e=="object"&&"backend"in e&&Ih(e.backend)}function P$(e){return{suid:e.uid,sgid:e.gid,euid:e.uid,egid:e.gid,groups:[],...e}}const Ar={id:0,root:"/",pwd:"/",credentials:P$({uid:0,gid:0}),descriptors:new Map,parent:null,children:[]},Oh=0,en=4,Gt=2,ru=1,kh=1,A$=2,T$=4,s_=0,yn=1,no=2,ou=64,iu=128,D$=256,su=512,zi=1024,M$=65536,I$=262144,O$=131072,au=1052672,k$=4096,L$=32768,j$=16384,F$=2048,Rt=61440,Bi=49152,Po=40960,Tr=32768,Wi=24576,Yt=16384,Vi=8192,Ui=4096,cl=2048,ul=1024,$$=512,z$=448,a_=256,l_=128,c_=64,B$=56,u_=32,d_=16,f_=8,W$=7,h_=4,p_=2,m_=1,V$=0,er=4294967295,g_=Object.freeze(Object.defineProperty({__proto__:null,COPYFILE_EXCL:kh,COPYFILE_FICLONE:A$,COPYFILE_FICLONE_FORCE:T$,F_OK:Oh,O_APPEND:zi,O_CREAT:ou,O_DIRECT:j$,O_DIRECTORY:M$,O_DSYNC:k$,O_EXCL:iu,O_NOATIME:I$,O_NOCTTY:D$,O_NOFOLLOW:O$,O_NONBLOCK:F$,O_RDONLY:s_,O_RDWR:no,O_SYMLINK:L$,O_SYNC:au,O_TRUNC:su,O_WRONLY:yn,R_OK:en,S_IFBLK:Wi,S_IFCHR:Vi,S_IFDIR:Yt,S_IFIFO:Ui,S_IFLNK:Po,S_IFMT:Rt,S_IFREG:Tr,S_IFSOCK:Bi,S_IRGRP:u_,S_IROTH:h_,S_IRUSR:a_,S_IRWXG:B$,S_IRWXO:W$,S_IRWXU:z$,S_ISGID:ul,S_ISUID:cl,S_ISVTX:$$,S_IWGRP:d_,S_IWOTH:p_,S_IWUSR:l_,S_IXGRP:f_,S_IXOTH:m_,S_IXUSR:c_,UV_FS_O_FILEMAP:V$,W_OK:Gt,X_OK:ru,size_max:er},Symbol.toStringTag,{value:"Module"}));Symbol.metadata??(Symbol.metadata=Symbol.for("Symbol.metadata"));function y_(e){e.metadata??(e.metadata={});const t=e.metadata.structInit??{};return e.metadata.structInit={fields:[...t.fields??[]]},e.metadata.structInit}function U$(e){return e!=null&&typeof e=="object"&&"struct"in e}function Lh(e){return typeof e=="function"&&Symbol.metadata in e&&U$(e[Symbol.metadata])}function H$(e){return e!=null&&typeof e=="object"&&Lh(e.constructor)}function G$(e){return H$(e)||Lh(e)}function Y$(e){if(!G$(e))throw new TypeError((typeof e=="function"?e.name:typeof e=="object"&&e?e.constructor.name:e)+" is not a struct")}function jh(e){var t;return(typeof e=="object"||typeof e=="function")&&e!=null&&"name"in e&&"size"in e&&"get"in e&&"set"in e&&typeof e.name=="string"&&typeof e.size=="number"&&typeof e.get=="function"&&typeof e.set=="function"&&lu.has(e.name)&&((t=lu.get(e.name))==null?void 0:t.name)===e.name}const lu=new Map;function w_(e){if(lu.has(e.name))throw new ReferenceError(`Type is already registered: ${e.name}`);lu.set(e.name,e)}const cu=Symbol("DataView");function sn(e){return e[cu]??(e[cu]=new DataView(e)),e[cu]}const uu={int8:{name:"int8",size:1,array:Int8Array,get:(e,t)=>sn(e).getInt8(t),set:(e,t,n)=>sn(e).setInt8(t,n)},uint8:{name:"uint8",size:1,array:Uint8Array,get:(e,t)=>sn(e).getUint8(t),set:(e,t,n)=>sn(e).setUint8(t,n)},int16:{name:"int16",size:2,array:Int16Array,get:(e,t)=>sn(e).getInt16(t,!0),set:(e,t,n)=>sn(e).setInt16(t,n,!0)},uint16:{name:"uint16",size:2,array:Uint16Array,get:(e,t)=>sn(e).getUint16(t,!0),set:(e,t,n)=>sn(e).setUint16(t,n,!0)},int32:{name:"int32",size:4,array:Int32Array,get:(e,t)=>sn(e).getInt32(t,!0),set:(e,t,n)=>sn(e).setInt32(t,n,!0)},uint32:{name:"uint32",size:4,array:Uint32Array,get:(e,t)=>sn(e).getUint32(t,!0),set:(e,t,n)=>sn(e).setUint32(t,n,!0)},int64:{name:"int64",size:8,array:BigInt64Array,get:(e,t)=>sn(e).getBigInt64(t,!0),set:(e,t,n)=>sn(e).setBigInt64(t,n,!0)},uint64:{name:"uint64",size:8,array:BigUint64Array,get:(e,t)=>sn(e).getBigUint64(t,!0),set:(e,t,n)=>sn(e).setBigUint64(t,n,!0)},float32:{name:"float32",size:4,array:Float32Array,get:(e,t)=>sn(e).getFloat32(t,!0),set:(e,t,n)=>sn(e).setFloat32(t,n,!0)},float64:{name:"float64",size:8,array:Float64Array,get:(e,t)=>sn(e).getFloat64(t,!0),set:(e,t,n)=>sn(e).setFloat64(t,n,!0)}},v_=Object.keys(uu);for(const e of Object.values(uu))w_(e);const b_=[...v_,...v_.map(e=>f$(e)),"char"];function q$(e){return b_.includes(e.toString())}function K$(e){if(!q$(e))throw Ce("EINVAL","Not a valid primitive type: "+e)}function __(e){return e=="char"?"uint8":e.toLowerCase()}function zt(e){if(jh(e))return e.size;if(e==null)return 0;if(typeof e=="object"&&jh(e.constructor))return e.constructor.size;if(Array.isArray(e)){let t=0;for(let n=0;n<e.length;n++)t+=zt(e[n]);return t}if(typeof e=="string")return K$(e),uu[__(e)].size;throw new TypeError(`Unable to resolve size of \`${e.toString()}\``)}function X$(e,t){Y$(e);const n=Lh(e)?e:e.constructor,{fields:r}=n[Symbol.metadata].struct;if(!(t in r))throw Ce("EINVAL","Struct does not have field: "+t);return r[t].offset}const ks={isPacked:!0};function Hi(...e){return function(n,r){const o=e.reduce((f,h)=>({...f,...h}),{}),i=y_(r);let s=1;const a={};let l=0;const c=f=>{l=Math.ceil(l/f)*f};for(const f of i.fields)o.isPacked||c(f.alignment),o.isUnion?l=Math.max(l,f.size):(f.offset=l,l+=f.size*(f.length??1)),a[f.name]=f,s=Math.max(s,f.alignment);o.alignment??(o.alignment=s),o.isPacked||c(o.alignment),r.metadata.struct={fields:a,size:l,alignment:o.isPacked?1:o.alignment,isUnion:o.isUnion??!1};const d=new Function("target",`return class ${n.name} extends target {
|
|
10
|
+
constructor(...args) {
|
|
11
|
+
if (!args.length) args = [new ArrayBuffer(${l}), 0, ${l}];
|
|
12
|
+
super(...args);
|
|
13
|
+
}
|
|
14
|
+
}`)(n),u=f=>({writable:!1,enumerable:!1,configurable:!1,value:f});return Object.defineProperties(d,{size:u(l),get:u((f,h)=>new d(f,h)),set:u((f,h,m)=>{const p=new Uint8Array(m.buffer,m.byteOffset,l),y=new Uint8Array(f,h,l);if(!(m.buffer===f&&m.byteOffset===h))for(let v=0;v<l;v++)y[v]=p[v]})}),w_(d),d}}function du(e,t={}){return function(r,o){if(o.kind!="accessor")throw Ce("EINVAL","Field must be an accessor");const i=y_(o);let s=o.name;if(typeof s=="symbol"&&(console.warn("Symbol used for struct field name will be coerced to string: "+s.toString()),s=s.toString()),!s)throw Ce("EINVAL","Invalid name for struct field");if(!jh(e))throw Ce("EINVAL","Not a valid type: "+e.name);t.countedBy&&(t.length??(t.length=0));const a={name:s,offset:0,type:e,length:t.length,countedBy:t.countedBy,size:e.size,alignment:t.align??e.size,decl:`${t.typeName??e.name} ${s}${typeof t.length=="number"?`[${t.length}]`:t.countedBy?`[${t.countedBy}]`:""}`,littleEndian:!t.bigEndian};return i.fields.push(a),{get(){return x_(this,a)},set(l){S_(this,a,l)}}}}function Fh(e,t,n){return t===void 0?-1:(typeof n=="string"&&(t=Math.min(t,e[n])),Number.isSafeInteger(t)&&t>=0?t:wt(Ce("EINVAL","Array lengths must be natural numbers")))}function S_(e,t,n,r){const{type:o,length:i,countedBy:s}=t,a=Fh(e,i,s);if(a===-1||typeof r=="number"){typeof n=="string"&&(n=n.charCodeAt(0)),o.set(e.buffer,e.byteOffset+t.offset+(r??0)*o.size,n);return}for(let l=0;l<Math.min(a,n.length);l++){const c=t.offset+l*o.size;o.set(e.buffer,e.byteOffset+c,n[l])}}function x_(e,t,n){const{type:r,length:o,countedBy:i}=t,s=Fh(e,o,i),a=e.byteOffset+t.offset+(n??0)*t.size;return s===-1||typeof n=="number"?r.get(e.buffer,a):s!==0&&r.array?new r.array(e.buffer,a,s*r.size):new Proxy({get length(){return Fh(e,t.length,t.countedBy)},*[Symbol.iterator](){for(let l=0;l<this.length;l++)yield this[l]}},{get(l,c){if(Object.hasOwn(l,c))return l[c];const d=parseInt(c.toString());if(!Number.isSafeInteger(d))throw Ce("EINVAL","Invalid index: "+c.toString());return x_(e,t,d)},set(l,c,d){const u=parseInt(c.toString());if(!Number.isSafeInteger(u))throw Ce("EINVAL","Invalid index: "+c.toString());return S_(e,t,u,d),!0}})}function J$(e){const t=uu[__(e)];function n(r,o){return typeof r=="number"?du(t,{typeName:e,length:r,...o}):du(t,{typeName:e})(r,o&&"name"in o?o:wt(Ce("EINVAL","Invalid decorator context object")))}return n}const We=Object.fromEntries(b_.map(e=>[e,J$(e)]));function dl(e,t){if(e.byteLength>=t)return e;if(ArrayBuffer.isView(e)){const r=dl(e.buffer,t);return new e.constructor(r,e.byteOffset,t)}const n=typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer;if(e.maxByteLength>t)return n?e.grow(t):e.resize(t),e;if(n){const r=new SharedArrayBuffer(t);return new Uint8Array(r).set(new Uint8Array(e)),r}try{return e.transfer(t)}catch{const r=new ArrayBuffer(t);return new Uint8Array(r).set(new Uint8Array(e)),r}}class Ls extends DataView{constructor(t,n,r){const{buffer:o,byteOffset:i,byteLength:s}=new Uint8Array(t,n,r);super(o,i,s)}}for(const e of Object.getOwnPropertyNames(DataView.prototype))!e.startsWith("get")&&!e.startsWith("set")||Object.defineProperty(Ls.prototype,e,{value:()=>{throw new ReferenceError("Do not use DataView methods on a BufferView.")},writable:!1,enumerable:!1,configurable:!1});function E_(e,t){let n="",r=0,o=-1,i=0,s="\0";for(let a=0;a<=e.length;++a){if(a<e.length)s=e[a];else{if(s=="/")break;s="/"}if(s=="/"){if(!(o===a-1||i===1))if(i===2){if(n.length<2||r!==2||n.at(-1)!=="."||n.at(-2)!=="."){if(n.length>2){const l=n.lastIndexOf("/");l===-1?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),o=a,i=0;continue}else if(n.length!==0){n="",r=0,o=a,i=0;continue}}t&&(n+=n.length>0?"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,a):n=e.slice(o+1,a),r=a-o-1;o=a,i=0}else s==="."&&i!==-1?++i:i=-1}return n}function Ao(...e){var t;let n="";for(const o of[...e.reverse(),(t=this===null||this===void 0?void 0:this.pwd)!==null&&t!==void 0?t:Ar.pwd])if(o!=null&&o.length&&(n=`${o}/${n}`,o.startsWith("/")))break;const r=n.startsWith("/");return n=E_(n,!r),r?`/${n}`:n.length?n:"/"}function Q$(e){if(!e.length)return".";const t=e.startsWith("/"),n=e.endsWith("/");return e=E_(e,!t),e.length?(n&&(e+="/"),t?`/${e}`:e):t?"/":n?"./":"."}function vt(...e){if(!e.length)return".";const t=e.join("/");return t!=null&&t.length?Q$(t):"."}function C_(e,t){if(e===t||(e=Ao.call(this,e),t=Ao.call(this,t),e===t))return"";const n=1,r=e.length,o=r-n,i=1,s=t.length-i,a=o<s?o:s;let l=-1,c=0;for(;c<a;c++){const u=e[n+c];if(u!==t[i+c])break;u==="/"&&(l=c)}if(c===a)if(s>a){if(t[i+c]==="/")return t.slice(i+c+1);if(c===0)return t.slice(i+c)}else o>a&&(e[n+c]==="/"?l=c:c===0&&(l=0));let d="";for(c=n+l+1;c<=r;++c)(c===r||e[c]==="/")&&(d+=d.length===0?"..":"/..");return`${d}${t.slice(i+l)}`}function it(e){if(e.length===0)return".";const t=e[0]==="/";let n=-1,r=!0;for(let o=e.length-1;o>=1;--o)if(e[o]==="/"){if(!r){n=o;break}}else r=!1;return n===-1?t?"/":".":t&&n===1?"//":e.slice(0,n)}function js(e,t){let n=0,r=-1,o=!0;for(let i=e.length-1;i>=0;--i)if(e[i]==="/"){if(!o){n=i+1;break}}else r===-1&&(o=!1,r=i+1);return r===-1?"":e.slice(n,r)}function gr(e){const t=e.startsWith("/"),n={root:t?"/":"",dir:"",base:"",ext:"",name:""};if(e.length===0)return n;const r=t?1:0;let o=-1,i=0,s=-1,a=!0,l=e.length-1,c=0;for(;l>=r;--l){if(e[l]==="/"){if(!a){i=l+1;break}continue}s===-1&&(a=!1,s=l+1),e[l]==="."?o===-1?o=l:c!==1&&(c=1):o!==-1&&(c=-1)}if(s!==-1){const d=i===0&&t?1:i;o===-1||c===0||c===1&&o===s-1&&o===i+1?n.base=n.name=e.slice(d,s):(n.name=e.slice(d,o),n.base=e.slice(d,s),n.ext=e.slice(o,s))}return i>0?n.dir=e.slice(0,i-1):t&&(n.dir="/"),n}const fu=BigInt(1e3);class N_{_convert(t){return this._isBigint?BigInt(t):Number(t)}get blocks(){return this._convert(Math.ceil(Number(this.size)/512))}set blocks(t){}get atime(){return new Date(Number(this.atimeMs))}set atime(t){this.atimeMs=this._convert(t.getTime())}get mtime(){return new Date(Number(this.mtimeMs))}set mtime(t){this.mtimeMs=this._convert(t.getTime())}get ctime(){return new Date(Number(this.ctimeMs))}set ctime(t){this.ctimeMs=this._convert(t.getTime())}get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(t){this.birthtimeMs=this._convert(t.getTime())}constructor({atimeMs:t,mtimeMs:n,ctimeMs:r,birthtimeMs:o,uid:i,gid:s,size:a,mode:l,ino:c,...d}={}){this.dev=this._convert(0),this.ino=this._convert(0),this.rdev=this._convert(0),this.nlink=this._convert(1),this.blksize=this._convert(4096),this.uid=this._convert(0),this.gid=this._convert(0);const u=Date.now();this.atimeMs=this._convert(t??u),this.mtimeMs=this._convert(n??u),this.ctimeMs=this._convert(r??u),this.birthtimeMs=this._convert(o??u),this.uid=this._convert(i??0),this.gid=this._convert(s??0),this.size=this._convert(a??0),this.ino=this._convert(c??0),this.mode=this._convert(l??420&Tr),this.mode&Rt||(this.mode=this.mode|this._convert(Tr)),Object.assign(this,d)}isFile(){return(this.mode&Rt)===Tr}isDirectory(){return(this.mode&Rt)===Yt}isSymbolicLink(){return(this.mode&Rt)===Po}isSocket(){return(this.mode&Rt)===Bi}isBlockDevice(){return(this.mode&Rt)===Wi}isCharacterDevice(){return(this.mode&Rt)===Vi}isFIFO(){return(this.mode&Rt)===Ui}toJSON(){return Dh(this,Bh)}hasAccess(t,n){return St(n,this._isBigint?new To(this):this,t)}get atimeNs(){return BigInt(this.atimeMs)*fu}get mtimeNs(){return BigInt(this.mtimeMs)*fu}get ctimeNs(){return BigInt(this.ctimeMs)*fu}get birthtimeNs(){return BigInt(this.birthtimeMs)*fu}}function R_(e,t,n){let r=!0;return!isNaN(t)&&t>=0&&t<er?e.uid=t:r=!1,!isNaN(n)&&n>=0&&n<er?e.gid=n:r=!1,r}class To extends N_{constructor(){super(...arguments),this._isBigint=!1}}class Gi extends N_{constructor(){super(...arguments),this._isBigint=!0}}function Z$(e,t){return e.size==t.size&&+e.atime==+t.atime&&+e.mtime==+t.mtime&&+e.ctime==+t.ctime&&e.mode==t.mode}class e2{constructor(){this.type=525687744115,this.bsize=4096,this.blocks=0,this.bfree=0,this.bavail=0,this.files=er,this.ffree=er}}class t2{constructor(){this.type=BigInt("0x7a656e6673"),this.bsize=BigInt(4096),this.blocks=BigInt(0),this.bfree=BigInt(0),this.bavail=BigInt(0),this.files=BigInt(er),this.ffree=BigInt(er)}}var Mt=function(e,t,n,r,o,i){function s(v){if(v!==void 0&&typeof v!="function")throw new TypeError("Function expected");return v}for(var a=r.kind,l=a==="getter"?"get":a==="setter"?"set":"value",c=!t&&e?r.static?e:e.prototype:null,d=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),u,f=!1,h=n.length-1;h>=0;h--){var m={};for(var p in r)m[p]=p==="access"?{}:r[p];for(var p in r.access)m.access[p]=r.access[p];m.addInitializer=function(v){if(f)throw new TypeError("Cannot add initializers after decoration has completed");i.push(s(v||null))};var y=(0,n[h])(a==="accessor"?{get:d.get,set:d.set}:d[l],m);if(a==="accessor"){if(y===void 0)continue;if(y===null||typeof y!="object")throw new TypeError("Object expected");(u=s(y.get))&&(d.get=u),(u=s(y.set))&&(d.set=u),(u=s(y.init))&&o.unshift(u)}else(u=s(y))&&(a==="field"?o.unshift(u):d[l]=u)}c&&Object.defineProperty(c,r.name,d),f=!0},Ue=function(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0},$h=function(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})},qt=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Kt=function(e,t,n,r,o){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?o.call(e,n):o?o.value=n:t.set(e,n),n};const Ln=0,zh=3968;let Do=(()=>{var e,t,n;let r=[Hi(ks)],o,i=[],s,a=Uint8Array,l,c=[],d=[],u,f=[],h=[];return s=class extends a{get keySize(){return qt(this,e,"f")}set keySize(m){Kt(this,e,m,"f")}get valueSize(){return qt(this,t,"f")}set valueSize(m){Kt(this,t,m,"f")}get name(){return tu(this.subarray(8,8+this.keySize))}set name(m){const p=ni(m);if(8+p.length+this.valueSize>zh)throw Ce("EOVERFLOW");this.set(p,8),this.keySize=p.length}get value(){return this.subarray(8+this.keySize,this.size)}set value(m){if(8+this.keySize+m.length>zh)throw Ce("EOVERFLOW");this.valueSize=m.length,this.set(m,8+this.keySize)}get size(){return 8+this.keySize+this.valueSize}constructor(){super(...arguments),e.set(this,Ue(this,c,void 0)),t.set(this,(Ue(this,d),Ue(this,f,void 0))),Ue(this,h)}},e=new WeakMap,t=new WeakMap,$h(s,"Attribute"),(()=>{var m;const p=typeof Symbol=="function"&&Symbol.metadata?Object.create((m=a[Symbol.metadata])!==null&&m!==void 0?m:null):void 0;l=[(m=We).uint32.bind(m)],u=[(n=We).uint32.bind(n)],Mt(s,null,l,{kind:"accessor",name:"keySize",static:!1,private:!1,access:{has:y=>"keySize"in y,get:y=>y.keySize,set:(y,v)=>{y.keySize=v}},metadata:p},c,d),Mt(s,null,u,{kind:"accessor",name:"valueSize",static:!1,private:!1,access:{has:y=>"valueSize"in y,get:y=>y.valueSize,set:(y,v)=>{y.valueSize=v}},metadata:p},f,h),Mt(null,o={value:s},r,{kind:"class",name:s.name,metadata:p},null,i),s=o.value,p&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:p}),Ue(s,i)})(),s})(),Yi=(()=>{var e;let t=[Hi(ks)],n,r=[],o,i=Ls,s,a=[],l=[];return o=class extends i{get size(){return qt(this,e,"f")}set size(c){Kt(this,e,c,"f")}get byteSize(){let c=this.byteOffset+zt(this);for(let d=0;d<this.size;d++){const u=new Do(this.buffer,c);c+=u.size}return c}has(c){let d=this.byteOffset+zt(this);for(let u=0;u<this.size;u++){const f=new Do(this.buffer,d);if(f.name==c)return!0;d+=f.size}return!1}get(c){let d=this.byteOffset+zt(this);for(let u=0;u<this.size;u++){const f=new Do(this.buffer,d);if(f.name==c)return f.value;d+=f.size}}set(c,d){let u=this.byteOffset+zt(this),f;for(let p=0;p<this.size;p++){const y=new Do(this.buffer,u);y.name==c&&(f=[u,y.size]),u+=y.size}const h=new Uint8Array(this.buffer);if(f){const[p,y]=f;u-=y,h.copyWithin(p,p+y,u+y),h.fill(0,u,u+y),this.size--}const m=new Do(this.buffer,u);m.name=c,m.value=d,this.size++}remove(c){let d=this.byteOffset+zt(this),u;for(let p=0;p<this.size;p++){const y=new Do(this.buffer,d);y.name==c&&(u=[d,y.size]),d+=y.size}if(!u)return!1;const[f,h]=u,m=new Uint8Array(this.buffer);return m.copyWithin(f,f+h,d),m.fill(0,d-h,d),this.size--,!0}copyFrom(c){const{byteSize:d}=c;new Uint8Array(this.buffer,this.byteOffset,d).set(new Uint8Array(c.buffer,c.byteOffset,d))}*keys(){let c=this.byteOffset+zt(this);for(let d=0;d<this.size;d++){const u=new Do(this.buffer,c);yield u.name,c+=u.size}}*values(){let c=this.byteOffset+zt(this);for(let d=0;d<this.size;d++){const u=new Do(this.buffer,c);yield u.value,c+=u.size}}*entries(){let c=this.byteOffset+zt(this);for(let d=0;d<this.size;d++){const u=new Do(this.buffer,c);yield[u.name,u.value],c+=u.size}}constructor(){super(...arguments),e.set(this,Ue(this,a,void 0)),Ue(this,l)}},e=new WeakMap,$h(o,"Attributes"),(()=>{var c;const d=typeof Symbol=="function"&&Symbol.metadata?Object.create((c=i[Symbol.metadata])!==null&&c!==void 0?c:null):void 0;s=[(c=We).uint32.bind(c)],Mt(o,null,s,{kind:"accessor",name:"size",static:!1,private:!1,access:{has:u=>"size"in u,get:u=>u.size,set:(u,f)=>{u.size=f}},metadata:d},a,l),Mt(null,n={value:o},t,{kind:"class",name:o.name,metadata:d},null,r),o=n.value,d&&Object.defineProperty(o,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:d}),Ue(o,r)})(),o})();const Bh=["ino","data","size","mode","flags","nlink","uid","gid","atimeMs","birthtimeMs","mtimeMs","ctimeMs","version"],P_=5;var Cn;(function(e){e[e.Sync=1]="Sync",e[e.NoAtime=2]="NoAtime",e[e.Append=4]="Append",e[e.Immutable=8]="Immutable",e[e.Dead=16]="Dead",e[e.NoQuota=32]="NoQuota",e[e.Dirsync=64]="Dirsync",e[e.NoCMtime=128]="NoCMtime",e[e.SwapFile=256]="SwapFile",e[e.Private=512]="Private",e[e.IMA=1024]="IMA",e[e.AutoMount=2048]="AutoMount",e[e.NoSec=4096]="NoSec",e[e.DAX=8192]="DAX",e[e.Encrypted=16384]="Encrypted",e[e.CaseFold=32768]="CaseFold",e[e.Verity=65536]="Verity",e[e.KernelFile=131072]="KernelFile"})(Cn||(Cn={}));let ht=(()=>{var e,t,n,r,o,i,s,a,l,c,d,u,f,h,m,p,y,v,b,_,C,N,A,R,D,k,F,W,B,T,Q,K,Y,ee;let G=[Hi(ks)],re,X=[],J,se=Ls,L,ne=[],fe=[],H,ae=[],V=[],de,ge=[],pe=[],oe,$=[],j=[],le,ve=[],we=[],M,q=[],te=[],Se,ue=[],ye=[],xe,Ae=[],Ze=[],P,S=[],E=[],I,U=[],ie=[],Z,Re=[],ct=[],ft,yt=[],et=[],Ie,at=[],lt=[],qe,Me=[],ot=[],Je,xt=[],O=[],z,Ee=[],Ne=[],Te,pt=[],gn=[],hr,Qr=[],Yc=[],Sh,qc=[],Kc=[];var ji=J=class extends se{constructor(...Le){let mt={};if(typeof Le[0]=="object"&&Le[0]!==null&&!ArrayBuffer.isView(Le[0])&&(mt=Le[0],Le=[zt(ji)]),super(...Le),e.set(this,Ue(this,ne,void 0)),t.set(this,(Ue(this,fe),Ue(this,ae,void 0))),n.set(this,(Ue(this,V),Ue(this,ge,void 0))),r.set(this,(Ue(this,pe),Ue(this,$,void 0))),o.set(this,(Ue(this,j),Ue(this,ve,void 0))),i.set(this,(Ue(this,we),Ue(this,q,void 0))),s.set(this,(Ue(this,te),Ue(this,ue,void 0))),a.set(this,(Ue(this,ye),Ue(this,Ae,void 0))),l.set(this,(Ue(this,Ze),Ue(this,S,void 0))),c.set(this,(Ue(this,E),Ue(this,U,void 0))),d.set(this,(Ue(this,ie),Ue(this,Re,void 0))),u.set(this,(Ue(this,ct),Ue(this,yt,void 0))),f.set(this,(Ue(this,et),Ue(this,at,void 0))),h.set(this,(Ue(this,lt),Ue(this,Me,void 0))),m.set(this,(Ue(this,ot),Ue(this,xt,void 0))),p.set(this,(Ue(this,O),Ue(this,Ee,void 0))),y.set(this,(Ue(this,Ne),Ue(this,pt,void 0))),v.set(this,(Ue(this,gn),Ue(this,Qr,void 0))),b.set(this,(Ue(this,Yc),Ue(this,qc,void 0))),Ue(this,Kc),this.byteLength<zt(ji))throw mr(Ce("EIO",`Buffer is too small to create an inode (${this.byteLength} bytes)`));Object.assign(this,mt),this.atimeMs||(this.atimeMs=Date.now()),this.mtimeMs||(this.mtimeMs=Date.now()),this.ctimeMs||(this.ctimeMs=Date.now()),this.birthtimeMs||(this.birthtimeMs=Date.now()),this.ino&&!this.nlink&&En(`Inode ${this.ino} has an nlink of 0`)}get data(){return qt(this,e,"f")}set data(Le){Kt(this,e,Le,"f")}get __data_old(){return qt(this,t,"f")}set __data_old(Le){Kt(this,t,Le,"f")}get size(){return qt(this,n,"f")}set size(Le){Kt(this,n,Le,"f")}get mode(){return qt(this,r,"f")}set mode(Le){Kt(this,r,Le,"f")}get nlink(){return qt(this,o,"f")}set nlink(Le){Kt(this,o,Le,"f")}get uid(){return qt(this,i,"f")}set uid(Le){Kt(this,i,Le,"f")}get gid(){return qt(this,s,"f")}set gid(Le){Kt(this,s,Le,"f")}get atimeMs(){return qt(this,a,"f")}set atimeMs(Le){Kt(this,a,Le,"f")}get birthtimeMs(){return qt(this,l,"f")}set birthtimeMs(Le){Kt(this,l,Le,"f")}get mtimeMs(){return qt(this,c,"f")}set mtimeMs(Le){Kt(this,c,Le,"f")}get ctimeMs(){return qt(this,d,"f")}set ctimeMs(Le){Kt(this,d,Le,"f")}get ino(){return qt(this,u,"f")}set ino(Le){Kt(this,u,Le,"f")}get __ino_old(){return qt(this,f,"f")}set __ino_old(Le){Kt(this,f,Le,"f")}get flags(){return qt(this,h,"f")}set flags(Le){Kt(this,h,Le,"f")}get __after_flags(){return qt(this,m,"f")}set __after_flags(Le){Kt(this,m,Le,"f")}get version(){return qt(this,p,"f")}set version(Le){Kt(this,p,Le,"f")}get __padding(){return qt(this,y,"f")}set __padding(Le){Kt(this,y,Le,"f")}get attributes(){return qt(this,v,"f")}set attributes(Le){Kt(this,v,Le,"f")}get __data(){return qt(this,b,"f")}set __data(Le){Kt(this,b,Le,"f")}toString(){return`<Inode ${this.ino}>`}toJSON(){return{...Dh(this,Bh),attributes:this.attributes}}toStats(){return new To(this)}update(Le){if(!Le)return!1;let mt=!1;for(const _e of Bh)Le[_e]!==void 0&&(_e=="ino"||_e=="data"||this[_e]!==Le[_e]&&(_e=="atimeMs"&&this.flags&Cn.NoAtime||(this[_e]=Le[_e],mt=!0)));return Le.attributes&&(this.attributes.copyFrom(Le.attributes),mt=!0),mt&&(this.ctimeMs=Date.now()),mt}};return e=new WeakMap,t=new WeakMap,n=new WeakMap,r=new WeakMap,o=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakMap,f=new WeakMap,h=new WeakMap,m=new WeakMap,p=new WeakMap,y=new WeakMap,v=new WeakMap,b=new WeakMap,$h(J,"Inode"),(()=>{var Le;const mt=typeof Symbol=="function"&&Symbol.metadata?Object.create((Le=se[Symbol.metadata])!==null&&Le!==void 0?Le:null):void 0;L=[(Le=We).uint32.bind(Le)],H=[(_=We).uint32.bind(_)],de=[(C=We).uint32.bind(C)],oe=[(N=We).uint16.bind(N)],le=[(A=We).uint32.bind(A)],M=[(R=We).uint32.bind(R)],Se=[(D=We).uint32.bind(D)],xe=[(k=We).float64.bind(k)],P=[(F=We).float64.bind(F)],I=[(W=We).float64.bind(W)],Z=[(B=We).float64.bind(B)],ft=[(T=We).uint32.bind(T)],Ie=[(Q=We).uint32.bind(Q)],qe=[(K=We).uint32.bind(K)],Je=[(Y=We).uint16.bind(Y)],z=[(ee=We).uint32.bind(ee)],Te=[We.uint8(48)],hr=[du(Yi)],Sh=[We.uint8(zh)],Mt(J,null,L,{kind:"accessor",name:"data",static:!1,private:!1,access:{has:_e=>"data"in _e,get:_e=>_e.data,set:(_e,Ke)=>{_e.data=Ke}},metadata:mt},ne,fe),Mt(J,null,H,{kind:"accessor",name:"__data_old",static:!1,private:!1,access:{has:_e=>"__data_old"in _e,get:_e=>_e.__data_old,set:(_e,Ke)=>{_e.__data_old=Ke}},metadata:mt},ae,V),Mt(J,null,de,{kind:"accessor",name:"size",static:!1,private:!1,access:{has:_e=>"size"in _e,get:_e=>_e.size,set:(_e,Ke)=>{_e.size=Ke}},metadata:mt},ge,pe),Mt(J,null,oe,{kind:"accessor",name:"mode",static:!1,private:!1,access:{has:_e=>"mode"in _e,get:_e=>_e.mode,set:(_e,Ke)=>{_e.mode=Ke}},metadata:mt},$,j),Mt(J,null,le,{kind:"accessor",name:"nlink",static:!1,private:!1,access:{has:_e=>"nlink"in _e,get:_e=>_e.nlink,set:(_e,Ke)=>{_e.nlink=Ke}},metadata:mt},ve,we),Mt(J,null,M,{kind:"accessor",name:"uid",static:!1,private:!1,access:{has:_e=>"uid"in _e,get:_e=>_e.uid,set:(_e,Ke)=>{_e.uid=Ke}},metadata:mt},q,te),Mt(J,null,Se,{kind:"accessor",name:"gid",static:!1,private:!1,access:{has:_e=>"gid"in _e,get:_e=>_e.gid,set:(_e,Ke)=>{_e.gid=Ke}},metadata:mt},ue,ye),Mt(J,null,xe,{kind:"accessor",name:"atimeMs",static:!1,private:!1,access:{has:_e=>"atimeMs"in _e,get:_e=>_e.atimeMs,set:(_e,Ke)=>{_e.atimeMs=Ke}},metadata:mt},Ae,Ze),Mt(J,null,P,{kind:"accessor",name:"birthtimeMs",static:!1,private:!1,access:{has:_e=>"birthtimeMs"in _e,get:_e=>_e.birthtimeMs,set:(_e,Ke)=>{_e.birthtimeMs=Ke}},metadata:mt},S,E),Mt(J,null,I,{kind:"accessor",name:"mtimeMs",static:!1,private:!1,access:{has:_e=>"mtimeMs"in _e,get:_e=>_e.mtimeMs,set:(_e,Ke)=>{_e.mtimeMs=Ke}},metadata:mt},U,ie),Mt(J,null,Z,{kind:"accessor",name:"ctimeMs",static:!1,private:!1,access:{has:_e=>"ctimeMs"in _e,get:_e=>_e.ctimeMs,set:(_e,Ke)=>{_e.ctimeMs=Ke}},metadata:mt},Re,ct),Mt(J,null,ft,{kind:"accessor",name:"ino",static:!1,private:!1,access:{has:_e=>"ino"in _e,get:_e=>_e.ino,set:(_e,Ke)=>{_e.ino=Ke}},metadata:mt},yt,et),Mt(J,null,Ie,{kind:"accessor",name:"__ino_old",static:!1,private:!1,access:{has:_e=>"__ino_old"in _e,get:_e=>_e.__ino_old,set:(_e,Ke)=>{_e.__ino_old=Ke}},metadata:mt},at,lt),Mt(J,null,qe,{kind:"accessor",name:"flags",static:!1,private:!1,access:{has:_e=>"flags"in _e,get:_e=>_e.flags,set:(_e,Ke)=>{_e.flags=Ke}},metadata:mt},Me,ot),Mt(J,null,Je,{kind:"accessor",name:"__after_flags",static:!1,private:!1,access:{has:_e=>"__after_flags"in _e,get:_e=>_e.__after_flags,set:(_e,Ke)=>{_e.__after_flags=Ke}},metadata:mt},xt,O),Mt(J,null,z,{kind:"accessor",name:"version",static:!1,private:!1,access:{has:_e=>"version"in _e,get:_e=>_e.version,set:(_e,Ke)=>{_e.version=Ke}},metadata:mt},Ee,Ne),Mt(J,null,Te,{kind:"accessor",name:"__padding",static:!1,private:!1,access:{has:_e=>"__padding"in _e,get:_e=>_e.__padding,set:(_e,Ke)=>{_e.__padding=Ke}},metadata:mt},pt,gn),Mt(J,null,hr,{kind:"accessor",name:"attributes",static:!1,private:!1,access:{has:_e=>"attributes"in _e,get:_e=>_e.attributes,set:(_e,Ke)=>{_e.attributes=Ke}},metadata:mt},Qr,Yc),Mt(J,null,Sh,{kind:"accessor",name:"__data",static:!1,private:!1,access:{has:_e=>"__data"in _e,get:_e=>_e.__data,set:(_e,Ke)=>{_e.__data=Ke}},metadata:mt},qc,Kc),Mt(null,re={value:J},G,{kind:"class",name:J.name,metadata:mt},null,X),ji=J=re.value,mt&&Object.defineProperty(J,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:mt}),Ue(J,X)})(),ji=J})();function n2(e){return(e.mode&Rt)===Tr}function an(e){return(e.mode&Rt)===Yt}function oi(e){return(e.mode&Rt)===Po}function r2(e){return(e.mode&Rt)===Bi}function fl(e){return(e.mode&Rt)===Wi}function hl(e){return(e.mode&Rt)===Vi}function o2(e){return(e.mode&Rt)===Ui}function St(e,t,n){const r=(e==null?void 0:e.credentials)||Ar.credentials;if(oi(t)||r.euid===0||r.egid===0)return!0;let o=0;return r.uid===t.uid&&(t.mode&a_&&(o|=en),t.mode&l_&&(o|=Gt),t.mode&c_&&(o|=ru)),(r.gid===t.gid||r.groups.includes(Number(t.gid)))&&(t.mode&u_&&(o|=en),t.mode&d_&&(o|=Gt),t.mode&f_&&(o|=ru)),t.mode&h_&&(o|=en),t.mode&p_&&(o|=Gt),t.mode&m_&&(o|=ru),(o&n)===n}const A_=1;class hu extends Map{constructor(){super(...arguments),this.maxSize=er}toJSON(){return{version:A_,maxSize:this.maxSize,entries:Object.fromEntries([...this].map(([t,n])=>[t,n.toJSON()]))}}toString(){return JSON.stringify(this.toJSON())}get byteSize(){let t=this.size*zt(ht);for(const n of this.values())t+=n.size;return t}usage(){return{totalSpace:this.maxSize,freeSpace:this.maxSize-this.byteSize}}pathOf(t){for(const[n,r]of this)if(r.ino==t||r.data==t)return n}getByID(t){var n;return(n=this.entryByID(t))===null||n===void 0?void 0:n.inode}entryByID(t){for(const[n,r]of this)if(r.ino==t||r.data==t)return{path:n,inode:r}}directoryEntries(t){const n=this.get(t);if(!n)throw Ce("ENOENT");if((n.mode&Rt)!=Yt)throw Ce("ENOTDIR");const r={};for(const o of this.keys())it(o)==t&&o!=t&&(r[js(o)]=this.get(o).ino);return r}_alloc(){return Math.max(...[...this.values()].flatMap(t=>[t.ino,t.data]))+1}directories(){const t=new Map;for(const[n,r]of this){if((r.mode&Rt)!=Yt)continue;const o={};for(const i of this.keys())it(i)==n&&i!=n&&(o[js(i)]=this.get(i).ino);t.set(n,o)}return t}fromJSON(t){var n;if(t.version!=A_)throw Ce("EINVAL","Index version mismatch");this.clear();for(const[r,o]of Object.entries(t.entries))(n=o.data)!==null&&n!==void 0||(o.data=d$(1,er)),r=="/"&&(o.ino=0),this.set(r,new ht(o));return this}static parse(t){if(!l$(t))throw Ce("EINVAL","Invalid JSON");const n=JSON.parse(t),r=new hu;return r.fromJSON(n),r}}const Wh=4096;class qi{get uuid(){return this._uuid}constructor(t,n){this.type=t,this.name=n,this._uuid=crypto.randomUUID(),this.attributes=new Map,this.streamRead===qi.prototype.streamRead&&this.attributes.set("default_stream_read"),this.streamWrite===qi.prototype.streamWrite&&this.attributes.set("default_stream_write")}toString(){var t;return`${this.name} ${(t=this.label)!==null&&t!==void 0?t:""} (${this._mountPoint?"mounted on "+this._mountPoint:"unmounted"})`}usage(){return{totalSpace:0,freeSpace:0}}async ready(){}async exists(t){try{return await this.stat(t),!0}catch(n){return n.code!="ENOENT"}}existsSync(t){try{return this.statSync(t),!0}catch(n){return n.code!="ENOENT"}}streamRead(t,n){return new ReadableStream({start:async r=>{const{size:o}=await this.stat(t),{start:i=0,end:s=o}=n;for(let a=i;a<s;a+=Wh){const l=a+Wh>s?s-a:Wh,c=new Uint8Array(l);await this.read(t,c,a,a+l).catch(r.error.bind(r)),r.enqueue(c)}r.close()},type:"bytes"})}streamWrite(t,n){var r;let o=(r=n.start)!==null&&r!==void 0?r:0;return new WritableStream({write:async(i,s)=>{let a=!1;const l=d=>{a=!0,s.error(d)},{size:c}=await this.stat(t);await this.write(t,i,o).catch(l),!a&&(o+=i.byteLength,await this.touch(t,{mtimeMs:Date.now(),size:Math.max(c,o)}).catch(l))}})}}function wn(e){return JSON.parse(tu(e),(t,n)=>t==""?n:typeof n=="string"?BigInt(n).toString(16).slice(0,Math.min(n.length,8)):n)}function yr(e){return ni(JSON.stringify(e))}function ii(e,t){if(typeof e=="number")return e;if(typeof e=="string"){const n=parseInt(e,8);if(!isNaN(n))return n}if(typeof t=="number")return t;throw Ce("EINVAL","Invalid mode: "+(e==null?void 0:e.toString()))}function pu(e){if(e instanceof Date)return e.getTime();try{return Number(e)}catch{throw Ce("EINVAL","Invalid time.")}}function Hse(e){}function je(e,t=!1){if(e instanceof URL){if(e.protocol!="file:")throw Ce("EINVAL","URLs must use the file: protocol");e=e.pathname}if(e=e.toString(),e.startsWith("file://")&&(e=e.slice(7)),e.includes("\0"))throw Ce("EINVAL","Path can not contain null character");if(e.length==0)throw Ce("EINVAL","Path can not be empty");return e=e.replaceAll(/[/\\]+/g,"/"),t?e:Ao(e)}function Mo(e,t="utf8",n,r=0){return typeof e!="object"||e===null?{encoding:typeof e=="string"?e:t??null,flag:n,mode:r}:{encoding:typeof(e==null?void 0:e.encoding)=="string"?e.encoding:t??null,flag:typeof(e==null?void 0:e.flag)=="string"?e.flag:n,mode:ii("mode"in e?e==null?void 0:e.mode:null,r)}}class i2{constructor(t,n,r,o){Pr(this,"id");Pr(this,"_size");Pr(this,"options");Pr(this,"regions",[]);this.id=t,this._size=n,this.options=r,r.sparse??(r.sparse=!0),r.sparse||this.regions.push({offset:0,data:new Uint8Array(n),ranges:[]}),o==null||o.set(t,this)}get size(){return this._size}set size(t){if(t>=this._size){this._size=t;return}this._size=t;for(let n=this.regions.length-1;n>=0;n--){const r=this.regions[n];if(r.offset>=t){this.regions.splice(n,1);continue}const o=t-r.offset;r.data.byteLength>o&&(r.data=r.data.subarray(0,o)),r.ranges=r.ranges.filter(i=>i.start<t).map(i=>i.end>t?{start:i.start,end:t}:i)}}collect(){if(!this.options.sparse)return;const{regionGapThreshold:t=4095}=this.options;for(let n=0;n<this.regions.length-1;){const r=this.regions[n],o=this.regions[n+1];if(o.offset-(r.offset+r.data.byteLength)>t){n++;continue}r.ranges.push(...o.ranges),r.ranges.sort((i,s)=>i.start-s.start),r.ranges=r.ranges.reduce((i,s)=>(!i.length||i.at(-1).end<s.start?i.push(s):i.at(-1).end=Math.max(i.at(-1).end,s.end),i),[]),r.data=dl(r.data,o.offset+o.data.byteLength),r.data.set(o.data,o.offset-r.offset),this.regions.splice(n+1,1)}}missing(t,n){const r=[];for(const o of this.regions){if(o.offset>=n)break;for(const i of o.ranges)if(!(i.end<=t)&&(i.start>=n||(i.start>t&&r.push({start:t,end:Math.min(i.start,n)}),i.end>t&&(t=Math.max(t,i.end)),t>=n)))break;if(t>=n)break}return t<n&&r.push({start:t,end:n}),r}cached(t,n){const r=[];for(const i of this.regions){if(i.offset>=n)break;for(const s of i.ranges)if(!(s.end<=t)){if(s.start>=n)break;r.push({start:Math.max(t,s.start),end:Math.min(n,s.end)})}}r.sort((i,s)=>i.start-s.start);const o=[];for(const i of r){const s=o.at(-1);s&&i.start<=s.end?s.end=Math.max(s.end,i.end):o.push(i)}return o}regionAt(t){if(this.regions.length)for(const n of this.regions){if(n.offset>t)break;if(t>=n.offset&&t<n.offset+n.data.byteLength)return n}}add(t,n){const r=n+t.byteLength,o=this.regionAt(n);if(o)return o.data=dl(o.data,r),o.data.set(t,n),o.ranges.push({start:n,end:r}),o.ranges.sort((a,l)=>a.start-l.start),this.collect(),this;const i={data:t,offset:n,ranges:[{start:n,end:r}]},s=this.regions.findIndex(a=>a.offset>n);return s==-1?this.regions.push(i):this.regions.splice(s,0,i),this.collect(),this}}var Vh,Uh,Hh;(Vh=Promise.withResolvers)!==null&&Vh!==void 0||(Promise.withResolvers=(En("Using a polyfill of Promise.withResolvers"),function(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}})),(Uh=Symbol.dispose)!==null&&Uh!==void 0||(Symbol.dispose=(En("Using a polyfill of Symbol.dispose"),Symbol("Symbol.dispose"))),(Hh=Symbol.asyncDispose)!==null&&Hh!==void 0||(Symbol.asyncDispose=(En("Using a polyfill of Symbol.asyncDispose"),Symbol("Symbol.asyncDispose")));class T_{constructor(t){this.store=t}}class s2 extends T_{async get(t,n,r){return this.getSync(t,n,r)}async set(t,n,r){return this.setSync(t,n,r)}async remove(t){return this.removeSync(t)}}class D_ extends T_{constructor(){super(...arguments),this.asyncDone=Promise.resolve()}async(t){this.asyncDone=this.asyncDone.then(()=>t)}_cached(t,n){var r,o;(r=(o=this.store).cache)!==null&&r!==void 0||(o.cache=new Map);const i=this.store.cache.get(t);return i?(n&&(i.size=n.size),i):n?new i2(t,n.size,{},this.store.cache):void 0}getSync(t,n,r){const o=this._cached(t);if(!o)return;r??(r=o.size);const i=o.missing(n,r);for(const{start:a,end:l}of i)this.async(this.get(t,a,l));if(i.length)throw Ce("EAGAIN");const s=o.regionAt(n);if(!s){En("Missing cache region for "+t);return}return s.data.subarray(n-s.offset,r-s.offset)}setSync(t,n,r){this.async(this.set(t,n,r))}removeSync(t){var n;this.async(this.remove(t)),(n=this.store.cache)===null||n===void 0||n.delete(t)}}class a2{flag(t){var n,r;return(r=(n=this.raw.store.flags)===null||n===void 0?void 0:n.includes(t))!==null&&r!==void 0?r:!1}constructor(t,n){this.raw=t,this.fs=n,this.done=!1,this.originalData=new Map,this.modifiedKeys=new Set}keys(){return this.raw.keys()}async get(t,n=0,r){const o=await this.raw.get(t,n,r);return this.stash(t),o}getSync(t,n=0,r){const o=this.raw.getSync(t,n,r);return this.stash(t),o}async set(t,n,r=0){await this.markModified(t,r,n.byteLength);const o=n instanceof Uint8Array?n:new Uint8Array(n.buffer,n.byteOffset,n.byteLength);await this.raw.set(t,o,r)}setSync(t,n,r=0){this.markModifiedSync(t,r,n.byteLength);const o=n instanceof Uint8Array?n:new Uint8Array(n.buffer,n.byteOffset,n.byteLength);this.raw.setSync(t,o,r)}async remove(t){await this.markModified(t,0,void 0),await this.raw.remove(t)}removeSync(t){this.markModifiedSync(t,0,void 0),this.raw.removeSync(t)}commit(){return this.done=!0,Promise.resolve()}commitSync(){this.done=!0}async abort(){if(!this.done){for(const[t,n]of this.originalData)if(this.modifiedKeys.has(t)){if(n.some(r=>!r.data)){await this.raw.remove(t),this.fs._remove(t);continue}for(const r of n.reverse())await this.raw.set(t,r.data,r.offset)}this.done=!0}}abortSync(){if(!this.done){for(const[t,n]of this.originalData)if(this.modifiedKeys.has(t)){if(n.some(r=>!r.data)){this.raw.removeSync(t),this.fs._remove(t);continue}for(const r of n.reverse())this.raw.setSync(t,r.data,r.offset)}this.done=!0}}async[Symbol.asyncDispose](){this.done||await this.abort()}[Symbol.dispose](){this.done||this.abortSync()}stash(t,n,r=0){this.originalData.has(t)||this.originalData.set(t,[]),this.originalData.get(t).push({data:n,offset:r})}async markModified(t,n,r){this.modifiedKeys.add(t);const o=r?n+r:void 0;try{this.stash(t,await this.raw.get(t,n,o),n)}catch(i){if(!(this.raw instanceof D_))throw i;const a=this.raw._cached(t);if(!a)throw i;for(const l of a.cached(n,o??n))this.stash(t,await this.raw.get(t,l.start,l.end),l.start)}}markModifiedSync(t,n,r){this.modifiedKeys.add(t);const o=r?n+r:void 0;try{this.stash(t,this.raw.getSync(t,n,o),n)}catch(i){if(!(this.raw instanceof D_))throw i;const a=this.raw._cached(t);if(!a)throw i;for(const l of a.cached(n,o??n))this.stash(t,this.raw.getSync(t,l.start,l.end),l.start)}}}var It=function(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var r,o;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose],n&&(o=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");o&&(r=function(){try{o.call(this)}catch(i){return Promise.reject(i)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t},Ot=function(e){return function(t){function n(s){t.error=t.hasError?new e(s,t.error,"An error was suppressed during disposal."):s,t.hasError=!0}var r,o=0;function i(){for(;r=t.stack.pop();)try{if(!r.async&&o===1)return o=0,t.stack.push(r),Promise.resolve().then(i);if(r.dispose){var s=r.dispose.call(r.value);if(r.async)return o|=2,Promise.resolve(s).then(i,function(a){return n(a),i()})}else o|=1}catch(a){n(a)}if(o===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return i()}}(typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r});class Gh extends qi{_path(t){var n;const[r]=(n=this._paths.get(t))!==null&&n!==void 0?n:[];return r}_add(t,n){this._paths.has(t)||this._paths.set(t,new Set),this._paths.get(t).add(n),this._ids.set(n,t)}_remove(t){var n;for(const r of(n=this._paths.get(t))!==null&&n!==void 0?n:[])this._ids.delete(r);this._paths.delete(t)}_move(t,n){const r=[];for(const[o,i]of this._ids){const s=C_(t,o);if(s.startsWith(".."))continue;let a=vt(n,s);a.endsWith("/")&&(a=a.slice(0,-1)),r.push({oldKey:o,newKey:a,ino:i})}for(const{oldKey:o,newKey:i,ino:s}of r){this._ids.delete(o),this._ids.set(i,s);const a=this._paths.get(s);if(!a){En("Missing paths in table for ino "+s);continue}a.delete(o),a.add(i)}}async ready(){this._initialized||(this.checkRootSync(),await this.checkRoot(),await this._populate(),this._initialized=!0)}constructor(t){var n,r,o;super((n=t.type)!==null&&n!==void 0?n:1802921587,t.name),this.store=t,this._ids=new Map([["/",0]]),this._paths=new Map([[0,new Set("/")]]),this._initialized=!1,t.fs=this,this._uuid=(r=t.uuid)!==null&&r!==void 0?r:this.uuid,this.label=t.label,$i(this.name+": supports features: "+((o=this.store.flags)===null||o===void 0?void 0:o.join(", ")))}usage(){var t,n;return((n=(t=this.store).usage)===null||n===void 0?void 0:n.call(t))||{totalSpace:0,freeSpace:0}}async loadIndex(t){const n={stack:[],error:void 0,hasError:!1};try{const r=It(n,this.transaction(),!0),o=t.directories();for(const[i,s]of t)this._add(s.ino,i),await r.set(s.ino,s),o.has(i)&&await r.set(s.data,yr(o.get(i)));await r.commit()}catch(r){n.error=r,n.hasError=!0}finally{const r=Ot(n);r&&await r}}loadIndexSync(t){const n={stack:[],error:void 0,hasError:!1};try{const r=It(n,this.transaction(),!1),o=t.directories();for(const[i,s]of t)this._add(s.ino,i),r.setSync(s.ino,s),o.has(i)&&r.setSync(s.data,yr(o.get(i)));r.commitSync()}catch(r){n.error=r,n.hasError=!0}finally{Ot(n)}}async createIndex(){var t;const n={stack:[],error:void 0,hasError:!1};try{const r=new hu,o=It(n,this.transaction(),!0),i=[["/",0]],s=n_(Ce("EDEADLK"));for(;i.length;){const[a,l]=i.shift(),c=new ht(await o.get(l));if(r.set(a,c),c.mode&Yt){const d=wn((t=await o.get(c.data))!==null&&t!==void 0?t:wt(Ce("ENODATA")));for(const[u,f]of Object.entries(d))i.push([vt(a,u),f])}}return s(),r}catch(r){n.error=r,n.hasError=!0}finally{const r=Ot(n);r&&await r}}createIndexSync(){var t;const n={stack:[],error:void 0,hasError:!1};try{const r=new hu,o=It(n,this.transaction(),!1),i=[["/",0]],s=n_(Ce("EDEADLK"));for(;i.length;){const[a,l]=i.shift(),c=new ht(o.getSync(l));if(r.set(a,c),c.mode&Yt){const d=wn((t=o.getSync(c.data))!==null&&t!==void 0?t:wt(Ce("ENODATA")));for(const[u,f]of Object.entries(d))i.push([vt(a,u),f])}}return s(),r}catch(r){n.error=r,n.hasError=!0}finally{Ot(n)}}async rename(t,n){var r,o,i;const s={stack:[],error:void 0,hasError:!1};try{const a=It(s,this.transaction(),!0),l=gr(t),c=gr(n),d=await this.findInode(a,l.dir),u=wn((r=await a.get(d.data))!==null&&r!==void 0?r:wt(Ce("ENODATA")));if(!u[l.base])throw Ce("ENOENT");const f=u[l.base];if(f!=this._ids.get(t)&&cn(`Ino mismatch while renaming ${t} to ${n}`),delete u[l.base],(c.dir+"/").startsWith(t+"/"))throw Ce("EBUSY");const h=c.dir==l.dir,m=h?d:await this.findInode(a,c.dir),p=h?u:wn((o=await a.get(m.data))!==null&&o!==void 0?o:wt(Ce("ENODATA")));if(p[c.base]){const y=new ht((i=await a.get(p[c.base]))!==null&&i!==void 0?i:wt(Ce("ENOENT")));if(!y.toStats().isFile())throw Ce("EISDIR");await a.remove(y.data),await a.remove(p[c.base])}p[c.base]=f,await a.set(d.data,yr(u)),await a.set(m.data,yr(p)),await a.commit(),this._move(t,n)}catch(a){s.error=a,s.hasError=!0}finally{const a=Ot(s);a&&await a}}renameSync(t,n){var r,o,i;const s={stack:[],error:void 0,hasError:!1};try{const a=It(s,this.transaction(),!1),l=gr(t),c=gr(n),d=this.findInodeSync(a,l.dir),u=wn((r=a.getSync(d.data))!==null&&r!==void 0?r:wt(Ce("ENODATA")));if(!u[l.base])throw Ce("ENOENT");const f=u[l.base];if(f!=this._ids.get(t)&&cn(`Ino mismatch while renaming ${t} to ${n}`),delete u[l.base],(c.dir+"/").startsWith(t+"/"))throw Ce("EBUSY");const h=c.dir===l.dir,m=h?d:this.findInodeSync(a,c.dir),p=h?u:wn((o=a.getSync(m.data))!==null&&o!==void 0?o:wt(Ce("ENODATA")));if(p[c.base]){const y=new ht((i=a.getSync(p[c.base]))!==null&&i!==void 0?i:wt(Ce("ENOENT")));if(!y.toStats().isFile())throw Ce("EISDIR");a.removeSync(y.data),a.removeSync(p[c.base])}p[c.base]=f,a.setSync(d.data,yr(u)),a.setSync(m.data,yr(p)),a.commitSync(),this._move(t,n)}catch(a){s.error=a,s.hasError=!0}finally{Ot(s)}}async stat(t){const n={stack:[],error:void 0,hasError:!1};try{const r=It(n,this.transaction(),!0);return await this.findInode(r,t)}catch(r){n.error=r,n.hasError=!0}finally{const r=Ot(n);r&&await r}}statSync(t){const n={stack:[],error:void 0,hasError:!1};try{const r=It(n,this.transaction(),!1);return this.findInodeSync(r,t)}catch(r){n.error=r,n.hasError=!0}finally{Ot(n)}}async touch(t,n){const r={stack:[],error:void 0,hasError:!1};try{const o=It(r,this.transaction(),!0),i=await this.findInode(o,t);i.update(n)&&(this._add(i.ino,t),o.setSync(i.ino,i)),await o.commit()}catch(o){r.error=o,r.hasError=!0}finally{const o=Ot(r);o&&await o}}touchSync(t,n){const r={stack:[],error:void 0,hasError:!1};try{const o=It(r,this.transaction(),!1),i=this.findInodeSync(o,t);i.update(n)&&(this._add(i.ino,t),o.setSync(i.ino,i)),o.commitSync()}catch(o){r.error=o,r.hasError=!0}finally{Ot(r)}}async createFile(t,n){return n.mode|=Tr,await this.commitNew(t,n,new Uint8Array)}createFileSync(t,n){return n.mode|=Tr,this.commitNewSync(t,n,new Uint8Array)}async unlink(t){return this.remove(t,!1)}unlinkSync(t){this.removeSync(t,!1)}async rmdir(t){if((await this.readdir(t)).length)throw Ce("ENOTEMPTY");await this.remove(t,!0)}rmdirSync(t){if(this.readdirSync(t).length)throw Ce("ENOTEMPTY");this.removeSync(t,!0)}async mkdir(t,n){return n.mode|=Yt,await this.commitNew(t,n,ni("{}"))}mkdirSync(t,n){return n.mode|=Yt,this.commitNewSync(t,n,ni("{}"))}async readdir(t){var n;const r={stack:[],error:void 0,hasError:!1};try{const o=It(r,this.transaction(),!0),i=await this.findInode(o,t);return Object.keys(wn((n=await o.get(i.data))!==null&&n!==void 0?n:wt(Ce("ENOENT"))))}catch(o){r.error=o,r.hasError=!0}finally{const o=Ot(r);o&&await o}}readdirSync(t){var n;const r={stack:[],error:void 0,hasError:!1};try{const o=It(r,this.transaction(),!1),i=this.findInodeSync(o,t);return Object.keys(wn((n=o.getSync(i.data))!==null&&n!==void 0?n:wt(Ce("ENOENT"))))}catch(o){r.error=o,r.hasError=!0}finally{Ot(r)}}async sync(){}syncSync(){}async link(t,n){var r;const o={stack:[],error:void 0,hasError:!1};try{const i=It(o,this.transaction(),!0),s=it(n),a=await this.findInode(i,s),l=wn((r=await i.get(a.data))!==null&&r!==void 0?r:wt(Ce("ENOENT"))),c=await this.findInode(i,t);c.nlink++,l[js(n)]=c.ino,this._add(c.ino,n),await i.set(c.ino,c),await i.set(a.data,yr(l)),await i.commit()}catch(i){o.error=i,o.hasError=!0}finally{const i=Ot(o);i&&await i}}linkSync(t,n){var r;const o={stack:[],error:void 0,hasError:!1};try{const i=It(o,this.transaction(),!1),s=it(n),a=this.findInodeSync(i,s),l=wn((r=i.getSync(a.data))!==null&&r!==void 0?r:wt(Ce("ENOENT"))),c=this.findInodeSync(i,t);c.nlink++,l[js(n)]=c.ino,this._add(c.ino,n),i.setSync(c.ino,c),i.setSync(a.data,yr(l)),i.commitSync()}catch(i){o.error=i,o.hasError=!0}finally{Ot(o)}}async read(t,n,r,o){var i;const s={stack:[],error:void 0,hasError:!1};try{const a=It(s,this.transaction(),!0),l=await this.findInode(a,t);if(l.size==0)return;const c=(i=await a.get(l.data,r,o))!==null&&i!==void 0?i:wt(Ce("ENODATA")),d=a.flag("partial")?c:c.subarray(r,o);d.byteLength>n.byteLength&&cn(`Trying to place ${d.byteLength} bytes into a ${n.byteLength} byte buffer on read`),n.set(d)}catch(a){s.error=a,s.hasError=!0}finally{const a=Ot(s);a&&await a}}readSync(t,n,r,o){var i;const s={stack:[],error:void 0,hasError:!1};try{const a=It(s,this.transaction(),!1),l=this.findInodeSync(a,t);if(l.size==0)return;const c=(i=a.getSync(l.data,r,o))!==null&&i!==void 0?i:wt(Ce("ENODATA")),d=a.flag("partial")?c:c.subarray(r,o);d.byteLength>n.byteLength&&cn(`Trying to place ${d.byteLength} bytes into a ${n.byteLength} byte buffer on read`),n.set(d)}catch(a){s.error=a,s.hasError=!0}finally{Ot(s)}}async write(t,n,r){var o;const i={stack:[],error:void 0,hasError:!1};try{const s=It(i,this.transaction(),!0),a=await this.findInode(s,t);let l=n;s.flag("partial")||(l=dl((o=await s.get(a.data))!==null&&o!==void 0?o:new Uint8Array,r+n.byteLength),l.set(n,r),r=0),await s.set(a.data,l,r),this._add(a.ino,t),await s.commit()}catch(s){i.error=s,i.hasError=!0}finally{const s=Ot(i);s&&await s}}writeSync(t,n,r){var o;const i={stack:[],error:void 0,hasError:!1};try{const s=It(i,this.transaction(),!1),a=this.findInodeSync(s,t);let l=n;s.flag("partial")||(l=dl((o=s.getSync(a.data))!==null&&o!==void 0?o:new Uint8Array,r+n.byteLength),l.set(n,r),r=0),s.setSync(a.data,l,r),this._add(a.ino,t),s.commitSync()}catch(s){i.error=s,i.hasError=!0}finally{Ot(i)}}transaction(){return new a2(this.store.transaction(),this)}async checkRoot(){const t={stack:[],error:void 0,hasError:!1};try{const n=It(t,this.transaction(),!0);if(await n.get(Ln))return;const r=new ht({ino:Ln,data:1,mode:511|Yt});await n.set(r.data,ni("{}")),this._add(Ln,"/"),await n.set(Ln,r),await n.commit()}catch(n){t.error=n,t.hasError=!0}finally{const n=Ot(t);n&&await n}}checkRootSync(){const t={stack:[],error:void 0,hasError:!1};try{const n=It(t,this.transaction(),!1);if(n.getSync(Ln))return;const r=new ht({ino:Ln,data:1,mode:511|Yt});n.setSync(r.data,ni("{}")),this._add(Ln,"/"),n.setSync(Ln,r),n.commitSync()}catch(n){t.error=n,t.hasError=!0}finally{Ot(t)}}async _populate(){const t={stack:[],error:void 0,hasError:!1};try{if(this._initialized){En("Attempted to populate tables after initialization");return}$i("Populating tables with existing store metadata");const n=It(t,this.transaction(),!0),r=await n.get(Ln);if(!r){i_("Store does not have a root inode");const a=new ht({ino:Ln,data:1,mode:511|Yt});await n.set(a.data,ni("{}")),this._add(Ln,"/"),await n.set(Ln,a),await n.commit();return}if(r.length<zt(ht)){mr("Store contains an invalid root inode. Refusing to populate tables");return}const o=new Set;let i=0;const s=[["/",Ln]];for(;s.length>0;){i++;const[a,l]=s.shift();this._add(l,a);const c=await n.get(l);if(!c){En("Store is missing data for inode: "+l);continue}if(c.length<zt(ht)){En(`Invalid inode size for ino ${l}: ${c.length}`);continue}const d=new ht(c);if((d.mode&Yt)!=Yt||o.has(l))continue;o.add(l);const u=await n.get(d.data);if(!u){En("Store is missing directory data: "+d.data);continue}const f=wn(u);for(const[h,m]of Object.entries(f))s.push([vt(a,h),m])}$i(`Added ${i} existing inode(s) from store`)}catch(n){t.error=n,t.hasError=!0}finally{const n=Ot(t);n&&await n}}async _findInode(t,n,r=new Set){var o,i,s;if(r.has(n))throw mr(Ce("EIO","Infinite loop detected while finding inode"));if(r.add(n),n=="/")return new ht((o=await t.get(Ln))!==null&&o!==void 0?o:wt(Ce("ENODATA")));const{dir:a,base:l}=gr(n),c=await this._findInode(t,a,r),d=wn((i=await t.get(c.data))!==null&&i!==void 0?i:wt(Ce("ENODATA")));if(!(l in d))throw Ce("ENOENT");return new ht((s=await t.get(d[l]))!==null&&s!==void 0?s:wt(Ce("ENODATA")))}_findInodeSync(t,n,r=new Set){var o,i,s;if(r.has(n))throw mr(Ce("EIO","Infinite loop detected while finding inode"));if(r.add(n),n=="/")return new ht((o=t.getSync(Ln))!==null&&o!==void 0?o:wt(Ce("ENOENT")));const{dir:a,base:l}=gr(n),c=this._findInodeSync(t,a,r),d=wn((i=t.getSync(c.data))!==null&&i!==void 0?i:wt(Ce("ENODATA")));if(!(l in d))throw Ce("ENOENT");return new ht((s=t.getSync(d[l]))!==null&&s!==void 0?s:wt(Ce("ENODATA")))}async findInode(t,n){var r;if(this.attributes.has("no_id_tables"))return await this._findInode(t,n);const o=this._ids.get(n);if(o===void 0)throw Ce("ENOENT");return new ht((r=await t.get(o))!==null&&r!==void 0?r:wt(Ce("ENOENT")))}findInodeSync(t,n){var r;if(this.attributes.has("no_id_tables"))return this._findInodeSync(t,n);const o=this._ids.get(n);if(o===void 0)throw Ce("ENOENT");return new ht((r=t.getSync(o))!==null&&r!==void 0?r:wt(Ce("ENOENT")))}allocNew(t){var n;(n=this._lastID)!==null&&n!==void 0||(this._lastID=Math.max(...this._paths.keys())),this._lastID+=2;const r=this._lastID;if(r>er)throw cn(Ce("ENOSPC","No IDs available"));return this._add(r,t),r}async commitNew(t,n,r){var o;const i={stack:[],error:void 0,hasError:!1};try{if(t=="/")throw Ce("EEXIST");const s=It(i,this.transaction(),!0),{dir:a,base:l}=gr(t),c=await this.findInode(s,a),d=wn((o=await s.get(c.data))!==null&&o!==void 0?o:wt(Ce("ENOENT")));if(d[l])throw Ce("EEXIST");const u=this.allocNew(t),f=new ht({...n,ino:u,data:u+1,size:r.byteLength,nlink:1});return await s.set(f.ino,f),await s.set(f.data,r),d[l]=f.ino,await s.set(c.data,yr(d)),await s.commit(),f}catch(s){i.error=s,i.hasError=!0}finally{const s=Ot(i);s&&await s}}commitNewSync(t,n,r){var o;const i={stack:[],error:void 0,hasError:!1};try{if(t=="/")throw Ce("EEXIST");const s=It(i,this.transaction(),!1),{dir:a,base:l}=gr(t),c=this.findInodeSync(s,a),d=wn((o=s.getSync(c.data))!==null&&o!==void 0?o:wt(Ce("ENOENT")));if(d[l])throw Ce("EEXIST");const u=this.allocNew(t),f=new ht({...n,ino:u,data:u+1,size:r.byteLength,nlink:1});return s.setSync(f.ino,f),s.setSync(f.data,r),d[l]=f.ino,s.setSync(c.data,yr(d)),s.commitSync(),f}catch(s){i.error=s,i.hasError=!0}finally{Ot(i)}}async remove(t,n){var r,o;const i={stack:[],error:void 0,hasError:!1};try{const s=It(i,this.transaction(),!0),{dir:a,base:l}=gr(t),c=await this.findInode(s,a),d=wn((r=await s.get(c.data))!==null&&r!==void 0?r:wt(Ce("ENOENT")));if(!d[l])throw Ce("ENOENT");const u=d[l],f=new ht((o=await s.get(u))!==null&&o!==void 0?o:wt(Ce("ENOENT")));if(delete d[l],!n&&an(f))throw Ce("EISDIR");await s.set(c.data,yr(d)),f.nlink>1?(f.update({nlink:f.nlink-1}),await s.set(f.ino,f)):(await s.remove(f.data),await s.remove(u),this._remove(u)),await s.commit()}catch(s){i.error=s,i.hasError=!0}finally{const s=Ot(i);s&&await s}}removeSync(t,n){var r,o;const i={stack:[],error:void 0,hasError:!1};try{const s=It(i,this.transaction(),!1),{dir:a,base:l}=gr(t),c=this.findInodeSync(s,a),d=wn((r=s.getSync(c.data))!==null&&r!==void 0?r:wt(Ce("ENOENT"))),u=d[l];if(!u)throw Ce("ENOENT");const f=new ht((o=s.getSync(u))!==null&&o!==void 0?o:wt(Ce("ENOENT")));if(delete d[l],!n&&an(f))throw Ce("EISDIR");s.setSync(c.data,yr(d)),f.nlink>1?(f.update({nlink:f.nlink-1}),s.setSync(f.ino,f)):(s.removeSync(f.data),s.removeSync(u),this._remove(u)),s.commitSync()}catch(s){i.error=s,i.hasError=!0}finally{Ot(i)}}}class l2 extends s2{async keys(){return this.store.keys()}async get(t){var n,r,o;return await((o=(r=(n=this.store).getAsync)===null||r===void 0?void 0:r.call(n,t))!==null&&o!==void 0?o:this.store.get(t))}getSync(t){return this.store.get(t)}setSync(t,n){this.store.set(t,n)}removeSync(t){this.store.delete(t)}}class c2 extends Map{constructor(t=er,n){super(),this.maxSize=t,this.label=n,this.flags=[],this.name="tmpfs"}async sync(){}transaction(){return new l2(this)}get bytes(){let t=this.size*4;for(const n of this.values())t+=n.byteLength;return t}usage(){return{totalSpace:this.maxSize,freeSpace:this.maxSize-this.bytes}}}const Yh={name:"InMemory",options:{maxSize:{type:"number",required:!1},label:{type:"string",required:!1}},create({maxSize:e,label:t}){const n=new Gh(new c2(e,t));return n.checkRootSync(),n}};let u2=!0;class M_ extends Th{get cursor(){return this._cursor}constructor(t,n,r,o=!1){super(),this.input=t,this.output=n,this.terminal=o,this.line="",this._cursor=0,this._buffer="",this._closed=!1,this._paused=!1,this._prompt="",this._history=[],this._historyIndex=-1,this._currentLine="",this._onData=i=>{if(!(this._paused||this._closed)){this._buffer+=typeof i=="string"?i:i.toString("utf8");for(let s=this._buffer.indexOf(`
|
|
15
|
+
`);s>=0;s=this._buffer.indexOf(`
|
|
16
|
+
`)){let a=this._buffer.substring(0,s);a.endsWith("\r")&&(a=a.substring(0,a.length-1)),this._buffer=this._buffer.substring(s+1),this.line=a,a.trim()&&!a.trim().match(/^\s*$/)&&this._history.at(-1)!=a&&(this._history.push(a),this._historyIndex=this._history.length,this.emit("history",this._history)),this.emit("line",a)}}},this.input.on("data",this._onData),this.input.on("end",this.close.bind(this)),this.input.on("close",this.close.bind(this))}close(){var t,n;if(!this._closed){if(this._closed=!0,(n=(t=this.input)===null||t===void 0?void 0:t.removeAllListeners)===null||n===void 0||n.call(t),this._buffer.length){const r=this._buffer;this._buffer="",this.line=r,this.emit("line",r)}this.emit("history",this._history),this.emit("close"),this.removeAllListeners()}}pause(){return this._paused?this:(this._paused=!0,"pause"in this.input&&this.input.pause(),this.emit("pause"),this)}resume(){return this._paused?(this._paused=!1,"resume"in this.input&&this.input.resume(),this.emit("resume"),this):this}setPrompt(t){this._prompt=t}getPrompt(){return this._prompt}prompt(t){if(!this.output)return;if(!t){this.output.write(this._prompt);return}const{cols:n}=this.getCursorPos();this.output.write(this._prompt),this._cursor=n}write(t,n){if(!this._closed){if(t){const r=typeof t=="string"?t:t.toString("utf8");this._onData(r)}if(!(!n||!this.terminal))switch((n.ctrl?"^":"")+n.name){case"^c":this.emit("SIGINT");break;case"^z":this.emit("SIGTSTP");break;case"^q":this.emit("SIGCONT");break;case"home":case"^a":if(!this.output)return;wr(this.output,-this._cursor,0),this._cursor=0,this._cursor=0;break;case"^e":case"end":{if(!this.output)return;const r=this.line.length-this._cursor;if(!r)return;wr(this.output,r,0),this._cursor=this.line.length,this._cursor=this.line.length;break}case"^k":{if(!this.output||this._cursor>=this.line.length)return;const r=this.line.slice(0,this._cursor);mu(this.output,1),this.line=r;break}case"^u":{if(!this.output||!this._cursor)return;const r=this.line.slice(this._cursor);mu(this.output,0),wr(this.output,0,0),this.output.write(this._prompt+r),this.line=r,this._cursor=0,this._cursor=0;break}case"^w":{if(!this.output||!this._cursor)return;let r=this._cursor-1;for(;r>=0&&this.line[r]===" ";)r--;for(;r>=0&&this.line[r]!==" ";)r--;const o=this.line.slice(0,r+1)+this.line.slice(this._cursor),i=r+1;this._renderLine(o),this._cursor=i,this._cursor=i,wr(this.output,-o.length,0),wr(this.output,i,0);break}case"^return":case"^enter":this._onData(`
|
|
17
|
+
`);break;case"return":case"enter":this._onData((t?typeof t=="string"?t:t.toString("utf8"):"")+`
|
|
18
|
+
`);break;case"up":case"down":{if(!this.output||!this._history.length)return;if(this._historyIndex===this._history.length&&(this._currentLine=this.line||""),n.name=="up"&&this._historyIndex>0)this._historyIndex--;else if(n.name=="down"&&this._historyIndex<this._history.length-1)this._historyIndex++;else if(n.name=="down"&&this._historyIndex==this._history.length-1){this._historyIndex=this._history.length,this._renderLine(this._currentLine);return}else return;const r=this._history[this._historyIndex];this._renderLine(r);break}case"left":case"right":{const r=n.name=="left"?-1:1;if(!this.output)return;const o=Math.max(0,Math.min(this.line.length,this._cursor+r));if(o==this._cursor)return;wr(this.output,r,0),this._cursor=o,this._cursor=o;break}case"backspace":{if(!this.output||!this._cursor)return;const r=this.line.slice(0,this._cursor-1)+this.line.slice(this._cursor);this._renderLine(r),this._cursor=--this._cursor,this._cursor>0&&(wr(this.output,-this._cursor,0),wr(this.output,this._cursor,0));break}case"delete":{if(!this.output||this._cursor>=this.line.length)return;const r=this.line.slice(0,this._cursor)+this.line.slice(this._cursor+1);mu(this.output,0),wr(this.output,0,0),this.output.write(this._prompt+r),this.line=r,wr(this.output,-r.length,0),wr(this.output,this._cursor,0);break}}}}_renderLine(t){this.output&&(mu(this.output,0),wr(this.output,0,0),this.output.write(this._prompt+t),this.line=t,this._cursor=t.length,this._cursor=t.length)}question(t,n,r){const o=typeof n=="function"?n:r;if(this._closed||!this.output){o("");return}this.output.write(t),this.once("line",o)}getCursorPos(){return{rows:0,cols:this.cursor}}prependListener(t,n){const r=this.listeners(t);return this.removeAllListeners(t),this.on(t,n),r.forEach(this.on.bind(this,t)),this}prependOnceListener(t,n){const r=this.listeners(t);return this.removeAllListeners(t),this.once(t,n),r.forEach(this.on.bind(this,t)),this}setMaxListeners(){return En("Interface.prototype.setMaxListeners is not supported"),this}getMaxListeners(){return En("Interface.prototype.getMaxListeners is not supported"),10}[Symbol.asyncIterator](){let t=!1;return{next:async()=>{if(t)return{done:t,value:void 0};const{resolve:n,promise:r}=Promise.withResolvers();return this.once("line",o=>n({value:o,done:!1})),this.once("close",()=>{t=!0,n({value:void 0,done:t})}),r},return:async n=>t?{done:t,value:n}:(t=!0,this.close(),{done:t,value:n}),throw:async n=>{throw t||(t=!0,this.close()),n},[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{t||(t=!0,this.close())}}}async[Symbol.asyncDispose](){if(this._closed)return;const{resolve:t,promise:n}=Promise.withResolvers();this.once("close",()=>t()),this.close(),await n}rawListeners(t){return this.listeners(t)}}function d2(e,t,n,r){return"input"in e?new M_(e.input,e.output,e.completer,e.terminal):new M_(e,t,n,r)}function mu(e,t){return e.write(t>=0?"\r\x1B[K":"\x1B[K"),!0}function wr(e,t,n){if(!e.write)return!1;let r="";return t<0?r+=`\x1B[${-t}D`:t>0&&(r+=`\x1B[${t}C`),n<0?r+=`\x1B[${-n}A`:n>0&&(r+=`\x1B[${n}B`),r&&e.write(r),!0}function Dr(e,t,n,r){const o=e[t];if(typeof o!="function")throw new TypeError(`${t} is not a function`);return function(...i){try{return o.call(e,...i)}catch(s){throw fn(Object.assign(s,{path:n,dest:r,syscall:t.endsWith("Sync")?t.slice(0,-4):t}))}}}class gu{get position(){return this.flag&zi?this.inode.size:this._position}set position(t){this._position=t}constructor(t,n,r,o,i,s){this.context=t,this.path=n,this.fs=r,this.internalPath=o,this.flag=i,this.inode=s,this._position=0,this.dirty=!1,this.closed=!1}[Symbol.dispose](){this.close()}get _isSync(){return!!(this.flag&au||this.inode.flags&Cn.Sync||this.fs.attributes.has("sync"))}sync(){if(this.closed)throw me("EBADF","sync",this.path);this.dirty&&(this.fs.attributes.has("no_write")||this.fs.touchSync(this.internalPath,this.inode),this.dirty=!1)}datasync(){return this.sync()}close(){if(this.closed)throw me("EBADF","close",this.path);this.sync(),this.dispose()}dispose(t){if(this.closed)throw me("EBADF","close",this.path);if(this.dirty&&!t)throw me("EBUSY","close",this.path);this.closed=!0}stat(){if(this.closed)throw me("EBADF","stat",this.path);return this.inode}truncate(t){if(t<0)throw me("EINVAL","truncate",this.path);if(this.closed)throw me("EBADF","truncate",this.path);if(!(this.flag&yn||this.flag&no))throw me("EBADF","truncate",this.path);if(this.fs.attributes.has("readonly"))throw me("EROFS","truncate",this.path);if(this.inode.flags&Cn.Immutable)throw me("EPERM","truncate",this.path);this.dirty=!0,this.inode.mtimeMs=Date.now(),this.inode.size=t,this.inode.ctimeMs=Date.now(),this._isSync&&this.sync()}write(t,n=0,r=t.byteLength-n,o=this.position){if(this.closed)throw me("EBADF","write",this.path);if(!(this.flag&yn||this.flag&no))throw me("EBADF","write",this.path);if(this.fs.attributes.has("readonly"))throw me("EROFS","write",this.path);if(this.inode.flags&Cn.Immutable)throw me("EPERM","write",this.path);this.dirty=!0;const i=o+r,s=t.subarray(n,n+r);return!hl(this.inode)&&!fl(this.inode)&&i>this.inode.size&&(this.inode.size=i),this.inode.mtimeMs=Date.now(),this.inode.ctimeMs=Date.now(),this._position=o+s.byteLength,this.fs.writeSync(this.internalPath,s,o),this._isSync&&this.sync(),s.byteLength}read(t,n=0,r=t.byteLength-n,o=this.position){if(this.closed)throw me("EBADF","read",this.path);if(this.flag&yn)throw me("EBADF","read",this.path);!(this.inode.flags&Cn.NoAtime)&&!this.fs.attributes.has("no_atime")&&(this.dirty=!0,this.inode.atimeMs=Date.now());let i=o+r;!hl(this.inode)&&!fl(this.inode)&&i>this.inode.size&&(i=o+Math.max(this.inode.size-o,0)),this._position=i;const s=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);return this.fs.readSync(this.internalPath,s.subarray(n,n+r),o,i),this._isSync&&this.sync(),i-o}chmod(t){if(this.closed)throw me("EBADF","chmod",this.path);this.dirty=!0,this.inode.mode=this.inode.mode&(t>Rt?-61441:Rt)|t,(this._isSync||t>Rt)&&this.sync()}chown(t,n){if(this.closed)throw me("EBADF","chmod",this.path);this.dirty=!0,R_(this.inode,t,n),this._isSync&&this.sync()}utimes(t,n){if(this.closed)throw me("EBADF","utimes",this.path);this.dirty=!0,this.inode.atimeMs=t,this.inode.mtimeMs=n,this._isSync&&this.sync()}streamRead(t){if(this.closed)throw me("EBADF","streamRead",this.path);return this.fs.streamRead(this.internalPath,t)}streamWrite(t){if(this.closed)throw me("EBADF","write",this.path);if(this.inode.flags&Cn.Immutable)throw me("EPERM","write",this.path);if(this.fs.attributes.has("readonly"))throw me("EROFS","write",this.path);return this.fs.streamWrite(this.internalPath,t)}}function yu(e){var t,n;const r=(n=(t=e.context)===null||t===void 0?void 0:t.descriptors)!==null&&n!==void 0?n:Ar.descriptors,o=Math.max(r.size?Math.max(...r.keys())+1:0,4);return r.set(o,e),o}function Nn(e,t){var n;const o=((n=e==null?void 0:e.descriptors)!==null&&n!==void 0?n:Ar.descriptors).get(t);if(!o)throw Ce("EBADF");return o}function I_(e,t){var n;return((n=e==null?void 0:e.descriptors)!==null&&n!==void 0?n:Ar.descriptors).delete(t)}const f2=/[rwasx]{1,2}\+?/;function Io(e){if(typeof e=="number")return e;if(!f2.test(e))throw Ce("EINVAL","Invalid flag string: "+e);return h2(e)}function h2(e){if(!e.includes("r")&&!e.includes("w")&&!e.includes("a"))throw Ce("EINVAL","Invalid flag string: "+e);let t=e.includes("r")?s_:ou;return e.includes("w")&&(t|=su),e.includes("a")&&(t|=zi),e.includes("+")?t|=no:e.includes("r")||(t|=yn),e.includes("s")&&(t|=au),e.includes("x")&&(t|=iu),t}function O_(e){let t=0;return e&yn||(t|=en),(e&yn||e&no)&&(t|=Gt),t}const pl=new Map;qh("/",Yh.create({label:"root"}));function qh(e,t){if(e[0]!="/"&&(e="/"+e),e=Ao.call(this,e),pl.has(e))throw cn(Ce("EINVAL","Mount point is already in use: "+e));t._mountPoint=e,pl.set(e,t),Mh(`Mounted ${t.name} on ${e}`),$i(`${t.name} attributes: ${[...t.attributes].map(([n,r])=>r!=null?n+"="+r:n).join(", ")}`)}function k_(e){if(e[0]!="/"&&(e="/"+e),e=Ao.call(this,e),!pl.has(e)){En(e+" is already unmounted");return}pl.delete(e),i_("Unmounted "+e)}function tt(e,t){const n=(t==null?void 0:t.root)||Ar.root;e=je(vt(n,e));const r=[...pl].sort((o,i)=>o[0].length>i[0].length?-1:1);for(const[o,i]of r)if(m2(o,e))return e=e.slice(o.length>1?o.length:0),e===""&&(e=n),{fs:i,path:e,mountPoint:o,root:n};throw y$(new Wt(he.EIO,"No file system for "+e))}function L_(e,t){const n=e.usage(),r=n.blockSize||4096;return{type:(t?BigInt:Number)(e.type),bsize:(t?BigInt:Number)(r),ffree:(t?BigInt:Number)(n.freeNodes||er),files:(t?BigInt:Number)(n.totalNodes||er),bavail:(t?BigInt:Number)(n.freeSpace/r),bfree:(t?BigInt:Number)(n.freeSpace/r),blocks:(t?BigInt:Number)(n.totalSpace/r)}}function p2(e){var t,n,r,o,i,s,a;const l=this!==null&&this!==void 0?this:Ar;if(((t=l.credentials)===null||t===void 0?void 0:t.uid)!==0&&((n=l.credentials)===null||n===void 0?void 0:n.gid)!==0&&((r=l.credentials)===null||r===void 0?void 0:r.euid)!==0&&((o=l.credentials)===null||o===void 0?void 0:o.egid)!==0)throw Ce("EPERM","Can not chroot() as non-root user");(i=l.root)!==null&&i!==void 0||(l.root="/");const c=vt(l.root,e);for(const d of(a=(s=l.descriptors)===null||s===void 0?void 0:s.values())!==null&&a!==void 0?a:[]){if(!d.path.startsWith(l.root))throw me("EBUSY","chroot",d.path);d.path=d.path.slice(l.root.length)}if(c.length>l.root.length)throw Ce("EPERM","Can not chroot() outside of current root");l.root=c}function m2(e,t){return e==="/"||e===t?!0:(e.endsWith("/")||(e+="/"),t.startsWith(e))}class j_ extends Th{off(t,n,r,o){return super.off(t,n,r,o)}removeListener(t,n,r,o){return super.removeListener(t,n,r,o)}constructor(t,n){super(),this._context=t,this.path=n}setMaxListeners(){throw me("ENOSYS","Watcher.setMaxListeners")}getMaxListeners(){throw me("ENOSYS","Watcher.getMaxListeners")}prependListener(){throw me("ENOSYS","Watcher.prependListener")}prependOnceListener(){throw me("ENOSYS","Watcher.prependOnceListener")}rawListeners(){throw me("ENOSYS","Watcher.rawListeners")}ref(){return this}unref(){return this}}class F_ extends j_{constructor(t,n,r){super(t,n),this.options=r,this.realpath=t!=null&&t.root?vt(t.root,n):n,y2(this.realpath,this)}close(){super.emit("close"),w2(this.realpath,this)}[Symbol.dispose](){this.close()}}class g2 extends j_{constructor(t,n,r){super(t,n),this.options=r,this.start()}onInterval(){try{const t=Mr(this.path);Z$(this.previous,t)||(this.emit("change",t,this.previous),this.previous=t)}catch(t){this.emit("error",t)}}start(){const t=this.options.interval||5e3;try{this.previous=Mr(this.path)}catch(n){this.emit("error",n);return}this.intervalId=setInterval(this.onInterval.bind(this),t),!this.options.persistent&&typeof this.intervalId=="object"&&this.intervalId.unref()}stop(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this.removeAllListeners()}}const si=new Map;function y2(e,t){const n=je(e);si.has(n)||si.set(n,new Set),si.get(n).add(t)}function w2(e,t){const n=je(e);si.has(n)&&(si.get(n).delete(t),si.get(n).size===0&&si.delete(n))}function jn(e,t,n){var r;e&&(n=vt((r=e.root)!==null&&r!==void 0?r:"/",n)),n=je(n);for(let o=n;o!="/";o=it(o)){const i=si.get(o);if(i)for(const s of i)s.emit("change",t,C_.call(s._context,o,n)||js(n))}}var Fs=function(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var r,o;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose],n&&(o=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");o&&(r=function(){try{o.call(this)}catch(i){return Promise.reject(i)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t},$s=function(e){return function(t){function n(s){t.error=t.hasError?new e(s,t.error,"An error was suppressed during disposal."):s,t.hasError=!0}var r,o=0;function i(){for(;r=t.stack.pop();)try{if(!r.async&&o===1)return o=0,t.stack.push(r),Promise.resolve().then(i);if(r.dispose){var s=r.dispose.call(r.value);if(r.async)return o|=2,Promise.resolve(s).then(i,function(a){return n(a),i()})}else o|=1}catch(a){n(a)}if(o===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return i()}}(typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r});function v2(e,t){e=je(e),t=je(t);const n=tt(e,this),r=tt(t,this),o={syscall:"rename",path:e,dest:t};if(n.fs!==r.fs)throw me("EXDEV",o);if(r.path.startsWith(n.path+"/"))throw me("EBUSY",o);const i=Mr.call(this,e),s=Mr.call(this,it(e)),a=Mr.call(this,it(t));let l;try{l=Mr.call(this,t)}catch(c){if(fn(Object.assign(c,o)),c.code!="ENOENT")throw c}if(!s.hasAccess(en,this)||!a.hasAccess(Gt,this))throw me("EACCES",o);if(l&&!an(i)&&an(l))throw me("EISDIR",o);if(l&&an(i)&&!an(l))throw me("ENOTDIR",o);try{n.fs.renameSync(n.path,r.path)}catch(c){throw fn(Object.assign(c,o))}jn(this,"rename",e),jn(this,"change",t)}function Kh(e){e=je(e);try{const{fs:t,path:n}=tt(li.call(this,e),this);return t.existsSync(n)}catch(t){if(t.errno==he.ENOENT)return!1;throw t}}function Mr(e,t){e=je(e);const{fs:n,path:r}=tt(li.call(this,e),this);let o;try{o=n.statSync(r)}catch(i){throw fn(Object.assign(i,{path:e}))}if(!St(this,o,en))throw me("EACCES",{syscall:"stat",path:e});return t!=null&&t.bigint?new Gi(o):new To(o)}function Xh(e,t){e=je(e);const{fs:n,path:r}=tt(e,this),o=Dr(n,"statSync",e)(r);if(!St(this,o,en))throw me("EACCES",{syscall:"lstat",path:e});return t!=null&&t.bigint?new Gi(o):new To(o)}function b2(e,t=0){const n={stack:[],error:void 0,hasError:!1};try{const r=Fs(n,ai.call(this,e,{flag:"r+"}),!1);if(t||(t=0),t<0)throw me("EINVAL","truncate",e.toString());r.truncate(t)}catch(r){n.error=r,n.hasError=!0}finally{$s(n)}}function $_(e){e=je(e);const{fs:t,path:n}=tt(e,this);try{if(u2&&!St(this,t.statSync(n),Gt))throw me("EACCES","unlink");t.unlinkSync(n)}catch(r){throw fn(Object.assign(r,{path:e}))}jn(this,"rename",e.toString())}function ai(e,t){var n;e=je(e);const r=ii(t.mode,420),o=Io(t.flag);e=t.preserveSymlinks?e:li.call(this,e);const{fs:i,path:s}=tt(e,this);let a;try{a=i.statSync(s)}catch{}if(!a){if(!(o&ou))throw me("ENOENT","open",e);const c=i.statSync(it(s));if(!St(this,c,Gt))throw me("EACCES","open",e);if(!an(c))throw me("ENOTDIR","open",e);if(!t.allowDirectory&&r&Yt)throw me("EISDIR","open",e);if(!St(this,c,Gt))throw me("EACCES","open",e);const{euid:d,egid:u}=(n=this===null||this===void 0?void 0:this.credentials)!==null&&n!==void 0?n:Ar.credentials,f=i.createFileSync(s,{mode:r,uid:c.mode&cl?c.uid:d,gid:c.mode&ul?c.gid:u});return new gu(this,e,i,s,o,f)}if(!St(this,a,r)||!St(this,a,O_(o)))throw me("EACCES","open",e);if(o&iu)throw me("EEXIST","open",e);const l=new gu(this,e,i,s,o,a);if(!t.allowDirectory&&a.mode&Yt)throw me("EISDIR","open",e);return o&su&&l.truncate(0),l}function wu(e,t,n=Oh){return yu(ai.call(this,e,{flag:t,mode:n}))}function vu(e,t,n){return yu(ai.call(this,e,{flag:t,mode:n,preserveSymlinks:!0}))}function z_(e,t={}){const n={stack:[],error:void 0,hasError:!1};try{const r=Mo(t,null,"r",420);if(Io(r.flag)&yn)throw me("EBADF","read",e.toString());const i=Fs(n,typeof e=="number"?Nn(this,e):ai.call(this,e.toString(),{flag:r.flag,mode:420,preserveSymlinks:!1}),!1),{size:s}=i.stat(),a=ut.Buffer.alloc(s);return i.read(a,0,s,0),r.encoding?a.toString(r.encoding):a}catch(r){n.error=r,n.hasError=!0}finally{$s(n)}}function B_(e,t,n={}){const r={stack:[],error:void 0,hasError:!1};try{const o=Mo(n,"utf8","w+",420),i=Io(o.flag);if(!(i&yn||i&no))throw new Wt(he.EINVAL,"Flag passed to writeFile must allow for writing");if(typeof t!="string"&&!o.encoding)throw new Wt(he.EINVAL,"Encoding not specified");const s=typeof t=="string"?ut.Buffer.from(t,o.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);if(!s)throw new Wt(he.EINVAL,"Data not specified");Fs(r,typeof e=="number"?Nn(this,e):ai.call(this,e.toString(),{flag:i,mode:o.mode,preserveSymlinks:!0}),!1).write(s,0,s.byteLength,0),jn(this,"change",e.toString())}catch(o){r.error=o,r.hasError=!0}finally{$s(r)}}function _2(e,t,n={}){const r={stack:[],error:void 0,hasError:!1};try{const o=Mo(n,"utf8","a+",420),i=Io(o.flag);if(!(i&zi))throw new Wt(he.EINVAL,"Flag passed to appendFile must allow for appending");if(typeof t!="string"&&!o.encoding)throw new Wt(he.EINVAL,"Encoding not specified");const s=typeof t=="string"?ut.Buffer.from(t,o.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);Fs(r,ai.call(this,typeof e=="number"?Nn(this,e).path:e.toString(),{flag:i,mode:o.mode,preserveSymlinks:!0}),!1).write(s,0,s.byteLength)}catch(o){r.error=o,r.hasError=!0}finally{$s(r)}}function S2(e,t){const n=Nn(this,e).stat();return t!=null&&t.bigint?new Gi(n):new To(n)}function Ki(e){Nn(this,e).close(),I_(this,e)}function x2(e,t=0){if(t||(t=0),t<0)throw new Wt(he.EINVAL);Nn(this,e).truncate(t)}function E2(e){Nn(this,e).sync()}function C2(e){Nn(this,e).datasync()}function N2(e,t,n,r,o){let i,s,a,l;if(typeof t=="string"){l=typeof n=="number"?n:null;const u=typeof r=="string"?r:"utf8";s=0,i=ut.Buffer.from(t,u),a=i.byteLength}else i=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),s=n,a=r,l=typeof o=="number"?o:null;const c=Nn(this,e);l??(l=c.position);const d=c.write(i,s,a,l);return jn(this,"change",c.path),d}function R2(e,t,n,r,o){const i=Nn(this,e),s=typeof n=="object"?n.offset:n;return typeof n=="object"&&(r=n.length,o=n.position),o=Number(o),isNaN(o)&&(o=i.position),i.read(t,s,r,o)}function Jh(e,t,n){Nn(this,e).chown(t,n)}function Qh(e,t){const n=ii(t,-1);if(n<0)throw new Wt(he.EINVAL,"Invalid mode.");Nn(this,e).chmod(n)}function Zh(e,t,n){Nn(this,e).utimes(pu(t),pu(n))}function W_(e){e=je(e);const{fs:t,path:n}=tt(li.call(this,e),this),r=Dr(t,"statSync",e)(n);if(!an(r))throw me("ENOTDIR","rmdir",e);if(!St(this,r,Gt))throw me("EACCES","rmdir",e);Dr(t,"rmdirSync",e)(n),jn(this,"rename",e.toString())}function ep(e,t){var n;const{euid:r,egid:o}=(n=this===null||this===void 0?void 0:this.credentials)!==null&&n!==void 0?n:Ar.credentials;t=typeof t=="object"?t:{mode:t};const i=ii(t==null?void 0:t.mode,511);e=li.call(this,e);const{fs:s,path:a}=tt(e,this),l=(u,f,h)=>{if(!St(this,h,Gt))throw me("EACCES","mkdir",it(u));const m=Dr(s,"mkdirSync",u)(f,{mode:i,uid:h.mode&cl?h.uid:r,gid:h.mode&ul?h.gid:o});return jn(this,"rename",u),m};if(!(t!=null&&t.recursive)){l(e,a,Dr(s,"statSync",it(e))(it(a)));return}const c=[];for(let u=a,f=e;!Dr(s,"existsSync",f)(u);u=it(u),f=it(f))c.unshift({resolved:u,original:f});if(!c.length)return;const d=[Dr(s,"statSync",it(c[0].original))(it(c[0].resolved))];for(const[u,f]of c.entries())d.push(l(f.original,f.resolved,d[u]));return c[0].original}function zs(e,t){t=typeof t=="object"?t:{encoding:t},e=je(e);const{fs:n,path:r}=tt(li.call(this,e),this),o=Dr(n,"statSync",e)(r);if(!St(this,o,en))throw me("EACCES","readdir",e);if(!an(o))throw me("ENOTDIR","readdir",e);const i=Dr(n,"readdirSync",e)(r),s=[];for(const a of i){let l;try{l=n.statSync(vt(r,a))}catch{continue}if(t!=null&&t.withFileTypes?s.push(new ml(a,l)):(t==null?void 0:t.encoding)=="buffer"?s.push(ut.Buffer.from(a)):s.push(a),!(!an(l)||!(t!=null&&t.recursive)))for(const c of zs.call(this,vt(e,a),t))c instanceof ml?(c.path=vt(a,c.path),s.push(c)):ut.Buffer.isBuffer(c)?s.push(ut.Buffer.from(vt(a,tu(c)))):s.push(vt(a,c))}return s}function P2(e,t){if(e=je(e),!Mr(it(e)).hasAccess(en,this))throw me("EACCES","link",it(e));if(t=je(t),!Mr(it(t)).hasAccess(Gt,this))throw me("EACCES","link",it(t));const{fs:n,path:r}=tt(e,this),o=tt(t,this);if(n!=o.fs)throw me("EXDEV","link",t);const i=Dr(n,"statSync",e)(r);if(!St(this,i,en))throw me("EACCES","link",r);return Dr(n,"linkSync",e,t)(r,o.path)}function A2(e,t,n="file"){const r={stack:[],error:void 0,hasError:!1};try{if(!["file","dir","junction"].includes(n))throw new TypeError("Invalid symlink type: "+n);t=je(t);const o=Fs(r,ai.call(this,t,{flag:"wx",mode:420}),!1);o.write(ni(je(e,!0))),o.chmod(Po)}catch(o){r.error=o,r.hasError=!0}finally{$s(r)}}function tp(e,t){const n={stack:[],error:void 0,hasError:!1};try{const r=Fs(n,ai.call(this,je(e),{flag:"r",mode:420,preserveSymlinks:!0}),!1);if(!oi(r.inode))throw new Wt(he.EINVAL,"Not a symbolic link: "+e);const o=r.inode.size,i=ut.Buffer.alloc(o);r.read(i,0,o,0);const s=typeof t=="object"?t==null?void 0:t.encoding:t;return s=="buffer"?i:i.toString(s??"utf-8")}catch(r){n.error=r,n.hasError=!0}finally{$s(n)}}function T2(e,t,n){const r=wu.call(this,e,"r+");Jh.call(this,r,t,n),Ki.call(this,r)}function D2(e,t,n){const r=vu.call(this,e,"r+");Jh.call(this,r,t,n),Ki.call(this,r)}function M2(e,t){const n=wu.call(this,e,"r+");Qh.call(this,n,t),Ki.call(this,n)}function I2(e,t){const n=vu.call(this,e,"r+");Qh.call(this,n,t),Ki.call(this,n)}function V_(e,t,n){const r=wu.call(this,e,"r+");Zh.call(this,r,t,n),Ki.call(this,r)}function O2(e,t,n){const r=vu.call(this,e,"r+");Zh.call(this,r,t,n),Ki.call(this,r)}function np(e,t,n){try{const d=tt(t,e),u=d.fs.statSync(d.path);if(!oi(u))return{...d,fullPath:t,stats:u};const f=Ao.call(e,it(t),tp.call(e,t).toString());return np(e,f)}catch{}const{base:r,dir:o}=gr(t),i=o=="/"?"/":li.call(e,o),s=vt(i,r),a=tt(s,e);let l;try{l=a.fs.statSync(a.path)}catch(d){if(d.code==="ENOENT")return{...a,fullPath:t};throw fn(Object.assign(d,{syscall:"stat",path:s}))}if(!oi(l))return{...a,fullPath:s,stats:l};const c=Ao.call(e,i,tp.call(e,s).toString());return np(e,c)}function li(e,t){var n;const r=typeof t=="string"?t:(n=t==null?void 0:t.encoding)!==null&&n!==void 0?n:"utf8";e=je(e);const{fullPath:o}=np(this,e);if(r=="utf8"||r=="utf-8")return o;const i=ut.Buffer.from(o,"utf-8");return r=="buffer"?i:i.toString(r)}function k2(e,t=384){if(!St(this,Mr.call(this,e),t))throw new Wt(he.EACCES)}function U_(e,t){e=je(e);let n;try{n=Xh.bind(this)(e)}catch(r){if(r.code!="ENOENT"||!(t!=null&&t.force))throw r}if(n)switch(n.mode&Rt){case Yt:if(t!=null&&t.recursive)for(const r of zs.call(this,e))U_.call(this,vt(e,r),t);W_.call(this,e);break;case Tr:case Po:case Wi:case Vi:$_.call(this,e);break;case Ui:case Bi:default:throw me("ENOSYS","rm",e)}}function L2(e,t){const n=typeof t=="object"?t==null?void 0:t.encoding:t||"utf8",o="/tmp/"+`${e}${Date.now()}-${Math.random().toString(36).slice(2)}`;return ep.call(this,o),n=="buffer"?ut.Buffer.from(o):o}function H_(e,t,n){if(e=je(e),t=je(t),n&&n&kh&&Kh(t))throw me("EEXIST","copyFile",t);B_.call(this,t,z_(e)),jn(this,"rename",t.toString())}function j2(e,t,n){const r=Nn(this,e);let o=0;for(const i of t)o+=r.read(i,0,i.byteLength,n+o);return o}function F2(e,t,n){const r=Nn(this,e);let o=0;for(const i of t)o+=r.write(new Uint8Array(i.buffer),0,i.byteLength,n+o);return o}function $2(e,t){return e=je(e),new rp(e,this)}function G_(e,t,n){e=je(e),t=je(t);const r=Xh.call(this,e);if(n!=null&&n.errorOnExist&&Kh.call(this,t))throw me("EEXIST","cp",t);switch(r.mode&Rt){case Yt:if(!(n!=null&&n.recursive))throw me("EISDIR","cp",e);ep.call(this,t,{recursive:!0});for(const o of zs.call(this,e,{withFileTypes:!0}))n.filter&&!n.filter(vt(e,o.name),vt(t,o.name))||G_.call(this,vt(e,o.name),vt(t,o.name),n);break;case Tr:case Po:H_.call(this,e,t);break;case Wi:case Vi:case Ui:case Bi:default:throw me("ENOSYS","cp",e)}n!=null&&n.preserveTimestamps&&V_.call(this,t,r.atime,r.mtime)}function z2(e,t){e=je(e);const{fs:n}=tt(e,this);return L_(n,t==null?void 0:t.bigint)}function B2(e,t={}){e=Array.isArray(e)?e:[e];const{cwd:n="/",withFileTypes:r=!1,exclude:o=()=>!1}=t,i=e.map(l=>(l=l.replace(/([.?+^$(){}|[\]/])/g,"\\$1").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*").replace(/\?/g,"."),new RegExp(`^${l}$`))),s=[];function a(l){const c=zs(l,{withFileTypes:r,encoding:"utf8"});for(const d of c){const u=r?d.path:l+"/"+d;o(r?d:u)||(Mr(u).isDirectory()&&i.some(f=>f.source.includes(".*"))&&a(u),i.some(f=>f.test(u.replace(/^\/+/g,"")))&&s.push(r?d.path:u.replace(/^\/+/g,"")))}}return a(n),s}class ml{get name(){return js(this.path)}constructor(t,n){this.path=t,this.stats=n}get parentPath(){return this.path}isFile(){return n2(this.stats)}isDirectory(){return an(this.stats)}isBlockDevice(){return fl(this.stats)}isCharacterDevice(){return hl(this.stats)}isSymbolicLink(){return oi(this.stats)}isFIFO(){return o2(this.stats)}isSocket(){return r2(this.stats)}}class rp{checkClosed(){if(this.closed)throw Ce("EBADF","Can not use closed Dir")}constructor(t,n){this.path=t,this.context=n,this.closed=!1}close(t){if(this.closed=!0,!t)return Promise.resolve();t()}closeSync(){this.closed=!0}async _read(){var t,n;return this.checkClosed(),(t=this._entries)!==null&&t!==void 0||(this._entries=await is.call(this.context,this.path,{withFileTypes:!0})),this._entries.length&&(n=this._entries.shift())!==null&&n!==void 0?n:null}read(t){if(!t)return this._read();this._read().then(n=>t(void 0,n))}readSync(){var t,n;return this.checkClosed(),(t=this._entries)!==null&&t!==void 0||(this._entries=zs.call(this.context,this.path,{withFileTypes:!0})),this._entries.length&&(n=this._entries.shift())!==null&&n!==void 0?n:null}async next(){const t=await this._read();return t?{done:!1,value:t}:(await this.close(),{done:!0,value:void 0})}[Symbol.asyncIterator](){return this}[Symbol.asyncDispose](){return Promise.resolve()}}var Y_={exports:{}},op={exports:{}},Vt={AggregateError:class extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let n="";for(let r=0;r<t.length;r++)n+=` ${t[r].stack}
|
|
19
|
+
`;super(n),this.name="AggregateError",this.errors=t}},ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,n){return e.slice(t,n)},Error,FunctionPrototypeCall(e,t,...n){return e.call(t,...n)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,n){return Object.defineProperty(e,t,n)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,n){return e.then(t,n)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,n){return e.slice(t,n)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,t,n){return e.set(t,n)},Boolean,Uint8Array},q_={exports:{}},K_={format(e,...t){return e.replace(/%([sdifj])/g,function(...[n,r]){const o=t.shift();return r==="f"?o.toFixed(6):r==="j"?JSON.stringify(o):r==="s"&&typeof o=="object"?`${o.constructor!==Object?o.constructor.name:""} {}`.trim():o.toString()})},inspect(e){switch(typeof e){case"string":if(e.includes("'"))if(e.includes('"')){if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}else return`"${e}"`;return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}};const{format:W2,inspect:bu}=K_,{AggregateError:V2}=Vt,U2=globalThis.AggregateError||V2,H2=Symbol("kIsNodeError"),G2=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Y2=/^([A-Z][a-z0-9]*)+$/,q2="__node_internal_",_u={};function Xi(e,t){if(!e)throw new _u.ERR_INTERNAL_ASSERTION(t)}function X_(e){let t="",n=e.length;const r=e[0]==="-"?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function K2(e,t,n){if(typeof t=="function")return Xi(t.length<=n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${t.length}).`),t(...n);const r=(t.match(/%[dfijoOs]/g)||[]).length;return Xi(r===n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${r}).`),n.length===0?t:W2(t,...n)}function vn(e,t,n){n||(n=Error);class r extends n{constructor(...i){super(K2(e,t,i))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(r.prototype,{name:{value:n.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),r.prototype.code=e,r.prototype[H2]=!0,_u[e]=r}function J_(e){const t=q2+e.name;return Object.defineProperty(e,"name",{value:t}),e}function X2(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const n=new U2([t,e],t.message);return n.code=t.code,n}return e||t}let J2=class extends Error{constructor(t="The operation was aborted",n=void 0){if(n!==void 0&&typeof n!="object")throw new _u.ERR_INVALID_ARG_TYPE("options","Object",n);super(t,n),this.code="ABORT_ERR",this.name="AbortError"}};vn("ERR_ASSERTION","%s",Error),vn("ERR_INVALID_ARG_TYPE",(e,t,n)=>{Xi(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let r="The ";e.endsWith(" argument")?r+=`${e} `:r+=`"${e}" ${e.includes(".")?"property":"argument"} `,r+="must be ";const o=[],i=[],s=[];for(const l of t)Xi(typeof l=="string","All expected entries have to be of type string"),G2.includes(l)?o.push(l.toLowerCase()):Y2.test(l)?i.push(l):(Xi(l!=="object",'The value "object" should be written as "Object"'),s.push(l));if(i.length>0){const l=o.indexOf("object");l!==-1&&(o.splice(o,l,1),i.push("Object"))}if(o.length>0){switch(o.length){case 1:r+=`of type ${o[0]}`;break;case 2:r+=`one of type ${o[0]} or ${o[1]}`;break;default:{const l=o.pop();r+=`one of type ${o.join(", ")}, or ${l}`}}(i.length>0||s.length>0)&&(r+=" or ")}if(i.length>0){switch(i.length){case 1:r+=`an instance of ${i[0]}`;break;case 2:r+=`an instance of ${i[0]} or ${i[1]}`;break;default:{const l=i.pop();r+=`an instance of ${i.join(", ")}, or ${l}`}}s.length>0&&(r+=" or ")}switch(s.length){case 0:break;case 1:s[0].toLowerCase()!==s[0]&&(r+="an "),r+=`${s[0]}`;break;case 2:r+=`one of ${s[0]} or ${s[1]}`;break;default:{const l=s.pop();r+=`one of ${s.join(", ")}, or ${l}`}}if(n==null)r+=`. Received ${n}`;else if(typeof n=="function"&&n.name)r+=`. Received function ${n.name}`;else if(typeof n=="object"){var a;if((a=n.constructor)!==null&&a!==void 0&&a.name)r+=`. Received an instance of ${n.constructor.name}`;else{const l=bu(n,{depth:-1});r+=`. Received ${l}`}}else{let l=bu(n,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),r+=`. Received type ${typeof n} (${l})`}return r},TypeError),vn("ERR_INVALID_ARG_VALUE",(e,t,n="is invalid")=>{let r=bu(t);return r.length>128&&(r=r.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${n}. Received ${r}`},TypeError),vn("ERR_INVALID_RETURN_VALUE",(e,t,n)=>{var r;const o=n!=null&&(r=n.constructor)!==null&&r!==void 0&&r.name?`instance of ${n.constructor.name}`:`type ${typeof n}`;return`Expected ${e} to be returned from the "${t}" function but got ${o}.`},TypeError),vn("ERR_MISSING_ARGS",(...e)=>{Xi(e.length>0,"At least one arg needs to be specified");let t;const n=e.length;switch(e=(Array.isArray(e)?e:[e]).map(r=>`"${r}"`).join(" or "),n){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{const r=e.pop();t+=`The ${e.join(", ")}, and ${r} arguments`}break}return`${t} must be specified`},TypeError),vn("ERR_OUT_OF_RANGE",(e,t,n)=>{Xi(t,'Missing "range" argument');let r;if(Number.isInteger(n)&&Math.abs(n)>2**32)r=X_(String(n));else if(typeof n=="bigint"){r=String(n);const o=BigInt(2)**BigInt(32);(n>o||n<-o)&&(r=X_(r)),r+="n"}else r=bu(n);return`The value of "${e}" is out of range. It must be ${t}. Received ${r}`},RangeError),vn("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),vn("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),vn("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),vn("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),vn("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),vn("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),vn("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),vn("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),vn("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),vn("ERR_STREAM_WRITE_AFTER_END","write after end",Error),vn("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);var Fn={AbortError:J2,aggregateTwoErrors:J_(X2),hideStackFrames:J_,codes:_u},gl={exports:{}},Q_;function yl(){if(Q_)return gl.exports;Q_=1;const{AbortController:e,AbortSignal:t}=typeof self<"u"?self:typeof window<"u"?window:void 0;return gl.exports=e,gl.exports.AbortSignal=t,gl.exports.default=e,gl.exports}var ip={exports:{}},Bs=typeof Reflect=="object"?Reflect:null,Z_=Bs&&typeof Bs.apply=="function"?Bs.apply:function(t,n,r){return Function.prototype.apply.call(t,n,r)},Su;Bs&&typeof Bs.ownKeys=="function"?Su=Bs.ownKeys:Object.getOwnPropertySymbols?Su=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Su=function(t){return Object.getOwnPropertyNames(t)};function Q2(e){console&&console.warn&&console.warn(e)}var eS=Number.isNaN||function(t){return t!==t};function Pt(){Pt.init.call(this)}ip.exports=Pt,ip.exports.once=nz,Pt.EventEmitter=Pt,Pt.prototype._events=void 0,Pt.prototype._eventsCount=0,Pt.prototype._maxListeners=void 0;var tS=10;function xu(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(Pt,"defaultMaxListeners",{enumerable:!0,get:function(){return tS},set:function(e){if(typeof e!="number"||e<0||eS(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");tS=e}}),Pt.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Pt.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||eS(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function nS(e){return e._maxListeners===void 0?Pt.defaultMaxListeners:e._maxListeners}Pt.prototype.getMaxListeners=function(){return nS(this)},Pt.prototype.emit=function(t){for(var n=[],r=1;r<arguments.length;r++)n.push(arguments[r]);var o=t==="error",i=this._events;if(i!==void 0)o=o&&i.error===void 0;else if(!o)return!1;if(o){var s;if(n.length>0&&(s=n[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=i[t];if(l===void 0)return!1;if(typeof l=="function")Z_(l,this,n);else for(var c=l.length,d=aS(l,c),r=0;r<c;++r)Z_(d[r],this,n);return!0};function rS(e,t,n,r){var o,i,s;if(xu(n),i=e._events,i===void 0?(i=e._events=Object.create(null),e._eventsCount=0):(i.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),s=i[t]),s===void 0)s=i[t]=n,++e._eventsCount;else if(typeof s=="function"?s=i[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),o=nS(e),o>0&&s.length>o&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=s.length,Q2(a)}return e}Pt.prototype.addListener=function(t,n){return rS(this,t,n,!1)},Pt.prototype.on=Pt.prototype.addListener,Pt.prototype.prependListener=function(t,n){return rS(this,t,n,!0)};function Z2(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function oS(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=Z2.bind(r);return o.listener=n,r.wrapFn=o,o}Pt.prototype.once=function(t,n){return xu(n),this.on(t,oS(this,t,n)),this},Pt.prototype.prependOnceListener=function(t,n){return xu(n),this.prependListener(t,oS(this,t,n)),this},Pt.prototype.removeListener=function(t,n){var r,o,i,s,a;if(xu(n),o=this._events,o===void 0)return this;if(r=o[t],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete o[t],o.removeListener&&this.emit("removeListener",t,r.listener||n));else if(typeof r!="function"){for(i=-1,s=r.length-1;s>=0;s--)if(r[s]===n||r[s].listener===n){a=r[s].listener,i=s;break}if(i<0)return this;i===0?r.shift():ez(r,i),r.length===1&&(o[t]=r[0]),o.removeListener!==void 0&&this.emit("removeListener",t,a||n)}return this},Pt.prototype.off=Pt.prototype.removeListener,Pt.prototype.removeAllListeners=function(t){var n,r,o;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var i=Object.keys(r),s;for(o=0;o<i.length;++o)s=i[o],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(n=r[t],typeof n=="function")this.removeListener(t,n);else if(n!==void 0)for(o=n.length-1;o>=0;o--)this.removeListener(t,n[o]);return this};function iS(e,t,n){var r=e._events;if(r===void 0)return[];var o=r[t];return o===void 0?[]:typeof o=="function"?n?[o.listener||o]:[o]:n?tz(o):aS(o,o.length)}Pt.prototype.listeners=function(t){return iS(this,t,!0)},Pt.prototype.rawListeners=function(t){return iS(this,t,!1)},Pt.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):sS.call(e,t)},Pt.prototype.listenerCount=sS;function sS(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}Pt.prototype.eventNames=function(){return this._eventsCount>0?Su(this._events):[]};function aS(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function ez(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function tz(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function nz(e,t){return new Promise(function(n,r){function o(s){e.removeListener(t,i),r(s)}function i(){typeof e.removeListener=="function"&&e.removeListener("error",o),n([].slice.call(arguments))}lS(e,t,i,{once:!0}),t!=="error"&&rz(e,o,{once:!0})})}function rz(e,t,n){typeof e.on=="function"&&lS(e,"error",t,n)}function lS(e,t,n,r){if(typeof e.on=="function")r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener=="function")e.addEventListener(t,function o(i){r.once&&e.removeEventListener(t,o),n(i)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var Eu=ip.exports;(function(e){const t=ut,{format:n,inspect:r}=K_,{codes:{ERR_INVALID_ARG_TYPE:o}}=Fn,{kResistStopPropagation:i,AggregateError:s,SymbolDispose:a}=Vt,l=globalThis.AbortSignal||yl().AbortSignal,c=globalThis.AbortController||yl().AbortController,d=Object.getPrototypeOf(async function(){}).constructor,u=globalThis.Blob||t.Blob,f=typeof u<"u"?function(y){return y instanceof u}:function(y){return!1},h=(p,y)=>{if(p!==void 0&&(p===null||typeof p!="object"||!("aborted"in p)))throw new o(y,"AbortSignal",p)},m=(p,y)=>{if(typeof p!="function")throw new o(y,"Function",p)};e.exports={AggregateError:s,kEmptyObject:Object.freeze({}),once(p){let y=!1;return function(...v){y||(y=!0,p.apply(this,v))}},createDeferredPromise:function(){let p,y;return{promise:new Promise((b,_)=>{p=b,y=_}),resolve:p,reject:y}},promisify(p){return new Promise((y,v)=>{p((b,..._)=>b?v(b):y(..._))})},debuglog(){return function(){}},format:n,inspect:r,types:{isAsyncFunction(p){return p instanceof d},isArrayBufferView(p){return ArrayBuffer.isView(p)}},isBlob:f,deprecate(p,y){return p},addAbortListener:Eu.addAbortListener||function(y,v){if(y===void 0)throw new o("signal","AbortSignal",y);h(y,"signal"),m(v,"listener");let b;return y.aborted?queueMicrotask(()=>v()):(y.addEventListener("abort",v,{__proto__:null,once:!0,[i]:!0}),b=()=>{y.removeEventListener("abort",v)}),{__proto__:null,[a](){var _;(_=b)===null||_===void 0||_()}}},AbortSignalAny:l.any||function(y){if(y.length===1)return y[0];const v=new c,b=()=>v.abort();return y.forEach(_=>{h(_,"signals"),_.addEventListener("abort",b,{once:!0})}),v.signal.addEventListener("abort",()=>{y.forEach(_=>_.removeEventListener("abort",b))},{once:!0}),v.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(q_);var Vn=q_.exports,sp={};const{ArrayIsArray:ap,ArrayPrototypeIncludes:cS,ArrayPrototypeJoin:uS,ArrayPrototypeMap:oz,NumberIsInteger:lp,NumberIsNaN:iz,NumberMAX_SAFE_INTEGER:sz,NumberMIN_SAFE_INTEGER:az,NumberParseInt:lz,ObjectPrototypeHasOwnProperty:cz,RegExpPrototypeExec:dS,String:uz,StringPrototypeToUpperCase:dz,StringPrototypeTrim:fz}=Vt,{hideStackFrames:vr,codes:{ERR_SOCKET_BAD_PORT:hz,ERR_INVALID_ARG_TYPE:Rn,ERR_INVALID_ARG_VALUE:Ws,ERR_OUT_OF_RANGE:Ji,ERR_UNKNOWN_SIGNAL:fS}}=Fn,{normalizeEncoding:pz}=Vn,{isAsyncFunction:mz,isArrayBufferView:gz}=Vn.types,hS={};function yz(e){return e===(e|0)}function wz(e){return e===e>>>0}const vz=/^[0-7]+$/,bz="must be a 32-bit unsigned integer or an octal string";function _z(e,t,n){if(typeof e>"u"&&(e=n),typeof e=="string"){if(dS(vz,e)===null)throw new Ws(t,e,bz);e=lz(e,8)}return pS(e,t),e}const Sz=vr((e,t,n=az,r=sz)=>{if(typeof e!="number")throw new Rn(t,"number",e);if(!lp(e))throw new Ji(t,"an integer",e);if(e<n||e>r)throw new Ji(t,`>= ${n} && <= ${r}`,e)}),xz=vr((e,t,n=-2147483648,r=2147483647)=>{if(typeof e!="number")throw new Rn(t,"number",e);if(!lp(e))throw new Ji(t,"an integer",e);if(e<n||e>r)throw new Ji(t,`>= ${n} && <= ${r}`,e)}),pS=vr((e,t,n=!1)=>{if(typeof e!="number")throw new Rn(t,"number",e);if(!lp(e))throw new Ji(t,"an integer",e);const r=n?1:0,o=4294967295;if(e<r||e>o)throw new Ji(t,`>= ${r} && <= ${o}`,e)});function cp(e,t){if(typeof e!="string")throw new Rn(t,"string",e)}function Ez(e,t,n=void 0,r){if(typeof e!="number")throw new Rn(t,"number",e);if(n!=null&&e<n||r!=null&&e>r||(n!=null||r!=null)&&iz(e))throw new Ji(t,`${n!=null?`>= ${n}`:""}${n!=null&&r!=null?" && ":""}${r!=null?`<= ${r}`:""}`,e)}const Cz=vr((e,t,n)=>{if(!cS(n,e)){const o="must be one of: "+uS(oz(n,i=>typeof i=="string"?`'${i}'`:uz(i)),", ");throw new Ws(t,e,o)}});function mS(e,t){if(typeof e!="boolean")throw new Rn(t,"boolean",e)}function up(e,t,n){return e==null||!cz(e,t)?n:e[t]}const Nz=vr((e,t,n=null)=>{const r=up(n,"allowArray",!1),o=up(n,"allowFunction",!1);if(!up(n,"nullable",!1)&&e===null||!r&&ap(e)||typeof e!="object"&&(!o||typeof e!="function"))throw new Rn(t,"Object",e)}),Rz=vr((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new Rn(t,"a dictionary",e)}),Cu=vr((e,t,n=0)=>{if(!ap(e))throw new Rn(t,"Array",e);if(e.length<n){const r=`must be longer than ${n}`;throw new Ws(t,e,r)}});function Pz(e,t){Cu(e,t);for(let n=0;n<e.length;n++)cp(e[n],`${t}[${n}]`)}function Az(e,t){Cu(e,t);for(let n=0;n<e.length;n++)mS(e[n],`${t}[${n}]`)}function Tz(e,t){Cu(e,t);for(let n=0;n<e.length;n++){const r=e[n],o=`${t}[${n}]`;if(r==null)throw new Rn(o,"AbortSignal",r);gS(r,o)}}function Dz(e,t="signal"){if(cp(e,t),hS[e]===void 0)throw hS[dz(e)]!==void 0?new fS(e+" (signals must use all capital letters)"):new fS(e)}const Mz=vr((e,t="buffer")=>{if(!gz(e))throw new Rn(t,["Buffer","TypedArray","DataView"],e)});function Iz(e,t){const n=pz(t),r=e.length;if(n==="hex"&&r%2!==0)throw new Ws("encoding",t,`is invalid for data of length ${r}`)}function Oz(e,t="Port",n=!0){if(typeof e!="number"&&typeof e!="string"||typeof e=="string"&&fz(e).length===0||+e!==+e>>>0||e>65535||e===0&&!n)throw new hz(t,e,n);return e|0}const gS=vr((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new Rn(t,"AbortSignal",e)}),kz=vr((e,t)=>{if(typeof e!="function")throw new Rn(t,"Function",e)}),Lz=vr((e,t)=>{if(typeof e!="function"||mz(e))throw new Rn(t,"Function",e)}),jz=vr((e,t)=>{if(e!==void 0)throw new Rn(t,"undefined",e)});function Fz(e,t,n){if(!cS(n,e))throw new Rn(t,`('${uS(n,"|")}')`,e)}const $z=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function yS(e,t){if(typeof e>"u"||!dS($z,e))throw new Ws(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function zz(e){if(typeof e=="string")return yS(e,"hints"),e;if(ap(e)){const t=e.length;let n="";if(t===0)return n;for(let r=0;r<t;r++){const o=e[r];yS(o,"hints"),n+=o,r!==t-1&&(n+=", ")}return n}throw new Ws("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}var wl={isInt32:yz,isUint32:wz,parseFileMode:_z,validateArray:Cu,validateStringArray:Pz,validateBooleanArray:Az,validateAbortSignalArray:Tz,validateBoolean:mS,validateBuffer:Mz,validateDictionary:Rz,validateEncoding:Iz,validateFunction:kz,validateInt32:xz,validateInteger:Sz,validateNumber:Ez,validateObject:Nz,validateOneOf:Cz,validatePlainFunction:Lz,validatePort:Oz,validateSignalName:Dz,validateString:cp,validateUint32:pS,validateUndefined:jz,validateUnion:Fz,validateAbortSignal:gS,validateLinkHeaderValue:zz},dp={exports:{}},wS={exports:{}},tn=wS.exports={},ro,oo;function fp(){throw new Error("setTimeout has not been defined")}function hp(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?ro=setTimeout:ro=fp}catch{ro=fp}try{typeof clearTimeout=="function"?oo=clearTimeout:oo=hp}catch{oo=hp}})();function vS(e){if(ro===setTimeout)return setTimeout(e,0);if((ro===fp||!ro)&&setTimeout)return ro=setTimeout,setTimeout(e,0);try{return ro(e,0)}catch{try{return ro.call(null,e,0)}catch{return ro.call(this,e,0)}}}function Bz(e){if(oo===clearTimeout)return clearTimeout(e);if((oo===hp||!oo)&&clearTimeout)return oo=clearTimeout,clearTimeout(e);try{return oo(e)}catch{try{return oo.call(null,e)}catch{return oo.call(this,e)}}}var Oo=[],Vs=!1,Qi,Nu=-1;function Wz(){!Vs||!Qi||(Vs=!1,Qi.length?Oo=Qi.concat(Oo):Nu=-1,Oo.length&&bS())}function bS(){if(!Vs){var e=vS(Wz);Vs=!0;for(var t=Oo.length;t;){for(Qi=Oo,Oo=[];++Nu<t;)Qi&&Qi[Nu].run();Nu=-1,t=Oo.length}Qi=null,Vs=!1,Bz(e)}}tn.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Oo.push(new _S(e,t)),Oo.length===1&&!Vs&&vS(bS)};function _S(e,t){this.fun=e,this.array=t}_S.prototype.run=function(){this.fun.apply(null,this.array)},tn.title="browser",tn.browser=!0,tn.env={},tn.argv=[],tn.version="",tn.versions={};function ko(){}tn.on=ko,tn.addListener=ko,tn.once=ko,tn.off=ko,tn.removeListener=ko,tn.removeAllListeners=ko,tn.emit=ko,tn.prependListener=ko,tn.prependOnceListener=ko,tn.listeners=function(e){return[]},tn.binding=function(e){throw new Error("process.binding is not supported")},tn.cwd=function(){return"/"},tn.chdir=function(e){throw new Error("process.chdir is not supported")},tn.umask=function(){return 0};var Zi=wS.exports;const{SymbolAsyncIterator:SS,SymbolIterator:xS,SymbolFor:es}=Vt,ES=es("nodejs.stream.destroyed"),CS=es("nodejs.stream.errored"),pp=es("nodejs.stream.readable"),mp=es("nodejs.stream.writable"),NS=es("nodejs.stream.disturbed"),Vz=es("nodejs.webstream.isClosedPromise"),Uz=es("nodejs.webstream.controllerErrorFunction");function Ru(e,t=!1){var n;return!!(e&&typeof e.pipe=="function"&&typeof e.on=="function"&&(!t||typeof e.pause=="function"&&typeof e.resume=="function")&&(!e._writableState||((n=e._readableState)===null||n===void 0?void 0:n.readable)!==!1)&&(!e._writableState||e._readableState))}function Pu(e){var t;return!!(e&&typeof e.write=="function"&&typeof e.on=="function"&&(!e._readableState||((t=e._writableState)===null||t===void 0?void 0:t.writable)!==!1))}function Hz(e){return!!(e&&typeof e.pipe=="function"&&e._readableState&&typeof e.on=="function"&&typeof e.write=="function")}function io(e){return e&&(e._readableState||e._writableState||typeof e.write=="function"&&typeof e.on=="function"||typeof e.pipe=="function"&&typeof e.on=="function")}function RS(e){return!!(e&&!io(e)&&typeof e.pipeThrough=="function"&&typeof e.getReader=="function"&&typeof e.cancel=="function")}function PS(e){return!!(e&&!io(e)&&typeof e.getWriter=="function"&&typeof e.abort=="function")}function AS(e){return!!(e&&!io(e)&&typeof e.readable=="object"&&typeof e.writable=="object")}function Gz(e){return RS(e)||PS(e)||AS(e)}function Yz(e,t){return e==null?!1:t===!0?typeof e[SS]=="function":t===!1?typeof e[xS]=="function":typeof e[SS]=="function"||typeof e[xS]=="function"}function Au(e){if(!io(e))return null;const t=e._writableState,n=e._readableState,r=t||n;return!!(e.destroyed||e[ES]||r!=null&&r.destroyed)}function TS(e){if(!Pu(e))return null;if(e.writableEnded===!0)return!0;const t=e._writableState;return t!=null&&t.errored?!1:typeof(t==null?void 0:t.ended)!="boolean"?null:t.ended}function qz(e,t){if(!Pu(e))return null;if(e.writableFinished===!0)return!0;const n=e._writableState;return n!=null&&n.errored?!1:typeof(n==null?void 0:n.finished)!="boolean"?null:!!(n.finished||t===!1&&n.ended===!0&&n.length===0)}function Kz(e){if(!Ru(e))return null;if(e.readableEnded===!0)return!0;const t=e._readableState;return!t||t.errored?!1:typeof(t==null?void 0:t.ended)!="boolean"?null:t.ended}function DS(e,t){if(!Ru(e))return null;const n=e._readableState;return n!=null&&n.errored?!1:typeof(n==null?void 0:n.endEmitted)!="boolean"?null:!!(n.endEmitted||t===!1&&n.ended===!0&&n.length===0)}function MS(e){return e&&e[pp]!=null?e[pp]:typeof(e==null?void 0:e.readable)!="boolean"?null:Au(e)?!1:Ru(e)&&e.readable&&!DS(e)}function IS(e){return e&&e[mp]!=null?e[mp]:typeof(e==null?void 0:e.writable)!="boolean"?null:Au(e)?!1:Pu(e)&&e.writable&&!TS(e)}function Xz(e,t){return io(e)?Au(e)?!0:!((t==null?void 0:t.readable)!==!1&&MS(e)||(t==null?void 0:t.writable)!==!1&&IS(e)):null}function Jz(e){var t,n;return io(e)?e.writableErrored?e.writableErrored:(t=(n=e._writableState)===null||n===void 0?void 0:n.errored)!==null&&t!==void 0?t:null:null}function Qz(e){var t,n;return io(e)?e.readableErrored?e.readableErrored:(t=(n=e._readableState)===null||n===void 0?void 0:n.errored)!==null&&t!==void 0?t:null:null}function Zz(e){if(!io(e))return null;if(typeof e.closed=="boolean")return e.closed;const t=e._writableState,n=e._readableState;return typeof(t==null?void 0:t.closed)=="boolean"||typeof(n==null?void 0:n.closed)=="boolean"?(t==null?void 0:t.closed)||(n==null?void 0:n.closed):typeof e._closed=="boolean"&&OS(e)?e._closed:null}function OS(e){return typeof e._closed=="boolean"&&typeof e._defaultKeepAlive=="boolean"&&typeof e._removedConnection=="boolean"&&typeof e._removedContLen=="boolean"}function kS(e){return typeof e._sent100=="boolean"&&OS(e)}function eB(e){var t;return typeof e._consuming=="boolean"&&typeof e._dumped=="boolean"&&((t=e.req)===null||t===void 0?void 0:t.upgradeOrConnect)===void 0}function tB(e){if(!io(e))return null;const t=e._writableState,n=e._readableState,r=t||n;return!r&&kS(e)||!!(r&&r.autoDestroy&&r.emitClose&&r.closed===!1)}function nB(e){var t;return!!(e&&((t=e[NS])!==null&&t!==void 0?t:e.readableDidRead||e.readableAborted))}function rB(e){var t,n,r,o,i,s,a,l,c,d;return!!(e&&((t=(n=(r=(o=(i=(s=e[CS])!==null&&s!==void 0?s:e.readableErrored)!==null&&i!==void 0?i:e.writableErrored)!==null&&o!==void 0?o:(a=e._readableState)===null||a===void 0?void 0:a.errorEmitted)!==null&&r!==void 0?r:(l=e._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&n!==void 0?n:(c=e._readableState)===null||c===void 0?void 0:c.errored)!==null&&t!==void 0?t:!((d=e._writableState)===null||d===void 0)&&d.errored))}var Lo={isDestroyed:Au,kIsDestroyed:ES,isDisturbed:nB,kIsDisturbed:NS,isErrored:rB,kIsErrored:CS,isReadable:MS,kIsReadable:pp,kIsClosedPromise:Vz,kControllerErrorFunction:Uz,kIsWritable:mp,isClosed:Zz,isDuplexNodeStream:Hz,isFinished:Xz,isIterable:Yz,isReadableNodeStream:Ru,isReadableStream:RS,isReadableEnded:Kz,isReadableFinished:DS,isReadableErrored:Qz,isNodeStream:io,isWebStream:Gz,isWritable:IS,isWritableNodeStream:Pu,isWritableStream:PS,isWritableEnded:TS,isWritableFinished:qz,isWritableErrored:Jz,isServerRequest:eB,isServerResponse:kS,willEmitClose:tB,isTransformStream:AS};const ci=Zi,{AbortError:LS,codes:oB}=Fn,{ERR_INVALID_ARG_TYPE:iB,ERR_STREAM_PREMATURE_CLOSE:jS}=oB,{kEmptyObject:gp,once:yp}=Vn,{validateAbortSignal:sB,validateFunction:aB,validateObject:lB,validateBoolean:cB}=wl,{Promise:uB,PromisePrototypeThen:dB,SymbolDispose:FS}=Vt,{isClosed:fB,isReadable:$S,isReadableNodeStream:wp,isReadableStream:hB,isReadableFinished:zS,isReadableErrored:BS,isWritable:WS,isWritableNodeStream:VS,isWritableStream:pB,isWritableFinished:US,isWritableErrored:HS,isNodeStream:mB,willEmitClose:gB,kIsClosedPromise:yB}=Lo;let Us;function wB(e){return e.setHeader&&typeof e.abort=="function"}const vp=()=>{};function GS(e,t,n){var r,o;if(arguments.length===2?(n=t,t=gp):t==null?t=gp:lB(t,"options"),aB(n,"callback"),sB(t.signal,"options.signal"),n=yp(n),hB(e)||pB(e))return vB(e,t,n);if(!mB(e))throw new iB("stream",["ReadableStream","WritableStream","Stream"],e);const i=(r=t.readable)!==null&&r!==void 0?r:wp(e),s=(o=t.writable)!==null&&o!==void 0?o:VS(e),a=e._writableState,l=e._readableState,c=()=>{e.writable||f()};let d=gB(e)&&wp(e)===i&&VS(e)===s,u=US(e,!1);const f=()=>{u=!0,e.destroyed&&(d=!1),!(d&&(!e.readable||i))&&(!i||h)&&n.call(e)};let h=zS(e,!1);const m=()=>{h=!0,e.destroyed&&(d=!1),!(d&&(!e.writable||s))&&(!s||u)&&n.call(e)},p=N=>{n.call(e,N)};let y=fB(e);const v=()=>{y=!0;const N=HS(e)||BS(e);if(N&&typeof N!="boolean")return n.call(e,N);if(i&&!h&&wp(e,!0)&&!zS(e,!1))return n.call(e,new jS);if(s&&!u&&!US(e,!1))return n.call(e,new jS);n.call(e)},b=()=>{y=!0;const N=HS(e)||BS(e);if(N&&typeof N!="boolean")return n.call(e,N);n.call(e)},_=()=>{e.req.on("finish",f)};wB(e)?(e.on("complete",f),d||e.on("abort",v),e.req?_():e.on("request",_)):s&&!a&&(e.on("end",c),e.on("close",c)),!d&&typeof e.aborted=="boolean"&&e.on("aborted",v),e.on("end",m),e.on("finish",f),t.error!==!1&&e.on("error",p),e.on("close",v),y?ci.nextTick(v):a!=null&&a.errorEmitted||l!=null&&l.errorEmitted?d||ci.nextTick(b):(!i&&(!d||$S(e))&&(u||WS(e)===!1)||!s&&(!d||WS(e))&&(h||$S(e)===!1)||l&&e.req&&e.aborted)&&ci.nextTick(b);const C=()=>{n=vp,e.removeListener("aborted",v),e.removeListener("complete",f),e.removeListener("abort",v),e.removeListener("request",_),e.req&&e.req.removeListener("finish",f),e.removeListener("end",c),e.removeListener("close",c),e.removeListener("finish",f),e.removeListener("end",m),e.removeListener("error",p),e.removeListener("close",v)};if(t.signal&&!y){const N=()=>{const A=n;C(),A.call(e,new LS(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)ci.nextTick(N);else{Us=Us||Vn.addAbortListener;const A=Us(t.signal,N),R=n;n=yp((...D)=>{A[FS](),R.apply(e,D)})}}return C}function vB(e,t,n){let r=!1,o=vp;if(t.signal)if(o=()=>{r=!0,n.call(e,new LS(void 0,{cause:t.signal.reason}))},t.signal.aborted)ci.nextTick(o);else{Us=Us||Vn.addAbortListener;const s=Us(t.signal,o),a=n;n=yp((...l)=>{s[FS](),a.apply(e,l)})}const i=(...s)=>{r||ci.nextTick(()=>n.apply(e,s))};return dB(e[yB].promise,i,i),vp}function bB(e,t){var n;let r=!1;return t===null&&(t=gp),(n=t)!==null&&n!==void 0&&n.cleanup&&(cB(t.cleanup,"cleanup"),r=t.cleanup),new uB((o,i)=>{const s=GS(e,t,a=>{r&&s(),a?i(a):o()})})}dp.exports=GS,dp.exports.finished=bB;var ui=dp.exports;const so=Zi,{aggregateTwoErrors:_B,codes:{ERR_MULTIPLE_CALLBACK:SB},AbortError:xB}=Fn,{Symbol:YS}=Vt,{kIsDestroyed:EB,isDestroyed:CB,isFinished:NB,isServerRequest:RB}=Lo,qS=YS("kDestroy"),bp=YS("kConstruct");function KS(e,t,n){e&&(e.stack,t&&!t.errored&&(t.errored=e),n&&!n.errored&&(n.errored=e))}function PB(e,t){const n=this._readableState,r=this._writableState,o=r||n;return r!=null&&r.destroyed||n!=null&&n.destroyed?(typeof t=="function"&&t(),this):(KS(e,r,n),r&&(r.destroyed=!0),n&&(n.destroyed=!0),o.constructed?XS(this,e,t):this.once(qS,function(i){XS(this,_B(i,e),t)}),this)}function XS(e,t,n){let r=!1;function o(i){if(r)return;r=!0;const s=e._readableState,a=e._writableState;KS(i,a,s),a&&(a.closed=!0),s&&(s.closed=!0),typeof n=="function"&&n(i),i?so.nextTick(AB,e,i):so.nextTick(JS,e)}try{e._destroy(t||null,o)}catch(i){o(i)}}function AB(e,t){_p(e,t),JS(e)}function JS(e){const t=e._readableState,n=e._writableState;n&&(n.closeEmitted=!0),t&&(t.closeEmitted=!0),(n!=null&&n.emitClose||t!=null&&t.emitClose)&&e.emit("close")}function _p(e,t){const n=e._readableState,r=e._writableState;r!=null&&r.errorEmitted||n!=null&&n.errorEmitted||(r&&(r.errorEmitted=!0),n&&(n.errorEmitted=!0),e.emit("error",t))}function TB(){const e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=e.readable===!1,e.endEmitted=e.readable===!1),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=t.writable===!1,t.ending=t.writable===!1,t.finished=t.writable===!1)}function Sp(e,t,n){const r=e._readableState,o=e._writableState;if(o!=null&&o.destroyed||r!=null&&r.destroyed)return this;r!=null&&r.autoDestroy||o!=null&&o.autoDestroy?e.destroy(t):t&&(t.stack,o&&!o.errored&&(o.errored=t),r&&!r.errored&&(r.errored=t),n?so.nextTick(_p,e,t):_p(e,t))}function DB(e,t){if(typeof e._construct!="function")return;const n=e._readableState,r=e._writableState;n&&(n.constructed=!1),r&&(r.constructed=!1),e.once(bp,t),!(e.listenerCount(bp)>1)&&so.nextTick(MB,e)}function MB(e){let t=!1;function n(r){if(t){Sp(e,r??new SB);return}t=!0;const o=e._readableState,i=e._writableState,s=i||o;o&&(o.constructed=!0),i&&(i.constructed=!0),s.destroyed?e.emit(qS,r):r?Sp(e,r,!0):so.nextTick(IB,e)}try{e._construct(r=>{so.nextTick(n,r)})}catch(r){so.nextTick(n,r)}}function IB(e){e.emit(bp)}function QS(e){return(e==null?void 0:e.setHeader)&&typeof e.abort=="function"}function ZS(e){e.emit("close")}function OB(e,t){e.emit("error",t),so.nextTick(ZS,e)}function kB(e,t){!e||CB(e)||(!t&&!NB(e)&&(t=new xB),RB(e)?(e.socket=null,e.destroy(t)):QS(e)?e.abort():QS(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?so.nextTick(OB,e,t):so.nextTick(ZS,e),e.destroyed||(e[EB]=!0))}var Hs={construct:DB,destroyer:kB,destroy:PB,undestroy:TB,errorOrDestroy:Sp};const{ArrayIsArray:LB,ObjectSetPrototypeOf:ex}=Vt,{EventEmitter:Tu}=Eu;function Du(e){Tu.call(this,e)}ex(Du.prototype,Tu.prototype),ex(Du,Tu),Du.prototype.pipe=function(e,t){const n=this;function r(d){e.writable&&e.write(d)===!1&&n.pause&&n.pause()}n.on("data",r);function o(){n.readable&&n.resume&&n.resume()}e.on("drain",o),!e._isStdio&&(!t||t.end!==!1)&&(n.on("end",s),n.on("close",a));let i=!1;function s(){i||(i=!0,e.end())}function a(){i||(i=!0,typeof e.destroy=="function"&&e.destroy())}function l(d){c(),Tu.listenerCount(this,"error")===0&&this.emit("error",d)}xp(n,"error",l),xp(e,"error",l);function c(){n.removeListener("data",r),e.removeListener("drain",o),n.removeListener("end",s),n.removeListener("close",a),n.removeListener("error",l),e.removeListener("error",l),n.removeListener("end",c),n.removeListener("close",c),e.removeListener("close",c)}return n.on("end",c),n.on("close",c),e.on("close",c),e.emit("pipe",n),e};function xp(e,t,n){if(typeof e.prependListener=="function")return e.prependListener(t,n);!e._events||!e._events[t]?e.on(t,n):LB(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]}var Ep={Stream:Du,prependListener:xp},tx={exports:{}};(function(e){const{SymbolDispose:t}=Vt,{AbortError:n,codes:r}=Fn,{isNodeStream:o,isWebStream:i,kControllerErrorFunction:s}=Lo,a=ui,{ERR_INVALID_ARG_TYPE:l}=r;let c;const d=(u,f)=>{if(typeof u!="object"||!("aborted"in u))throw new l(f,"AbortSignal",u)};e.exports.addAbortSignal=function(f,h){if(d(f,"signal"),!o(h)&&!i(h))throw new l("stream",["ReadableStream","WritableStream","Stream"],h);return e.exports.addAbortSignalNoValidate(f,h)},e.exports.addAbortSignalNoValidate=function(u,f){if(typeof u!="object"||!("aborted"in u))return f;const h=o(f)?()=>{f.destroy(new n(void 0,{cause:u.reason}))}:()=>{f[s](new n(void 0,{cause:u.reason}))};if(u.aborted)h();else{c=c||Vn.addAbortListener;const m=c(u,h);a(f,m[t])}return f}})(tx);var Mu=tx.exports;const{StringPrototypeSlice:nx,SymbolIterator:jB,TypedArrayPrototypeSet:Iu,Uint8Array:FB}=Vt,{Buffer:Cp}=ut,{inspect:$B}=Vn;var zB=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){const n={data:t,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}unshift(t){const n={data:t,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}shift(){if(this.length===0)return;const t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let n=this.head,r=""+n.data;for(;(n=n.next)!==null;)r+=t+n.data;return r}concat(t){if(this.length===0)return Cp.alloc(0);const n=Cp.allocUnsafe(t>>>0);let r=this.head,o=0;for(;r;)Iu(n,r.data,o),o+=r.data.length,r=r.next;return n}consume(t,n){const r=this.head.data;if(t<r.length){const o=r.slice(0,t);return this.head.data=r.slice(t),o}return t===r.length?this.shift():n?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[jB](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let n="",r=this.head,o=0;do{const i=r.data;if(t>i.length)n+=i,t-=i.length;else{t===i.length?(n+=i,++o,r.next?this.head=r.next:this.head=this.tail=null):(n+=nx(i,0,t),this.head=r,r.data=nx(i,t));break}++o}while((r=r.next)!==null);return this.length-=o,n}_getBuffer(t){const n=Cp.allocUnsafe(t),r=t;let o=this.head,i=0;do{const s=o.data;if(t>s.length)Iu(n,s,r-t),t-=s.length;else{t===s.length?(Iu(n,s,r-t),++i,o.next?this.head=o.next:this.head=this.tail=null):(Iu(n,new FB(s.buffer,s.byteOffset,t),r-t),this.head=o,o.data=s.slice(t));break}++i}while((o=o.next)!==null);return this.length-=i,n}[Symbol.for("nodejs.util.inspect.custom")](t,n){return $B(this,{...n,depth:0,customInspect:!1})}};const{MathFloor:BB,NumberIsInteger:WB}=Vt,{validateInteger:VB}=wl,{ERR_INVALID_ARG_VALUE:UB}=Fn.codes;let rx=16*1024,ox=16;function HB(e,t,n){return e.highWaterMark!=null?e.highWaterMark:t?e[n]:null}function ix(e){return e?ox:rx}function GB(e,t){VB(t,"value",0),e?ox=t:rx=t}function YB(e,t,n,r){const o=HB(t,r,n);if(o!=null){if(!WB(o)||o<0){const i=r?`options.${n}`:"options.highWaterMark";throw new UB(i,o)}return BB(o)}return ix(e.objectMode)}var Ou={getHighWaterMark:YB,getDefaultHighWaterMark:ix,setDefaultHighWaterMark:GB},sx={},Np={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var n=ut,r=n.Buffer;function o(s,a){for(var l in s)a[l]=s[l]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=i);function i(s,a,l){return r(s,a,l)}i.prototype=Object.create(r.prototype),o(r,i),i.from=function(s,a,l){if(typeof s=="number")throw new TypeError("Argument must not be a number");return r(s,a,l)},i.alloc=function(s,a,l){if(typeof s!="number")throw new TypeError("Argument must be a number");var c=r(s);return a!==void 0?typeof l=="string"?c.fill(a,l):c.fill(a):c.fill(0),c},i.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r(s)},i.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(s)}})(Np,Np.exports);var qB=Np.exports,Rp=qB.Buffer,ax=Rp.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function KB(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function XB(e){var t=KB(e);if(typeof t!="string"&&(Rp.isEncoding===ax||!ax(e)))throw new Error("Unknown encoding: "+e);return t||e}sx.StringDecoder=vl;function vl(e){this.encoding=XB(e);var t;switch(this.encoding){case"utf16le":this.text=n4,this.end=r4,t=4;break;case"utf8":this.fillLast=ZB,t=4;break;case"base64":this.text=o4,this.end=i4,t=3;break;default:this.write=s4,this.end=a4;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Rp.allocUnsafe(t)}vl.prototype.write=function(e){if(e.length===0)return"";var t,n;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},vl.prototype.end=t4,vl.prototype.text=e4,vl.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function Pp(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function JB(e,t,n){var r=t.length-1;if(r<n)return 0;var o=Pp(t[r]);return o>=0?(o>0&&(e.lastNeed=o-1),o):--r<n||o===-2?0:(o=Pp(t[r]),o>=0?(o>0&&(e.lastNeed=o-2),o):--r<n||o===-2?0:(o=Pp(t[r]),o>=0?(o>0&&(o===2?o=0:e.lastNeed=o-3),o):0))}function QB(e,t,n){if((t[0]&192)!==128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"�"}}function ZB(e){var t=this.lastTotal-this.lastNeed,n=QB(this,e);if(n!==void 0)return n;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function e4(e,t){var n=JB(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)}function t4(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function n4(e,t){if((e.length-t)%2===0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function r4(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function o4(e,t){var n=(e.length-t)%3;return n===0?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,n===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function i4(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function s4(e){return e.toString(this.encoding)}function a4(e){return e&&e.length?this.write(e):""}const lx=Zi,{PromisePrototypeThen:l4,SymbolAsyncIterator:cx,SymbolIterator:ux}=Vt,{Buffer:c4}=ut,{ERR_INVALID_ARG_TYPE:u4,ERR_STREAM_NULL_VALUES:d4}=Fn.codes;function f4(e,t,n){let r;if(typeof t=="string"||t instanceof c4)return new e({objectMode:!0,...n,read(){this.push(t),this.push(null)}});let o;if(t&&t[cx])o=!0,r=t[cx]();else if(t&&t[ux])o=!1,r=t[ux]();else throw new u4("iterable",["Iterable"],t);const i=new e({objectMode:!0,highWaterMark:1,...n});let s=!1;i._read=function(){s||(s=!0,l())},i._destroy=function(c,d){l4(a(c),()=>lx.nextTick(d,c),u=>lx.nextTick(d,u||c))};async function a(c){const d=c!=null,u=typeof r.throw=="function";if(d&&u){const{value:f,done:h}=await r.throw(c);if(await f,h)return}if(typeof r.return=="function"){const{value:f}=await r.return();await f}}async function l(){for(;;){try{const{value:c,done:d}=o?await r.next():r.next();if(d)i.push(null);else{const u=c&&typeof c.then=="function"?await c:c;if(u===null)throw s=!1,new d4;if(i.push(u))continue;s=!1}}catch(c){i.destroy(c)}break}}return i}var dx=f4,Ap,fx;function ku(){if(fx)return Ap;fx=1;const e=Zi,{ArrayPrototypeIndexOf:t,NumberIsInteger:n,NumberIsNaN:r,NumberParseInt:o,ObjectDefineProperties:i,ObjectKeys:s,ObjectSetPrototypeOf:a,Promise:l,SafeSet:c,SymbolAsyncDispose:d,SymbolAsyncIterator:u,Symbol:f}=Vt;Ap=ue,ue.ReadableState=Se;const{EventEmitter:h}=Eu,{Stream:m,prependListener:p}=Ep,{Buffer:y}=ut,{addAbortSignal:v}=Mu,b=ui;let _=Vn.debuglog("stream",O=>{_=O});const C=zB,N=Hs,{getHighWaterMark:A,getDefaultHighWaterMark:R}=Ou,{aggregateTwoErrors:D,codes:{ERR_INVALID_ARG_TYPE:k,ERR_METHOD_NOT_IMPLEMENTED:F,ERR_OUT_OF_RANGE:W,ERR_STREAM_PUSH_AFTER_EOF:B,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:T},AbortError:Q}=Fn,{validateObject:K}=wl,Y=f("kPaused"),{StringDecoder:ee}=sx,G=dx;a(ue.prototype,m.prototype),a(ue,m);const re=()=>{},{errorOrDestroy:X}=N,J=1,se=2,L=4,ne=8,fe=16,H=32,ae=64,V=128,de=256,ge=512,pe=1024,oe=2048,$=4096,j=8192,le=16384,ve=32768,we=65536,M=1<<17,q=1<<18;function te(O){return{enumerable:!1,get(){return(this.state&O)!==0},set(z){z?this.state|=O:this.state&=~O}}}i(Se.prototype,{objectMode:te(J),ended:te(se),endEmitted:te(L),reading:te(ne),constructed:te(fe),sync:te(H),needReadable:te(ae),emittedReadable:te(V),readableListening:te(de),resumeScheduled:te(ge),errorEmitted:te(pe),emitClose:te(oe),autoDestroy:te($),destroyed:te(j),closed:te(le),closeEmitted:te(ve),multiAwaitDrain:te(we),readingMore:te(M),dataEmitted:te(q)});function Se(O,z,Ee){typeof Ee!="boolean"&&(Ee=z instanceof jo()),this.state=oe|$|fe|H,O&&O.objectMode&&(this.state|=J),Ee&&O&&O.readableObjectMode&&(this.state|=J),this.highWaterMark=O?A(this,O,"readableHighWaterMark",Ee):R(!1),this.buffer=new C,this.length=0,this.pipes=[],this.flowing=null,this[Y]=null,O&&O.emitClose===!1&&(this.state&=-2049),O&&O.autoDestroy===!1&&(this.state&=-4097),this.errored=null,this.defaultEncoding=O&&O.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,O&&O.encoding&&(this.decoder=new ee(O.encoding),this.encoding=O.encoding)}function ue(O){if(!(this instanceof ue))return new ue(O);const z=this instanceof jo();this._readableState=new Se(O,this,z),O&&(typeof O.read=="function"&&(this._read=O.read),typeof O.destroy=="function"&&(this._destroy=O.destroy),typeof O.construct=="function"&&(this._construct=O.construct),O.signal&&!z&&v(O.signal,this)),m.call(this,O),N.construct(this,()=>{this._readableState.needReadable&&U(this,this._readableState)})}ue.prototype.destroy=N.destroy,ue.prototype._undestroy=N.undestroy,ue.prototype._destroy=function(O,z){z(O)},ue.prototype[h.captureRejectionSymbol]=function(O){this.destroy(O)},ue.prototype[d]=function(){let O;return this.destroyed||(O=this.readableEnded?null:new Q,this.destroy(O)),new l((z,Ee)=>b(this,Ne=>Ne&&Ne!==O?Ee(Ne):z(null)))},ue.prototype.push=function(O,z){return ye(this,O,z,!1)},ue.prototype.unshift=function(O,z){return ye(this,O,z,!0)};function ye(O,z,Ee,Ne){_("readableAddChunk",z);const Te=O._readableState;let pt;if(Te.state&J||(typeof z=="string"?(Ee=Ee||Te.defaultEncoding,Te.encoding!==Ee&&(Ne&&Te.encoding?z=y.from(z,Ee).toString(Te.encoding):(z=y.from(z,Ee),Ee=""))):z instanceof y?Ee="":m._isUint8Array(z)?(z=m._uint8ArrayToBuffer(z),Ee=""):z!=null&&(pt=new k("chunk",["string","Buffer","Uint8Array"],z))),pt)X(O,pt);else if(z===null)Te.state&=-9,S(O,Te);else if(Te.state&J||z&&z.length>0)if(Ne)if(Te.state&L)X(O,new T);else{if(Te.destroyed||Te.errored)return!1;xe(O,Te,z,!0)}else if(Te.ended)X(O,new B);else{if(Te.destroyed||Te.errored)return!1;Te.state&=-9,Te.decoder&&!Ee?(z=Te.decoder.write(z),Te.objectMode||z.length!==0?xe(O,Te,z,!1):U(O,Te)):xe(O,Te,z,!1)}else Ne||(Te.state&=-9,U(O,Te));return!Te.ended&&(Te.length<Te.highWaterMark||Te.length===0)}function xe(O,z,Ee,Ne){z.flowing&&z.length===0&&!z.sync&&O.listenerCount("data")>0?(z.state&we?z.awaitDrainWriters.clear():z.awaitDrainWriters=null,z.dataEmitted=!0,O.emit("data",Ee)):(z.length+=z.objectMode?1:Ee.length,Ne?z.buffer.unshift(Ee):z.buffer.push(Ee),z.state&ae&&E(O)),U(O,z)}ue.prototype.isPaused=function(){const O=this._readableState;return O[Y]===!0||O.flowing===!1},ue.prototype.setEncoding=function(O){const z=new ee(O);this._readableState.decoder=z,this._readableState.encoding=this._readableState.decoder.encoding;const Ee=this._readableState.buffer;let Ne="";for(const Te of Ee)Ne+=z.write(Te);return Ee.clear(),Ne!==""&&Ee.push(Ne),this._readableState.length=Ne.length,this};const Ae=1073741824;function Ze(O){if(O>Ae)throw new W("size","<= 1GiB",O);return O--,O|=O>>>1,O|=O>>>2,O|=O>>>4,O|=O>>>8,O|=O>>>16,O++,O}function P(O,z){return O<=0||z.length===0&&z.ended?0:z.state&J?1:r(O)?z.flowing&&z.length?z.buffer.first().length:z.length:O<=z.length?O:z.ended?z.length:0}ue.prototype.read=function(O){_("read",O),O===void 0?O=NaN:n(O)||(O=o(O,10));const z=this._readableState,Ee=O;if(O>z.highWaterMark&&(z.highWaterMark=Ze(O)),O!==0&&(z.state&=-129),O===0&&z.needReadable&&((z.highWaterMark!==0?z.length>=z.highWaterMark:z.length>0)||z.ended))return _("read: emitReadable",z.length,z.ended),z.length===0&&z.ended?qe(this):E(this),null;if(O=P(O,z),O===0&&z.ended)return z.length===0&&qe(this),null;let Ne=(z.state&ae)!==0;if(_("need readable",Ne),(z.length===0||z.length-O<z.highWaterMark)&&(Ne=!0,_("length less than watermark",Ne)),z.ended||z.reading||z.destroyed||z.errored||!z.constructed)Ne=!1,_("reading, ended or constructing",Ne);else if(Ne){_("do read"),z.state|=ne|H,z.length===0&&(z.state|=ae);try{this._read(z.highWaterMark)}catch(pt){X(this,pt)}z.state&=-33,z.reading||(O=P(Ee,z))}let Te;return O>0?Te=lt(O,z):Te=null,Te===null?(z.needReadable=z.length<=z.highWaterMark,O=0):(z.length-=O,z.multiAwaitDrain?z.awaitDrainWriters.clear():z.awaitDrainWriters=null),z.length===0&&(z.ended||(z.needReadable=!0),Ee!==O&&z.ended&&qe(this)),Te!==null&&!z.errorEmitted&&!z.closeEmitted&&(z.dataEmitted=!0,this.emit("data",Te)),Te};function S(O,z){if(_("onEofChunk"),!z.ended){if(z.decoder){const Ee=z.decoder.end();Ee&&Ee.length&&(z.buffer.push(Ee),z.length+=z.objectMode?1:Ee.length)}z.ended=!0,z.sync?E(O):(z.needReadable=!1,z.emittedReadable=!0,I(O))}}function E(O){const z=O._readableState;_("emitReadable",z.needReadable,z.emittedReadable),z.needReadable=!1,z.emittedReadable||(_("emitReadable",z.flowing),z.emittedReadable=!0,e.nextTick(I,O))}function I(O){const z=O._readableState;_("emitReadable_",z.destroyed,z.length,z.ended),!z.destroyed&&!z.errored&&(z.length||z.ended)&&(O.emit("readable"),z.emittedReadable=!1),z.needReadable=!z.flowing&&!z.ended&&z.length<=z.highWaterMark,et(O)}function U(O,z){!z.readingMore&&z.constructed&&(z.readingMore=!0,e.nextTick(ie,O,z))}function ie(O,z){for(;!z.reading&&!z.ended&&(z.length<z.highWaterMark||z.flowing&&z.length===0);){const Ee=z.length;if(_("maybeReadMore read 0"),O.read(0),Ee===z.length)break}z.readingMore=!1}ue.prototype._read=function(O){throw new F("_read()")},ue.prototype.pipe=function(O,z){const Ee=this,Ne=this._readableState;Ne.pipes.length===1&&(Ne.multiAwaitDrain||(Ne.multiAwaitDrain=!0,Ne.awaitDrainWriters=new c(Ne.awaitDrainWriters?[Ne.awaitDrainWriters]:[]))),Ne.pipes.push(O),_("pipe count=%d opts=%j",Ne.pipes.length,z);const pt=(!z||z.end!==!1)&&O!==e.stdout&&O!==e.stderr?hr:_e;Ne.endEmitted?e.nextTick(pt):Ee.once("end",pt),O.on("unpipe",gn);function gn(Ke,ei){_("onunpipe"),Ke===Ee&&ei&&ei.hasUnpiped===!1&&(ei.hasUnpiped=!0,Sh())}function hr(){_("onend"),O.end()}let Qr,Yc=!1;function Sh(){_("cleanup"),O.removeListener("close",Le),O.removeListener("finish",mt),Qr&&O.removeListener("drain",Qr),O.removeListener("error",ji),O.removeListener("unpipe",gn),Ee.removeListener("end",hr),Ee.removeListener("end",_e),Ee.removeListener("data",Kc),Yc=!0,Qr&&Ne.awaitDrainWriters&&(!O._writableState||O._writableState.needDrain)&&Qr()}function qc(){Yc||(Ne.pipes.length===1&&Ne.pipes[0]===O?(_("false write response, pause",0),Ne.awaitDrainWriters=O,Ne.multiAwaitDrain=!1):Ne.pipes.length>1&&Ne.pipes.includes(O)&&(_("false write response, pause",Ne.awaitDrainWriters.size),Ne.awaitDrainWriters.add(O)),Ee.pause()),Qr||(Qr=Z(Ee,O),O.on("drain",Qr))}Ee.on("data",Kc);function Kc(Ke){_("ondata");const ei=O.write(Ke);_("dest.write",ei),ei===!1&&qc()}function ji(Ke){if(_("onerror",Ke),_e(),O.removeListener("error",ji),O.listenerCount("error")===0){const ei=O._writableState||O._readableState;ei&&!ei.errorEmitted?X(O,Ke):O.emit("error",Ke)}}p(O,"error",ji);function Le(){O.removeListener("finish",mt),_e()}O.once("close",Le);function mt(){_("onfinish"),O.removeListener("close",Le),_e()}O.once("finish",mt);function _e(){_("unpipe"),Ee.unpipe(O)}return O.emit("pipe",Ee),O.writableNeedDrain===!0?qc():Ne.flowing||(_("pipe resume"),Ee.resume()),O};function Z(O,z){return function(){const Ne=O._readableState;Ne.awaitDrainWriters===z?(_("pipeOnDrain",1),Ne.awaitDrainWriters=null):Ne.multiAwaitDrain&&(_("pipeOnDrain",Ne.awaitDrainWriters.size),Ne.awaitDrainWriters.delete(z)),(!Ne.awaitDrainWriters||Ne.awaitDrainWriters.size===0)&&O.listenerCount("data")&&O.resume()}}ue.prototype.unpipe=function(O){const z=this._readableState,Ee={hasUnpiped:!1};if(z.pipes.length===0)return this;if(!O){const Te=z.pipes;z.pipes=[],this.pause();for(let pt=0;pt<Te.length;pt++)Te[pt].emit("unpipe",this,{hasUnpiped:!1});return this}const Ne=t(z.pipes,O);return Ne===-1?this:(z.pipes.splice(Ne,1),z.pipes.length===0&&this.pause(),O.emit("unpipe",this,Ee),this)},ue.prototype.on=function(O,z){const Ee=m.prototype.on.call(this,O,z),Ne=this._readableState;return O==="data"?(Ne.readableListening=this.listenerCount("readable")>0,Ne.flowing!==!1&&this.resume()):O==="readable"&&!Ne.endEmitted&&!Ne.readableListening&&(Ne.readableListening=Ne.needReadable=!0,Ne.flowing=!1,Ne.emittedReadable=!1,_("on readable",Ne.length,Ne.reading),Ne.length?E(this):Ne.reading||e.nextTick(ct,this)),Ee},ue.prototype.addListener=ue.prototype.on,ue.prototype.removeListener=function(O,z){const Ee=m.prototype.removeListener.call(this,O,z);return O==="readable"&&e.nextTick(Re,this),Ee},ue.prototype.off=ue.prototype.removeListener,ue.prototype.removeAllListeners=function(O){const z=m.prototype.removeAllListeners.apply(this,arguments);return(O==="readable"||O===void 0)&&e.nextTick(Re,this),z};function Re(O){const z=O._readableState;z.readableListening=O.listenerCount("readable")>0,z.resumeScheduled&&z[Y]===!1?z.flowing=!0:O.listenerCount("data")>0?O.resume():z.readableListening||(z.flowing=null)}function ct(O){_("readable nexttick read 0"),O.read(0)}ue.prototype.resume=function(){const O=this._readableState;return O.flowing||(_("resume"),O.flowing=!O.readableListening,ft(this,O)),O[Y]=!1,this};function ft(O,z){z.resumeScheduled||(z.resumeScheduled=!0,e.nextTick(yt,O,z))}function yt(O,z){_("resume",z.reading),z.reading||O.read(0),z.resumeScheduled=!1,O.emit("resume"),et(O),z.flowing&&!z.reading&&O.read(0)}ue.prototype.pause=function(){return _("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(_("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Y]=!0,this};function et(O){const z=O._readableState;for(_("flow",z.flowing);z.flowing&&O.read()!==null;);}ue.prototype.wrap=function(O){let z=!1;O.on("data",Ne=>{!this.push(Ne)&&O.pause&&(z=!0,O.pause())}),O.on("end",()=>{this.push(null)}),O.on("error",Ne=>{X(this,Ne)}),O.on("close",()=>{this.destroy()}),O.on("destroy",()=>{this.destroy()}),this._read=()=>{z&&O.resume&&(z=!1,O.resume())};const Ee=s(O);for(let Ne=1;Ne<Ee.length;Ne++){const Te=Ee[Ne];this[Te]===void 0&&typeof O[Te]=="function"&&(this[Te]=O[Te].bind(O))}return this},ue.prototype[u]=function(){return Ie(this)},ue.prototype.iterator=function(O){return O!==void 0&&K(O,"options"),Ie(this,O)};function Ie(O,z){typeof O.read!="function"&&(O=ue.wrap(O,{objectMode:!0}));const Ee=at(O,z);return Ee.stream=O,Ee}async function*at(O,z){let Ee=re;function Ne(gn){this===O?(Ee(),Ee=re):Ee=gn}O.on("readable",Ne);let Te;const pt=b(O,{writable:!1},gn=>{Te=gn?D(Te,gn):null,Ee(),Ee=re});try{for(;;){const gn=O.destroyed?null:O.read();if(gn!==null)yield gn;else{if(Te)throw Te;if(Te===null)return;await new l(Ne)}}}catch(gn){throw Te=D(Te,gn),Te}finally{(Te||(z==null?void 0:z.destroyOnReturn)!==!1)&&(Te===void 0||O._readableState.autoDestroy)?N.destroyer(O,null):(O.off("readable",Ne),pt())}}i(ue.prototype,{readable:{__proto__:null,get(){const O=this._readableState;return!!O&&O.readable!==!1&&!O.destroyed&&!O.errorEmitted&&!O.endEmitted},set(O){this._readableState&&(this._readableState.readable=!!O)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(O){this._readableState&&(this._readableState.flowing=O)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(O){this._readableState&&(this._readableState.destroyed=O)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),i(Se.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[Y]!==!1},set(O){this[Y]=!!O}}}),ue._fromList=lt;function lt(O,z){if(z.length===0)return null;let Ee;return z.objectMode?Ee=z.buffer.shift():!O||O>=z.length?(z.decoder?Ee=z.buffer.join(""):z.buffer.length===1?Ee=z.buffer.first():Ee=z.buffer.concat(z.length),z.buffer.clear()):Ee=z.buffer.consume(O,z.decoder),Ee}function qe(O){const z=O._readableState;_("endReadable",z.endEmitted),z.endEmitted||(z.ended=!0,e.nextTick(Me,z,O))}function Me(O,z){if(_("endReadableNT",O.endEmitted,O.length),!O.errored&&!O.closeEmitted&&!O.endEmitted&&O.length===0){if(O.endEmitted=!0,z.emit("end"),z.writable&&z.allowHalfOpen===!1)e.nextTick(ot,z);else if(O.autoDestroy){const Ee=z._writableState;(!Ee||Ee.autoDestroy&&(Ee.finished||Ee.writable===!1))&&z.destroy()}}}function ot(O){O.writable&&!O.writableEnded&&!O.destroyed&&O.end()}ue.from=function(O,z){return G(ue,O,z)};let Je;function xt(){return Je===void 0&&(Je={}),Je}return ue.fromWeb=function(O,z){return xt().newStreamReadableFromReadableStream(O,z)},ue.toWeb=function(O,z){return xt().newReadableStreamFromStreamReadable(O,z)},ue.wrap=function(O,z){var Ee,Ne;return new ue({objectMode:(Ee=(Ne=O.readableObjectMode)!==null&&Ne!==void 0?Ne:O.objectMode)!==null&&Ee!==void 0?Ee:!0,...z,destroy(Te,pt){N.destroyer(O,Te),pt(Te)}}).wrap(O)},Ap}var Tp,hx;function Dp(){if(hx)return Tp;hx=1;const e=Zi,{ArrayPrototypeSlice:t,Error:n,FunctionPrototypeSymbolHasInstance:r,ObjectDefineProperty:o,ObjectDefineProperties:i,ObjectSetPrototypeOf:s,StringPrototypeToLowerCase:a,Symbol:l,SymbolHasInstance:c}=Vt;Tp=K,K.WritableState=T;const{EventEmitter:d}=Eu,u=Ep.Stream,{Buffer:f}=ut,h=Hs,{addAbortSignal:m}=Mu,{getHighWaterMark:p,getDefaultHighWaterMark:y}=Ou,{ERR_INVALID_ARG_TYPE:v,ERR_METHOD_NOT_IMPLEMENTED:b,ERR_MULTIPLE_CALLBACK:_,ERR_STREAM_CANNOT_PIPE:C,ERR_STREAM_DESTROYED:N,ERR_STREAM_ALREADY_FINISHED:A,ERR_STREAM_NULL_VALUES:R,ERR_STREAM_WRITE_AFTER_END:D,ERR_UNKNOWN_ENCODING:k}=Fn.codes,{errorOrDestroy:F}=h;s(K.prototype,u.prototype),s(K,u);function W(){}const B=l("kOnFinished");function T($,j,le){typeof le!="boolean"&&(le=j instanceof jo()),this.objectMode=!!($&&$.objectMode),le&&(this.objectMode=this.objectMode||!!($&&$.writableObjectMode)),this.highWaterMark=$?p(this,$,"writableHighWaterMark",le):y(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const ve=!!($&&$.decodeStrings===!1);this.decodeStrings=!ve,this.defaultEncoding=$&&$.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=X.bind(void 0,j),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Q(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!$||$.emitClose!==!1,this.autoDestroy=!$||$.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[B]=[]}function Q($){$.buffered=[],$.bufferedIndex=0,$.allBuffers=!0,$.allNoop=!0}T.prototype.getBuffer=function(){return t(this.buffered,this.bufferedIndex)},o(T.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function K($){const j=this instanceof jo();if(!j&&!r(K,this))return new K($);this._writableState=new T($,this,j),$&&(typeof $.write=="function"&&(this._write=$.write),typeof $.writev=="function"&&(this._writev=$.writev),typeof $.destroy=="function"&&(this._destroy=$.destroy),typeof $.final=="function"&&(this._final=$.final),typeof $.construct=="function"&&(this._construct=$.construct),$.signal&&m($.signal,this)),u.call(this,$),h.construct(this,()=>{const le=this._writableState;le.writing||ne(this,le),V(this,le)})}o(K,c,{__proto__:null,value:function($){return r(this,$)?!0:this!==K?!1:$&&$._writableState instanceof T}}),K.prototype.pipe=function(){F(this,new C)};function Y($,j,le,ve){const we=$._writableState;if(typeof le=="function")ve=le,le=we.defaultEncoding;else{if(!le)le=we.defaultEncoding;else if(le!=="buffer"&&!f.isEncoding(le))throw new k(le);typeof ve!="function"&&(ve=W)}if(j===null)throw new R;if(!we.objectMode)if(typeof j=="string")we.decodeStrings!==!1&&(j=f.from(j,le),le="buffer");else if(j instanceof f)le="buffer";else if(u._isUint8Array(j))j=u._uint8ArrayToBuffer(j),le="buffer";else throw new v("chunk",["string","Buffer","Uint8Array"],j);let M;return we.ending?M=new D:we.destroyed&&(M=new N("write")),M?(e.nextTick(ve,M),F($,M,!0),M):(we.pendingcb++,ee($,we,j,le,ve))}K.prototype.write=function($,j,le){return Y(this,$,j,le)===!0},K.prototype.cork=function(){this._writableState.corked++},K.prototype.uncork=function(){const $=this._writableState;$.corked&&($.corked--,$.writing||ne(this,$))},K.prototype.setDefaultEncoding=function(j){if(typeof j=="string"&&(j=a(j)),!f.isEncoding(j))throw new k(j);return this._writableState.defaultEncoding=j,this};function ee($,j,le,ve,we){const M=j.objectMode?1:le.length;j.length+=M;const q=j.length<j.highWaterMark;return q||(j.needDrain=!0),j.writing||j.corked||j.errored||!j.constructed?(j.buffered.push({chunk:le,encoding:ve,callback:we}),j.allBuffers&&ve!=="buffer"&&(j.allBuffers=!1),j.allNoop&&we!==W&&(j.allNoop=!1)):(j.writelen=M,j.writecb=we,j.writing=!0,j.sync=!0,$._write(le,ve,j.onwrite),j.sync=!1),q&&!j.errored&&!j.destroyed}function G($,j,le,ve,we,M,q){j.writelen=ve,j.writecb=q,j.writing=!0,j.sync=!0,j.destroyed?j.onwrite(new N("write")):le?$._writev(we,j.onwrite):$._write(we,M,j.onwrite),j.sync=!1}function re($,j,le,ve){--j.pendingcb,ve(le),L(j),F($,le)}function X($,j){const le=$._writableState,ve=le.sync,we=le.writecb;if(typeof we!="function"){F($,new _);return}le.writing=!1,le.writecb=null,le.length-=le.writelen,le.writelen=0,j?(j.stack,le.errored||(le.errored=j),$._readableState&&!$._readableState.errored&&($._readableState.errored=j),ve?e.nextTick(re,$,le,j,we):re($,le,j,we)):(le.buffered.length>le.bufferedIndex&&ne($,le),ve?le.afterWriteTickInfo!==null&&le.afterWriteTickInfo.cb===we?le.afterWriteTickInfo.count++:(le.afterWriteTickInfo={count:1,cb:we,stream:$,state:le},e.nextTick(J,le.afterWriteTickInfo)):se($,le,1,we))}function J({stream:$,state:j,count:le,cb:ve}){return j.afterWriteTickInfo=null,se($,j,le,ve)}function se($,j,le,ve){for(!j.ending&&!$.destroyed&&j.length===0&&j.needDrain&&(j.needDrain=!1,$.emit("drain"));le-- >0;)j.pendingcb--,ve();j.destroyed&&L(j),V($,j)}function L($){if($.writing)return;for(let we=$.bufferedIndex;we<$.buffered.length;++we){var j;const{chunk:M,callback:q}=$.buffered[we],te=$.objectMode?1:M.length;$.length-=te,q((j=$.errored)!==null&&j!==void 0?j:new N("write"))}const le=$[B].splice(0);for(let we=0;we<le.length;we++){var ve;le[we]((ve=$.errored)!==null&&ve!==void 0?ve:new N("end"))}Q($)}function ne($,j){if(j.corked||j.bufferProcessing||j.destroyed||!j.constructed)return;const{buffered:le,bufferedIndex:ve,objectMode:we}=j,M=le.length-ve;if(!M)return;let q=ve;if(j.bufferProcessing=!0,M>1&&$._writev){j.pendingcb-=M-1;const te=j.allNoop?W:ue=>{for(let ye=q;ye<le.length;++ye)le[ye].callback(ue)},Se=j.allNoop&&q===0?le:t(le,q);Se.allBuffers=j.allBuffers,G($,j,!0,j.length,Se,"",te),Q(j)}else{do{const{chunk:te,encoding:Se,callback:ue}=le[q];le[q++]=null;const ye=we?1:te.length;G($,j,!1,ye,te,Se,ue)}while(q<le.length&&!j.writing);q===le.length?Q(j):q>256?(le.splice(0,q),j.bufferedIndex=0):j.bufferedIndex=q}j.bufferProcessing=!1}K.prototype._write=function($,j,le){if(this._writev)this._writev([{chunk:$,encoding:j}],le);else throw new b("_write()")},K.prototype._writev=null,K.prototype.end=function($,j,le){const ve=this._writableState;typeof $=="function"?(le=$,$=null,j=null):typeof j=="function"&&(le=j,j=null);let we;if($!=null){const M=Y(this,$,j);M instanceof n&&(we=M)}return ve.corked&&(ve.corked=1,this.uncork()),we||(!ve.errored&&!ve.ending?(ve.ending=!0,V(this,ve,!0),ve.ended=!0):ve.finished?we=new A("end"):ve.destroyed&&(we=new N("end"))),typeof le=="function"&&(we||ve.finished?e.nextTick(le,we):ve[B].push(le)),this};function fe($){return $.ending&&!$.destroyed&&$.constructed&&$.length===0&&!$.errored&&$.buffered.length===0&&!$.finished&&!$.writing&&!$.errorEmitted&&!$.closeEmitted}function H($,j){let le=!1;function ve(we){if(le){F($,we??_());return}if(le=!0,j.pendingcb--,we){const M=j[B].splice(0);for(let q=0;q<M.length;q++)M[q](we);F($,we,j.sync)}else fe(j)&&(j.prefinished=!0,$.emit("prefinish"),j.pendingcb++,e.nextTick(de,$,j))}j.sync=!0,j.pendingcb++;try{$._final(ve)}catch(we){ve(we)}j.sync=!1}function ae($,j){!j.prefinished&&!j.finalCalled&&(typeof $._final=="function"&&!j.destroyed?(j.finalCalled=!0,H($,j)):(j.prefinished=!0,$.emit("prefinish")))}function V($,j,le){fe(j)&&(ae($,j),j.pendingcb===0&&(le?(j.pendingcb++,e.nextTick((ve,we)=>{fe(we)?de(ve,we):we.pendingcb--},$,j)):fe(j)&&(j.pendingcb++,de($,j))))}function de($,j){j.pendingcb--,j.finished=!0;const le=j[B].splice(0);for(let ve=0;ve<le.length;ve++)le[ve]();if($.emit("finish"),j.autoDestroy){const ve=$._readableState;(!ve||ve.autoDestroy&&(ve.endEmitted||ve.readable===!1))&&$.destroy()}}i(K.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set($){this._writableState&&(this._writableState.destroyed=$)}},writable:{__proto__:null,get(){const $=this._writableState;return!!$&&$.writable!==!1&&!$.destroyed&&!$.errored&&!$.ending&&!$.ended},set($){this._writableState&&(this._writableState.writable=!!$)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const $=this._writableState;return $?!$.destroyed&&!$.ending&&$.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const ge=h.destroy;K.prototype.destroy=function($,j){const le=this._writableState;return!le.destroyed&&(le.bufferedIndex<le.buffered.length||le[B].length)&&e.nextTick(L,le),ge.call(this,$,j),this},K.prototype._undestroy=h.undestroy,K.prototype._destroy=function($,j){j($)},K.prototype[d.captureRejectionSymbol]=function($){this.destroy($)};let pe;function oe(){return pe===void 0&&(pe={}),pe}return K.fromWeb=function($,j){return oe().newStreamWritableFromWritableStream($,j)},K.toWeb=function($){return oe().newWritableStreamFromStreamWritable($)},Tp}var Mp,px;function h4(){if(px)return Mp;px=1;const e=Zi,t=ut,{isReadable:n,isWritable:r,isIterable:o,isNodeStream:i,isReadableNodeStream:s,isWritableNodeStream:a,isDuplexNodeStream:l,isReadableStream:c,isWritableStream:d}=Lo,u=ui,{AbortError:f,codes:{ERR_INVALID_ARG_TYPE:h,ERR_INVALID_RETURN_VALUE:m}}=Fn,{destroyer:p}=Hs,y=jo(),v=ku(),b=Dp(),{createDeferredPromise:_}=Vn,C=dx,N=globalThis.Blob||t.Blob,A=typeof N<"u"?function(T){return T instanceof N}:function(T){return!1},R=globalThis.AbortController||yl().AbortController,{FunctionPrototypeCall:D}=Vt;class k extends y{constructor(T){super(T),(T==null?void 0:T.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(T==null?void 0:T.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}Mp=function B(T,Q){if(l(T))return T;if(s(T))return W({readable:T});if(a(T))return W({writable:T});if(i(T))return W({writable:!1,readable:!1});if(c(T))return W({readable:v.fromWeb(T)});if(d(T))return W({writable:b.fromWeb(T)});if(typeof T=="function"){const{value:Y,write:ee,final:G,destroy:re}=F(T);if(o(Y))return C(k,Y,{objectMode:!0,write:ee,final:G,destroy:re});const X=Y==null?void 0:Y.then;if(typeof X=="function"){let J;const se=D(X,Y,L=>{if(L!=null)throw new m("nully","body",L)},L=>{p(J,L)});return J=new k({objectMode:!0,readable:!1,write:ee,final(L){G(async()=>{try{await se,e.nextTick(L,null)}catch(ne){e.nextTick(L,ne)}})},destroy:re})}throw new m("Iterable, AsyncIterable or AsyncFunction",Q,Y)}if(A(T))return B(T.arrayBuffer());if(o(T))return C(k,T,{objectMode:!0,writable:!1});if(c(T==null?void 0:T.readable)&&d(T==null?void 0:T.writable))return k.fromWeb(T);if(typeof(T==null?void 0:T.writable)=="object"||typeof(T==null?void 0:T.readable)=="object"){const Y=T!=null&&T.readable?s(T==null?void 0:T.readable)?T==null?void 0:T.readable:B(T.readable):void 0,ee=T!=null&&T.writable?a(T==null?void 0:T.writable)?T==null?void 0:T.writable:B(T.writable):void 0;return W({readable:Y,writable:ee})}const K=T==null?void 0:T.then;if(typeof K=="function"){let Y;return D(K,T,ee=>{ee!=null&&Y.push(ee),Y.push(null)},ee=>{p(Y,ee)}),Y=new k({objectMode:!0,writable:!1,read(){}})}throw new h(Q,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],T)};function F(B){let{promise:T,resolve:Q}=_();const K=new R,Y=K.signal;return{value:B(async function*(){for(;;){const G=T;T=null;const{chunk:re,done:X,cb:J}=await G;if(e.nextTick(J),X)return;if(Y.aborted)throw new f(void 0,{cause:Y.reason});({promise:T,resolve:Q}=_()),yield re}}(),{signal:Y}),write(G,re,X){const J=Q;Q=null,J({chunk:G,done:!1,cb:X})},final(G){const re=Q;Q=null,re({done:!0,cb:G})},destroy(G,re){K.abort(),re(G)}}}function W(B){const T=B.readable&&typeof B.readable.read!="function"?v.wrap(B.readable):B.readable,Q=B.writable;let K=!!n(T),Y=!!r(Q),ee,G,re,X,J;function se(L){const ne=X;X=null,ne?ne(L):L&&J.destroy(L)}return J=new k({readableObjectMode:!!(T!=null&&T.readableObjectMode),writableObjectMode:!!(Q!=null&&Q.writableObjectMode),readable:K,writable:Y}),Y&&(u(Q,L=>{Y=!1,L&&p(T,L),se(L)}),J._write=function(L,ne,fe){Q.write(L,ne)?fe():ee=fe},J._final=function(L){Q.end(),G=L},Q.on("drain",function(){if(ee){const L=ee;ee=null,L()}}),Q.on("finish",function(){if(G){const L=G;G=null,L()}})),K&&(u(T,L=>{K=!1,L&&p(T,L),se(L)}),T.on("readable",function(){if(re){const L=re;re=null,L()}}),T.on("end",function(){J.push(null)}),J._read=function(){for(;;){const L=T.read();if(L===null){re=J._read;return}if(!J.push(L))return}}),J._destroy=function(L,ne){!L&&X!==null&&(L=new f),re=null,ee=null,G=null,X===null?ne(L):(X=ne,p(Q,L),p(T,L))},J}return Mp}var Ip,mx;function jo(){if(mx)return Ip;mx=1;const{ObjectDefineProperties:e,ObjectGetOwnPropertyDescriptor:t,ObjectKeys:n,ObjectSetPrototypeOf:r}=Vt;Ip=s;const o=ku(),i=Dp();r(s.prototype,o.prototype),r(s,o);{const d=n(i.prototype);for(let u=0;u<d.length;u++){const f=d[u];s.prototype[f]||(s.prototype[f]=i.prototype[f])}}function s(d){if(!(this instanceof s))return new s(d);o.call(this,d),i.call(this,d),d?(this.allowHalfOpen=d.allowHalfOpen!==!1,d.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),d.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}e(s.prototype,{writable:{__proto__:null,...t(i.prototype,"writable")},writableHighWaterMark:{__proto__:null,...t(i.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...t(i.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...t(i.prototype,"writableBuffer")},writableLength:{__proto__:null,...t(i.prototype,"writableLength")},writableFinished:{__proto__:null,...t(i.prototype,"writableFinished")},writableCorked:{__proto__:null,...t(i.prototype,"writableCorked")},writableEnded:{__proto__:null,...t(i.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...t(i.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(d){this._readableState&&this._writableState&&(this._readableState.destroyed=d,this._writableState.destroyed=d)}}});let a;function l(){return a===void 0&&(a={}),a}s.fromWeb=function(d,u){return l().newStreamDuplexFromReadableWritablePair(d,u)},s.toWeb=function(d){return l().newReadableWritablePairFromDuplex(d)};let c;return s.from=function(d){return c||(c=h4()),c(d,"body")},Ip}const{ObjectSetPrototypeOf:gx,Symbol:p4}=Vt;var yx=Fo;const{ERR_METHOD_NOT_IMPLEMENTED:m4}=Fn.codes,Op=jo(),{getHighWaterMark:g4}=Ou;gx(Fo.prototype,Op.prototype),gx(Fo,Op);const bl=p4("kCallback");function Fo(e){if(!(this instanceof Fo))return new Fo(e);const t=e?g4(this,e,"readableHighWaterMark",!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),Op.call(this,e),this._readableState.sync=!1,this[bl]=null,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",y4)}function kp(e){typeof this._flush=="function"&&!this.destroyed?this._flush((t,n)=>{if(t){e?e(t):this.destroy(t);return}n!=null&&this.push(n),this.push(null),e&&e()}):(this.push(null),e&&e())}function y4(){this._final!==kp&&kp.call(this)}Fo.prototype._final=kp,Fo.prototype._transform=function(e,t,n){throw new m4("_transform()")},Fo.prototype._write=function(e,t,n){const r=this._readableState,o=this._writableState,i=r.length;this._transform(e,t,(s,a)=>{if(s){n(s);return}a!=null&&this.push(a),o.ended||i===r.length||r.length<r.highWaterMark?n():this[bl]=n})},Fo.prototype._read=function(){if(this[bl]){const e=this[bl];this[bl]=null,e()}};const{ObjectSetPrototypeOf:wx}=Vt;var vx=Gs;const Lp=yx;wx(Gs.prototype,Lp.prototype),wx(Gs,Lp);function Gs(e){if(!(this instanceof Gs))return new Gs(e);Lp.call(this,e)}Gs.prototype._transform=function(e,t,n){n(null,e)};const _l=Zi,{ArrayIsArray:w4,Promise:v4,SymbolAsyncIterator:b4,SymbolDispose:_4}=Vt,Lu=ui,{once:S4}=Vn,x4=Hs,bx=jo(),{aggregateTwoErrors:E4,codes:{ERR_INVALID_ARG_TYPE:jp,ERR_INVALID_RETURN_VALUE:Fp,ERR_MISSING_ARGS:C4,ERR_STREAM_DESTROYED:N4,ERR_STREAM_PREMATURE_CLOSE:R4},AbortError:P4}=Fn,{validateFunction:A4,validateAbortSignal:T4}=wl,{isIterable:ts,isReadable:$p,isReadableNodeStream:ju,isNodeStream:_x,isTransformStream:Ys,isWebStream:D4,isReadableStream:zp,isReadableFinished:M4}=Lo,I4=globalThis.AbortController||yl().AbortController;let Bp,Wp,Vp;function Sx(e,t,n){let r=!1;e.on("close",()=>{r=!0});const o=Lu(e,{readable:t,writable:n},i=>{r=!i});return{destroy:i=>{r||(r=!0,x4.destroyer(e,i||new N4("pipe")))},cleanup:o}}function O4(e){return A4(e[e.length-1],"streams[stream.length - 1]"),e.pop()}function Up(e){if(ts(e))return e;if(ju(e))return k4(e);throw new jp("val",["Readable","Iterable","AsyncIterable"],e)}async function*k4(e){Wp||(Wp=ku()),yield*Wp.prototype[b4].call(e)}async function Fu(e,t,n,{end:r}){let o,i=null;const s=c=>{if(c&&(o=c),i){const d=i;i=null,d()}},a=()=>new v4((c,d)=>{o?d(o):i=()=>{o?d(o):c()}});t.on("drain",s);const l=Lu(t,{readable:!1},s);try{t.writableNeedDrain&&await a();for await(const c of e)t.write(c)||await a();r&&(t.end(),await a()),n()}catch(c){n(o!==c?E4(o,c):c)}finally{l(),t.off("drain",s)}}async function Hp(e,t,n,{end:r}){Ys(t)&&(t=t.writable);const o=t.getWriter();try{for await(const i of e)await o.ready,o.write(i).catch(()=>{});await o.ready,r&&await o.close(),n()}catch(i){try{await o.abort(i),n(i)}catch(s){n(s)}}}function L4(...e){return xx(e,S4(O4(e)))}function xx(e,t,n){if(e.length===1&&w4(e[0])&&(e=e[0]),e.length<2)throw new C4("streams");const r=new I4,o=r.signal,i=n==null?void 0:n.signal,s=[];T4(i,"options.signal");function a(){m(new P4)}Vp=Vp||Vn.addAbortListener;let l;i&&(l=Vp(i,a));let c,d;const u=[];let f=0;function h(b){m(b,--f===0)}function m(b,_){var C;if(b&&(!c||c.code==="ERR_STREAM_PREMATURE_CLOSE")&&(c=b),!(!c&&!_)){for(;u.length;)u.shift()(c);(C=l)===null||C===void 0||C[_4](),r.abort(),_&&(c||s.forEach(N=>N()),_l.nextTick(t,c,d))}}let p;for(let b=0;b<e.length;b++){const _=e[b],C=b<e.length-1,N=b>0,A=C||(n==null?void 0:n.end)!==!1,R=b===e.length-1;if(_x(_)){let D=function(k){k&&k.name!=="AbortError"&&k.code!=="ERR_STREAM_PREMATURE_CLOSE"&&h(k)};if(A){const{destroy:k,cleanup:F}=Sx(_,C,N);u.push(k),$p(_)&&R&&s.push(F)}_.on("error",D),$p(_)&&R&&s.push(()=>{_.removeListener("error",D)})}if(b===0)if(typeof _=="function"){if(p=_({signal:o}),!ts(p))throw new Fp("Iterable, AsyncIterable or Stream","source",p)}else ts(_)||ju(_)||Ys(_)?p=_:p=bx.from(_);else if(typeof _=="function"){if(Ys(p)){var y;p=Up((y=p)===null||y===void 0?void 0:y.readable)}else p=Up(p);if(p=_(p,{signal:o}),C){if(!ts(p,!0))throw new Fp("AsyncIterable",`transform[${b-1}]`,p)}else{var v;Bp||(Bp=vx);const D=new Bp({objectMode:!0}),k=(v=p)===null||v===void 0?void 0:v.then;if(typeof k=="function")f++,k.call(p,B=>{d=B,B!=null&&D.write(B),A&&D.end(),_l.nextTick(h)},B=>{D.destroy(B),_l.nextTick(h,B)});else if(ts(p,!0))f++,Fu(p,D,h,{end:A});else if(zp(p)||Ys(p)){const B=p.readable||p;f++,Fu(B,D,h,{end:A})}else throw new Fp("AsyncIterable or Promise","destination",p);p=D;const{destroy:F,cleanup:W}=Sx(p,!1,!0);u.push(F),R&&s.push(W)}}else if(_x(_)){if(ju(p)){f+=2;const D=j4(p,_,h,{end:A});$p(_)&&R&&s.push(D)}else if(Ys(p)||zp(p)){const D=p.readable||p;f++,Fu(D,_,h,{end:A})}else if(ts(p))f++,Fu(p,_,h,{end:A});else throw new jp("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],p);p=_}else if(D4(_)){if(ju(p))f++,Hp(Up(p),_,h,{end:A});else if(zp(p)||ts(p))f++,Hp(p,_,h,{end:A});else if(Ys(p))f++,Hp(p.readable,_,h,{end:A});else throw new jp("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],p);p=_}else p=bx.from(_)}return(o!=null&&o.aborted||i!=null&&i.aborted)&&_l.nextTick(a),p}function j4(e,t,n,{end:r}){let o=!1;if(t.on("close",()=>{o||n(new R4)}),e.pipe(t,{end:!1}),r){let i=function(){o=!0,t.end()};M4(e)?_l.nextTick(i):e.once("end",i)}else n();return Lu(e,{readable:!0,writable:!1},i=>{const s=e._readableState;i&&i.code==="ERR_STREAM_PREMATURE_CLOSE"&&s&&s.ended&&!s.errored&&!s.errorEmitted?e.once("end",n).once("error",n):n(i)}),Lu(t,{readable:!1,writable:!0},n)}var Gp={pipelineImpl:xx,pipeline:L4};const{pipeline:F4}=Gp,$u=jo(),{destroyer:$4}=Hs,{isNodeStream:zu,isReadable:Ex,isWritable:Cx,isWebStream:Yp,isTransformStream:ns,isWritableStream:Nx,isReadableStream:Rx}=Lo,{AbortError:z4,codes:{ERR_INVALID_ARG_VALUE:Px,ERR_MISSING_ARGS:B4}}=Fn,W4=ui;var Ax=function(...t){if(t.length===0)throw new B4("streams");if(t.length===1)return $u.from(t[0]);const n=[...t];if(typeof t[0]=="function"&&(t[0]=$u.from(t[0])),typeof t[t.length-1]=="function"){const h=t.length-1;t[h]=$u.from(t[h])}for(let h=0;h<t.length;++h)if(!(!zu(t[h])&&!Yp(t[h]))){if(h<t.length-1&&!(Ex(t[h])||Rx(t[h])||ns(t[h])))throw new Px(`streams[${h}]`,n[h],"must be readable");if(h>0&&!(Cx(t[h])||Nx(t[h])||ns(t[h])))throw new Px(`streams[${h}]`,n[h],"must be writable")}let r,o,i,s,a;function l(h){const m=s;s=null,m?m(h):h?a.destroy(h):!f&&!u&&a.destroy()}const c=t[0],d=F4(t,l),u=!!(Cx(c)||Nx(c)||ns(c)),f=!!(Ex(d)||Rx(d)||ns(d));if(a=new $u({writableObjectMode:!!(c!=null&&c.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:u,readable:f}),u){if(zu(c))a._write=function(m,p,y){c.write(m,p)?y():r=y},a._final=function(m){c.end(),o=m},c.on("drain",function(){if(r){const m=r;r=null,m()}});else if(Yp(c)){const p=(ns(c)?c.writable:c).getWriter();a._write=async function(y,v,b){try{await p.ready,p.write(y).catch(()=>{}),b()}catch(_){b(_)}},a._final=async function(y){try{await p.ready,p.close().catch(()=>{}),o=y}catch(v){y(v)}}}const h=ns(d)?d.readable:d;W4(h,()=>{if(o){const m=o;o=null,m()}})}if(f){if(zu(d))d.on("readable",function(){if(i){const h=i;i=null,h()}}),d.on("end",function(){a.push(null)}),a._read=function(){for(;;){const h=d.read();if(h===null){i=a._read;return}if(!a.push(h))return}};else if(Yp(d)){const m=(ns(d)?d.readable:d).getReader();a._read=async function(){for(;;)try{const{value:p,done:y}=await m.read();if(!a.push(p))return;if(y){a.push(null);return}}catch{return}}}}return a._destroy=function(h,m){!h&&s!==null&&(h=new z4),i=null,r=null,o=null,s===null?m(h):(s=m,zu(d)&&$4(d,h))},a};const V4=globalThis.AbortController||yl().AbortController,{codes:{ERR_INVALID_ARG_VALUE:U4,ERR_INVALID_ARG_TYPE:Sl,ERR_MISSING_ARGS:H4,ERR_OUT_OF_RANGE:G4},AbortError:ao}=Fn,{validateAbortSignal:rs,validateInteger:Tx,validateObject:os}=wl,Y4=Vt.Symbol("kWeak"),q4=Vt.Symbol("kResistStopPropagation"),{finished:K4}=ui,X4=Ax,{addAbortSignalNoValidate:J4}=Mu,{isWritable:Q4,isNodeStream:Z4}=Lo,{deprecate:eW}=Vn,{ArrayPrototypePush:tW,Boolean:nW,MathFloor:Dx,Number:rW,NumberIsNaN:oW,Promise:Mx,PromiseReject:Ix,PromiseResolve:iW,PromisePrototypeThen:Ox,Symbol:kx}=Vt,Bu=kx("kEmpty"),Lx=kx("kEof");function sW(e,t){if(t!=null&&os(t,"options"),(t==null?void 0:t.signal)!=null&&rs(t.signal,"options.signal"),Z4(e)&&!Q4(e))throw new U4("stream",e,"must be writable");const n=X4(this,e);return t!=null&&t.signal&&J4(t.signal,n),n}function Wu(e,t){if(typeof e!="function")throw new Sl("fn",["Function","AsyncFunction"],e);t!=null&&os(t,"options"),(t==null?void 0:t.signal)!=null&&rs(t.signal,"options.signal");let n=1;(t==null?void 0:t.concurrency)!=null&&(n=Dx(t.concurrency));let r=n-1;return(t==null?void 0:t.highWaterMark)!=null&&(r=Dx(t.highWaterMark)),Tx(n,"options.concurrency",1),Tx(r,"options.highWaterMark",0),r+=n,(async function*(){const i=Vn.AbortSignalAny([t==null?void 0:t.signal].filter(nW)),s=this,a=[],l={signal:i};let c,d,u=!1,f=0;function h(){u=!0,m()}function m(){f-=1,p()}function p(){d&&!u&&f<n&&a.length<r&&(d(),d=null)}async function y(){try{for await(let v of s){if(u)return;if(i.aborted)throw new ao;try{if(v=e(v,l),v===Bu)continue;v=iW(v)}catch(b){v=Ix(b)}f+=1,Ox(v,m,h),a.push(v),c&&(c(),c=null),!u&&(a.length>=r||f>=n)&&await new Mx(b=>{d=b})}a.push(Lx)}catch(v){const b=Ix(v);Ox(b,m,h),a.push(b)}finally{u=!0,c&&(c(),c=null)}}y();try{for(;;){for(;a.length>0;){const v=await a[0];if(v===Lx)return;if(i.aborted)throw new ao;v!==Bu&&(yield v),a.shift(),p()}await new Mx(v=>{c=v})}}finally{u=!0,d&&(d(),d=null)}}).call(this)}function aW(e=void 0){return e!=null&&os(e,"options"),(e==null?void 0:e.signal)!=null&&rs(e.signal,"options.signal"),(async function*(){let n=0;for await(const o of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new ao({cause:e.signal.reason});yield[n++,o]}}).call(this)}async function jx(e,t=void 0){for await(const n of qp.call(this,e,t))return!0;return!1}async function lW(e,t=void 0){if(typeof e!="function")throw new Sl("fn",["Function","AsyncFunction"],e);return!await jx.call(this,async(...n)=>!await e(...n),t)}async function cW(e,t){for await(const n of qp.call(this,e,t))return n}async function uW(e,t){if(typeof e!="function")throw new Sl("fn",["Function","AsyncFunction"],e);async function n(r,o){return await e(r,o),Bu}for await(const r of Wu.call(this,n,t));}function qp(e,t){if(typeof e!="function")throw new Sl("fn",["Function","AsyncFunction"],e);async function n(r,o){return await e(r,o)?r:Bu}return Wu.call(this,n,t)}class dW extends H4{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function fW(e,t,n){var r;if(typeof e!="function")throw new Sl("reducer",["Function","AsyncFunction"],e);n!=null&&os(n,"options"),(n==null?void 0:n.signal)!=null&&rs(n.signal,"options.signal");let o=arguments.length>1;if(n!=null&&(r=n.signal)!==null&&r!==void 0&&r.aborted){const c=new ao(void 0,{cause:n.signal.reason});throw this.once("error",()=>{}),await K4(this.destroy(c)),c}const i=new V4,s=i.signal;if(n!=null&&n.signal){const c={once:!0,[Y4]:this,[q4]:!0};n.signal.addEventListener("abort",()=>i.abort(),c)}let a=!1;try{for await(const c of this){var l;if(a=!0,n!=null&&(l=n.signal)!==null&&l!==void 0&&l.aborted)throw new ao;o?t=await e(t,c,{signal:s}):(t=c,o=!0)}if(!a&&!o)throw new dW}finally{i.abort()}return t}async function hW(e){e!=null&&os(e,"options"),(e==null?void 0:e.signal)!=null&&rs(e.signal,"options.signal");const t=[];for await(const r of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new ao(void 0,{cause:e.signal.reason});tW(t,r)}return t}function pW(e,t){const n=Wu.call(this,e,t);return(async function*(){for await(const o of n)yield*o}).call(this)}function Fx(e){if(e=rW(e),oW(e))return 0;if(e<0)throw new G4("number",">= 0",e);return e}function mW(e,t=void 0){return t!=null&&os(t,"options"),(t==null?void 0:t.signal)!=null&&rs(t.signal,"options.signal"),e=Fx(e),(async function*(){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new ao;for await(const i of this){var o;if(t!=null&&(o=t.signal)!==null&&o!==void 0&&o.aborted)throw new ao;e--<=0&&(yield i)}}).call(this)}function gW(e,t=void 0){return t!=null&&os(t,"options"),(t==null?void 0:t.signal)!=null&&rs(t.signal,"options.signal"),e=Fx(e),(async function*(){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new ao;for await(const i of this){var o;if(t!=null&&(o=t.signal)!==null&&o!==void 0&&o.aborted)throw new ao;if(e-- >0&&(yield i),e<=0)return}}).call(this)}sp.streamReturningOperators={asIndexedPairs:eW(aW,"readable.asIndexedPairs will be removed in a future version."),drop:mW,filter:qp,flatMap:pW,map:Wu,take:gW,compose:sW},sp.promiseReturningOperators={every:lW,forEach:uW,reduce:fW,toArray:hW,some:jx,find:cW};var Kp,$x;function zx(){if($x)return Kp;$x=1;const{ArrayPrototypePop:e,Promise:t}=Vt,{isIterable:n,isNodeStream:r,isWebStream:o}=Lo,{pipelineImpl:i}=Gp,{finished:s}=ui;Wx();function a(...l){return new t((c,d)=>{let u,f;const h=l[l.length-1];if(h&&typeof h=="object"&&!r(h)&&!n(h)&&!o(h)){const m=e(l);u=m.signal,f=m.end}i(l,(m,p)=>{m?d(m):c(p)},{signal:u,end:f})})}return Kp={finished:s,pipeline:a},Kp}var Bx;function Wx(){if(Bx)return op.exports;Bx=1;const{Buffer:e}=ut,{ObjectDefineProperty:t,ObjectKeys:n,ReflectApply:r}=Vt,{promisify:{custom:o}}=Vn,{streamReturningOperators:i,promiseReturningOperators:s}=sp,{codes:{ERR_ILLEGAL_CONSTRUCTOR:a}}=Fn,l=Ax,{setDefaultHighWaterMark:c,getDefaultHighWaterMark:d}=Ou,{pipeline:u}=Gp,{destroyer:f}=Hs,h=ui,m=zx(),p=Lo,y=op.exports=Ep.Stream;y.isDestroyed=p.isDestroyed,y.isDisturbed=p.isDisturbed,y.isErrored=p.isErrored,y.isReadable=p.isReadable,y.isWritable=p.isWritable,y.Readable=ku();for(const b of n(i)){let C=function(...N){if(new.target)throw a();return y.Readable.from(r(_,this,N))};const _=i[b];t(C,"name",{__proto__:null,value:_.name}),t(C,"length",{__proto__:null,value:_.length}),t(y.Readable.prototype,b,{__proto__:null,value:C,enumerable:!1,configurable:!0,writable:!0})}for(const b of n(s)){let C=function(...N){if(new.target)throw a();return r(_,this,N)};const _=s[b];t(C,"name",{__proto__:null,value:_.name}),t(C,"length",{__proto__:null,value:_.length}),t(y.Readable.prototype,b,{__proto__:null,value:C,enumerable:!1,configurable:!0,writable:!0})}y.Writable=Dp(),y.Duplex=jo(),y.Transform=yx,y.PassThrough=vx,y.pipeline=u;const{addAbortSignal:v}=Mu;return y.addAbortSignal=v,y.finished=h,y.destroy=f,y.compose=l,y.setDefaultHighWaterMark=c,y.getDefaultHighWaterMark=d,t(y,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return m}}),t(u,o,{__proto__:null,enumerable:!0,get(){return m.pipeline}}),t(h,o,{__proto__:null,enumerable:!0,get(){return m.finished}}),y.Stream=y,y._isUint8Array=function(_){return _ instanceof Uint8Array},y._uint8ArrayToBuffer=function(_){return e.from(_.buffer,_.byteOffset,_.byteLength)},op.exports}(function(e){const t=Wx(),n=zx(),r=t.Readable.destroy;e.exports=t.Readable,e.exports._uint8ArrayToBuffer=t._uint8ArrayToBuffer,e.exports._isUint8Array=t._isUint8Array,e.exports.isDisturbed=t.isDisturbed,e.exports.isErrored=t.isErrored,e.exports.isReadable=t.isReadable,e.exports.Readable=t.Readable,e.exports.Writable=t.Writable,e.exports.Duplex=t.Duplex,e.exports.Transform=t.Transform,e.exports.PassThrough=t.PassThrough,e.exports.addAbortSignal=t.addAbortSignal,e.exports.finished=t.finished,e.exports.destroy=t.destroy,e.exports.destroy=r,e.exports.pipeline=t.pipeline,e.exports.compose=t.compose,Object.defineProperty(t,"promises",{configurable:!0,enumerable:!0,get(){return n}}),e.exports.Stream=t.Stream,e.exports.default=e.exports})(Y_);var Vx=Y_.exports;class Xp extends Vx.Readable{constructor(t={},n){var r;super({...t,encoding:(r=t.encoding)!==null&&r!==void 0?r:void 0}),this.pending=!0,this._path="<unknown>",this._bytesRead=0,this.ready=Promise.resolve(n).then(o=>{this._path=o.path;const i=o.readableWebStream({start:t.start,end:t.end});this.reader=i.getReader(),this.pending=!1}).catch(o=>{this.destroy(o)})}async _read(){try{if(await this.ready,!this.reader)return;const{done:t,value:n}=await this.reader.read();if(t){this.push(null);return}this._bytesRead+=n.byteLength,this.push(n)}catch(t){this.destroy(new Wt(he.EIO,t.toString()))}}close(t=()=>null){try{this.destroy(),this.emit("close"),t(null)}catch(n){t(new Wt(he.EIO,n.toString()))}}get path(){return this._path}get bytesRead(){return this._bytesRead}wrap(t){return super.wrap(t),this}}class Jp extends Vx.Writable{constructor(t={},n){super(t),this.pending=!0,this._path="<unknown>",this._bytesWritten=0,this.ready=Promise.resolve(n).then(r=>{this._path=r.path;const o=r.writableWebStream({start:t.start});this.writer=o.getWriter(),this.pending=!1}).catch(r=>this.destroy(r))}async _write(t,n,r){if(await this.ready,!this.writer)return r(En(me("EAGAIN","write",this._path)));if(n!="buffer")return r(En(me("ENOTSUP","write",this._path)));const o=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);try{await this.writer.write(o),this._bytesWritten+=t.byteLength,r()}catch(i){r(new Wt(he.EIO,i.toString()))}}async _final(t){if(await this.ready,!this.writer)return t();try{await this.writer.close(),t()}catch(n){t(new Wt(he.EIO,n.toString()))}}close(t=()=>null){try{this.destroy(),this.emit("close"),t(null)}catch(n){t(new Wt(he.EIO,n.toString()))}}get path(){return this._path}get bytesWritten(){return this._bytesWritten}}var br=function(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var r,o;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose],n&&(o=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");o&&(r=function(){try{o.call(this)}catch(i){return Promise.reject(i)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t},_r=function(e){return function(t){function n(s){t.error=t.hasError?new e(s,t.error,"An error was suppressed during disposal."):s,t.hasError=!0}var r,o=0;function i(){for(;r=t.stack.pop();)try{if(!r.async&&o===1)return o=0,t.stack.push(r),Promise.resolve().then(i);if(r.dispose){var s=r.dispose.call(r.value);if(r.async)return o|=2,Promise.resolve(s).then(i,function(a){return n(a),i()})}else o|=1}catch(a){n(a)}if(o===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return i()}}(typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r});class bn{get position(){return this.flag&zi?this.inode.size:this._position}set position(t){this._position=t}constructor(t,n){this.context=t,this.fd=n,this._position=0,this.dirty=!1,this.closed=!1;const r=Nn(t,n);Object.assign(this,Dh(r,"path","fs","internalPath","flag","inode"))}get _isSync(){return!!(this.flag&au||this.inode.flags&Cn.Sync)}_emitChange(){jn(this.context,"change",this.path)}async chown(t,n){if(this.closed)throw me("EBADF","chown",this.path);this.dirty=!0,R_(this.inode,t,n),this._isSync&&await this.sync(),this._emitChange()}async chmod(t){const n=ii(t,-1);if(n<0)throw me("EINVAL","chmod",this.path);if(this.closed)throw me("EBADF","chmod",this.path);this.dirty=!0,this.inode.mode=this.inode.mode&(n>Rt?-61441:Rt)|n,(this._isSync||n>Rt)&&await this.sync(),this._emitChange()}datasync(){return this.sync()}async sync(){if(this.closed)throw me("EBADF","sync",this.path);this.dirty&&(this.fs.attributes.has("no_write")||await this.fs.touch(this.internalPath,this.inode),this.dirty=!1)}async truncate(t=0){if(this.closed)throw me("EBADF","truncate",this.path);if(t<0)throw me("EINVAL","truncate",this.path);if(!(this.flag&yn||this.flag&no))throw me("EBADF","truncate",this.path);if(this.fs.attributes.has("readonly"))throw me("EROFS","truncate",this.path);if(this.inode.flags&Cn.Immutable)throw me("EPERM","truncate",this.path);if(this.dirty=!0,!(this.flag&yn||this.flag&no))throw me("EBADF","truncate",this.path);this.inode.mtimeMs=Date.now(),this.inode.size=t,this._isSync&&await this.sync(),this._emitChange()}async utimes(t,n){if(this.closed)throw me("EBADF","utimes",this.path);this.dirty=!0,this.inode.atimeMs=pu(t),this.inode.mtimeMs=pu(n),this._isSync&&await this.sync(),this._emitChange()}async appendFile(t,n={}){const r=Mo(n,"utf8","a",420);if(!(Io(r.flag)&zi))throw me("EBADF","write",this.path);const i=typeof t=="string"?ut.Buffer.from(t,r.encoding):t;await this._write(i,0,i.length),this._emitChange()}async _read(t,n=0,r=t.byteLength-n,o=this.position){if(this.closed)throw me("EBADF","read",this.path);if(this.flag&yn)throw me("EBADF","read",this.path);!(this.inode.flags&Cn.NoAtime)&&!this.fs.attributes.has("no_atime")&&(this.dirty=!0,this.inode.atimeMs=Date.now());let i=o+r;!hl(this.inode)&&!fl(this.inode)&&i>this.inode.size&&(i=o+Math.max(this.inode.size-o,0)),this._position=i;const s=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);return await this.fs.read(this.internalPath,s.subarray(n,n+r),o,i),this._isSync&&await this.sync(),{bytesRead:i-o,buffer:t}}async read(t,n,r,o){typeof n=="object"&&n!=null&&(o=n.position,r=n.length,n=n.offset),!ArrayBuffer.isView(t)&&typeof t=="object"&&(o=t.position,r=t.length,n=t.offset,t=t.buffer);const i=Number.isSafeInteger(o)?o:this.position;return t||(t=new Uint8Array(this.inode.size)),n??(n=0),this._read(t,n,r??t.byteLength-n,i)}async readFile(t){const n=Mo(t,null,"r",292);if(Io(n.flag)&yn)throw me("EBADF","read",this.path);const{size:o}=await this.stat(),i=new Uint8Array(o);await this._read(i,0,o,0);const s=ut.Buffer.from(i);return n.encoding?s.toString(n.encoding):s}readableWebStream(t={}){if(this.closed)throw me("EBADF","readableWebStream",this.path);return this.fs.streamRead(this.internalPath,t)}writableWebStream(t={}){if(this.closed)throw me("EBADF","writableWebStream",this.path);if(this.inode.flags&Cn.Immutable)throw me("EPERM","writableWebStream",this.path);return this.fs.streamWrite(this.internalPath,t)}readLines(t){if(this.closed||this.flag&yn)throw me("EBADF","read",this.path);return d2({input:this.createReadStream(t),crlfDelay:1/0})}[Symbol.asyncDispose](){return this.close()}async stat(t){if(this.closed)throw me("EBADF","stat",this.path);if(!St(this.context,this.inode,en))throw me("EACCES","stat",this.path);return t!=null&&t.bigint?new Gi(this.inode):new To(this.inode)}async _write(t,n=0,r=t.byteLength-n,o=this.position){if(this.closed)throw me("EBADF","write",this.path);if(this.inode.flags&Cn.Immutable)throw me("EPERM","write",this.path);if(!(this.flag&yn||this.flag&no))throw me("EBADF","write",this.path);if(this.fs.attributes.has("readonly"))throw me("EROFS","write",this.path);this.dirty=!0;const i=o+r,s=t.subarray(n,n+r);return!hl(this.inode)&&!fl(this.inode)&&i>this.inode.size&&(this.inode.size=i),this.inode.mtimeMs=Date.now(),this.inode.ctimeMs=Date.now(),this._position=o+s.byteLength,await this.fs.write(this.internalPath,s,o),this._isSync&&await this.sync(),s.byteLength}async write(t,n,r,o){let i,s,a;typeof n=="object"&&n!=null&&(r=n.length,o=n.position,n=n.offset),typeof t=="string"?(o=typeof n=="number"?n:null,s=0,i=ut.Buffer.from(t,typeof r=="string"?r:"utf8"),a=i.length):(i=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),s=n??0,a=typeof r=="number"?r:i.byteLength,o=typeof o=="number"?o:null),o??(o=this.position);const l=await this._write(i,s,a,o);return this._emitChange(),{buffer:t,bytesWritten:l}}async writeFile(t,n={}){const r=Mo(n,"utf8","w",420),o=Io(r.flag);if(!(o&yn||o&no))throw me("EBADF","writeFile",this.path);const i=typeof t=="string"?ut.Buffer.from(t,r.encoding):t;await this._write(i,0,i.length,0),this._emitChange()}async close(){if(this.closed)throw me("EBADF","close",this.path);await this.sync(),this.dispose(),I_(this.context,this.fd)}dispose(t){if(this.closed)throw me("EBADF","close",this.path);if(this.dirty&&!t)throw me("EBUSY","close",this.path);this.closed=!0}async writev(t,n){typeof n=="number"&&(this.position=n);let r=0;for(const o of t)r+=(await this.write(o)).bytesWritten;return{bytesWritten:r,buffers:t}}async readv(t,n){typeof n=="number"&&(this.position=n);let r=0;for(const o of t)r+=(await this.read(o)).bytesRead;return{bytesRead:r,buffers:t}}createReadStream(t={}){if(this.closed||this.flag&yn)throw me("EBADF","createReadStream",this.path);return new Xp(t,this)}createWriteStream(t={}){if(this.closed)throw me("EBADF","createWriteStream",this.path);if(this.inode.flags&Cn.Immutable)throw me("EPERM","createWriteStream",this.path);if(this.fs.attributes.has("readonly"))throw me("EROFS","createWriteStream",this.path);return new Jp(t,this)}}async function Ux(e,t){e=je(e),t=je(t);const n={syscall:"rename",path:e,dest:t},r=tt(e,this),o=tt(t,this);if(r.fs!==o.fs)throw me("EXDEV",n);if(o.path.startsWith(r.path+"/"))throw me("EBUSY",n);const i=await $o.call(this,it(e)).catch($t(n)),s=await $o.call(this,e).catch($t(n)),a=await $o.call(this,it(t)).catch($t(n)),l=await $o.call(this,t).catch(c=>{if(c.code=="ENOENT")return null;throw fn(Object.assign(c,n))});if(!i.hasAccess(en,this)||!a.hasAccess(Gt,this))throw me("EACCES",n);if(l&&!an(s)&&an(l))throw me("EISDIR",n);if(l&&an(s)&&!an(l))throw me("ENOTDIR",n);await r.fs.rename(r.path,o.path).catch($t(n)),jn(this,"rename",e),jn(this,"change",t)}async function xl(e){try{const{fs:t,path:n}=tt(await di.call(this,e),this);return await t.exists(n)}catch(t){if(t instanceof Wt&&t.code=="ENOENT")return!1;throw t}}async function $o(e,t){e=je(e);const{fs:n,path:r}=tt(await di.call(this,e),this),o={syscall:"stat",path:e},i=await n.stat(r).catch($t(o));if(!St(this,i,en))throw me("EACCES",o);return t!=null&&t.bigint?new Gi(i):new To(i)}async function Vu(e,t){e=je(e);const{fs:n,path:r}=tt(e,this),o={syscall:"lstat",path:e},i=await n.stat(r).catch($t(o));if(!St(this,i,en))throw me("EACCES",o);return t!=null&&t.bigint?new Gi(i):new To(i)}async function Hx(e,t=0){const n={stack:[],error:void 0,hasError:!1};try{await br(n,await Sr.call(this,e,"r+"),!0).truncate(t)}catch(r){n.error=r,n.hasError=!0}finally{const r=_r(n);r&&await r}}async function Qp(e){e=je(e);const{fs:t,path:n}=tt(e,this),r={syscall:"unlink",path:e},o=await t.stat(n).catch($t(r));if(!St(this,o,Gt))throw me("EACCES",r);await t.unlink(n).catch($t(r)),jn(this,"rename",e.toString())}async function qs(e,t,n){var r;t=je(t);const o=ii(n.mode,420),i=Io(n.flag),s={syscall:"open",path:t},{fs:a,path:l,stats:c}=await Gu(e,t.toString(),n.preserveSymlinks);if(!c){if(!(i&ou))throw me("ENOENT",s);const u=await a.stat(it(l));if(!St(e,u,Gt))throw me("EACCES","open",it(t));if(!an(u))throw me("ENOTDIR","open",it(t));if(!n.allowDirectory&&o&Yt)throw me("EISDIR","open",t);const{euid:f,egid:h}=(r=e==null?void 0:e.credentials)!==null&&r!==void 0?r:Ar.credentials,m=await a.createFile(l,{mode:o,uid:u.mode&cl?u.uid:f,gid:u.mode&ul?u.gid:h});return new bn(e,yu(new gu(e,t,a,l,i,m)))}if(!St(e,c,O_(i)))throw me("EACCES",s);if(i&iu)throw me("EEXIST",s);const d=new bn(e,yu(new gu(e,t,a,l,i,c)));if(!n.allowDirectory&&o&Yt)throw me("EISDIR","open",t);return i&su&&await d.truncate(0),d}async function Sr(e,t="r",n=420){return await qs(this,e,{flag:t,mode:n})}async function Zp(e,t){const n={stack:[],error:void 0,hasError:!1};try{const r=Mo(t,null,"r",292);return await br(n,typeof e=="object"&&"fd"in e?e:await Sr.call(this,e,r.flag,r.mode),!0).readFile(r)}catch(r){n.error=r,n.hasError=!0}finally{const r=_r(n);r&&await r}}async function em(e,t,n){const r={stack:[],error:void 0,hasError:!1};try{const o=Mo(n,"utf8","w+",420),i=br(r,e instanceof bn?e:await Sr.call(this,e.toString(),o.flag,o.mode),!0),s=typeof t=="string"?t:t instanceof DataView?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t;if(typeof s!="string"&&!(s instanceof Uint8Array))throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received '+typeof t);await i.writeFile(s,o)}catch(o){r.error=o,r.hasError=!0}finally{const o=_r(r);o&&await o}}async function Gx(e,t,n){const r={stack:[],error:void 0,hasError:!1};try{const o=Mo(n,"utf8","a",420),i=Io(o.flag),s={syscall:"write",path:e instanceof bn?e.path:e.toString()};if(!(i&zi))throw me("EBADF",s);const a=typeof t=="string"?ut.Buffer.from(t,o.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);await br(r,typeof e=="object"&&"fd"in e?e:await Sr.call(this,e,o.flag,o.mode),!0).appendFile(a,o)}catch(o){r.error=o,r.hasError=!0}finally{const o=_r(r);o&&await o}}async function tm(e){e=await di.call(this,e);const{fs:t,path:n}=tt(e,this),r={syscall:"rmdir",path:e},o=await t.stat(n).catch($t(r));if(!o)throw me("ENOENT",r);if(!an(o))throw me("ENOTDIR",r);if(!St(this,o,Gt))throw me("EACCES",r);await t.rmdir(n).catch($t(r)),jn(this,"rename",e.toString())}async function Uu(e,t){var n;const{euid:r,egid:o}=(n=this===null||this===void 0?void 0:this.credentials)!==null&&n!==void 0?n:Ar.credentials;t=typeof t=="object"?t:{mode:t};const i=ii(t==null?void 0:t.mode,511);e=await di.call(this,e);const{fs:s,path:a}=tt(e,this),l=async(f,h,m)=>{if(!St(this,m,Gt))throw me("EACCES","mkdir",it(f));const p=await s.mkdir(h,{mode:i,uid:m.mode&cl?m.uid:r,gid:m.mode&ul?m.gid:o}).catch($t({syscall:"mkdir",path:f}));return jn(this,"rename",f),p};if(!(t!=null&&t.recursive)){await l(e,a,await s.stat(it(a)).catch($t({path:it(e)})));return}const c=[];let d=e;for(let f=a;!await s.exists(f).catch($t({syscall:"exists",path:d}));f=it(f),d=it(d))c.unshift([d,f]);if(!c.length)return;const u=[await s.stat(it(c[0][1])).catch($t({syscall:"stat",path:it(c[0][0])}))];for(const[f,[h,m]]of c.entries())u.push(await l(h,m,u[f]));return c[0][0]}async function is(e,t){t=typeof t=="object"?t:{encoding:t},e=await di.call(this,e);const{fs:n,path:r}=tt(e,this),o={syscall:"readdir",path:e},i=await n.stat(r).catch($t({syscall:"stat",path:e}));if(!i)throw me("ENOENT",o);if(!St(this,i,en))throw me("EACCES",o);if(!an(i))throw me("ENOTDIR",o);const s=await n.readdir(r).catch($t(o)),a=[],l=async c=>{let d;if(!((t!=null&&t.recursive||t!=null&&t.withFileTypes)&&(d=await n.stat(vt(r,c)).catch(u=>{if(u.code!="ENOENT")throw fn(Object.assign(u,{syscall:"stat",path:vt(e,c)}))}),!d))&&(t!=null&&t.withFileTypes?a.push(new ml(c,d)):(t==null?void 0:t.encoding)=="buffer"?a.push(ut.Buffer.from(c)):a.push(c),!(!(t!=null&&t.recursive)||!an(d))))for(const u of await is.call(this,vt(e,c),t))u instanceof ml?(u.path=vt(c,u.path),a.push(u)):ut.Buffer.isBuffer(u)?a.push(ut.Buffer.from(vt(c,tu(u)))):a.push(vt(c,u))};return await Promise.all(s.map(l)),a}async function Yx(e,t){e=je(e),t=je(t);const{fs:n,path:r}=tt(e,this),o=tt(t,this),i={syscall:"link",path:e};if(n!=o.fs)throw me("EXDEV",i);const s=await n.stat(it(r)).catch($t({syscall:"stat",path:it(e)}));if(!St(this,s,en))throw me("EACCES","link",it(e));if(!(await $o.call(this,it(t))).hasAccess(Gt,this))throw me("EACCES","link",it(t));if(!St(this,await n.stat(r).catch($t(i)),en))throw me("EACCES",i);return await n.link(r,o.path).catch($t(i))}async function qx(e,t,n="file"){const r={stack:[],error:void 0,hasError:!1};try{if(!["file","dir","junction"].includes(n))throw new TypeError("Invalid symlink type: "+n);if(t=je(t),await xl.call(this,t))throw me("EEXIST","symlink",t);const o=br(r,await qs(this,t,{flag:"w+",mode:420,preserveSymlinks:!0}),!0);await o.writeFile(je(e,!0)),await o.chmod(Po)}catch(o){r.error=o,r.hasError=!0}finally{const o=_r(r);o&&await o}}async function Hu(e,t){const n={stack:[],error:void 0,hasError:!1};try{e=je(e);const r=br(n,await qs(this,e,{flag:"r",mode:420,preserveSymlinks:!0}),!0);if(!oi(r.inode))throw me("EINVAL","readlink",e);const o=await r.readFile(),i=typeof t=="object"?t==null?void 0:t.encoding:t;return i=="buffer"?o:o.toString(i??"utf-8")}catch(r){n.error=r,n.hasError=!0}finally{const r=_r(n);r&&await r}}async function Kx(e,t,n){const r={stack:[],error:void 0,hasError:!1};try{await br(r,await Sr.call(this,e,"r+"),!0).chown(t,n)}catch(o){r.error=o,r.hasError=!0}finally{const o=_r(r);o&&await o}}async function Xx(e,t,n){const r={stack:[],error:void 0,hasError:!1};try{await br(r,await qs(this,e,{flag:"r+",mode:420,preserveSymlinks:!0,allowDirectory:!0}),!0).chown(t,n)}catch(o){r.error=o,r.hasError=!0}finally{const o=_r(r);o&&await o}}async function Jx(e,t){const n={stack:[],error:void 0,hasError:!1};try{await br(n,await Sr.call(this,e,"r+"),!0).chmod(t)}catch(r){n.error=r,n.hasError=!0}finally{const r=_r(n);r&&await r}}async function Qx(e,t){const n={stack:[],error:void 0,hasError:!1};try{await br(n,await qs(this,e,{flag:"r+",mode:420,preserveSymlinks:!0,allowDirectory:!0}),!0).chmod(t)}catch(r){n.error=r,n.hasError=!0}finally{const r=_r(n);r&&await r}}async function nm(e,t,n){const r={stack:[],error:void 0,hasError:!1};try{await br(r,await Sr.call(this,e,"r+"),!0).utimes(t,n)}catch(o){r.error=o,r.hasError=!0}finally{const o=_r(r);o&&await o}}async function Zx(e,t,n){const r={stack:[],error:void 0,hasError:!1};try{await br(r,await qs(this,e,{flag:"r+",mode:420,preserveSymlinks:!0,allowDirectory:!0}),!0).utimes(new Date(t),new Date(n))}catch(o){r.error=o,r.hasError=!0}finally{const o=_r(r);o&&await o}}async function Gu(e,t,n){if(n){const d=tt(t,e),u=await d.fs.stat(d.path).catch(()=>{});return{...d,fullPath:t,stats:u}}try{const d=tt(t,e),u=await d.fs.stat(d.path);if(!oi(u))return{...d,fullPath:t,stats:u};const f=Ao.call(e,it(t),(await Hu.call(e,t)).toString());return await Gu(e,f)}catch{}const{base:r,dir:o}=gr(t),i=o=="/"?"/":await di.call(e,o),s=vt(i,r),a=tt(s,e),l=await a.fs.stat(a.path).catch(d=>{if(d.code!="ENOENT")throw fn(Object.assign(d,{syscall:"stat",path:s}))});if(!l)return{...a,fullPath:t};if(!oi(l))return{...a,fullPath:s,stats:l};const c=Ao.call(e,i,(await Hu.call(e,s)).toString());return await Gu(e,c)}async function di(e,t){var n;const r=typeof t=="string"?t:(n=t==null?void 0:t.encoding)!==null&&n!==void 0?n:"utf8";e=je(e);const{fullPath:o}=await Gu(this,e);if(r=="utf8"||r=="utf-8")return o;const i=ut.Buffer.from(o,"utf-8");return r=="buffer"?i:i.toString(r)}function yW(e,t={}){const n=new F_(this,e.toString(),typeof t!="string"?t:{encoding:t}),r=[];let o=!1;n.on("change",(s,a)=>{var l;(l=r.shift())===null||l===void 0||l({value:{eventType:s,filename:a},done:!1})});function i(){o=!0,n.close();for(const s of r)s({value:null,done:o});return r.length=0,Promise.resolve({value:null,done:!0})}return{async next(){if(o)return Promise.resolve({value:null,done:o});const{promise:s,resolve:a}=Promise.withResolvers();return r.push(a),s},return:i,throw:i,async[Symbol.asyncDispose](){await i()},[Symbol.asyncIterator](){return this}}}async function e0(e,t=Oh){if(!(await $o.call(this,e)).hasAccess(t,this))throw me("EACCES","access",e.toString())}async function rm(e,t){e=je(e);const n=await Vu.call(this,e).catch(r=>{if(!(r.code=="ENOENT"&&(t!=null&&t.force)))throw r});if(n)switch(n.mode&Rt){case Yt:if(t!=null&&t.recursive)for(const r of await is.call(this,e))await rm.call(this,vt(e,r),t);await tm.call(this,e);break;case Tr:case Po:case Wi:case Vi:await Qp.call(this,e);break;case Ui:case Bi:default:throw me("ENOSYS","rm",e)}}async function t0(e,t){const n=typeof t=="object"?t==null?void 0:t.encoding:t||"utf8",o="/tmp/"+`${e}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await Uu.call(this,o),n=="buffer"?ut.Buffer.from(o):o}async function om(e,t,n){if(e=je(e),t=je(t),n&&n&kh&&await xl.call(this,t))throw me("EEXIST","copyFile",t);await em.call(this,t,await Zp.call(this,e)),jn(this,"rename",t.toString())}function n0(e,t){return e=je(e),Promise.resolve(new rp(e,this))}async function im(e,t,n){e=je(e),t=je(t);const r=await Vu.call(this,e);if(n!=null&&n.errorOnExist&&await xl.call(this,t))throw me("EEXIST","cp",t);switch(r.mode&Rt){case Yt:{if(!(n!=null&&n.recursive))throw me("EISDIR","cp",e);const[o]=await Promise.all([is.call(this,e,{withFileTypes:!0}),Uu.call(this,t,{recursive:!0})]),i=async s=>{n.filter&&!n.filter(vt(e,s.name),vt(t,s.name))||await im.call(this,vt(e,s.name),vt(t,s.name),n)};await Promise.all(o.map(i));break}case Tr:case Po:await om.call(this,e,t);break;case Wi:case Vi:case Ui:case Bi:default:throw me("ENOSYS","cp",e)}n!=null&&n.preserveTimestamps&&await nm.call(this,t,r.atime,r.mtime)}async function r0(e,t){e=je(e);const{fs:n}=tt(e,this);return Promise.resolve(L_(n,t==null?void 0:t.bigint))}function o0(e,t){e=Array.isArray(e)?e:[e];const{cwd:n="/",withFileTypes:r=!1,exclude:o=()=>!1}=t||{},i=e.map(a=>(a=a.replace(/([.?+^$(){}|[\]/])/g,"$1").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*").replace(/\?/g,"."),new RegExp(`^${a}$`)));async function*s(a){const l=await is(a,{withFileTypes:r,encoding:"utf8"});for(const c of l){const d=r?c.path:a+"/"+c;o(r?c:d)||((await $o(d)).isDirectory()&&i.some(u=>u.source.includes(".*"))&&(yield*s(d)),i.some(u=>u.test(d.replace(/^\/+/g,"")))&&(yield r?c:d.replace(/^\/+/g,"")))}}return s(n)}const i0=Object.freeze(Object.defineProperty({__proto__:null,FileHandle:bn,access:e0,appendFile:Gx,chmod:Jx,chown:Kx,constants:g_,copyFile:om,cp:im,exists:xl,glob:o0,lchmod:Qx,lchown:Xx,link:Yx,lstat:Vu,lutimes:Zx,mkdir:Uu,mkdtemp:t0,open:Sr,opendir:n0,readFile:Zp,readdir:is,readlink:Hu,realpath:di,rename:Ux,rm,rmdir:tm,stat:$o,statfs:r0,symlink:qx,truncate:Hx,unlink:Qp,utimes:nm,watch:yW,writeFile:em},Symbol.toStringTag,{value:"Module"})),Ye=()=>{};async function wW(e){const t=[];for await(const n of e)t.push(n);return t}function vW(e,t,n=Ye){Ux.call(this,e,t).then(()=>n()).catch(n)}function bW(e,t=Ye){xl.call(this,e).then(t).catch(()=>t(!1))}function _W(e,t,n=Ye){n=typeof t=="function"?t:n,$o.call(this,e,typeof t!="function"?t:{}).then(r=>n(void 0,r)).catch(n)}function SW(e,t,n=Ye){n=typeof t=="function"?t:n,Vu.call(this,e,typeof t!="function"?t:{}).then(r=>n(void 0,r)).catch(n)}function xW(e,t=0,n=Ye){n=typeof t=="function"?t:n;const r=typeof t=="number"?t:0;Hx.call(this,e,r).then(()=>n()).catch(n)}function EW(e,t=Ye){Qp.call(this,e).then(()=>t()).catch(t)}function CW(e,t,n,r=Ye){const o=ii(n,420);r=typeof n=="function"?n:r,Sr.call(this,e,t,o).then(i=>r(void 0,i.fd)).catch(r)}function NW(e,t,n=Ye){n=typeof t=="function"?t:n,Zp.call(this,e,typeof t=="function"?null:t).then(r=>n(void 0,r)).catch(n)}function RW(e,t,n,r=Ye){r=typeof n=="function"?n:r,em.call(this,e,t,typeof n!="function"?n:null).then(()=>r(void 0)).catch(r)}function PW(e,t,n,r=Ye){const o=typeof n!="function"?n:void 0;r=typeof n=="function"?n:r,Gx.call(this,e,t,o).then(()=>r()).catch(r)}function AW(e,t,n=Ye){n=typeof t=="function"?t:n,new bn(this,e).stat().then(r=>n(void 0,typeof t=="object"&&(t!=null&&t.bigint)?new Gi(r):r)).catch(n)}function TW(e,t=Ye){new bn(this,e).close().then(()=>t()).catch(t)}function DW(e,t,n=Ye){const r=typeof t=="number"?t:0;n=typeof t=="function"?t:n;const o=new bn(this,e);if(r<0)throw Ce("EINVAL");o.truncate(r).then(()=>n()).catch(n)}function MW(e,t=Ye){new bn(this,e).sync().then(()=>t()).catch(t)}function IW(e,t=Ye){new bn(this,e).datasync().then(()=>t()).catch(t)}function OW(e,t,n,r,o,i=Ye){let s,a,l,c,d;const u=new bn(this,e);if(typeof t=="string"){switch(d="utf8",typeof n){case"function":i=n;break;case"number":c=n,d=typeof r=="string"?r:"utf8",i=typeof o=="function"?o:i;break;default:i=typeof r=="function"?r:typeof o=="function"?o:i,i(Ce("EINVAL"));return}s=ut.Buffer.from(t),a=0,l=s.length;const f=i;u.write(s,a,l,c).then(({bytesWritten:h})=>f(void 0,h,s.toString(d))).catch(f)}else{s=ut.Buffer.from(t.buffer),a=n,l=r,c=typeof o=="number"?o:null;const f=typeof o=="function"?o:i;u.write(s,a,l,c).then(({bytesWritten:h})=>f(void 0,h,s)).catch(f)}}function kW(e,t,n,r,o,i=Ye){new bn(this,e).read(t,n,r,o).then(({bytesRead:s,buffer:a})=>i(void 0,s,a)).catch(i)}function LW(e,t,n,r=Ye){new bn(this,e).chown(t,n).then(()=>r()).catch(r)}function jW(e,t,n){new bn(this,e).chmod(t).then(()=>n()).catch(n)}function FW(e,t,n,r=Ye){new bn(this,e).utimes(t,n).then(()=>r()).catch(r)}function $W(e,t=Ye){tm.call(this,e).then(()=>t()).catch(t)}function zW(e,t,n=Ye){Uu.call(this,e,t).then(()=>n()).catch(n)}function BW(e,t,n=Ye){n=typeof t=="function"?t:n;const r=typeof t!="function"?t:{};is.call(this,e,r).then(o=>n(void 0,o)).catch(n)}function WW(e,t,n=Ye){Yx.call(this,e,t).then(()=>n()).catch(n)}function VW(e,t,n,r=Ye){const o=typeof n=="string"?n:"file";r=typeof n=="function"?n:r,qx.call(this,e,t,o).then(()=>r()).catch(r)}function UW(e,t,n=Ye){n=typeof t=="function"?t:n,Hu.call(this,e).then(r=>n(void 0,r)).catch(n)}function HW(e,t,n,r=Ye){Kx.call(this,e,t,n).then(()=>r()).catch(r)}function GW(e,t,n,r=Ye){Xx.call(this,e,t,n).then(()=>r()).catch(r)}function YW(e,t,n=Ye){Jx.call(this,e,t).then(()=>n()).catch(n)}function qW(e,t,n=Ye){Qx.call(this,e,t).then(()=>n()).catch(n)}function KW(e,t,n,r=Ye){nm.call(this,e,t,n).then(()=>r()).catch(r)}function XW(e,t,n,r=Ye){Zx.call(this,e,t,n).then(()=>r()).catch(r)}function JW(e,t,n=Ye){n=typeof t=="function"?t:n,di.call(this,e,typeof t=="function"?null:t).then(r=>n(void 0,r)).catch(n)}function QW(e,t,n=Ye){const r=typeof t=="number"?t:en;n=typeof t=="function"?t:n,e0.call(this,e,r).then(()=>n()).catch(n)}const Ks=new Map;function ZW(e,t,n){const r=je(e),o=typeof t!="function"?t:{};if(typeof t=="function"&&(n=t),!n)throw me("EINVAL","watch",e.toString());if(Ks.has(r)){const s=Ks.get(r);s&&s.listeners.add(n);return}const i=new g2(this,r,o);i.on("change",(s,a)=>{const l=Ks.get(r);if(l)for(const c of l.listeners)c(s,a)}),Ks.set(r,{watcher:i,listeners:new Set})}function e5(e,t=Ye){const n=je(e),r=Ks.get(n);r&&(t&&t!==Ye?r.listeners.delete(t):r.listeners.clear(),r.listeners.size===0&&(r.watcher.stop(),Ks.delete(n)))}function t5(e,t,n){const r=new F_(this,je(e),typeof t=="object"?t:{});return n=typeof t=="function"?t:n,r.on("change",n||Ye),r}function n5(e,t){t=typeof t=="object"?t:{encoding:t};const n=Sr.call(this,e,"r",t==null?void 0:t.mode);return new Xp({...t,autoClose:!0},n)}function r5(e,t){t=typeof t=="object"?t:{encoding:t};const n=Sr.call(this,e,"w",t==null?void 0:t.mode);return new Jp(t,n)}function o5(e,t,n=Ye){n=typeof t=="function"?t:n,rm.call(this,e,typeof t=="function"?void 0:t).then(()=>n(void 0)).catch(n)}function i5(e,t,n=Ye){n=typeof t=="function"?t:n,t0.call(this,e,typeof t!="function"?t:null).then(r=>n(void 0,r)).catch(n)}function s5(e,t,n,r=Ye){r=typeof n=="function"?n:r,om.call(this,e,t,typeof n=="function"?void 0:n).then(()=>r(void 0)).catch(r)}function a5(e,t,n,r=Ye){r=typeof n=="function"?n:r,new bn(this,e).readv(t,typeof n=="function"?void 0:n).then(({buffers:o,bytesRead:i})=>r(void 0,i,o)).catch(r)}function l5(e,t,n,r=Ye){r=typeof n=="function"?n:r,new bn(this,e).writev(t,typeof n=="function"?void 0:n).then(({buffers:o,bytesWritten:i})=>r(void 0,i,o)).catch(r)}function c5(e,t,n=Ye){n=typeof t=="function"?t:n,n0.call(this,e,typeof t=="function"?void 0:t).then(r=>n(void 0,r)).catch(n)}function u5(e,t,n,r=Ye){r=typeof n=="function"?n:r,im.call(this,e,t,typeof n=="function"?void 0:n).then(()=>r(void 0)).catch(r)}function d5(e,t,n=Ye){n=typeof t=="function"?t:n,r0.call(this,e,typeof t=="function"?void 0:t).then(r=>n(void 0,r)).catch(n)}async function f5(e,t){const n=await Sr.call(this,e.toString(),"r"),r=await n.readFile();return await n.close(),new Blob([r],t)}function h5(e,t,n=Ye){n=typeof t=="function"?t:n;const r=o0.call(this,e,typeof t=="function"?void 0:t);wW(r).then(o=>{var i;return n(null,(i=o)!==null&&i!==void 0?i:[])}).catch(o=>n(o))}var ss=function(e,t,n,r,o,i){function s(v){if(v!==void 0&&typeof v!="function")throw new TypeError("Function expected");return v}for(var a=r.kind,l=a==="getter"?"get":a==="setter"?"set":"value",c=!t&&e?r.static?e:e.prototype:null,d=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),u,f=!1,h=n.length-1;h>=0;h--){var m={};for(var p in r)m[p]=p==="access"?{}:r[p];for(var p in r.access)m.access[p]=r.access[p];m.addInitializer=function(v){if(f)throw new TypeError("Cannot add initializers after decoration has completed");i.push(s(v||null))};var y=(0,n[h])(a==="accessor"?{get:d.get,set:d.set}:d[l],m);if(a==="accessor"){if(y===void 0)continue;if(y===null||typeof y!="object")throw new TypeError("Object expected");(u=s(y.get))&&(d.get=u),(u=s(y.set))&&(d.set=u),(u=s(y.init))&&o.unshift(u)}else(u=s(y))&&(a==="field"?o.unshift(u):d[l]=u)}c&&Object.defineProperty(c,r.name,d),f=!0},tr=function(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0},p5=function(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})},Xs=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Js=function(e,t,n,r,o){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?o.call(e,n):o?o.value=n:t.set(e,n),n},Yu;(function(e){e[e.RealTime=1]="RealTime",e[e.PreAlloc=2]="PreAlloc",e[e.Immutable=8]="Immutable",e[e.Append=16]="Append",e[e.Sync=32]="Sync",e[e.NoAtime=64]="NoAtime",e[e.NoDump=128]="NoDump",e[e.RtInherit=256]="RtInherit",e[e.ProjInherit=512]="ProjInherit",e[e.NoSymlinks=1024]="NoSymlinks",e[e.ExtSize=2048]="ExtSize",e[e.ExtSzInherit=4096]="ExtSzInherit",e[e.NoDefrag=8192]="NoDefrag",e[e.FileStream=16384]="FileStream",e[e.Dax=32768]="Dax",e[e.CowExtSize=65536]="CowExtSize",e[e.HasAttr=2147483648]="HasAttr"})(Yu||(Yu={}));let s0=(()=>{var e,t,n,r,o,i,s,a,l,c;let d=[Hi()],u,f=[],h,m=Ls,p,y=[],v=[],b,_=[],C=[],N,A=[],R=[],D,k=[],F=[],W,B=[],T=[],Q,K=[],Y=[];var ee=h=class extends m{get xflags(){return Xs(this,e,"f")}set xflags(G){Js(this,e,G,"f")}get extsize(){return Xs(this,t,"f")}set extsize(G){Js(this,t,G,"f")}get nextents(){return Xs(this,n,"f")}set nextents(G){Js(this,n,G,"f")}get projid(){return Xs(this,r,"f")}set projid(G){Js(this,r,G,"f")}get cowextsize(){return Xs(this,o,"f")}set cowextsize(G){Js(this,o,G,"f")}get pad(){return Xs(this,i,"f")}set pad(G){Js(this,i,G,"f")}constructor(G=wt(new Wt(he.EINVAL,"fsxattr must be initialized with an inode"))){super(new ArrayBuffer(zt(ee))),e.set(this,tr(this,y,void 0)),t.set(this,(tr(this,v),tr(this,_,void 0))),n.set(this,(tr(this,C),tr(this,A,void 0))),r.set(this,(tr(this,R),tr(this,k,void 0))),o.set(this,(tr(this,F),tr(this,B,void 0))),i.set(this,(tr(this,T),tr(this,K,[]))),tr(this,Y),this.extsize=G.size,this.nextents=1,this.projid=G.uid,this.cowextsize=G.size;for(const re of Object.keys(Cn))G.flags&Cn[re]&&re in Yu&&(this.xflags|=Yu[re])}};return e=new WeakMap,t=new WeakMap,n=new WeakMap,r=new WeakMap,o=new WeakMap,i=new WeakMap,p5(h,"fsxattr"),(()=>{var G;const re=typeof Symbol=="function"&&Symbol.metadata?Object.create((G=m[Symbol.metadata])!==null&&G!==void 0?G:null):void 0;p=[(G=We).uint32.bind(G)],b=[(s=We).uint32.bind(s)],N=[(a=We).uint32.bind(a)],D=[(l=We).uint32.bind(l)],W=[(c=We).uint32.bind(c)],Q=[We.char(8)],ss(h,null,p,{kind:"accessor",name:"xflags",static:!1,private:!1,access:{has:X=>"xflags"in X,get:X=>X.xflags,set:(X,J)=>{X.xflags=J}},metadata:re},y,v),ss(h,null,b,{kind:"accessor",name:"extsize",static:!1,private:!1,access:{has:X=>"extsize"in X,get:X=>X.extsize,set:(X,J)=>{X.extsize=J}},metadata:re},_,C),ss(h,null,N,{kind:"accessor",name:"nextents",static:!1,private:!1,access:{has:X=>"nextents"in X,get:X=>X.nextents,set:(X,J)=>{X.nextents=J}},metadata:re},A,R),ss(h,null,D,{kind:"accessor",name:"projid",static:!1,private:!1,access:{has:X=>"projid"in X,get:X=>X.projid,set:(X,J)=>{X.projid=J}},metadata:re},k,F),ss(h,null,W,{kind:"accessor",name:"cowextsize",static:!1,private:!1,access:{has:X=>"cowextsize"in X,get:X=>X.cowextsize,set:(X,J)=>{X.cowextsize=J}},metadata:re},B,T),ss(h,null,Q,{kind:"accessor",name:"pad",static:!1,private:!1,access:{has:X=>"pad"in X,get:X=>X.pad,set:(X,J)=>{X.pad=J}},metadata:re},K,Y),ss(null,u={value:h},d,{kind:"class",name:h.name,metadata:re},null,f),ee=h=u.value,re&&Object.defineProperty(h,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:re}),tr(h,f)})(),ee=h})();var a0;(function(e){e[e.SecureRm=1]="SecureRm",e[e.Undelete=2]="Undelete",e[e.Compress=4]="Compress",e[e.Sync=8]="Sync",e[e.Immutable=16]="Immutable",e[e.Append=32]="Append",e[e.NoDump=64]="NoDump",e[e.NoAtime=128]="NoAtime",e[e.Dirty=256]="Dirty",e[e.CompressBlk=512]="CompressBlk",e[e.NoCompress=1024]="NoCompress",e[e.Encrypt=2048]="Encrypt",e[e.Btree=4096]="Btree",e[e.Index=4096]="Index",e[e.IMagic=8192]="IMagic",e[e.JournalData=16384]="JournalData",e[e.NoTail=32768]="NoTail",e[e.DirSync=65536]="DirSync",e[e.TopDir=131072]="TopDir",e[e.HugeFile=262144]="HugeFile",e[e.Extent=524288]="Extent",e[e.Verity=1048576]="Verity",e[e.EaInode=2097152]="EaInode",e[e.EofBlocks=4194304]="EofBlocks",e[e.NoCow=8388608]="NoCow",e[e.Dax=33554432]="Dax",e[e.InlineData=268435456]="InlineData",e[e.ProjInherit=536870912]="ProjInherit",e[e.CaseFold=1073741824]="CaseFold",e[e.Reserved=2147483648]="Reserved"})(a0||(a0={}));var kt;(function(e){e[e.GetFlags=2148034049]="GetFlags",e[e.SetFlags=1074292226]="SetFlags",e[e.GetVersion=2148038145]="GetVersion",e[e.SetVersion=1074296322]="SetVersion",e[e.Fiemap=3223348747]="Fiemap",e[e.GetXattr=2149341215]="GetXattr",e[e.SetXattr=1075599392]="SetXattr",e[e.GetLabel=2164298801]="GetLabel",e[e.SetLabel=1090556978]="SetLabel",e[e.GetUUID=2148603136]="GetUUID",e[e.GetSysfsPath=2155943169]="GetSysfsPath"})(kt||(kt={}));var Ir;(function(e){e[e.GetFlags=2147771905]="GetFlags",e[e.SetFlags=1074030082]="SetFlags",e[e.GetVersion=2147776001]="GetVersion",e[e.SetVersion=1074034178]="SetVersion"})(Ir||(Ir={}));async function m5(e,t,...n){e=je(e);const{fs:r,path:o}=tt(e,this);try{const i=new ht(await r.stat(o));switch(t){case kt.GetFlags:case Ir.GetFlags:return i.flags;case kt.SetFlags:case Ir.SetFlags:i.flags=n[0],await r.touch(o,i);return;case kt.GetVersion:case Ir.GetVersion:return i.version;case kt.SetVersion:case Ir.SetVersion:i.version=n[0],await r.touch(o,i);return;case kt.Fiemap:break;case kt.GetXattr:return new s0(i);case kt.SetXattr:break;case kt.GetLabel:return r.label;case kt.SetLabel:r.label=n[0];return;case kt.GetUUID:return r.uuid;case kt.GetSysfsPath:return`/sys/fs/${r.name}/${r.uuid}`}}catch(i){throw fn(Object.assign(i,{syscall:"ioctl",path:e}))}throw me("ENOTSUP","ioctl",e)}function g5(e,t,...n){e=je(e);const{fs:r,path:o}=tt(e,this);try{const i=new ht(r.statSync(o));switch(t){case kt.GetFlags:case Ir.GetFlags:return i.flags;case kt.SetFlags:case Ir.SetFlags:i.flags=n[0],r.touchSync(o,i);return;case kt.GetVersion:case Ir.GetVersion:return i.version;case kt.SetVersion:case Ir.SetVersion:i.version=n[0],r.touchSync(o,i);return;case kt.Fiemap:break;case kt.GetXattr:return new s0(i);case kt.SetXattr:break;case kt.GetLabel:return r.label;case kt.SetLabel:r.label=n[0];return;case kt.GetUUID:return r.uuid;case kt.GetSysfsPath:return`/sys/fs/${r.name}/${r.uuid}`}}catch(i){throw fn(Object.assign(i,{syscall:"ioctl",path:e}))}throw me("ENOTSUP","ioctl",e)}const y5=[];function Qs(e,t,n,r){if(!t.startsWith("user.")&&!y5.includes(t))throw me("ENOTSUP",r,n)}async function w5(e,t,n={}){var r;e=je(e);const{fs:o,path:i}=tt(e,this);Qs(this,t,e,"xattr.get");const s=await o.stat(i).catch($t("xattr.get",e));if(!St(this,s,en))throw me("EACCES","xattr.get",e);(r=s.attributes)!==null&&r!==void 0||(s.attributes=new Yi);const a=s.attributes.get(t);if(!a)throw me("ENODATA","xattr.get",e);const l=ut.Buffer.from(a);return n.encoding=="buffer"||!n.encoding?l:l.toString(n.encoding)}function v5(e,t,n={}){var r;e=je(e),Qs(this,t,e,"xattr.get");const{fs:o,path:i}=tt(e,this);let s;try{s=o.statSync(i)}catch(c){throw fn(Object.assign(c,{path:e}))}if(!St(this,s,en))throw me("EACCES","xattr.get",e);(r=s.attributes)!==null&&r!==void 0||(s.attributes=new Yi);const a=s.attributes.get(t);if(!a)throw me("ENODATA","xattr.get",e);const l=ut.Buffer.from(a);return n.encoding=="buffer"||!n.encoding?l:l.toString(n.encoding)}async function b5(e,t,n,r={}){var o;e=je(e);const{fs:i,path:s}=tt(e,this);Qs(this,t,e,"xattr.set");const a=await i.stat(s).catch($t("xattr.set",e));if(!St(this,a,Gt))throw me("EACCES","xattr.set",e);(o=a.attributes)!==null&&o!==void 0||(a.attributes=new Yi);const l=a.attributes.get(t);if(r.create&&l)throw me("EEXIST","xattr.set",e);if(r.replace&&!l)throw me("ENODATA","xattr.set",e);a.attributes.set(t,ut.Buffer.from(n)),await i.touch(s,a).catch($t("xattr.set",e))}function _5(e,t,n,r={}){var o;e=je(e);const{fs:i,path:s}=tt(e,this);Qs(this,t,e,"xattr.set");let a;try{a=i.statSync(s)}catch(c){throw fn(Object.assign(c,{path:e}))}if(!St(this,a,Gt))throw me("EACCES","xattr.set",e);(o=a.attributes)!==null&&o!==void 0||(a.attributes=new Yi);const l=a.attributes.get(t);if(r.create&&l)throw me("EEXIST","xattr.set",e);if(r.replace&&!l)throw me("ENODATA","xattr.set",e);a.attributes.set(t,ut.Buffer.from(n));try{i.touchSync(s,a)}catch(c){throw fn(Object.assign(c,{path:e}))}}async function S5(e,t){var n;e=je(e);const{fs:r,path:o}=tt(e,this);Qs(this,t,e,"xattr.remove");const i=await r.stat(o).catch($t("xattr.remove",e));if(!St(this,i,Gt))throw me("EACCES","xattr.remove",e);if((n=i.attributes)!==null&&n!==void 0||(i.attributes=new Yi),!i.attributes.get(t))throw me("ENODATA","xattr.remove",e);i.attributes.remove(t),await r.touch(o,i)}function x5(e,t){var n;e=je(e);const{fs:r,path:o}=tt(e,this);Qs(this,t,e,"xattr.remove");let i;try{i=r.statSync(o)}catch(a){throw fn(Object.assign(a,{path:e}))}if(!St(this,i,Gt))throw me("EACCES","xattr.remove",e);if((n=i.attributes)!==null&&n!==void 0||(i.attributes=new Yi),!i.attributes.get(t))throw me("ENODATA","xattr.remove",e);i.attributes.remove(t);try{r.touchSync(o,i)}catch(a){throw fn(Object.assign(a,{path:e}))}}async function E5(e){e=je(e);const{fs:t,path:n}=tt(e,this),r=await t.stat(n).catch($t("xattr.list",e));return r.attributes?r.attributes.keys().toArray():[]}function C5(e){e=je(e);const{fs:t,path:n}=tt(e,this);let r;try{r=t.statSync(n)}catch(o){throw fn(Object.assign(o,{path:e}))}return r.attributes?r.attributes.keys().toArray():[]}const l0=Object.freeze(Object.defineProperty({__proto__:null,BigIntStatsFs:t2,Dir:rp,Dirent:ml,get IOC(){return kt},get IOC32(){return Ir},ReadStream:Xp,Stats:To,StatsFs:e2,WriteStream:Jp,access:QW,accessSync:k2,appendFile:PW,appendFileSync:_2,chmod:YW,chmodSync:M2,chown:HW,chownSync:T2,chroot:p2,close:TW,closeSync:Ki,constants:g_,copyFile:s5,copyFileSync:H_,cp:u5,cpSync:G_,createReadStream:n5,createWriteStream:r5,exists:bW,existsSync:Kh,fchmod:jW,fchmodSync:Qh,fchown:LW,fchownSync:Jh,fdatasync:IW,fdatasyncSync:C2,fstat:AW,fstatSync:S2,fsync:MW,fsyncSync:E2,ftruncate:DW,ftruncateSync:x2,futimes:FW,futimesSync:Zh,glob:h5,globSync:B2,ioctl:m5,ioctlSync:g5,lchmod:qW,lchmodSync:I2,lchown:GW,lchownSync:D2,link:WW,linkSync:P2,lopenSync:vu,lstat:SW,lstatSync:Xh,lutimes:XW,lutimesSync:O2,mkdir:zW,mkdirSync:ep,mkdtemp:i5,mkdtempSync:L2,mount:qh,open:CW,openAsBlob:f5,openSync:wu,opendir:c5,opendirSync:$2,promises:i0,read:kW,readFile:NW,readFileSync:z_,readSync:R2,readdir:BW,readdirSync:zs,readlink:UW,readlinkSync:tp,readv:a5,readvSync:j2,realpath:JW,realpathSync:li,rename:vW,renameSync:v2,rm:o5,rmSync:U_,rmdir:$W,rmdirSync:W_,stat:_W,statSync:Mr,statfs:d5,statfsSync:z2,symlink:VW,symlinkSync:A2,truncate:xW,truncateSync:b2,umount:k_,unlink:EW,unlinkSync:$_,unwatchFile:e5,utimes:KW,utimesSync:V_,watch:t5,watchFile:ZW,write:OW,writeFile:RW,writeFileSync:B_,writeSync:N2,writev:l5,writevSync:F2,xattr:Object.freeze(Object.defineProperty({__proto__:null,get:w5,getSync:v5,list:E5,listSync:C5,remove:S5,removeSync:x5,set:b5,setSync:_5},Symbol.toStringTag,{value:"Module"}))},Symbol.toStringTag,{value:"Module"}));function c0(e){return R$(e)||Ih(e)||e instanceof qi}async function u0(e,t=0){if(typeof e!="object"||e==null)throw cn(Ce("EINVAL","Invalid options on mount configuration"));if(!c0(e))throw cn(Ce("EINVAL","Invalid mount configuration"));if(e instanceof qi)return await e.ready(),e;Ih(e)&&(e={backend:e});for(const[o,i]of Object.entries(e))if(o!="backend"&&c0(i)){if(Mh("Resolving nested mount configuration: "+o),t>10)throw cn(Ce("EINVAL","Invalid configuration, too deep and possibly infinite"));e[o]=await u0(i,++t)}const{backend:n}=e;if(typeof n.isAvailable=="function"&&!await n.isAvailable(e))throw cn(Ce("EPERM","Backend not available: "+n.name));N$(n,e);const r=await n.create(e);return e.disableAsyncCache&&r.attributes.set("no_async_preload"),await r.ready(),r}Math.max(...["delete"].map(e=>e.length)),typeof SuppressedError=="function"&&SuppressedError;function N5(e){class t extends e{async done(){await this._promise}queueDone(){return this.done()}_async(r){this._promise=this._promise.then(()=>r)}constructor(...r){super(...r),this._promise=Promise.resolve(),this._isInitialized=!1,this._skippedCacheUpdates=0,this._patchAsync()}async ready(){if(await super.ready(),await this._promise,!(this._isInitialized||this.attributes.has("no_async_preload"))){if(this.checkSync(),await this._sync.ready(),this._sync instanceof Gh&&this instanceof Gh){const r=this._sync.transaction(),o=this.transaction(),i=[];for(const s of await o.keys())i.push(o.get(s).then(a=>r.setSync(s,a)));await Promise.all(i),this._isInitialized=!0;return}try{await this.crossCopy("/"),$i(`Skipped ${this._skippedCacheUpdates} updates to the sync cache during initialization`),this._isInitialized=!0}catch(r){throw this._isInitialized=!1,mr(r)}}}checkSync(){if(this.attributes.has("no_async_preload"))throw Ce("ENOTSUP","Sync preloading has been disabled for this async file system");if(!this._sync)throw mr(Ce("ENOTSUP","No sync cache is attached to this async file system"))}renameSync(r,o){this.checkSync(),this._sync.renameSync(r,o),this._async(this.rename(r,o))}statSync(r){return this.checkSync(),this._sync.statSync(r)}touchSync(r,o){this.checkSync(),this._sync.touchSync(r,o),this._async(this.touch(r,o))}createFileSync(r,o){return this.checkSync(),this._async(this.createFile(r,o)),this._sync.createFileSync(r,o)}unlinkSync(r){this.checkSync(),this._sync.unlinkSync(r),this._async(this.unlink(r))}rmdirSync(r){this.checkSync(),this._sync.rmdirSync(r),this._async(this.rmdir(r))}mkdirSync(r,o){return this.checkSync(),this._async(this.mkdir(r,o)),this._sync.mkdirSync(r,o)}readdirSync(r){return this.checkSync(),this._sync.readdirSync(r)}linkSync(r,o){this.checkSync(),this._sync.linkSync(r,o),this._async(this.link(r,o))}async sync(){this.checkSync(),this._sync.syncSync(),await this._promise}syncSync(){this.checkSync(),this._sync.syncSync()}existsSync(r){return this.checkSync(),this._sync.existsSync(r)}readSync(r,o,i,s){this.checkSync(),this._sync.readSync(r,o,i,s)}writeSync(r,o,i){this.checkSync(),this._sync.writeSync(r,o,i),this._async(this.write(r,o,i))}streamWrite(r,o){this.checkSync();const i=this._sync.streamWrite(r,o).getWriter(),s=super.streamWrite(r,o).getWriter();return new WritableStream({async write(a,l){await Promise.all([i.write(a),s.write(a)]).catch(l.error.bind(l))},async close(){await Promise.all([i.close(),s.close()])},async abort(a){await Promise.all([i.abort(a),s.abort(a)])}})}async crossCopy(r){this.checkSync();const o=await this.stat(r);if(!an(o)){this._sync.createFileSync(r,o);const s=new Uint8Array(o.size);await this.read(r,s,0,o.size),this._sync.writeSync(r,s,0),this._sync.touchSync(r,o);return}r!=="/"&&(this._sync.mkdirSync(r,o),this._sync.touchSync(r,o));const i=[];for(const s of await this.readdir(r))i.push(this.crossCopy(vt(r,s)));await Promise.all(i)}_patchAsync(){const r=Array.from(u$(this)).flatMap(Object.getOwnPropertyNames).filter(o=>typeof this[o]=="function"&&`${o}Sync`in this);$i("Async: patching methods: "+r.join(", "));for(const o of r){const i=this[o];this[o]=async(...s)=>{var a,l,c;const d=await i.apply(this,s),u=(a=new Error().stack)===null||a===void 0?void 0:a.split(`
|
|
20
|
+
`).slice(2).join(`
|
|
21
|
+
`);if(u!=null&&u.includes(`at <computed> [as ${o}]`)||u!=null&&u.includes(`${o}Sync `)||!u)return d;if(!this._isInitialized)return this._skippedCacheUpdates++,d;try{(c=(l=this._sync)===null||l===void 0?void 0:l[`${o}Sync`])===null||c===void 0||c.call(l,...s)}catch(f){throw cn(Ce(f.errno,f.message+" (Out of sync!)"))}return d}}}}return t}function R5(e){return typeof e=="object"&&e!=null&&"_zenfs"in e&&!!e._zenfs}function sm(e){const t=El.get(e);t&&(t.timeout&&(clearTimeout(t.timeout),typeof t.timeout=="object"&&t.timeout.unref()),t.fs._executors.delete(e),El.delete(e))}const El=new Map;function P5(e,{port:t,timeout:n=1e3,fs:r}){const o=`
|
|
22
|
+
`+new Error().stack.slice(6);if(!t)throw cn(Ce("EINVAL","Can not make an RPC request without a port"));const{resolve:i,reject:s,promise:a}=Promise.withResolvers(),l=Math.random().toString(16).slice(10),c=setTimeout(()=>{const u=cn(Ce("EIO","RPC Failed"));u.stack+=o,sm(l),s(u)},n),d={resolve:i,reject:s,promise:a,fs:r,timeout:c};return r._executors.set(l,d),El.set(l,d),t.postMessage({...e,_zenfs:!0,id:l,stack:o}),a}function A5(e,...t){return t.includes(e.method)}function T5(e){if(!R5(e))return;if(!El.has(e.id)){const r=cn(Ce("EIO","Invalid RPC id: "+e.id));throw r.stack+=e.stack,r}const{resolve:t,reject:n}=El.get(e.id);if(e.error){const r=Wt.fromJSON({code:"EIO",errno:he.EIO,...e.error});r.stack+=e.stack,sm(e.id),n(r);return}sm(e.id),t(A5(e,"stat","createFile","mkdir")?new ht(e.value):e.value)}function D5(e,t){if(!e)throw cn(Ce("EINVAL","Cannot attach to non-existent port"));Mh("Attached handler to port: "+t.name),e["on"in e?"on":"addEventListener"]("message",n=>{t(typeof n=="object"&&n!==null&&"data"in n?n.data:n)})}class M5 extends N5(qi){constructor(t){super(1886351988,"portfs"),this.options=t,this._executors=new Map,this._sync=Yh.create({label:"tmpfs:port"}),this.port=t.port,D5(this.port,T5)}rpc(t,...n){return P5({method:t,args:n},{...this.options,fs:this})}async ready(){await this.rpc("ready"),await super.ready()}rename(t,n){return this.rpc("rename",t,n)}async stat(t){const n=await this.rpc("stat",t);return n instanceof ht?n:new ht(n)}async touch(t,n){const r=n instanceof ht?n:new ht(n);await this.rpc("touch",t,new Uint8Array(r.buffer,r.byteOffset,r.byteLength))}async sync(){await this.rpc("sync");for(const t of this._executors.values())await t.promise.catch(()=>{})}async createFile(t,n){n instanceof ht&&(n=n.toJSON());const r=await this.rpc("createFile",t,n);return r instanceof ht?r:new ht(r)}unlink(t){return this.rpc("unlink",t)}rmdir(t){return this.rpc("rmdir",t)}async mkdir(t,n){n instanceof ht&&(n=n.toJSON());const r=await this.rpc("mkdir",t,n);return r instanceof ht?r:new ht(r)}readdir(t){return this.rpc("readdir",t)}exists(t){return this.rpc("exists",t)}link(t,n){return this.rpc("link",t,n)}async read(t,n,r,o){n.set(await this.rpc("read",t,n,r,o))}write(t,n,r){return this.rpc("write",t,n,r)}}C$("RPCPort",e=>typeof(e==null?void 0:e.postMessage)=="function");const d0=new Uint32Array(256);for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t=t&1?2197175160^t>>>1:t>>>1;d0[e]=t}function I5(e){let t=4294967295;for(let n=0;n<e.length;n++)t=t>>>8^d0[(t^e[n])&255];return(t^4294967295)>>>0}var Lt=function(e,t,n,r,o,i){function s(v){if(v!==void 0&&typeof v!="function")throw new TypeError("Function expected");return v}for(var a=r.kind,l=a==="getter"?"get":a==="setter"?"set":"value",c=!t&&e?r.static?e:e.prototype:null,d=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),u,f=!1,h=n.length-1;h>=0;h--){var m={};for(var p in r)m[p]=p==="access"?{}:r[p];for(var p in r.access)m.access[p]=r.access[p];m.addInitializer=function(v){if(f)throw new TypeError("Cannot add initializers after decoration has completed");i.push(s(v||null))};var y=(0,n[h])(a==="accessor"?{get:d.get,set:d.set}:d[l],m);if(a==="accessor"){if(y===void 0)continue;if(y===null||typeof y!="object")throw new TypeError("Object expected");(u=s(y.get))&&(d.get=u),(u=s(y.set))&&(d.set=u),(u=s(y.init))&&o.unshift(u)}else(u=s(y))&&(a==="field"?o.unshift(u):d[l]=u)}c&&Object.defineProperty(c,r.name,d),f=!0},He=function(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0};typeof SuppressedError=="function"&&SuppressedError;var am=function(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})},Xt=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Jt=function(e,t,n,r,o){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?o.call(e,n):o?o.value=n:t.set(e,n),n};const{format:O5}=new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:2,unit:"byte",unitDisplay:"narrow"});let k5=(()=>{var e,t,n,r,o,i,s;let a=[Hi(ks)],l,c=[],d,u=Ls,f,h=[],m=[],p,y=[],v=[],b,_=[],C=[],N,A=[],R=[];return d=class extends u{get id(){return Xt(this,e,"f")}set id(D){Jt(this,e,D,"f")}get offset_(){return Xt(this,t,"f")}set offset_(D){Jt(this,t,D,"f")}get offset(){return Xt(this,n,"f")}set offset(D){Jt(this,n,D,"f")}get size(){return Xt(this,r,"f")}set size(D){Jt(this,r,D,"f")}toString(){return`<MetadataEntry @ 0x${this.byteOffset.toString(16).padStart(8,"0")}>`}constructor(){super(...arguments),e.set(this,He(this,h,void 0)),t.set(this,(He(this,m),He(this,y,void 0))),n.set(this,(He(this,v),He(this,_,void 0))),r.set(this,(He(this,C),He(this,A,void 0))),He(this,R)}},e=new WeakMap,t=new WeakMap,n=new WeakMap,r=new WeakMap,am(d,"MetadataEntry"),(()=>{var D;const k=typeof Symbol=="function"&&Symbol.metadata?Object.create((D=u[Symbol.metadata])!==null&&D!==void 0?D:null):void 0;f=[(D=We).uint32.bind(D)],p=[(o=We).uint32.bind(o)],b=[(i=We).uint32.bind(i)],N=[(s=We).uint32.bind(s)],Lt(d,null,f,{kind:"accessor",name:"id",static:!1,private:!1,access:{has:F=>"id"in F,get:F=>F.id,set:(F,W)=>{F.id=W}},metadata:k},h,m),Lt(d,null,p,{kind:"accessor",name:"offset_",static:!1,private:!1,access:{has:F=>"offset_"in F,get:F=>F.offset_,set:(F,W)=>{F.offset_=W}},metadata:k},y,v),Lt(d,null,b,{kind:"accessor",name:"offset",static:!1,private:!1,access:{has:F=>"offset"in F,get:F=>F.offset,set:(F,W)=>{F.offset=W}},metadata:k},_,C),Lt(d,null,N,{kind:"accessor",name:"size",static:!1,private:!1,access:{has:F=>"size"in F,get:F=>F.size,set:(F,W)=>{F.size=W}},metadata:k},A,R),Lt(null,l={value:d},a,{kind:"class",name:d.name,metadata:k},null,c),d=l.value,k&&Object.defineProperty(d,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:k}),He(d,c)})(),d})();const L5=255,f0=5;let zo=(()=>{var e,t,n,r,o,i,s,a;let l=[Hi(ks)],c,d=[],u,f=Int32Array,h,m=[],p=[],y,v=[],b=[],_,C=[],N=[],A,R=[],D=[],k,F=[],W=[];var B=u=class extends f{get checksum(){return Xt(this,e,"f")}set checksum(T){Jt(this,e,T,"f")}get timestamp(){return Xt(this,t,"f")}set timestamp(T){Jt(this,t,T,"f")}get previous_offset(){return Xt(this,n,"f")}set previous_offset(T){Jt(this,n,T,"f")}get previous(){var T;if(this.previous_offset)return(T=this._previous)!==null&&T!==void 0||(this._previous=new B(this.buffer,this.previous_offset)),this._previous}get offsetHex(){return"0x"+this.byteOffset.toString(16).padStart(8,"0")}get items(){return Xt(this,r,"f")}set items(T){Jt(this,r,T,"f")}toString(T=!1){if(!T)return`<MetadataBlock @ ${this.offsetHex}>`;let Q=[`---- Metadata block at ${this.offsetHex} ----`,`Checksum: 0x${this.checksum.toString(16).padStart(8,"0")}`,`Last updated: ${new Date(Number(this.timestamp)).toLocaleString()}`,`Previous block: 0x${this.previous_offset.toString(16).padStart(8,"0")}`,"Entries:"].join(`
|
|
23
|
+
`);for(const K of this.items)K.offset&&(Q+=`
|
|
24
|
+
0x${K.id.toString(16).padStart(8,"0")}: ${O5(K.size).padStart(5)} at 0x${K.offset.toString(16).padStart(8,"0")}`);return Q}get locked(){return Xt(this,o,"f")}set locked(T){Jt(this,o,T,"f")}waitUnlocked(T=0){if(T>f0)throw mr(Ce("EBUSY",`sbfs: exceeded max attempts waiting for metadata block at ${this.offsetHex} to be unlocked`));const Q=this.length-1;if(Atomics.load(this,Q))switch(Atomics.wait(this,Q,1)){case"ok":break;case"not-equal":return T++,cn(`sbfs: waiting for metadata block at ${this.offsetHex} to be unlocked (${T}/${f0})`),this.waitUnlocked(T);case"timed-out":throw mr(Ce("EBUSY",`sbfs: timed out waiting for metadata block at ${this.offsetHex} to be unlocked`))}}lock(){this.waitUnlocked();const T=X$(this,"locked");Atomics.store(this,T,1);const Q=()=>{Atomics.store(this,T,0),Atomics.notify(this,T,1)};return Q[Symbol.dispose]=Q,Q}constructor(){super(...arguments),e.set(this,He(this,m,void 0)),t.set(this,(He(this,p),He(this,v,BigInt(Date.now())))),n.set(this,(He(this,b),He(this,C,void 0))),this._previous=He(this,N),r.set(this,He(this,R,void 0)),o.set(this,(He(this,D),He(this,F,void 0))),He(this,W)}};return e=new WeakMap,t=new WeakMap,n=new WeakMap,r=new WeakMap,o=new WeakMap,am(u,"MetadataBlock"),(()=>{var T;const Q=typeof Symbol=="function"&&Symbol.metadata?Object.create((T=f[Symbol.metadata])!==null&&T!==void 0?T:null):void 0;h=[(T=We).uint32.bind(T)],y=[(i=We).uint64.bind(i)],_=[(s=We).uint32.bind(s)],A=[du(k5,{length:L5})],k=[(a=We).int32.bind(a)],Lt(u,null,h,{kind:"accessor",name:"checksum",static:!1,private:!1,access:{has:K=>"checksum"in K,get:K=>K.checksum,set:(K,Y)=>{K.checksum=Y}},metadata:Q},m,p),Lt(u,null,y,{kind:"accessor",name:"timestamp",static:!1,private:!1,access:{has:K=>"timestamp"in K,get:K=>K.timestamp,set:(K,Y)=>{K.timestamp=Y}},metadata:Q},v,b),Lt(u,null,_,{kind:"accessor",name:"previous_offset",static:!1,private:!1,access:{has:K=>"previous_offset"in K,get:K=>K.previous_offset,set:(K,Y)=>{K.previous_offset=Y}},metadata:Q},C,N),Lt(u,null,A,{kind:"accessor",name:"items",static:!1,private:!1,access:{has:K=>"items"in K,get:K=>K.items,set:(K,Y)=>{K.items=Y}},metadata:Q},R,D),Lt(u,null,k,{kind:"accessor",name:"locked",static:!1,private:!1,access:{has:K=>"locked"in K,get:K=>K.locked,set:(K,Y)=>{K.locked=Y}},metadata:Q},F,W),Lt(null,c={value:u},l,{kind:"class",name:u.name,metadata:Q},null,d),B=u=c.value,Q&&Object.defineProperty(u,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:Q}),He(u,d)})(),B=u})();const h0=1651715706;(()=>{var e,t,n,r,o,i,s,a,l,c,d,u,f,h,m,p,y,v,b,_,C,N;let A=[Hi(ks)],R,D=[],k,F=Ls,W,B=[],T=[],Q,K=[],Y=[],ee,G=[],re=[],X,J=[],se=[],L,ne=[],fe=[],H,ae=[],V=[],de,ge=[],pe=[],oe,$=[],j=[],le,ve=[],we=[],M,q=[],te=[],Se,ue=[],ye=[],xe,Ae=[],Ze=[],P,S=[],E=[];var I=k=class extends F{constructor(...U){if(super(...U),e.set(this,He(this,B,void 0)),t.set(this,(He(this,T),He(this,K,void 0))),n.set(this,(He(this,Y),He(this,G,void 0))),r.set(this,(He(this,re),He(this,J,void 0))),o.set(this,(He(this,se),He(this,ne,void 0))),i.set(this,(He(this,fe),He(this,ae,void 0))),s.set(this,(He(this,V),He(this,ge,void 0))),a.set(this,(He(this,pe),He(this,$,void 0))),l.set(this,(He(this,j),He(this,ve,void 0))),c.set(this,(He(this,we),He(this,q,void 0))),d.set(this,(He(this,te),He(this,ue,void 0))),this.metadata=He(this,ye),u.set(this,He(this,Ae,void 0)),f.set(this,(He(this,Ze),He(this,S,void 0))),He(this,E),this.magic!=h0){En("sbfs: Invalid magic value, assuming this is a fresh super block");const ie=new zo(this.buffer,zt(I));Object.assign(this,{metadata:ie,metadata_offset:ie.byteOffset,used_bytes:BigInt(zt(I)+zt(zo)),total_bytes:BigInt(this.buffer.byteLength),magic:h0,version:1,inode_format:P_,metadata_block_size:zt(zo),uuid:p$(crypto.randomUUID())}),Ku(this),Ku(ie);return}if(this.checksum!==qu(this))throw mr(Ce("EIO","sbfs: checksum mismatch for super block"));if(this.metadata=new zo(this.buffer,this.metadata_offset),this.metadata.checksum!==qu(this.metadata))throw mr(Ce("EIO",`sbfs: checksum mismatch for metadata block (saved ${this.metadata.checksum.toString(16).padStart(8,"0")}, computed ${qu(this.metadata).toString(16).padStart(8,"0")})`));if(this.inode_format!=P_)throw mr(Ce("EIO","sbfs: inode format mismatch"));if(this.metadata_block_size!=zt(zo))throw mr(Ce("EIO","sbfs: metadata block size mismatch"))}get checksum(){return Xt(this,e,"f")}set checksum(U){Jt(this,e,U,"f")}get magic(){return Xt(this,t,"f")}set magic(U){Jt(this,t,U,"f")}get version(){return Xt(this,n,"f")}set version(U){Jt(this,n,U,"f")}get inode_format(){return Xt(this,r,"f")}set inode_format(U){Jt(this,r,U,"f")}get flags(){return Xt(this,o,"f")}set flags(U){Jt(this,o,U,"f")}get used_bytes(){return Xt(this,i,"f")}set used_bytes(U){Jt(this,i,U,"f")}get total_bytes(){return Xt(this,s,"f")}set total_bytes(U){Jt(this,s,U,"f")}get uuid(){return Xt(this,a,"f")}set uuid(U){Jt(this,a,U,"f")}get metadata_block_size(){return Xt(this,l,"f")}set metadata_block_size(U){Jt(this,l,U,"f")}get metadata_offset_(){return Xt(this,c,"f")}set metadata_offset_(U){Jt(this,c,U,"f")}get metadata_offset(){return Xt(this,d,"f")}set metadata_offset(U){Jt(this,d,U,"f")}get label(){return Xt(this,u,"f")}set label(U){Jt(this,u,U,"f")}get _padding(){return Xt(this,f,"f")}set _padding(U){Jt(this,f,U,"f")}rotateMetadata(){const U=new zo(this.buffer,Number(this.used_bytes));return U.previous_offset=this.metadata_offset,this.metadata=U,this.metadata_offset=U.byteOffset,Ku(U),this.used_bytes+=BigInt(zt(zo)),Ku(this),U}isUnused(U,ie){if(!ie)return!0;if(U+ie>this.total_bytes||U<zt(I))return!1;for(let Z=this.metadata;Z;Z=Z.previous){if(U<Z.byteOffset+zt(zo)&&U+ie>Z.byteOffset)return!1;for(const Re of Z.items)if(Re.offset&&(U>=Re.offset&&U<Re.offset+Re.size||U+ie>Re.offset&&U+ie<=Re.offset+Re.size||U<=Re.offset&&U+ie>=Re.offset+Re.size))return!1}return!0}};return e=new WeakMap,t=new WeakMap,n=new WeakMap,r=new WeakMap,o=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakMap,f=new WeakMap,am(k,"SuperBlock"),(()=>{var U;const ie=typeof Symbol=="function"&&Symbol.metadata?Object.create((U=F[Symbol.metadata])!==null&&U!==void 0?U:null):void 0;W=[(U=We).uint32.bind(U)],Q=[(h=We).uint32.bind(h)],ee=[(m=We).uint16.bind(m)],X=[(p=We).uint16.bind(p)],L=[(y=We).uint32.bind(y)],H=[(v=We).uint64.bind(v)],de=[(b=We).uint64.bind(b)],oe=[We.uint8(16)],le=[(_=We).uint32.bind(_)],M=[(C=We).uint32.bind(C)],Se=[(N=We).uint32.bind(N)],xe=[We.char(64)],P=[We.char(132)],Lt(k,null,W,{kind:"accessor",name:"checksum",static:!1,private:!1,access:{has:Z=>"checksum"in Z,get:Z=>Z.checksum,set:(Z,Re)=>{Z.checksum=Re}},metadata:ie},B,T),Lt(k,null,Q,{kind:"accessor",name:"magic",static:!1,private:!1,access:{has:Z=>"magic"in Z,get:Z=>Z.magic,set:(Z,Re)=>{Z.magic=Re}},metadata:ie},K,Y),Lt(k,null,ee,{kind:"accessor",name:"version",static:!1,private:!1,access:{has:Z=>"version"in Z,get:Z=>Z.version,set:(Z,Re)=>{Z.version=Re}},metadata:ie},G,re),Lt(k,null,X,{kind:"accessor",name:"inode_format",static:!1,private:!1,access:{has:Z=>"inode_format"in Z,get:Z=>Z.inode_format,set:(Z,Re)=>{Z.inode_format=Re}},metadata:ie},J,se),Lt(k,null,L,{kind:"accessor",name:"flags",static:!1,private:!1,access:{has:Z=>"flags"in Z,get:Z=>Z.flags,set:(Z,Re)=>{Z.flags=Re}},metadata:ie},ne,fe),Lt(k,null,H,{kind:"accessor",name:"used_bytes",static:!1,private:!1,access:{has:Z=>"used_bytes"in Z,get:Z=>Z.used_bytes,set:(Z,Re)=>{Z.used_bytes=Re}},metadata:ie},ae,V),Lt(k,null,de,{kind:"accessor",name:"total_bytes",static:!1,private:!1,access:{has:Z=>"total_bytes"in Z,get:Z=>Z.total_bytes,set:(Z,Re)=>{Z.total_bytes=Re}},metadata:ie},ge,pe),Lt(k,null,oe,{kind:"accessor",name:"uuid",static:!1,private:!1,access:{has:Z=>"uuid"in Z,get:Z=>Z.uuid,set:(Z,Re)=>{Z.uuid=Re}},metadata:ie},$,j),Lt(k,null,le,{kind:"accessor",name:"metadata_block_size",static:!1,private:!1,access:{has:Z=>"metadata_block_size"in Z,get:Z=>Z.metadata_block_size,set:(Z,Re)=>{Z.metadata_block_size=Re}},metadata:ie},ve,we),Lt(k,null,M,{kind:"accessor",name:"metadata_offset_",static:!1,private:!1,access:{has:Z=>"metadata_offset_"in Z,get:Z=>Z.metadata_offset_,set:(Z,Re)=>{Z.metadata_offset_=Re}},metadata:ie},q,te),Lt(k,null,Se,{kind:"accessor",name:"metadata_offset",static:!1,private:!1,access:{has:Z=>"metadata_offset"in Z,get:Z=>Z.metadata_offset,set:(Z,Re)=>{Z.metadata_offset=Re}},metadata:ie},ue,ye),Lt(k,null,xe,{kind:"accessor",name:"label",static:!1,private:!1,access:{has:Z=>"label"in Z,get:Z=>Z.label,set:(Z,Re)=>{Z.label=Re}},metadata:ie},Ae,Ze),Lt(k,null,P,{kind:"accessor",name:"_padding",static:!1,private:!1,access:{has:Z=>"_padding"in Z,get:Z=>Z._padding,set:(Z,Re)=>{Z._padding=Re}},metadata:ie},S,E),Lt(null,R={value:k},A,{kind:"class",name:k.name,metadata:ie},null,D),I=k=R.value,ie&&Object.defineProperty(k,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:ie}),He(k,D)})(),I=k})();function qu(e){return I5(new Uint8Array(e.buffer,e.byteOffset+4,zt(e)-4))}function Ku(e){e instanceof zo&&(e.timestamp=BigInt(Date.now())),e.checksum=qu(e)}typeof SuppressedError=="function"&&SuppressedError,globalThis.__zenfs__=l0;var nr=Uint8Array,Zs=Uint16Array,j5=Int32Array,p0=new nr([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),m0=new nr([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),F5=new nr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),g0=function(e,t){for(var n=new Zs(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var o=new j5(n[30]),r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)o[i]=i-n[r]<<5|r;return{b:n,r:o}},y0=g0(p0,2),w0=y0.b,$5=y0.r;w0[28]=258,$5[258]=28;for(var z5=g0(m0,0),B5=z5.b,lm=new Zs(32768),jt=0;jt<32768;++jt){var fi=(jt&43690)>>1|(jt&21845)<<1;fi=(fi&52428)>>2|(fi&13107)<<2,fi=(fi&61680)>>4|(fi&3855)<<4,lm[jt]=((fi&65280)>>8|(fi&255)<<8)>>1}for(var Cl=function(e,t,n){for(var r=e.length,o=0,i=new Zs(t);o<r;++o)e[o]&&++i[e[o]-1];var s=new Zs(t);for(o=1;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;var a;if(n){a=new Zs(1<<t);var l=15-t;for(o=0;o<r;++o)if(e[o])for(var c=o<<4|e[o],d=t-e[o],u=s[e[o]-1]++<<d,f=u|(1<<d)-1;u<=f;++u)a[lm[u]>>l]=c}else for(a=new Zs(r),o=0;o<r;++o)e[o]&&(a[o]=lm[s[e[o]-1]++]>>15-e[o]);return a},Nl=new nr(288),jt=0;jt<144;++jt)Nl[jt]=8;for(var jt=144;jt<256;++jt)Nl[jt]=9;for(var jt=256;jt<280;++jt)Nl[jt]=7;for(var jt=280;jt<288;++jt)Nl[jt]=8;for(var v0=new nr(32),jt=0;jt<32;++jt)v0[jt]=5;var W5=Cl(Nl,9,1),V5=Cl(v0,5,1),cm=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},Or=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},um=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},U5=function(e){return(e+7)/8|0},dm=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new nr(e.subarray(t,n))},H5=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],xr=function(e,t,n){var r=new Error(t||H5[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,xr),!n)throw r;return r},G5=function(e,t,n,r){var o=e.length,i=r?r.length:0;if(!o||t.f&&!t.l)return n||new nr(0);var s=!n,a=s||t.i!=2,l=t.i;s&&(n=new nr(o*3));var c=function(pe){var oe=n.length;if(pe>oe){var $=new nr(Math.max(oe*2,pe));$.set(n),n=$}},d=t.f||0,u=t.p||0,f=t.b||0,h=t.l,m=t.d,p=t.m,y=t.n,v=o*8;do{if(!h){d=Or(e,u,1);var b=Or(e,u+1,3);if(u+=3,b)if(b==1)h=W5,m=V5,p=9,y=5;else if(b==2){var A=Or(e,u,31)+257,R=Or(e,u+10,15)+4,D=A+Or(e,u+5,31)+1;u+=14;for(var k=new nr(D),F=new nr(19),W=0;W<R;++W)F[F5[W]]=Or(e,u+W*3,7);u+=R*3;for(var B=cm(F),T=(1<<B)-1,Q=Cl(F,B,1),W=0;W<D;){var K=Q[Or(e,u,T)];u+=K&15;var _=K>>4;if(_<16)k[W++]=_;else{var Y=0,ee=0;for(_==16?(ee=3+Or(e,u,3),u+=2,Y=k[W-1]):_==17?(ee=3+Or(e,u,7),u+=3):_==18&&(ee=11+Or(e,u,127),u+=7);ee--;)k[W++]=Y}}var G=k.subarray(0,A),re=k.subarray(A);p=cm(G),y=cm(re),h=Cl(G,p,1),m=Cl(re,y,1)}else xr(1);else{var _=U5(u)+4,C=e[_-4]|e[_-3]<<8,N=_+C;if(N>o){l&&xr(0);break}a&&c(f+C),n.set(e.subarray(_,N),f),t.b=f+=C,t.p=u=N*8,t.f=d;continue}if(u>v){l&&xr(0);break}}a&&c(f+131072);for(var X=(1<<p)-1,J=(1<<y)-1,se=u;;se=u){var Y=h[um(e,u)&X],L=Y>>4;if(u+=Y&15,u>v){l&&xr(0);break}if(Y||xr(2),L<256)n[f++]=L;else if(L==256){se=u,h=null;break}else{var ne=L-254;if(L>264){var W=L-257,fe=p0[W];ne=Or(e,u,(1<<fe)-1)+w0[W],u+=fe}var H=m[um(e,u)&J],ae=H>>4;H||xr(3),u+=H&15;var re=B5[ae];if(ae>3){var fe=m0[ae];re+=um(e,u)&(1<<fe)-1,u+=fe}if(u>v){l&&xr(0);break}a&&c(f+131072);var V=f+ne;if(f<re){var de=i-re,ge=Math.min(re,V);for(de+f<0&&xr(3);f<ge;++f)n[f]=r[de+f]}for(;f<V;++f)n[f]=n[f-re]}}t.l=h,t.p=se,t.b=f,t.f=d,h&&(d=1,t.m=p,t.d=m,t.n=y)}while(!d);return f!=n.length&&s?dm(n,0,f):n.subarray(0,f)},Y5=new nr(0),lo=function(e,t){return e[t]|e[t+1]<<8},kr=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},fm=function(e,t){return kr(e,t)+kr(e,t+4)*4294967296};function q5(e,t){return G5(e,{i:2},t.out,t.dictionary)}var hm=typeof TextDecoder<"u"&&new TextDecoder,K5=0;try{hm.decode(Y5,{stream:!0}),K5=1}catch{}var X5=function(e){for(var t="",n=0;;){var r=e[n++],o=(r>127)+(r>223)+(r>239);if(n+o>e.length)return{s:t,r:dm(e,n-1)};o?o==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):o&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};function J5(e,t){if(t){for(var n="",r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}else{if(hm)return hm.decode(e);var o=X5(e),i=o.s,n=o.r;return n.length&&xr(8),i}}var Q5=function(e,t){return t+30+lo(e,t+26)+lo(e,t+28)},Z5=function(e,t,n){var r=lo(e,t+28),o=J5(e.subarray(t+46,t+46+r),!(lo(e,t+8)&2048)),i=t+46+r,s=kr(e,t+20),a=n&&s==4294967295?e8(e,i):[s,kr(e,t+24),kr(e,t+42)],l=a[0],c=a[1],d=a[2];return[lo(e,t+10),l,c,o,i+lo(e,t+30)+lo(e,t+32),d]},e8=function(e,t){for(;lo(e,t)!=1;t+=4+lo(e,t+2));return[fm(e,t+12),fm(e,t+4),fm(e,t+20)]};function t8(e,t){for(var n={},r=e.length-22;kr(e,r)!=101010256;--r)(!r||e.length-r>65558)&&xr(13);var o=lo(e,r+8);if(!o)return{};var i=kr(e,r+16),s=i==4294967295||o==65535;if(s){var a=kr(e,r-12);s=kr(e,a)==101075792,s&&(o=kr(e,a+32),i=kr(e,a+48))}for(var l=0;l<o;++l){var c=Z5(e,i,s),d=c[0],u=c[1],f=c[2],h=c[3],m=c[4],p=c[5],y=Q5(e,p);i=m,d?d==8?n[h]=q5(e.subarray(y,y+u),{out:new nr(f)}):xr(14,"unknown compression type "+d):n[h]=dm(e,y,y+u)}return n}function co(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function b0(e,t){for(var n="",r=0,o=-1,i=0,s,a=0;a<=e.length;++a){if(a<e.length)s=e.charCodeAt(a);else{if(s===47)break;s=47}if(s===47){if(!(o===a-1||i===1))if(o!==a-1&&i===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){l===-1?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),o=a,i=0;continue}}else if(n.length===2||n.length===1){n="",r=0,o=a,i=0;continue}}t&&(n.length>0?n+="/..":n="..",r=2)}else n.length>0?n+="/"+e.slice(o+1,a):n=e.slice(o+1,a),r=a-o-1;o=a,i=0}else s===46&&i!==-1?++i:i=-1}return n}function n8(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+e+r:r}var ea={resolve:function(){for(var t="",n=!1,r,o=arguments.length-1;o>=-1&&!n;o--){var i;o>=0?i=arguments[o]:(r===void 0&&(r=process.cwd()),i=r),co(i),i.length!==0&&(t=i+"/"+t,n=i.charCodeAt(0)===47)}return t=b0(t,!n),n?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(co(t),t.length===0)return".";var n=t.charCodeAt(0)===47,r=t.charCodeAt(t.length-1)===47;return t=b0(t,!n),t.length===0&&!n&&(t="."),t.length>0&&r&&(t+="/"),n?"/"+t:t},isAbsolute:function(t){return co(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,n=0;n<arguments.length;++n){var r=arguments[n];co(r),r.length>0&&(t===void 0?t=r:t+="/"+r)}return t===void 0?".":ea.normalize(t)},relative:function(t,n){if(co(t),co(n),t===n||(t=ea.resolve(t),n=ea.resolve(n),t===n))return"";for(var r=1;r<t.length&&t.charCodeAt(r)===47;++r);for(var o=t.length,i=o-r,s=1;s<n.length&&n.charCodeAt(s)===47;++s);for(var a=n.length,l=a-s,c=i<l?i:l,d=-1,u=0;u<=c;++u){if(u===c){if(l>c){if(n.charCodeAt(s+u)===47)return n.slice(s+u+1);if(u===0)return n.slice(s+u)}else i>c&&(t.charCodeAt(r+u)===47?d=u:u===0&&(d=0));break}var f=t.charCodeAt(r+u),h=n.charCodeAt(s+u);if(f!==h)break;f===47&&(d=u)}var m="";for(u=r+d+1;u<=o;++u)(u===o||t.charCodeAt(u)===47)&&(m.length===0?m+="..":m+="/..");return m.length>0?m+n.slice(s+d):(s+=d,n.charCodeAt(s)===47&&++s,n.slice(s))},_makeLong:function(t){return t},dirname:function(t){if(co(t),t.length===0)return".";for(var n=t.charCodeAt(0),r=n===47,o=-1,i=!0,s=t.length-1;s>=1;--s)if(n=t.charCodeAt(s),n===47){if(!i){o=s;break}}else i=!1;return o===-1?r?"/":".":r&&o===1?"//":t.slice(0,o)},basename:function(t,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');co(t);var r=0,o=-1,i=!0,s;if(n!==void 0&&n.length>0&&n.length<=t.length){if(n.length===t.length&&n===t)return"";var a=n.length-1,l=-1;for(s=t.length-1;s>=0;--s){var c=t.charCodeAt(s);if(c===47){if(!i){r=s+1;break}}else l===-1&&(i=!1,l=s+1),a>=0&&(c===n.charCodeAt(a)?--a===-1&&(o=s):(a=-1,o=l))}return r===o?o=l:o===-1&&(o=t.length),t.slice(r,o)}else{for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===47){if(!i){r=s+1;break}}else o===-1&&(i=!1,o=s+1);return o===-1?"":t.slice(r,o)}},extname:function(t){co(t);for(var n=-1,r=0,o=-1,i=!0,s=0,a=t.length-1;a>=0;--a){var l=t.charCodeAt(a);if(l===47){if(!i){r=a+1;break}continue}o===-1&&(i=!1,o=a+1),l===46?n===-1?n=a:s!==1&&(s=1):n!==-1&&(s=-1)}return n===-1||o===-1||s===0||s===1&&n===o-1&&n===r+1?"":t.slice(n,o)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return n8("/",t)},parse:function(t){co(t);var n={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return n;var r=t.charCodeAt(0),o=r===47,i;o?(n.root="/",i=1):i=0;for(var s=-1,a=0,l=-1,c=!0,d=t.length-1,u=0;d>=i;--d){if(r=t.charCodeAt(d),r===47){if(!c){a=d+1;break}continue}l===-1&&(c=!1,l=d+1),r===46?s===-1?s=d:u!==1&&(u=1):s!==-1&&(u=-1)}return s===-1||l===-1||u===0||u===1&&s===l-1&&s===a+1?l!==-1&&(a===0&&o?n.base=n.name=t.slice(1,l):n.base=n.name=t.slice(a,l)):(a===0&&o?(n.name=t.slice(1,s),n.base=t.slice(1,l)):(n.name=t.slice(a,s),n.base=t.slice(a,l)),n.ext=t.slice(s,l)),a>0?n.dir=t.slice(0,a-1):o&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};ea.posix=ea;var _0=ea,pm={exports:{}};function S0(e){return Array.isArray(e)?e:[e]}const r8=void 0,mm="",x0=" ",gm="\\",o8=/^\s+$/,i8=/(?:[^\\]|^)\\$/,s8=/^\\!/,a8=/^\\#/,l8=/\r?\n/g,c8=/^\.*\/|^\.+$/,u8=/\/$/,ta="/";let E0="node-ignore";typeof Symbol<"u"&&(E0=Symbol.for("node-ignore"));const C0=E0,Rl=(e,t,n)=>(Object.defineProperty(e,t,{value:n}),n),d8=/([0-z])-([0-z])/g,N0=()=>!1,f8=e=>e.replace(d8,(t,n,r)=>n.charCodeAt(0)<=r.charCodeAt(0)?t:mm),h8=e=>{const{length:t}=e;return e.slice(0,t-t%2)},p8=[[/^\uFEFF/,()=>mm],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf("\\")===0?x0:mm)],[/(\\+?)\s/g,(e,t)=>{const{length:n}=t;return t.slice(0,n-n%2)+x0}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>{const r=n.replace(/\\\*/g,"[^\\/]*");return t+r}],[/\\\\\\(?=[$.|*+(){^])/g,()=>gm],[/\\\\/g,()=>gm],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,o)=>t===gm?`\\[${n}${h8(r)}${o}`:o==="]"&&r.length%2===0?`[${f8(n)}${r}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],m8=/(^|\\\/)?\\\*$/,Pl="regex",Xu="checkRegex",R0="_",g8={[Pl](e,t){return`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`},[Xu](e,t){return`${t?`${t}[^/]*`:"[^/]*"}(?=$|\\/$)`}},y8=e=>p8.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e),Ju=e=>typeof e=="string",w8=e=>e&&Ju(e)&&!o8.test(e)&&!i8.test(e)&&e.indexOf("#")!==0,v8=e=>e.split(l8).filter(Boolean);class b8{constructor(t,n,r,o,i,s){this.pattern=t,this.mark=n,this.negative=i,Rl(this,"body",r),Rl(this,"ignoreCase",o),Rl(this,"regexPrefix",s)}get regex(){const t=R0+Pl;return this[t]?this[t]:this._make(Pl,t)}get checkRegex(){const t=R0+Xu;return this[t]?this[t]:this._make(Xu,t)}_make(t,n){const r=this.regexPrefix.replace(m8,g8[t]),o=this.ignoreCase?new RegExp(r,"i"):new RegExp(r);return Rl(this,n,o)}}const _8=({pattern:e,mark:t},n)=>{let r=!1,o=e;o.indexOf("!")===0&&(r=!0,o=o.substr(1)),o=o.replace(s8,"!").replace(a8,"#");const i=y8(o);return new b8(e,t,o,n,r,i)};class S8{constructor(t){this._ignoreCase=t,this._rules=[]}_add(t){if(t&&t[C0]){this._rules=this._rules.concat(t._rules._rules),this._added=!0;return}if(Ju(t)&&(t={pattern:t}),w8(t.pattern)){const n=_8(t,this._ignoreCase);this._added=!0,this._rules.push(n)}}add(t){return this._added=!1,S0(Ju(t)?v8(t):t).forEach(this._add,this),this._added}test(t,n,r){let o=!1,i=!1,s;this._rules.forEach(l=>{const{negative:c}=l;i===c&&o!==i||c&&!o&&!i&&!n||!l[r].test(t)||(o=!c,i=c,s=c?r8:l)});const a={ignored:o,unignored:i};return s&&(a.rule=s),a}}const x8=(e,t)=>{throw new t(e)},Bo=(e,t,n)=>Ju(e)?e?Bo.isNotRelative(e)?n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:n("path must not be empty",TypeError):n(`path must be a string, but got \`${t}\``,TypeError),P0=e=>c8.test(e);Bo.isNotRelative=P0,Bo.convert=e=>e;class E8{constructor({ignorecase:t=!0,ignoreCase:n=t,allowRelativePaths:r=!1}={}){Rl(this,C0,!0),this._rules=new S8(n),this._strictPathCheck=!r,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(t){return this._rules.add(t)&&this._initCache(),this}addPattern(t){return this.add(t)}_test(t,n,r,o){const i=t&&Bo.convert(t);return Bo(i,t,this._strictPathCheck?x8:N0),this._t(i,n,r,o)}checkIgnore(t){if(!u8.test(t))return this.test(t);const n=t.split(ta).filter(Boolean);if(n.pop(),n.length){const r=this._t(n.join(ta)+ta,this._testCache,!0,n);if(r.ignored)return r}return this._rules.test(t,!1,Xu)}_t(t,n,r,o){if(t in n)return n[t];if(o||(o=t.split(ta).filter(Boolean)),o.pop(),!o.length)return n[t]=this._rules.test(t,r,Pl);const i=this._t(o.join(ta)+ta,n,r,o);return n[t]=i.ignored?i:this._rules.test(t,r,Pl)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return S0(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}}const ym=e=>new E8(e),C8=e=>Bo(e&&Bo.convert(e),e,N0);if(typeof process<"u"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){const e=n=>/^\\\\\?\\/.test(n)||/["<>|\u0000-\u001F]+/u.test(n)?n:n.replace(/\\/g,"/");Bo.convert=e;const t=/^[a-z]:\//i;Bo.isNotRelative=n=>t.test(n)||P0(n)}pm.exports=ym,ym.default=ym,pm.exports.isPathValid=C8;var N8=pm.exports;const R8=il(N8),P8=async e=>{try{return await(await window.pfs.stat(e)).isDirectory()}catch(t){if(t.code==="ENOENT")return!1;throw t}},A0=async e=>await window.pfs.readdir(e);var T0={exports:{}},Al={};/*
|
|
25
|
+
object-assign
|
|
26
|
+
(c) Sindre Sorhus
|
|
27
|
+
@license MIT
|
|
28
|
+
*/var D0=Object.getOwnPropertySymbols,A8=Object.prototype.hasOwnProperty,T8=Object.prototype.propertyIsEnumerable;function D8(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function M8(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(i){return t[i]});if(r.join("")!=="0123456789")return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(i){o[i]=i}),Object.keys(Object.assign({},o)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}M8();/** @license React v17.0.2
|
|
29
|
+
* react-jsx-runtime.production.min.js
|
|
30
|
+
*
|
|
31
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
32
|
+
*
|
|
33
|
+
* This source code is licensed under the MIT license found in the
|
|
34
|
+
* LICENSE file in the root directory of this source tree.
|
|
35
|
+
*/var I8=x,M0=60103;if(Al.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var I0=Symbol.for;M0=I0("react.element"),Al.Fragment=I0("react.fragment")}var O8=I8.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,k8=Object.prototype.hasOwnProperty,L8={key:!0,ref:!0,__self:!0,__source:!0};function O0(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)k8.call(t,r)&&!L8.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:M0,type:e,key:i,ref:s,props:o,_owner:O8.current}}Al.jsx=O0,Al.jsxs=O0,T0.exports=Al;var g=T0.exports;const j8=async e=>{let t=null,n=null;try{const r=e.replace(/import.*?;\n/g,""),o=Vb.transform(r,{presets:["react","typescript"],filename:"file.tsx"}).code,i=new Blob([o],{type:"text/javascript"});t=(await import(URL.createObjectURL(i))).component}catch(r){t=null,n=r.stack}return{compileError:n,compiledComponent:t}},F8=async e=>{let t=[];const n=await e.getComponentLibrary();if(n.status!==200)throw new Error("Could not load library components");let r=(await n.json()).components;for(const o in r)if(o==="example")for(const i of r[o]){let s=i.content["component.tsx"];s=s.replace(/import.*?;\n/g,"");let a=i.content["layout.json"];const l=Vb.transform(s,{presets:["react","typescript"],filename:"file.tsx"}).code,c=new Blob([l],{type:"text/javascript"}),f=(await import(URL.createObjectURL(c))).component;t.push({class:i.name,layout:JSON.parse(a),component:g.jsx(f,{})})}return t},k0=async e=>{let t=[],n=[];const r=`${window.miDir}/${e}`,o="src/ProjectComponents";let i=await A0(`${r}/${o}`);i=i.filter(s=>!(s.includes(".gitkeep")||s.includes("index.ts")));for(const s of i){let a=`${s.replace(o,"")}`,l=`${a}/component.tsx`,c=await window.pfs.readFile(`${r}/${o}/${l}`,"utf8");const{compileError:d,compiledComponent:u}=await j8(c);let f=`${a}/layout.json`;const h=await window.pfs.readFile(`${r}/${o}/${f}`,"utf8");let m={id:s,component:null};if(d){m={...m,overrides:{compileError:{message:d}}},t.push(m),n.push({...JSON.parse(h),i:s});continue}if(a.includes("Chart")){let p=`${a}/chart_config.json`;const y=await window.pfs.readFile(`${r}/${o}/${p}`,"utf8"),v=JSON.parse(y),b=u;m.component=g.jsx(b,{chartConfig:v})}else{const p=u;m.component=g.jsx(p,{})}t.push(m),n.push({...JSON.parse(h),i:s})}return{components:t,layout:n}},$8=async(e,t)=>{var d;const n={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp"},o=(await window.pfs.readdir(window.miDir)).find(u=>u.toLowerCase()===e.toLowerCase());if(!o)throw new Error(`Project "${e}" not found`);const i=`${window.miDir}/${o}/src/assets/images/${t}`,s=await window.pfs.readFile(i),a=Buffer.from(s).toString("base64"),l=((d=t.split(".").pop())==null?void 0:d.toLowerCase())||"";return`data:${n[l]??"image/jpeg"};base64,${a}`},L0=e=>{if(window.tailwind)window.tailwind.config=e;else throw new Error("Could not load tailwind theme: missing tailwind global.")},j0=(e,t)=>{const[n,r]=x.useState("");return x.useEffect(()=>{(async()=>{try{const i=await $8(e,t);r(i)}catch(i){console.error("Error fetching background image URL:",i)}})()},[e,t]),n},z8=(e,t=[])=>{const[n,r]=x.useState(null);return x.useEffect(()=>{(async()=>{r(null);try{const i=`${window.miDir}/${e}/metadata.json`;await window.pfs.readFile(i,"utf8").then(s=>{if(s instanceof Uint8Array)throw new Error("Expected string but received buffer (Uint8Array)");r(JSON.parse(s))})}catch(i){throw console.log("Error: can not read app metadata file."),i}})()},[e,...t]),n},B8=(e,t=[])=>{const[n,r]=x.useState(null);return x.useEffect(()=>{(async()=>{r(null);try{const i=`${window.miDir}/${e}/settings.json`;await window.pfs.readFile(i,"utf8").then(s=>{if(s instanceof Uint8Array)throw new Error("Expected string but received buffer (Uint8Array)");r(JSON.parse(s))})}catch(i){throw console.log("Error: can not read app settings file."),i}})()},[e,...t]),n},W8=(e,t,n=[])=>{const[r,o]=x.useState(null);return x.useEffect(()=>{(async()=>{o(null);const s=await vm(e,t);if(s){const a=s.filter(c=>c.tag==="published"),l=s.filter(c=>c.tag!=="published");o({publishedVersion:a.length?a[0]:null,versions:l})}})()},[e,t,...n]),r},V8=e=>typeof e=="string"?e:new TextDecoder("utf-8").decode(e),U8=e=>e.toLowerCase().endsWith(".zip"),Lr=e=>`${window.miDir}/${e}`,H8=async(e,t,n)=>{const r=t.endsWith("/"),o=_0.join(e,r?t.slice(0,-1):t);if(r){await window.pfs.mkdir(o,{recursive:!0});return}const i=_0.dirname(o);await window.pfs.mkdir(i,{recursive:!0}),await window.pfs.writeFile(o,n)},G8=async(e,t)=>{window.fs=l0,window.pfs=i0;try{await k_("/")}catch{}const n=await u0({backend:Yh});await qh("/",n);const r=Lr(e),o=await fetch(t);if(!o.ok)throw new Error(`Failed to fetch zip: ${o.status} ${o.statusText}`);const i=new Uint8Array(await o.arrayBuffer()),s=t8(i);for(const[a,l]of Object.entries(s)){const c=a.replace(/^\/+/,"").replace(/\\/g,"/");await H8(r,c,l)}await F0(e)},F0=async e=>{const t=window.pfs,n=Lr(e);await _t.setConfig({fs:t,dir:n,path:"user.name",value:"makeinfinite_client"}),await _t.setConfig({fs:t,dir:n,path:"user.email",value:"makeinfinite_client@spaceandtime.io"})},Y8=async e=>_t.resolveRef({fs:window.pfs,dir:Lr(e),ref:"refs/tags/published"}).then(t=>_t.checkout({fs:window.pfs,dir:Lr(e),ref:t}));class q8{constructor(t,n,r){this.targetRef=t,this.sourceRef=n,this.opType=r}}const wm=e=>{var s,a;const t=e.commit.message.trim().split(`
|
|
36
|
+
`),n=t.find(l=>l.startsWith("Git Ref: ")),r=t.find(l=>l.startsWith("Extra Metadata: "));if(!n||!r)return null;const o=(s=n.split("Git Ref: ")[1])==null?void 0:s.trim(),i=JSON.parse(((a=r.split("Extra Metadata: ")[1])==null?void 0:a.trim())||"{}");return!o||!i?null:new q8(o,i.sourceRef,i.opType)},K8=async e=>{const t=window.pfs,n=`${window.miDir}/${e}`;return await _t.resolveRef({fs:t,dir:n,ref:"HEAD"})},$0=async(e,t)=>{const n=window.pfs,r=`${window.miDir}/${e}`,o={fs:n,dir:r,ref:"HEAD",depth:1,filepath:t},i=(await _t.log(o))[0];if(!i)throw new Error("No commit found");return i.oid},Qu=async(e,t,n,r,o=new Set,i=1e3)=>{if(i<=0)throw new Error(`Maximum recursion depth reached while resolving commit: ${n}`);const s=window.pfs,a=`${window.miDir}/${e}`,l={fs:s,dir:a,ref:n,depth:1,filepath:t},c=(await _t.log(l))[0];if(!c)throw new Error("No commit found");if(o.has(c.oid))throw new Error(`Circular reference detected: ${c.oid} has already been seen`);o.add(c.oid);const d=wm(c);if(d&&d.opType==r)return Qu(e,t,d.targetRef,r,o,i-1);if(c.commit.parent.length>1){const u=c.commit.parent[0];if(!u)throw new Error("No parent found");return Qu(e,t,u,r,o,i-1)}return c},X8=async(e,t)=>{const n=window.pfs,r=`${window.miDir}/${e}`,o=await $0(e,t),i=await Qu(e,t,o,"UNDO"),s=wm(i);if(s)return[o,s.sourceRef];{let a=i.oid;const l={fs:n,dir:r,ref:a,depth:2,filepath:t},c=await _t.log(l);if(!c[1])throw new Error("No previous commit found");const d=c[1].oid;return[o,d]}},J8=async(e,t)=>{const n=await $0(e,t),r=await Qu(e,t,n,"REDO"),o=wm(r);if(!o)throw new Error("No undos to redo");return[n,o.sourceRef]},Q8=async(e,t)=>{try{await P8(Lr(e))?(await _t.fetch({fs:window.pfs,http:Ah,dir:Lr(e),url:t,ref:"main",tags:!0,pruneTags:!0}),await _t.fastForward({fs:window.pfs,http:Ah,dir:Lr(e),url:t,ref:"main"})):(await _t.clone({fs:window.pfs,http:Ah,dir:Lr(e),url:t,ref:"main"}),await F0(e))}catch(n){throw await window.fs.init("fs",{wipe:!0}),n}},Tl=async(e,t)=>{let r=0;for(;r<=5;)try{U8(t)?await G8(e,t):await Q8(e,t);return}catch(o){if(console.error("syncAndRetry error",o),r+=1,r>5)throw o}},vm=async(e,t,{fetch:n=!0}={})=>{n&&await Tl(e,t);const r=window.pfs,o=Lr(e);let i=await _t.listTags({fs:r,dir:o});return Promise.all(i.map(async s=>{const a=await _t.resolveRef({fs:r,dir:o,ref:`refs/tags/${s}`});let l;try{l=(await _t.readTag({fs:r,dir:o,oid:a})).tag.object}catch{l=a}const{commit:c}=await _t.readCommit({fs:r,dir:o,oid:a});return{tag:s,targetCommitTimestamp:c.committer.timestamp,targetCommit:l,ref:`refs/tags/${s}`}}))},Z8=async(e,t)=>_t.listFiles({fs:e,dir:t}).catch(()=>[]),e3=async(e,t,n)=>{const r=R8(),o=await t.readFile(`${n}/.sxtignore`,"utf8");return r.add(V8(o).split(`
|
|
37
|
+
`).map(i=>i.trim()).filter(i=>i)),r.filter(e)},t3=async(e,t)=>{await Tl(e,t);const n=window.pfs,r=Lr(e);return Z8(n,r)},n3=async(e,t,n)=>{try{const r=window.pfs,o=`${window.miDir}/${e}`;return await Tl(e,t),(await _t.log({fs:r,dir:o,depth:n,ref:"main"})).map(a=>{const{oid:l,commit:c}=a,d=c.message,u=d.toLowerCase().includes("release");return{hash:l,timestamp:c.committer.timestamp,message:d,isRelease:u}})}catch(r){throw console.error("Error in gitCommits:",r),r}},r3=async(e,t)=>_t.checkout({fs:window.pfs,dir:Lr(e),ref:t,force:!0});var z0={exports:{}},Et={};/** @license React v16.13.1
|
|
38
|
+
* react-is.production.min.js
|
|
39
|
+
*
|
|
40
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
41
|
+
*
|
|
42
|
+
* This source code is licensed under the MIT license found in the
|
|
43
|
+
* LICENSE file in the root directory of this source tree.
|
|
44
|
+
*/var hn=typeof Symbol=="function"&&Symbol.for,bm=hn?Symbol.for("react.element"):60103,_m=hn?Symbol.for("react.portal"):60106,Zu=hn?Symbol.for("react.fragment"):60107,ed=hn?Symbol.for("react.strict_mode"):60108,td=hn?Symbol.for("react.profiler"):60114,nd=hn?Symbol.for("react.provider"):60109,rd=hn?Symbol.for("react.context"):60110,Sm=hn?Symbol.for("react.async_mode"):60111,od=hn?Symbol.for("react.concurrent_mode"):60111,id=hn?Symbol.for("react.forward_ref"):60112,sd=hn?Symbol.for("react.suspense"):60113,o3=hn?Symbol.for("react.suspense_list"):60120,ad=hn?Symbol.for("react.memo"):60115,ld=hn?Symbol.for("react.lazy"):60116,i3=hn?Symbol.for("react.block"):60121,s3=hn?Symbol.for("react.fundamental"):60117,a3=hn?Symbol.for("react.responder"):60118,l3=hn?Symbol.for("react.scope"):60119;function rr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case bm:switch(e=e.type,e){case Sm:case od:case Zu:case td:case ed:case sd:return e;default:switch(e=e&&e.$$typeof,e){case rd:case id:case ld:case ad:case nd:return e;default:return t}}case _m:return t}}}function B0(e){return rr(e)===od}Et.AsyncMode=Sm,Et.ConcurrentMode=od,Et.ContextConsumer=rd,Et.ContextProvider=nd,Et.Element=bm,Et.ForwardRef=id,Et.Fragment=Zu,Et.Lazy=ld,Et.Memo=ad,Et.Portal=_m,Et.Profiler=td,Et.StrictMode=ed,Et.Suspense=sd,Et.isAsyncMode=function(e){return B0(e)||rr(e)===Sm},Et.isConcurrentMode=B0,Et.isContextConsumer=function(e){return rr(e)===rd},Et.isContextProvider=function(e){return rr(e)===nd},Et.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===bm},Et.isForwardRef=function(e){return rr(e)===id},Et.isFragment=function(e){return rr(e)===Zu},Et.isLazy=function(e){return rr(e)===ld},Et.isMemo=function(e){return rr(e)===ad},Et.isPortal=function(e){return rr(e)===_m},Et.isProfiler=function(e){return rr(e)===td},Et.isStrictMode=function(e){return rr(e)===ed},Et.isSuspense=function(e){return rr(e)===sd},Et.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Zu||e===od||e===td||e===ed||e===sd||e===o3||typeof e=="object"&&e!==null&&(e.$$typeof===ld||e.$$typeof===ad||e.$$typeof===nd||e.$$typeof===rd||e.$$typeof===id||e.$$typeof===s3||e.$$typeof===a3||e.$$typeof===l3||e.$$typeof===i3)},Et.typeOf=rr,z0.exports=Et;var xm=z0.exports;function c3(e){function t(se,L,ne,fe,H){for(var ae=0,V=0,de=0,ge=0,pe,oe,$=0,j=0,le,ve=le=pe=0,we=0,M=0,q=0,te=0,Se=ne.length,ue=Se-1,ye,xe="",Ae="",Ze="",P="",S;we<Se;){if(oe=ne.charCodeAt(we),we===ue&&V+ge+de+ae!==0&&(V!==0&&(oe=V===47?10:47),ge=de=ae=0,Se++,ue++),V+ge+de+ae===0){if(we===ue&&(0<M&&(xe=xe.replace(f,"")),0<xe.trim().length)){switch(oe){case 32:case 9:case 59:case 13:case 10:break;default:xe+=ne.charAt(we)}oe=59}switch(oe){case 123:for(xe=xe.trim(),pe=xe.charCodeAt(0),le=1,te=++we;we<Se;){switch(oe=ne.charCodeAt(we)){case 123:le++;break;case 125:le--;break;case 47:switch(oe=ne.charCodeAt(we+1)){case 42:case 47:e:{for(ve=we+1;ve<ue;++ve)switch(ne.charCodeAt(ve)){case 47:if(oe===42&&ne.charCodeAt(ve-1)===42&&we+2!==ve){we=ve+1;break e}break;case 10:if(oe===47){we=ve+1;break e}}we=ve}}break;case 91:oe++;case 40:oe++;case 34:case 39:for(;we++<ue&&ne.charCodeAt(we)!==oe;);}if(le===0)break;we++}switch(le=ne.substring(te,we),pe===0&&(pe=(xe=xe.replace(u,"").trim()).charCodeAt(0)),pe){case 64:switch(0<M&&(xe=xe.replace(f,"")),oe=xe.charCodeAt(1),oe){case 100:case 109:case 115:case 45:M=L;break;default:M=Y}if(le=t(L,M,le,oe,H+1),te=le.length,0<G&&(M=n(Y,xe,q),S=a(3,le,M,L,T,B,te,oe,H,fe),xe=M.join(""),S!==void 0&&(te=(le=S.trim()).length)===0&&(oe=0,le="")),0<te)switch(oe){case 115:xe=xe.replace(A,s);case 100:case 109:case 45:le=xe+"{"+le+"}";break;case 107:xe=xe.replace(b,"$1 $2"),le=xe+"{"+le+"}",le=K===1||K===2&&i("@"+le,3)?"@-webkit-"+le+"@"+le:"@"+le;break;default:le=xe+le,fe===112&&(le=(Ae+=le,""))}else le="";break;default:le=t(L,n(L,xe,q),le,fe,H+1)}Ze+=le,le=q=M=ve=pe=0,xe="",oe=ne.charCodeAt(++we);break;case 125:case 59:if(xe=(0<M?xe.replace(f,""):xe).trim(),1<(te=xe.length))switch(ve===0&&(pe=xe.charCodeAt(0),pe===45||96<pe&&123>pe)&&(te=(xe=xe.replace(" ",":")).length),0<G&&(S=a(1,xe,L,se,T,B,Ae.length,fe,H,fe))!==void 0&&(te=(xe=S.trim()).length)===0&&(xe="\0\0"),pe=xe.charCodeAt(0),oe=xe.charCodeAt(1),pe){case 0:break;case 64:if(oe===105||oe===99){P+=xe+ne.charAt(we);break}default:xe.charCodeAt(te-1)!==58&&(Ae+=o(xe,pe,oe,xe.charCodeAt(2)))}q=M=ve=pe=0,xe="",oe=ne.charCodeAt(++we)}}switch(oe){case 13:case 10:V===47?V=0:1+pe===0&&fe!==107&&0<xe.length&&(M=1,xe+="\0"),0<G*X&&a(0,xe,L,se,T,B,Ae.length,fe,H,fe),B=1,T++;break;case 59:case 125:if(V+ge+de+ae===0){B++;break}default:switch(B++,ye=ne.charAt(we),oe){case 9:case 32:if(ge+ae+V===0)switch($){case 44:case 58:case 9:case 32:ye="";break;default:oe!==32&&(ye=" ")}break;case 0:ye="\\0";break;case 12:ye="\\f";break;case 11:ye="\\v";break;case 38:ge+V+ae===0&&(M=q=1,ye="\f"+ye);break;case 108:if(ge+V+ae+Q===0&&0<ve)switch(we-ve){case 2:$===112&&ne.charCodeAt(we-3)===58&&(Q=$);case 8:j===111&&(Q=j)}break;case 58:ge+V+ae===0&&(ve=we);break;case 44:V+de+ge+ae===0&&(M=1,ye+="\r");break;case 34:case 39:V===0&&(ge=ge===oe?0:ge===0?oe:ge);break;case 91:ge+V+de===0&&ae++;break;case 93:ge+V+de===0&&ae--;break;case 41:ge+V+ae===0&&de--;break;case 40:if(ge+V+ae===0){if(pe===0)switch(2*$+3*j){case 533:break;default:pe=1}de++}break;case 64:V+de+ge+ae+ve+le===0&&(le=1);break;case 42:case 47:if(!(0<ge+ae+de))switch(V){case 0:switch(2*oe+3*ne.charCodeAt(we+1)){case 235:V=47;break;case 220:te=we,V=42}break;case 42:oe===47&&$===42&&te+2!==we&&(ne.charCodeAt(te+2)===33&&(Ae+=ne.substring(te,we+1)),ye="",V=0)}}V===0&&(xe+=ye)}j=$,$=oe,we++}if(te=Ae.length,0<te){if(M=L,0<G&&(S=a(2,Ae,M,se,T,B,te,fe,H,fe),S!==void 0&&(Ae=S).length===0))return P+Ae+Ze;if(Ae=M.join(",")+"{"+Ae+"}",K*Q!==0){switch(K!==2||i(Ae,2)||(Q=0),Q){case 111:Ae=Ae.replace(C,":-moz-$1")+Ae;break;case 112:Ae=Ae.replace(_,"::-webkit-input-$1")+Ae.replace(_,"::-moz-$1")+Ae.replace(_,":-ms-input-$1")+Ae}Q=0}}return P+Ae+Ze}function n(se,L,ne){var fe=L.trim().split(y);L=fe;var H=fe.length,ae=se.length;switch(ae){case 0:case 1:var V=0;for(se=ae===0?"":se[0]+" ";V<H;++V)L[V]=r(se,L[V],ne).trim();break;default:var de=V=0;for(L=[];V<H;++V)for(var ge=0;ge<ae;++ge)L[de++]=r(se[ge]+" ",fe[V],ne).trim()}return L}function r(se,L,ne){var fe=L.charCodeAt(0);switch(33>fe&&(fe=(L=L.trim()).charCodeAt(0)),fe){case 38:return L.replace(v,"$1"+se.trim());case 58:return se.trim()+L.replace(v,"$1"+se.trim());default:if(0<1*ne&&0<L.indexOf("\f"))return L.replace(v,(se.charCodeAt(0)===58?"":"$1")+se.trim())}return se+L}function o(se,L,ne,fe){var H=se+";",ae=2*L+3*ne+4*fe;if(ae===944){se=H.indexOf(":",9)+1;var V=H.substring(se,H.length-1).trim();return V=H.substring(0,se).trim()+V+";",K===1||K===2&&i(V,1)?"-webkit-"+V+V:V}if(K===0||K===2&&!i(H,1))return H;switch(ae){case 1015:return H.charCodeAt(10)===97?"-webkit-"+H+H:H;case 951:return H.charCodeAt(3)===116?"-webkit-"+H+H:H;case 963:return H.charCodeAt(5)===110?"-webkit-"+H+H:H;case 1009:if(H.charCodeAt(4)!==100)break;case 969:case 942:return"-webkit-"+H+H;case 978:return"-webkit-"+H+"-moz-"+H+H;case 1019:case 983:return"-webkit-"+H+"-moz-"+H+"-ms-"+H+H;case 883:if(H.charCodeAt(8)===45)return"-webkit-"+H+H;if(0<H.indexOf("image-set(",11))return H.replace(W,"$1-webkit-$2")+H;break;case 932:if(H.charCodeAt(4)===45)switch(H.charCodeAt(5)){case 103:return"-webkit-box-"+H.replace("-grow","")+"-webkit-"+H+"-ms-"+H.replace("grow","positive")+H;case 115:return"-webkit-"+H+"-ms-"+H.replace("shrink","negative")+H;case 98:return"-webkit-"+H+"-ms-"+H.replace("basis","preferred-size")+H}return"-webkit-"+H+"-ms-"+H+H;case 964:return"-webkit-"+H+"-ms-flex-"+H+H;case 1023:if(H.charCodeAt(8)!==99)break;return V=H.substring(H.indexOf(":",15)).replace("flex-","").replace("space-between","justify"),"-webkit-box-pack"+V+"-webkit-"+H+"-ms-flex-pack"+V+H;case 1005:return m.test(H)?H.replace(h,":-webkit-")+H.replace(h,":-moz-")+H:H;case 1e3:switch(V=H.substring(13).trim(),L=V.indexOf("-")+1,V.charCodeAt(0)+V.charCodeAt(L)){case 226:V=H.replace(N,"tb");break;case 232:V=H.replace(N,"tb-rl");break;case 220:V=H.replace(N,"lr");break;default:return H}return"-webkit-"+H+"-ms-"+V+H;case 1017:if(H.indexOf("sticky",9)===-1)break;case 975:switch(L=(H=se).length-10,V=(H.charCodeAt(L)===33?H.substring(0,L):H).substring(se.indexOf(":",7)+1).trim(),ae=V.charCodeAt(0)+(V.charCodeAt(7)|0)){case 203:if(111>V.charCodeAt(8))break;case 115:H=H.replace(V,"-webkit-"+V)+";"+H;break;case 207:case 102:H=H.replace(V,"-webkit-"+(102<ae?"inline-":"")+"box")+";"+H.replace(V,"-webkit-"+V)+";"+H.replace(V,"-ms-"+V+"box")+";"+H}return H+";";case 938:if(H.charCodeAt(5)===45)switch(H.charCodeAt(6)){case 105:return V=H.replace("-items",""),"-webkit-"+H+"-webkit-box-"+V+"-ms-flex-"+V+H;case 115:return"-webkit-"+H+"-ms-flex-item-"+H.replace(D,"")+H;default:return"-webkit-"+H+"-ms-flex-line-pack"+H.replace("align-content","").replace(D,"")+H}break;case 973:case 989:if(H.charCodeAt(3)!==45||H.charCodeAt(4)===122)break;case 931:case 953:if(F.test(se)===!0)return(V=se.substring(se.indexOf(":")+1)).charCodeAt(0)===115?o(se.replace("stretch","fill-available"),L,ne,fe).replace(":fill-available",":stretch"):H.replace(V,"-webkit-"+V)+H.replace(V,"-moz-"+V.replace("fill-",""))+H;break;case 962:if(H="-webkit-"+H+(H.charCodeAt(5)===102?"-ms-"+H:"")+H,ne+fe===211&&H.charCodeAt(13)===105&&0<H.indexOf("transform",10))return H.substring(0,H.indexOf(";",27)+1).replace(p,"$1-webkit-$2")+H}return H}function i(se,L){var ne=se.indexOf(L===1?":":"{"),fe=se.substring(0,L!==3?ne:10);return ne=se.substring(ne+1,se.length-1),re(L!==2?fe:fe.replace(k,"$1"),ne,L)}function s(se,L){var ne=o(L,L.charCodeAt(0),L.charCodeAt(1),L.charCodeAt(2));return ne!==L+";"?ne.replace(R," or ($1)").substring(4):"("+L+")"}function a(se,L,ne,fe,H,ae,V,de,ge,pe){for(var oe=0,$=L,j;oe<G;++oe)switch(j=ee[oe].call(d,se,$,ne,fe,H,ae,V,de,ge,pe)){case void 0:case!1:case!0:case null:break;default:$=j}if($!==L)return $}function l(se){switch(se){case void 0:case null:G=ee.length=0;break;default:if(typeof se=="function")ee[G++]=se;else if(typeof se=="object")for(var L=0,ne=se.length;L<ne;++L)l(se[L]);else X=!!se|0}return l}function c(se){return se=se.prefix,se!==void 0&&(re=null,se?typeof se!="function"?K=1:(K=2,re=se):K=0),c}function d(se,L){var ne=se;if(33>ne.charCodeAt(0)&&(ne=ne.trim()),J=ne,ne=[J],0<G){var fe=a(-1,L,ne,ne,T,B,0,0,0,0);fe!==void 0&&typeof fe=="string"&&(L=fe)}var H=t(Y,ne,L,0,0);return 0<G&&(fe=a(-2,H,ne,ne,T,B,H.length,0,0,0),fe!==void 0&&(H=fe)),J="",Q=0,B=T=1,H}var u=/^\0+/g,f=/[\0\r\f]/g,h=/: */g,m=/zoo|gra/,p=/([,: ])(transform)/g,y=/,\r+?/g,v=/([\t\r\n ])*\f?&/g,b=/@(k\w+)\s*(\S*)\s*/,_=/::(place)/g,C=/:(read-only)/g,N=/[svh]\w+-[tblr]{2}/,A=/\(\s*(.*)\s*\)/g,R=/([\s\S]*?);/g,D=/-self|flex-/g,k=/[^]*?(:[rp][el]a[\w-]+)[^]*/,F=/stretch|:\s*\w+\-(?:conte|avail)/,W=/([^-])(image-set\()/,B=1,T=1,Q=0,K=1,Y=[],ee=[],G=0,re=null,X=0,J="";return d.use=l,d.set=c,e!==void 0&&c(e),d}var u3={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function d3(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var f3=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,W0=d3(function(e){return f3.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),Em=xm,h3={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},p3={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},m3={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},V0={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Cm={};Cm[Em.ForwardRef]=m3,Cm[Em.Memo]=V0;function U0(e){return Em.isMemo(e)?V0:Cm[e.$$typeof]||h3}var g3=Object.defineProperty,y3=Object.getOwnPropertyNames,H0=Object.getOwnPropertySymbols,w3=Object.getOwnPropertyDescriptor,v3=Object.getPrototypeOf,G0=Object.prototype;function Y0(e,t,n){if(typeof t!="string"){if(G0){var r=v3(t);r&&r!==G0&&Y0(e,r,n)}var o=y3(t);H0&&(o=o.concat(H0(t)));for(var i=U0(e),s=U0(t),a=0;a<o.length;++a){var l=o[a];if(!p3[l]&&!(n&&n[l])&&!(s&&s[l])&&!(i&&i[l])){var c=w3(t,l);try{g3(e,l,c)}catch{}}}}return e}var b3=Y0;const _3=il(b3);function Wo(){return(Wo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var q0=function(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n},Nm=function(e){return e!==null&&typeof e=="object"&&(e.toString?e.toString():Object.prototype.toString.call(e))==="[object Object]"&&!xm.typeOf(e)},cd=Object.freeze([]),hi=Object.freeze({});function Dl(e){return typeof e=="function"}function K0(e){return e.displayName||e.name||"Component"}function Rm(e){return e&&typeof e.styledComponentId=="string"}var na=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",Pm=typeof window<"u"&&"HTMLElement"in window,S3=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==""?process.env.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&process.env.REACT_APP_SC_DISABLE_SPEEDY:process.env.SC_DISABLE_SPEEDY!==void 0&&process.env.SC_DISABLE_SPEEDY!==""&&process.env.SC_DISABLE_SPEEDY!=="false"&&process.env.SC_DISABLE_SPEEDY));function Ml(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(n.length>0?" Args: "+n.join(", "):""))}var x3=function(){function e(n){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=n}var t=e.prototype;return t.indexOfGroup=function(n){for(var r=0,o=0;o<n;o++)r+=this.groupSizes[o];return r},t.insertRules=function(n,r){if(n>=this.groupSizes.length){for(var o=this.groupSizes,i=o.length,s=i;n>=s;)(s<<=1)<0&&Ml(16,""+n);this.groupSizes=new Uint32Array(s),this.groupSizes.set(o),this.length=s;for(var a=i;a<s;a++)this.groupSizes[a]=0}for(var l=this.indexOfGroup(n+1),c=0,d=r.length;c<d;c++)this.tag.insertRule(l,r[c])&&(this.groupSizes[n]++,l++)},t.clearGroup=function(n){if(n<this.length){var r=this.groupSizes[n],o=this.indexOfGroup(n),i=o+r;this.groupSizes[n]=0;for(var s=o;s<i;s++)this.tag.deleteRule(o)}},t.getGroup=function(n){var r="";if(n>=this.length||this.groupSizes[n]===0)return r;for(var o=this.groupSizes[n],i=this.indexOfGroup(n),s=i+o,a=i;a<s;a++)r+=this.tag.getRule(a)+`/*!sc*/
|
|
45
|
+
`;return r},e}(),ud=new Map,dd=new Map,Il=1,fd=function(e){if(ud.has(e))return ud.get(e);for(;dd.has(Il);)Il++;var t=Il++;return ud.set(e,t),dd.set(t,e),t},E3=function(e){return dd.get(e)},C3=function(e,t){t>=Il&&(Il=t+1),ud.set(e,t),dd.set(t,e)},N3="style["+na+'][data-styled-version="5.3.11"]',R3=new RegExp("^"+na+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),P3=function(e,t,n){for(var r,o=n.split(","),i=0,s=o.length;i<s;i++)(r=o[i])&&e.registerName(t,r)},A3=function(e,t){for(var n=(t.textContent||"").split(`/*!sc*/
|
|
46
|
+
`),r=[],o=0,i=n.length;o<i;o++){var s=n[o].trim();if(s){var a=s.match(R3);if(a){var l=0|parseInt(a[1],10),c=a[2];l!==0&&(C3(c,l),P3(e,c,a[3]),e.getTag().insertRules(l,r)),r.length=0}else r.push(s)}}},T3=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null},X0=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(a){for(var l=a.childNodes,c=l.length;c>=0;c--){var d=l[c];if(d&&d.nodeType===1&&d.hasAttribute(na))return d}}(n),i=o!==void 0?o.nextSibling:null;r.setAttribute(na,"active"),r.setAttribute("data-styled-version","5.3.11");var s=T3();return s&&r.setAttribute("nonce",s),n.insertBefore(r,i),r},D3=function(){function e(n){var r=this.element=X0(n);r.appendChild(document.createTextNode("")),this.sheet=function(o){if(o.sheet)return o.sheet;for(var i=document.styleSheets,s=0,a=i.length;s<a;s++){var l=i[s];if(l.ownerNode===o)return l}Ml(17)}(r),this.length=0}var t=e.prototype;return t.insertRule=function(n,r){try{return this.sheet.insertRule(r,n),this.length++,!0}catch{return!1}},t.deleteRule=function(n){this.sheet.deleteRule(n),this.length--},t.getRule=function(n){var r=this.sheet.cssRules[n];return r!==void 0&&typeof r.cssText=="string"?r.cssText:""},e}(),M3=function(){function e(n){var r=this.element=X0(n);this.nodes=r.childNodes,this.length=0}var t=e.prototype;return t.insertRule=function(n,r){if(n<=this.length&&n>=0){var o=document.createTextNode(r),i=this.nodes[n];return this.element.insertBefore(o,i||null),this.length++,!0}return!1},t.deleteRule=function(n){this.element.removeChild(this.nodes[n]),this.length--},t.getRule=function(n){return n<this.length?this.nodes[n].textContent:""},e}(),I3=function(){function e(n){this.rules=[],this.length=0}var t=e.prototype;return t.insertRule=function(n,r){return n<=this.length&&(this.rules.splice(n,0,r),this.length++,!0)},t.deleteRule=function(n){this.rules.splice(n,1),this.length--},t.getRule=function(n){return n<this.length?this.rules[n]:""},e}(),J0=Pm,O3={isServer:!Pm,useCSSOMInjection:!S3},Q0=function(){function e(n,r,o){n===void 0&&(n=hi),r===void 0&&(r={}),this.options=Wo({},O3,{},n),this.gs=r,this.names=new Map(o),this.server=!!n.isServer,!this.server&&Pm&&J0&&(J0=!1,function(i){for(var s=document.querySelectorAll(N3),a=0,l=s.length;a<l;a++){var c=s[a];c&&c.getAttribute(na)!=="active"&&(A3(i,c),c.parentNode&&c.parentNode.removeChild(c))}}(this))}e.registerId=function(n){return fd(n)};var t=e.prototype;return t.reconstructWithOptions=function(n,r){return r===void 0&&(r=!0),new e(Wo({},this.options,{},n),this.gs,r&&this.names||void 0)},t.allocateGSInstance=function(n){return this.gs[n]=(this.gs[n]||0)+1},t.getTag=function(){return this.tag||(this.tag=(o=(r=this.options).isServer,i=r.useCSSOMInjection,s=r.target,n=o?new I3(s):i?new D3(s):new M3(s),new x3(n)));var n,r,o,i,s},t.hasNameForId=function(n,r){return this.names.has(n)&&this.names.get(n).has(r)},t.registerName=function(n,r){if(fd(n),this.names.has(n))this.names.get(n).add(r);else{var o=new Set;o.add(r),this.names.set(n,o)}},t.insertRules=function(n,r,o){this.registerName(n,r),this.getTag().insertRules(fd(n),o)},t.clearNames=function(n){this.names.has(n)&&this.names.get(n).clear()},t.clearRules=function(n){this.getTag().clearGroup(fd(n)),this.clearNames(n)},t.clearTag=function(){this.tag=void 0},t.toString=function(){return function(n){for(var r=n.getTag(),o=r.length,i="",s=0;s<o;s++){var a=E3(s);if(a!==void 0){var l=n.names.get(a),c=r.getGroup(s);if(l&&c&&l.size){var d=na+".g"+s+'[id="'+a+'"]',u="";l!==void 0&&l.forEach(function(f){f.length>0&&(u+=f+",")}),i+=""+c+d+'{content:"'+u+`"}/*!sc*/
|
|
47
|
+
`}}}return i}(this)},e}(),k3=/(a)(d)/gi,Z0=function(e){return String.fromCharCode(e+(e>25?39:97))};function Am(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Z0(t%52)+n;return(Z0(t%52)+n).replace(k3,"$1-$2")}var ra=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},eE=function(e){return ra(5381,e)};function L3(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(Dl(n)&&!Rm(n))return!1}return!0}var j3=eE("5.3.11"),F3=function(){function e(t,n,r){this.rules=t,this.staticRulesId="",this.isStatic=(r===void 0||r.isStatic)&&L3(t),this.componentId=n,this.baseHash=ra(j3,n),this.baseStyle=r,Q0.registerId(n)}return e.prototype.generateAndInjectStyles=function(t,n,r){var o=this.componentId,i=[];if(this.baseStyle&&i.push(this.baseStyle.generateAndInjectStyles(t,n,r)),this.isStatic&&!r.hash)if(this.staticRulesId&&n.hasNameForId(o,this.staticRulesId))i.push(this.staticRulesId);else{var s=oa(this.rules,t,n,r).join(""),a=Am(ra(this.baseHash,s)>>>0);if(!n.hasNameForId(o,a)){var l=r(s,"."+a,void 0,o);n.insertRules(o,a,l)}i.push(a),this.staticRulesId=a}else{for(var c=this.rules.length,d=ra(this.baseHash,r.hash),u="",f=0;f<c;f++){var h=this.rules[f];if(typeof h=="string")u+=h;else if(h){var m=oa(h,t,n,r),p=Array.isArray(m)?m.join(""):m;d=ra(d,p+f),u+=p}}if(u){var y=Am(d>>>0);if(!n.hasNameForId(o,y)){var v=r(u,"."+y,void 0,o);n.insertRules(o,y,v)}i.push(y)}}return i.join(" ")},e}(),$3=/^\s*\/\/.*$/gm,z3=[":","[",".","#"];function B3(e){var t,n,r,o,i=hi,s=i.options,a=s===void 0?hi:s,l=i.plugins,c=l===void 0?cd:l,d=new c3(a),u=[],f=function(p){function y(v){if(v)try{p(v+"}")}catch{}}return function(v,b,_,C,N,A,R,D,k,F){switch(v){case 1:if(k===0&&b.charCodeAt(0)===64)return p(b+";"),"";break;case 2:if(D===0)return b+"/*|*/";break;case 3:switch(D){case 102:case 112:return p(_[0]+b),"";default:return b+(F===0?"/*|*/":"")}case-2:b.split("/*|*/}").forEach(y)}}}(function(p){u.push(p)}),h=function(p,y,v){return y===0&&z3.indexOf(v[n.length])!==-1||v.match(o)?p:"."+t};function m(p,y,v,b){b===void 0&&(b="&");var _=p.replace($3,""),C=y&&v?v+" "+y+" { "+_+" }":_;return t=b,n=y,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),d(v||!y?"":y,C)}return d.use([].concat(c,[function(p,y,v){p===2&&v.length&&v[0].lastIndexOf(n)>0&&(v[0]=v[0].replace(r,h))},f,function(p){if(p===-2){var y=u;return u=[],y}}])),m.hash=c.length?c.reduce(function(p,y){return y.name||Ml(15),ra(p,y.name)},5381).toString():"",m}var tE=x.createContext();tE.Consumer;var nE=x.createContext(),W3=(nE.Consumer,new Q0),Tm=B3();function V3(){return x.useContext(tE)||W3}function U3(){return x.useContext(nE)||Tm}var H3=function(){function e(t,n){var r=this;this.inject=function(o,i){i===void 0&&(i=Tm);var s=r.name+i.hash;o.hasNameForId(r.id,s)||o.insertRules(r.id,s,i(r.rules,s,"@keyframes"))},this.toString=function(){return Ml(12,String(r.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=n}return e.prototype.getName=function(t){return t===void 0&&(t=Tm),this.name+t.hash},e}(),G3=/([A-Z])/,Y3=/([A-Z])/g,q3=/^ms-/,K3=function(e){return"-"+e.toLowerCase()};function rE(e){return G3.test(e)?e.replace(Y3,K3).replace(q3,"-ms-"):e}var oE=function(e){return e==null||e===!1||e===""};function oa(e,t,n,r){if(Array.isArray(e)){for(var o,i=[],s=0,a=e.length;s<a;s+=1)(o=oa(e[s],t,n,r))!==""&&(Array.isArray(o)?i.push.apply(i,o):i.push(o));return i}if(oE(e))return"";if(Rm(e))return"."+e.styledComponentId;if(Dl(e)){if(typeof(c=e)!="function"||c.prototype&&c.prototype.isReactComponent||!t)return e;var l=e(t);return oa(l,t,n,r)}var c;return e instanceof H3?n?(e.inject(n,r),e.getName(r)):e:Nm(e)?function d(u,f){var h,m,p=[];for(var y in u)u.hasOwnProperty(y)&&!oE(u[y])&&(Array.isArray(u[y])&&u[y].isCss||Dl(u[y])?p.push(rE(y)+":",u[y],";"):Nm(u[y])?p.push.apply(p,d(u[y],y)):p.push(rE(y)+": "+(h=y,(m=u[y])==null||typeof m=="boolean"||m===""?"":typeof m!="number"||m===0||h in u3||h.startsWith("--")?String(m).trim():m+"px")+";"));return f?[f+" {"].concat(p,["}"]):p}(e):e.toString()}var iE=function(e){return Array.isArray(e)&&(e.isCss=!0),e};function X3(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Dl(e)||Nm(e)?iE(oa(q0(cd,[e].concat(n)))):n.length===0&&e.length===1&&typeof e[0]=="string"?e:iE(oa(q0(e,n)))}var J3=function(e,t,n){return n===void 0&&(n=hi),e.theme!==n.theme&&e.theme||t||n.theme},Q3=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Z3=/(^-|-$)/g;function Dm(e){return e.replace(Q3,"-").replace(Z3,"")}var eV=function(e){return Am(eE(e)>>>0)};function hd(e){return typeof e=="string"&&!0}var Mm=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},tV=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function nV(e,t,n){var r=e[n];Mm(t)&&Mm(r)?sE(r,t):e[n]=t}function sE(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var o=0,i=n;o<i.length;o++){var s=i[o];if(Mm(s))for(var a in s)tV(a)&&nV(e,s[a],a)}return e}var aE=x.createContext();aE.Consumer;var Im={};function lE(e,t,n){var r=Rm(e),o=!hd(e),i=t.attrs,s=i===void 0?cd:i,a=t.componentId,l=a===void 0?function(b,_){var C=typeof b!="string"?"sc":Dm(b);Im[C]=(Im[C]||0)+1;var N=C+"-"+eV("5.3.11"+C+Im[C]);return _?_+"-"+N:N}(t.displayName,t.parentComponentId):a,c=t.displayName,d=c===void 0?function(b){return hd(b)?"styled."+b:"Styled("+K0(b)+")"}(e):c,u=t.displayName&&t.componentId?Dm(t.displayName)+"-"+t.componentId:t.componentId||l,f=r&&e.attrs?Array.prototype.concat(e.attrs,s).filter(Boolean):s,h=t.shouldForwardProp;r&&e.shouldForwardProp&&(h=t.shouldForwardProp?function(b,_,C){return e.shouldForwardProp(b,_,C)&&t.shouldForwardProp(b,_,C)}:e.shouldForwardProp);var m,p=new F3(n,u,r?e.componentStyle:void 0),y=p.isStatic&&s.length===0,v=function(b,_){return function(C,N,A,R){var D=C.attrs,k=C.componentStyle,F=C.defaultProps,W=C.foldedComponentIds,B=C.shouldForwardProp,T=C.styledComponentId,Q=C.target,K=function(fe,H,ae){fe===void 0&&(fe=hi);var V=Wo({},H,{theme:fe}),de={};return ae.forEach(function(ge){var pe,oe,$,j=ge;for(pe in Dl(j)&&(j=j(V)),j)V[pe]=de[pe]=pe==="className"?(oe=de[pe],$=j[pe],oe&&$?oe+" "+$:oe||$):j[pe]}),[V,de]}(J3(N,x.useContext(aE),F)||hi,N,D),Y=K[0],ee=K[1],G=function(fe,H,ae,V){var de=V3(),ge=U3(),pe=H?fe.generateAndInjectStyles(hi,de,ge):fe.generateAndInjectStyles(ae,de,ge);return pe}(k,R,Y),re=A,X=ee.$as||N.$as||ee.as||N.as||Q,J=hd(X),se=ee!==N?Wo({},N,{},ee):N,L={};for(var ne in se)ne[0]!=="$"&&ne!=="as"&&(ne==="forwardedAs"?L.as=se[ne]:(B?B(ne,W0,X):!J||W0(ne))&&(L[ne]=se[ne]));return N.style&&ee.style!==N.style&&(L.style=Wo({},N.style,{},ee.style)),L.className=Array.prototype.concat(W,T,G!==T?G:null,N.className,ee.className).filter(Boolean).join(" "),L.ref=re,x.createElement(X,L)}(m,b,_,y)};return v.displayName=d,(m=x.forwardRef(v)).attrs=f,m.componentStyle=p,m.displayName=d,m.shouldForwardProp=h,m.foldedComponentIds=r?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):cd,m.styledComponentId=u,m.target=r?e.target:e,m.withComponent=function(b){var _=t.componentId,C=function(A,R){if(A==null)return{};var D,k,F={},W=Object.keys(A);for(k=0;k<W.length;k++)D=W[k],R.indexOf(D)>=0||(F[D]=A[D]);return F}(t,["componentId"]),N=_&&_+"-"+(hd(b)?b:Dm(K0(b)));return lE(b,Wo({},C,{attrs:f,componentId:N}),n)},Object.defineProperty(m,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(b){this._foldedDefaultProps=r?sE({},e.defaultProps,b):b}}),Object.defineProperty(m,"toString",{value:function(){return"."+m.styledComponentId}}),o&&_3(m,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),m}var pi=function(e){return function t(n,r,o){if(o===void 0&&(o=hi),!xm.isValidElementType(r))return Ml(1,String(r));var i=function(){return n(r,o,X3.apply(void 0,arguments))};return i.withConfig=function(s){return t(n,r,Wo({},o,{},s))},i.attrs=function(s){return t(n,r,Wo({},o,{attrs:Array.prototype.concat(o.attrs,s).filter(Boolean)}))},i}(lE,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){pi[e]=pi(e)});const cE=x.createContext(null),uE=()=>{const e=x.useContext(cE);if(!e)throw new Error("useAPI must be used within an APIProvider");return e},rV=({children:e})=>{const[t,n]=x.useState(0),r=x.useCallback(async i=>{n(s=>s+1);try{return await i}finally{n(s=>Math.max(0,s-1))}},[]),o=x.useCallback(async(i,s)=>(n(a=>a+1),new Promise((a,l)=>{const c=i(),d=()=>{n(u=>Math.max(0,u-1))};c.addEventListener("load",()=>{if(d(),c.status>=200&&c.status<300)try{const u=s(c);a(u)}catch(u){l(u)}else l(new Error(`Request failed with status ${c.status}`))}),c.addEventListener("error",()=>{d(),l(new Error("Network error occurred"))}),c.addEventListener("abort",()=>{d(),l(new Error("Request cancelled"))})})),[]);return g.jsx(cE.Provider,{value:{isLoading:t>0,wrapAPICall:r,wrapXHRCall:o},children:e})},dE=x.createContext(null),Om=()=>{const e=x.useContext(dE);if(!e)throw new Error("useRGContext must be used within a RGProvider");return e},fE=e=>{const{children:t}=e,[n,r]=x.useState({w:1,h:1}),o=s=>{r(s)},i=()=>{r({w:1,h:1})};return g.jsx(dE.Provider,{value:{activeCompDimension:n,onDragStart:o,onDragStop:i},children:t})};for(var _n=[],km=0;km<256;++km)_n.push((km+256).toString(16).slice(1));function oV(e,t=0){return(_n[e[t+0]]+_n[e[t+1]]+_n[e[t+2]]+_n[e[t+3]]+"-"+_n[e[t+4]]+_n[e[t+5]]+"-"+_n[e[t+6]]+_n[e[t+7]]+"-"+_n[e[t+8]]+_n[e[t+9]]+"-"+_n[e[t+10]]+_n[e[t+11]]+_n[e[t+12]]+_n[e[t+13]]+_n[e[t+14]]+_n[e[t+15]]).toLowerCase()}var pd,iV=new Uint8Array(16);function sV(){if(!pd&&(pd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!pd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return pd(iV)}var aV=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const hE={randomUUID:aV};function pE(e,t,n){if(hE.randomUUID&&!e)return hE.randomUUID();e=e||{};var r=e.random||(e.rng||sV)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,oV(r)}const Lm=e=>{const t=e;return{createProject:async(F,W,B)=>{if(B){const T=new FormData;return T.append("description",F),T.append("theme",W),T.append("background_image",B),await fetch(`${t}/create_project`,{method:"POST",body:T})}else{const T={description:F,theme:W};return await fetch(`${t}/create_project`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)})}},createBlankProject:async(F,W,B)=>{if(B){const T=new FormData;return T.append("description",F),T.append("theme",W),T.append("background_image",B),await fetch(`${t}/create_blank_project`,{method:"POST",body:T})}else{const T={description:F,theme:W};return await fetch(`${t}/create_blank_project`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)})}},getProjects:async()=>await fetch(`${t}/fetch_projects`,{method:"GET",headers:{"Content-Type":"application/json"}}),getSubdomains:async F=>await fetch(`${t}/subdomains?project_name=${F}`,{method:"GET",headers:{"Content-Type":"application/json"}}),allocateSubdomain:async(F,W)=>{const B={project_name:F,subdomain:W};return await fetch(`${t}/allocate_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(B)})},updateSubdomain:async(F,W)=>{const B={project_name:F,subdomain:W};return await fetch(`${t}/update_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(B)})},releaseSubdomain:async(F,W)=>{const B={project_name:F,subdomain:W};return await fetch(`${t}/release_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(B)})},publishProject:async(F,W)=>{const B={project_name:F,git_ref:W};return await fetch(`${t}/publish_project`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(B)})},unpublishProject:async F=>{const W={project_name:F};return await fetch(`${t}/unpublish_project`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(W)})},tagCommit:async(F,W,B)=>{const T={project_name:F,commit_hash:W,tag_name:B};return await fetch(`${t}/tag_project_commit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)})},getComponentLibrary:async()=>await fetch(`${t}/library_components?namespaces=example`,{method:"GET",headers:{"Content-Type":"application/json"}}),addProjectComponent:async(F,W,B,T)=>{const Q={project_name:F,component_namespace:W,component_name:B,layout_metadata:T};return await fetch(`${t}/add_project_component`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Q)})},addProjectChart:async(F,W,B)=>{const T={project_name:F,visual_id:W,layout_metadata:B};return await fetch(`${t}/add_project_chart`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)})},updateProjectComponentLayoutMetadata:async(F,W,B)=>{const T={project_name:F,component_id:W,layout_metadata:B};return await fetch(`${t}/update_project_component_layout_metadata`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)})},updateProjectComponentSourceCode:async(F,W,B)=>{const T={project_name:F,component_id:W,source_code:B};return await fetch(`${t}/update_project_component_source_code`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)})},updateApplicationMetadata:async(F,W,B,T)=>{const Q={project_name:F,application_name:W,application_description:B,application_category:T};return await fetch(`${t}/update_application_metadata`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Q)})},updateApplicationSettings:async(F,W=null,B=null)=>{const T={project_name:F,application_login_enabled:W,default_deployment_chain_reference:B};return await fetch(`${t}/update_application_settings`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)})},updateProjectFile:async(F,W,B,T)=>{const Q={file_path:F,project_name:W,source_code:B};return await fetch(`${t}/update_project_file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Q),signal:T})},deleteProjectFile:async(F,W)=>{const B={project_name:F,file_path:W};return await fetch(`${t}/delete_project_file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(B)})},resetProjectFile:async(F,W,B,T,Q)=>{let K={project_name:F,file_path:W,git_ref:B};return T&&(K.prune=T),Q&&(K.extra_metadata=Q),await fetch(`${t}/reset_project_file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(K)})},deleteProject:async F=>{const W={projects:[F]};return await fetch(`${t}/delete_projects`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(W)})},requestErrorCorrection:async(F,W,B)=>{const T={project_name:F,component_id:W,error_message:B};return await fetch(`${t}/error_correction`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)})},addImage:async F=>await fetch(`${t}/add_image`,{method:"POST",body:F}),initializeProject:async F=>await fetch(`${t}/initialize_project/${F}`,{method:"POST",headers:{"Content-Type":"application/json"}})}},mE=e=>{const t=e;return{getQueryContent:async i=>await fetch(`${t}/v1/public/sql/content-queries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({queryId:i,biscuits:[]})}),getVisuals:async(i,s,a,l,c,d,u,f)=>{const h=new URLSearchParams({pageNo:i.toString(),pageSize:s.toString(),scope:a,searchPattern:l,sortBy:c,sortOrder:d,visibility:u,visualType:f}).toString();return await fetch(`${t}/v2/content/visuals?${h}`,{method:"GET",headers:{"Content-Type":"application/json"}})},getSubscription:async()=>await fetch(`${t}/v1/subscription`,{method:"GET",headers:{"Content-Type":"application/json"}})}},jm=e=>{const t=e;return{getSecrets:async()=>await fetch(`${t}/config/secrets`,{method:"GET",headers:{"Content-Type":"application/json"}}),putSecret:async(C,N)=>await fetch(`${t}/config/secrets/${C}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(N)}),getSecret:async C=>await fetch(`${t}/config/secrets/${C}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteSecret:async C=>await fetch(`${t}/config/secrets/${C}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),getTierKeyMap:async C=>await fetch(`${t}/config/miniapps/${C}/tier-key-map`,{method:"GET",headers:{"Content-Type":"application/json"}}),putTierKeyMap:async(C,N,A)=>await fetch(`${t}/config/miniapps/${C}/tier-key-map/${N}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({secret_reference:A})}),getTierKeyMapForTier:async(C,N)=>await fetch(`${t}/config/miniapps/${C}/tier-key-map/${N}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteTierKeyMap:async(C,N)=>await fetch(`${t}/config/miniapps/${C}/tier-key-map/${N}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),getTierAssignments:async C=>await fetch(`${t}/config/miniapps/${C}/assignments`,{method:"GET",headers:{"Content-Type":"application/json"}}),putTierAssignment:async(C,N,A)=>await fetch(`${t}/config/miniapps/${C}/assignments/${N}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tier:A})}),getTierAssignment:async(C,N)=>await fetch(`${t}/config/miniapps/${C}/assignments/${N}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteTierAssignment:async(C,N)=>await fetch(`${t}/config/miniapps/${C}/assignments/${N}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),getRateLimits:async C=>await fetch(`${t}/config/miniapps/${C}/rate-limits`,{method:"GET",headers:{"Content-Type":"application/json"}}),putRateLimit:async(C,N,A,R)=>await fetch(`${t}/config/miniapps/${C}/rate-limits/${N}/${A}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(R)}),getRateLimit:async(C,N,A)=>await fetch(`${t}/config/miniapps/${C}/rate-limits/${N}/${A}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteRateLimit:async(C,N,A)=>await fetch(`${t}/config/miniapps/${C}/rate-limits/${N}/${A}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),createProxyFetch:C=>async(N,A)=>{const R=N instanceof URL?N:new URL(N.toString());return await fetch(`${t}/proxy/${C.miniappName}/${R.host}${R.pathname}${R.search}${R.hash}`,A)},createProxyGetView:C=>{const N=new URL(C.gwProxyUrl).hostname;return async(A,R,D={})=>{let k=`SELECT * FROM ${A}.${R}`;D&&Object.keys(D).length>0&&(k+=`(${Object.entries(D).map(([B,T])=>`'${B}=${T}'`).join(",")})`);const F=await fetch(`${t}/proxy/${C.miniappName}/${N}/v1/sql/no-injected-authz`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sqlText:k})});if(!F.ok)throw new Error(`Failed to fetch view: ${F.statusText}`);return await F.json()}}}};function lV(e){return typeof e=="function"}const cV=e=>{const{wrapAPICall:t}=uE(),n=Lm(e);return new Proxy(n,{get:(o,i)=>{const s=o[i];return lV(s)?(...a)=>t(s.apply(o,a)):s}})},Fm=x.createContext(null);Fm.Consumer;const uV=e=>{const[t,n]=x.useState({projectName:null,projectURL:null}),[r,o]=x.useState({API_BASE_URL:null,WS_BASE_URL:null,GW_BASE_URL:null,GW_PROXY_URL:null,PROXY_API_BASE_URL:null}),[i,s]=x.useState(()=>mE(e.config.GW_BASE_URL)),[a,l]=x.useState(!1),[c,d]=x.useState(""),[u,f]=x.useState(""),[h,m]=x.useState(""),[p,y]=x.useState(pE()),v=cV(e.config.API_BASE_URL),b=Lm(e.config.API_BASE_URL),_=v||b,[C,N]=x.useState(()=>jm(e.config.PROXY_API_BASE_URL)),[A,R]=x.useState(null),[D,k]=x.useState(null),F=()=>{y(pE())};return x.useEffect(()=>{o(e==null?void 0:e.config)},[e.config]),x.useEffect(()=>{n(e==null?void 0:e.metadata)},[e.metadata]),x.useEffect(()=>{if(!(r!=null&&r.PROXY_API_BASE_URL)||!(r!=null&&r.GW_PROXY_URL)||!(t!=null&&t.projectName)){console.log("Missing required config for proxy setup");return}s(mE(r.GW_BASE_URL)),N(W=>{const B=jm(r.PROXY_API_BASE_URL),T=B.createProxyFetch({miniappName:t.projectName}),Q=async(ee,G)=>T(ee,G);R(()=>Q);const K=B.createProxyGetView({miniappName:t.projectName,gwProxyUrl:r.GW_PROXY_URL}),Y=async(ee,G,re={})=>{if(typeof ee!="string"||typeof G!="string")throw new Error(`Invalid parameters: schema and viewName must be strings. Got schema: ${typeof ee}, viewName: ${typeof G}`);return K(ee,G,re)};return k(()=>Y),B})},[r,t]),g.jsx(Fm.Provider,{value:{config:r,projectMetadata:t,setProjectMetadata:n,syncToken:p,setSyncToken:F,selectedComponentId:c,setSelectedComponentId:d,selectedComponentXPath:u,setSelectedComponentXPath:f,selectedComponentHTML:h,setSelectedComponentHTML:m,isComponentSubselected:a,setIsComponentSubselected:l,APIHandler:_,gwAPIHandler:i,proxyHandler:C,proxyFetch:A,proxyGetView:D},children:e.children})},dV=e=>g.jsx(rV,{children:g.jsx(fE,{children:g.jsx(uV,{...e})})}),$m=()=>{const e=x.useContext(Fm);if(e===null)throw new Error("Invalid project context.");return{...e}},fV=pi.div`
|
|
48
|
+
position: fixed;
|
|
49
|
+
top: 0;
|
|
50
|
+
left: 0;
|
|
51
|
+
width: 100%;
|
|
52
|
+
height: 100%;
|
|
53
|
+
background-color: rgba(0, 0, 0, 0.5); /* Darkened, transparent background */
|
|
54
|
+
display: flex;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
align-items: center;
|
|
57
|
+
z-index: 10000; /* Increased z-index to be higher than all other components (others use 9999) */
|
|
58
|
+
`,hV=pi.div`
|
|
59
|
+
border: 4px solid rgba(255, 255, 255, 0.3);
|
|
60
|
+
border-top: 4px solid white;
|
|
61
|
+
border-radius: 50%;
|
|
62
|
+
width: 40px;
|
|
63
|
+
height: 40px;
|
|
64
|
+
animation: spin 1s linear infinite;
|
|
65
|
+
|
|
66
|
+
@keyframes spin {
|
|
67
|
+
0% {
|
|
68
|
+
transform: rotate(0deg);
|
|
69
|
+
}
|
|
70
|
+
100% {
|
|
71
|
+
transform: rotate(360deg);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
`,pV=({isVisible:e})=>e?g.jsx(fV,{children:g.jsx(hV,{})}):null;var gE={exports:{}},Ol={},zm={exports:{}};(function(e,t){(function(n,r){r(t)})(Jc,function(n){function r(V){return function(ge,pe,oe,$,j,le,ve){return V(ge,pe,ve)}}function o(V){return function(ge,pe,oe,$){if(!ge||!pe||typeof ge!="object"||typeof pe!="object")return V(ge,pe,oe,$);var j=$.get(ge),le=$.get(pe);if(j&&le)return j===pe&&le===ge;$.set(ge,pe),$.set(pe,ge);var ve=V(ge,pe,oe,$);return $.delete(ge),$.delete(pe),ve}}function i(V,de){var ge={};for(var pe in V)ge[pe]=V[pe];for(var pe in de)ge[pe]=de[pe];return ge}function s(V){return V.constructor===Object||V.constructor==null}function a(V){return typeof V.then=="function"}function l(V,de){return V===de||V!==V&&de!==de}var c="[object Arguments]",d="[object Boolean]",u="[object Date]",f="[object RegExp]",h="[object Map]",m="[object Number]",p="[object Object]",y="[object Set]",v="[object String]",b=Object.prototype.toString;function _(V){var de=V.areArraysEqual,ge=V.areDatesEqual,pe=V.areMapsEqual,oe=V.areObjectsEqual,$=V.areRegExpsEqual,j=V.areSetsEqual,le=V.createIsNestedEqual,ve=le(we);function we(M,q,te){if(M===q)return!0;if(!M||!q||typeof M!="object"||typeof q!="object")return M!==M&&q!==q;if(s(M)&&s(q))return oe(M,q,ve,te);var Se=Array.isArray(M),ue=Array.isArray(q);if(Se||ue)return Se===ue&&de(M,q,ve,te);var ye=b.call(M);return ye!==b.call(q)?!1:ye===u?ge(M,q,ve,te):ye===f?$(M,q,ve,te):ye===h?pe(M,q,ve,te):ye===y?j(M,q,ve,te):ye===p||ye===c?a(M)||a(q)?!1:oe(M,q,ve,te):ye===d||ye===m||ye===v?l(M.valueOf(),q.valueOf()):!1}return we}function C(V,de,ge,pe){var oe=V.length;if(de.length!==oe)return!1;for(;oe-- >0;)if(!ge(V[oe],de[oe],oe,oe,V,de,pe))return!1;return!0}var N=o(C);function A(V,de){return l(V.valueOf(),de.valueOf())}function R(V,de,ge,pe){var oe=V.size===de.size;if(!oe)return!1;if(!V.size)return!0;var $={},j=0;return V.forEach(function(le,ve){if(oe){var we=!1,M=0;de.forEach(function(q,te){!we&&!$[M]&&(we=ge(ve,te,j,M,V,de,pe)&&ge(le,q,ve,te,V,de,pe))&&($[M]=!0),M++}),j++,oe=we}}),oe}var D=o(R),k="_owner",F=Object.prototype.hasOwnProperty;function W(V,de,ge,pe){var oe=Object.keys(V),$=oe.length;if(Object.keys(de).length!==$)return!1;for(var j;$-- >0;){if(j=oe[$],j===k){var le=!!V.$$typeof,ve=!!de.$$typeof;if((le||ve)&&le!==ve)return!1}if(!F.call(de,j)||!ge(V[j],de[j],j,j,V,de,pe))return!1}return!0}var B=o(W);function T(V,de){return V.source===de.source&&V.flags===de.flags}function Q(V,de,ge,pe){var oe=V.size===de.size;if(!oe)return!1;if(!V.size)return!0;var $={};return V.forEach(function(j,le){if(oe){var ve=!1,we=0;de.forEach(function(M,q){!ve&&!$[we]&&(ve=ge(j,M,le,q,V,de,pe))&&($[we]=!0),we++}),oe=ve}}),oe}var K=o(Q),Y=Object.freeze({areArraysEqual:C,areDatesEqual:A,areMapsEqual:R,areObjectsEqual:W,areRegExpsEqual:T,areSetsEqual:Q,createIsNestedEqual:r}),ee=Object.freeze({areArraysEqual:N,areDatesEqual:A,areMapsEqual:D,areObjectsEqual:B,areRegExpsEqual:T,areSetsEqual:K,createIsNestedEqual:r}),G=_(Y);function re(V,de){return G(V,de,void 0)}var X=_(i(Y,{createIsNestedEqual:function(){return l}}));function J(V,de){return X(V,de,void 0)}var se=_(ee);function L(V,de){return se(V,de,new WeakMap)}var ne=_(i(ee,{createIsNestedEqual:function(){return l}}));function fe(V,de){return ne(V,de,new WeakMap)}function H(V){return _(i(Y,V(Y)))}function ae(V){var de=_(i(ee,V(ee)));return function(ge,pe,oe){return oe===void 0&&(oe=new WeakMap),de(ge,pe,oe)}}n.circularDeepEqual=L,n.circularShallowEqual=fe,n.createCustomCircularEqual=ae,n.createCustomEqual=H,n.deepEqual=re,n.sameValueZeroEqual=l,n.shallowEqual=J,Object.defineProperty(n,"__esModule",{value:!0})})})(zm,zm.exports);var Bm=zm.exports;function yE(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=yE(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function md(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=yE(e))&&(r&&(r+=" "),r+=t);return r}const Wm=Qc(Object.freeze(Object.defineProperty({__proto__:null,clsx:md,default:md},Symbol.toStringTag,{value:"Module"})));var st={},mV=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)};Object.defineProperty(st,"__esModule",{value:!0}),st.bottom=Vm,st.childrenEqual=wV,st.cloneLayout=vE,st.cloneLayoutItem=as,st.collides=gd,st.compact=_E,st.compactItem=SE,st.compactType=PV,st.correctBounds=xE,st.fastPositionEqual=vV,st.fastRGLPropsEqual=void 0,st.getAllCollisions=EE,st.getFirstCollision=ls,st.getLayoutItem=Hm,st.getStatics=Gm,st.modifyLayout=bE,st.moveElement=Ll,st.moveElementAwayFromCollision=Ym,st.noop=void 0,st.perc=_V,st.resizeItemInDirection=xV,st.setTopLeft=CV,st.setTransform=EV,st.sortLayoutItems=Zm,st.sortLayoutItemsByColRow=AE,st.sortLayoutItemsByRowCol=PE,st.synchronizeLayoutWithChildren=NV,st.validateLayout=RV,st.withLayoutItem=yV;var wE=Bm,kl=gV(x);function gV(e){return e&&e.__esModule?e:{default:e}}function Vm(e){let t=0,n;for(let r=0,o=e.length;r<o;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function vE(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=as(e[n]);return t}function bE(e,t){const n=Array(e.length);for(let r=0,o=e.length;r<o;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function yV(e,t,n){let r=Hm(e,t);return r?(r=n(as(r)),e=bE(e,r),[e,r]):[e,null]}function as(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}function wV(e,t){return(0,wE.deepEqual)(kl.default.Children.map(e,n=>n==null?void 0:n.key),kl.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,wE.deepEqual)(kl.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),kl.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}st.fastRGLPropsEqual=mV;function vV(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function gd(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function _E(e,t,n,r){const o=Gm(e),i=Zm(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=as(i[a]);c.static||(c=SE(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const bV={x:"w",y:"h"};function Um(e,t,n,r){const o=bV[r];t[r]+=1;const i=e.map(s=>s.i).indexOf(t.i);for(let s=i+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;gd(t,a)&&Um(e,a,n+t[o],r)}}t[r]=n}function SE(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(Vm(e),t.y);t.y>0&&!ls(e,t);)t.y--;else if(a)for(;t.x>0&&!ls(e,t);)t.x--;let l;for(;(l=ls(e,t))&&!(n===null&&i);)if(a?Um(o,t,l.x+l.w,"x"):Um(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!ls(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function xE(e,t){const n=Gm(e);for(let r=0,o=e.length;r<o;r++){const i=e[r];if(i.x+i.w>t.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;ls(n,i);)i.y++}return e}function Hm(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function ls(e,t){for(let n=0,r=e.length;n<r;n++)if(gd(e[n],t))return e[n]}function EE(e,t){return e.filter(n=>gd(n,t))}function Gm(e){return e.filter(t=>t.static)}function Ll(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;`${t.i}${String(n)}${String(r)}${t.x}${t.y}`;const c=t.x,d=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let u=Zm(e,s);(s==="vertical"&&typeof r=="number"?d>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(u=u.reverse());const h=EE(u,t),m=h.length>0;if(m&&l)return vE(e);if(m&&i)return`${t.i}`,t.x=c,t.y=d,t.moved=!1,e;for(let p=0,y=h.length;p<y;p++){const v=h[p];`${t.i}${t.x}${t.y}${v.i}${v.x}${v.y}`,!v.moved&&(v.static?e=Ym(e,v,t,o,s):e=Ym(e,t,v,o,s))}return e}function Ym(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const u={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},f=ls(e,u),h=f&&f.y+f.h>t.y,m=f&&t.x+t.w>f.x;if(f){if(h&&a)return Ll(e,n,void 0,t.y+1,r,l,o);if(h&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(m&&s)return Ll(e,t,n.x,void 0,r,l,o)}else return`${n.i}${u.x}${u.y}`,Ll(e,n,s?u.x:void 0,a?u.y:void 0,r,l,o)}const c=s?n.x+1:void 0,d=a?n.y+1:void 0;return c==null&&d==null?e:Ll(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function _V(e){return e*100+"%"}const CE=(e,t,n,r)=>e+n>r?t:n,NE=(e,t,n)=>e<0?t:n,RE=e=>Math.max(0,e),qm=e=>Math.max(0,e),Km=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:NE(s,e.height,o),top:qm(s)}},Xm=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:CE(e.left,e.width,s,n),left:RE(o)}},Jm=(e,t,n)=>{let{top:r,height:o,width:i}=t;const s=e.left-(i-e.width);return{height:o,width:s<0?e.width:CE(e.left,e.width,i,n),top:qm(r),left:RE(s)}},Qm=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:NE(r,e.height,i),top:qm(r)}},SV={n:Km,ne:function(){return Km(arguments.length<=0?void 0:arguments[0],Xm(...arguments))},e:Xm,se:function(){return Qm(arguments.length<=0?void 0:arguments[0],Xm(...arguments))},s:Qm,sw:function(){return Qm(arguments.length<=0?void 0:arguments[0],Jm(...arguments))},w:Jm,nw:function(){return Km(arguments.length<=0?void 0:arguments[0],Jm(...arguments))}};function xV(e,t,n,r){const o=SV[e];return o?o(t,{...t,...n},r):n}function EV(e){let{top:t,left:n,width:r,height:o}=e;const i=`translate(${n}px,${t}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${r}px`,height:`${o}px`,position:"absolute"}}function CV(e){let{top:t,left:n,width:r,height:o}=e;return{top:`${t}px`,left:`${n}px`,width:`${r}px`,height:`${o}px`,position:"absolute"}}function Zm(e,t){return t==="horizontal"?AE(e):t==="vertical"?PE(e):e}function PE(e){return e.slice(0).sort(function(t,n){return t.y>n.y||t.y===n.y&&t.x>n.x?1:t.y===n.y&&t.x===n.x?0:-1})}function AE(e){return e.slice(0).sort(function(t,n){return t.x>n.x||t.x===n.x&&t.y>n.y?1:-1})}function NV(e,t,n,r,o){e=e||[];const i=[];kl.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=Hm(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(as(l)):c?i.push(as({...c,i:a.key})):i.push(as({w:1,h:1,x:0,y:Vm(i),i:String(a.key)}))});const s=xE(i,{cols:n});return o?s:_E(s,r,n)}function RV(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,o=e.length;r<o;r++){const i=e[r];for(let s=0;s<n.length;s++){const a=n[s],l=i[a];if(typeof l!="number"||Number.isNaN(l))throw new Error(`ReactGridLayout: ${t}[${r}].${a} must be a number! Received: ${l} (${typeof l})`)}if(typeof i.i<"u"&&typeof i.i!="string")throw new Error(`ReactGridLayout: ${t}[${r}].i must be a string! Received: ${i.i} (${typeof i.i})`)}}function PV(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}function tae(){}const AV=()=>{};st.noop=AV;var uo={};Object.defineProperty(uo,"__esModule",{value:!0}),uo.calcGridColWidth=yd,uo.calcGridItemPosition=TV,uo.calcGridItemWHPx=eg,uo.calcWH=MV,uo.calcXY=DV,uo.clamp=cs;function yd(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function eg(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function TV(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=yd(e),d={};return i&&i.resizing?(d.width=Math.round(i.resizing.width),d.height=Math.round(i.resizing.height)):(d.width=eg(r,c,s[0]),d.height=eg(o,l,s[1])),i&&i.dragging?(d.top=Math.round(i.dragging.top),d.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(d.top=Math.round(i.resizing.top),d.left=Math.round(i.resizing.left)):(d.top=Math.round((l+s[1])*n+a[1]),d.left=Math.round((c+s[0])*t+a[0])),d}function DV(e,t,n,r,o){const{margin:i,containerPadding:s,cols:a,rowHeight:l,maxRows:c}=e,d=yd(e);let u=Math.round((n-s[0])/(d+i[0])),f=Math.round((t-s[1])/(l+i[1]));return u=cs(u,0,a-r),f=cs(f,0,c-o),{x:u,y:f}}function MV(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,d=yd(e);let u=Math.round((t+s[0])/(d+s[0])),f=Math.round((n+s[1])/(c+s[1])),h=cs(u,0,l-r),m=cs(f,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(h=cs(u,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(m=cs(f,0,a)),{w:h,h:m}}function cs(e,t,n){return Math.max(Math.min(e,n),t)}var wd={},TE={exports:{}},IV="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",OV=IV,kV=OV;function DE(){}function ME(){}ME.resetWarningCache=DE;var LV=function(){function e(r,o,i,s,a,l){if(l!==kV){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:ME,resetWarningCache:DE};return n.PropTypes=n,n};TE.exports=LV();var mi=TE.exports,vd={exports:{}},IE={};function OE(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=OE(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function kE(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=OE(e))&&(r&&(r+=" "),r+=t);return r}const jV=Qc(Object.freeze(Object.defineProperty({__proto__:null,clsx:kE,default:kE},Symbol.toStringTag,{value:"Module"})));var Qt={},fo={};Object.defineProperty(fo,"__esModule",{value:!0}),fo.dontSetMe=WV,fo.findInArray=FV,fo.int=BV,fo.isFunction=$V,fo.isNum=zV;function FV(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function $V(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function zV(e){return typeof e=="number"&&!isNaN(e)}function BV(e){return parseInt(e,10)}function WV(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}var us={};Object.defineProperty(us,"__esModule",{value:!0}),us.browserPrefixToKey=jE,us.browserPrefixToStyle=VV,us.default=void 0,us.getPrefix=LE;const tg=["Moz","Webkit","O","ms"];function LE(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;r<tg.length;r++)if(jE(t,tg[r])in n)return tg[r];return""}function jE(e,t){return t?"".concat(t).concat(UV(e)):e}function VV(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function UV(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}us.default=LE(),Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.addClassName=BE,Qt.addEvent=YV,Qt.addUserSelectStyles=oU,Qt.createCSSTransform=eU,Qt.createSVGTransform=tU,Qt.getTouch=nU,Qt.getTouchIdentifier=rU,Qt.getTranslation=ng,Qt.innerHeight=JV,Qt.innerWidth=QV,Qt.matchesSelector=zE,Qt.matchesSelectorAndParentsTo=GV,Qt.offsetXYFromParent=ZV,Qt.outerHeight=KV,Qt.outerWidth=XV,Qt.removeClassName=WE,Qt.removeEvent=qV,Qt.removeUserSelectStyles=iU;var or=fo,FE=HV(us);function $E(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return($E=function(r){return r?n:t})(e)}function HV(e,t){if(e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=$E(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}let bd="";function zE(e,t){return bd||(bd=(0,or.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,or.isFunction)(e[n])})),(0,or.isFunction)(e[bd])?e[bd](t):!1}function GV(e,t,n){let r=e;do{if(zE(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function YV(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function qV(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function KV(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,or.int)(n.borderTopWidth),t+=(0,or.int)(n.borderBottomWidth),t}function XV(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,or.int)(n.borderLeftWidth),t+=(0,or.int)(n.borderRightWidth),t}function JV(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,or.int)(n.paddingTop),t-=(0,or.int)(n.paddingBottom),t}function QV(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,or.int)(n.paddingLeft),t-=(0,or.int)(n.paddingRight),t}function ZV(e,t,n){const o=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-o.left)/n,s=(e.clientY+t.scrollTop-o.top)/n;return{x:i,y:s}}function eU(e,t){const n=ng(e,t,"px");return{[(0,FE.browserPrefixToKey)("transform",FE.default)]:n}}function tU(e,t){return ng(e,t,"")}function ng(e,t,n){let{x:r,y:o}=e,i="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(t){const s="".concat(typeof t.x=="string"?t.x:t.x+n),a="".concat(typeof t.y=="string"?t.y:t.y+n);i="translate(".concat(s,", ").concat(a,")")+i}return i}function nU(e,t){return e.targetTouches&&(0,or.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,or.findInArray)(e.changedTouches,n=>t===n.identifier)}function rU(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function oU(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
75
|
+
`,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
76
|
+
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&BE(e.body,"react-draggable-transparent-selection")}function iU(e){if(e)try{if(e.body&&WE(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function BE(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function WE(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var ho={};Object.defineProperty(ho,"__esModule",{value:!0}),ho.canDragX=lU,ho.canDragY=cU,ho.createCoreData=dU,ho.createDraggableData=fU,ho.getBoundPosition=sU,ho.getControlPosition=uU,ho.snapToGrid=aU;var ir=fo,ia=Qt;function sU(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:hU(r);const o=rg(e);if(typeof r=="string"){const{ownerDocument:i}=o,s=i.defaultView;let a;if(r==="parent"?a=o.parentNode:a=i.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(o),d=s.getComputedStyle(l);r={left:-o.offsetLeft+(0,ir.int)(d.paddingLeft)+(0,ir.int)(c.marginLeft),top:-o.offsetTop+(0,ir.int)(d.paddingTop)+(0,ir.int)(c.marginTop),right:(0,ia.innerWidth)(l)-(0,ia.outerWidth)(o)-o.offsetLeft+(0,ir.int)(d.paddingRight)-(0,ir.int)(c.marginRight),bottom:(0,ia.innerHeight)(l)-(0,ia.outerHeight)(o)-o.offsetTop+(0,ir.int)(d.paddingBottom)-(0,ir.int)(c.marginBottom)}}return(0,ir.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,ir.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,ir.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,ir.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function aU(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function lU(e){return e.props.axis==="both"||e.props.axis==="x"}function cU(e){return e.props.axis==="both"||e.props.axis==="y"}function uU(e,t,n){const r=typeof t=="number"?(0,ia.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=rg(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,ia.offsetXYFromParent)(r||e,i,n.props.scale)}function dU(e,t,n){const r=!(0,ir.isNum)(e.lastX),o=rg(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function fU(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function hU(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function rg(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var _d={},Sd={};Object.defineProperty(Sd,"__esModule",{value:!0}),Sd.default=pU;function pU(){}Object.defineProperty(_d,"__esModule",{value:!0}),_d.default=void 0;var og=gU(x),Un=sg(mi),mU=sg(Zr),Pn=Qt,gi=ho,ig=fo,jl=sg(Sd);function sg(e){return e&&e.__esModule?e:{default:e}}function VE(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(VE=function(r){return r?n:t})(e)}function gU(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=VE(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function $n(e,t,n){return t=yU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yU(e){var t=wU(e,"string");return typeof t=="symbol"?t:String(t)}function wU(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const jr={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let yi=jr.mouse,xd=class extends og.Component{constructor(){super(...arguments),$n(this,"dragging",!1),$n(this,"lastX",NaN),$n(this,"lastY",NaN),$n(this,"touchIdentifier",null),$n(this,"mounted",!1),$n(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,Pn.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,Pn.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,Pn.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,gi.getControlPosition)(t,o,this);if(i==null)return;const{x:s,y:a}=i,l=(0,gi.createCoreData)(this,s,a);(0,jl.default)("DraggableCore: handleDragStart: %j",l),(0,jl.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Pn.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,Pn.addEvent)(r,yi.move,this.handleDrag),(0,Pn.addEvent)(r,yi.stop,this.handleDragStop))}),$n(this,"handleDrag",t=>{const n=(0,gi.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=o-this.lastY;if([a,l]=(0,gi.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,o=this.lastY+l}const i=(0,gi.createCoreData)(this,r,o);if((0,jl.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(t,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=o}),$n(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,gi.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=o-this.lastY||0;[l,c]=(0,gi.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,gi.createCoreData)(this,r,o);if(this.props.onStop(t,i)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,Pn.removeUserSelectStyles)(a.ownerDocument),(0,jl.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,jl.default)("DraggableCore: Removing handlers"),(0,Pn.removeEvent)(a.ownerDocument,yi.move,this.handleDrag),(0,Pn.removeEvent)(a.ownerDocument,yi.stop,this.handleDragStop))}),$n(this,"onMouseDown",t=>(yi=jr.mouse,this.handleDragStart(t))),$n(this,"onMouseUp",t=>(yi=jr.mouse,this.handleDragStop(t))),$n(this,"onTouchStart",t=>(yi=jr.touch,this.handleDragStart(t))),$n(this,"onTouchEnd",t=>(yi=jr.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Pn.addEvent)(t,jr.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,Pn.removeEvent)(n,jr.mouse.move,this.handleDrag),(0,Pn.removeEvent)(n,jr.touch.move,this.handleDrag),(0,Pn.removeEvent)(n,jr.mouse.stop,this.handleDragStop),(0,Pn.removeEvent)(n,jr.touch.stop,this.handleDragStop),(0,Pn.removeEvent)(t,jr.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Pn.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:mU.default.findDOMNode(this)}render(){return og.cloneElement(og.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};_d.default=xd,$n(xd,"displayName","DraggableCore"),$n(xd,"propTypes",{allowAnyClick:Un.default.bool,children:Un.default.node.isRequired,disabled:Un.default.bool,enableUserSelectHack:Un.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:Un.default.arrayOf(Un.default.number),handle:Un.default.string,cancel:Un.default.string,nodeRef:Un.default.object,onStart:Un.default.func,onDrag:Un.default.func,onStop:Un.default.func,onMouseDown:Un.default.func,scale:Un.default.number,className:ig.dontSetMe,style:ig.dontSetMe,transform:ig.dontSetMe}),$n(xd,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=f(x),n=d(mi),r=d(Zr),o=d(jV),i=Qt,s=ho,a=fo,l=d(_d),c=d(Sd);function d(b){return b&&b.__esModule?b:{default:b}}function u(b){if(typeof WeakMap!="function")return null;var _=new WeakMap,C=new WeakMap;return(u=function(N){return N?C:_})(b)}function f(b,_){if(b&&b.__esModule)return b;if(b===null||typeof b!="object"&&typeof b!="function")return{default:b};var C=u(_);if(C&&C.has(b))return C.get(b);var N={},A=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in b)if(R!=="default"&&Object.prototype.hasOwnProperty.call(b,R)){var D=A?Object.getOwnPropertyDescriptor(b,R):null;D&&(D.get||D.set)?Object.defineProperty(N,R,D):N[R]=b[R]}return N.default=b,C&&C.set(b,N),N}function h(){return h=Object.assign?Object.assign.bind():function(b){for(var _=1;_<arguments.length;_++){var C=arguments[_];for(var N in C)Object.prototype.hasOwnProperty.call(C,N)&&(b[N]=C[N])}return b},h.apply(this,arguments)}function m(b,_,C){return _=p(_),_ in b?Object.defineProperty(b,_,{value:C,enumerable:!0,configurable:!0,writable:!0}):b[_]=C,b}function p(b){var _=y(b,"string");return typeof _=="symbol"?_:String(_)}function y(b,_){if(typeof b!="object"||b===null)return b;var C=b[Symbol.toPrimitive];if(C!==void 0){var N=C.call(b,_||"default");if(typeof N!="object")return N;throw new TypeError("@@toPrimitive must return a primitive value.")}return(_==="string"?String:Number)(b)}class v extends t.Component{static getDerivedStateFromProps(_,C){let{position:N}=_,{prevPropsPosition:A}=C;return N&&(!A||N.x!==A.x||N.y!==A.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:N,prevPropsPosition:A}),{x:N.x,y:N.y,prevPropsPosition:{...N}}):null}constructor(_){super(_),m(this,"onDragStart",(C,N)=>{if((0,c.default)("Draggable: onDragStart: %j",N),this.props.onStart(C,(0,s.createDraggableData)(this,N))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),m(this,"onDrag",(C,N)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",N);const A=(0,s.createDraggableData)(this,N),R={x:A.x,y:A.y,slackX:0,slackY:0};if(this.props.bounds){const{x:k,y:F}=R;R.x+=this.state.slackX,R.y+=this.state.slackY;const[W,B]=(0,s.getBoundPosition)(this,R.x,R.y);R.x=W,R.y=B,R.slackX=this.state.slackX+(k-R.x),R.slackY=this.state.slackY+(F-R.y),A.x=R.x,A.y=R.y,A.deltaX=R.x-this.state.x,A.deltaY=R.y-this.state.y}if(this.props.onDrag(C,A)===!1)return!1;this.setState(R)}),m(this,"onDragStop",(C,N)=>{if(!this.state.dragging||this.props.onStop(C,(0,s.createDraggableData)(this,N))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",N);const R={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:k,y:F}=this.props.position;R.x=k,R.y=F}this.setState(R)}),this.state={dragging:!1,dragged:!1,x:_.position?_.position.x:_.defaultPosition.x,y:_.position?_.position.y:_.defaultPosition.y,prevPropsPosition:{..._.position},slackX:0,slackY:0,isElementSVG:!1},_.position&&!(_.onDrag||_.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var _,C;return(_=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&_!==void 0?_:r.default.findDOMNode(this)}render(){const{axis:_,bounds:C,children:N,defaultPosition:A,defaultClassName:R,defaultClassNameDragging:D,defaultClassNameDragged:k,position:F,positionOffset:W,scale:B,...T}=this.props;let Q={},K=null;const ee=!!!F||this.state.dragging,G=F||A,re={x:(0,s.canDragX)(this)&&ee?this.state.x:G.x,y:(0,s.canDragY)(this)&&ee?this.state.y:G.y};this.state.isElementSVG?K=(0,i.createSVGTransform)(re,W):Q=(0,i.createCSSTransform)(re,W);const X=(0,o.default)(N.props.className||"",R,{[D]:this.state.dragging,[k]:this.state.dragged});return t.createElement(l.default,h({},T,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(N),{className:X,style:{...N.props.style,...Q},transform:K}))}}e.default=v,m(v,"displayName","Draggable"),m(v,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),m(v,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(IE);const{default:UE,DraggableCore:vU}=IE;vd.exports=UE,vd.exports.default=UE,vd.exports.DraggableCore=vU;var HE=vd.exports,Ed={exports:{}},Fl={},ag={};ag.__esModule=!0,ag.cloneElement=CU;var bU=_U(x);function _U(e){return e&&e.__esModule?e:{default:e}}function GE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function YE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GE(Object(n),!0).forEach(function(r){SU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function SU(e,t,n){return t=xU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xU(e){var t=EU(e,"string");return typeof t=="symbol"?t:String(t)}function EU(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function CU(e,t){return t.style&&e.props.style&&(t.style=YE(YE({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),bU.default.cloneElement(e,t)}var $l={};$l.__esModule=!0,$l.resizableProps=void 0;var Qe=NU(mi);function NU(e){return e&&e.__esModule?e:{default:e}}var RU={axis:Qe.default.oneOf(["both","x","y","none"]),className:Qe.default.string,children:Qe.default.element.isRequired,draggableOpts:Qe.default.shape({allowAnyClick:Qe.default.bool,cancel:Qe.default.string,children:Qe.default.node,disabled:Qe.default.bool,enableUserSelectHack:Qe.default.bool,offsetParent:Qe.default.node,grid:Qe.default.arrayOf(Qe.default.number),handle:Qe.default.string,nodeRef:Qe.default.object,onStart:Qe.default.func,onDrag:Qe.default.func,onStop:Qe.default.func,onMouseDown:Qe.default.func,scale:Qe.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="y"){var i;return(i=Qe.default.number).isRequired.apply(i,n)}return Qe.default.number.apply(Qe.default,n)},handle:Qe.default.oneOfType([Qe.default.node,Qe.default.func]),handleSize:Qe.default.arrayOf(Qe.default.number),lockAspectRatio:Qe.default.bool,maxConstraints:Qe.default.arrayOf(Qe.default.number),minConstraints:Qe.default.arrayOf(Qe.default.number),onResizeStop:Qe.default.func,onResizeStart:Qe.default.func,onResize:Qe.default.func,resizeHandles:Qe.default.arrayOf(Qe.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:Qe.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="x"){var i;return(i=Qe.default.number).isRequired.apply(i,n)}return Qe.default.number.apply(Qe.default,n)}};$l.resizableProps=RU,Fl.__esModule=!0,Fl.default=void 0;var zl=MU(x),PU=HE,AU=ag,TU=$l,DU=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function qE(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(qE=function(o){return o?n:t})(e)}function MU(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=qE(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function lg(){return lg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lg.apply(this,arguments)}function IU(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function KE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function cg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KE(Object(n),!0).forEach(function(r){OU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function OU(e,t,n){return t=kU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kU(e){var t=LU(e,"string");return typeof t=="symbol"?t:String(t)}function LU(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jU(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ug(e,t)}function ug(e,t){return ug=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},ug(e,t)}var dg=function(e){jU(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,i){var s=this.props,a=s.minConstraints,l=s.maxConstraints,c=s.lockAspectRatio;if(!a&&!l&&!c)return[o,i];if(c){var d=this.props.width/this.props.height,u=o-this.props.width,f=i-this.props.height;Math.abs(u)>Math.abs(f*d)?i=o/d:o=i*d}var h=o,m=i,p=this.slack||[0,0],y=p[0],v=p[1];return o+=y,i+=v,a&&(o=Math.max(a[0],o),i=Math.max(a[1],i)),l&&(o=Math.min(l[0],o),i=Math.min(l[1],i)),this.slack=[y+(h-o),v+(m-i)],[o,i]},n.resizeHandler=function(o,i){var s=this;return function(a,l){var c=l.node,d=l.deltaX,u=l.deltaY;o==="onResizeStart"&&s.resetData();var f=(s.props.axis==="both"||s.props.axis==="x")&&i!=="n"&&i!=="s",h=(s.props.axis==="both"||s.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!f&&!h)){var m=i[0],p=i[i.length-1],y=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(p==="w"){var v=y.left-s.lastHandleRect.left;d+=v}if(m==="n"){var b=y.top-s.lastHandleRect.top;u+=b}}s.lastHandleRect=y,p==="w"&&(d=-d),m==="n"&&(u=-u);var _=s.props.width+(f?d/s.props.transformScale:0),C=s.props.height+(h?u/s.props.transformScale:0),N=s.runConstraints(_,C);_=N[0],C=N[1];var A=_!==s.props.width||C!==s.props.height,R=typeof s.props[o]=="function"?s.props[o]:null,D=o==="onResize"&&!A;R&&!D&&(a.persist==null||a.persist(),R(a,{node:c,size:{width:_,height:C},handle:i})),o==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(o,i){var s=this.props.handle;if(!s)return zl.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:i});if(typeof s=="function")return s(o,i);var a=typeof s.type=="string",l=cg({ref:i},a?{}:{handleAxis:o});return zl.cloneElement(s,l)},n.render=function(){var o=this,i=this.props,s=i.children,a=i.className,l=i.draggableOpts;i.width,i.height,i.handle,i.handleSize,i.lockAspectRatio,i.axis,i.minConstraints,i.maxConstraints,i.onResize,i.onResizeStop,i.onResizeStart;var c=i.resizeHandles;i.transformScale;var d=IU(i,DU);return(0,AU.cloneElement)(s,cg(cg({},d),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(u){var f,h=(f=o.handleRefs[u])!=null?f:o.handleRefs[u]=zl.createRef();return zl.createElement(PU.DraggableCore,lg({},l,{nodeRef:h,key:"resizableHandle-"+u,onStop:o.resizeHandler("onResizeStop",u),onStart:o.resizeHandler("onResizeStart",u),onDrag:o.resizeHandler("onResize",u)}),o.renderResizeHandle(u,h))}))}))},t}(zl.Component);Fl.default=dg,dg.propTypes=TU.resizableProps,dg.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var Cd={};Cd.__esModule=!0,Cd.default=void 0;var fg=WU(x),FU=XE(mi),$U=XE(Fl),zU=$l,BU=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function XE(e){return e&&e.__esModule?e:{default:e}}function JE(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(JE=function(o){return o?n:t})(e)}function WU(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=JE(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function hg(){return hg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hg.apply(this,arguments)}function QE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Nd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QE(Object(n),!0).forEach(function(r){VU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function VU(e,t,n){return t=UU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UU(e){var t=HU(e,"string");return typeof t=="symbol"?t:String(t)}function HU(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function GU(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function YU(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,pg(e,t)}function pg(e,t){return pg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},pg(e,t)}var ZE=function(e){YU(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(a,l){var c=l.size;r.props.onResize?(a.persist==null||a.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(a,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(o,i){return i.propsWidth!==o.width||i.propsHeight!==o.height?{width:o.width,height:o.height,propsWidth:o.width,propsHeight:o.height}:null};var n=t.prototype;return n.render=function(){var o=this.props,i=o.handle,s=o.handleSize;o.onResize;var a=o.onResizeStart,l=o.onResizeStop,c=o.draggableOpts,d=o.minConstraints,u=o.maxConstraints,f=o.lockAspectRatio,h=o.axis;o.width,o.height;var m=o.resizeHandles,p=o.style,y=o.transformScale,v=GU(o,BU);return fg.createElement($U.default,{axis:h,draggableOpts:c,handle:i,handleSize:s,height:this.state.height,lockAspectRatio:f,maxConstraints:u,minConstraints:d,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:m,transformScale:y,width:this.state.width},fg.createElement("div",hg({},v,{style:Nd(Nd({},p),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(fg.Component);Cd.default=ZE,ZE.propTypes=Nd(Nd({},zU.resizableProps),{},{children:FU.default.element}),Ed.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Ed.exports.Resizable=Fl.default,Ed.exports.ResizableBox=Cd.default;var qU=Ed.exports,Vo={};Object.defineProperty(Vo,"__esModule",{value:!0}),Vo.resizeHandleType=Vo.resizeHandleAxesType=Vo.default=void 0;var nt=eC(mi),KU=eC(x);function eC(e){return e&&e.__esModule?e:{default:e}}const XU=Vo.resizeHandleAxesType=nt.default.arrayOf(nt.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),JU=Vo.resizeHandleType=nt.default.oneOfType([nt.default.node,nt.default.func]);Vo.default={className:nt.default.string,style:nt.default.object,width:nt.default.number,autoSize:nt.default.bool,cols:nt.default.number,draggableCancel:nt.default.string,draggableHandle:nt.default.string,verticalCompact:function(e){e.verticalCompact},compactType:nt.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&st.validateLayout(t,"layout")},margin:nt.default.arrayOf(nt.default.number),containerPadding:nt.default.arrayOf(nt.default.number),rowHeight:nt.default.number,maxRows:nt.default.number,isBounded:nt.default.bool,isDraggable:nt.default.bool,isResizable:nt.default.bool,allowOverlap:nt.default.bool,preventCollision:nt.default.bool,useCSSTransforms:nt.default.bool,transformScale:nt.default.number,isDroppable:nt.default.bool,resizeHandles:XU,resizeHandle:JU,onLayoutChange:nt.default.func,onDragStart:nt.default.func,onDrag:nt.default.func,onDragStop:nt.default.func,onResizeStart:nt.default.func,onResize:nt.default.func,onResizeStop:nt.default.func,onDrop:nt.default.func,droppingItem:nt.default.shape({i:nt.default.string.isRequired,w:nt.default.number.isRequired,h:nt.default.number.isRequired}),children:function(e,t){const n=e[t],r={};KU.default.Children.forEach(n,function(o){if((o==null?void 0:o.key)!=null){if(r[o.key])throw new Error('Duplicate child key "'+o.key+'" found! This will cause problems in ReactGridLayout.');r[o.key]=!0}})},innerRef:nt.default.any},Object.defineProperty(wd,"__esModule",{value:!0}),wd.default=void 0;var sa=mg(x),bt=mg(mi),QU=HE,ZU=qU,aa=st,Sn=uo,tC=Vo,eH=mg(Wm);function mg(e){return e&&e.__esModule?e:{default:e}}function po(e,t,n){return t=tH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tH(e){var t=nH(e,"string");return typeof t=="symbol"?t:String(t)}function nH(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class gg extends sa.default.Component{constructor(){super(...arguments),po(this,"state",{resizing:null,dragging:null,className:""}),po(this,"elementRef",sa.default.createRef()),po(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:o,transformScale:i}=this.props;if(!o)return;const s={top:0,left:0},{offsetParent:a}=r;if(!a)return;const l=a.getBoundingClientRect(),c=r.getBoundingClientRect(),d=c.left/i,u=l.left/i,f=c.top/i,h=l.top/i;s.left=d-u+a.scrollLeft,s.top=f-h+a.scrollTop,this.setState({dragging:s});const{x:m,y:p}=(0,Sn.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return o.call(this,this.props.i,m,p,{e:t,node:r,newPosition:s})}),po(this,"onDrag",(t,n)=>{let{node:r,deltaX:o,deltaY:i}=n;const{onDrag:s}=this.props;if(!s)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let a=this.state.dragging.top+i,l=this.state.dragging.left+o;const{isBounded:c,i:d,w:u,h:f,containerWidth:h}=this.props,m=this.getPositionParams();if(c){const{offsetParent:b}=r;if(b){const{margin:_,rowHeight:C,containerPadding:N}=this.props,A=b.clientHeight-(0,Sn.calcGridItemWHPx)(f,C,_[1]);a=(0,Sn.clamp)(a-N[1],0,A);const R=(0,Sn.calcGridColWidth)(m),D=h-(0,Sn.calcGridItemWHPx)(u,R,_[0]);l=(0,Sn.clamp)(l-N[0],0,D)}}const p={top:a,left:l};this.setState({dragging:p});const{x:y,y:v}=(0,Sn.calcXY)(m,a,l,u,f);return s.call(this,d,y,v,{e:t,node:r,newPosition:p})}),po(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:i,h:s,i:a}=this.props,{left:l,top:c}=this.state.dragging,d={top:c,left:l};this.setState({dragging:null});const{x:u,y:f}=(0,Sn.calcXY)(this.getPositionParams(),c,l,i,s);return o.call(this,a,u,f,{e:t,node:r,newPosition:d})}),po(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),po(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),po(this,"onResize",(t,n,r)=>this.onResizeHandler(t,n,r,"onResize"))}shouldComponentUpdate(t,n){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const r=(0,Sn.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,Sn.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,aa.fastPositionEqual)(r,o)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const o=t.droppingPosition||{left:0,top:0},{dragging:i}=this.state,s=i&&n.left!==o.left||n.top!==o.top;if(!i)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(s){const a=n.left-i.left,l=n.top-i.top;this.onDrag(n.e,{node:r,deltaX:a,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:o}=this.props;let i;return o?i=(0,aa.setTransform)(t):(i=(0,aa.setTopLeft)(t),n&&(i.left=(0,aa.perc)(t.left/r),i.width=(0,aa.perc)(t.width/r))),i}mixinDraggable(t,n){return sa.default.createElement(QU.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,o)=>n(r,o,t)}mixinResizable(t,n,r){const{cols:o,minW:i,minH:s,maxW:a,maxH:l,transformScale:c,resizeHandles:d,resizeHandle:u}=this.props,f=this.getPositionParams(),h=(0,Sn.calcGridItemPosition)(f,0,0,o,0).width,m=(0,Sn.calcGridItemPosition)(f,0,0,i,s),p=(0,Sn.calcGridItemPosition)(f,0,0,a,l),y=[m.width,m.height],v=[Math.min(p.width,h),Math.min(p.height,1/0)];return sa.default.createElement(ZU.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:y,maxConstraints:v,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:d,handle:u},t)}onResizeHandler(t,n,r,o){let{node:i,size:s,handle:a}=n;const l=this.props[o];if(!l)return;const{x:c,y:d,i:u,maxH:f,minH:h,containerWidth:m}=this.props,{minW:p,maxW:y}=this.props;let v=s;i&&(v=(0,aa.resizeItemInDirection)(a,r,s,m),this.setState({resizing:o==="onResizeStop"?null:v}));let{w:b,h:_}=(0,Sn.calcWH)(this.getPositionParams(),v.width,v.height,c,d,a);b=(0,Sn.clamp)(b,Math.max(p,1),y),_=(0,Sn.clamp)(_,h,f),l.call(this,u,b,_,{e:t,node:i,size:v,handle:a})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,c=(0,Sn.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),d=sa.default.Children.only(this.props.children);let u=sa.default.cloneElement(d,{ref:this.elementRef,className:(0,eH.default)("react-grid-item",d.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":i,"react-draggable-dragging":!!this.state.dragging,dropping:!!a,cssTransforms:l}),style:{...this.props.style,...d.props.style,...this.createStyle(c)}});return u=this.mixinResizable(u,c,s),u=this.mixinDraggable(u,i),u}}wd.default=gg,po(gg,"propTypes",{children:bt.default.element,cols:bt.default.number.isRequired,containerWidth:bt.default.number.isRequired,rowHeight:bt.default.number.isRequired,margin:bt.default.array.isRequired,maxRows:bt.default.number.isRequired,containerPadding:bt.default.array.isRequired,x:bt.default.number.isRequired,y:bt.default.number.isRequired,w:bt.default.number.isRequired,h:bt.default.number.isRequired,minW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minWidth not Number");if(n>e.w||n>e.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxWidth not Number");if(n<e.w||n<e.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minHeight not Number");if(n>e.h||n>e.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxHeight not Number");if(n<e.h||n<e.minH)return new Error("maxHeight smaller than item height/minHeight")},i:bt.default.string.isRequired,resizeHandles:tC.resizeHandleAxesType,resizeHandle:tC.resizeHandleType,onDragStop:bt.default.func,onDragStart:bt.default.func,onDrag:bt.default.func,onResizeStop:bt.default.func,onResizeStart:bt.default.func,onResize:bt.default.func,isDraggable:bt.default.bool.isRequired,isResizable:bt.default.bool.isRequired,isBounded:bt.default.bool.isRequired,static:bt.default.bool,useCSSTransforms:bt.default.bool.isRequired,transformScale:bt.default.number,className:bt.default.string,handle:bt.default.string,cancel:bt.default.string,droppingPosition:bt.default.shape({e:bt.default.object.isRequired,left:bt.default.number.isRequired,top:bt.default.number.isRequired})}),po(gg,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Object.defineProperty(Ol,"__esModule",{value:!0}),Ol.default=void 0;var ds=sH(x),yg=Bm,rH=wg(Wm),Ge=st,oH=uo,nC=wg(wd),iH=wg(Vo);function wg(e){return e&&e.__esModule?e:{default:e}}function rC(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(rC=function(r){return r?n:t})(e)}function sH(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=rC(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function An(e,t,n){return t=aH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aH(e){var t=lH(e,"string");return typeof t=="symbol"?t:String(t)}function lH(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const oC="react-grid-layout";let iC=!1;try{iC=/firefox/i.test(navigator.userAgent)}catch{}class Rd extends ds.Component{constructor(){super(...arguments),An(this,"state",{activeDrag:null,layout:(0,Ge.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,Ge.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),An(this,"dragEnterCounter",0),An(this,"onDragStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,Ge.getLayoutItem)(a,t);if(!l)return;const c={w:l.w,h:l.h,x:l.x,y:l.y,placeholder:!0,i:t};return this.setState({oldDragItem:(0,Ge.cloneLayoutItem)(l),oldLayout:a,activeDrag:c}),this.props.onDragStart(a,l,l,null,i,s)}),An(this,"onDrag",(t,n,r,o)=>{let{e:i,node:s}=o;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:d,preventCollision:u}=this.props,f=(0,Ge.getLayoutItem)(l,t);if(!f)return;const h={w:f.w,h:f.h,x:f.x,y:f.y,placeholder:!0,i:t};l=(0,Ge.moveElement)(l,f,n,r,!0,u,(0,Ge.compactType)(this.props),c,d),this.props.onDrag(l,a,f,h,i,s),this.setState({layout:d?l:(0,Ge.compact)(l,(0,Ge.compactType)(this.props),c),activeDrag:h})}),An(this,"onDragStop",(t,n,r,o)=>{let{e:i,node:s}=o;if(!this.state.activeDrag)return;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:d,allowOverlap:u}=this.props,f=(0,Ge.getLayoutItem)(l,t);if(!f)return;l=(0,Ge.moveElement)(l,f,n,r,!0,d,(0,Ge.compactType)(this.props),c,u);const m=u?l:(0,Ge.compact)(l,(0,Ge.compactType)(this.props),c);this.props.onDragStop(m,a,f,null,i,s);const{oldLayout:p}=this.state;this.setState({activeDrag:null,layout:m,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(m,p)}),An(this,"onResizeStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,Ge.getLayoutItem)(a,t);l&&(this.setState({oldResizeItem:(0,Ge.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(a,l,l,null,i,s))}),An(this,"onResize",(t,n,r,o)=>{let{e:i,node:s,size:a,handle:l}=o;const{oldResizeItem:c}=this.state,{layout:d}=this.state,{cols:u,preventCollision:f,allowOverlap:h}=this.props;let m=!1,p,y,v;const[b,_]=(0,Ge.withLayoutItem)(d,t,N=>{let A;return y=N.x,v=N.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(y=N.x+(N.w-n),n=N.x!==y&&y<0?N.w:n,y=y<0?0:y),["ne","n","nw"].indexOf(l)!==-1&&(v=N.y+(N.h-r),r=N.y!==v&&v<0?N.h:r,v=v<0?0:v),m=!0),f&&!h&&(A=(0,Ge.getAllCollisions)(d,{...N,w:n,h:r,x:y,y:v}).filter(D=>D.i!==N.i).length>0,A&&(v=N.y,r=N.h,y=N.x,n=N.w,m=!1)),N.w=n,N.h=r,N});if(!_)return;p=b,m&&(p=(0,Ge.moveElement)(b,_,y,v,!0,this.props.preventCollision,(0,Ge.compactType)(this.props),u,h));const C={w:_.w,h:_.h,x:_.x,y:_.y,static:!0,i:t};this.props.onResize(p,c,_,C,i,s),this.setState({layout:h?p:(0,Ge.compact)(p,(0,Ge.compactType)(this.props),u),activeDrag:C})}),An(this,"onResizeStop",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a,oldResizeItem:l}=this.state,{cols:c,allowOverlap:d}=this.props,u=(0,Ge.getLayoutItem)(a,t),f=d?a:(0,Ge.compact)(a,(0,Ge.compactType)(this.props),c);this.props.onResizeStop(f,l,u,null,i,s);const{oldLayout:h}=this.state;this.setState({activeDrag:null,layout:f,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(f,h)}),An(this,"onDragOver",t=>{var b;if(t.preventDefault(),t.stopPropagation(),iC&&!((b=t.nativeEvent.target)!=null&&b.classList.contains(oC)))return!1;const{droppingItem:n,onDropDragOver:r,margin:o,cols:i,rowHeight:s,maxRows:a,width:l,containerPadding:c,transformScale:d}=this.props,u=r==null?void 0:r(t);if(u===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const f={...n,...u},{layout:h}=this.state,m=t.currentTarget.getBoundingClientRect(),p=t.clientX-m.left,y=t.clientY-m.top,v={left:p/d,top:y/d,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:_,top:C}=this.state.droppingPosition;(_!=p||C!=y)&&this.setState({droppingPosition:v})}}else{const _={cols:i,margin:o,maxRows:a,rowHeight:s,containerWidth:l,containerPadding:c||o},C=(0,oH.calcXY)(_,y,p,f.w,f.h);this.setState({droppingDOMNode:ds.createElement("div",{key:f.i}),droppingPosition:v,layout:[...h,{...f,x:C.x,y:C.y,static:!1,isDraggable:!0}]})}}),An(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,Ge.compact)(r.filter(i=>i.i!==t.i),(0,Ge.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),An(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),An(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),An(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,o=r.find(i=>i.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,o,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,yg.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,Ge.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,Ge.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,Ge.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,Ge.fastRGLPropsEqual)(this.props,t,yg.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,o=n.layout;this.onLayoutMaybeChanged(r,o)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,Ge.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(t,n){n||(n=this.state.layout),(0,yg.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:o,containerPadding:i,rowHeight:s,maxRows:a,useCSSTransforms:l,transformScale:c}=this.props;return ds.createElement(nC.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:n,cols:r,margin:o,containerPadding:i||o,maxRows:a,rowHeight:s,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},ds.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,Ge.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:o,cols:i,margin:s,containerPadding:a,rowHeight:l,maxRows:c,isDraggable:d,isResizable:u,isBounded:f,useCSSTransforms:h,transformScale:m,draggableCancel:p,draggableHandle:y,resizeHandles:v,resizeHandle:b}=this.props,{mounted:_,droppingPosition:C}=this.state,N=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&d,A=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&u,R=r.resizeHandles||v,D=N&&f&&r.isBounded!==!1;return ds.createElement(nC.default,{containerWidth:o,cols:i,margin:s,containerPadding:a||s,maxRows:c,rowHeight:l,cancel:p,handle:y,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:N,isResizable:A,isBounded:D,useCSSTransforms:h&&_,usePercentages:!_,transformScale:m,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?C:void 0,resizeHandles:R,resizeHandle:b},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,rH.default)(oC,t),s={height:this.containerHeight(),...n};return ds.createElement("div",{ref:o,className:i,style:s,onDrop:r?this.onDrop:Ge.noop,onDragLeave:r?this.onDragLeave:Ge.noop,onDragEnter:r?this.onDragEnter:Ge.noop,onDragOver:r?this.onDragOver:Ge.noop},ds.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}Ol.default=Rd,An(Rd,"displayName","ReactGridLayout"),An(Rd,"propTypes",iH.default),An(Rd,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:Ge.noop,onDragStart:Ge.noop,onDrag:Ge.noop,onDragStop:Ge.noop,onResizeStart:Ge.noop,onResize:Ge.noop,onResizeStop:Ge.noop,onDrop:Ge.noop,onDropDragOver:Ge.noop});var Pd={},fs={};Object.defineProperty(fs,"__esModule",{value:!0}),fs.findOrGenerateResponsiveLayout=dH,fs.getBreakpointFromWidth=cH,fs.getColsFromBreakpoint=uH,fs.sortBreakpoints=vg;var Ad=st;function cH(e,t){const n=vg(e);let r=n[0];for(let o=1,i=n.length;o<i;o++){const s=n[o];t>e[s]&&(r=s)}return r}function uH(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function dH(e,t,n,r,o,i){if(e[n])return(0,Ad.cloneLayout)(e[n]);let s=e[r];const a=vg(t),l=a.slice(a.indexOf(n));for(let c=0,d=l.length;c<d;c++){const u=l[c];if(e[u]){s=e[u];break}}return s=(0,Ad.cloneLayout)(s||[]),(0,Ad.compact)((0,Ad.correctBounds)(s,{cols:o}),i,o)}function vg(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(Pd,"__esModule",{value:!0}),Pd.default=void 0;var sC=hH(x),Hn=aC(mi),bg=Bm,la=st,hs=fs,fH=aC(Ol);function aC(e){return e&&e.__esModule?e:{default:e}}function lC(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(lC=function(r){return r?n:t})(e)}function hH(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=lC(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function _g(){return _g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_g.apply(this,arguments)}function Td(e,t,n){return t=pH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pH(e){var t=mH(e,"string");return typeof t=="symbol"?t:String(t)}function mH(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const cC=e=>Object.prototype.toString.call(e);function Dd(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class Sg extends sC.Component{constructor(){super(...arguments),Td(this,"state",this.generateInitialState()),Td(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:o}=this.props,i=(0,hs.getBreakpointFromWidth)(n,t),s=(0,hs.getColsFromBreakpoint)(i,o),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,hs.findOrGenerateResponsiveLayout)(r,n,i,i,s,a),breakpoint:i,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,bg.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,hs.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,o,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,bg.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,bg.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:o,compactType:i}=this.props,s=this.props.breakpoint||(0,hs.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,hs.getColsFromBreakpoint)(s,r),c={...o};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,la.cloneLayout)(this.state.layout));let f=(0,hs.findOrGenerateResponsiveLayout)(c,n,s,a,l,i);f=(0,la.synchronizeLayoutWithChildren)(f,this.props.children,l,i,this.props.allowOverlap),c[s]=f,this.props.onBreakpointChange(s,l),this.props.onLayoutChange(f,c),this.setState({breakpoint:s,layout:f,cols:l})}const d=Dd(this.props.margin,s),u=Dd(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,d,l,u)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:o,margin:i,containerPadding:s,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,...d}=this.props;return sC.createElement(fH.default,_g({},d,{margin:Dd(i,this.state.breakpoint),containerPadding:Dd(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Pd.default=Sg,Td(Sg,"propTypes",{breakpoint:Hn.default.string,breakpoints:Hn.default.object,allowOverlap:Hn.default.bool,cols:Hn.default.object,margin:Hn.default.oneOfType([Hn.default.array,Hn.default.object]),containerPadding:Hn.default.oneOfType([Hn.default.array,Hn.default.object]),layouts(e,t){if(cC(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+cC(e[t]));Object.keys(e[t]).forEach(n=>{if(!(n in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,la.validateLayout)(e.layouts[n],"layouts."+n)})},width:Hn.default.number.isRequired,onBreakpointChange:Hn.default.func,onLayoutChange:Hn.default.func,onWidthChange:Hn.default.func}),Td(Sg,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:la.noop,onLayoutChange:la.noop,onWidthChange:la.noop});var xg={},uC=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,i){return o[0]===n?(r=i,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,i=this.__entries__;o<i.length;o++){var s=i[o];n.call(r,s[1],s[0])}},t}()}(),Eg=typeof window<"u"&&typeof document<"u"&&window.document===document,Md=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),gH=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Md):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),yH=2;function wH(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&a()}function s(){gH(i)}function a(){var l=Date.now();if(n){if(l-o<yH)return;r=!0}else n=!0,r=!1,setTimeout(s,t);o=l}return a}var vH=20,bH=["top","right","bottom","left","width","height","size","weight"],_H=typeof MutationObserver<"u",SH=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=wH(this.refresh.bind(this),vH)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!Eg||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),_H?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Eg||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=bH.some(function(i){return!!~r.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),dC=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},ca=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Md},fC=Od(0,0,0,0);function Id(e){return parseFloat(e)||0}function hC(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var i=e["border-"+o+"-width"];return r+Id(i)},0)}function xH(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var i=o[r],s=e["padding-"+i];n[i]=Id(s)}return n}function EH(e){var t=e.getBBox();return Od(0,0,t.width,t.height)}function CH(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return fC;var r=ca(e).getComputedStyle(e),o=xH(r),i=o.left+o.right,s=o.top+o.bottom,a=Id(r.width),l=Id(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+i)!==t&&(a-=hC(r,"left","right")+i),Math.round(l+s)!==n&&(l-=hC(r,"top","bottom")+s)),!RH(e)){var c=Math.round(a+i)-t,d=Math.round(l+s)-n;Math.abs(c)!==1&&(a-=c),Math.abs(d)!==1&&(l-=d)}return Od(o.left,o.top,a,l)}var NH=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof ca(e).SVGGraphicsElement}:function(e){return e instanceof ca(e).SVGElement&&typeof e.getBBox=="function"}}();function RH(e){return e===ca(e).document.documentElement}function PH(e){return Eg?NH(e)?EH(e):CH(e):fC}function AH(e){var t=e.x,n=e.y,r=e.width,o=e.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,s=Object.create(i.prototype);return dC(s,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),s}function Od(e,t,n,r){return{x:e,y:t,width:n,height:r}}var TH=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Od(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=PH(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),DH=function(){function e(t,n){var r=AH(n);dC(this,{target:t,contentRect:r})}return e}(),MH=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new uC,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ca(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new TH(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ca(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new DH(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),pC=typeof WeakMap<"u"?new WeakMap:new uC,mC=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=SH.getInstance(),r=new MH(t,n,this);pC.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){mC.prototype[e]=function(){var t;return(t=pC.get(this))[e].apply(t,arguments)}});var IH=function(){return typeof Md.ResizeObserver<"u"?Md.ResizeObserver:mC}();const OH=Qc(Object.freeze(Object.defineProperty({__proto__:null,default:IH},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(xg,"__esModule",{value:!0}),xg.default=WH;var kd=FH(x),kH=Cg(mi),LH=Cg(OH),jH=Cg(Wm);function Cg(e){return e&&e.__esModule?e:{default:e}}function gC(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(gC=function(r){return r?n:t})(e)}function FH(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=gC(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Ng(){return Ng=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ng.apply(this,arguments)}function ua(e,t,n){return t=$H(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $H(e){var t=zH(e,"string");return typeof t=="symbol"?t:String(t)}function zH(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const BH="react-grid-layout";function WH(e){var t;return t=class extends kd.Component{constructor(){super(...arguments),ua(this,"state",{width:1280}),ua(this,"elementRef",kd.createRef()),ua(this,"mounted",!1),ua(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new LH.default(o=>{if(this.elementRef.current instanceof HTMLElement){const s=o[0].contentRect.width;this.setState({width:s})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...o}=this.props;return r&&!this.mounted?kd.createElement("div",{className:(0,jH.default)(this.props.className,BH),style:this.props.style,ref:this.elementRef}):kd.createElement(e,Ng({innerRef:this.elementRef},o,this.state))}},ua(t,"defaultProps",{measureBeforeMount:!1}),ua(t,"propTypes",{measureBeforeMount:kH.default.bool}),t}(function(e){e.exports=Ol.default,e.exports.utils=st,e.exports.calculateUtils=uo,e.exports.Responsive=Pd.default,e.exports.Responsive.utils=fs,e.exports.WidthProvider=xg.default})(gE);var Rg=gE.exports;const yC=il(Rg),VH=Rg.WidthProvider(yC),UH=pi.div`
|
|
77
|
+
.react-grid-layout {
|
|
78
|
+
position: relative;
|
|
79
|
+
// transition: height 200ms ease;
|
|
80
|
+
}
|
|
81
|
+
.react-grid-item {
|
|
82
|
+
// transition: all 200ms ease;
|
|
83
|
+
transition-property: left, top;
|
|
84
|
+
}
|
|
85
|
+
.react-grid-item.cssTransforms {
|
|
86
|
+
transition-property: transform;
|
|
87
|
+
}
|
|
88
|
+
.react-grid-item.resizing {
|
|
89
|
+
z-index: 1;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.react-grid-item.react-draggable-dragging {
|
|
93
|
+
transition: none;
|
|
94
|
+
z-index: 3;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.react-grid-item.react-grid-placeholder {
|
|
98
|
+
background: #000;
|
|
99
|
+
opacity: 0.1;
|
|
100
|
+
// transition-duration: 100ms;
|
|
101
|
+
z-index: 2;
|
|
102
|
+
border-radius: 4px;
|
|
103
|
+
-webkit-user-select: none;
|
|
104
|
+
-moz-user-select: none;
|
|
105
|
+
-ms-user-select: none;
|
|
106
|
+
-o-user-select: none;
|
|
107
|
+
user-select: none;
|
|
108
|
+
pointer-events: none; /* Allow events to pass through to elements below */
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.react-grid-item:hover > .react-resizable-handle {
|
|
112
|
+
position: absolute;
|
|
113
|
+
width: 25px;
|
|
114
|
+
height: 25px;
|
|
115
|
+
bottom: 0;
|
|
116
|
+
right: 0;
|
|
117
|
+
background: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg08IS0tIEdlbmVyYXRvcjogQWRvYmUgRmlyZXdvcmtzIENTNiwgRXhwb3J0IFNWRyBFeHRlbnNpb24gYnkgQWFyb24gQmVhbGwgKGh0dHA6Ly9maXJld29ya3MuYWJlYWxsLmNvbSkgLiBWZXJzaW9uOiAwLjYuMSAgLS0+DTwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DTxzdmcgaWQ9IlVudGl0bGVkLVBhZ2UlMjAxIiB2aWV3Qm94PSIwIDAgNiA2IiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHZlcnNpb249IjEuMSINCXhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbDpzcGFjZT0icHJlc2VydmUiDQl4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjZweCIgaGVpZ2h0PSI2cHgiDT4NCTxnIG9wYWNpdHk9IjAuMzAyIj4NCQk8cGF0aCBkPSJNIDYgNiBMIDAgNiBMIDAgNC4yIEwgNCA0LjIgTCA0LjIgNC4yIEwgNC4yIDAgTCA2IDAgTCA2IDYgTCA2IDYgWiIgZmlsbD0iIzAwMDAwMCIvPg0JPC9nPg08L3N2Zz4=");
|
|
118
|
+
background-position: bottom right;
|
|
119
|
+
padding: 0 3px 3px 0;
|
|
120
|
+
background-repeat: no-repeat;
|
|
121
|
+
background-origin: content-box;
|
|
122
|
+
background-size: cover;
|
|
123
|
+
box-sizing: border-box;
|
|
124
|
+
cursor: se-resize;
|
|
125
|
+
}
|
|
126
|
+
`,HH=pi.div`
|
|
127
|
+
.grid-container {
|
|
128
|
+
display: flex;
|
|
129
|
+
|
|
130
|
+
justify-content: center;
|
|
131
|
+
align-items: center;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.grid-item {
|
|
135
|
+
width: 100%;
|
|
136
|
+
height: 100%;
|
|
137
|
+
position: relative;
|
|
138
|
+
overflow: hidden;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.selected {
|
|
142
|
+
z-index: 5;
|
|
143
|
+
outline: 1px solid #cc0aac;
|
|
144
|
+
box-shadow: 0 0 10px #cc0aac;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.react-resizable-hide .react-resizable-handle {
|
|
148
|
+
display: none !important;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.react-grid-drag-handle {
|
|
152
|
+
cursor: move;
|
|
153
|
+
}
|
|
154
|
+
`,Ld=50,GH=2*Ld,YH=10,qH=e=>{const{activeCompDimension:t}=Om(),n=x.useMemo(()=>e.layout.reduce((o,i)=>o+i.h,0),[e.layout]),r=x.useMemo(()=>n*Ld+GH+YH*(e.layout.length+1),[n,e.layout]);return g.jsx(UH,{children:g.jsx(HH,{children:g.jsx(VH,{className:"layout",cols:12,rowHeight:Ld,layout:e.layout,onLayoutChange:e.onLayoutChange,onResizeStop:e.onResize,onDrop:e.onDrop,onDragStop:e.onDrag,onDropDragOver:()=>t,draggableCancel:".cancel-drag",preventCollision:!1,isDroppable:!0,autoSize:!0,margin:[0,0],containerPadding:[3,3],draggableHandle:".react-grid-drag-handle",style:{height:r},children:e.components})})})},KH=Rg.WidthProvider(yC),XH=pi.div`
|
|
155
|
+
.grid-container {
|
|
156
|
+
display: flex;
|
|
157
|
+
|
|
158
|
+
justify-content: center;
|
|
159
|
+
align-items: center;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.react-grid-item {
|
|
163
|
+
border: 1px solid transparent;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.selected {
|
|
167
|
+
border: 2px solid #cc0aac;
|
|
168
|
+
border-radius: 5px;
|
|
169
|
+
box-shadow: 0 0 10px #cc0aac;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.react-resizable-hide .react-resizable-handle {
|
|
173
|
+
display: none !important;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.react-grid-drag-handle {
|
|
177
|
+
cursor: move;
|
|
178
|
+
}
|
|
179
|
+
`,wC=e=>g.jsx(XH,{children:g.jsx(KH,{className:"layout",rowHeight:Ld,cols:12,isResizable:!1,isDraggable:!1,preventCollision:!0,margin:[0,0],layout:e.layout,children:e.components.map(t=>g.jsx("div",{children:t.component},t.id))})}),JH=pi.div`
|
|
180
|
+
display: flex;
|
|
181
|
+
flexdirection: column;
|
|
182
|
+
height: 100vh;
|
|
183
|
+
|
|
184
|
+
.mi-container {
|
|
185
|
+
flex: 1;
|
|
186
|
+
display: flex;
|
|
187
|
+
flex-direction: column;
|
|
188
|
+
height: 100%;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.mi-workspace {
|
|
192
|
+
flex: 1;
|
|
193
|
+
}
|
|
194
|
+
`,QH=()=>{const[e,t]=x.useState([]),[n,r]=x.useState([]),[o,i]=x.useState(!1),{projectMetadata:s}=$m(),{siteBackground:a,setSiteBackground:l}=Zw(),{siteBackgroundColor:c,siteBackgroundImage:d}=Zw(),u=async()=>{i(!0),await Tl(s.projectName,s.projectURL),i(!1),await vm(s.projectName,s.projectURL,{fetch:!1}),await Y8(s.projectName);const p=await k0(s.projectName);t(p.components),r(p.layout);const y=`${window.miDir}/${s.projectName}/src/theme.json`,v=await window.pfs.readFile(y,"utf8"),b=JSON.parse(v),_=b.tailwind,C=b.siteBackground;window.tailwind.config=_,L0(_),l(C)},f=j0(s.projectName,d),h=x.useMemo(()=>d?{backgroundImage:d?`url(${f})`:"",backgroundSize:"cover",backgroundRepeat:"no-repeat"}:c?{background:c||""}:{},[a,d,c,f]),m=async()=>{Object.assign(document.documentElement.style,{height:"100%"}),Object.assign(document.body.style,{height:"100%",margin:"0",padding:"0",...h})};return x.useEffect(()=>{!s.projectName&&!s.projectURL||u()},[s.projectName,s.projectURL]),x.useEffect(()=>{m()},[h]),g.jsx("div",{children:g.jsxs(JH,{children:[g.jsx(pV,{isVisible:o}),g.jsx("div",{className:"mi-container",children:g.jsx("div",{className:"mi-workspace",children:g.jsx(wC,{components:e,layout:n})})})]})})},ZH=x.forwardRef(({style:e,className:t,onMouseDown:n,onMouseUp:r,onTouchEnd:o,children:i,componentId:s},a)=>{const{selectedComponentId:l}=$m(),c=x.useMemo(()=>l===s,[l]),d=x.Children.toArray(i),u=d.filter(h=>h.key===".$resizableHandle-se"),f=d.filter(h=>h.key!==".$resizableHandle-se");return g.jsxs("div",{style:{...e},className:t+(c?" selected":""),ref:a,onMouseDown:n,onMouseUp:r,onTouchEnd:o,children:[g.jsx("div",{className:"grid-item "+(c?"selected":""),children:f}),u]})});class eG extends x.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}render(){const{hasError:t,error:n}=this.state,{children:r,fallback:o,fallbackProps:i}=this.props;return t&&(this.resetState(),o)?g.jsx(o,{error:n,...i}):r}resetState(){this.state={hasError:!1,error:null}}}const tG=e=>{const{onDragStart:t,onDragStop:n}=Om(),r=i=>{t(e.initialSize),i.dataTransfer.setData("text/plain",""),i.dataTransfer.setData("application/reactgridlayout",JSON.stringify({id:e.id,type:e.type,initialSize:e.initialSize,metadata:e.metadata}))},o=()=>{n()};return g.jsx("div",{className:"w-full h-full flex items-center justify-center",draggable:!0,unselectable:"on",onDragStart:r,onDragEnd:o,children:e.node})},nG={maxReconnectAttempts:5,reconnectInitialDelay:1e3,reconnectBackoffFactor:2},rG=(e,t,n)=>{const{maxReconnectAttempts:r,reconnectInitialDelay:o,reconnectBackoffFactor:i}={...nG,...n},s=x.useRef(null),a=x.useRef(0),l=x.useRef(null),c=x.useRef(!1),d=x.useRef([]),u=x.useRef(t),[f,h]=x.useState("idle"),[m,p]=x.useState(null);x.useEffect(()=>{u.current=t},[t]);const y=x.useCallback(()=>{console.log("WebSocket connected"),h("open"),p(null),a.current=0;const R=[...d.current];d.current=[],R.length>0&&(console.log(`Processing ${R.length} queued messages`),R.forEach(D=>{var k,F;try{(k=s.current)==null||k.send(D)}catch(W){console.error("Error sending queued message:",W),((F=s.current)==null?void 0:F.readyState)===WebSocket.OPEN&&d.current.push(D)}}))},[]),v=x.useCallback(R=>{console.log(`WebSocket closed: code=${R.code}, reason=${R.reason}, wasClean=${R.wasClean}`),h("closed"),l.current&&(clearTimeout(l.current),l.current=null);const D=R.code===1e3;if(!c.current&&!D)if(a.current<r){const k=a.current+1,F=o*Math.pow(i,k-1);console.log(`Attempting WebSocket reconnect ${k}/${r} in ${F}ms...`),h("connecting"),l.current=setTimeout(()=>{s.current=null,C(),l.current=null},F),a.current=k}else console.error(`WebSocket max reconnect attempts (${r}) reached.`),p(new Error(`Maximum reconnection attempts reached (${r})`));else c.current=!1},[r,o,i]),b=x.useCallback(R=>{console.error("WebSocket error:",R);const D=R instanceof ErrorEvent?R.message:"Unknown WebSocket error";p(new Error(D))},[]),_=x.useCallback(R=>{try{const D=JSON.parse(R.data);u.current(D)}catch(D){console.error("Failed to parse WebSocket message:",D,R.data),p(D instanceof Error?D:new Error("Invalid message format"))}},[]),C=x.useCallback(()=>{const R=e();if(!R){console.log("WebSocket connect skipped: No URL provided");return}if(s.current){const D=s.current.readyState;if(D===WebSocket.OPEN||D===WebSocket.CONNECTING){console.log("WebSocket connect skipped: Already connecting/connected",{readyState:D,status:f});return}s.current=null}l.current&&(clearTimeout(l.current),l.current=null),console.log("Initiating WebSocket connection to:",R),h("connecting"),p(null);try{const D=new WebSocket(R);s.current=D,D.onopen=y,D.onclose=v,D.onerror=b,D.onmessage=_}catch(D){console.error("Failed to create WebSocket:",D),p(D instanceof Error?D:new Error("Failed to create WebSocket")),h("closed")}},[e,y,v,b,_]),N=x.useCallback(()=>{if(console.log("Initiating intentional WebSocket disconnect"),c.current=!0,l.current&&(clearTimeout(l.current),l.current=null),s.current){h("closing");try{s.current.close(1e3,"Client disconnecting")}catch(R){console.error("Error during WebSocket close:",R),h("closed"),s.current=null}}else h("closed");a.current=0},[]),A=x.useCallback(R=>{var F,W;const D=JSON.stringify(R);if(((F=s.current)==null?void 0:F.readyState)===WebSocket.OPEN)try{return(W=s.current)==null||W.send(D),!0}catch(B){return console.error("WebSocket send error:",B),p(B instanceof Error?B:new Error("Failed to send message")),!1}else return console.log("WebSocket not open, queuing message"),d.current.push(D),!0},[]);return x.useEffect(()=>(e()?C():f!=="idle"&&f!=="closed"&&N(),()=>{s.current&&N()}),[e,C,N]),{connectionStatus:f,sendMessage:A,lastError:m}};var Bl=e=>e.type==="checkbox",ps=e=>e instanceof Date,zn=e=>e==null;const vC=e=>typeof e=="object";var nn=e=>!zn(e)&&!Array.isArray(e)&&vC(e)&&!ps(e),bC=e=>nn(e)&&e.target?Bl(e.target)?e.target.checked:e.target.value:e,oG=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,_C=(e,t)=>e.has(oG(t)),iG=e=>{const t=e.constructor&&e.constructor.prototype;return nn(t)&&t.hasOwnProperty("isPrototypeOf")},Pg=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Gn(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(!(Pg&&(e instanceof Blob||r))&&(n||nn(e)))if(t=n?[]:{},!n&&!iG(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=Gn(e[o]));else return e;return t}var jd=e=>Array.isArray(e)?e.filter(Boolean):[],rn=e=>e===void 0,De=(e,t,n)=>{if(!t||!nn(e))return n;const r=jd(t.split(/[,[\].]+?/)).reduce((o,i)=>zn(o)?o:o[i],e);return rn(r)||r===e?rn(e[t])?n:e[t]:r},Er=e=>typeof e=="boolean",Ag=e=>/^\w*$/.test(e),SC=e=>jd(e.replace(/["|']|\]/g,"").split(/\.|\[/)),At=(e,t,n)=>{let r=-1;const o=Ag(t)?[t]:SC(t),i=o.length,s=i-1;for(;++r<i;){const a=o[r];let l=n;if(r!==s){const c=e[a];l=nn(c)||Array.isArray(c)?c:isNaN(+o[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=l,e=e[a]}return e};const Fd={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Fr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Uo={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},xC=x.createContext(null),$d=()=>x.useContext(xC),sG=e=>{const{children:t,...n}=e;return x.createElement(xC.Provider,{value:n},t)};var EC=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(o,i,{get:()=>{const s=i;return t._proxyFormState[s]!==Fr.all&&(t._proxyFormState[s]=!r||Fr.all),n&&(n[s]=!0),e[s]}});return o},Yn=e=>nn(e)&&!Object.keys(e).length,CC=(e,t,n,r)=>{n(e);const{name:o,...i}=e;return Yn(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(s=>t[s]===(!r||Fr.all))},Wl=e=>Array.isArray(e)?e:[e],NC=(e,t,n)=>!e||!t||e===t||Wl(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function Tg(e){const t=x.useRef(e);t.current=e,x.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function aG(e){const t=$d(),{control:n=t.control,disabled:r,name:o,exact:i}=e,[s,a]=x.useState(n._formState),l=x.useRef(!0),c=x.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=x.useRef(o);return d.current=o,Tg({disabled:r,next:u=>l.current&&NC(d.current,u.name,i)&&CC(u,c.current,n._updateFormState)&&a({...n._formState,...u}),subject:n._subjects.state}),x.useEffect(()=>(l.current=!0,c.current.isValid&&n._updateValid(!0),()=>{l.current=!1}),[n]),x.useMemo(()=>EC(s,n,c.current,!1),[s,n])}var mo=e=>typeof e=="string",RC=(e,t,n,r,o)=>mo(e)?(r&&t.watch.add(e),De(n,e,o)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),De(n,i))):(r&&(t.watchAll=!0),n);function lG(e){const t=$d(),{control:n=t.control,name:r,defaultValue:o,disabled:i,exact:s}=e,a=x.useRef(r);a.current=r,Tg({disabled:i,subject:n._subjects.values,next:d=>{NC(a.current,d.name,s)&&c(Gn(RC(a.current,n._names,d.values||n._formValues,!1,o)))}});const[l,c]=x.useState(n._getWatch(r,o));return x.useEffect(()=>n._removeUnmounted()),l}function cG(e){const t=$d(),{name:n,disabled:r,control:o=t.control,shouldUnregister:i}=e,s=_C(o._names.array,n),a=lG({control:o,name:n,defaultValue:De(o._formValues,n,De(o._defaultValues,n,e.defaultValue)),exact:!0}),l=aG({control:o,name:n,exact:!0}),c=x.useRef(o.register(n,{...e.rules,value:a,...Er(e.disabled)?{disabled:e.disabled}:{}})),d=x.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!De(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!De(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!De(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!De(l.validatingFields,n)},error:{enumerable:!0,get:()=>De(l.errors,n)}}),[l,n]),u=x.useMemo(()=>({name:n,value:a,...Er(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:f=>c.current.onChange({target:{value:bC(f),name:n},type:Fd.CHANGE}),onBlur:()=>c.current.onBlur({target:{value:De(o._formValues,n),name:n},type:Fd.BLUR}),ref:f=>{const h=De(o._fields,n);h&&f&&(h._f.ref={focus:()=>f.focus(),select:()=>f.select(),setCustomValidity:m=>f.setCustomValidity(m),reportValidity:()=>f.reportValidity()})}}),[n,o._formValues,r,l.disabled,a,o._fields]);return x.useEffect(()=>{const f=o._options.shouldUnregister||i,h=(m,p)=>{const y=De(o._fields,m);y&&y._f&&(y._f.mount=p)};if(h(n,!0),f){const m=Gn(De(o._options.defaultValues,n));At(o._defaultValues,n,m),rn(De(o._formValues,n))&&At(o._formValues,n,m)}return!s&&o.register(n),()=>{(s?f&&!o._state.action:f)?o.unregister(n):h(n,!1)}},[n,o,s,i]),x.useEffect(()=>{o._updateDisabledField({disabled:r,fields:o._fields,name:n})},[r,n,o]),x.useMemo(()=>({field:u,formState:l,fieldState:d}),[u,l,d])}const uG=e=>e.render(cG(e));var dG=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},PC=e=>({isOnSubmit:!e||e===Fr.onSubmit,isOnBlur:e===Fr.onBlur,isOnChange:e===Fr.onChange,isOnAll:e===Fr.all,isOnTouch:e===Fr.onTouched}),AC=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Vl=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const i=De(e,o);if(i){const{_f:s,...a}=i;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],o)&&!r)return!0;if(s.ref&&t(s.ref,s.name)&&!r)return!0;if(Vl(a,t))break}else if(nn(a)&&Vl(a,t))break}}};var fG=(e,t,n)=>{const r=Wl(De(e,n));return At(r,"root",t[n]),At(e,n,r),e},Dg=e=>e.type==="file",go=e=>typeof e=="function",zd=e=>{if(!Pg)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Bd=e=>mo(e),Mg=e=>e.type==="radio",Wd=e=>e instanceof RegExp;const TC={value:!1,isValid:!1},DC={value:!0,isValid:!0};var MC=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&&!rn(e[0].attributes.value)?rn(e[0].value)||e[0].value===""?DC:{value:e[0].value,isValid:!0}:DC:TC}return TC};const IC={isValid:!1,value:null};var OC=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,IC):IC;function kC(e,t,n="validate"){if(Bd(e)||Array.isArray(e)&&e.every(Bd)||Er(e)&&!e)return{type:n,message:Bd(e)?e:"",ref:t}}var da=e=>nn(e)&&!Wd(e)?e:{value:e,message:""},LC=async(e,t,n,r,o,i)=>{const{ref:s,refs:a,required:l,maxLength:c,minLength:d,min:u,max:f,pattern:h,validate:m,name:p,valueAsNumber:y,mount:v}=e._f,b=De(n,p);if(!v||t.has(p))return{};const _=a?a[0]:s,C=B=>{o&&_.reportValidity&&(_.setCustomValidity(Er(B)?"":B||""),_.reportValidity())},N={},A=Mg(s),R=Bl(s),D=A||R,k=(y||Dg(s))&&rn(s.value)&&rn(b)||zd(s)&&s.value===""||b===""||Array.isArray(b)&&!b.length,F=dG.bind(null,p,r,N),W=(B,T,Q,K=Uo.maxLength,Y=Uo.minLength)=>{const ee=B?T:Q;N[p]={type:B?K:Y,message:ee,ref:s,...F(B?K:Y,ee)}};if(i?!Array.isArray(b)||!b.length:l&&(!D&&(k||zn(b))||Er(b)&&!b||R&&!MC(a).isValid||A&&!OC(a).isValid)){const{value:B,message:T}=Bd(l)?{value:!!l,message:l}:da(l);if(B&&(N[p]={type:Uo.required,message:T,ref:_,...F(Uo.required,T)},!r))return C(T),N}if(!k&&(!zn(u)||!zn(f))){let B,T;const Q=da(f),K=da(u);if(!zn(b)&&!isNaN(b)){const Y=s.valueAsNumber||b&&+b;zn(Q.value)||(B=Y>Q.value),zn(K.value)||(T=Y<K.value)}else{const Y=s.valueAsDate||new Date(b),ee=X=>new Date(new Date().toDateString()+" "+X),G=s.type=="time",re=s.type=="week";mo(Q.value)&&b&&(B=G?ee(b)>ee(Q.value):re?b>Q.value:Y>new Date(Q.value)),mo(K.value)&&b&&(T=G?ee(b)<ee(K.value):re?b<K.value:Y<new Date(K.value))}if((B||T)&&(W(!!B,Q.message,K.message,Uo.max,Uo.min),!r))return C(N[p].message),N}if((c||d)&&!k&&(mo(b)||i&&Array.isArray(b))){const B=da(c),T=da(d),Q=!zn(B.value)&&b.length>+B.value,K=!zn(T.value)&&b.length<+T.value;if((Q||K)&&(W(Q,B.message,T.message),!r))return C(N[p].message),N}if(h&&!k&&mo(b)){const{value:B,message:T}=da(h);if(Wd(B)&&!b.match(B)&&(N[p]={type:Uo.pattern,message:T,ref:s,...F(Uo.pattern,T)},!r))return C(T),N}if(m){if(go(m)){const B=await m(b,n),T=kC(B,_);if(T&&(N[p]={...T,...F(Uo.validate,T.message)},!r))return C(T.message),N}else if(nn(m)){let B={};for(const T in m){if(!Yn(B)&&!r)break;const Q=kC(await m[T](b,n),_,T);Q&&(B={...Q,...F(T,Q.message)},C(Q.message),r&&(N[p]=B))}if(!Yn(B)&&(N[p]={ref:_,...B},!r))return N}}return C(!0),N};function hG(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=rn(e)?r++:e[t[r++]];return e}function pG(e){for(const t in e)if(e.hasOwnProperty(t)&&!rn(e[t]))return!1;return!0}function un(e,t){const n=Array.isArray(t)?t:Ag(t)?[t]:SC(t),r=n.length===1?e:hG(e,n),o=n.length-1,i=n[o];return r&&delete r[i],o!==0&&(nn(r)&&Yn(r)||Array.isArray(r)&&pG(r))&&un(e,n.slice(0,-1)),e}var Ig=()=>{let e=[];return{get observers(){return e},next:o=>{for(const i of e)i.next&&i.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(i=>i!==o)}}),unsubscribe:()=>{e=[]}}},Og=e=>zn(e)||!vC(e);function wi(e,t){if(Og(e)||Og(t))return e===t;if(ps(e)&&ps(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 i=e[o];if(!r.includes(o))return!1;if(o!=="ref"){const s=t[o];if(ps(i)&&ps(s)||nn(i)&&nn(s)||Array.isArray(i)&&Array.isArray(s)?!wi(i,s):i!==s)return!1}}return!0}var jC=e=>e.type==="select-multiple",mG=e=>Mg(e)||Bl(e),kg=e=>zd(e)&&e.isConnected,FC=e=>{for(const t in e)if(go(e[t]))return!0;return!1};function Vd(e,t={}){const n=Array.isArray(e);if(nn(e)||n)for(const r in e)Array.isArray(e[r])||nn(e[r])&&!FC(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Vd(e[r],t[r])):zn(e[r])||(t[r]=!0);return t}function $C(e,t,n){const r=Array.isArray(e);if(nn(e)||r)for(const o in e)Array.isArray(e[o])||nn(e[o])&&!FC(e[o])?rn(t)||Og(n[o])?n[o]=Array.isArray(e[o])?Vd(e[o],[]):{...Vd(e[o])}:$C(e[o],zn(t)?{}:t[o],n[o]):n[o]=!wi(e[o],t[o]);return n}var Ul=(e,t)=>$C(e,t,Vd(t)),zC=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>rn(e)?e:t?e===""?NaN:e&&+e:n&&mo(e)?new Date(e):r?r(e):e;function Lg(e){const t=e.ref;return Dg(t)?t.files:Mg(t)?OC(e.refs).value:jC(t)?[...t.selectedOptions].map(({value:n})=>n):Bl(t)?MC(e.refs).value:zC(rn(t.value)?e.ref.value:t.value,e)}var gG=(e,t,n,r)=>{const o={};for(const i of e){const s=De(t,i);s&&At(o,i,s._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Hl=e=>rn(e)?e:Wd(e)?e.source:nn(e)?Wd(e.value)?e.value.source:e.value:e;const BC="AsyncFunction";var yG=e=>!!e&&!!e.validate&&!!(go(e.validate)&&e.validate.constructor.name===BC||nn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===BC)),wG=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function WC(e,t,n){const r=De(e,n);if(r||Ag(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const i=o.join("."),s=De(t,i),a=De(e,i);if(s&&!Array.isArray(s)&&n!==i)return{name:n};if(a&&a.type)return{name:i,error:a};o.pop()}return{name:n}}var vG=(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,bG=(e,t)=>!jd(De(e,t)).length&&un(e,t);const _G={mode:Fr.onSubmit,reValidateMode:Fr.onChange,shouldFocusError:!0};function SG(e={}){let t={..._G,...e},n={submitCount:0,isDirty:!1,isLoading:go(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=nn(t.defaultValues)||nn(t.values)?Gn(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:Gn(o),s={action:!1,mount:!1,watch:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l,c=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},u={values:Ig(),array:Ig(),state:Ig()},f=PC(t.mode),h=PC(t.reValidateMode),m=t.criteriaMode===Fr.all,p=M=>q=>{clearTimeout(c),c=setTimeout(M,q)},y=async M=>{if(!t.disabled&&(d.isValid||M)){const q=t.resolver?Yn((await D()).errors):await F(r,!0);q!==n.isValid&&u.state.next({isValid:q})}},v=(M,q)=>{!t.disabled&&(d.isValidating||d.validatingFields)&&((M||Array.from(a.mount)).forEach(te=>{te&&(q?At(n.validatingFields,te,q):un(n.validatingFields,te))}),u.state.next({validatingFields:n.validatingFields,isValidating:!Yn(n.validatingFields)}))},b=(M,q=[],te,Se,ue=!0,ye=!0)=>{if(Se&&te&&!t.disabled){if(s.action=!0,ye&&Array.isArray(De(r,M))){const xe=te(De(r,M),Se.argA,Se.argB);ue&&At(r,M,xe)}if(ye&&Array.isArray(De(n.errors,M))){const xe=te(De(n.errors,M),Se.argA,Se.argB);ue&&At(n.errors,M,xe),bG(n.errors,M)}if(d.touchedFields&&ye&&Array.isArray(De(n.touchedFields,M))){const xe=te(De(n.touchedFields,M),Se.argA,Se.argB);ue&&At(n.touchedFields,M,xe)}d.dirtyFields&&(n.dirtyFields=Ul(o,i)),u.state.next({name:M,isDirty:B(M,q),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else At(i,M,q)},_=(M,q)=>{At(n.errors,M,q),u.state.next({errors:n.errors})},C=M=>{n.errors=M,u.state.next({errors:n.errors,isValid:!1})},N=(M,q,te,Se)=>{const ue=De(r,M);if(ue){const ye=De(i,M,rn(te)?De(o,M):te);rn(ye)||Se&&Se.defaultChecked||q?At(i,M,q?ye:Lg(ue._f)):K(M,ye),s.mount&&y()}},A=(M,q,te,Se,ue)=>{let ye=!1,xe=!1;const Ae={name:M};if(!t.disabled){const Ze=!!(De(r,M)&&De(r,M)._f&&De(r,M)._f.disabled);if(!te||Se){d.isDirty&&(xe=n.isDirty,n.isDirty=Ae.isDirty=B(),ye=xe!==Ae.isDirty);const P=Ze||wi(De(o,M),q);xe=!!(!Ze&&De(n.dirtyFields,M)),P||Ze?un(n.dirtyFields,M):At(n.dirtyFields,M,!0),Ae.dirtyFields=n.dirtyFields,ye=ye||d.dirtyFields&&xe!==!P}if(te){const P=De(n.touchedFields,M);P||(At(n.touchedFields,M,te),Ae.touchedFields=n.touchedFields,ye=ye||d.touchedFields&&P!==te)}ye&&ue&&u.state.next(Ae)}return ye?Ae:{}},R=(M,q,te,Se)=>{const ue=De(n.errors,M),ye=d.isValid&&Er(q)&&n.isValid!==q;if(t.delayError&&te?(l=p(()=>_(M,te)),l(t.delayError)):(clearTimeout(c),l=null,te?At(n.errors,M,te):un(n.errors,M)),(te?!wi(ue,te):ue)||!Yn(Se)||ye){const xe={...Se,...ye&&Er(q)?{isValid:q}:{},errors:n.errors,name:M};n={...n,...xe},u.state.next(xe)}},D=async M=>{v(M,!0);const q=await t.resolver(i,t.context,gG(M||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return v(M),q},k=async M=>{const{errors:q}=await D(M);if(M)for(const te of M){const Se=De(q,te);Se?At(n.errors,te,Se):un(n.errors,te)}else n.errors=q;return q},F=async(M,q,te={valid:!0})=>{for(const Se in M){const ue=M[Se];if(ue){const{_f:ye,...xe}=ue;if(ye){const Ae=a.array.has(ye.name),Ze=ue._f&&yG(ue._f);Ze&&d.validatingFields&&v([Se],!0);const P=await LC(ue,a.disabled,i,m,t.shouldUseNativeValidation&&!q,Ae);if(Ze&&d.validatingFields&&v([Se]),P[ye.name]&&(te.valid=!1,q))break;!q&&(De(P,ye.name)?Ae?fG(n.errors,P,ye.name):At(n.errors,ye.name,P[ye.name]):un(n.errors,ye.name))}!Yn(xe)&&await F(xe,q,te)}}return te.valid},W=()=>{for(const M of a.unMount){const q=De(r,M);q&&(q._f.refs?q._f.refs.every(te=>!kg(te)):!kg(q._f.ref))&&H(M)}a.unMount=new Set},B=(M,q)=>!t.disabled&&(M&&q&&At(i,M,q),!wi(J(),o)),T=(M,q,te)=>RC(M,a,{...s.mount?i:rn(q)?o:mo(M)?{[M]:q}:q},te,q),Q=M=>jd(De(s.mount?i:o,M,t.shouldUnregister?De(o,M,[]):[])),K=(M,q,te={})=>{const Se=De(r,M);let ue=q;if(Se){const ye=Se._f;ye&&(!ye.disabled&&At(i,M,zC(q,ye)),ue=zd(ye.ref)&&zn(q)?"":q,jC(ye.ref)?[...ye.ref.options].forEach(xe=>xe.selected=ue.includes(xe.value)):ye.refs?Bl(ye.ref)?ye.refs.length>1?ye.refs.forEach(xe=>(!xe.defaultChecked||!xe.disabled)&&(xe.checked=Array.isArray(ue)?!!ue.find(Ae=>Ae===xe.value):ue===xe.value)):ye.refs[0]&&(ye.refs[0].checked=!!ue):ye.refs.forEach(xe=>xe.checked=xe.value===ue):Dg(ye.ref)?ye.ref.value="":(ye.ref.value=ue,ye.ref.type||u.values.next({name:M,values:{...i}})))}(te.shouldDirty||te.shouldTouch)&&A(M,ue,te.shouldTouch,te.shouldDirty,!0),te.shouldValidate&&X(M)},Y=(M,q,te)=>{for(const Se in q){const ue=q[Se],ye=`${M}.${Se}`,xe=De(r,ye);(a.array.has(M)||nn(ue)||xe&&!xe._f)&&!ps(ue)?Y(ye,ue,te):K(ye,ue,te)}},ee=(M,q,te={})=>{const Se=De(r,M),ue=a.array.has(M),ye=Gn(q);At(i,M,ye),ue?(u.array.next({name:M,values:{...i}}),(d.isDirty||d.dirtyFields)&&te.shouldDirty&&u.state.next({name:M,dirtyFields:Ul(o,i),isDirty:B(M,ye)})):Se&&!Se._f&&!zn(ye)?Y(M,ye,te):K(M,ye,te),AC(M,a)&&u.state.next({...n}),u.values.next({name:s.mount?M:void 0,values:{...i}})},G=async M=>{s.mount=!0;const q=M.target;let te=q.name,Se=!0;const ue=De(r,te),ye=()=>q.type?Lg(ue._f):bC(M),xe=Ae=>{Se=Number.isNaN(Ae)||ps(Ae)&&isNaN(Ae.getTime())||wi(Ae,De(i,te,Ae))};if(ue){let Ae,Ze;const P=ye(),S=M.type===Fd.BLUR||M.type===Fd.FOCUS_OUT,E=!wG(ue._f)&&!t.resolver&&!De(n.errors,te)&&!ue._f.deps||vG(S,De(n.touchedFields,te),n.isSubmitted,h,f),I=AC(te,a,S);At(i,te,P),S?(ue._f.onBlur&&ue._f.onBlur(M),l&&l(0)):ue._f.onChange&&ue._f.onChange(M);const U=A(te,P,S,!1),ie=!Yn(U)||I;if(!S&&u.values.next({name:te,type:M.type,values:{...i}}),E)return d.isValid&&(t.mode==="onBlur"&&S?y():S||y()),ie&&u.state.next({name:te,...I?{}:U});if(!S&&I&&u.state.next({...n}),t.resolver){const{errors:Z}=await D([te]);if(xe(P),Se){const Re=WC(n.errors,r,te),ct=WC(Z,r,Re.name||te);Ae=ct.error,te=ct.name,Ze=Yn(Z)}}else v([te],!0),Ae=(await LC(ue,a.disabled,i,m,t.shouldUseNativeValidation))[te],v([te]),xe(P),Se&&(Ae?Ze=!1:d.isValid&&(Ze=await F(r,!0)));Se&&(ue._f.deps&&X(ue._f.deps),R(te,Ze,Ae,U))}},re=(M,q)=>{if(De(n.errors,q)&&M.focus)return M.focus(),1},X=async(M,q={})=>{let te,Se;const ue=Wl(M);if(t.resolver){const ye=await k(rn(M)?M:ue);te=Yn(ye),Se=M?!ue.some(xe=>De(ye,xe)):te}else M?(Se=(await Promise.all(ue.map(async ye=>{const xe=De(r,ye);return await F(xe&&xe._f?{[ye]:xe}:xe)}))).every(Boolean),!(!Se&&!n.isValid)&&y()):Se=te=await F(r);return u.state.next({...!mo(M)||d.isValid&&te!==n.isValid?{}:{name:M},...t.resolver||!M?{isValid:te}:{},errors:n.errors}),q.shouldFocus&&!Se&&Vl(r,re,M?ue:a.mount),Se},J=M=>{const q={...s.mount?i:o};return rn(M)?q:mo(M)?De(q,M):M.map(te=>De(q,te))},se=(M,q)=>({invalid:!!De((q||n).errors,M),isDirty:!!De((q||n).dirtyFields,M),error:De((q||n).errors,M),isValidating:!!De(n.validatingFields,M),isTouched:!!De((q||n).touchedFields,M)}),L=M=>{M&&Wl(M).forEach(q=>un(n.errors,q)),u.state.next({errors:M?n.errors:{}})},ne=(M,q,te)=>{const Se=(De(r,M,{_f:{}})._f||{}).ref,ue=De(n.errors,M)||{},{ref:ye,message:xe,type:Ae,...Ze}=ue;At(n.errors,M,{...Ze,...q,ref:Se}),u.state.next({name:M,errors:n.errors,isValid:!1}),te&&te.shouldFocus&&Se&&Se.focus&&Se.focus()},fe=(M,q)=>go(M)?u.values.subscribe({next:te=>M(T(void 0,q),te)}):T(M,q,!0),H=(M,q={})=>{for(const te of M?Wl(M):a.mount)a.mount.delete(te),a.array.delete(te),q.keepValue||(un(r,te),un(i,te)),!q.keepError&&un(n.errors,te),!q.keepDirty&&un(n.dirtyFields,te),!q.keepTouched&&un(n.touchedFields,te),!q.keepIsValidating&&un(n.validatingFields,te),!t.shouldUnregister&&!q.keepDefaultValue&&un(o,te);u.values.next({values:{...i}}),u.state.next({...n,...q.keepDirty?{isDirty:B()}:{}}),!q.keepIsValid&&y()},ae=({disabled:M,name:q,field:te,fields:Se})=>{(Er(M)&&s.mount||M||a.disabled.has(q))&&(M?a.disabled.add(q):a.disabled.delete(q),A(q,Lg(te?te._f:De(Se,q)._f),!1,!1,!0))},V=(M,q={})=>{let te=De(r,M);const Se=Er(q.disabled)||Er(t.disabled);return At(r,M,{...te||{},_f:{...te&&te._f?te._f:{ref:{name:M}},name:M,mount:!0,...q}}),a.mount.add(M),te?ae({field:te,disabled:Er(q.disabled)?q.disabled:t.disabled,name:M}):N(M,!0,q.value),{...Se?{disabled:q.disabled||t.disabled}:{},...t.progressive?{required:!!q.required,min:Hl(q.min),max:Hl(q.max),minLength:Hl(q.minLength),maxLength:Hl(q.maxLength),pattern:Hl(q.pattern)}:{},name:M,onChange:G,onBlur:G,ref:ue=>{if(ue){V(M,q),te=De(r,M);const ye=rn(ue.value)&&ue.querySelectorAll&&ue.querySelectorAll("input,select,textarea")[0]||ue,xe=mG(ye),Ae=te._f.refs||[];if(xe?Ae.find(Ze=>Ze===ye):ye===te._f.ref)return;At(r,M,{_f:{...te._f,...xe?{refs:[...Ae.filter(kg),ye,...Array.isArray(De(o,M))?[{}]:[]],ref:{type:ye.type,name:M}}:{ref:ye}}}),N(M,!1,void 0,ye)}else te=De(r,M,{}),te._f&&(te._f.mount=!1),(t.shouldUnregister||q.shouldUnregister)&&!(_C(a.array,M)&&s.action)&&a.unMount.add(M)}}},de=()=>t.shouldFocusError&&Vl(r,re,a.mount),ge=M=>{Er(M)&&(u.state.next({disabled:M}),Vl(r,(q,te)=>{const Se=De(r,te);Se&&(q.disabled=Se._f.disabled||M,Array.isArray(Se._f.refs)&&Se._f.refs.forEach(ue=>{ue.disabled=Se._f.disabled||M}))},0,!1))},pe=(M,q)=>async te=>{let Se;te&&(te.preventDefault&&te.preventDefault(),te.persist&&te.persist());let ue=Gn(i);if(a.disabled.size)for(const ye of a.disabled)At(ue,ye,void 0);if(u.state.next({isSubmitting:!0}),t.resolver){const{errors:ye,values:xe}=await D();n.errors=ye,ue=xe}else await F(r);if(un(n.errors,"root"),Yn(n.errors)){u.state.next({errors:{}});try{await M(ue,te)}catch(ye){Se=ye}}else q&&await q({...n.errors},te),de(),setTimeout(de);if(u.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Yn(n.errors)&&!Se,submitCount:n.submitCount+1,errors:n.errors}),Se)throw Se},oe=(M,q={})=>{De(r,M)&&(rn(q.defaultValue)?ee(M,Gn(De(o,M))):(ee(M,q.defaultValue),At(o,M,Gn(q.defaultValue))),q.keepTouched||un(n.touchedFields,M),q.keepDirty||(un(n.dirtyFields,M),n.isDirty=q.defaultValue?B(M,Gn(De(o,M))):B()),q.keepError||(un(n.errors,M),d.isValid&&y()),u.state.next({...n}))},$=(M,q={})=>{const te=M?Gn(M):o,Se=Gn(te),ue=Yn(M),ye=ue?o:Se;if(q.keepDefaultValues||(o=te),!q.keepValues){if(q.keepDirtyValues){const xe=new Set([...a.mount,...Object.keys(Ul(o,i))]);for(const Ae of Array.from(xe))De(n.dirtyFields,Ae)?At(ye,Ae,De(i,Ae)):ee(Ae,De(ye,Ae))}else{if(Pg&&rn(M))for(const xe of a.mount){const Ae=De(r,xe);if(Ae&&Ae._f){const Ze=Array.isArray(Ae._f.refs)?Ae._f.refs[0]:Ae._f.ref;if(zd(Ze)){const P=Ze.closest("form");if(P){P.reset();break}}}}r={}}i=t.shouldUnregister?q.keepDefaultValues?Gn(o):{}:Gn(ye),u.array.next({values:{...ye}}),u.values.next({values:{...ye}})}a={mount:q.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!d.isValid||!!q.keepIsValid||!!q.keepDirtyValues,s.watch=!!t.shouldUnregister,u.state.next({submitCount:q.keepSubmitCount?n.submitCount:0,isDirty:ue?!1:q.keepDirty?n.isDirty:!!(q.keepDefaultValues&&!wi(M,o)),isSubmitted:q.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:ue?{}:q.keepDirtyValues?q.keepDefaultValues&&i?Ul(o,i):n.dirtyFields:q.keepDefaultValues&&M?Ul(o,M):q.keepDirty?n.dirtyFields:{},touchedFields:q.keepTouched?n.touchedFields:{},errors:q.keepErrors?n.errors:{},isSubmitSuccessful:q.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},j=(M,q)=>$(go(M)?M(i):M,q);return{control:{register:V,unregister:H,getFieldState:se,handleSubmit:pe,setError:ne,_executeSchema:D,_getWatch:T,_getDirty:B,_updateValid:y,_removeUnmounted:W,_updateFieldArray:b,_updateDisabledField:ae,_getFieldArray:Q,_reset:$,_resetDefaultValues:()=>go(t.defaultValues)&&t.defaultValues().then(M=>{j(M,t.resetOptions),u.state.next({isLoading:!1})}),_updateFormState:M=>{n={...n,...M}},_disableForm:ge,_subjects:u,_proxyFormState:d,_setErrors:C,get _fields(){return r},get _formValues(){return i},get _state(){return s},set _state(M){s=M},get _defaultValues(){return o},get _names(){return a},set _names(M){a=M},get _formState(){return n},set _formState(M){n=M},get _options(){return t},set _options(M){t={...t,...M}}},trigger:X,register:V,handleSubmit:pe,watch:fe,setValue:ee,getValues:J,reset:j,resetField:oe,clearErrors:L,unregister:H,setError:ne,setFocus:(M,q={})=>{const te=De(r,M),Se=te&&te._f;if(Se){const ue=Se.refs?Se.refs[0]:Se.ref;ue.focus&&(ue.focus(),q.shouldSelect&&go(ue.select)&&ue.select())}},getFieldState:se}}function xG(e={}){const t=x.useRef(void 0),n=x.useRef(void 0),[r,o]=x.useState({isDirty:!1,isValidating:!1,isLoading:go(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:go(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...SG(e),formState:r});const i=t.current.control;return i._options=e,Tg({subject:i._subjects.state,next:s=>{CC(s,i._proxyFormState,i._updateFormState,!0)&&o({...i._formState})}}),x.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),x.useEffect(()=>{if(i._proxyFormState.isDirty){const s=i._getDirty();s!==r.isDirty&&i._subjects.state.next({isDirty:s})}},[i,r.isDirty]),x.useEffect(()=>{e.values&&!wi(e.values,n.current)?(i._reset(e.values,i._options.resetOptions),n.current=e.values,o(s=>({...s}))):i._resetDefaultValues()},[e.values,i]),x.useEffect(()=>{e.errors&&i._setErrors(e.errors)},[e.errors,i]),x.useEffect(()=>{i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),x.useEffect(()=>{e.shouldUnregister&&i._subjects.values.next({values:i._getWatch()})},[e.shouldUnregister,i]),t.current.formState=EC(r,i),t.current}function VC(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Gl(...e){return t=>{let n=!1;const r=e.map(o=>{const i=VC(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():VC(e[o],null)}}}}function Fe(...e){return w.useCallback(Gl(...e),e)}var $r=w.forwardRef((e,t)=>{const{children:n,...r}=e,o=w.Children.toArray(n),i=o.find(EG);if(i){const s=i.props.children,a=o.map(l=>l===i?w.Children.count(s)>1?w.Children.only(null):w.isValidElement(s)?s.props.children:null:l);return g.jsx(jg,{...r,ref:t,children:w.isValidElement(s)?w.cloneElement(s,void 0,a):null})}return g.jsx(jg,{...r,ref:t,children:n})});$r.displayName="Slot";var jg=w.forwardRef((e,t)=>{const{children:n,...r}=e;if(w.isValidElement(n)){const o=NG(n),i=CG(r,n.props);return n.type!==w.Fragment&&(i.ref=t?Gl(t,o):o),w.cloneElement(n,i)}return w.Children.count(n)>1?w.Children.only(null):null});jg.displayName="SlotClone";var Ud=({children:e})=>g.jsx(g.Fragment,{children:e});function EG(e){return w.isValidElement(e)&&e.type===Ud}function CG(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function NG(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 RG=$r;const PG=Object.freeze(Object.defineProperty({__proto__:null,Root:RG,Slot:$r,Slottable:Ud},Symbol.toStringTag,{value:"Module"}));var AG=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Pe=AG.reduce((e,t)=>{const n=w.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?$r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Hd(e,t){e&&Xc.flushSync(()=>e.dispatchEvent(t))}var TG="VisuallyHidden",Fg=w.forwardRef((e,t)=>g.jsx(Pe.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}}));Fg.displayName=TG;var UC=Fg;function DG(e,t){const n=w.createContext(t),r=i=>{const{children:s,...a}=i,l=w.useMemo(()=>a,Object.values(a));return g.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=w.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function Tt(e,t=[]){let n=[];function r(i,s){const a=w.createContext(s),l=n.length;n=[...n,s];const c=u=>{var v;const{scope:f,children:h,...m}=u,p=((v=f==null?void 0:f[e])==null?void 0:v[l])||a,y=w.useMemo(()=>m,Object.values(m));return g.jsx(p.Provider,{value:y,children:h})};c.displayName=i+"Provider";function d(u,f){var p;const h=((p=f==null?void 0:f[e])==null?void 0:p[l])||a,m=w.useContext(h);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${u}\` must be used within \`${i}\``)}return[c,d]}const o=()=>{const i=n.map(s=>w.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return w.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,MG(o,...t)]}function MG(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const u=l(i)[`__scope${c}`];return{...a,...u}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function vi(e){const t=e+"CollectionProvider",[n,r]=Tt(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:m,children:p}=h,y=x.useRef(null),v=x.useRef(new Map).current;return g.jsx(o,{scope:m,itemMap:v,collectionRef:y,children:p})};s.displayName=t;const a=e+"CollectionSlot",l=x.forwardRef((h,m)=>{const{scope:p,children:y}=h,v=i(a,p),b=Fe(m,v.collectionRef);return g.jsx($r,{ref:b,children:y})});l.displayName=a;const c=e+"CollectionItemSlot",d="data-radix-collection-item",u=x.forwardRef((h,m)=>{const{scope:p,children:y,...v}=h,b=x.useRef(null),_=Fe(m,b),C=i(c,p);return x.useEffect(()=>(C.itemMap.set(b,{ref:b,...v}),()=>void C.itemMap.delete(b))),g.jsx($r,{[d]:"",ref:_,children:y})});u.displayName=c;function f(h){const m=i(e+"CollectionConsumer",h);return x.useCallback(()=>{const y=m.collectionRef.current;if(!y)return[];const v=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(m.itemMap.values()).sort((C,N)=>v.indexOf(C.ref.current)-v.indexOf(N.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:s,Slot:l,ItemSlot:u},f,r]}function be(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 Ct(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Ft({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=IG({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Ct(n),l=w.useCallback(c=>{if(i){const u=typeof c=="function"?c(e):c;u!==e&&a(u)}else o(c)},[i,e,o,a]);return[s,l]}function IG({defaultProp:e,onChange:t}){const n=w.useState(e),[r]=n,o=w.useRef(r),i=Ct(t);return w.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var Zt=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{};function OG(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var Bt=e=>{const{present:t,children:n}=e,r=kG(t),o=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),i=Fe(r.ref,LG(o));return typeof n=="function"||r.isPresent?w.cloneElement(o,{ref:i}):null};Bt.displayName="Presence";function kG(e){const[t,n]=w.useState(),r=w.useRef({}),o=w.useRef(e),i=w.useRef("none"),s=e?"mounted":"unmounted",[a,l]=OG(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const c=Gd(r.current);i.current=a==="mounted"?c:"none"},[a]),Zt(()=>{const c=r.current,d=o.current;if(d!==e){const f=i.current,h=Gd(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&f!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Zt(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,u=h=>{const p=Gd(r.current).includes(h.animationName);if(h.target===t&&p&&(l("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},f=h=>{h.target===t&&(i.current=Gd(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:w.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Gd(e){return(e==null?void 0:e.animationName)||"none"}function LG(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var jG=w.useId||(()=>{}),FG=0;function on(e){const[t,n]=w.useState(jG());return Zt(()=>{e||n(r=>r??String(FG++))},[e]),e||(t?`radix-${t}`:"")}var $g="Collapsible",[$G,HC]=Tt($g),[zG,zg]=$G($g),GC=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l=!1,c]=Ft({prop:r,defaultProp:o,onChange:s});return g.jsx(zG,{scope:n,disabled:i,contentId:on(),open:l,onOpenToggle:w.useCallback(()=>c(d=>!d),[c]),children:g.jsx(Pe.div,{"data-state":Ug(l),"data-disabled":i?"":void 0,...a,ref:t})})});GC.displayName=$g;var YC="CollapsibleTrigger",Bg=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=zg(YC,n);return g.jsx(Pe.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Ug(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:be(e.onClick,o.onOpenToggle)})});Bg.displayName=YC;var Wg="CollapsibleContent",Vg=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=zg(Wg,e.__scopeCollapsible);return g.jsx(Bt,{present:n||o.open,children:({present:i})=>g.jsx(BG,{...r,ref:t,present:i})})});Vg.displayName=Wg;var BG=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=zg(Wg,n),[a,l]=w.useState(r),c=w.useRef(null),d=Fe(t,c),u=w.useRef(0),f=u.current,h=w.useRef(0),m=h.current,p=s.open||a,y=w.useRef(p),v=w.useRef(void 0);return w.useEffect(()=>{const b=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(b)},[]),Zt(()=>{const b=c.current;if(b){v.current=v.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const _=b.getBoundingClientRect();u.current=_.height,h.current=_.width,y.current||(b.style.transitionDuration=v.current.transitionDuration,b.style.animationName=v.current.animationName),l(r)}},[s.open,r]),g.jsx(Pe.div,{"data-state":Ug(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!p,...i,ref:d,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:p&&o})});function Ug(e){return e?"open":"closed"}var qC=GC,WG=Bg,VG=Vg,UG=w.createContext(void 0);function zr(e){const t=w.useContext(UG);return e||t||"ltr"}var Ho="Accordion",HG=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Hg,GG,YG]=vi(Ho),[Yd,oae]=Tt(Ho,[YG,HC]),Gg=HC(),KC=x.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return g.jsx(Hg.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?g.jsx(JG,{...i,ref:t}):g.jsx(XG,{...o,ref:t})})});KC.displayName=Ho;var[XC,qG]=Yd(Ho),[JC,KG]=Yd(Ho,{collapsible:!1}),XG=x.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...s}=e,[a,l]=Ft({prop:n,defaultProp:r,onChange:o});return g.jsx(XC,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:x.useCallback(()=>i&&l(""),[i,l]),children:g.jsx(JC,{scope:e.__scopeAccordion,collapsible:i,children:g.jsx(QC,{...s,ref:t})})})}),JG=x.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[s=[],a]=Ft({prop:n,defaultProp:r,onChange:o}),l=x.useCallback(d=>a((u=[])=>[...u,d]),[a]),c=x.useCallback(d=>a((u=[])=>u.filter(f=>f!==d)),[a]);return g.jsx(XC,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c,children:g.jsx(JC,{scope:e.__scopeAccordion,collapsible:!0,children:g.jsx(QC,{...i,ref:t})})})}),[QG,qd]=Yd(Ho),QC=x.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...s}=e,a=x.useRef(null),l=Fe(a,t),c=GG(n),u=zr(o)==="ltr",f=be(e.onKeyDown,h=>{var D;if(!HG.includes(h.key))return;const m=h.target,p=c().filter(k=>{var F;return!((F=k.ref.current)!=null&&F.disabled)}),y=p.findIndex(k=>k.ref.current===m),v=p.length;if(y===-1)return;h.preventDefault();let b=y;const _=0,C=v-1,N=()=>{b=y+1,b>C&&(b=_)},A=()=>{b=y-1,b<_&&(b=C)};switch(h.key){case"Home":b=_;break;case"End":b=C;break;case"ArrowRight":i==="horizontal"&&(u?N():A());break;case"ArrowDown":i==="vertical"&&N();break;case"ArrowLeft":i==="horizontal"&&(u?A():N());break;case"ArrowUp":i==="vertical"&&A();break}const R=b%v;(D=p[R].ref.current)==null||D.focus()});return g.jsx(QG,{scope:n,disabled:r,direction:o,orientation:i,children:g.jsx(Hg.Slot,{scope:n,children:g.jsx(Pe.div,{...s,"data-orientation":i,ref:l,onKeyDown:r?void 0:f})})})}),Kd="AccordionItem",[ZG,Yg]=Yd(Kd),ZC=x.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=qd(Kd,n),s=qG(Kd,n),a=Gg(n),l=on(),c=r&&s.value.includes(r)||!1,d=i.disabled||e.disabled;return g.jsx(ZG,{scope:n,open:c,disabled:d,triggerId:l,children:g.jsx(qC,{"data-orientation":i.orientation,"data-state":i1(c),...a,...o,ref:t,disabled:d,open:c,onOpenChange:u=>{u?s.onItemOpen(r):s.onItemClose(r)}})})});ZC.displayName=Kd;var e1="AccordionHeader",t1=x.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=qd(Ho,n),i=Yg(e1,n);return g.jsx(Pe.h3,{"data-orientation":o.orientation,"data-state":i1(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});t1.displayName=e1;var qg="AccordionTrigger",n1=x.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=qd(Ho,n),i=Yg(qg,n),s=KG(qg,n),a=Gg(n);return g.jsx(Hg.ItemSlot,{scope:n,children:g.jsx(WG,{"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId,...a,...r,ref:t})})});n1.displayName=qg;var r1="AccordionContent",o1=x.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=qd(Ho,n),i=Yg(r1,n),s=Gg(n);return g.jsx(VG,{role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation,...s,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});o1.displayName=r1;function i1(e){return e?"open":"closed"}var e7=KC,t7=ZC,n7=t1,r7=n1,o7=o1;function i7(e,t=globalThis==null?void 0:globalThis.document){const n=Ct(e);w.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 s7="DismissableLayer",Kg="dismissableLayer.update",a7="dismissableLayer.pointerDownOutside",l7="dismissableLayer.focusOutside",s1,a1=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),bi=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=w.useContext(a1),[d,u]=w.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=w.useState({}),m=Fe(t,R=>u(R)),p=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=p.indexOf(y),b=d?p.indexOf(d):-1,_=c.layersWithOutsidePointerEventsDisabled.size>0,C=b>=v,N=d7(R=>{const D=R.target,k=[...c.branches].some(F=>F.contains(D));!C||k||(o==null||o(R),s==null||s(R),R.defaultPrevented||a==null||a())},f),A=f7(R=>{const D=R.target;[...c.branches].some(F=>F.contains(D))||(i==null||i(R),s==null||s(R),R.defaultPrevented||a==null||a())},f);return i7(R=>{b===c.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&a&&(R.preventDefault(),a()))},f),w.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(s1=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),l1(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=s1)}},[d,f,n,c]),w.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),l1())},[d,c]),w.useEffect(()=>{const R=()=>h({});return document.addEventListener(Kg,R),()=>document.removeEventListener(Kg,R)},[]),g.jsx(Pe.div,{...l,ref:m,style:{pointerEvents:_?C?"auto":"none":void 0,...e.style},onFocusCapture:be(e.onFocusCapture,A.onFocusCapture),onBlurCapture:be(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:be(e.onPointerDownCapture,N.onPointerDownCapture)})});bi.displayName=s7;var c7="DismissableLayerBranch",u7=w.forwardRef((e,t)=>{const n=w.useContext(a1),r=w.useRef(null),o=Fe(t,r);return w.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),g.jsx(Pe.div,{...e,ref:o})});u7.displayName=c7;function d7(e,t=globalThis==null?void 0:globalThis.document){const n=Ct(e),r=w.useRef(!1),o=w.useRef(()=>{});return w.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){c1(a7,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function f7(e,t=globalThis==null?void 0:globalThis.document){const n=Ct(e),r=w.useRef(!1);return w.useEffect(()=>{const o=i=>{i.target&&!r.current&&c1(l7,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function l1(){const e=new CustomEvent(Kg);document.dispatchEvent(e)}function c1(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Hd(o,i):o.dispatchEvent(i)}var Xg="focusScope.autoFocusOnMount",Jg="focusScope.autoFocusOnUnmount",u1={bubbles:!1,cancelable:!0},h7="FocusScope",Yl=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=w.useState(null),c=Ct(o),d=Ct(i),u=w.useRef(null),f=Fe(t,p=>l(p)),h=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let p=function(_){if(h.paused||!a)return;const C=_.target;a.contains(C)?u.current=C:_i(u.current,{select:!0})},y=function(_){if(h.paused||!a)return;const C=_.relatedTarget;C!==null&&(a.contains(C)||_i(u.current,{select:!0}))},v=function(_){if(document.activeElement===document.body)for(const N of _)N.removedNodes.length>0&&_i(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",y);const b=new MutationObserver(v);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",y),b.disconnect()}}},[r,a,h.paused]),w.useEffect(()=>{if(a){h1.add(h);const p=document.activeElement;if(!a.contains(p)){const v=new CustomEvent(Xg,u1);a.addEventListener(Xg,c),a.dispatchEvent(v),v.defaultPrevented||(p7(v7(d1(a)),{select:!0}),document.activeElement===p&&_i(a))}return()=>{a.removeEventListener(Xg,c),setTimeout(()=>{const v=new CustomEvent(Jg,u1);a.addEventListener(Jg,d),a.dispatchEvent(v),v.defaultPrevented||_i(p??document.body,{select:!0}),a.removeEventListener(Jg,d),h1.remove(h)},0)}}},[a,c,d,h]);const m=w.useCallback(p=>{if(!n&&!r||h.paused)return;const y=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,v=document.activeElement;if(y&&v){const b=p.currentTarget,[_,C]=m7(b);_&&C?!p.shiftKey&&v===C?(p.preventDefault(),n&&_i(_,{select:!0})):p.shiftKey&&v===_&&(p.preventDefault(),n&&_i(C,{select:!0})):v===b&&p.preventDefault()}},[n,r,h.paused]);return g.jsx(Pe.div,{tabIndex:-1,...s,ref:f,onKeyDown:m})});Yl.displayName=h7;function p7(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(_i(r,{select:t}),document.activeElement!==n)return}function m7(e){const t=d1(e),n=f1(t,e),r=f1(t.reverse(),e);return[n,r]}function d1(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 f1(e,t){for(const n of e)if(!g7(n,{upTo:t}))return n}function g7(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 y7(e){return e instanceof HTMLInputElement&&"select"in e}function _i(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&y7(e)&&t&&e.select()}}var h1=w7();function w7(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=p1(e,t),e.unshift(t)},remove(t){var n;e=p1(e,t),(n=e[0])==null||n.resume()}}}function p1(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function v7(e){return e.filter(t=>t.tagName!=="A")}var b7="Portal",ql=w.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=w.useState(!1);Zt(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?Zr.createPortal(g.jsx(Pe.div,{...r,ref:t}),s):null});ql.displayName=b7;var Qg=0;function Xd(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??m1()),document.body.insertAdjacentElement("beforeend",e[1]??m1()),Qg++,()=>{Qg===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Qg--}},[])}function m1(){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 Tn=function(){return Tn=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Tn.apply(this,arguments)};function Zg(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 g1(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Kl="right-scroll-bar-position",Xl="width-before-scroll-bar",_7="with-scroll-bars-hidden",S7="--removed-body-scroll-bar-size";function ey(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function x7(e,t){var n=x.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 E7=typeof window<"u"?w.useLayoutEffect:w.useEffect,y1=new WeakMap;function w1(e,t){var n=x7(null,function(r){return e.forEach(function(o){return ey(o,r)})});return E7(function(){var r=y1.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||ey(a,null)}),i.forEach(function(a){o.has(a)||ey(a,s)})}y1.set(n,e)},[e]),n}function C7(e){return e}function N7(e,t){t===void 0&&(t=C7);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(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var l=function(){var d=s;s=[],d.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(d){s.push(d),c()},filter:function(d){return s=s.filter(d),n}}}};return o}function v1(e){e===void 0&&(e={});var t=N7(null);return t.options=Tn({async:!0,ssr:!1},e),t}var b1=function(e){var t=e.sideCar,n=Zg(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 w.createElement(r,Tn({},n))};b1.isSideCarExport=!0;function _1(e,t){return e.useMedium(t),b1}var S1=v1(),ty=function(){},Jd=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:ty,onWheelCapture:ty,onTouchMoveCapture:ty}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,d=e.enabled,u=e.shards,f=e.sideCar,h=e.noIsolation,m=e.inert,p=e.allowPinchZoom,y=e.as,v=y===void 0?"div":y,b=e.gapMode,_=Zg(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=f,N=w1([n,t]),A=Tn(Tn({},_),o);return w.createElement(w.Fragment,null,d&&w.createElement(C,{sideCar:S1,removeScrollBar:c,shards:u,noIsolation:h,inert:m,setCallbacks:i,allowPinchZoom:!!p,lockRef:n,gapMode:b}),s?w.cloneElement(w.Children.only(a),Tn(Tn({},A),{ref:N})):w.createElement(v,Tn({},A,{className:l,ref:N}),a))});Jd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Jd.classNames={fullWidth:Xl,zeroRight:Kl};var R7=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function P7(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=R7();return t&&e.setAttribute("nonce",t),e}function A7(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function T7(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var D7=function(){var e=0,t=null;return{add:function(n){e==0&&(t=P7())&&(A7(t,n),T7(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},M7=function(){var e=D7();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ny=function(){var e=M7(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},I7={left:0,top:0,right:0,gap:0},ry=function(e){return parseInt(e||"",10)||0},O7=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[ry(n),ry(r),ry(o)]},k7=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return I7;var t=O7(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])}},L7=ny(),fa="data-scroll-locked",j7=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
195
|
+
.`.concat(_7,` {
|
|
196
|
+
overflow: hidden `).concat(r,`;
|
|
197
|
+
padding-right: `).concat(a,"px ").concat(r,`;
|
|
198
|
+
}
|
|
199
|
+
body[`).concat(fa,`] {
|
|
200
|
+
overflow: hidden `).concat(r,`;
|
|
201
|
+
overscroll-behavior: contain;
|
|
202
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
203
|
+
padding-left: `.concat(o,`px;
|
|
204
|
+
padding-top: `).concat(i,`px;
|
|
205
|
+
padding-right: `).concat(s,`px;
|
|
206
|
+
margin-left:0;
|
|
207
|
+
margin-top:0;
|
|
208
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
209
|
+
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.`).concat(Kl,` {
|
|
213
|
+
right: `).concat(a,"px ").concat(r,`;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.`).concat(Xl,` {
|
|
217
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.`).concat(Kl," .").concat(Kl,` {
|
|
221
|
+
right: 0 `).concat(r,`;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.`).concat(Xl," .").concat(Xl,` {
|
|
225
|
+
margin-right: 0 `).concat(r,`;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
body[`).concat(fa,`] {
|
|
229
|
+
`).concat(S7,": ").concat(a,`px;
|
|
230
|
+
}
|
|
231
|
+
`)},x1=function(){var e=parseInt(document.body.getAttribute(fa)||"0",10);return isFinite(e)?e:0},F7=function(){w.useEffect(function(){return document.body.setAttribute(fa,(x1()+1).toString()),function(){var e=x1()-1;e<=0?document.body.removeAttribute(fa):document.body.setAttribute(fa,e.toString())}},[])},E1=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;F7();var i=w.useMemo(function(){return k7(o)},[o]);return w.createElement(L7,{styles:j7(i,!t,o,n?"":"!important")})},oy=!1;if(typeof window<"u")try{var Qd=Object.defineProperty({},"passive",{get:function(){return oy=!0,!0}});window.addEventListener("test",Qd,Qd),window.removeEventListener("test",Qd,Qd)}catch{oy=!1}var ha=oy?{passive:!1}:!1,$7=function(e){return e.tagName==="TEXTAREA"},C1=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!$7(e)&&n[t]==="visible")},z7=function(e){return C1(e,"overflowY")},B7=function(e){return C1(e,"overflowX")},N1=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=R1(e,r);if(o){var i=P1(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},W7=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},V7=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},R1=function(e,t){return e==="v"?z7(t):B7(t)},P1=function(e,t){return e==="v"?W7(t):V7(t)},U7=function(e,t){return e==="h"&&t==="rtl"?-1:1},H7=function(e,t,n,r,o){var i=U7(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,d=s>0,u=0,f=0;do{var h=P1(e,a),m=h[0],p=h[1],y=h[2],v=p-y-i*m;(m||v)&&R1(e,a)&&(u+=v,f+=m),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&Math.abs(u)<1||!d&&Math.abs(f)<1)&&(c=!0),c},Zd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},A1=function(e){return[e.deltaX,e.deltaY]},T1=function(e){return e&&"current"in e?e.current:e},G7=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Y7=function(e){return`
|
|
232
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
233
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
234
|
+
`)},q7=0,pa=[];function K7(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),o=w.useState(q7++)[0],i=w.useState(ny)[0],s=w.useRef(e);w.useEffect(function(){s.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=g1([e.lockRef.current],(e.shards||[]).map(T1),!0).filter(Boolean);return p.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=w.useCallback(function(p,y){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!s.current.allowPinchZoom;var v=Zd(p),b=n.current,_="deltaX"in p?p.deltaX:b[0]-v[0],C="deltaY"in p?p.deltaY:b[1]-v[1],N,A=p.target,R=Math.abs(_)>Math.abs(C)?"h":"v";if("touches"in p&&R==="h"&&A.type==="range")return!1;var D=N1(R,A);if(!D)return!0;if(D?N=R:(N=R==="v"?"h":"v",D=N1(R,A)),!D)return!1;if(!r.current&&"changedTouches"in p&&(_||C)&&(r.current=N),!N)return!0;var k=r.current||N;return H7(k,y,p,k==="h"?_:C)},[]),l=w.useCallback(function(p){var y=p;if(!(!pa.length||pa[pa.length-1]!==i)){var v="deltaY"in y?A1(y):Zd(y),b=t.current.filter(function(N){return N.name===y.type&&(N.target===y.target||y.target===N.shadowParent)&&G7(N.delta,v)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var _=(s.current.shards||[]).map(T1).filter(Boolean).filter(function(N){return N.contains(y.target)}),C=_.length>0?a(y,_[0]):!s.current.noIsolation;C&&y.cancelable&&y.preventDefault()}}},[]),c=w.useCallback(function(p,y,v,b){var _={name:p,delta:y,target:v,should:b,shadowParent:X7(v)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(C){return C!==_})},1)},[]),d=w.useCallback(function(p){n.current=Zd(p),r.current=void 0},[]),u=w.useCallback(function(p){c(p.type,A1(p),p.target,a(p,e.lockRef.current))},[]),f=w.useCallback(function(p){c(p.type,Zd(p),p.target,a(p,e.lockRef.current))},[]);w.useEffect(function(){return pa.push(i),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:f}),document.addEventListener("wheel",l,ha),document.addEventListener("touchmove",l,ha),document.addEventListener("touchstart",d,ha),function(){pa=pa.filter(function(p){return p!==i}),document.removeEventListener("wheel",l,ha),document.removeEventListener("touchmove",l,ha),document.removeEventListener("touchstart",d,ha)}},[]);var h=e.removeScrollBar,m=e.inert;return w.createElement(w.Fragment,null,m?w.createElement(i,{styles:Y7(o)}):null,h?w.createElement(E1,{gapMode:e.gapMode}):null)}function X7(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const J7=_1(S1,K7);var Jl=w.forwardRef(function(e,t){return w.createElement(Jd,Tn({},e,{ref:t,sideCar:J7}))});Jl.classNames=Jd.classNames;var Q7=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ma=new WeakMap,ef=new WeakMap,tf={},iy=0,D1=function(e){return e&&(e.host||D1(e.parentNode))},Z7=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=D1(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})},e9=function(e,t,n,r){var o=Z7(t,Array.isArray(e)?e:[e]);tf[n]||(tf[n]=new WeakMap);var i=tf[n],s=[],a=new Set,l=new Set(o),c=function(u){!u||a.has(u)||(a.add(u),c(u.parentNode))};o.forEach(c);var d=function(u){!u||l.has(u)||Array.prototype.forEach.call(u.children,function(f){if(a.has(f))d(f);else try{var h=f.getAttribute(r),m=h!==null&&h!=="false",p=(ma.get(f)||0)+1,y=(i.get(f)||0)+1;ma.set(f,p),i.set(f,y),s.push(f),p===1&&m&&ef.set(f,!0),y===1&&f.setAttribute(n,"true"),m||f.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",f,v)}})};return d(t),a.clear(),iy++,function(){s.forEach(function(u){var f=ma.get(u)-1,h=i.get(u)-1;ma.set(u,f),i.set(u,h),f||(ef.has(u)||u.removeAttribute(r),ef.delete(u)),h||u.removeAttribute(n)}),iy--,iy||(ma=new WeakMap,ma=new WeakMap,ef=new WeakMap,tf={})}},Ql=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Q7(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),e9(r,o,n,"aria-hidden")):function(){return null}},sy="Dialog",[M1,I1]=Tt(sy),[t9,Br]=M1(sy),O1=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=w.useRef(null),l=w.useRef(null),[c=!1,d]=Ft({prop:r,defaultProp:o,onChange:i});return g.jsx(t9,{scope:t,triggerRef:a,contentRef:l,contentId:on(),titleId:on(),descriptionId:on(),open:c,onOpenChange:d,onOpenToggle:w.useCallback(()=>d(u=>!u),[d]),modal:s,children:n})};O1.displayName=sy;var k1="DialogTrigger",L1=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Br(k1,n),i=Fe(t,o.triggerRef);return g.jsx(Pe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":cy(o.open),...r,ref:i,onClick:be(e.onClick,o.onOpenToggle)})});L1.displayName=k1;var ay="DialogPortal",[n9,j1]=M1(ay,{forceMount:void 0}),F1=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Br(ay,t);return g.jsx(n9,{scope:t,forceMount:n,children:w.Children.map(r,s=>g.jsx(Bt,{present:n||i.open,children:g.jsx(ql,{asChild:!0,container:o,children:s})}))})};F1.displayName=ay;var nf="DialogOverlay",$1=w.forwardRef((e,t)=>{const n=j1(nf,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Br(nf,e.__scopeDialog);return i.modal?g.jsx(Bt,{present:r||i.open,children:g.jsx(r9,{...o,ref:t})}):null});$1.displayName=nf;var r9=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Br(nf,n);return g.jsx(Jl,{as:$r,allowPinchZoom:!0,shards:[o.contentRef],children:g.jsx(Pe.div,{"data-state":cy(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ms="DialogContent",z1=w.forwardRef((e,t)=>{const n=j1(ms,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Br(ms,e.__scopeDialog);return g.jsx(Bt,{present:r||i.open,children:i.modal?g.jsx(o9,{...o,ref:t}):g.jsx(i9,{...o,ref:t})})});z1.displayName=ms;var o9=w.forwardRef((e,t)=>{const n=Br(ms,e.__scopeDialog),r=w.useRef(null),o=Fe(t,n.contentRef,r);return w.useEffect(()=>{const i=r.current;if(i)return Ql(i)},[]),g.jsx(B1,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:be(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:be(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:be(e.onFocusOutside,i=>i.preventDefault())})}),i9=w.forwardRef((e,t)=>{const n=Br(ms,e.__scopeDialog),r=w.useRef(!1),o=w.useRef(!1);return g.jsx(B1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),B1=w.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=Br(ms,n),l=w.useRef(null),c=Fe(t,l);return Xd(),g.jsxs(g.Fragment,{children:[g.jsx(Yl,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:g.jsx(bi,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":cy(a.open),...s,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(a9,{titleId:a.titleId}),g.jsx(c9,{contentRef:l,descriptionId:a.descriptionId})]})]})}),ly="DialogTitle",W1=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Br(ly,n);return g.jsx(Pe.h2,{id:o.titleId,...r,ref:t})});W1.displayName=ly;var V1="DialogDescription",U1=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Br(V1,n);return g.jsx(Pe.p,{id:o.descriptionId,...r,ref:t})});U1.displayName=V1;var H1="DialogClose",G1=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Br(H1,n);return g.jsx(Pe.button,{type:"button",...r,ref:t,onClick:be(e.onClick,()=>o.onOpenChange(!1))})});G1.displayName=H1;function cy(e){return e?"open":"closed"}var Y1="DialogTitleWarning",[s9,q1]=DG(Y1,{contentName:ms,titleName:ly,docsSlug:"dialog"}),a9=({titleId:e})=>{const t=q1(Y1),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
235
|
+
|
|
236
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
237
|
+
|
|
238
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return w.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},l9="DialogDescriptionWarning",c9=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${q1(l9).contentName}}.`;return w.useEffect(()=>{var i;const o=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},rf=O1,of=L1,sf=F1,ga=$1,ya=z1,wa=W1,va=U1,ba=G1,K1="AlertDialog",[u9,iae]=Tt(K1,[I1]),Go=I1(),X1=e=>{const{__scopeAlertDialog:t,...n}=e,r=Go(t);return g.jsx(rf,{...r,...n,modal:!0})};X1.displayName=K1;var d9="AlertDialogTrigger",J1=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Go(n);return g.jsx(of,{...o,...r,ref:t})});J1.displayName=d9;var f9="AlertDialogPortal",Q1=e=>{const{__scopeAlertDialog:t,...n}=e,r=Go(t);return g.jsx(sf,{...r,...n})};Q1.displayName=f9;var h9="AlertDialogOverlay",Z1=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Go(n);return g.jsx(ga,{...o,...r,ref:t})});Z1.displayName=h9;var _a="AlertDialogContent",[p9,m9]=u9(_a),eN=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,i=Go(n),s=w.useRef(null),a=Fe(t,s),l=w.useRef(null);return g.jsx(s9,{contentName:_a,titleName:tN,docsSlug:"alert-dialog",children:g.jsx(p9,{scope:n,cancelRef:l,children:g.jsxs(ya,{role:"alertdialog",...i,...o,ref:a,onOpenAutoFocus:be(o.onOpenAutoFocus,c=>{var d;c.preventDefault(),(d=l.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[g.jsx(Ud,{children:r}),g.jsx(y9,{contentRef:s})]})})})});eN.displayName=_a;var tN="AlertDialogTitle",nN=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Go(n);return g.jsx(wa,{...o,...r,ref:t})});nN.displayName=tN;var rN="AlertDialogDescription",oN=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Go(n);return g.jsx(va,{...o,...r,ref:t})});oN.displayName=rN;var g9="AlertDialogAction",iN=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Go(n);return g.jsx(ba,{...o,...r,ref:t})});iN.displayName=g9;var sN="AlertDialogCancel",aN=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=m9(sN,n),i=Go(n),s=Fe(t,o);return g.jsx(ba,{...i,...r,ref:s})});aN.displayName=sN;var y9=({contentRef:e})=>{const t=`\`${_a}\` requires a description for the component to be accessible for screen reader users.
|
|
239
|
+
|
|
240
|
+
You can add a description to the \`${_a}\` by passing a \`${rN}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
241
|
+
|
|
242
|
+
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${_a}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
243
|
+
|
|
244
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return w.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},w9=X1,v9=J1,b9=Q1,lN=Z1,cN=eN,uN=iN,dN=aN,fN=nN,hN=oN,_9="AspectRatio",pN=w.forwardRef((e,t)=>{const{ratio:n=1/1,style:r,...o}=e;return g.jsx("div",{style:{position:"relative",width:"100%",paddingBottom:`${100/n}%`},"data-radix-aspect-ratio-wrapper":"",children:g.jsx(Pe.div,{...o,ref:t,style:{...r,position:"absolute",top:0,right:0,bottom:0,left:0}})})});pN.displayName=_9;var S9=pN,uy="Avatar",[x9,sae]=Tt(uy),[E9,mN]=x9(uy),gN=w.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,i]=w.useState("idle");return g.jsx(E9,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:i,children:g.jsx(Pe.span,{...r,ref:t})})});gN.displayName=uy;var yN="AvatarImage",wN=w.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...i}=e,s=mN(yN,n),a=C9(r,i.referrerPolicy),l=Ct(c=>{o(c),s.onImageLoadingStatusChange(c)});return Zt(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?g.jsx(Pe.img,{...i,ref:t,src:r}):null});wN.displayName=yN;var vN="AvatarFallback",bN=w.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,i=mN(vN,n),[s,a]=w.useState(r===void 0);return w.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),s&&i.imageLoadingStatus!=="loaded"?g.jsx(Pe.span,{...o,ref:t}):null});bN.displayName=vN;function C9(e,t){const[n,r]=w.useState("idle");return Zt(()=>{if(!e){r("error");return}let o=!0;const i=new window.Image,s=a=>()=>{o&&r(a)};return r("loading"),i.onload=s("loaded"),i.onerror=s("error"),i.src=e,t&&(i.referrerPolicy=t),()=>{o=!1}},[e,t]),n}var _N=gN,SN=wN,xN=bN;function Sa(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Zl(e){const[t,n]=w.useState(void 0);return Zt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var dy="Checkbox",[N9,aae]=Tt(dy),[R9,P9]=N9(dy),EN=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,form:d,...u}=e,[f,h]=w.useState(null),m=Fe(t,C=>h(C)),p=w.useRef(!1),y=f?d||!!f.closest("form"):!0,[v=!1,b]=Ft({prop:o,defaultProp:i,onChange:c}),_=w.useRef(v);return w.useEffect(()=>{const C=f==null?void 0:f.form;if(C){const N=()=>b(_.current);return C.addEventListener("reset",N),()=>C.removeEventListener("reset",N)}},[f,b]),g.jsxs(R9,{scope:n,state:v,disabled:a,children:[g.jsx(Pe.button,{type:"button",role:"checkbox","aria-checked":Si(v)?"mixed":v,"aria-required":s,"data-state":RN(v),"data-disabled":a?"":void 0,disabled:a,value:l,...u,ref:m,onKeyDown:be(e.onKeyDown,C=>{C.key==="Enter"&&C.preventDefault()}),onClick:be(e.onClick,C=>{b(N=>Si(N)?!0:!N),y&&(p.current=C.isPropagationStopped(),p.current||C.stopPropagation())})}),y&&g.jsx(A9,{control:f,bubbles:!p.current,name:r,value:l,checked:v,required:s,disabled:a,form:d,style:{transform:"translateX(-100%)"},defaultChecked:Si(i)?!1:i})]})});EN.displayName=dy;var CN="CheckboxIndicator",NN=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=P9(CN,n);return g.jsx(Bt,{present:r||Si(i.state)||i.state===!0,children:g.jsx(Pe.span,{"data-state":RN(i.state),"data-disabled":i.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});NN.displayName=CN;var A9=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...i}=e,s=w.useRef(null),a=Sa(n),l=Zl(t);w.useEffect(()=>{const d=s.current,u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"checked").set;if(a!==n&&h){const m=new Event("click",{bubbles:r});d.indeterminate=Si(n),h.call(d,Si(n)?!1:n),d.dispatchEvent(m)}},[a,n,r]);const c=w.useRef(Si(n)?!1:n);return g.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o??c.current,...i,tabIndex:-1,ref:s,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Si(e){return e==="indeterminate"}function RN(e){return Si(e)?"indeterminate":e?"checked":"unchecked"}var PN=EN,T9=NN;const D9=["top","right","bottom","left"],xi=Math.min,sr=Math.max,af=Math.round,lf=Math.floor,yo=e=>({x:e,y:e}),M9={left:"right",right:"left",bottom:"top",top:"bottom"},I9={start:"end",end:"start"};function fy(e,t,n){return sr(e,xi(t,n))}function Yo(e,t){return typeof e=="function"?e(t):e}function qo(e){return e.split("-")[0]}function xa(e){return e.split("-")[1]}function hy(e){return e==="x"?"y":"x"}function py(e){return e==="y"?"height":"width"}function Ei(e){return["top","bottom"].includes(qo(e))?"y":"x"}function my(e){return hy(Ei(e))}function O9(e,t,n){n===void 0&&(n=!1);const r=xa(e),o=my(e),i=py(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=cf(s)),[s,cf(s)]}function k9(e){const t=cf(e);return[gy(e),t,gy(t)]}function gy(e){return e.replace(/start|end/g,t=>I9[t])}function L9(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function j9(e,t,n,r){const o=xa(e);let i=L9(qo(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(gy)))),i}function cf(e){return e.replace(/left|right|bottom|top/g,t=>M9[t])}function F9(e){return{top:0,right:0,bottom:0,left:0,...e}}function AN(e){return typeof e!="number"?F9(e):{top:e,right:e,bottom:e,left:e}}function uf(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 TN(e,t,n){let{reference:r,floating:o}=e;const i=Ei(t),s=my(t),a=py(s),l=qo(t),c=i==="y",d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:d,y:r.y-o.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:u};break;case"left":h={x:r.x-o.width,y:u};break;default:h={x:r.x,y:r.y}}switch(xa(t)){case"start":h[s]-=f*(n&&c?-1:1);break;case"end":h[s]+=f*(n&&c?-1:1);break}return h}const $9=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=TN(c,r,l),f=r,h={},m=0;for(let p=0;p<a.length;p++){const{name:y,fn:v}=a[p],{x:b,y:_,data:C,reset:N}=await v({x:d,y:u,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});d=b??d,u=_??u,h={...h,[y]:{...h[y],...C}},N&&m<=50&&(m++,typeof N=="object"&&(N.placement&&(f=N.placement),N.rects&&(c=N.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):N.rects),{x:d,y:u}=TN(c,f,l)),p=-1)}return{x:d,y:u,placement:f,strategy:o,middlewareData:h}};async function ec(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:h=0}=Yo(t,e),m=AN(h),y=a[f?u==="floating"?"reference":"floating":u],v=uf(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),b=u==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),C=await(i.isElement==null?void 0:i.isElement(_))?await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1}:{x:1,y:1},N=uf(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:_,strategy:l}):b);return{top:(v.top-N.top+m.top)/C.y,bottom:(N.bottom-v.bottom+m.bottom)/C.y,left:(v.left-N.left+m.left)/C.x,right:(N.right-v.right+m.right)/C.x}}const z9=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=Yo(e,t)||{};if(c==null)return{};const u=AN(d),f={x:n,y:r},h=my(o),m=py(h),p=await s.getDimensions(c),y=h==="y",v=y?"top":"left",b=y?"bottom":"right",_=y?"clientHeight":"clientWidth",C=i.reference[m]+i.reference[h]-f[h]-i.floating[m],N=f[h]-i.reference[h],A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let R=A?A[_]:0;(!R||!await(s.isElement==null?void 0:s.isElement(A)))&&(R=a.floating[_]||i.floating[m]);const D=C/2-N/2,k=R/2-p[m]/2-1,F=xi(u[v],k),W=xi(u[b],k),B=F,T=R-p[m]-W,Q=R/2-p[m]/2+D,K=fy(B,Q,T),Y=!l.arrow&&xa(o)!=null&&Q!==K&&i.reference[m]/2-(Q<B?F:W)-p[m]/2<0,ee=Y?Q<B?Q-B:Q-T:0;return{[h]:f[h]+ee,data:{[h]:K,centerOffset:Q-K-ee,...Y&&{alignmentOffset:ee}},reset:Y}}}),B9=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...y}=Yo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=qo(o),b=Ei(a),_=qo(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(c.floating)),N=f||(_||!p?[cf(a)]:k9(a)),A=m!=="none";!f&&A&&N.push(...j9(a,p,m,C));const R=[a,...N],D=await ec(t,y),k=[];let F=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&k.push(D[v]),u){const Q=O9(o,s,C);k.push(D[Q[0]],D[Q[1]])}if(F=[...F,{placement:o,overflows:k}],!k.every(Q=>Q<=0)){var W,B;const Q=(((W=i.flip)==null?void 0:W.index)||0)+1,K=R[Q];if(K)return{data:{index:Q,overflows:F},reset:{placement:K}};let Y=(B=F.filter(ee=>ee.overflows[0]<=0).sort((ee,G)=>ee.overflows[1]-G.overflows[1])[0])==null?void 0:B.placement;if(!Y)switch(h){case"bestFit":{var T;const ee=(T=F.filter(G=>{if(A){const re=Ei(G.placement);return re===b||re==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(re=>re>0).reduce((re,X)=>re+X,0)]).sort((G,re)=>G[1]-re[1])[0])==null?void 0:T[0];ee&&(Y=ee);break}case"initialPlacement":Y=a;break}if(o!==Y)return{reset:{placement:Y}}}return{}}}};function DN(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function MN(e){return D9.some(t=>e[t]>=0)}const W9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Yo(e,t);switch(r){case"referenceHidden":{const i=await ec(t,{...o,elementContext:"reference"}),s=DN(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:MN(s)}}}case"escaped":{const i=await ec(t,{...o,altBoundary:!0}),s=DN(i,n.floating);return{data:{escapedOffsets:s,escaped:MN(s)}}}default:return{}}}}};async function V9(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=qo(n),a=xa(n),l=Ei(n)==="y",c=["left","top"].includes(s)?-1:1,d=i&&l?-1:1,u=Yo(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:m}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),l?{x:h*d,y:f*c}:{x:f*c,y:h*d}}const U9=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await V9(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},H9=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:y=>{let{x:v,y:b}=y;return{x:v,y:b}}},...l}=Yo(e,t),c={x:n,y:r},d=await ec(t,l),u=Ei(qo(o)),f=hy(u);let h=c[f],m=c[u];if(i){const y=f==="y"?"top":"left",v=f==="y"?"bottom":"right",b=h+d[y],_=h-d[v];h=fy(b,h,_)}if(s){const y=u==="y"?"top":"left",v=u==="y"?"bottom":"right",b=m+d[y],_=m-d[v];m=fy(b,m,_)}const p=a.fn({...t,[f]:h,[u]:m});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[f]:i,[u]:s}}}}}},G9=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Yo(e,t),d={x:n,y:r},u=Ei(o),f=hy(u);let h=d[f],m=d[u];const p=Yo(a,t),y=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const _=f==="y"?"height":"width",C=i.reference[f]-i.floating[_]+y.mainAxis,N=i.reference[f]+i.reference[_]-y.mainAxis;h<C?h=C:h>N&&(h=N)}if(c){var v,b;const _=f==="y"?"width":"height",C=["top","left"].includes(qo(o)),N=i.reference[u]-i.floating[_]+(C&&((v=s.offset)==null?void 0:v[u])||0)+(C?0:y.crossAxis),A=i.reference[u]+i.reference[_]+(C?0:((b=s.offset)==null?void 0:b[u])||0)-(C?y.crossAxis:0);m<N?m=N:m>A&&(m=A)}return{[f]:h,[u]:m}}}},Y9=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=Yo(e,t),d=await ec(t,c),u=qo(o),f=xa(o),h=Ei(o)==="y",{width:m,height:p}=i.floating;let y,v;u==="top"||u==="bottom"?(y=u,v=f===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=u,y=f==="end"?"top":"bottom");const b=p-d.top-d.bottom,_=m-d.left-d.right,C=xi(p-d[y],b),N=xi(m-d[v],_),A=!t.middlewareData.shift;let R=C,D=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=b),A&&!f){const F=sr(d.left,0),W=sr(d.right,0),B=sr(d.top,0),T=sr(d.bottom,0);h?D=m-2*(F!==0||W!==0?F+W:sr(d.left,d.right)):R=p-2*(B!==0||T!==0?B+T:sr(d.top,d.bottom))}await l({...t,availableWidth:D,availableHeight:R});const k=await s.getDimensions(a.floating);return m!==k.width||p!==k.height?{reset:{rects:!0}}:{}}}};function df(){return typeof window<"u"}function Ea(e){return IN(e)?(e.nodeName||"").toLowerCase():"#document"}function ar(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function wo(e){var t;return(t=(IN(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function IN(e){return df()?e instanceof Node||e instanceof ar(e).Node:!1}function Wr(e){return df()?e instanceof Element||e instanceof ar(e).Element:!1}function vo(e){return df()?e instanceof HTMLElement||e instanceof ar(e).HTMLElement:!1}function ON(e){return!df()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ar(e).ShadowRoot}function tc(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Vr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function q9(e){return["table","td","th"].includes(Ea(e))}function ff(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function yy(e){const t=wy(),n=Wr(e)?Vr(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function K9(e){let t=Ci(e);for(;vo(t)&&!Ca(t);){if(yy(t))return t;if(ff(t))return null;t=Ci(t)}return null}function wy(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ca(e){return["html","body","#document"].includes(Ea(e))}function Vr(e){return ar(e).getComputedStyle(e)}function hf(e){return Wr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ci(e){if(Ea(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ON(e)&&e.host||wo(e);return ON(t)?t.host:t}function kN(e){const t=Ci(e);return Ca(t)?e.ownerDocument?e.ownerDocument.body:e.body:vo(t)&&tc(t)?t:kN(t)}function nc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=kN(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=ar(o);if(i){const a=vy(s);return t.concat(s,s.visualViewport||[],tc(o)?o:[],a&&n?nc(a):[])}return t.concat(o,nc(o,[],n))}function vy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function LN(e){const t=Vr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=vo(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=af(n)!==i||af(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function by(e){return Wr(e)?e:e.contextElement}function Na(e){const t=by(e);if(!vo(t))return yo(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=LN(t);let s=(i?af(n.width):n.width)/r,a=(i?af(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const X9=yo(0);function jN(e){const t=ar(e);return!wy()||!t.visualViewport?X9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function J9(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ar(e)?!1:t}function gs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=by(e);let s=yo(1);t&&(r?Wr(r)&&(s=Na(r)):s=Na(e));const a=J9(i,n,r)?jN(i):yo(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,d=o.width/s.x,u=o.height/s.y;if(i){const f=ar(i),h=r&&Wr(r)?ar(r):r;let m=f,p=vy(m);for(;p&&r&&h!==m;){const y=Na(p),v=p.getBoundingClientRect(),b=Vr(p),_=v.left+(p.clientLeft+parseFloat(b.paddingLeft))*y.x,C=v.top+(p.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,c*=y.y,d*=y.x,u*=y.y,l+=_,c+=C,m=ar(p),p=vy(m)}}return uf({width:d,height:u,x:l,y:c})}function _y(e,t){const n=hf(e).scrollLeft;return t?t.left+n:gs(wo(e)).left+n}function FN(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:_y(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function Q9(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=wo(r),a=t?ff(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=yo(1);const d=yo(0),u=vo(r);if((u||!u&&!i)&&((Ea(r)!=="body"||tc(s))&&(l=hf(r)),vo(r))){const h=gs(r);c=Na(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}const f=s&&!u&&!i?FN(s,l,!0):yo(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+f.x,y:n.y*c.y-l.scrollTop*c.y+d.y+f.y}}function Z9(e){return Array.from(e.getClientRects())}function eY(e){const t=wo(e),n=hf(e),r=e.ownerDocument.body,o=sr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=sr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+_y(e);const a=-n.scrollTop;return Vr(r).direction==="rtl"&&(s+=sr(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function tY(e,t){const n=ar(e),r=wo(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=wy();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function nY(e,t){const n=gs(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=vo(e)?Na(e):yo(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function $N(e,t,n){let r;if(t==="viewport")r=tY(e,n);else if(t==="document")r=eY(wo(e));else if(Wr(t))r=nY(t,n);else{const o=jN(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return uf(r)}function zN(e,t){const n=Ci(e);return n===t||!Wr(n)||Ca(n)?!1:Vr(n).position==="fixed"||zN(n,t)}function rY(e,t){const n=t.get(e);if(n)return n;let r=nc(e,[],!1).filter(a=>Wr(a)&&Ea(a)!=="body"),o=null;const i=Vr(e).position==="fixed";let s=i?Ci(e):e;for(;Wr(s)&&!Ca(s);){const a=Vr(s),l=yy(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||tc(s)&&!l&&zN(e,s))?r=r.filter(d=>d!==s):o=a,s=Ci(s)}return t.set(e,r),r}function oY(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?ff(t)?[]:rY(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,d)=>{const u=$N(t,d,o);return c.top=sr(u.top,c.top),c.right=xi(u.right,c.right),c.bottom=xi(u.bottom,c.bottom),c.left=sr(u.left,c.left),c},$N(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function iY(e){const{width:t,height:n}=LN(e);return{width:t,height:n}}function sY(e,t,n){const r=vo(t),o=wo(t),i=n==="fixed",s=gs(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=yo(0);if(r||!r&&!i)if((Ea(t)!=="body"||tc(o))&&(a=hf(t)),r){const f=gs(t,!0,i,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else o&&(l.x=_y(o));const c=o&&!r&&!i?FN(o,a):yo(0),d=s.left+a.scrollLeft-l.x-c.x,u=s.top+a.scrollTop-l.y-c.y;return{x:d,y:u,width:s.width,height:s.height}}function Sy(e){return Vr(e).position==="static"}function BN(e,t){if(!vo(e)||Vr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return wo(e)===n&&(n=n.ownerDocument.body),n}function WN(e,t){const n=ar(e);if(ff(e))return n;if(!vo(e)){let o=Ci(e);for(;o&&!Ca(o);){if(Wr(o)&&!Sy(o))return o;o=Ci(o)}return n}let r=BN(e,t);for(;r&&q9(r)&&Sy(r);)r=BN(r,t);return r&&Ca(r)&&Sy(r)&&!yy(r)?n:r||K9(e)||n}const aY=async function(e){const t=this.getOffsetParent||WN,n=this.getDimensions,r=await n(e.floating);return{reference:sY(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function lY(e){return Vr(e).direction==="rtl"}const cY={convertOffsetParentRelativeRectToViewportRelativeRect:Q9,getDocumentElement:wo,getClippingRect:oY,getOffsetParent:WN,getElementRects:aY,getClientRects:Z9,getDimensions:iY,getScale:Na,isElement:Wr,isRTL:lY};function VN(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function uY(e,t){let n=null,r;const o=wo(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:d,top:u,width:f,height:h}=c;if(a||t(),!f||!h)return;const m=lf(u),p=lf(o.clientWidth-(d+f)),y=lf(o.clientHeight-(u+h)),v=lf(d),_={rootMargin:-m+"px "+-p+"px "+-y+"px "+-v+"px",threshold:sr(0,xi(1,l))||1};let C=!0;function N(A){const R=A[0].intersectionRatio;if(R!==l){if(!C)return s();R?s(!1,R):r=setTimeout(()=>{s(!1,1e-7)},1e3)}R===1&&!VN(c,e.getBoundingClientRect())&&s(),C=!1}try{n=new IntersectionObserver(N,{..._,root:o.ownerDocument})}catch{n=new IntersectionObserver(N,_)}n.observe(e)}return s(!0),i}function dY(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=by(e),d=o||i?[...c?nc(c):[],...nc(t)]:[];d.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const u=c&&a?uY(c,n):null;let f=-1,h=null;s&&(h=new ResizeObserver(v=>{let[b]=v;b&&b.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var _;(_=h)==null||_.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let m,p=l?gs(e):null;l&&y();function y(){const v=gs(e);p&&!VN(p,v)&&n(),p=v,m=requestAnimationFrame(y)}return n(),()=>{var v;d.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),u==null||u(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const fY=U9,hY=H9,pY=B9,mY=Y9,gY=W9,UN=z9,yY=G9,wY=(e,t,n)=>{const r=new Map,o={platform:cY,...n},i={...o.platform,_c:r};return $9(e,t,{...o,platform:i})};var pf=typeof document<"u"?x.useLayoutEffect:x.useEffect;function mf(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(!mf(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 i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!mf(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function HN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function GN(e,t){const n=HN(e);return Math.round(t*n)/n}function xy(e){const t=w.useRef(e);return pf(()=>{t.current=e}),t}function vY(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,u]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=w.useState(r);mf(f,r)||h(r);const[m,p]=w.useState(null),[y,v]=w.useState(null),b=w.useCallback(G=>{G!==A.current&&(A.current=G,p(G))},[]),_=w.useCallback(G=>{G!==R.current&&(R.current=G,v(G))},[]),C=i||m,N=s||y,A=w.useRef(null),R=w.useRef(null),D=w.useRef(d),k=l!=null,F=xy(l),W=xy(o),B=xy(c),T=w.useCallback(()=>{if(!A.current||!R.current)return;const G={placement:t,strategy:n,middleware:f};W.current&&(G.platform=W.current),wY(A.current,R.current,G).then(re=>{const X={...re,isPositioned:B.current!==!1};Q.current&&!mf(D.current,X)&&(D.current=X,Xc.flushSync(()=>{u(X)}))})},[f,t,n,W,B]);pf(()=>{c===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,u(G=>({...G,isPositioned:!1})))},[c]);const Q=w.useRef(!1);pf(()=>(Q.current=!0,()=>{Q.current=!1}),[]),pf(()=>{if(C&&(A.current=C),N&&(R.current=N),C&&N){if(F.current)return F.current(C,N,T);T()}},[C,N,T,F,k]);const K=w.useMemo(()=>({reference:A,floating:R,setReference:b,setFloating:_}),[b,_]),Y=w.useMemo(()=>({reference:C,floating:N}),[C,N]),ee=w.useMemo(()=>{const G={position:n,left:0,top:0};if(!Y.floating)return G;const re=GN(Y.floating,d.x),X=GN(Y.floating,d.y);return a?{...G,transform:"translate("+re+"px, "+X+"px)",...HN(Y.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:re,top:X}},[n,a,Y.floating,d.x,d.y]);return w.useMemo(()=>({...d,update:T,refs:K,elements:Y,floatingStyles:ee}),[d,T,K,Y,ee])}const bY=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?UN({element:r.current,padding:o}).fn(n):{}:r?UN({element:r,padding:o}).fn(n):{}}}},_Y=(e,t)=>({...fY(e),options:[e,t]}),SY=(e,t)=>({...hY(e),options:[e,t]}),xY=(e,t)=>({...yY(e),options:[e,t]}),EY=(e,t)=>({...pY(e),options:[e,t]}),CY=(e,t)=>({...mY(e),options:[e,t]}),NY=(e,t)=>({...gY(e),options:[e,t]}),RY=(e,t)=>({...bY(e),options:[e,t]});var PY="Arrow",YN=w.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return g.jsx(Pe.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});YN.displayName=PY;var AY=YN,Ey="Popper",[qN,bo]=Tt(Ey),[TY,KN]=qN(Ey),XN=e=>{const{__scopePopper:t,children:n}=e,[r,o]=w.useState(null);return g.jsx(TY,{scope:t,anchor:r,onAnchorChange:o,children:n})};XN.displayName=Ey;var JN="PopperAnchor",QN=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=KN(JN,n),s=w.useRef(null),a=Fe(t,s);return w.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:g.jsx(Pe.div,{...o,ref:a})});QN.displayName=JN;var Cy="PopperContent",[DY,MY]=qN(Cy),ZN=w.forwardRef((e,t)=>{var ae,V,de,ge,pe,oe;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:u="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:m,...p}=e,y=KN(Cy,n),[v,b]=w.useState(null),_=Fe(t,$=>b($)),[C,N]=w.useState(null),A=Zl(C),R=(A==null?void 0:A.width)??0,D=(A==null?void 0:A.height)??0,k=r+(i!=="center"?"-"+i:""),F=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},W=Array.isArray(c)?c:[c],B=W.length>0,T={padding:F,boundary:W.filter(OY),altBoundary:B},{refs:Q,floatingStyles:K,placement:Y,isPositioned:ee,middlewareData:G}=vY({strategy:"fixed",placement:k,whileElementsMounted:(...$)=>dY(...$,{animationFrame:h==="always"}),elements:{reference:y.anchor},middleware:[_Y({mainAxis:o+D,alignmentAxis:s}),l&&SY({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?xY():void 0,...T}),l&&EY({...T}),CY({...T,apply:({elements:$,rects:j,availableWidth:le,availableHeight:ve})=>{const{width:we,height:M}=j.reference,q=$.floating.style;q.setProperty("--radix-popper-available-width",`${le}px`),q.setProperty("--radix-popper-available-height",`${ve}px`),q.setProperty("--radix-popper-anchor-width",`${we}px`),q.setProperty("--radix-popper-anchor-height",`${M}px`)}}),C&&RY({element:C,padding:a}),kY({arrowWidth:R,arrowHeight:D}),f&&NY({strategy:"referenceHidden",...T})]}),[re,X]=nR(Y),J=Ct(m);Zt(()=>{ee&&(J==null||J())},[ee,J]);const se=(ae=G.arrow)==null?void 0:ae.x,L=(V=G.arrow)==null?void 0:V.y,ne=((de=G.arrow)==null?void 0:de.centerOffset)!==0,[fe,H]=w.useState();return Zt(()=>{v&&H(window.getComputedStyle(v).zIndex)},[v]),g.jsx("div",{ref:Q.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:ee?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(ge=G.transformOrigin)==null?void 0:ge.x,(pe=G.transformOrigin)==null?void 0:pe.y].join(" "),...((oe=G.hide)==null?void 0:oe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(DY,{scope:n,placedSide:re,onArrowChange:N,arrowX:se,arrowY:L,shouldHideArrow:ne,children:g.jsx(Pe.div,{"data-side":re,"data-align":X,...p,ref:_,style:{...p.style,animation:ee?void 0:"none"}})})})});ZN.displayName=Cy;var eR="PopperArrow",IY={top:"bottom",right:"left",bottom:"top",left:"right"},tR=w.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=MY(eR,r),s=IY[i.placedSide];return g.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:g.jsx(AY,{...o,ref:n,style:{...o.style,display:"block"}})})});tR.displayName=eR;function OY(e){return e!==null}var kY=e=>({name:"transformOrigin",options:e,fn(t){var y,v,b;const{placement:n,rects:r,middlewareData:o}=t,s=((y=o.arrow)==null?void 0:y.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,d]=nR(n),u={start:"0%",center:"50%",end:"100%"}[d],f=(((v=o.arrow)==null?void 0:v.x)??0)+a/2,h=(((b=o.arrow)==null?void 0:b.y)??0)+l/2;let m="",p="";return c==="bottom"?(m=s?u:`${f}px`,p=`${-l}px`):c==="top"?(m=s?u:`${f}px`,p=`${r.floating.height+l}px`):c==="right"?(m=`${-l}px`,p=s?u:`${h}px`):c==="left"&&(m=`${r.floating.width+l}px`,p=s?u:`${h}px`),{data:{x:m,y:p}}}});function nR(e){const[t,n="center"]=e.split("-");return[t,n]}var Ra=XN,Pa=QN,rc=ZN,oc=tR,Ny="rovingFocusGroup.onEntryFocus",LY={bubbles:!1,cancelable:!0},gf="RovingFocusGroup",[Ry,rR,jY]=vi(gf),[FY,_o]=Tt(gf,[jY]),[$Y,zY]=FY(gf),oR=w.forwardRef((e,t)=>g.jsx(Ry.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(Ry.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(BY,{...e,ref:t})})}));oR.displayName=gf;var BY=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:d=!1,...u}=e,f=w.useRef(null),h=Fe(t,f),m=zr(i),[p=null,y]=Ft({prop:s,defaultProp:a,onChange:l}),[v,b]=w.useState(!1),_=Ct(c),C=rR(n),N=w.useRef(!1),[A,R]=w.useState(0);return w.useEffect(()=>{const D=f.current;if(D)return D.addEventListener(Ny,_),()=>D.removeEventListener(Ny,_)},[_]),g.jsx($Y,{scope:n,orientation:r,dir:m,loop:o,currentTabStopId:p,onItemFocus:w.useCallback(D=>y(D),[y]),onItemShiftTab:w.useCallback(()=>b(!0),[]),onFocusableItemAdd:w.useCallback(()=>R(D=>D+1),[]),onFocusableItemRemove:w.useCallback(()=>R(D=>D-1),[]),children:g.jsx(Pe.div,{tabIndex:v||A===0?-1:0,"data-orientation":r,...u,ref:h,style:{outline:"none",...e.style},onMouseDown:be(e.onMouseDown,()=>{N.current=!0}),onFocus:be(e.onFocus,D=>{const k=!N.current;if(D.target===D.currentTarget&&k&&!v){const F=new CustomEvent(Ny,LY);if(D.currentTarget.dispatchEvent(F),!F.defaultPrevented){const W=C().filter(Y=>Y.focusable),B=W.find(Y=>Y.active),T=W.find(Y=>Y.id===p),K=[B,T,...W].filter(Boolean).map(Y=>Y.ref.current);aR(K,d)}}N.current=!1}),onBlur:be(e.onBlur,()=>b(!1))})})}),iR="RovingFocusGroupItem",sR=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=on(),l=i||a,c=zY(iR,n),d=c.currentTabStopId===l,u=rR(n),{onFocusableItemAdd:f,onFocusableItemRemove:h}=c;return w.useEffect(()=>{if(r)return f(),()=>h()},[r,f,h]),g.jsx(Ry.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:g.jsx(Pe.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:be(e.onMouseDown,m=>{r?c.onItemFocus(l):m.preventDefault()}),onFocus:be(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:be(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){c.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const p=UY(m,c.orientation,c.dir);if(p!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let v=u().filter(b=>b.focusable).map(b=>b.ref.current);if(p==="last")v.reverse();else if(p==="prev"||p==="next"){p==="prev"&&v.reverse();const b=v.indexOf(m.currentTarget);v=c.loop?HY(v,b+1):v.slice(b+1)}setTimeout(()=>aR(v))}})})})});sR.displayName=iR;var WY={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function VY(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function UY(e,t,n){const r=VY(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return WY[r]}function aR(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function HY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ic=oR,sc=sR,Py=["Enter"," "],GY=["ArrowDown","PageUp","Home"],lR=["ArrowUp","PageDown","End"],YY=[...GY,...lR],qY={ltr:[...Py,"ArrowRight"],rtl:[...Py,"ArrowLeft"]},KY={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ac="Menu",[lc,XY,JY]=vi(ac),[ys,cc]=Tt(ac,[JY,bo,_o]),uc=bo(),cR=_o(),[uR,Ni]=ys(ac),[QY,dc]=ys(ac),dR=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=uc(t),[l,c]=w.useState(null),d=w.useRef(!1),u=Ct(i),f=zr(o);return w.useEffect(()=>{const h=()=>{d.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>d.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),g.jsx(Ra,{...a,children:g.jsx(uR,{scope:t,open:n,onOpenChange:u,content:l,onContentChange:c,children:g.jsx(QY,{scope:t,onClose:w.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:d,dir:f,modal:s,children:r})})})};dR.displayName=ac;var ZY="MenuAnchor",Ay=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=uc(n);return g.jsx(Pa,{...o,...r,ref:t})});Ay.displayName=ZY;var Ty="MenuPortal",[eq,fR]=ys(Ty,{forceMount:void 0}),hR=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Ni(Ty,t);return g.jsx(eq,{scope:t,forceMount:n,children:g.jsx(Bt,{present:n||i.open,children:g.jsx(ql,{asChild:!0,container:o,children:r})})})};hR.displayName=Ty;var Cr="MenuContent",[tq,Dy]=ys(Cr),pR=w.forwardRef((e,t)=>{const n=fR(Cr,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Ni(Cr,e.__scopeMenu),s=dc(Cr,e.__scopeMenu);return g.jsx(lc.Provider,{scope:e.__scopeMenu,children:g.jsx(Bt,{present:r||i.open,children:g.jsx(lc.Slot,{scope:e.__scopeMenu,children:s.modal?g.jsx(nq,{...o,ref:t}):g.jsx(rq,{...o,ref:t})})})})}),nq=w.forwardRef((e,t)=>{const n=Ni(Cr,e.__scopeMenu),r=w.useRef(null),o=Fe(t,r);return w.useEffect(()=>{const i=r.current;if(i)return Ql(i)},[]),g.jsx(My,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:be(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),rq=w.forwardRef((e,t)=>{const n=Ni(Cr,e.__scopeMenu);return g.jsx(My,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),My=w.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:f,onDismiss:h,disableOutsideScroll:m,...p}=e,y=Ni(Cr,n),v=dc(Cr,n),b=uc(n),_=cR(n),C=XY(n),[N,A]=w.useState(null),R=w.useRef(null),D=Fe(t,R,y.onContentChange),k=w.useRef(0),F=w.useRef(""),W=w.useRef(0),B=w.useRef(null),T=w.useRef("right"),Q=w.useRef(0),K=m?Jl:w.Fragment,Y=m?{as:$r,allowPinchZoom:!0}:void 0,ee=re=>{var ae,V;const X=F.current+re,J=C().filter(de=>!de.disabled),se=document.activeElement,L=(ae=J.find(de=>de.ref.current===se))==null?void 0:ae.textValue,ne=J.map(de=>de.textValue),fe=mq(ne,X,L),H=(V=J.find(de=>de.textValue===fe))==null?void 0:V.ref.current;(function de(ge){F.current=ge,window.clearTimeout(k.current),ge!==""&&(k.current=window.setTimeout(()=>de(""),1e3))})(X),H&&setTimeout(()=>H.focus())};w.useEffect(()=>()=>window.clearTimeout(k.current),[]),Xd();const G=w.useCallback(re=>{var J,se;return T.current===((J=B.current)==null?void 0:J.side)&&yq(re,(se=B.current)==null?void 0:se.area)},[]);return g.jsx(tq,{scope:n,searchRef:F,onItemEnter:w.useCallback(re=>{G(re)&&re.preventDefault()},[G]),onItemLeave:w.useCallback(re=>{var X;G(re)||((X=R.current)==null||X.focus(),A(null))},[G]),onTriggerLeave:w.useCallback(re=>{G(re)&&re.preventDefault()},[G]),pointerGraceTimerRef:W,onPointerGraceIntentChange:w.useCallback(re=>{B.current=re},[]),children:g.jsx(K,{...Y,children:g.jsx(Yl,{asChild:!0,trapped:o,onMountAutoFocus:be(i,re=>{var X;re.preventDefault(),(X=R.current)==null||X.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:g.jsx(bi,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:f,onDismiss:h,children:g.jsx(ic,{asChild:!0,..._,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:N,onCurrentTabStopIdChange:A,onEntryFocus:be(l,re=>{v.isUsingKeyboardRef.current||re.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(rc,{role:"menu","aria-orientation":"vertical","data-state":MR(y.open),"data-radix-menu-content":"",dir:v.dir,...b,...p,ref:D,style:{outline:"none",...p.style},onKeyDown:be(p.onKeyDown,re=>{const J=re.target.closest("[data-radix-menu-content]")===re.currentTarget,se=re.ctrlKey||re.altKey||re.metaKey,L=re.key.length===1;J&&(re.key==="Tab"&&re.preventDefault(),!se&&L&&ee(re.key));const ne=R.current;if(re.target!==ne||!YY.includes(re.key))return;re.preventDefault();const H=C().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);lR.includes(re.key)&&H.reverse(),hq(H)}),onBlur:be(e.onBlur,re=>{re.currentTarget.contains(re.target)||(window.clearTimeout(k.current),F.current="")}),onPointerMove:be(e.onPointerMove,hc(re=>{const X=re.target,J=Q.current!==re.clientX;if(re.currentTarget.contains(X)&&J){const se=re.clientX>Q.current?"right":"left";T.current=se,Q.current=re.clientX}}))})})})})})})});pR.displayName=Cr;var oq="MenuGroup",Iy=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(Pe.div,{role:"group",...r,ref:t})});Iy.displayName=oq;var iq="MenuLabel",mR=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(Pe.div,{...r,ref:t})});mR.displayName=iq;var yf="MenuItem",gR="menu.itemSelect",wf=w.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=w.useRef(null),s=dc(yf,e.__scopeMenu),a=Dy(yf,e.__scopeMenu),l=Fe(t,i),c=w.useRef(!1),d=()=>{const u=i.current;if(!n&&u){const f=new CustomEvent(gR,{bubbles:!0,cancelable:!0});u.addEventListener(gR,h=>r==null?void 0:r(h),{once:!0}),Hd(u,f),f.defaultPrevented?c.current=!1:s.onClose()}};return g.jsx(yR,{...o,ref:l,disabled:n,onClick:be(e.onClick,d),onPointerDown:u=>{var f;(f=e.onPointerDown)==null||f.call(e,u),c.current=!0},onPointerUp:be(e.onPointerUp,u=>{var f;c.current||(f=u.currentTarget)==null||f.click()}),onKeyDown:be(e.onKeyDown,u=>{const f=a.searchRef.current!=="";n||f&&u.key===" "||Py.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});wf.displayName=yf;var yR=w.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=Dy(yf,n),a=cR(n),l=w.useRef(null),c=Fe(t,l),[d,u]=w.useState(!1),[f,h]=w.useState("");return w.useEffect(()=>{const m=l.current;m&&h((m.textContent??"").trim())},[i.children]),g.jsx(lc.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:g.jsx(sc,{asChild:!0,...a,focusable:!r,children:g.jsx(Pe.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:be(e.onPointerMove,hc(m=>{r?s.onItemLeave(m):(s.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:be(e.onPointerLeave,hc(m=>s.onItemLeave(m))),onFocus:be(e.onFocus,()=>u(!0)),onBlur:be(e.onBlur,()=>u(!1))})})})}),sq="MenuCheckboxItem",wR=w.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return g.jsx(xR,{scope:e.__scopeMenu,checked:n,children:g.jsx(wf,{role:"menuitemcheckbox","aria-checked":vf(n)?"mixed":n,...o,ref:t,"data-state":Ly(n),onSelect:be(o.onSelect,()=>r==null?void 0:r(vf(n)?!0:!n),{checkForDefaultPrevented:!1})})})});wR.displayName=sq;var vR="MenuRadioGroup",[aq,lq]=ys(vR,{value:void 0,onValueChange:()=>{}}),bR=w.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=Ct(r);return g.jsx(aq,{scope:e.__scopeMenu,value:n,onValueChange:i,children:g.jsx(Iy,{...o,ref:t})})});bR.displayName=vR;var _R="MenuRadioItem",SR=w.forwardRef((e,t)=>{const{value:n,...r}=e,o=lq(_R,e.__scopeMenu),i=n===o.value;return g.jsx(xR,{scope:e.__scopeMenu,checked:i,children:g.jsx(wf,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":Ly(i),onSelect:be(r.onSelect,()=>{var s;return(s=o.onValueChange)==null?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})})});SR.displayName=_R;var Oy="MenuItemIndicator",[xR,cq]=ys(Oy,{checked:!1}),ER=w.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=cq(Oy,n);return g.jsx(Bt,{present:r||vf(i.checked)||i.checked===!0,children:g.jsx(Pe.span,{...o,ref:t,"data-state":Ly(i.checked)})})});ER.displayName=Oy;var uq="MenuSeparator",CR=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(Pe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});CR.displayName=uq;var dq="MenuArrow",NR=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=uc(n);return g.jsx(oc,{...o,...r,ref:t})});NR.displayName=dq;var ky="MenuSub",[fq,RR]=ys(ky),PR=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,i=Ni(ky,t),s=uc(t),[a,l]=w.useState(null),[c,d]=w.useState(null),u=Ct(o);return w.useEffect(()=>(i.open===!1&&u(!1),()=>u(!1)),[i.open,u]),g.jsx(Ra,{...s,children:g.jsx(uR,{scope:t,open:r,onOpenChange:u,content:c,onContentChange:d,children:g.jsx(fq,{scope:t,contentId:on(),triggerId:on(),trigger:a,onTriggerChange:l,children:n})})})};PR.displayName=ky;var fc="MenuSubTrigger",AR=w.forwardRef((e,t)=>{const n=Ni(fc,e.__scopeMenu),r=dc(fc,e.__scopeMenu),o=RR(fc,e.__scopeMenu),i=Dy(fc,e.__scopeMenu),s=w.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},d=w.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return w.useEffect(()=>d,[d]),w.useEffect(()=>{const u=a.current;return()=>{window.clearTimeout(u),l(null)}},[a,l]),g.jsx(Ay,{asChild:!0,...c,children:g.jsx(yR,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":MR(n.open),...e,ref:Gl(t,o.onTriggerChange),onClick:u=>{var f;(f=e.onClick)==null||f.call(e,u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:be(e.onPointerMove,hc(u=>{i.onItemEnter(u),!u.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:be(e.onPointerLeave,hc(u=>{var h,m;d();const f=(h=n.content)==null?void 0:h.getBoundingClientRect();if(f){const p=(m=n.content)==null?void 0:m.dataset.side,y=p==="right",v=y?-5:5,b=f[y?"left":"right"],_=f[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:u.clientX+v,y:u.clientY},{x:b,y:f.top},{x:_,y:f.top},{x:_,y:f.bottom},{x:b,y:f.bottom}],side:p}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(u),u.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:be(e.onKeyDown,u=>{var h;const f=i.searchRef.current!=="";e.disabled||f&&u.key===" "||qY[r.dir].includes(u.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),u.preventDefault())})})})});AR.displayName=fc;var TR="MenuSubContent",DR=w.forwardRef((e,t)=>{const n=fR(Cr,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Ni(Cr,e.__scopeMenu),s=dc(Cr,e.__scopeMenu),a=RR(TR,e.__scopeMenu),l=w.useRef(null),c=Fe(t,l);return g.jsx(lc.Provider,{scope:e.__scopeMenu,children:g.jsx(Bt,{present:r||i.open,children:g.jsx(lc.Slot,{scope:e.__scopeMenu,children:g.jsx(My,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var u;s.isUsingKeyboardRef.current&&((u=l.current)==null||u.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:be(e.onFocusOutside,d=>{d.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:be(e.onEscapeKeyDown,d=>{s.onClose(),d.preventDefault()}),onKeyDown:be(e.onKeyDown,d=>{var h;const u=d.currentTarget.contains(d.target),f=KY[s.dir].includes(d.key);u&&f&&(i.onOpenChange(!1),(h=a.trigger)==null||h.focus(),d.preventDefault())})})})})})});DR.displayName=TR;function MR(e){return e?"open":"closed"}function vf(e){return e==="indeterminate"}function Ly(e){return vf(e)?"indeterminate":e?"checked":"unchecked"}function hq(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function pq(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function mq(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=pq(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function gq(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,c=t[s].x,d=t[s].y;l>r!=d>r&&n<(c-a)*(r-l)/(d-l)+a&&(o=!o)}return o}function yq(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return gq(n,t)}function hc(e){return t=>t.pointerType==="mouse"?e(t):void 0}var jy=dR,Fy=Ay,$y=hR,zy=pR,By=Iy,Wy=mR,Vy=wf,Uy=wR,Hy=bR,Gy=SR,Yy=ER,qy=CR,Ky=NR,Xy=PR,Jy=AR,Qy=DR,Zy="ContextMenu",[wq,lae]=Tt(Zy,[cc]),Dn=cc(),[vq,IR]=wq(Zy),OR=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:o,modal:i=!0}=e,[s,a]=w.useState(!1),l=Dn(t),c=Ct(r),d=w.useCallback(u=>{a(u),c(u)},[c]);return g.jsx(vq,{scope:t,open:s,onOpenChange:d,modal:i,children:g.jsx(jy,{...l,dir:o,open:s,onOpenChange:d,modal:i,children:n})})};OR.displayName=Zy;var kR="ContextMenuTrigger",LR=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...o}=e,i=IR(kR,n),s=Dn(n),a=w.useRef({x:0,y:0}),l=w.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),c=w.useRef(0),d=w.useCallback(()=>window.clearTimeout(c.current),[]),u=f=>{a.current={x:f.clientX,y:f.clientY},i.onOpenChange(!0)};return w.useEffect(()=>d,[d]),w.useEffect(()=>void(r&&d()),[r,d]),g.jsxs(g.Fragment,{children:[g.jsx(Fy,{...s,virtualRef:l}),g.jsx(Pe.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...o,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:be(e.onContextMenu,f=>{d(),u(f),f.preventDefault()}),onPointerDown:r?e.onPointerDown:be(e.onPointerDown,bf(f=>{d(),c.current=window.setTimeout(()=>u(f),700)})),onPointerMove:r?e.onPointerMove:be(e.onPointerMove,bf(d)),onPointerCancel:r?e.onPointerCancel:be(e.onPointerCancel,bf(d)),onPointerUp:r?e.onPointerUp:be(e.onPointerUp,bf(d))})]})});LR.displayName=kR;var bq="ContextMenuPortal",jR=e=>{const{__scopeContextMenu:t,...n}=e,r=Dn(t);return g.jsx($y,{...r,...n})};jR.displayName=bq;var FR="ContextMenuContent",$R=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=IR(FR,n),i=Dn(n),s=w.useRef(!1);return g.jsx(zy,{...i,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:a=>{var l;(l=e.onCloseAutoFocus)==null||l.call(e,a),!a.defaultPrevented&&s.current&&a.preventDefault(),s.current=!1},onInteractOutside:a=>{var l;(l=e.onInteractOutside)==null||l.call(e,a),!a.defaultPrevented&&!o.modal&&(s.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});$R.displayName=FR;var _q="ContextMenuGroup",zR=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Dn(n);return g.jsx(By,{...o,...r,ref:t})});zR.displayName=_q;var Sq="ContextMenuLabel",BR=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Dn(n);return g.jsx(Wy,{...o,...r,ref:t})});BR.displayName=Sq;var xq="ContextMenuItem",WR=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Dn(n);return g.jsx(Vy,{...o,...r,ref:t})});WR.displayName=xq;var Eq="ContextMenuCheckboxItem",VR=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Dn(n);return g.jsx(Uy,{...o,...r,ref:t})});VR.displayName=Eq;var Cq="ContextMenuRadioGroup",UR=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Dn(n);return g.jsx(Hy,{...o,...r,ref:t})});UR.displayName=Cq;var Nq="ContextMenuRadioItem",HR=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Dn(n);return g.jsx(Gy,{...o,...r,ref:t})});HR.displayName=Nq;var Rq="ContextMenuItemIndicator",GR=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Dn(n);return g.jsx(Yy,{...o,...r,ref:t})});GR.displayName=Rq;var Pq="ContextMenuSeparator",YR=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Dn(n);return g.jsx(qy,{...o,...r,ref:t})});YR.displayName=Pq;var Aq="ContextMenuArrow",Tq=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Dn(n);return g.jsx(Ky,{...o,...r,ref:t})});Tq.displayName=Aq;var Dq="ContextMenuSub",qR=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,open:o,defaultOpen:i}=e,s=Dn(t),[a,l]=Ft({prop:o,defaultProp:i,onChange:r});return g.jsx(Xy,{...s,open:a,onOpenChange:l,children:n})};qR.displayName=Dq;var Mq="ContextMenuSubTrigger",KR=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Dn(n);return g.jsx(Jy,{...o,...r,ref:t})});KR.displayName=Mq;var Iq="ContextMenuSubContent",XR=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Dn(n);return g.jsx(Qy,{...o,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});XR.displayName=Iq;function bf(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var Oq=OR,kq=LR,JR=jR,QR=$R,Lq=zR,ZR=BR,eP=WR,tP=VR,jq=UR,nP=HR,rP=GR,oP=YR,Fq=qR,iP=KR,sP=XR,ew="DropdownMenu",[$q,cae]=Tt(ew,[cc]),Mn=cc(),[zq,aP]=$q(ew),lP=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=Mn(t),c=w.useRef(null),[d=!1,u]=Ft({prop:o,defaultProp:i,onChange:s});return g.jsx(zq,{scope:t,triggerId:on(),triggerRef:c,contentId:on(),open:d,onOpenChange:u,onOpenToggle:w.useCallback(()=>u(f=>!f),[u]),modal:a,children:g.jsx(jy,{...l,open:d,onOpenChange:u,dir:r,modal:a,children:n})})};lP.displayName=ew;var cP="DropdownMenuTrigger",uP=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=aP(cP,n),s=Mn(n);return g.jsx(Fy,{asChild:!0,...s,children:g.jsx(Pe.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Gl(t,i.triggerRef),onPointerDown:be(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:be(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});uP.displayName=cP;var Bq="DropdownMenuPortal",dP=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Mn(t);return g.jsx($y,{...r,...n})};dP.displayName=Bq;var fP="DropdownMenuContent",hP=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=aP(fP,n),i=Mn(n),s=w.useRef(!1);return g.jsx(zy,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:be(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)==null||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:be(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;(!o.modal||d)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});hP.displayName=fP;var Wq="DropdownMenuGroup",pP=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Mn(n);return g.jsx(By,{...o,...r,ref:t})});pP.displayName=Wq;var Vq="DropdownMenuLabel",mP=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Mn(n);return g.jsx(Wy,{...o,...r,ref:t})});mP.displayName=Vq;var Uq="DropdownMenuItem",gP=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Mn(n);return g.jsx(Vy,{...o,...r,ref:t})});gP.displayName=Uq;var Hq="DropdownMenuCheckboxItem",yP=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Mn(n);return g.jsx(Uy,{...o,...r,ref:t})});yP.displayName=Hq;var Gq="DropdownMenuRadioGroup",wP=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Mn(n);return g.jsx(Hy,{...o,...r,ref:t})});wP.displayName=Gq;var Yq="DropdownMenuRadioItem",vP=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Mn(n);return g.jsx(Gy,{...o,...r,ref:t})});vP.displayName=Yq;var qq="DropdownMenuItemIndicator",bP=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Mn(n);return g.jsx(Yy,{...o,...r,ref:t})});bP.displayName=qq;var Kq="DropdownMenuSeparator",_P=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Mn(n);return g.jsx(qy,{...o,...r,ref:t})});_P.displayName=Kq;var Xq="DropdownMenuArrow",Jq=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Mn(n);return g.jsx(Ky,{...o,...r,ref:t})});Jq.displayName=Xq;var Qq=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:i}=e,s=Mn(t),[a=!1,l]=Ft({prop:r,defaultProp:i,onChange:o});return g.jsx(Xy,{...s,open:a,onOpenChange:l,children:n})},Zq="DropdownMenuSubTrigger",SP=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Mn(n);return g.jsx(Jy,{...o,...r,ref:t})});SP.displayName=Zq;var eK="DropdownMenuSubContent",xP=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Mn(n);return g.jsx(Qy,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xP.displayName=eK;var tK=lP,nK=uP,EP=dP,CP=hP,rK=pP,NP=mP,RP=gP,PP=yP,oK=wP,AP=vP,TP=bP,DP=_P,iK=Qq,MP=SP,IP=xP,sK="Label",OP=w.forwardRef((e,t)=>g.jsx(Pe.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())}}));OP.displayName=sK;var kP=OP,tw,nw="HoverCard",[LP,uae]=Tt(nw,[bo]),_f=bo(),[aK,rw]=LP(nw),jP=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:s=700,closeDelay:a=300}=e,l=_f(t),c=w.useRef(0),d=w.useRef(0),u=w.useRef(!1),f=w.useRef(!1),[h=!1,m]=Ft({prop:r,defaultProp:o,onChange:i}),p=w.useCallback(()=>{clearTimeout(d.current),c.current=window.setTimeout(()=>m(!0),s)},[s,m]),y=w.useCallback(()=>{clearTimeout(c.current),!u.current&&!f.current&&(d.current=window.setTimeout(()=>m(!1),a))},[a,m]),v=w.useCallback(()=>m(!1),[m]);return w.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(d.current)},[]),g.jsx(aK,{scope:t,open:h,onOpenChange:m,onOpen:p,onClose:y,onDismiss:v,hasSelectionRef:u,isPointerDownOnContentRef:f,children:g.jsx(Ra,{...l,children:n})})};jP.displayName=nw;var FP="HoverCardTrigger",$P=w.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=rw(FP,n),i=_f(n);return g.jsx(Pa,{asChild:!0,...i,children:g.jsx(Pe.a,{"data-state":o.open?"open":"closed",...r,ref:t,onPointerEnter:be(e.onPointerEnter,xf(o.onOpen)),onPointerLeave:be(e.onPointerLeave,xf(o.onClose)),onFocus:be(e.onFocus,o.onOpen),onBlur:be(e.onBlur,o.onClose),onTouchStart:be(e.onTouchStart,s=>s.preventDefault())})})});$P.displayName=FP;var lK="HoverCardPortal",[dae,cK]=LP(lK,{forceMount:void 0}),Sf="HoverCardContent",zP=w.forwardRef((e,t)=>{const n=cK(Sf,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=rw(Sf,e.__scopeHoverCard);return g.jsx(Bt,{present:r||i.open,children:g.jsx(uK,{"data-state":i.open?"open":"closed",...o,onPointerEnter:be(e.onPointerEnter,xf(i.onOpen)),onPointerLeave:be(e.onPointerLeave,xf(i.onClose)),ref:t})})});zP.displayName=Sf;var uK=w.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,...a}=e,l=rw(Sf,n),c=_f(n),d=w.useRef(null),u=Fe(t,d),[f,h]=w.useState(!1);return w.useEffect(()=>{if(f){const m=document.body;return tw=m.style.userSelect||m.style.webkitUserSelect,m.style.userSelect="none",m.style.webkitUserSelect="none",()=>{m.style.userSelect=tw,m.style.webkitUserSelect=tw}}},[f]),w.useEffect(()=>{if(d.current){const m=()=>{h(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var y;((y=document.getSelection())==null?void 0:y.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",m),()=>{document.removeEventListener("pointerup",m),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),w.useEffect(()=>{d.current&&hK(d.current).forEach(p=>p.setAttribute("tabindex","-1"))}),g.jsx(bi,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:be(i,m=>{m.preventDefault()}),onDismiss:l.onDismiss,children:g.jsx(rc,{...c,...a,onPointerDown:be(a.onPointerDown,m=>{m.currentTarget.contains(m.target)&&h(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:u,style:{...a.style,userSelect:f?"text":void 0,WebkitUserSelect:f?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),dK="HoverCardArrow",fK=w.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=_f(n);return g.jsx(oc,{...o,...r,ref:t})});fK.displayName=dK;function xf(e){return t=>t.pointerType==="touch"?void 0:e()}function hK(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var pK=jP,mK=$P,BP=zP,Ef="Menubar",[ow,gK,yK]=vi(Ef),[WP,fae]=Tt(Ef,[yK,_o]),In=cc(),VP=_o(),[wK,iw]=WP(Ef),UP=w.forwardRef((e,t)=>{const{__scopeMenubar:n,value:r,onValueChange:o,defaultValue:i,loop:s=!0,dir:a,...l}=e,c=zr(a),d=VP(n),[u="",f]=Ft({prop:r,onChange:o,defaultProp:i}),[h,m]=w.useState(null);return g.jsx(wK,{scope:n,value:u,onMenuOpen:w.useCallback(p=>{f(p),m(p)},[f]),onMenuClose:w.useCallback(()=>f(""),[f]),onMenuToggle:w.useCallback(p=>{f(y=>y?"":p),m(p)},[f]),dir:c,loop:s,children:g.jsx(ow.Provider,{scope:n,children:g.jsx(ow.Slot,{scope:n,children:g.jsx(ic,{asChild:!0,...d,orientation:"horizontal",loop:s,dir:c,currentTabStopId:h,onCurrentTabStopIdChange:m,children:g.jsx(Pe.div,{role:"menubar",...l,ref:t})})})})})});UP.displayName=Ef;var sw="MenubarMenu",[vK,HP]=WP(sw),GP=e=>{const{__scopeMenubar:t,value:n,...r}=e,o=on(),i=n||o||"LEGACY_REACT_AUTO_VALUE",s=iw(sw,t),a=In(t),l=w.useRef(null),c=w.useRef(!1),d=s.value===i;return w.useEffect(()=>{d||(c.current=!1)},[d]),g.jsx(vK,{scope:t,value:i,triggerId:on(),triggerRef:l,contentId:on(),wasKeyboardTriggerOpenRef:c,children:g.jsx(jy,{...a,open:d,onOpenChange:u=>{u||s.onMenuClose()},modal:!1,dir:s.dir,...r})})};GP.displayName=sw;var aw="MenubarTrigger",YP=w.forwardRef((e,t)=>{const{__scopeMenubar:n,disabled:r=!1,...o}=e,i=VP(n),s=In(n),a=iw(aw,n),l=HP(aw,n),c=w.useRef(null),d=Fe(t,c,l.triggerRef),[u,f]=w.useState(!1),h=a.value===l.value;return g.jsx(ow.ItemSlot,{scope:n,value:l.value,disabled:r,children:g.jsx(sc,{asChild:!0,...i,focusable:!r,tabStopId:l.value,children:g.jsx(Fy,{asChild:!0,...s,children:g.jsx(Pe.button,{type:"button",role:"menuitem",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":h,"aria-controls":h?l.contentId:void 0,"data-highlighted":u?"":void 0,"data-state":h?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:d,onPointerDown:be(e.onPointerDown,m=>{!r&&m.button===0&&m.ctrlKey===!1&&(a.onMenuOpen(l.value),h||m.preventDefault())}),onPointerEnter:be(e.onPointerEnter,()=>{var p;!!a.value&&!h&&(a.onMenuOpen(l.value),(p=c.current)==null||p.focus())}),onKeyDown:be(e.onKeyDown,m=>{r||(["Enter"," "].includes(m.key)&&a.onMenuToggle(l.value),m.key==="ArrowDown"&&a.onMenuOpen(l.value),["Enter"," ","ArrowDown"].includes(m.key)&&(l.wasKeyboardTriggerOpenRef.current=!0,m.preventDefault()))}),onFocus:be(e.onFocus,()=>f(!0)),onBlur:be(e.onBlur,()=>f(!1))})})})})});YP.displayName=aw;var bK="MenubarPortal",qP=e=>{const{__scopeMenubar:t,...n}=e,r=In(t);return g.jsx($y,{...r,...n})};qP.displayName=bK;var lw="MenubarContent",KP=w.forwardRef((e,t)=>{const{__scopeMenubar:n,align:r="start",...o}=e,i=In(n),s=iw(lw,n),a=HP(lw,n),l=gK(n),c=w.useRef(!1);return g.jsx(zy,{id:a.contentId,"aria-labelledby":a.triggerId,"data-radix-menubar-content":"",...i,...o,ref:t,align:r,onCloseAutoFocus:be(e.onCloseAutoFocus,d=>{var f;!!!s.value&&!c.current&&((f=a.triggerRef.current)==null||f.focus()),c.current=!1,d.preventDefault()}),onFocusOutside:be(e.onFocusOutside,d=>{const u=d.target;l().some(h=>{var m;return(m=h.ref.current)==null?void 0:m.contains(u)})&&d.preventDefault()}),onInteractOutside:be(e.onInteractOutside,()=>{c.current=!0}),onEntryFocus:d=>{a.wasKeyboardTriggerOpenRef.current||d.preventDefault()},onKeyDown:be(e.onKeyDown,d=>{if(["ArrowRight","ArrowLeft"].includes(d.key)){const u=d.target,f=u.hasAttribute("data-radix-menubar-subtrigger"),h=u.closest("[data-radix-menubar-content]")!==d.currentTarget,p=(s.dir==="rtl"?"ArrowRight":"ArrowLeft")===d.key;if(!p&&f||h&&p)return;let b=l().filter(N=>!N.disabled).map(N=>N.value);p&&b.reverse();const _=b.indexOf(a.value);b=s.loop?OK(b,_+1):b.slice(_+1);const[C]=b;C&&s.onMenuOpen(C)}},{checkForDefaultPrevented:!1}),style:{...e.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});KP.displayName=lw;var _K="MenubarGroup",XP=w.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=In(n);return g.jsx(By,{...o,...r,ref:t})});XP.displayName=_K;var SK="MenubarLabel",JP=w.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=In(n);return g.jsx(Wy,{...o,...r,ref:t})});JP.displayName=SK;var xK="MenubarItem",QP=w.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=In(n);return g.jsx(Vy,{...o,...r,ref:t})});QP.displayName=xK;var EK="MenubarCheckboxItem",ZP=w.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=In(n);return g.jsx(Uy,{...o,...r,ref:t})});ZP.displayName=EK;var CK="MenubarRadioGroup",eA=w.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=In(n);return g.jsx(Hy,{...o,...r,ref:t})});eA.displayName=CK;var NK="MenubarRadioItem",tA=w.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=In(n);return g.jsx(Gy,{...o,...r,ref:t})});tA.displayName=NK;var RK="MenubarItemIndicator",nA=w.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=In(n);return g.jsx(Yy,{...o,...r,ref:t})});nA.displayName=RK;var PK="MenubarSeparator",rA=w.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=In(n);return g.jsx(qy,{...o,...r,ref:t})});rA.displayName=PK;var AK="MenubarArrow",TK=w.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=In(n);return g.jsx(Ky,{...o,...r,ref:t})});TK.displayName=AK;var DK="MenubarSub",oA=e=>{const{__scopeMenubar:t,children:n,open:r,onOpenChange:o,defaultOpen:i}=e,s=In(t),[a=!1,l]=Ft({prop:r,defaultProp:i,onChange:o});return g.jsx(Xy,{...s,open:a,onOpenChange:l,children:n})};oA.displayName=DK;var MK="MenubarSubTrigger",iA=w.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=In(n);return g.jsx(Jy,{"data-radix-menubar-subtrigger":"",...o,...r,ref:t})});iA.displayName=MK;var IK="MenubarSubContent",sA=w.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=In(n);return g.jsx(Qy,{...o,"data-radix-menubar-content":"",...r,ref:t,style:{...e.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});sA.displayName=IK;function OK(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var aA=UP,kK=GP,lA=YP,cA=qP,uA=KP,LK=XP,dA=JP,fA=QP,hA=ZP,jK=eA,pA=tA,mA=nA,gA=rA,FK=oA,yA=iA,wA=sA,Aa="NavigationMenu",[cw,vA,$K]=vi(Aa),[uw,zK,BK]=vi(Aa),[dw,hae]=Tt(Aa,[$K,BK]),[WK,Nr]=dw(Aa),[VK,UK]=dw(Aa),bA=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:o,defaultValue:i,delayDuration:s=200,skipDelayDuration:a=300,orientation:l="horizontal",dir:c,...d}=e,[u,f]=w.useState(null),h=Fe(t,k=>f(k)),m=zr(c),p=w.useRef(0),y=w.useRef(0),v=w.useRef(0),[b,_]=w.useState(!0),[C="",N]=Ft({prop:r,onChange:k=>{const F=k!=="",W=a>0;F?(window.clearTimeout(v.current),W&&_(!1)):(window.clearTimeout(v.current),v.current=window.setTimeout(()=>_(!0),a)),o==null||o(k)},defaultProp:i}),A=w.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>N(""),150)},[N]),R=w.useCallback(k=>{window.clearTimeout(y.current),N(k)},[N]),D=w.useCallback(k=>{C===k?window.clearTimeout(y.current):p.current=window.setTimeout(()=>{window.clearTimeout(y.current),N(k)},s)},[C,N,s]);return w.useEffect(()=>()=>{window.clearTimeout(p.current),window.clearTimeout(y.current),window.clearTimeout(v.current)},[]),g.jsx(SA,{scope:n,isRootMenu:!0,value:C,dir:m,orientation:l,rootNavigationMenu:u,onTriggerEnter:k=>{window.clearTimeout(p.current),b?D(k):R(k)},onTriggerLeave:()=>{window.clearTimeout(p.current),A()},onContentEnter:()=>window.clearTimeout(y.current),onContentLeave:A,onItemSelect:k=>{N(F=>F===k?"":k)},onItemDismiss:()=>N(""),children:g.jsx(Pe.nav,{"aria-label":"Main","data-orientation":l,dir:m,...d,ref:h})})});bA.displayName=Aa;var _A="NavigationMenuSub",HK=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",...a}=e,l=Nr(_A,n),[c="",d]=Ft({prop:r,onChange:o,defaultProp:i});return g.jsx(SA,{scope:n,isRootMenu:!1,value:c,dir:l.dir,orientation:s,rootNavigationMenu:l.rootNavigationMenu,onTriggerEnter:u=>d(u),onItemSelect:u=>d(u),onItemDismiss:()=>d(""),children:g.jsx(Pe.div,{"data-orientation":s,...a,ref:t})})});HK.displayName=_A;var SA=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:o,orientation:i,children:s,value:a,onItemSelect:l,onItemDismiss:c,onTriggerEnter:d,onTriggerLeave:u,onContentEnter:f,onContentLeave:h}=e,[m,p]=w.useState(null),[y,v]=w.useState(new Map),[b,_]=w.useState(null);return g.jsx(WK,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:a,previousValue:Sa(a),baseId:on(),dir:o,orientation:i,viewport:m,onViewportChange:p,indicatorTrack:b,onIndicatorTrackChange:_,onTriggerEnter:Ct(d),onTriggerLeave:Ct(u),onContentEnter:Ct(f),onContentLeave:Ct(h),onItemSelect:Ct(l),onItemDismiss:Ct(c),onViewportContentChange:w.useCallback((C,N)=>{v(A=>(A.set(C,N),new Map(A)))},[]),onViewportContentRemove:w.useCallback(C=>{v(N=>N.has(C)?(N.delete(C),new Map(N)):N)},[]),children:g.jsx(cw.Provider,{scope:t,children:g.jsx(VK,{scope:t,items:y,children:s})})})},xA="NavigationMenuList",EA=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,o=Nr(xA,n),i=g.jsx(Pe.ul,{"data-orientation":o.orientation,...r,ref:t});return g.jsx(Pe.div,{style:{position:"relative"},ref:o.onIndicatorTrackChange,children:g.jsx(cw.Slot,{scope:n,children:o.isRootMenu?g.jsx(kA,{asChild:!0,children:i}):i})})});EA.displayName=xA;var CA="NavigationMenuItem",[GK,NA]=dw(CA),RA=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...o}=e,i=on(),s=r||i||"LEGACY_REACT_AUTO_VALUE",a=w.useRef(null),l=w.useRef(null),c=w.useRef(null),d=w.useRef(()=>{}),u=w.useRef(!1),f=w.useCallback((m="start")=>{if(a.current){d.current();const p=mw(a.current);p.length&&gw(m==="start"?p:p.reverse())}},[]),h=w.useCallback(()=>{if(a.current){const m=mw(a.current);m.length&&(d.current=ZK(m))}},[]);return g.jsx(GK,{scope:n,value:s,triggerRef:l,contentRef:a,focusProxyRef:c,wasEscapeCloseRef:u,onEntryKeyDown:f,onFocusProxyEnter:f,onRootContentClose:h,onContentFocusOutside:h,children:g.jsx(Pe.li,{...o,ref:t})})});RA.displayName=CA;var fw="NavigationMenuTrigger",PA=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...o}=e,i=Nr(fw,e.__scopeNavigationMenu),s=NA(fw,e.__scopeNavigationMenu),a=w.useRef(null),l=Fe(a,s.triggerRef,t),c=FA(i.baseId,s.value),d=$A(i.baseId,s.value),u=w.useRef(!1),f=w.useRef(!1),h=s.value===i.value;return g.jsxs(g.Fragment,{children:[g.jsx(cw.ItemSlot,{scope:n,value:s.value,children:g.jsx(jA,{asChild:!0,children:g.jsx(Pe.button,{id:c,disabled:r,"data-disabled":r?"":void 0,"data-state":ww(h),"aria-expanded":h,"aria-controls":d,...o,ref:l,onPointerEnter:be(e.onPointerEnter,()=>{f.current=!1,s.wasEscapeCloseRef.current=!1}),onPointerMove:be(e.onPointerMove,Nf(()=>{r||f.current||s.wasEscapeCloseRef.current||u.current||(i.onTriggerEnter(s.value),u.current=!0)})),onPointerLeave:be(e.onPointerLeave,Nf(()=>{r||(i.onTriggerLeave(),u.current=!1)})),onClick:be(e.onClick,()=>{i.onItemSelect(s.value),f.current=h}),onKeyDown:be(e.onKeyDown,m=>{const y={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];h&&m.key===y&&(s.onEntryKeyDown(),m.preventDefault())})})})}),h&&g.jsxs(g.Fragment,{children:[g.jsx(UC,{"aria-hidden":!0,tabIndex:0,ref:s.focusProxyRef,onFocus:m=>{const p=s.contentRef.current,y=m.relatedTarget,v=y===a.current,b=p==null?void 0:p.contains(y);(v||!b)&&s.onFocusProxyEnter(v?"start":"end")}}),i.viewport&&g.jsx("span",{"aria-owns":d})]})]})});PA.displayName=fw;var YK="NavigationMenuLink",AA="navigationMenu.linkSelect",TA=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:o,...i}=e;return g.jsx(jA,{asChild:!0,children:g.jsx(Pe.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...i,ref:t,onClick:be(e.onClick,s=>{const a=s.target,l=new CustomEvent(AA,{bubbles:!0,cancelable:!0});if(a.addEventListener(AA,c=>o==null?void 0:o(c),{once:!0}),Hd(a,l),!l.defaultPrevented&&!s.metaKey){const c=new CustomEvent(Cf,{bubbles:!0,cancelable:!0});Hd(a,c)}},{checkForDefaultPrevented:!1})})})});TA.displayName=YK;var hw="NavigationMenuIndicator",DA=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Nr(hw,e.__scopeNavigationMenu),i=!!o.value;return o.indicatorTrack?Zr.createPortal(g.jsx(Bt,{present:n||i,children:g.jsx(qK,{...r,ref:t})}),o.indicatorTrack):null});DA.displayName=hw;var qK=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,o=Nr(hw,n),i=vA(n),[s,a]=w.useState(null),[l,c]=w.useState(null),d=o.orientation==="horizontal",u=!!o.value;w.useEffect(()=>{var p;const m=(p=i().find(y=>y.value===o.value))==null?void 0:p.ref.current;m&&a(m)},[i,o.value]);const f=()=>{s&&c({size:d?s.offsetWidth:s.offsetHeight,offset:d?s.offsetLeft:s.offsetTop})};return yw(s,f),yw(o.indicatorTrack,f),l?g.jsx(Pe.div,{"aria-hidden":!0,"data-state":u?"visible":"hidden","data-orientation":o.orientation,...r,ref:t,style:{position:"absolute",...d?{left:0,width:l.size+"px",transform:`translateX(${l.offset}px)`}:{top:0,height:l.size+"px",transform:`translateY(${l.offset}px)`},...r.style}}):null}),Ta="NavigationMenuContent",MA=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Nr(Ta,e.__scopeNavigationMenu),i=NA(Ta,e.__scopeNavigationMenu),s=Fe(i.contentRef,t),a=i.value===o.value,l={value:i.value,triggerRef:i.triggerRef,focusProxyRef:i.focusProxyRef,wasEscapeCloseRef:i.wasEscapeCloseRef,onContentFocusOutside:i.onContentFocusOutside,onRootContentClose:i.onRootContentClose,...r};return o.viewport?g.jsx(KK,{forceMount:n,...l,ref:s}):g.jsx(Bt,{present:n||a,children:g.jsx(IA,{"data-state":ww(a),...l,ref:s,onPointerEnter:be(e.onPointerEnter,o.onContentEnter),onPointerLeave:be(e.onPointerLeave,Nf(o.onContentLeave)),style:{pointerEvents:!a&&o.isRootMenu?"none":void 0,...l.style}})})});MA.displayName=Ta;var KK=w.forwardRef((e,t)=>{const n=Nr(Ta,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:o}=n;return Zt(()=>{r(e.value,{ref:t,...e})},[e,t,r]),Zt(()=>()=>o(e.value),[e.value,o]),null}),Cf="navigationMenu.rootContentDismiss",IA=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:o,focusProxyRef:i,wasEscapeCloseRef:s,onRootContentClose:a,onContentFocusOutside:l,...c}=e,d=Nr(Ta,n),u=w.useRef(null),f=Fe(u,t),h=FA(d.baseId,r),m=$A(d.baseId,r),p=vA(n),y=w.useRef(null),{onItemDismiss:v}=d;w.useEffect(()=>{const _=u.current;if(d.isRootMenu&&_){const C=()=>{var N;v(),a(),_.contains(document.activeElement)&&((N=o.current)==null||N.focus())};return _.addEventListener(Cf,C),()=>_.removeEventListener(Cf,C)}},[d.isRootMenu,e.value,o,v,a]);const b=w.useMemo(()=>{const C=p().map(F=>F.value);d.dir==="rtl"&&C.reverse();const N=C.indexOf(d.value),A=C.indexOf(d.previousValue),R=r===d.value,D=A===C.indexOf(r);if(!R&&!D)return y.current;const k=(()=>{if(N!==A){if(R&&A!==-1)return N>A?"from-end":"from-start";if(D&&N!==-1)return N>A?"to-start":"to-end"}return null})();return y.current=k,k},[d.previousValue,d.value,d.dir,p,r]);return g.jsx(kA,{asChild:!0,children:g.jsx(bi,{id:m,"aria-labelledby":h,"data-motion":b,"data-orientation":d.orientation,...c,ref:f,disableOutsidePointerEvents:!1,onDismiss:()=>{var C;const _=new Event(Cf,{bubbles:!0,cancelable:!0});(C=u.current)==null||C.dispatchEvent(_)},onFocusOutside:be(e.onFocusOutside,_=>{var N;l();const C=_.target;(N=d.rootNavigationMenu)!=null&&N.contains(C)&&_.preventDefault()}),onPointerDownOutside:be(e.onPointerDownOutside,_=>{var R;const C=_.target,N=p().some(D=>{var k;return(k=D.ref.current)==null?void 0:k.contains(C)}),A=d.isRootMenu&&((R=d.viewport)==null?void 0:R.contains(C));(N||A||!d.isRootMenu)&&_.preventDefault()}),onKeyDown:be(e.onKeyDown,_=>{var A;const C=_.altKey||_.ctrlKey||_.metaKey;if(_.key==="Tab"&&!C){const R=mw(_.currentTarget),D=document.activeElement,k=R.findIndex(B=>B===D),W=_.shiftKey?R.slice(0,k).reverse():R.slice(k+1,R.length);gw(W)?_.preventDefault():(A=i.current)==null||A.focus()}}),onEscapeKeyDown:be(e.onEscapeKeyDown,_=>{s.current=!0})})})}),pw="NavigationMenuViewport",OA=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=!!Nr(pw,e.__scopeNavigationMenu).value;return g.jsx(Bt,{present:n||i,children:g.jsx(XK,{...r,ref:t})})});OA.displayName=pw;var XK=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:r,...o}=e,i=Nr(pw,n),s=Fe(t,i.onViewportChange),a=UK(Ta,e.__scopeNavigationMenu),[l,c]=w.useState(null),[d,u]=w.useState(null),f=l?(l==null?void 0:l.width)+"px":void 0,h=l?(l==null?void 0:l.height)+"px":void 0,m=!!i.value,p=m?i.value:i.previousValue;return yw(d,()=>{d&&c({width:d.offsetWidth,height:d.offsetHeight})}),g.jsx(Pe.div,{"data-state":ww(m),"data-orientation":i.orientation,...o,ref:s,style:{pointerEvents:!m&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":f,"--radix-navigation-menu-viewport-height":h,...o.style},onPointerEnter:be(e.onPointerEnter,i.onContentEnter),onPointerLeave:be(e.onPointerLeave,Nf(i.onContentLeave)),children:Array.from(a.items).map(([v,{ref:b,forceMount:_,...C}])=>{const N=p===v;return g.jsx(Bt,{present:_||N,children:g.jsx(IA,{...C,ref:Gl(b,A=>{N&&A&&u(A)})})},v)})})}),JK="FocusGroup",kA=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,o=Nr(JK,n);return g.jsx(uw.Provider,{scope:n,children:g.jsx(uw.Slot,{scope:n,children:g.jsx(Pe.div,{dir:o.dir,...r,ref:t})})})}),LA=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],QK="FocusGroupItem",jA=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,o=zK(n),i=Nr(QK,n);return g.jsx(uw.ItemSlot,{scope:n,children:g.jsx(Pe.button,{...r,ref:t,onKeyDown:be(e.onKeyDown,s=>{if(["Home","End",...LA].includes(s.key)){let l=o().map(u=>u.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(s.key)&&l.reverse(),LA.includes(s.key)){const u=l.indexOf(s.currentTarget);l=l.slice(u+1)}setTimeout(()=>gw(l)),s.preventDefault()}})})})});function mw(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 gw(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function ZK(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const n=t.dataset.tabindex;t.setAttribute("tabindex",n)})}}function yw(e,t){const n=Ct(t);Zt(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}function ww(e){return e?"open":"closed"}function FA(e,t){return`${e}-trigger-${t}`}function $A(e,t){return`${e}-content-${t}`}function Nf(e){return t=>t.pointerType==="mouse"?e(t):void 0}var zA=bA,BA=EA,e6=RA,WA=PA,t6=TA,VA=DA,UA=MA,HA=OA,vw="Popover",[GA,pae]=Tt(vw,[bo]),pc=bo(),[n6,Ri]=GA(vw),YA=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=pc(t),l=w.useRef(null),[c,d]=w.useState(!1),[u=!1,f]=Ft({prop:r,defaultProp:o,onChange:i});return g.jsx(Ra,{...a,children:g.jsx(n6,{scope:t,contentId:on(),triggerRef:l,open:u,onOpenChange:f,onOpenToggle:w.useCallback(()=>f(h=>!h),[f]),hasCustomAnchor:c,onCustomAnchorAdd:w.useCallback(()=>d(!0),[]),onCustomAnchorRemove:w.useCallback(()=>d(!1),[]),modal:s,children:n})})};YA.displayName=vw;var qA="PopoverAnchor",r6=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ri(qA,n),i=pc(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=o;return w.useEffect(()=>(s(),()=>a()),[s,a]),g.jsx(Pa,{...i,...r,ref:t})});r6.displayName=qA;var KA="PopoverTrigger",XA=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ri(KA,n),i=pc(n),s=Fe(t,o.triggerRef),a=g.jsx(Pe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":tT(o.open),...r,ref:s,onClick:be(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:g.jsx(Pa,{asChild:!0,...i,children:a})});XA.displayName=KA;var bw="PopoverPortal",[o6,i6]=GA(bw,{forceMount:void 0}),JA=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=Ri(bw,t);return g.jsx(o6,{scope:t,forceMount:n,children:g.jsx(Bt,{present:n||i.open,children:g.jsx(ql,{asChild:!0,container:o,children:r})})})};JA.displayName=bw;var Da="PopoverContent",QA=w.forwardRef((e,t)=>{const n=i6(Da,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=Ri(Da,e.__scopePopover);return g.jsx(Bt,{present:r||i.open,children:i.modal?g.jsx(s6,{...o,ref:t}):g.jsx(a6,{...o,ref:t})})});QA.displayName=Da;var s6=w.forwardRef((e,t)=>{const n=Ri(Da,e.__scopePopover),r=w.useRef(null),o=Fe(t,r),i=w.useRef(!1);return w.useEffect(()=>{const s=r.current;if(s)return Ql(s)},[]),g.jsx(Jl,{as:$r,allowPinchZoom:!0,children:g.jsx(ZA,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:be(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:be(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:be(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),a6=w.forwardRef((e,t)=>{const n=Ri(Da,e.__scopePopover),r=w.useRef(!1),o=w.useRef(!1);return g.jsx(ZA,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),ZA=w.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,...u}=e,f=Ri(Da,n),h=pc(n);return Xd(),g.jsx(Yl,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:g.jsx(bi,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:g.jsx(rc,{"data-state":tT(f.open),role:"dialog",id:f.contentId,...h,...u,ref:t,style:{...u.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),eT="PopoverClose",l6=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ri(eT,n);return g.jsx(Pe.button,{type:"button",...r,ref:t,onClick:be(e.onClick,()=>o.onOpenChange(!1))})});l6.displayName=eT;var c6="PopoverArrow",u6=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=pc(n);return g.jsx(oc,{...o,...r,ref:t})});u6.displayName=c6;function tT(e){return e?"open":"closed"}var d6=YA,f6=XA,h6=JA,nT=QA,_w="Progress",Sw=100,[p6,mae]=Tt(_w),[m6,g6]=p6(_w),rT=w.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:o,getValueLabel:i=y6,...s}=e;(o||o===0)&&!aT(o)&&console.error(w6(`${o}`,"Progress"));const a=aT(o)?o:Sw;r!==null&&!lT(r,a)&&console.error(v6(`${r}`,"Progress"));const l=lT(r,a)?r:null,c=Rf(l)?i(l,a):void 0;return g.jsx(m6,{scope:n,value:l,max:a,children:g.jsx(Pe.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":Rf(l)?l:void 0,"aria-valuetext":c,role:"progressbar","data-state":sT(l,a),"data-value":l??void 0,"data-max":a,...s,ref:t})})});rT.displayName=_w;var oT="ProgressIndicator",iT=w.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,o=g6(oT,n);return g.jsx(Pe.div,{"data-state":sT(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...r,ref:t})});iT.displayName=oT;function y6(e,t){return`${Math.round(e/t*100)}%`}function sT(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Rf(e){return typeof e=="number"}function aT(e){return Rf(e)&&!isNaN(e)&&e>0}function lT(e,t){return Rf(e)&&!isNaN(e)&&e<=t&&e>=0}function w6(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Sw}\`.`}function v6(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
245
|
+
- a positive number
|
|
246
|
+
- less than the value passed to \`max\` (or ${Sw} if no \`max\` prop is set)
|
|
247
|
+
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
248
|
+
|
|
249
|
+
Defaulting to \`null\`.`}var cT=rT,b6=iT,xw="Radio",[_6,uT]=Tt(xw),[S6,x6]=_6(xw),dT=w.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:s,value:a="on",onCheck:l,form:c,...d}=e,[u,f]=w.useState(null),h=Fe(t,y=>f(y)),m=w.useRef(!1),p=u?c||!!u.closest("form"):!0;return g.jsxs(S6,{scope:n,checked:o,disabled:s,children:[g.jsx(Pe.button,{type:"button",role:"radio","aria-checked":o,"data-state":pT(o),"data-disabled":s?"":void 0,disabled:s,value:a,...d,ref:h,onClick:be(e.onClick,y=>{o||l==null||l(),p&&(m.current=y.isPropagationStopped(),m.current||y.stopPropagation())})}),p&&g.jsx(E6,{control:u,bubbles:!m.current,name:r,value:a,checked:o,required:i,disabled:s,form:c,style:{transform:"translateX(-100%)"}})]})});dT.displayName=xw;var fT="RadioIndicator",hT=w.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=x6(fT,n);return g.jsx(Bt,{present:r||i.checked,children:g.jsx(Pe.span,{"data-state":pT(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t})})});hT.displayName=fT;var E6=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=w.useRef(null),s=Sa(n),a=Zl(t);return w.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&u){const f=new Event("click",{bubbles:r});u.call(l,n),l.dispatchEvent(f)}},[s,n,r]),g.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function pT(e){return e?"checked":"unchecked"}var C6=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Ew="RadioGroup",[N6,gae]=Tt(Ew,[_o,uT]),mT=_o(),gT=uT(),[R6,P6]=N6(Ew),yT=w.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:s=!1,disabled:a=!1,orientation:l,dir:c,loop:d=!0,onValueChange:u,...f}=e,h=mT(n),m=zr(c),[p,y]=Ft({prop:i,defaultProp:o,onChange:u});return g.jsx(R6,{scope:n,name:r,required:s,disabled:a,value:p,onValueChange:y,children:g.jsx(ic,{asChild:!0,...h,orientation:l,dir:m,loop:d,children:g.jsx(Pe.div,{role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:m,...f,ref:t})})})});yT.displayName=Ew;var wT="RadioGroupItem",vT=w.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=P6(wT,n),s=i.disabled||r,a=mT(n),l=gT(n),c=w.useRef(null),d=Fe(t,c),u=i.value===o.value,f=w.useRef(!1);return w.useEffect(()=>{const h=p=>{C6.includes(p.key)&&(f.current=!0)},m=()=>f.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),g.jsx(sc,{asChild:!0,...a,focusable:!s,active:u,children:g.jsx(dT,{disabled:s,required:i.required,checked:u,...l,...o,name:i.name,ref:d,onCheck:()=>i.onValueChange(o.value),onKeyDown:be(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:be(o.onFocus,()=>{var h;f.current&&((h=c.current)==null||h.click())})})})});vT.displayName=wT;var A6="RadioGroupIndicator",bT=w.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=gT(n);return g.jsx(hT,{...o,...r,ref:t})});bT.displayName=A6;var _T=yT,ST=vT,T6=bT;function mc(e,[t,n]){return Math.min(n,Math.max(t,e))}function D6(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var Cw="ScrollArea",[xT,yae]=Tt(Cw),[M6,Rr]=xT(Cw),ET=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=w.useState(null),[c,d]=w.useState(null),[u,f]=w.useState(null),[h,m]=w.useState(null),[p,y]=w.useState(null),[v,b]=w.useState(0),[_,C]=w.useState(0),[N,A]=w.useState(!1),[R,D]=w.useState(!1),k=Fe(t,W=>l(W)),F=zr(o);return g.jsx(M6,{scope:n,type:r,dir:F,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:d,content:u,onContentChange:f,scrollbarX:h,onScrollbarXChange:m,scrollbarXEnabled:N,onScrollbarXEnabledChange:A,scrollbarY:p,onScrollbarYChange:y,scrollbarYEnabled:R,onScrollbarYEnabledChange:D,onCornerWidthChange:b,onCornerHeightChange:C,children:g.jsx(Pe.div,{dir:F,...s,ref:k,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});ET.displayName=Cw;var CT="ScrollAreaViewport",NT=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,s=Rr(CT,n),a=w.useRef(null),l=Fe(t,a,s.onViewportChange);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),g.jsx(Pe.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:g.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});NT.displayName=CT;var So="ScrollAreaScrollbar",Nw=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Rr(So,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return w.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?g.jsx(I6,{...r,ref:t,forceMount:n}):o.type==="scroll"?g.jsx(O6,{...r,ref:t,forceMount:n}):o.type==="auto"?g.jsx(RT,{...r,ref:t,forceMount:n}):o.type==="always"?g.jsx(Rw,{...r,ref:t}):null});Nw.displayName=So;var I6=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Rr(So,e.__scopeScrollArea),[i,s]=w.useState(!1);return w.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},d=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),g.jsx(Bt,{present:n||i,children:g.jsx(RT,{"data-state":i?"visible":"hidden",...r,ref:t})})}),O6=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Rr(So,e.__scopeScrollArea),i=e.orientation==="horizontal",s=Df(()=>l("SCROLL_END"),100),[a,l]=D6("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return w.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),w.useEffect(()=>{const c=o.viewport,d=i?"scrollLeft":"scrollTop";if(c){let u=c[d];const f=()=>{const h=c[d];u!==h&&(l("SCROLL"),s()),u=h};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[o.viewport,i,l,s]),g.jsx(Bt,{present:n||a!=="hidden",children:g.jsx(Rw,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:be(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:be(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),RT=w.forwardRef((e,t)=>{const n=Rr(So,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=w.useState(!1),a=e.orientation==="horizontal",l=Df(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:d)}},10);return Ma(n.viewport,l),Ma(n.content,l),g.jsx(Bt,{present:r||i,children:g.jsx(Rw,{"data-state":i?"visible":"hidden",...o,ref:t})})}),Rw=w.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=Rr(So,e.__scopeScrollArea),i=w.useRef(null),s=w.useRef(0),[a,l]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=MT(a.viewport,a.content),d={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:f=>i.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function u(f,h){return z6(f,s.current,a,h)}return n==="horizontal"?g.jsx(k6,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollLeft,h=IT(f,a,o.dir);i.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=u(f,o.dir))}}):n==="vertical"?g.jsx(L6,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollTop,h=IT(f,a);i.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=u(f))}}):null}),k6=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=Rr(So,e.__scopeScrollArea),[s,a]=w.useState(),l=w.useRef(null),c=Fe(t,l,i.onScrollbarXChange);return w.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),g.jsx(AT,{"data-orientation":"horizontal",...o,ref:c,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Tf(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,u)=>{if(i.viewport){const f=i.viewport.scrollLeft+d.deltaX;e.onWheelScroll(f),kT(f,u)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Af(s.paddingLeft),paddingEnd:Af(s.paddingRight)}})}})}),L6=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=Rr(So,e.__scopeScrollArea),[s,a]=w.useState(),l=w.useRef(null),c=Fe(t,l,i.onScrollbarYChange);return w.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),g.jsx(AT,{"data-orientation":"vertical",...o,ref:c,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Tf(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,u)=>{if(i.viewport){const f=i.viewport.scrollTop+d.deltaY;e.onWheelScroll(f),kT(f,u)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Af(s.paddingTop),paddingEnd:Af(s.paddingBottom)}})}})}),[j6,PT]=xT(So),AT=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:d,onResize:u,...f}=e,h=Rr(So,n),[m,p]=w.useState(null),y=Fe(t,k=>p(k)),v=w.useRef(null),b=w.useRef(""),_=h.viewport,C=r.content-r.viewport,N=Ct(d),A=Ct(l),R=Df(u,10);function D(k){if(v.current){const F=k.clientX-v.current.left,W=k.clientY-v.current.top;c({x:F,y:W})}}return w.useEffect(()=>{const k=F=>{const W=F.target;(m==null?void 0:m.contains(W))&&N(F,C)};return document.addEventListener("wheel",k,{passive:!1}),()=>document.removeEventListener("wheel",k,{passive:!1})},[_,m,C,N]),w.useEffect(A,[r,A]),Ma(m,R),Ma(h.content,R),g.jsx(j6,{scope:n,scrollbar:m,hasThumb:o,onThumbChange:Ct(i),onThumbPointerUp:Ct(s),onThumbPositionChange:A,onThumbPointerDown:Ct(a),children:g.jsx(Pe.div,{...f,ref:y,style:{position:"absolute",...f.style},onPointerDown:be(e.onPointerDown,k=>{k.button===0&&(k.target.setPointerCapture(k.pointerId),v.current=m.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),D(k))}),onPointerMove:be(e.onPointerMove,D),onPointerUp:be(e.onPointerUp,k=>{const F=k.target;F.hasPointerCapture(k.pointerId)&&F.releasePointerCapture(k.pointerId),document.body.style.webkitUserSelect=b.current,h.viewport&&(h.viewport.style.scrollBehavior=""),v.current=null})})})}),Pf="ScrollAreaThumb",TT=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=PT(Pf,e.__scopeScrollArea);return g.jsx(Bt,{present:n||o.hasThumb,children:g.jsx(F6,{ref:t,...r})})}),F6=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=Rr(Pf,n),s=PT(Pf,n),{onThumbPositionChange:a}=s,l=Fe(t,u=>s.onThumbChange(u)),c=w.useRef(void 0),d=Df(()=>{c.current&&(c.current(),c.current=void 0)},100);return w.useEffect(()=>{const u=i.viewport;if(u){const f=()=>{if(d(),!c.current){const h=B6(u,a);c.current=h,a()}};return a(),u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[i.viewport,d,a]),g.jsx(Pe.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:be(e.onPointerDownCapture,u=>{const h=u.target.getBoundingClientRect(),m=u.clientX-h.left,p=u.clientY-h.top;s.onThumbPointerDown({x:m,y:p})}),onPointerUp:be(e.onPointerUp,s.onThumbPointerUp)})});TT.displayName=Pf;var Pw="ScrollAreaCorner",DT=w.forwardRef((e,t)=>{const n=Rr(Pw,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?g.jsx($6,{...e,ref:t}):null});DT.displayName=Pw;var $6=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=Rr(Pw,n),[i,s]=w.useState(0),[a,l]=w.useState(0),c=!!(i&&a);return Ma(o.scrollbarX,()=>{var u;const d=((u=o.scrollbarX)==null?void 0:u.offsetHeight)||0;o.onCornerHeightChange(d),l(d)}),Ma(o.scrollbarY,()=>{var u;const d=((u=o.scrollbarY)==null?void 0:u.offsetWidth)||0;o.onCornerWidthChange(d),s(d)}),c?g.jsx(Pe.div,{...r,ref:t,style:{width:i,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Af(e){return e?parseInt(e,10):0}function MT(e,t){const n=e/t;return isNaN(n)?0:n}function Tf(e){const t=MT(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function z6(e,t,n,r="ltr"){const o=Tf(n),i=o/2,s=t||i,a=o-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,d=n.content-n.viewport,u=r==="ltr"?[0,d]:[d*-1,0];return OT([l,c],u)(e)}function IT(e,t,n="ltr"){const r=Tf(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,a=i-r,l=n==="ltr"?[0,s]:[s*-1,0],c=mc(e,l);return OT([0,s],[0,a])(c)}function OT(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function kT(e,t){return e>0&&e<t}var B6=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=n.left!==i.left,a=n.top!==i.top;(s||a)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function Df(e,t){const n=Ct(e),r=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),w.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ma(e,t){const n=Ct(t);Zt(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var LT=ET,W6=NT,V6=DT,U6=[" ","Enter","ArrowUp","ArrowDown"],H6=[" ","Enter"],gc="Select",[Mf,If,G6]=vi(gc),[Ia,wae]=Tt(gc,[G6,bo]),Of=bo(),[Y6,Pi]=Ia(gc),[q6,K6]=Ia(gc),jT=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:d,autoComplete:u,disabled:f,required:h,form:m}=e,p=Of(t),[y,v]=w.useState(null),[b,_]=w.useState(null),[C,N]=w.useState(!1),A=zr(c),[R=!1,D]=Ft({prop:r,defaultProp:o,onChange:i}),[k,F]=Ft({prop:s,defaultProp:a,onChange:l}),W=w.useRef(null),B=y?m||!!y.closest("form"):!0,[T,Q]=w.useState(new Set),K=Array.from(T).map(Y=>Y.props.value).join(";");return g.jsx(Ra,{...p,children:g.jsxs(Y6,{required:h,scope:t,trigger:y,onTriggerChange:v,valueNode:b,onValueNodeChange:_,valueNodeHasChildren:C,onValueNodeHasChildrenChange:N,contentId:on(),value:k,onValueChange:F,open:R,onOpenChange:D,dir:A,triggerPointerDownPosRef:W,disabled:f,children:[g.jsx(Mf.Provider,{scope:t,children:g.jsx(q6,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(Y=>{Q(ee=>new Set(ee).add(Y))},[]),onNativeOptionRemove:w.useCallback(Y=>{Q(ee=>{const G=new Set(ee);return G.delete(Y),G})},[]),children:n})}),B?g.jsxs(cD,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:u,value:k,onChange:Y=>F(Y.target.value),disabled:f,form:m,children:[k===void 0?g.jsx("option",{value:""}):null,Array.from(T)]},K):null]})})};jT.displayName=gc;var FT="SelectTrigger",$T=w.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=Of(n),s=Pi(FT,n),a=s.disabled||r,l=Fe(t,s.onTriggerChange),c=If(n),d=w.useRef("touch"),[u,f,h]=uD(p=>{const y=c().filter(_=>!_.disabled),v=y.find(_=>_.value===s.value),b=dD(y,p,v);b!==void 0&&s.onValueChange(b.value)}),m=p=>{a||(s.onOpenChange(!0),h()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return g.jsx(Pa,{asChild:!0,...i,children:g.jsx(Pe.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":lD(s.value)?"":void 0,...o,ref:l,onClick:be(o.onClick,p=>{p.currentTarget.focus(),d.current!=="mouse"&&m(p)}),onPointerDown:be(o.onPointerDown,p=>{d.current=p.pointerType;const y=p.target;y.hasPointerCapture(p.pointerId)&&y.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(m(p),p.preventDefault())}),onKeyDown:be(o.onKeyDown,p=>{const y=u.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&f(p.key),!(y&&p.key===" ")&&U6.includes(p.key)&&(m(),p.preventDefault())})})})});$T.displayName=FT;var zT="SelectValue",BT=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=Pi(zT,n),{onValueNodeHasChildrenChange:c}=l,d=i!==void 0,u=Fe(t,l.onValueNodeChange);return Zt(()=>{c(d)},[c,d]),g.jsx(Pe.span,{...a,ref:u,style:{pointerEvents:"none"},children:lD(l.value)?g.jsx(g.Fragment,{children:s}):i})});BT.displayName=zT;var X6="SelectIcon",WT=w.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return g.jsx(Pe.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});WT.displayName=X6;var J6="SelectPortal",VT=e=>g.jsx(ql,{asChild:!0,...e});VT.displayName=J6;var ws="SelectContent",UT=w.forwardRef((e,t)=>{const n=Pi(ws,e.__scopeSelect),[r,o]=w.useState();if(Zt(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Xc.createPortal(g.jsx(HT,{scope:e.__scopeSelect,children:g.jsx(Mf.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),i):null}return g.jsx(GT,{...e,ref:t})});UT.displayName=ws;var Ur=10,[HT,Ai]=Ia(ws),Q6="SelectContentImpl",GT=w.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:u,collisionBoundary:f,collisionPadding:h,sticky:m,hideWhenDetached:p,avoidCollisions:y,...v}=e,b=Pi(ws,n),[_,C]=w.useState(null),[N,A]=w.useState(null),R=Fe(t,ae=>C(ae)),[D,k]=w.useState(null),[F,W]=w.useState(null),B=If(n),[T,Q]=w.useState(!1),K=w.useRef(!1);w.useEffect(()=>{if(_)return Ql(_)},[_]),Xd();const Y=w.useCallback(ae=>{const[V,...de]=B().map(oe=>oe.ref.current),[ge]=de.slice(-1),pe=document.activeElement;for(const oe of ae)if(oe===pe||(oe==null||oe.scrollIntoView({block:"nearest"}),oe===V&&N&&(N.scrollTop=0),oe===ge&&N&&(N.scrollTop=N.scrollHeight),oe==null||oe.focus(),document.activeElement!==pe))return},[B,N]),ee=w.useCallback(()=>Y([D,_]),[Y,D,_]);w.useEffect(()=>{T&&ee()},[T,ee]);const{onOpenChange:G,triggerPointerDownPosRef:re}=b;w.useEffect(()=>{if(_){let ae={x:0,y:0};const V=ge=>{var pe,oe;ae={x:Math.abs(Math.round(ge.pageX)-(((pe=re.current)==null?void 0:pe.x)??0)),y:Math.abs(Math.round(ge.pageY)-(((oe=re.current)==null?void 0:oe.y)??0))}},de=ge=>{ae.x<=10&&ae.y<=10?ge.preventDefault():_.contains(ge.target)||G(!1),document.removeEventListener("pointermove",V),re.current=null};return re.current!==null&&(document.addEventListener("pointermove",V),document.addEventListener("pointerup",de,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",de,{capture:!0})}}},[_,G,re]),w.useEffect(()=>{const ae=()=>G(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[G]);const[X,J]=uD(ae=>{const V=B().filter(pe=>!pe.disabled),de=V.find(pe=>pe.ref.current===document.activeElement),ge=dD(V,ae,de);ge&&setTimeout(()=>ge.ref.current.focus())}),se=w.useCallback((ae,V,de)=>{const ge=!K.current&&!de;(b.value!==void 0&&b.value===V||ge)&&(k(ae),ge&&(K.current=!0))},[b.value]),L=w.useCallback(()=>_==null?void 0:_.focus(),[_]),ne=w.useCallback((ae,V,de)=>{const ge=!K.current&&!de;(b.value!==void 0&&b.value===V||ge)&&W(ae)},[b.value]),fe=r==="popper"?Aw:YT,H=fe===Aw?{side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:u,collisionBoundary:f,collisionPadding:h,sticky:m,hideWhenDetached:p,avoidCollisions:y}:{};return g.jsx(HT,{scope:n,content:_,viewport:N,onViewportChange:A,itemRefCallback:se,selectedItem:D,onItemLeave:L,itemTextRefCallback:ne,focusSelectedItem:ee,selectedItemText:F,position:r,isPositioned:T,searchRef:X,children:g.jsx(Jl,{as:$r,allowPinchZoom:!0,children:g.jsx(Yl,{asChild:!0,trapped:b.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:be(o,ae=>{var V;(V=b.trigger)==null||V.focus({preventScroll:!0}),ae.preventDefault()}),children:g.jsx(bi,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:g.jsx(fe,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:ae=>ae.preventDefault(),...v,...H,onPlaced:()=>Q(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:be(v.onKeyDown,ae=>{const V=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!V&&ae.key.length===1&&J(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let ge=B().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(ge=ge.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const pe=ae.target,oe=ge.indexOf(pe);ge=ge.slice(oe+1)}setTimeout(()=>Y(ge)),ae.preventDefault()}})})})})})})});GT.displayName=Q6;var Z6="SelectItemAlignedPosition",YT=w.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Pi(ws,n),s=Ai(ws,n),[a,l]=w.useState(null),[c,d]=w.useState(null),u=Fe(t,R=>d(R)),f=If(n),h=w.useRef(!1),m=w.useRef(!0),{viewport:p,selectedItem:y,selectedItemText:v,focusSelectedItem:b}=s,_=w.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&p&&y&&v){const R=i.trigger.getBoundingClientRect(),D=c.getBoundingClientRect(),k=i.valueNode.getBoundingClientRect(),F=v.getBoundingClientRect();if(i.dir!=="rtl"){const pe=F.left-D.left,oe=k.left-pe,$=R.left-oe,j=R.width+$,le=Math.max(j,D.width),ve=window.innerWidth-Ur,we=mc(oe,[Ur,Math.max(Ur,ve-le)]);a.style.minWidth=j+"px",a.style.left=we+"px"}else{const pe=D.right-F.right,oe=window.innerWidth-k.right-pe,$=window.innerWidth-R.right-oe,j=R.width+$,le=Math.max(j,D.width),ve=window.innerWidth-Ur,we=mc(oe,[Ur,Math.max(Ur,ve-le)]);a.style.minWidth=j+"px",a.style.right=we+"px"}const W=f(),B=window.innerHeight-Ur*2,T=p.scrollHeight,Q=window.getComputedStyle(c),K=parseInt(Q.borderTopWidth,10),Y=parseInt(Q.paddingTop,10),ee=parseInt(Q.borderBottomWidth,10),G=parseInt(Q.paddingBottom,10),re=K+Y+T+G+ee,X=Math.min(y.offsetHeight*5,re),J=window.getComputedStyle(p),se=parseInt(J.paddingTop,10),L=parseInt(J.paddingBottom,10),ne=R.top+R.height/2-Ur,fe=B-ne,H=y.offsetHeight/2,ae=y.offsetTop+H,V=K+Y+ae,de=re-V;if(V<=ne){const pe=W.length>0&&y===W[W.length-1].ref.current;a.style.bottom="0px";const oe=c.clientHeight-p.offsetTop-p.offsetHeight,$=Math.max(fe,H+(pe?L:0)+oe+ee),j=V+$;a.style.height=j+"px"}else{const pe=W.length>0&&y===W[0].ref.current;a.style.top="0px";const $=Math.max(ne,K+p.offsetTop+(pe?se:0)+H)+de;a.style.height=$+"px",p.scrollTop=V-ne+p.offsetTop}a.style.margin=`${Ur}px 0`,a.style.minHeight=X+"px",a.style.maxHeight=B+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[f,i.trigger,i.valueNode,a,c,p,y,v,i.dir,r]);Zt(()=>_(),[_]);const[C,N]=w.useState();Zt(()=>{c&&N(window.getComputedStyle(c).zIndex)},[c]);const A=w.useCallback(R=>{R&&m.current===!0&&(_(),b==null||b(),m.current=!1)},[_,b]);return g.jsx(tX,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:A,children:g.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:g.jsx(Pe.div,{...o,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});YT.displayName=Z6;var eX="SelectPopperPosition",Aw=w.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Ur,...i}=e,s=Of(n);return g.jsx(rc,{...s,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Aw.displayName=eX;var[tX,Tw]=Ia(ws,{}),Dw="SelectViewport",qT=w.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=Ai(Dw,n),s=Tw(Dw,n),a=Fe(t,i.onViewportChange),l=w.useRef(0);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),g.jsx(Mf.Slot,{scope:n,children:g.jsx(Pe.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:be(o.onScroll,c=>{const d=c.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:f}=s;if(f!=null&&f.current&&u){const h=Math.abs(l.current-d.scrollTop);if(h>0){const m=window.innerHeight-Ur*2,p=parseFloat(u.style.minHeight),y=parseFloat(u.style.height),v=Math.max(p,y);if(v<m){const b=v+h,_=Math.min(m,b),C=b-_;u.style.height=_+"px",u.style.bottom==="0px"&&(d.scrollTop=C>0?C:0,u.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});qT.displayName=Dw;var KT="SelectGroup",[nX,rX]=Ia(KT),XT=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=on();return g.jsx(nX,{scope:n,id:o,children:g.jsx(Pe.div,{role:"group","aria-labelledby":o,...r,ref:t})})});XT.displayName=KT;var JT="SelectLabel",QT=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=rX(JT,n);return g.jsx(Pe.div,{id:o.id,...r,ref:t})});QT.displayName=JT;var kf="SelectItem",[oX,ZT]=Ia(kf),eD=w.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=Pi(kf,n),l=Ai(kf,n),c=a.value===r,[d,u]=w.useState(i??""),[f,h]=w.useState(!1),m=Fe(t,b=>{var _;return(_=l.itemRefCallback)==null?void 0:_.call(l,b,r,o)}),p=on(),y=w.useRef("touch"),v=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return g.jsx(oX,{scope:n,value:r,disabled:o,textId:p,isSelected:c,onItemTextChange:w.useCallback(b=>{u(_=>_||((b==null?void 0:b.textContent)??"").trim())},[]),children:g.jsx(Mf.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:g.jsx(Pe.div,{role:"option","aria-labelledby":p,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:m,onFocus:be(s.onFocus,()=>h(!0)),onBlur:be(s.onBlur,()=>h(!1)),onClick:be(s.onClick,()=>{y.current!=="mouse"&&v()}),onPointerUp:be(s.onPointerUp,()=>{y.current==="mouse"&&v()}),onPointerDown:be(s.onPointerDown,b=>{y.current=b.pointerType}),onPointerMove:be(s.onPointerMove,b=>{var _;y.current=b.pointerType,o?(_=l.onItemLeave)==null||_.call(l):y.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:be(s.onPointerLeave,b=>{var _;b.currentTarget===document.activeElement&&((_=l.onItemLeave)==null||_.call(l))}),onKeyDown:be(s.onKeyDown,b=>{var C;((C=l.searchRef)==null?void 0:C.current)!==""&&b.key===" "||(H6.includes(b.key)&&v(),b.key===" "&&b.preventDefault())})})})})});eD.displayName=kf;var yc="SelectItemText",tD=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Pi(yc,n),a=Ai(yc,n),l=ZT(yc,n),c=K6(yc,n),[d,u]=w.useState(null),f=Fe(t,v=>u(v),l.onItemTextChange,v=>{var b;return(b=a.itemTextRefCallback)==null?void 0:b.call(a,v,l.value,l.disabled)}),h=d==null?void 0:d.textContent,m=w.useMemo(()=>g.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:p,onNativeOptionRemove:y}=c;return Zt(()=>(p(m),()=>y(m)),[p,y,m]),g.jsxs(g.Fragment,{children:[g.jsx(Pe.span,{id:l.textId,...i,ref:f}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Xc.createPortal(i.children,s.valueNode):null]})});tD.displayName=yc;var nD="SelectItemIndicator",rD=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return ZT(nD,n).isSelected?g.jsx(Pe.span,{"aria-hidden":!0,...r,ref:t}):null});rD.displayName=nD;var Mw="SelectScrollUpButton",oD=w.forwardRef((e,t)=>{const n=Ai(Mw,e.__scopeSelect),r=Tw(Mw,e.__scopeSelect),[o,i]=w.useState(!1),s=Fe(t,r.onScrollButtonChange);return Zt(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollTop>0;i(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?g.jsx(sD,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});oD.displayName=Mw;var Iw="SelectScrollDownButton",iD=w.forwardRef((e,t)=>{const n=Ai(Iw,e.__scopeSelect),r=Tw(Iw,e.__scopeSelect),[o,i]=w.useState(!1),s=Fe(t,r.onScrollButtonChange);return Zt(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<c;i(d)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?g.jsx(sD,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});iD.displayName=Iw;var sD=w.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Ai("SelectScrollButton",n),s=w.useRef(null),a=If(n),l=w.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return w.useEffect(()=>()=>l(),[l]),Zt(()=>{var d;const c=a().find(u=>u.ref.current===document.activeElement);(d=c==null?void 0:c.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),g.jsx(Pe.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:be(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:be(o.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:be(o.onPointerLeave,()=>{l()})})}),iX="SelectSeparator",aD=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return g.jsx(Pe.div,{"aria-hidden":!0,...r,ref:t})});aD.displayName=iX;var Ow="SelectArrow",sX=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Of(n),i=Pi(Ow,n),s=Ai(Ow,n);return i.open&&s.position==="popper"?g.jsx(oc,{...o,...r,ref:t}):null});sX.displayName=Ow;function lD(e){return e===""||e===void 0}var cD=w.forwardRef((e,t)=>{const{value:n,...r}=e,o=w.useRef(null),i=Fe(t,o),s=Sa(n);return w.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&d){const u=new Event("change",{bubbles:!0});d.call(a,n),a.dispatchEvent(u)}},[s,n]),g.jsx(Fg,{asChild:!0,children:g.jsx("select",{...r,ref:i,defaultValue:n})})});cD.displayName="BubbleSelect";function uD(e){const t=Ct(e),n=w.useRef(""),r=w.useRef(0),o=w.useCallback(s=>{const a=n.current+s;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),i=w.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function dD(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=aX(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function aX(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var lX=jT,fD=$T,cX=BT,uX=WT,dX=VT,hD=UT,fX=qT,hX=XT,pD=QT,mD=eD,pX=tD,mX=rD,gD=oD,yD=iD,wD=aD,gX="Separator",vD="horizontal",yX=["horizontal","vertical"],bD=w.forwardRef((e,t)=>{const{decorative:n,orientation:r=vD,...o}=e,i=wX(r)?r:vD,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return g.jsx(Pe.div,{"data-orientation":i,...a,...o,ref:t})});bD.displayName=gX;function wX(e){return yX.includes(e)}var _D=bD,SD=["PageUp","PageDown"],xD=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ED={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Oa="Slider",[kw,vX,bX]=vi(Oa),[CD,vae]=Tt(Oa,[bX]),[_X,Lf]=CD(Oa),ND=w.forwardRef((e,t)=>{const{name:n,min:r=0,max:o=100,step:i=1,orientation:s="horizontal",disabled:a=!1,minStepsBetweenThumbs:l=0,defaultValue:c=[r],value:d,onValueChange:u=()=>{},onValueCommit:f=()=>{},inverted:h=!1,form:m,...p}=e,y=w.useRef(new Set),v=w.useRef(0),_=s==="horizontal"?SX:xX,[C=[],N]=Ft({prop:d,defaultProp:c,onChange:W=>{var T;(T=[...y.current][v.current])==null||T.focus(),u(W)}}),A=w.useRef(C);function R(W){const B=PX(C,W);F(W,B)}function D(W){F(W,v.current)}function k(){const W=A.current[v.current];C[v.current]!==W&&f(C)}function F(W,B,{commit:T}={commit:!1}){const Q=MX(i),K=IX(Math.round((W-r)/i)*i+r,Q),Y=mc(K,[r,o]);N((ee=[])=>{const G=NX(ee,Y,B);if(DX(G,l*i)){v.current=G.indexOf(Y);const re=String(G)!==String(ee);return re&&T&&f(G),re?G:ee}else return ee})}return g.jsx(_X,{scope:e.__scopeSlider,name:n,disabled:a,min:r,max:o,valueIndexToChangeRef:v,thumbs:y.current,values:C,orientation:s,form:m,children:g.jsx(kw.Provider,{scope:e.__scopeSlider,children:g.jsx(kw.Slot,{scope:e.__scopeSlider,children:g.jsx(_,{"aria-disabled":a,"data-disabled":a?"":void 0,...p,ref:t,onPointerDown:be(p.onPointerDown,()=>{a||(A.current=C)}),min:r,max:o,inverted:h,onSlideStart:a?void 0:R,onSlideMove:a?void 0:D,onSlideEnd:a?void 0:k,onHomeKeyDown:()=>!a&&F(r,0,{commit:!0}),onEndKeyDown:()=>!a&&F(o,C.length-1,{commit:!0}),onStepKeyDown:({event:W,direction:B})=>{if(!a){const K=SD.includes(W.key)||W.shiftKey&&xD.includes(W.key)?10:1,Y=v.current,ee=C[Y],G=i*K*B;F(ee+G,Y,{commit:!0})}}})})})})});ND.displayName=Oa;var[RD,PD]=CD(Oa,{startEdge:"left",endEdge:"right",size:"width",direction:1}),SX=w.forwardRef((e,t)=>{const{min:n,max:r,dir:o,inverted:i,onSlideStart:s,onSlideMove:a,onSlideEnd:l,onStepKeyDown:c,...d}=e,[u,f]=w.useState(null),h=Fe(t,_=>f(_)),m=w.useRef(void 0),p=zr(o),y=p==="ltr",v=y&&!i||!y&&i;function b(_){const C=m.current||u.getBoundingClientRect(),N=[0,C.width],R=Fw(N,v?[n,r]:[r,n]);return m.current=C,R(_-C.left)}return g.jsx(RD,{scope:e.__scopeSlider,startEdge:v?"left":"right",endEdge:v?"right":"left",direction:v?1:-1,size:"width",children:g.jsx(AD,{dir:p,"data-orientation":"horizontal",...d,ref:h,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:_=>{const C=b(_.clientX);s==null||s(C)},onSlideMove:_=>{const C=b(_.clientX);a==null||a(C)},onSlideEnd:()=>{m.current=void 0,l==null||l()},onStepKeyDown:_=>{const N=ED[v?"from-left":"from-right"].includes(_.key);c==null||c({event:_,direction:N?-1:1})}})})}),xX=w.forwardRef((e,t)=>{const{min:n,max:r,inverted:o,onSlideStart:i,onSlideMove:s,onSlideEnd:a,onStepKeyDown:l,...c}=e,d=w.useRef(null),u=Fe(t,d),f=w.useRef(void 0),h=!o;function m(p){const y=f.current||d.current.getBoundingClientRect(),v=[0,y.height],_=Fw(v,h?[r,n]:[n,r]);return f.current=y,_(p-y.top)}return g.jsx(RD,{scope:e.__scopeSlider,startEdge:h?"bottom":"top",endEdge:h?"top":"bottom",size:"height",direction:h?1:-1,children:g.jsx(AD,{"data-orientation":"vertical",...c,ref:u,style:{...c.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:p=>{const y=m(p.clientY);i==null||i(y)},onSlideMove:p=>{const y=m(p.clientY);s==null||s(y)},onSlideEnd:()=>{f.current=void 0,a==null||a()},onStepKeyDown:p=>{const v=ED[h?"from-bottom":"from-top"].includes(p.key);l==null||l({event:p,direction:v?-1:1})}})})}),AD=w.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:s,onEndKeyDown:a,onStepKeyDown:l,...c}=e,d=Lf(Oa,n);return g.jsx(Pe.span,{...c,ref:t,onKeyDown:be(e.onKeyDown,u=>{u.key==="Home"?(s(u),u.preventDefault()):u.key==="End"?(a(u),u.preventDefault()):SD.concat(xD).includes(u.key)&&(l(u),u.preventDefault())}),onPointerDown:be(e.onPointerDown,u=>{const f=u.target;f.setPointerCapture(u.pointerId),u.preventDefault(),d.thumbs.has(f)?f.focus():r(u)}),onPointerMove:be(e.onPointerMove,u=>{u.target.hasPointerCapture(u.pointerId)&&o(u)}),onPointerUp:be(e.onPointerUp,u=>{const f=u.target;f.hasPointerCapture(u.pointerId)&&(f.releasePointerCapture(u.pointerId),i(u))})})}),TD="SliderTrack",DD=w.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=Lf(TD,n);return g.jsx(Pe.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})});DD.displayName=TD;var Lw="SliderRange",MD=w.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=Lf(Lw,n),i=PD(Lw,n),s=w.useRef(null),a=Fe(t,s),l=o.values.length,c=o.values.map(f=>OD(f,o.min,o.max)),d=l>1?Math.min(...c):0,u=100-Math.max(...c);return g.jsx(Pe.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...r,ref:a,style:{...e.style,[i.startEdge]:d+"%",[i.endEdge]:u+"%"}})});MD.displayName=Lw;var jw="SliderThumb",ID=w.forwardRef((e,t)=>{const n=vX(e.__scopeSlider),[r,o]=w.useState(null),i=Fe(t,a=>o(a)),s=w.useMemo(()=>r?n().findIndex(a=>a.ref.current===r):-1,[n,r]);return g.jsx(EX,{...e,ref:i,index:s})}),EX=w.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:o,...i}=e,s=Lf(jw,n),a=PD(jw,n),[l,c]=w.useState(null),d=Fe(t,b=>c(b)),u=l?s.form||!!l.closest("form"):!0,f=Zl(l),h=s.values[r],m=h===void 0?0:OD(h,s.min,s.max),p=RX(r,s.values.length),y=f==null?void 0:f[a.size],v=y?AX(y,m,a.direction):0;return w.useEffect(()=>{if(l)return s.thumbs.add(l),()=>{s.thumbs.delete(l)}},[l,s.thumbs]),g.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${m}% + ${v}px)`},children:[g.jsx(kw.ItemSlot,{scope:e.__scopeSlider,children:g.jsx(Pe.span,{role:"slider","aria-label":e["aria-label"]||p,"aria-valuemin":s.min,"aria-valuenow":h,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...i,ref:d,style:h===void 0?{display:"none"}:e.style,onFocus:be(e.onFocus,()=>{s.valueIndexToChangeRef.current=r})})}),u&&g.jsx(CX,{name:o??(s.name?s.name+(s.values.length>1?"[]":""):void 0),form:s.form,value:h},r)]})});ID.displayName=jw;var CX=e=>{const{value:t,...n}=e,r=w.useRef(null),o=Sa(t);return w.useEffect(()=>{const i=r.current,s=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(s,"value").set;if(o!==t&&l){const c=new Event("input",{bubbles:!0});l.call(i,t),i.dispatchEvent(c)}},[o,t]),g.jsx("input",{style:{display:"none"},...n,ref:r,defaultValue:t})};function NX(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,i)=>o-i)}function OD(e,t,n){const i=100/(n-t)*(e-t);return mc(i,[0,100])}function RX(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function PX(e,t){if(e.length===1)return 0;const n=e.map(o=>Math.abs(o-t)),r=Math.min(...n);return n.indexOf(r)}function AX(e,t,n){const r=e/2,i=Fw([0,50],[0,r]);return(r-i(t)*n)*n}function TX(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function DX(e,t){if(t>0){const n=TX(e);return Math.min(...n)>=t}return!0}function Fw(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function MX(e){return(String(e).split(".")[1]||"").length}function IX(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var kD=ND,OX=DD,kX=MD,LX=ID,$w="Switch",[jX,bae]=Tt($w),[FX,$X]=jX($w),LD=w.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,form:d,...u}=e,[f,h]=w.useState(null),m=Fe(t,_=>h(_)),p=w.useRef(!1),y=f?d||!!f.closest("form"):!0,[v=!1,b]=Ft({prop:o,defaultProp:i,onChange:c});return g.jsxs(FX,{scope:n,checked:v,disabled:a,children:[g.jsx(Pe.button,{type:"button",role:"switch","aria-checked":v,"aria-required":s,"data-state":$D(v),"data-disabled":a?"":void 0,disabled:a,value:l,...u,ref:m,onClick:be(e.onClick,_=>{b(C=>!C),y&&(p.current=_.isPropagationStopped(),p.current||_.stopPropagation())})}),y&&g.jsx(zX,{control:f,bubbles:!p.current,name:r,value:l,checked:v,required:s,disabled:a,form:d,style:{transform:"translateX(-100%)"}})]})});LD.displayName=$w;var jD="SwitchThumb",FD=w.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=$X(jD,n);return g.jsx(Pe.span,{"data-state":$D(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});FD.displayName=jD;var zX=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=w.useRef(null),s=Sa(n),a=Zl(t);return w.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&u){const f=new Event("click",{bubbles:r});u.call(l,n),l.dispatchEvent(f)}},[s,n,r]),g.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function $D(e){return e?"checked":"unchecked"}var zD=LD,BX=FD,zw="Tabs",[WX,_ae]=Tt(zw,[_o]),BD=_o(),[VX,Bw]=WX(zw),WD=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,d=zr(a),[u,f]=Ft({prop:r,onChange:o,defaultProp:i});return g.jsx(VX,{scope:n,baseId:on(),value:u,onValueChange:f,orientation:s,dir:d,activationMode:l,children:g.jsx(Pe.div,{dir:d,"data-orientation":s,...c,ref:t})})});WD.displayName=zw;var VD="TabsList",UD=w.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=Bw(VD,n),s=BD(n);return g.jsx(ic,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:g.jsx(Pe.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});UD.displayName=VD;var HD="TabsTrigger",GD=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=Bw(HD,n),a=BD(n),l=KD(s.baseId,r),c=XD(s.baseId,r),d=r===s.value;return g.jsx(sc,{asChild:!0,...a,focusable:!o,active:d,children:g.jsx(Pe.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":c,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...i,ref:t,onMouseDown:be(e.onMouseDown,u=>{!o&&u.button===0&&u.ctrlKey===!1?s.onValueChange(r):u.preventDefault()}),onKeyDown:be(e.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&s.onValueChange(r)}),onFocus:be(e.onFocus,()=>{const u=s.activationMode!=="manual";!d&&!o&&u&&s.onValueChange(r)})})})});GD.displayName=HD;var YD="TabsContent",qD=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=Bw(YD,n),l=KD(a.baseId,r),c=XD(a.baseId,r),d=r===a.value,u=w.useRef(d);return w.useEffect(()=>{const f=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(f)},[]),g.jsx(Bt,{present:o||d,children:({present:f})=>g.jsx(Pe.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:u.current?"0s":void 0},children:f&&i})})});qD.displayName=YD;function KD(e,t){return`${e}-trigger-${t}`}function XD(e,t){return`${e}-content-${t}`}var UX=WD,JD=UD,QD=GD,ZD=qD,HX="Toggle",Ww=w.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[s=!1,a]=Ft({prop:n,onChange:o,defaultProp:r});return g.jsx(Pe.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:be(e.onClick,()=>{e.disabled||a(!s)})})});Ww.displayName=HX;var eM=Ww,ka="ToggleGroup",[tM,Sae]=Tt(ka,[_o]),nM=_o(),Vw=x.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const o=r;return g.jsx(GX,{...o,ref:t})}if(n==="multiple"){const o=r;return g.jsx(YX,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${ka}\``)});Vw.displayName=ka;var[rM,oM]=tM(ka),GX=x.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[s,a]=Ft({prop:n,defaultProp:r,onChange:o});return g.jsx(rM,{scope:e.__scopeToggleGroup,type:"single",value:s?[s]:[],onItemActivate:a,onItemDeactivate:x.useCallback(()=>a(""),[a]),children:g.jsx(iM,{...i,ref:t})})}),YX=x.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[s=[],a]=Ft({prop:n,defaultProp:r,onChange:o}),l=x.useCallback(d=>a((u=[])=>[...u,d]),[a]),c=x.useCallback(d=>a((u=[])=>u.filter(f=>f!==d)),[a]);return g.jsx(rM,{scope:e.__scopeToggleGroup,type:"multiple",value:s,onItemActivate:l,onItemDeactivate:c,children:g.jsx(iM,{...i,ref:t})})});Vw.displayName=ka;var[qX,KX]=tM(ka),iM=x.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:o=!0,orientation:i,dir:s,loop:a=!0,...l}=e,c=nM(n),d=zr(s),u={role:"group",dir:d,...l};return g.jsx(qX,{scope:n,rovingFocus:o,disabled:r,children:o?g.jsx(ic,{asChild:!0,...c,orientation:i,dir:d,loop:a,children:g.jsx(Pe.div,{...u,ref:t})}):g.jsx(Pe.div,{...u,ref:t})})}),jf="ToggleGroupItem",sM=x.forwardRef((e,t)=>{const n=oM(jf,e.__scopeToggleGroup),r=KX(jf,e.__scopeToggleGroup),o=nM(e.__scopeToggleGroup),i=n.value.includes(e.value),s=r.disabled||e.disabled,a={...e,pressed:i,disabled:s},l=x.useRef(null);return r.rovingFocus?g.jsx(sc,{asChild:!0,...o,focusable:!s,active:i,ref:l,children:g.jsx(aM,{...a,ref:t})}):g.jsx(aM,{...a,ref:t})});sM.displayName=jf;var aM=x.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...o}=e,i=oM(jf,n),s={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},a=i.type==="single"?s:void 0;return g.jsx(Ww,{...a,...o,ref:t,onPressedChange:l=>{l?i.onItemActivate(r):i.onItemDeactivate(r)}})}),lM=Vw,cM=sM,[Ff,xae]=Tt("Tooltip",[bo]),$f=bo(),uM="TooltipProvider",XX=700,Uw="tooltip.open",[JX,Hw]=Ff(uM),dM=e=>{const{__scopeTooltip:t,delayDuration:n=XX,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[s,a]=w.useState(!0),l=w.useRef(!1),c=w.useRef(0);return w.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),g.jsx(JX,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:w.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:w.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:w.useCallback(d=>{l.current=d},[]),disableHoverableContent:o,children:i})};dM.displayName=uM;var zf="Tooltip",[QX,Bf]=Ff(zf),fM=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=Hw(zf,e.__scopeTooltip),c=$f(t),[d,u]=w.useState(null),f=on(),h=w.useRef(0),m=s??l.disableHoverableContent,p=a??l.delayDuration,y=w.useRef(!1),[v=!1,b]=Ft({prop:r,defaultProp:o,onChange:R=>{R?(l.onOpen(),document.dispatchEvent(new CustomEvent(Uw))):l.onClose(),i==null||i(R)}}),_=w.useMemo(()=>v?y.current?"delayed-open":"instant-open":"closed",[v]),C=w.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,b(!0)},[b]),N=w.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),A=w.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,b(!0),h.current=0},p)},[p,b]);return w.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),g.jsx(Ra,{...c,children:g.jsx(QX,{scope:t,contentId:f,open:v,stateAttribute:_,trigger:d,onTriggerChange:u,onTriggerEnter:w.useCallback(()=>{l.isOpenDelayed?A():C()},[l.isOpenDelayed,A,C]),onTriggerLeave:w.useCallback(()=>{m?N():(window.clearTimeout(h.current),h.current=0)},[N,m]),onOpen:C,onClose:N,disableHoverableContent:m,children:n})})};fM.displayName=zf;var Gw="TooltipTrigger",hM=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Bf(Gw,n),i=Hw(Gw,n),s=$f(n),a=w.useRef(null),l=Fe(t,a,o.onTriggerChange),c=w.useRef(!1),d=w.useRef(!1),u=w.useCallback(()=>c.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),g.jsx(Pa,{asChild:!0,...s,children:g.jsx(Pe.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:be(e.onPointerMove,f=>{f.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:be(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:be(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:be(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:be(e.onBlur,o.onClose),onClick:be(e.onClick,o.onClose)})})});hM.displayName=Gw;var ZX="TooltipPortal",[Eae,eJ]=Ff(ZX,{forceMount:void 0}),La="TooltipContent",pM=w.forwardRef((e,t)=>{const n=eJ(La,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=Bf(La,e.__scopeTooltip);return g.jsx(Bt,{present:r||s.open,children:s.disableHoverableContent?g.jsx(mM,{side:o,...i,ref:t}):g.jsx(tJ,{side:o,...i,ref:t})})}),tJ=w.forwardRef((e,t)=>{const n=Bf(La,e.__scopeTooltip),r=Hw(La,e.__scopeTooltip),o=w.useRef(null),i=Fe(t,o),[s,a]=w.useState(null),{trigger:l,onClose:c}=n,d=o.current,{onPointerInTransitChange:u}=r,f=w.useCallback(()=>{a(null),u(!1)},[u]),h=w.useCallback((m,p)=>{const y=m.currentTarget,v={x:m.clientX,y:m.clientY},b=iJ(v,y.getBoundingClientRect()),_=sJ(v,b),C=aJ(p.getBoundingClientRect()),N=cJ([..._,...C]);a(N),u(!0)},[u]);return w.useEffect(()=>()=>f(),[f]),w.useEffect(()=>{if(l&&d){const m=y=>h(y,d),p=y=>h(y,l);return l.addEventListener("pointerleave",m),d.addEventListener("pointerleave",p),()=>{l.removeEventListener("pointerleave",m),d.removeEventListener("pointerleave",p)}}},[l,d,h,f]),w.useEffect(()=>{if(s){const m=p=>{const y=p.target,v={x:p.clientX,y:p.clientY},b=(l==null?void 0:l.contains(y))||(d==null?void 0:d.contains(y)),_=!lJ(v,s);b?f():_&&(f(),c())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,d,s,c,f]),g.jsx(mM,{...e,ref:i})}),[nJ,rJ]=Ff(zf,{isInside:!1}),mM=w.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=Bf(La,n),c=$f(n),{onClose:d}=l;return w.useEffect(()=>(document.addEventListener(Uw,d),()=>document.removeEventListener(Uw,d)),[d]),w.useEffect(()=>{if(l.trigger){const u=f=>{const h=f.target;h!=null&&h.contains(l.trigger)&&d()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[l.trigger,d]),g.jsx(bi,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:u=>u.preventDefault(),onDismiss:d,children:g.jsxs(rc,{"data-state":l.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:[g.jsx(Ud,{children:r}),g.jsx(nJ,{scope:n,isInside:!0,children:g.jsx(UC,{id:l.contentId,role:"tooltip",children:o||r})})]})})});pM.displayName=La;var gM="TooltipArrow",oJ=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=$f(n);return rJ(gM,n).isInside?null:g.jsx(oc,{...o,...r,ref:t})});oJ.displayName=gM;function iJ(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function sJ(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 aJ(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 lJ(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,c=t[s].x,d=t[s].y;l>r!=d>r&&n<(c-a)*(r-l)/(d-l)+a&&(o=!o)}return o}function cJ(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),uJ(t)}function uJ(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 i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.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 i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.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 dJ=dM,fJ=fM,hJ=hM,yM=pM;/**
|
|
250
|
+
* @license lucide-react v0.475.0 - ISC
|
|
251
|
+
*
|
|
252
|
+
* This source code is licensed under the ISC license.
|
|
253
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
+
*/const pJ=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),wM=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
255
|
+
* @license lucide-react v0.475.0 - ISC
|
|
256
|
+
*
|
|
257
|
+
* This source code is licensed under the ISC license.
|
|
258
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
+
*/var mJ={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"};/**
|
|
260
|
+
* @license lucide-react v0.475.0 - ISC
|
|
261
|
+
*
|
|
262
|
+
* This source code is licensed under the ISC license.
|
|
263
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
+
*/const gJ=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>x.createElement("svg",{ref:l,...mJ,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:wM("lucide",o),...a},[...s.map(([c,d])=>x.createElement(c,d)),...Array.isArray(i)?i:[i]]));/**
|
|
265
|
+
* @license lucide-react v0.475.0 - ISC
|
|
266
|
+
*
|
|
267
|
+
* This source code is licensed under the ISC license.
|
|
268
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
269
|
+
*/const lr=(e,t)=>{const n=x.forwardRef(({className:r,...o},i)=>x.createElement(gJ,{ref:i,iconNode:t,className:wM(`lucide-${pJ(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
|
|
270
|
+
* @license lucide-react v0.475.0 - ISC
|
|
271
|
+
*
|
|
272
|
+
* This source code is licensed under the ISC license.
|
|
273
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
+
*/const vM=lr("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
|
275
|
+
* @license lucide-react v0.475.0 - ISC
|
|
276
|
+
*
|
|
277
|
+
* This source code is licensed under the ISC license.
|
|
278
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
+
*/const ja=lr("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
280
|
+
* @license lucide-react v0.475.0 - ISC
|
|
281
|
+
*
|
|
282
|
+
* This source code is licensed under the ISC license.
|
|
283
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
284
|
+
*/const Wf=lr("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
285
|
+
* @license lucide-react v0.475.0 - ISC
|
|
286
|
+
*
|
|
287
|
+
* This source code is licensed under the ISC license.
|
|
288
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
289
|
+
*/const Vf=lr("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
290
|
+
* @license lucide-react v0.475.0 - ISC
|
|
291
|
+
*
|
|
292
|
+
* This source code is licensed under the ISC license.
|
|
293
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
294
|
+
*/const Ti=lr("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
295
|
+
* @license lucide-react v0.475.0 - ISC
|
|
296
|
+
*
|
|
297
|
+
* This source code is licensed under the ISC license.
|
|
298
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
299
|
+
*/const yJ=lr("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
300
|
+
* @license lucide-react v0.475.0 - ISC
|
|
301
|
+
*
|
|
302
|
+
* This source code is licensed under the ISC license.
|
|
303
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
304
|
+
*/const wJ=lr("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);/**
|
|
305
|
+
* @license lucide-react v0.475.0 - ISC
|
|
306
|
+
*
|
|
307
|
+
* This source code is licensed under the ISC license.
|
|
308
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
309
|
+
*/const vJ=lr("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/**
|
|
310
|
+
* @license lucide-react v0.475.0 - ISC
|
|
311
|
+
*
|
|
312
|
+
* This source code is licensed under the ISC license.
|
|
313
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
314
|
+
*/const bJ=lr("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
|
|
315
|
+
* @license lucide-react v0.475.0 - ISC
|
|
316
|
+
*
|
|
317
|
+
* This source code is licensed under the ISC license.
|
|
318
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
319
|
+
*/const Uf=lr("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
320
|
+
* @license lucide-react v0.475.0 - ISC
|
|
321
|
+
*
|
|
322
|
+
* This source code is licensed under the ISC license.
|
|
323
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
324
|
+
*/const _J=lr("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"}]]);/**
|
|
325
|
+
* @license lucide-react v0.475.0 - ISC
|
|
326
|
+
*
|
|
327
|
+
* This source code is licensed under the ISC license.
|
|
328
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
329
|
+
*/const SJ=lr("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
330
|
+
* @license lucide-react v0.475.0 - ISC
|
|
331
|
+
*
|
|
332
|
+
* This source code is licensed under the ISC license.
|
|
333
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
334
|
+
*/const bM=lr("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Yw="-",xJ=e=>{const t=CJ(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(Yw);return a[0]===""&&a.length!==1&&a.shift(),_M(a,t)||EJ(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},_M=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?_M(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Yw);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId},SM=/^\[(.+)\]$/,EJ=e=>{if(SM.test(e)){const t=SM.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},CJ=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const o in n)qw(n[o],r,o,t);return r},qw=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:xM(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(NJ(o)){qw(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{qw(s,xM(t,i),n,r)})})},xM=(e,t)=>{let n=e;return t.split(Yw).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},NJ=e=>e.isThemeGetter,RJ=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}},Kw="!",Xw=":",PJ=Xw.length,AJ=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const i=[];let s=0,a=0,l=0,c;for(let m=0;m<o.length;m++){let p=o[m];if(s===0&&a===0){if(p===Xw){i.push(o.slice(l,m)),l=m+PJ;continue}if(p==="/"){c=m;continue}}p==="["?s++:p==="]"?s--:p==="("?a++:p===")"&&a--}const d=i.length===0?o:o.substring(l),u=TJ(d),f=u!==d,h=c&&c>l?c-l:void 0;return{modifiers:i,hasImportantModifier:f,baseClassName:u,maybePostfixModifierPosition:h}};if(t){const o=t+Xw,i=r;r=s=>s.startsWith(o)?i(s.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:s,maybePostfixModifierPosition:void 0}}if(n){const o=r;r=i=>n({className:i,parseClassName:o})}return r},TJ=e=>e.endsWith(Kw)?e.substring(0,e.length-1):e.startsWith(Kw)?e.substring(1):e,DJ=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const o=[];let i=[];return r.forEach(s=>{s[0]==="["||t[s]?(o.push(...i.sort(),s),i=[]):i.push(s)}),o.push(...i.sort()),o}},MJ=e=>({cache:RJ(e.cacheSize),parseClassName:AJ(e),sortModifiers:DJ(e),...xJ(e)}),IJ=/\s+/,OJ=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(IJ);let l="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{isExternal:u,modifiers:f,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:p}=n(d);if(u){l=d+(l.length>0?" "+l:l);continue}let y=!!p,v=r(y?m.substring(0,p):m);if(!v){if(!y){l=d+(l.length>0?" "+l:l);continue}if(v=r(m),!v){l=d+(l.length>0?" "+l:l);continue}y=!1}const b=i(f).join(":"),_=h?b+Kw:b,C=_+v;if(s.includes(C))continue;s.push(C);const N=o(v,y);for(let A=0;A<N.length;++A){const R=N[A];s.push(_+R)}l=d+(l.length>0?" "+l:l)}return l};function kJ(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=EM(t))&&(r&&(r+=" "),r+=n);return r}const EM=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=EM(e[r]))&&(n&&(n+=" "),n+=t);return n};function LJ(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((d,u)=>u(d),e());return n=MJ(c),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const d=OJ(l,n);return o(l,d),d}return function(){return i(kJ.apply(null,arguments))}}const pn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},CM=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,NM=/^\((?:(\w[\w-]*):)?(.+)\)$/i,jJ=/^\d+\/\d+$/,FJ=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$J=/\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$/,zJ=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,BJ=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,WJ=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fa=e=>jJ.test(e),dt=e=>!!e&&!Number.isNaN(Number(e)),vs=e=>!!e&&Number.isInteger(Number(e)),RM=e=>e.endsWith("%")&&dt(e.slice(0,-1)),Di=e=>FJ.test(e),VJ=()=>!0,UJ=e=>$J.test(e)&&!zJ.test(e),Jw=()=>!1,HJ=e=>BJ.test(e),GJ=e=>WJ.test(e),YJ=e=>!Oe(e)&&!ke(e),qJ=e=>$a(e,TM,Jw),Oe=e=>CM.test(e),bs=e=>$a(e,DM,UJ),Qw=e=>$a(e,iQ,dt),KJ=e=>$a(e,PM,Jw),XJ=e=>$a(e,AM,GJ),JJ=e=>$a(e,Jw,HJ),ke=e=>NM.test(e),Hf=e=>za(e,DM),QJ=e=>za(e,sQ),ZJ=e=>za(e,PM),eQ=e=>za(e,TM),tQ=e=>za(e,AM),nQ=e=>za(e,aQ,!0),$a=(e,t,n)=>{const r=CM.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},za=(e,t,n=!1)=>{const r=NM.exec(e);return r?r[1]?t(r[1]):n:!1},PM=e=>e==="position",rQ=new Set(["image","url"]),AM=e=>rQ.has(e),oQ=new Set(["length","size","percentage"]),TM=e=>oQ.has(e),DM=e=>e==="length",iQ=e=>e==="number",sQ=e=>e==="family-name",aQ=e=>e==="shadow",lQ=LJ(()=>{const e=pn("color"),t=pn("font"),n=pn("text"),r=pn("font-weight"),o=pn("tracking"),i=pn("leading"),s=pn("breakpoint"),a=pn("container"),l=pn("spacing"),c=pn("radius"),d=pn("shadow"),u=pn("inset-shadow"),f=pn("drop-shadow"),h=pn("blur"),m=pn("perspective"),p=pn("aspect"),y=pn("ease"),v=pn("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],C=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],A=()=>[ke,Oe,l],R=()=>[Fa,"full","auto",...A()],D=()=>[vs,"none","subgrid",ke,Oe],k=()=>["auto",{span:["full",vs,ke,Oe]},ke,Oe],F=()=>[vs,"auto",ke,Oe],W=()=>["auto","min","max","fr",ke,Oe],B=()=>["start","end","center","between","around","evenly","stretch","baseline"],T=()=>["start","end","center","stretch"],Q=()=>["auto",...A()],K=()=>[Fa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],Y=()=>[e,ke,Oe],ee=()=>[RM,bs],G=()=>["","none","full",c,ke,Oe],re=()=>["",dt,Hf,bs],X=()=>["solid","dashed","dotted","double"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>["","none",h,ke,Oe],L=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ke,Oe],ne=()=>["none",dt,ke,Oe],fe=()=>["none",dt,ke,Oe],H=()=>[dt,ke,Oe],ae=()=>[Fa,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Di],breakpoint:[Di],color:[VJ],container:[Di],"drop-shadow":[Di],ease:["in","out","in-out"],font:[YJ],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Di],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Di],shadow:[Di],spacing:["px",dt],text:[Di],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Fa,Oe,ke,p]}],container:["container"],columns:[{columns:[dt,Oe,ke,a]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[..._(),Oe,ke]}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{start:R()}],end:[{end:R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[vs,"auto",ke,Oe]}],basis:[{basis:[Fa,"full","auto",a,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[dt,Fa,"auto","initial","none",Oe]}],grow:[{grow:["",dt,ke,Oe]}],shrink:[{shrink:["",dt,ke,Oe]}],order:[{order:[vs,"first","last","none",ke,Oe]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:k()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:k()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...B(),"normal"]}],"justify-items":[{"justify-items":[...T(),"normal"]}],"justify-self":[{"justify-self":["auto",...T()]}],"align-content":[{content:["normal",...B()]}],"align-items":[{items:[...T(),"baseline"]}],"align-self":[{self:["auto",...T(),"baseline"]}],"place-content":[{"place-content":B()}],"place-items":[{"place-items":[...T(),"baseline"]}],"place-self":[{"place-self":["auto",...T()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:Q()}],mx:[{mx:Q()}],my:[{my:Q()}],ms:[{ms:Q()}],me:[{me:Q()}],mt:[{mt:Q()}],mr:[{mr:Q()}],mb:[{mb:Q()}],ml:[{ml:Q()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],w:[{w:[a,"screen",...K()]}],"min-w":[{"min-w":[a,"screen","none",...K()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...K()]}],h:[{h:["screen",...K()]}],"min-h":[{"min-h":["screen","none",...K()]}],"max-h":[{"max-h":["screen",...K()]}],"font-size":[{text:["base",n,Hf,bs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ke,Qw]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",RM,Oe]}],"font-family":[{font:[QJ,Oe,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,ke,Oe]}],"line-clamp":[{"line-clamp":[dt,"none",ke,Qw]}],leading:[{leading:[i,...A()]}],"list-image":[{"list-image":["none",ke,Oe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ke,Oe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Y()}],"text-color":[{text:Y()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...X(),"wavy"]}],"text-decoration-thickness":[{decoration:[dt,"from-font","auto",ke,bs]}],"text-decoration-color":[{decoration:Y()}],"underline-offset":[{"underline-offset":[dt,"auto",ke,Oe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke,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",ke,Oe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[..._(),ZJ,KJ]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",eQ,qJ]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},vs,ke,Oe],radial:["",ke,Oe],conic:[vs,ke,Oe]},tQ,XJ]}],"bg-color":[{bg:Y()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:Y()}],"gradient-via":[{via:Y()}],"gradient-to":[{to:Y()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...X(),"hidden","none"]}],"divide-style":[{divide:[...X(),"hidden","none"]}],"border-color":[{border:Y()}],"border-color-x":[{"border-x":Y()}],"border-color-y":[{"border-y":Y()}],"border-color-s":[{"border-s":Y()}],"border-color-e":[{"border-e":Y()}],"border-color-t":[{"border-t":Y()}],"border-color-r":[{"border-r":Y()}],"border-color-b":[{"border-b":Y()}],"border-color-l":[{"border-l":Y()}],"divide-color":[{divide:Y()}],"outline-style":[{outline:[...X(),"none","hidden"]}],"outline-offset":[{"outline-offset":[dt,ke,Oe]}],"outline-w":[{outline:["",dt,Hf,bs]}],"outline-color":[{outline:[e]}],shadow:[{shadow:["","none",d,nQ,JJ]}],"shadow-color":[{shadow:Y()}],"inset-shadow":[{"inset-shadow":["none",ke,Oe,u]}],"inset-shadow-color":[{"inset-shadow":Y()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Y()}],"ring-offset-w":[{"ring-offset":[dt,bs]}],"ring-offset-color":[{"ring-offset":Y()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":Y()}],opacity:[{opacity:[dt,ke,Oe]}],"mix-blend":[{"mix-blend":[...J(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":J()}],filter:[{filter:["","none",ke,Oe]}],blur:[{blur:se()}],brightness:[{brightness:[dt,ke,Oe]}],contrast:[{contrast:[dt,ke,Oe]}],"drop-shadow":[{"drop-shadow":["","none",f,ke,Oe]}],grayscale:[{grayscale:["",dt,ke,Oe]}],"hue-rotate":[{"hue-rotate":[dt,ke,Oe]}],invert:[{invert:["",dt,ke,Oe]}],saturate:[{saturate:[dt,ke,Oe]}],sepia:[{sepia:["",dt,ke,Oe]}],"backdrop-filter":[{"backdrop-filter":["","none",ke,Oe]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[dt,ke,Oe]}],"backdrop-contrast":[{"backdrop-contrast":[dt,ke,Oe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",dt,ke,Oe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[dt,ke,Oe]}],"backdrop-invert":[{"backdrop-invert":["",dt,ke,Oe]}],"backdrop-opacity":[{"backdrop-opacity":[dt,ke,Oe]}],"backdrop-saturate":[{"backdrop-saturate":[dt,ke,Oe]}],"backdrop-sepia":[{"backdrop-sepia":["",dt,ke,Oe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ke,Oe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[dt,"initial",ke,Oe]}],ease:[{ease:["linear","initial",y,ke,Oe]}],delay:[{delay:[dt,ke,Oe]}],animate:[{animate:["none",v,ke,Oe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,ke,Oe]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:ne()}],"rotate-x":[{"rotate-x":ne()}],"rotate-y":[{"rotate-y":ne()}],"rotate-z":[{"rotate-z":ne()}],scale:[{scale:fe()}],"scale-x":[{"scale-x":fe()}],"scale-y":[{"scale-y":fe()}],"scale-z":[{"scale-z":fe()}],"scale-3d":["scale-3d"],skew:[{skew:H()}],"skew-x":[{"skew-x":H()}],"skew-y":[{"skew-y":H()}],transform:[{transform:[ke,Oe,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ae()}],"translate-x":[{"translate-x":ae()}],"translate-y":[{"translate-y":ae()}],"translate-z":[{"translate-z":ae()}],"translate-none":["translate-none"],accent:[{accent:Y()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Y()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ke,Oe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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",ke,Oe]}],fill:[{fill:["none",...Y()]}],"stroke-w":[{stroke:[dt,Hf,bs,Qw]}],stroke:[{stroke:["none",...Y()]}],"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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["before","after","placeholder","file","marker","selection","first-line","first-letter","backdrop","*","**"]}});function ce(...e){return lQ(md(e))}const cQ=e7,MM=w.forwardRef(({className:e,...t},n)=>g.jsx(t7,{ref:n,className:ce("border-b",e),...t}));MM.displayName="AccordionItem";const IM=w.forwardRef(({className:e,children:t,...n},r)=>g.jsx(n7,{className:"flex",children:g.jsxs(r7,{ref:r,className:ce("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,g.jsx(Wf,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));IM.displayName="AccordionTrigger";const OM=w.forwardRef(({className:e,children:t,...n},r)=>g.jsx(o7,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:g.jsx("div",{className:ce("pb-4 pt-0",e),children:t})}));OM.displayName="AccordionContent";const kM=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,LM=md,cr=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return LM(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const d=n==null?void 0:n[c],u=i==null?void 0:i[c];if(d===null)return null;const f=kM(d)||kM(u);return o[c][f]}),a=n&&Object.entries(n).reduce((c,d)=>{let[u,f]=d;return f===void 0||(c[u]=f),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:u,className:f,...h}=d;return Object.entries(h).every(m=>{let[p,y]=m;return Array.isArray(y)?y.includes({...i,...a}[p]):{...i,...a}[p]===y})?[...c,u,f]:c},[]);return LM(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},jM={alert:{defaultStyles:"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",variantStyles:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}},badge:{defaultStyles:"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",variantStyles:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"text-foreground"}},defaultVariants:{variant:"default"}},button:{defaultStyles:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",variantStyles:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",primary:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}},sidebar:{defaultStyles:"relative flex flex-col gap-2 h-screen p-4 bg-background border-r transition-all duration-300 ease-in-out",variantStyles:{variant:{default:"border-r",floating:"rounded-lg border shadow-lg m-2 h-[calc(100vh-1rem)]"},size:{default:"w-64",sm:"w-48",lg:"w-72"},collapsed:{true:"w-16",false:""}},defaultVariants:{variant:"default",size:"default",collapsed:!1}},sidebarItem:{defaultStyles:"flex items-center gap-2 rounded-md px-3 py-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",variantStyles:{variant:{default:"hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-transparent hover:text-foreground/80",active:"bg-accent text-accent-foreground"}},defaultVariants:{variant:"default"}},toggle:{defaultStyles:"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-primary hover:text-foreground 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=on]:bg-accent data-[state=on]:text-accent-foreground",variantStyles:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}},uQ=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT:jM},Symbol.toStringTag,{value:"Module"})),Ko=x.createContext(null),dQ=Ko.Consumer,fQ=Object.freeze(Object.defineProperty({__proto__:null,TailwindThemeConsumer:dQ,TailwindThemeContext:Ko,TailwindThemeProvider:e=>{const[t,n]=x.useState(jM),[r,o]=x.useState({tailwind:{},siteBackground:{}}),i=a=>{o(l=>({...l,tailwind:a}))},s=a=>{o(l=>({...l,siteBackground:a}))};return g.jsx(Ko.Provider,{value:{variants:t,setVariants:n,theme:r,setTheme:o,tailwind:(r==null?void 0:r.tailwind)??{},setTailwind:i,siteBackground:(r==null?void 0:r.siteBackground)??{},setSiteBackground:s},children:e.children})}},Symbol.toStringTag,{value:"Module"})),Mi=()=>{const e=x.useContext(Ko);if(e===void 0)throw new Error("Invalid tailwind theme context.");return{variants:e.variants,setVariants:e.setVariants}},hQ=()=>{const e=x.useContext(Ko);if(e===void 0)throw new Error("Invalid tailwind theme context.");return{theme:e.theme,setTheme:e.setTheme}},pQ=()=>{var n,r,o,i;const e=x.useContext(Ko);if(e===void 0)throw new Error("Invalid tailwind theme context.");const t=s=>{e.setTailwind({theme:{extend:{...e.tailwind.theme.extend,fontFamily:{custom:s}}}})};return{fontFamily:((i=(o=(r=(n=e.tailwind)==null?void 0:n.theme)==null?void 0:r.extend)==null?void 0:o.fontFamily)==null?void 0:i.custom)??null,setFontFamily:t}},mQ=()=>{var n,r,o;const e=x.useContext(Ko);if(e===void 0)throw new Error("Invalid tailwind theme context.");const t=i=>{e.setTailwind({theme:{extend:{...e.tailwind.theme.extend,colors:i}}})};return{colors:((o=(r=(n=e.tailwind)==null?void 0:n.theme)==null?void 0:r.extend)==null?void 0:o.colors)??null,setColors:t}},Zw=()=>{const e=x.useContext(Ko);if(e===void 0)throw new Error("Invalid tailwind theme context.");return{siteBackground:e.siteBackground,siteBackgroundColor:e.siteBackground.color,siteBackgroundImage:e.siteBackground.image,setSiteBackground:e.setSiteBackground}},gQ=Object.freeze(Object.defineProperty({__proto__:null,useColors:mQ,useFontFamily:pQ,useSiteBackground:Zw,useTailwind:()=>{const e=x.useContext(Ko);if(e===void 0)throw new Error("Invalid tailwind theme context.");return{tailwind:e.tailwind,setTailwind:e.setTailwind}},useTheme:hQ,useVariants:Mi},Symbol.toStringTag,{value:"Module"})),FM=x.forwardRef(({className:e,variant:t,...n},r)=>{const{variants:o}=Mi(),i=x.useMemo(()=>cr(o.alert.defaultStyles,{variants:o.alert.variantStyles,defaultVariants:o.alert.defaultVariants}),[o]);return g.jsx("div",{ref:r,role:"alert",className:ce(i({variant:t}),e),...n})});FM.displayName="Alert";const $M=x.forwardRef(({className:e,...t},n)=>g.jsx("h5",{ref:n,className:ce("mb-1 font-medium leading-none tracking-tight",e),...t}));$M.displayName="AlertTitle";const zM=x.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:ce("text-sm [&_p]:leading-relaxed",e),...t}));zM.displayName="AlertDescription";const yQ=w9,wQ=v9,vQ=b9,BM=w.forwardRef(({className:e,...t},n)=>g.jsx(lN,{className:ce("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,ref:n}));BM.displayName=lN.displayName;const WM=w.forwardRef(({className:e,...t},n)=>g.jsxs(vQ,{children:[g.jsx(BM,{}),g.jsx(cN,{ref:n,className:ce("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),...t})]}));WM.displayName=cN.displayName;const VM=({className:e,...t})=>g.jsx("div",{className:ce("flex flex-col space-y-2 text-center sm:text-left",e),...t});VM.displayName="AlertDialogHeader";const UM=({className:e,...t})=>g.jsx("div",{className:ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});UM.displayName="AlertDialogFooter";const HM=w.forwardRef(({className:e,...t},n)=>g.jsx(fN,{ref:n,className:ce("text-lg font-semibold",e),...t}));HM.displayName=fN.displayName;const GM=w.forwardRef(({className:e,...t},n)=>g.jsx(hN,{ref:n,className:ce("text-sm text-foreground",e),...t}));GM.displayName=hN.displayName;const YM=w.forwardRef(({className:e,...t},n)=>g.jsx(uN,{ref:n,className:ce("inline-flex h-10 items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground ring-offset-background transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e),...t}));YM.displayName=uN.displayName;const qM=w.forwardRef(({className:e,...t},n)=>g.jsx(dN,{ref:n,className:ce("mt-2 inline-flex h-10 items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-semibold ring-offset-background transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 sm:mt-0",e),...t}));qM.displayName=dN.displayName;const bQ=S9,KM=w.forwardRef(({className:e,...t},n)=>g.jsx(_N,{ref:n,className:ce("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));KM.displayName=_N.displayName;const XM=w.forwardRef(({className:e,...t},n)=>g.jsx(SN,{ref:n,className:ce("aspect-square h-full w-full",e),...t}));XM.displayName=SN.displayName;const JM=w.forwardRef(({className:e,...t},n)=>g.jsx(xN,{ref:n,className:ce("flex h-full w-full items-center justify-center rounded-full bg-primary",e),...t}));JM.displayName=xN.displayName;const _Q=cr("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function SQ({className:e,variant:t,...n}){const{variants:r}=Mi(),o=x.useMemo(()=>cr(r.badge.defaultStyles,{variants:r.badge.variantStyles,defaultVariants:r.badge.defaultVariants}),[r]);return g.jsx("div",{className:ce(o({variant:t}),e),...n})}const QM=w.forwardRef(({...e},t)=>g.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));QM.displayName="Breadcrumb";const ZM=w.forwardRef(({className:e,...t},n)=>g.jsx("ol",{ref:n,className:ce("flex flex-wrap items-center gap-1.5 break-words text-sm text-foreground sm:gap-2.5",e),...t}));ZM.displayName="BreadcrumbList";const eI=w.forwardRef(({className:e,...t},n)=>g.jsx("li",{ref:n,className:ce("inline-flex items-center gap-1.5",e),...t}));eI.displayName="BreadcrumbItem";const tI=w.forwardRef(({className:e,...t},n)=>g.jsx("a",{ref:n,className:ce("transition-colors hover:text-foreground hover:underline",e),...t}));tI.displayName="BreadcrumbLink";const nI=w.forwardRef(({className:e,...t},n)=>g.jsx("span",{ref:n,role:"link","aria-current":"page",className:ce("font-normal text-foreground",e),...t}));nI.displayName="BreadcrumbPage";const rI=({className:e,...t})=>g.jsx("li",{role:"presentation","aria-hidden":"true",className:ce("[&>svg]:size-3.5",e),...t,children:g.jsx(Ti,{})});rI.displayName="BreadcrumbSeparator";const xQ=cr("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Hr=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?PG:"button",{variants:a}=Mi(),l=x.useMemo(()=>cr(a.button.defaultStyles,{variants:a.button.variantStyles,defaultVariants:a.button.defaultVariants}),[a]);return g.jsx(s,{className:ce(l({variant:t,size:n,className:e})),ref:i,...o})});Hr.displayName="Button";function gt(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function ur(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Bn(e,t){const n=gt(e);return isNaN(t)?ur(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Gr(e,t){const n=gt(e);if(isNaN(t))return ur(e,NaN);if(!t)return n;const r=n.getDate(),o=ur(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);const i=o.getDate();return r>=i?o:(n.setFullYear(o.getFullYear(),o.getMonth(),r),n)}const ev=6048e5,EQ=864e5;let CQ={};function wc(){return CQ}function xo(e,t){var a,l,c,d;const n=wc(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((d=(c=n.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??0,o=gt(e),i=o.getDay(),s=(i<r?7:0)+i-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function _s(e){return xo(e,{weekStartsOn:1})}function oI(e){const t=gt(e),n=t.getFullYear(),r=ur(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=_s(r),i=ur(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=_s(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function Ba(e){const t=gt(e);return t.setHours(0,0,0,0),t}function Gf(e){const t=gt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Eo(e,t){const n=Ba(e),r=Ba(t),o=+n-Gf(n),i=+r-Gf(r);return Math.round((o-i)/EQ)}function NQ(e){const t=oI(e),n=ur(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),_s(n)}function tv(e,t){const n=t*7;return Bn(e,n)}function RQ(e,t){return Gr(e,t*12)}function PQ(e){let t;return e.forEach(function(n){const r=gt(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function AQ(e){let t;return e.forEach(n=>{const r=gt(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function qn(e,t){const n=Ba(e),r=Ba(t);return+n==+r}function nv(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function TQ(e){if(!nv(e)&&typeof e!="number")return!1;const t=gt(e);return!isNaN(Number(t))}function vc(e,t){const n=gt(e),r=gt(t),o=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return o*12+i}function DQ(e,t,n){const r=xo(e,n),o=xo(t,n),i=+r-Gf(r),s=+o-Gf(o);return Math.round((i-s)/ev)}function rv(e){const t=gt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function Kn(e){const t=gt(e);return t.setDate(1),t.setHours(0,0,0,0),t}function iI(e){const t=gt(e),n=ur(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ov(e,t){var a,l,c,d;const n=wc(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((d=(c=n.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??0,o=gt(e),i=o.getDay(),s=(i<r?-7:0)+6-(i-r);return o.setDate(o.getDate()+s),o.setHours(23,59,59,999),o}function sI(e){return ov(e,{weekStartsOn:1})}const MQ={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},IQ=(e,t,n)=>{let r;const o=MQ[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function iv(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const OQ={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},kQ={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},LQ={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},jQ={date:iv({formats:OQ,defaultWidth:"full"}),time:iv({formats:kQ,defaultWidth:"full"}),dateTime:iv({formats:LQ,defaultWidth:"full"})},FQ={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},$Q=(e,t,n,r)=>FQ[e];function bc(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):s;o=e.formattingValues[a]||e.formattingValues[s]}else{const s=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[a]||e.values[s]}const i=e.argumentCallback?e.argumentCallback(t):t;return o[i]}}const zQ={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},BQ={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},WQ={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},VQ={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},UQ={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},HQ={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},GQ={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:bc({values:zQ,defaultWidth:"wide"}),quarter:bc({values:BQ,defaultWidth:"wide",argumentCallback:e=>e-1}),month:bc({values:WQ,defaultWidth:"wide"}),day:bc({values:VQ,defaultWidth:"wide"}),dayPeriod:bc({values:UQ,defaultWidth:"wide",formattingValues:HQ,defaultFormattingWidth:"wide"})};function _c(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const s=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?qQ(a,u=>u.test(s)):YQ(a,u=>u.test(s));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const d=t.slice(s.length);return{value:c,rest:d}}}function YQ(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function qQ(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function KQ(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],i=t.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=n.valueCallback?n.valueCallback(s):s;const a=t.slice(o.length);return{value:s,rest:a}}}const XQ=/^(\d+)(th|st|nd|rd)?/i,JQ=/\d+/i,QQ={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ZQ={any:[/^b/i,/^(a|c)/i]},eZ={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},tZ={any:[/1/i,/2/i,/3/i,/4/i]},nZ={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},rZ={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},oZ={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},iZ={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},sZ={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},aZ={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},lZ={ordinalNumber:KQ({matchPattern:XQ,parsePattern:JQ,valueCallback:e=>parseInt(e,10)}),era:_c({matchPatterns:QQ,defaultMatchWidth:"wide",parsePatterns:ZQ,defaultParseWidth:"any"}),quarter:_c({matchPatterns:eZ,defaultMatchWidth:"wide",parsePatterns:tZ,defaultParseWidth:"any",valueCallback:e=>e+1}),month:_c({matchPatterns:nZ,defaultMatchWidth:"wide",parsePatterns:rZ,defaultParseWidth:"any"}),day:_c({matchPatterns:oZ,defaultMatchWidth:"wide",parsePatterns:iZ,defaultParseWidth:"any"}),dayPeriod:_c({matchPatterns:sZ,defaultMatchWidth:"any",parsePatterns:aZ,defaultParseWidth:"any"})},aI={code:"en-US",formatDistance:IQ,formatLong:jQ,formatRelative:$Q,localize:GQ,match:lZ,options:{weekStartsOn:0,firstWeekContainsDate:1}};function cZ(e){const t=gt(e);return Eo(t,iI(t))+1}function lI(e){const t=gt(e),n=+_s(t)-+NQ(t);return Math.round(n/ev)+1}function cI(e,t){var d,u,f,h;const n=gt(e),r=n.getFullYear(),o=wc(),i=(t==null?void 0:t.firstWeekContainsDate)??((u=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??o.firstWeekContainsDate??((h=(f=o.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,s=ur(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=xo(s,t),l=ur(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=xo(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function uZ(e,t){var a,l,c,d;const n=wc(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(c=n.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??1,o=cI(e,t),i=ur(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),xo(i,t)}function uI(e,t){const n=gt(e),r=+xo(n,t)-+uZ(n,t);return Math.round(r/ev)+1}function Nt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Ii={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Nt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Nt(n+1,2)},d(e,t){return Nt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Nt(e.getHours()%12||12,t.length)},H(e,t){return Nt(e.getHours(),t.length)},m(e,t){return Nt(e.getMinutes(),t.length)},s(e,t){return Nt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return Nt(o,t.length)}},Wa={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},dI={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return Ii.y(e,t)},Y:function(e,t,n,r){const o=cI(e,r),i=o>0?o:1-o;if(t==="YY"){const s=i%100;return Nt(s,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):Nt(i,t.length)},R:function(e,t){const n=oI(e);return Nt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Nt(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Nt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Nt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Ii.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Nt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=uI(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):Nt(o,t.length)},I:function(e,t,n){const r=lI(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Nt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ii.d(e,t)},D:function(e,t,n){const r=cZ(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Nt(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Nt(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Nt(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return Nt(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=Wa.noon:r===0?o=Wa.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=Wa.evening:r>=12?o=Wa.afternoon:r>=4?o=Wa.morning:o=Wa.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Ii.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ii.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Nt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Nt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ii.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ii.s(e,t)},S:function(e,t){return Ii.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return hI(r);case"XXXX":case"XX":return Ss(r);case"XXXXX":case"XXX":default:return Ss(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return hI(r);case"xxxx":case"xx":return Ss(r);case"xxxxx":case"xxx":default:return Ss(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+fI(r,":");case"OOOO":default:return"GMT"+Ss(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+fI(r,":");case"zzzz":default:return"GMT"+Ss(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return Nt(r,t.length)},T:function(e,t,n){const r=e.getTime();return Nt(r,t.length)}};function fI(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return i===0?n+String(o):n+String(o)+t+Nt(i,2)}function hI(e,t){return e%60===0?(e>0?"-":"+")+Nt(Math.abs(e)/60,2):Ss(e,t)}function Ss(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Nt(Math.trunc(r/60),2),i=Nt(r%60,2);return n+o+t+i}const pI=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},mI=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},dZ={p:mI,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return pI(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",pI(r,t)).replace("{{time}}",mI(o,t))}},fZ=/^D+$/,hZ=/^Y+$/,pZ=["D","DD","YY","YYYY"];function mZ(e){return fZ.test(e)}function gZ(e){return hZ.test(e)}function yZ(e,t,n){const r=wZ(e,t,n);if(console.warn(r),pZ.includes(e))throw new RangeError(r)}function wZ(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const vZ=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,bZ=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,_Z=/^'([^]*?)'?$/,SZ=/''/g,xZ=/[a-zA-Z]/;function Co(e,t,n){var d,u,f,h,m,p,y,v;const r=wc(),o=(n==null?void 0:n.locale)??r.locale??aI,i=(n==null?void 0:n.firstWeekContainsDate)??((u=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??r.firstWeekContainsDate??((h=(f=r.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((p=(m=n==null?void 0:n.locale)==null?void 0:m.options)==null?void 0:p.weekStartsOn)??r.weekStartsOn??((v=(y=r.locale)==null?void 0:y.options)==null?void 0:v.weekStartsOn)??0,a=gt(e);if(!TQ(a))throw new RangeError("Invalid time value");let l=t.match(bZ).map(b=>{const _=b[0];if(_==="p"||_==="P"){const C=dZ[_];return C(b,o.formatLong)}return b}).join("").match(vZ).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const _=b[0];if(_==="'")return{isToken:!1,value:EZ(b)};if(dI[_])return{isToken:!0,value:b};if(_.match(xZ))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:b}});o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const c={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map(b=>{if(!b.isToken)return b.value;const _=b.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&gZ(_)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&mZ(_))&&yZ(_,t,String(e));const C=dI[_[0]];return C(a,_,o.localize,c)}).join("")}function EZ(e){const t=e.match(_Z);return t?t[1].replace(SZ,"'"):e}function CZ(e){const t=gt(e),n=t.getFullYear(),r=t.getMonth(),o=ur(e,0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}function NZ(e){return Math.trunc(+gt(e)/1e3)}function RZ(e){const t=gt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function PZ(e,t){return DQ(RZ(e),Kn(e),t)+1}function sv(e,t){const n=gt(e),r=gt(t);return n.getTime()>r.getTime()}function gI(e,t){const n=gt(e),r=gt(t);return+n<+r}function av(e,t){const n=gt(e),r=gt(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function AZ(e,t){const n=gt(e),r=gt(t);return n.getFullYear()===r.getFullYear()}function lv(e,t){return Bn(e,-t)}function cv(e,t){const n=gt(e),r=n.getFullYear(),o=n.getDate(),i=ur(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const s=CZ(i);return n.setMonth(t,Math.min(o,s)),n}function yI(e,t){const n=gt(e);return isNaN(+n)?ur(e,NaN):(n.setFullYear(t),n)}var Ve=function(){return Ve=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ve.apply(this,arguments)};function TZ(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 wI(e,t,n){for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function Sc(e){return e.mode==="multiple"}function xc(e){return e.mode==="range"}function Yf(e){return e.mode==="single"}var DZ={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function MZ(e,t){return Co(e,"LLLL y",t)}function IZ(e,t){return Co(e,"d",t)}function OZ(e,t){return Co(e,"LLLL",t)}function kZ(e){return"".concat(e)}function LZ(e,t){return Co(e,"cccccc",t)}function jZ(e,t){return Co(e,"yyyy",t)}var FZ=Object.freeze({__proto__:null,formatCaption:MZ,formatDay:IZ,formatMonthCaption:OZ,formatWeekNumber:kZ,formatWeekdayName:LZ,formatYearCaption:jZ}),$Z=function(e,t,n){return Co(e,"do MMMM (EEEE)",n)},zZ=function(){return"Month: "},BZ=function(){return"Go to next month"},WZ=function(){return"Go to previous month"},VZ=function(e,t){return Co(e,"cccc",t)},UZ=function(e){return"Week n. ".concat(e)},HZ=function(){return"Year: "},GZ=Object.freeze({__proto__:null,labelDay:$Z,labelMonthDropdown:zZ,labelNext:BZ,labelPrevious:WZ,labelWeekNumber:UZ,labelWeekday:VZ,labelYearDropdown:HZ});function YZ(){var e="buttons",t=DZ,n=aI,r={},o={},i=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:FZ,labels:GZ,locale:n,modifiersClassNames:r,modifiers:o,numberOfMonths:i,styles:s,today:a,mode:"default"}}function qZ(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,s=e.toDate;return r?i=Kn(r):t&&(i=new Date(t,0,1)),o?s=rv(o):n&&(s=new Date(n,11,31)),{fromDate:i?Ba(i):void 0,toDate:s?Ba(s):void 0}}var vI=x.createContext(void 0);function KZ(e){var t,n=e.initialProps,r=YZ(),o=qZ(n),i=o.fromDate,s=o.toDate,a=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;a!=="buttons"&&(!i||!s)&&(a="buttons");var l;(Yf(n)||Sc(n)||xc(n))&&(l=n.onSelect);var c=Ve(Ve(Ve({},r),n),{captionLayout:a,classNames:Ve(Ve({},r.classNames),n.classNames),components:Ve({},n.components),formatters:Ve(Ve({},r.formatters),n.formatters),fromDate:i,labels:Ve(Ve({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Ve(Ve({},r.modifiers),n.modifiers),modifiersClassNames:Ve(Ve({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:Ve(Ve({},r.styles),n.styles),toDate:s});return g.jsx(vI.Provider,{value:c,children:e.children})}function Dt(){var e=x.useContext(vI);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function bI(e){var t=Dt(),n=t.locale,r=t.classNames,o=t.styles,i=t.formatters.formatCaption;return g.jsx("div",{className:r.caption_label,style:o.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:i(e.displayMonth,{locale:n})})}function XZ(e){return g.jsx("svg",Ve({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:g.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function _I(e){var t,n,r=e.onChange,o=e.value,i=e.children,s=e.caption,a=e.className,l=e.style,c=Dt(),d=(n=(t=c.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:XZ;return g.jsxs("div",{className:a,style:l,children:[g.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),g.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:o,onChange:r,children:i}),g.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[s,g.jsx(d,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function JZ(e){var t,n=Dt(),r=n.fromDate,o=n.toDate,i=n.styles,s=n.locale,a=n.formatters.formatMonthCaption,l=n.classNames,c=n.components,d=n.labels.labelMonthDropdown;if(!r)return g.jsx(g.Fragment,{});if(!o)return g.jsx(g.Fragment,{});var u=[];if(AZ(r,o))for(var f=Kn(r),h=r.getMonth();h<=o.getMonth();h++)u.push(cv(f,h));else for(var f=Kn(new Date),h=0;h<=11;h++)u.push(cv(f,h));var m=function(y){var v=Number(y.target.value),b=cv(Kn(e.displayMonth),v);e.onChange(b)},p=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:_I;return g.jsx(p,{name:"months","aria-label":d(),className:l.dropdown_month,style:i.dropdown_month,onChange:m,value:e.displayMonth.getMonth(),caption:a(e.displayMonth,{locale:s}),children:u.map(function(y){return g.jsx("option",{value:y.getMonth(),children:a(y,{locale:s})},y.getMonth())})})}function QZ(e){var t,n=e.displayMonth,r=Dt(),o=r.fromDate,i=r.toDate,s=r.locale,a=r.styles,l=r.classNames,c=r.components,d=r.formatters.formatYearCaption,u=r.labels.labelYearDropdown,f=[];if(!o)return g.jsx(g.Fragment,{});if(!i)return g.jsx(g.Fragment,{});for(var h=o.getFullYear(),m=i.getFullYear(),p=h;p<=m;p++)f.push(yI(iI(new Date),p));var y=function(b){var _=yI(Kn(n),Number(b.target.value));e.onChange(_)},v=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:_I;return g.jsx(v,{name:"years","aria-label":u(),className:l.dropdown_year,style:a.dropdown_year,onChange:y,value:n.getFullYear(),caption:d(n,{locale:s}),children:f.map(function(b){return g.jsx("option",{value:b.getFullYear(),children:d(b,{locale:s})},b.getFullYear())})})}function ZZ(e,t){var n=x.useState(e),r=n[0],o=n[1],i=t===void 0?r:t;return[i,o]}function eee(e){var t=e.month,n=e.defaultMonth,r=e.today,o=t||n||r||new Date,i=e.toDate,s=e.fromDate,a=e.numberOfMonths,l=a===void 0?1:a;if(i&&vc(i,o)<0){var c=-1*(l-1);o=Gr(i,c)}return s&&vc(o,s)<0&&(o=s),Kn(o)}function tee(){var e=Dt(),t=eee(e),n=ZZ(t,e.month),r=n[0],o=n[1],i=function(s){var a;if(!e.disableNavigation){var l=Kn(s);o(l),(a=e.onMonthChange)===null||a===void 0||a.call(e,l)}};return[r,i]}function nee(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=Kn(e),i=Kn(Gr(o,r)),s=vc(i,o),a=[],l=0;l<s;l++){var c=Gr(o,l);a.push(c)}return n&&(a=a.reverse()),a}function ree(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,o=t.numberOfMonths,i=o===void 0?1:o,s=r?i:1,a=Kn(e);if(!n)return Gr(a,s);var l=vc(n,e);if(!(l<i))return Gr(a,s)}}function oee(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,o=t.numberOfMonths,i=o===void 0?1:o,s=r?i:1,a=Kn(e);if(!n)return Gr(a,-s);var l=vc(a,n);if(!(l<=0))return Gr(a,-s)}}var SI=x.createContext(void 0);function iee(e){var t=Dt(),n=tee(),r=n[0],o=n[1],i=nee(r,t),s=ree(r,t),a=oee(r,t),l=function(u){return i.some(function(f){return av(u,f)})},c=function(u,f){l(u)||(f&&gI(u,f)?o(Gr(u,1+t.numberOfMonths*-1)):o(u))},d={currentMonth:r,displayMonths:i,goToMonth:o,goToDate:c,previousMonth:a,nextMonth:s,isDateDisplayed:l};return g.jsx(SI.Provider,{value:d,children:e.children})}function Ec(){var e=x.useContext(SI);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function xI(e){var t,n=Dt(),r=n.classNames,o=n.styles,i=n.components,s=Ec().goToMonth,a=function(d){s(Gr(d,e.displayIndex?-e.displayIndex:0))},l=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:bI,c=g.jsx(l,{id:e.id,displayMonth:e.displayMonth});return g.jsxs("div",{className:r.caption_dropdowns,style:o.caption_dropdowns,children:[g.jsx("div",{className:r.vhidden,children:c}),g.jsx(JZ,{onChange:a,displayMonth:e.displayMonth}),g.jsx(QZ,{onChange:a,displayMonth:e.displayMonth})]})}function see(e){return g.jsx("svg",Ve({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:g.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function aee(e){return g.jsx("svg",Ve({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:g.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var qf=x.forwardRef(function(e,t){var n=Dt(),r=n.classNames,o=n.styles,i=[r.button_reset,r.button];e.className&&i.push(e.className);var s=i.join(" "),a=Ve(Ve({},o.button_reset),o.button);return e.style&&Object.assign(a,e.style),g.jsx("button",Ve({},e,{ref:t,type:"button",className:s,style:a}))});function lee(e){var t,n,r=Dt(),o=r.dir,i=r.locale,s=r.classNames,a=r.styles,l=r.labels,c=l.labelPrevious,d=l.labelNext,u=r.components;if(!e.nextMonth&&!e.previousMonth)return g.jsx(g.Fragment,{});var f=c(e.previousMonth,{locale:i}),h=[s.nav_button,s.nav_button_previous].join(" "),m=d(e.nextMonth,{locale:i}),p=[s.nav_button,s.nav_button_next].join(" "),y=(t=u==null?void 0:u.IconRight)!==null&&t!==void 0?t:aee,v=(n=u==null?void 0:u.IconLeft)!==null&&n!==void 0?n:see;return g.jsxs("div",{className:s.nav,style:a.nav,children:[!e.hidePrevious&&g.jsx(qf,{name:"previous-month","aria-label":f,className:h,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:o==="rtl"?g.jsx(y,{className:s.nav_icon,style:a.nav_icon}):g.jsx(v,{className:s.nav_icon,style:a.nav_icon})}),!e.hideNext&&g.jsx(qf,{name:"next-month","aria-label":m,className:p,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:o==="rtl"?g.jsx(v,{className:s.nav_icon,style:a.nav_icon}):g.jsx(y,{className:s.nav_icon,style:a.nav_icon})})]})}function EI(e){var t=Dt().numberOfMonths,n=Ec(),r=n.previousMonth,o=n.nextMonth,i=n.goToMonth,s=n.displayMonths,a=s.findIndex(function(m){return av(e.displayMonth,m)}),l=a===0,c=a===s.length-1,d=t>1&&(l||!c),u=t>1&&(c||!l),f=function(){r&&i(r)},h=function(){o&&i(o)};return g.jsx(lee,{displayMonth:e.displayMonth,hideNext:d,hidePrevious:u,nextMonth:o,previousMonth:r,onPreviousClick:f,onNextClick:h})}function cee(e){var t,n=Dt(),r=n.classNames,o=n.disableNavigation,i=n.styles,s=n.captionLayout,a=n.components,l=(t=a==null?void 0:a.CaptionLabel)!==null&&t!==void 0?t:bI,c;return o?c=g.jsx(l,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?c=g.jsx(xI,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?c=g.jsxs(g.Fragment,{children:[g.jsx(xI,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),g.jsx(EI,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):c=g.jsxs(g.Fragment,{children:[g.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),g.jsx(EI,{displayMonth:e.displayMonth,id:e.id})]}),g.jsx("div",{className:r.caption,style:i.caption,children:c})}function uee(e){var t=Dt(),n=t.footer,r=t.styles,o=t.classNames.tfoot;return n?g.jsx("tfoot",{className:o,style:r.tfoot,children:g.jsx("tr",{children:g.jsx("td",{colSpan:8,children:n})})}):g.jsx(g.Fragment,{})}function dee(e,t,n){for(var r=n?_s(new Date):xo(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var s=Bn(r,i);o.push(s)}return o}function fee(){var e=Dt(),t=e.classNames,n=e.styles,r=e.showWeekNumber,o=e.locale,i=e.weekStartsOn,s=e.ISOWeek,a=e.formatters.formatWeekdayName,l=e.labels.labelWeekday,c=dee(o,i,s);return g.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&g.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(d,u){return g.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":l(d,{locale:o}),children:a(d,{locale:o})},u)})]})}function hee(){var e,t=Dt(),n=t.classNames,r=t.styles,o=t.components,i=(e=o==null?void 0:o.HeadRow)!==null&&e!==void 0?e:fee;return g.jsx("thead",{style:r.head,className:n.head,children:g.jsx(i,{})})}function pee(e){var t=Dt(),n=t.locale,r=t.formatters.formatDay;return g.jsx(g.Fragment,{children:r(e.date,{locale:n})})}var uv=x.createContext(void 0);function mee(e){if(!Sc(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return g.jsx(uv.Provider,{value:t,children:e.children})}return g.jsx(gee,{initialProps:e.initialProps,children:e.children})}function gee(e){var t=e.initialProps,n=e.children,r=t.selected,o=t.min,i=t.max,s=function(c,d,u){var f,h;(f=t.onDayClick)===null||f===void 0||f.call(t,c,d,u);var m=!!(d.selected&&o&&(r==null?void 0:r.length)===o);if(!m){var p=!!(!d.selected&&i&&(r==null?void 0:r.length)===i);if(!p){var y=r?wI([],r):[];if(d.selected){var v=y.findIndex(function(b){return qn(c,b)});y.splice(v,1)}else y.push(c);(h=t.onSelect)===null||h===void 0||h.call(t,y,c,d,u)}}},a={disabled:[]};r&&a.disabled.push(function(c){var d=i&&r.length>i-1,u=r.some(function(f){return qn(f,c)});return!!(d&&!u)});var l={selected:r,onDayClick:s,modifiers:a};return g.jsx(uv.Provider,{value:l,children:n})}function dv(){var e=x.useContext(uv);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function yee(e,t){var n=t||{},r=n.from,o=n.to;return r&&o?qn(o,e)&&qn(r,e)?void 0:qn(o,e)?{from:o,to:void 0}:qn(r,e)?void 0:sv(r,e)?{from:e,to:o}:{from:r,to:e}:o?sv(e,o)?{from:o,to:e}:{from:e,to:o}:r?gI(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var fv=x.createContext(void 0);function wee(e){if(!xc(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return g.jsx(fv.Provider,{value:t,children:e.children})}return g.jsx(vee,{initialProps:e.initialProps,children:e.children})}function vee(e){var t=e.initialProps,n=e.children,r=t.selected,o=r||{},i=o.from,s=o.to,a=t.min,l=t.max,c=function(h,m,p){var y,v;(y=t.onDayClick)===null||y===void 0||y.call(t,h,m,p);var b=yee(h,r);(v=t.onSelect)===null||v===void 0||v.call(t,b,h,m,p)},d={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(d.range_start=[i],s?(d.range_end=[s],qn(i,s)||(d.range_middle=[{after:i,before:s}])):d.range_end=[i]):s&&(d.range_start=[s],d.range_end=[s]),a&&(i&&!s&&d.disabled.push({after:lv(i,a-1),before:Bn(i,a-1)}),i&&s&&d.disabled.push({after:i,before:Bn(i,a-1)}),!i&&s&&d.disabled.push({after:lv(s,a-1),before:Bn(s,a-1)})),l){if(i&&!s&&(d.disabled.push({before:Bn(i,-l+1)}),d.disabled.push({after:Bn(i,l-1)})),i&&s){var u=Eo(s,i)+1,f=l-u;d.disabled.push({before:lv(i,f)}),d.disabled.push({after:Bn(s,f)})}!i&&s&&(d.disabled.push({before:Bn(s,-l+1)}),d.disabled.push({after:Bn(s,l-1)}))}return g.jsx(fv.Provider,{value:{selected:r,onDayClick:c,modifiers:d},children:n})}function hv(){var e=x.useContext(fv);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function Kf(e){return Array.isArray(e)?wI([],e):e!==void 0?[e]:[]}function bee(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],o=n[1];t[r]=Kf(o)}),t}var Yr;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(Yr||(Yr={}));var _ee=Yr.Selected,Xo=Yr.Disabled,See=Yr.Hidden,xee=Yr.Today,pv=Yr.RangeEnd,mv=Yr.RangeMiddle,gv=Yr.RangeStart,Eee=Yr.Outside;function Cee(e,t,n){var r,o=(r={},r[_ee]=Kf(e.selected),r[Xo]=Kf(e.disabled),r[See]=Kf(e.hidden),r[xee]=[e.today],r[pv]=[],r[mv]=[],r[gv]=[],r[Eee]=[],r);return e.fromDate&&o[Xo].push({before:e.fromDate}),e.toDate&&o[Xo].push({after:e.toDate}),Sc(e)?o[Xo]=o[Xo].concat(t.modifiers[Xo]):xc(e)&&(o[Xo]=o[Xo].concat(n.modifiers[Xo]),o[gv]=n.modifiers[gv],o[mv]=n.modifiers[mv],o[pv]=n.modifiers[pv]),o}var CI=x.createContext(void 0);function Nee(e){var t=Dt(),n=dv(),r=hv(),o=Cee(t,n,r),i=bee(t.modifiers),s=Ve(Ve({},o),i);return g.jsx(CI.Provider,{value:s,children:e.children})}function NI(){var e=x.useContext(CI);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function Ree(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Pee(e){return!!(e&&typeof e=="object"&&"from"in e)}function Aee(e){return!!(e&&typeof e=="object"&&"after"in e)}function Tee(e){return!!(e&&typeof e=="object"&&"before"in e)}function Dee(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Mee(e,t){var n,r=t.from,o=t.to;if(r&&o){var i=Eo(o,r)<0;i&&(n=[o,r],r=n[0],o=n[1]);var s=Eo(e,r)>=0&&Eo(o,e)>=0;return s}return o?qn(o,e):r?qn(r,e):!1}function Iee(e){return nv(e)}function Oee(e){return Array.isArray(e)&&e.every(nv)}function kee(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(Iee(n))return qn(e,n);if(Oee(n))return n.includes(e);if(Pee(n))return Mee(e,n);if(Dee(n))return n.dayOfWeek.includes(e.getDay());if(Ree(n)){var r=Eo(n.before,e),o=Eo(n.after,e),i=r>0,s=o<0,a=sv(n.before,n.after);return a?s&&i:i||s}return Aee(n)?Eo(e,n.after)>0:Tee(n)?Eo(n.before,e)>0:typeof n=="function"?n(e):!1})}function yv(e,t,n){var r=Object.keys(t).reduce(function(i,s){var a=t[s];return kee(e,a)&&i.push(s),i},[]),o={};return r.forEach(function(i){return o[i]=!0}),n&&!av(e,n)&&(o.outside=!0),o}function Lee(e,t){for(var n=Kn(e[0]),r=rv(e[e.length-1]),o,i,s=n;s<=r;){var a=yv(s,t),l=!a.disabled&&!a.hidden;if(!l){s=Bn(s,1);continue}if(a.selected)return s;a.today&&!i&&(i=s),o||(o=s),s=Bn(s,1)}return i||o}var jee=365;function RI(e,t){var n=t.moveBy,r=t.direction,o=t.context,i=t.modifiers,s=t.retry,a=s===void 0?{count:0,lastFocused:e}:s,l=o.weekStartsOn,c=o.fromDate,d=o.toDate,u=o.locale,f={day:Bn,week:tv,month:Gr,year:RQ,startOfWeek:function(y){return o.ISOWeek?_s(y):xo(y,{locale:u,weekStartsOn:l})},endOfWeek:function(y){return o.ISOWeek?sI(y):ov(y,{locale:u,weekStartsOn:l})}},h=f[n](e,r==="after"?1:-1);r==="before"&&c?h=PQ([c,h]):r==="after"&&d&&(h=AQ([d,h]));var m=!0;if(i){var p=yv(h,i);m=!p.disabled&&!p.hidden}return m?h:a.count>jee?a.lastFocused:RI(h,{moveBy:n,direction:r,context:o,modifiers:i,retry:Ve(Ve({},a),{count:a.count+1})})}var PI=x.createContext(void 0);function Fee(e){var t=Ec(),n=NI(),r=x.useState(),o=r[0],i=r[1],s=x.useState(),a=s[0],l=s[1],c=Lee(t.displayMonths,n),d=o??(a&&t.isDateDisplayed(a))?a:c,u=function(){l(o),i(void 0)},f=function(y){i(y)},h=Dt(),m=function(y,v){if(o){var b=RI(o,{moveBy:y,direction:v,context:h,modifiers:n});qn(o,b)||(t.goToDate(b,o),f(b))}},p={focusedDay:o,focusTarget:d,blur:u,focus:f,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}};return g.jsx(PI.Provider,{value:p,children:e.children})}function wv(){var e=x.useContext(PI);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function $ee(e,t){var n=NI(),r=yv(e,n,t);return r}var vv=x.createContext(void 0);function zee(e){if(!Yf(e.initialProps)){var t={selected:void 0};return g.jsx(vv.Provider,{value:t,children:e.children})}return g.jsx(Bee,{initialProps:e.initialProps,children:e.children})}function Bee(e){var t=e.initialProps,n=e.children,r=function(i,s,a){var l,c,d;if((l=t.onDayClick)===null||l===void 0||l.call(t,i,s,a),s.selected&&!t.required){(c=t.onSelect)===null||c===void 0||c.call(t,void 0,i,s,a);return}(d=t.onSelect)===null||d===void 0||d.call(t,i,i,s,a)},o={selected:t.selected,onDayClick:r};return g.jsx(vv.Provider,{value:o,children:n})}function AI(){var e=x.useContext(vv);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function Wee(e,t){var n=Dt(),r=AI(),o=dv(),i=hv(),s=wv(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,d=s.focusWeekBefore,u=s.blur,f=s.focus,h=s.focusMonthBefore,m=s.focusMonthAfter,p=s.focusYearBefore,y=s.focusYearAfter,v=s.focusStartOfWeek,b=s.focusEndOfWeek,_=function(ee){var G,re,X,J;Yf(n)?(G=r.onDayClick)===null||G===void 0||G.call(r,e,t,ee):Sc(n)?(re=o.onDayClick)===null||re===void 0||re.call(o,e,t,ee):xc(n)?(X=i.onDayClick)===null||X===void 0||X.call(i,e,t,ee):(J=n.onDayClick)===null||J===void 0||J.call(n,e,t,ee)},C=function(ee){var G;f(e),(G=n.onDayFocus)===null||G===void 0||G.call(n,e,t,ee)},N=function(ee){var G;u(),(G=n.onDayBlur)===null||G===void 0||G.call(n,e,t,ee)},A=function(ee){var G;(G=n.onDayMouseEnter)===null||G===void 0||G.call(n,e,t,ee)},R=function(ee){var G;(G=n.onDayMouseLeave)===null||G===void 0||G.call(n,e,t,ee)},D=function(ee){var G;(G=n.onDayPointerEnter)===null||G===void 0||G.call(n,e,t,ee)},k=function(ee){var G;(G=n.onDayPointerLeave)===null||G===void 0||G.call(n,e,t,ee)},F=function(ee){var G;(G=n.onDayTouchCancel)===null||G===void 0||G.call(n,e,t,ee)},W=function(ee){var G;(G=n.onDayTouchEnd)===null||G===void 0||G.call(n,e,t,ee)},B=function(ee){var G;(G=n.onDayTouchMove)===null||G===void 0||G.call(n,e,t,ee)},T=function(ee){var G;(G=n.onDayTouchStart)===null||G===void 0||G.call(n,e,t,ee)},Q=function(ee){var G;(G=n.onDayKeyUp)===null||G===void 0||G.call(n,e,t,ee)},K=function(ee){var G;switch(ee.key){case"ArrowLeft":ee.preventDefault(),ee.stopPropagation(),n.dir==="rtl"?a():l();break;case"ArrowRight":ee.preventDefault(),ee.stopPropagation(),n.dir==="rtl"?l():a();break;case"ArrowDown":ee.preventDefault(),ee.stopPropagation(),c();break;case"ArrowUp":ee.preventDefault(),ee.stopPropagation(),d();break;case"PageUp":ee.preventDefault(),ee.stopPropagation(),ee.shiftKey?p():h();break;case"PageDown":ee.preventDefault(),ee.stopPropagation(),ee.shiftKey?y():m();break;case"Home":ee.preventDefault(),ee.stopPropagation(),v();break;case"End":ee.preventDefault(),ee.stopPropagation(),b();break}(G=n.onDayKeyDown)===null||G===void 0||G.call(n,e,t,ee)},Y={onClick:_,onFocus:C,onBlur:N,onKeyDown:K,onKeyUp:Q,onMouseEnter:A,onMouseLeave:R,onPointerEnter:D,onPointerLeave:k,onTouchCancel:F,onTouchEnd:W,onTouchMove:B,onTouchStart:T};return Y}function Vee(){var e=Dt(),t=AI(),n=dv(),r=hv(),o=Yf(e)?t.selected:Sc(e)?n.selected:xc(e)?r.selected:void 0;return o}function Uee(e){return Object.values(Yr).includes(e)}function Hee(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var o=e.modifiersClassNames[r];if(o)n.push(o);else if(Uee(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function Gee(e,t){var n=Ve({},e.styles.day);return Object.keys(t).forEach(function(r){var o;n=Ve(Ve({},n),(o=e.modifiersStyles)===null||o===void 0?void 0:o[r])}),n}function Yee(e,t,n){var r,o,i,s=Dt(),a=wv(),l=$ee(e,t),c=Wee(e,l),d=Vee(),u=!!(s.onDayClick||s.mode!=="default");x.useEffect(function(){var A;l.outside||a.focusedDay&&u&&qn(a.focusedDay,e)&&((A=n.current)===null||A===void 0||A.focus())},[a.focusedDay,e,n,u,l.outside]);var f=Hee(s,l).join(" "),h=Gee(s,l),m=!!(l.outside&&!s.showOutsideDays||l.hidden),p=(i=(o=s.components)===null||o===void 0?void 0:o.DayContent)!==null&&i!==void 0?i:pee,y=g.jsx(p,{date:e,displayMonth:t,activeModifiers:l}),v={style:h,className:f,children:y,role:"gridcell"},b=a.focusTarget&&qn(a.focusTarget,e)&&!l.outside,_=a.focusedDay&&qn(a.focusedDay,e),C=Ve(Ve(Ve({},v),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=_||b?0:-1,r)),c),N={isButton:u,isHidden:m,activeModifiers:l,selectedDays:d,buttonProps:C,divProps:v};return N}function qee(e){var t=x.useRef(null),n=Yee(e.date,e.displayMonth,t);return n.isHidden?g.jsx("div",{role:"gridcell"}):n.isButton?g.jsx(qf,Ve({name:"day",ref:t},n.buttonProps)):g.jsx("div",Ve({},n.divProps))}function Kee(e){var t=e.number,n=e.dates,r=Dt(),o=r.onWeekNumberClick,i=r.styles,s=r.classNames,a=r.locale,l=r.labels.labelWeekNumber,c=r.formatters.formatWeekNumber,d=c(Number(t),{locale:a});if(!o)return g.jsx("span",{className:s.weeknumber,style:i.weeknumber,children:d});var u=l(Number(t),{locale:a}),f=function(h){o(t,n,h)};return g.jsx(qf,{name:"week-number","aria-label":u,className:s.weeknumber,style:i.weeknumber,onClick:f,children:d})}function Xee(e){var t,n,r=Dt(),o=r.styles,i=r.classNames,s=r.showWeekNumber,a=r.components,l=(t=a==null?void 0:a.Day)!==null&&t!==void 0?t:qee,c=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:Kee,d;return s&&(d=g.jsx("td",{className:i.cell,style:o.cell,children:g.jsx(c,{number:e.weekNumber,dates:e.dates})})),g.jsxs("tr",{className:i.row,style:o.row,children:[d,e.dates.map(function(u){return g.jsx("td",{className:i.cell,style:o.cell,role:"presentation",children:g.jsx(l,{displayMonth:e.displayMonth,date:u})},NZ(u))})]})}function TI(e,t,n){for(var r=n!=null&&n.ISOWeek?sI(t):ov(t,n),o=n!=null&&n.ISOWeek?_s(e):xo(e,n),i=Eo(r,o),s=[],a=0;a<=i;a++)s.push(Bn(o,a));var l=s.reduce(function(c,d){var u=n!=null&&n.ISOWeek?lI(d):uI(d,n),f=c.find(function(h){return h.weekNumber===u});return f?(f.dates.push(d),c):(c.push({weekNumber:u,dates:[d]}),c)},[]);return l}function Jee(e,t){var n=TI(Kn(e),rv(e),t);if(t!=null&&t.useFixedWeeks){var r=PZ(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],s=tv(i,6-r),a=TI(tv(i,1),s,t);n.push.apply(n,a)}}return n}function Qee(e){var t,n,r,o=Dt(),i=o.locale,s=o.classNames,a=o.styles,l=o.hideHead,c=o.fixedWeeks,d=o.components,u=o.weekStartsOn,f=o.firstWeekContainsDate,h=o.ISOWeek,m=Jee(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:h,locale:i,weekStartsOn:u,firstWeekContainsDate:f}),p=(t=d==null?void 0:d.Head)!==null&&t!==void 0?t:hee,y=(n=d==null?void 0:d.Row)!==null&&n!==void 0?n:Xee,v=(r=d==null?void 0:d.Footer)!==null&&r!==void 0?r:uee;return g.jsxs("table",{id:e.id,className:s.table,style:a.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&g.jsx(p,{}),g.jsx("tbody",{className:s.tbody,style:a.tbody,children:m.map(function(b){return g.jsx(y,{displayMonth:e.displayMonth,dates:b.dates,weekNumber:b.weekNumber},b.weekNumber)})}),g.jsx(v,{displayMonth:e.displayMonth})]})}function Zee(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var ete=Zee()?x.useLayoutEffect:x.useEffect,bv=!1,tte=0;function DI(){return"react-day-picker-".concat(++tte)}function nte(e){var t,n=e??(bv?DI():null),r=x.useState(n),o=r[0],i=r[1];return ete(function(){o===null&&i(DI())},[]),x.useEffect(function(){bv===!1&&(bv=!0)},[]),(t=e??o)!==null&&t!==void 0?t:void 0}function rte(e){var t,n,r=Dt(),o=r.dir,i=r.classNames,s=r.styles,a=r.components,l=Ec().displayMonths,c=nte(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),d=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,u=[i.month],f=s.month,h=e.displayIndex===0,m=e.displayIndex===l.length-1,p=!h&&!m;o==="rtl"&&(t=[h,m],m=t[0],h=t[1]),h&&(u.push(i.caption_start),f=Ve(Ve({},f),s.caption_start)),m&&(u.push(i.caption_end),f=Ve(Ve({},f),s.caption_end)),p&&(u.push(i.caption_between),f=Ve(Ve({},f),s.caption_between));var y=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:cee;return g.jsxs("div",{className:u.join(" "),style:f,children:[g.jsx(y,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),g.jsx(Qee,{id:d,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function ote(e){var t=Dt(),n=t.classNames,r=t.styles;return g.jsx("div",{className:n.months,style:r.months,children:e.children})}function ite(e){var t,n,r=e.initialProps,o=Dt(),i=wv(),s=Ec(),a=x.useState(!1),l=a[0],c=a[1];x.useEffect(function(){o.initialFocus&&i.focusTarget&&(l||(i.focus(i.focusTarget),c(!0)))},[o.initialFocus,l,i.focus,i.focusTarget,i]);var d=[o.classNames.root,o.className];o.numberOfMonths>1&&d.push(o.classNames.multiple_months),o.showWeekNumber&&d.push(o.classNames.with_weeknumber);var u=Ve(Ve({},o.styles.root),o.style),f=Object.keys(r).filter(function(m){return m.startsWith("data-")}).reduce(function(m,p){var y;return Ve(Ve({},m),(y={},y[p]=r[p],y))},{}),h=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:ote;return g.jsx("div",Ve({className:d.join(" "),style:u,dir:o.dir,id:o.id,nonce:r.nonce,title:r.title,lang:r.lang},f,{children:g.jsx(h,{children:s.displayMonths.map(function(m,p){return g.jsx(rte,{displayIndex:p,displayMonth:m},p)})})}))}function ste(e){var t=e.children,n=TZ(e,["children"]);return g.jsx(KZ,{initialProps:n,children:g.jsx(iee,{children:g.jsx(zee,{initialProps:n,children:g.jsx(mee,{initialProps:n,children:g.jsx(wee,{initialProps:n,children:g.jsx(Nee,{children:g.jsx(Fee,{children:t})})})})})})})}function ate(e){return g.jsx(ste,Ve({},e,{children:g.jsx(ite,{initialProps:e})}))}function Xf({className:e,classNames:t,showOutsideDays:n=!0,...r}){const{variants:o}=Mi(),i=x.useMemo(()=>cr(o.button.defaultStyles,{variants:o.button.variantStyles,defaultVariants:o.button.defaultVariants}),[o]);return g.jsx(ate,{showOutsideDays:n,className:ce("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:ce(i({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:ce(i({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-foreground aria-selected:opacity-30",day_disabled:"text-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:()=>g.jsx(Vf,{className:"h-4 w-4"}),IconRight:()=>g.jsx(Ti,{className:"h-4 w-4"})},...r})}Xf.displayName="Calendar";const MI=w.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:ce("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));MI.displayName="Card";const II=w.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:ce("flex flex-col space-y-1.5 p-6",e),...t}));II.displayName="CardHeader";const OI=w.forwardRef(({className:e,...t},n)=>g.jsx("h3",{ref:n,className:ce("text-2xl font-semibold leading-none tracking-tight",e),...t}));OI.displayName="CardTitle";const kI=w.forwardRef(({className:e,...t},n)=>g.jsx("p",{ref:n,className:ce("text-sm text-foreground",e),...t}));kI.displayName="CardDescription";const LI=w.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:ce("p-6 pt-0",e),...t}));LI.displayName="CardContent";const jI=w.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:ce("flex items-center p-6 pt-0",e),...t}));jI.displayName="CardFooter";function lte(e){return Object.prototype.toString.call(e)==="[object Object]"}function FI(e){return lte(e)||Array.isArray(e)}function cte(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function _v(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const o=JSON.stringify(Object.keys(e.breakpoints||{})),i=JSON.stringify(Object.keys(t.breakpoints||{}));return o!==i?!1:n.every(s=>{const a=e[s],l=t[s];return typeof a=="function"?`${a}`==`${l}`:!FI(a)||!FI(l)?a===l:_v(a,l)})}function $I(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function ute(e,t){if(e.length!==t.length)return!1;const n=$I(e),r=$I(t);return n.every((o,i)=>{const s=r[i];return _v(o,s)})}function Sv(e){return typeof e=="number"}function xv(e){return typeof e=="string"}function Jf(e){return typeof e=="boolean"}function zI(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ut(e){return Math.abs(e)}function Ev(e){return Math.sign(e)}function Cc(e,t){return Ut(e-t)}function dte(e,t){if(e===0||t===0||Ut(e)<=Ut(t))return 0;const n=Cc(Ut(e),Ut(t));return Ut(n/e)}function fte(e){return Math.round(e*100)/100}function Nc(e){return Pc(e).map(Number)}function qr(e){return e[Rc(e)]}function Rc(e){return Math.max(0,e.length-1)}function Cv(e,t){return t===Rc(e)}function BI(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function Pc(e){return Object.keys(e)}function WI(e,t){return[e,t].reduce((n,r)=>(Pc(r).forEach(o=>{const i=n[o],s=r[o],a=zI(i)&&zI(s);n[o]=a?WI(i,s):s}),n),{})}function Nv(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function hte(e,t){const n={start:r,center:o,end:i};function r(){return 0}function o(l){return i(l)/2}function i(l){return t-l}function s(l,c){return xv(e)?n[e](l):e(t,l,c)}return{measure:s}}function Ac(){let e=[];function t(o,i,s,a={passive:!0}){let l;if("addEventListener"in o)o.addEventListener(i,s,a),l=()=>o.removeEventListener(i,s,a);else{const c=o;c.addListener(s),l=()=>c.removeListener(s)}return e.push(l),r}function n(){e=e.filter(o=>o())}const r={add:t,clear:n};return r}function pte(e,t,n,r){const o=Ac(),i=1e3/60;let s=null,a=0,l=0;function c(){o.add(e,"visibilitychange",()=>{e.hidden&&m()})}function d(){h(),o.clear()}function u(y){if(!l)return;s||(s=y,n(),n());const v=y-s;for(s=y,a+=v;a>=i;)n(),a-=i;const b=a/i;r(b),l&&(l=t.requestAnimationFrame(u))}function f(){l||(l=t.requestAnimationFrame(u))}function h(){t.cancelAnimationFrame(l),s=null,a=0,l=0}function m(){s=null,a=0}return{init:c,destroy:d,start:f,stop:h,update:n,render:r}}function mte(e,t){const n=t==="rtl",r=e==="y",o=r?"y":"x",i=r?"x":"y",s=!r&&n?-1:1,a=d(),l=u();function c(m){const{height:p,width:y}=m;return r?p:y}function d(){return r?"top":n?"right":"left"}function u(){return r?"bottom":n?"left":"right"}function f(m){return m*s}return{scroll:o,cross:i,startEdge:a,endEdge:l,measureSize:c,direction:f}}function xs(e=0,t=0){const n=Ut(e-t);function r(c){return c<e}function o(c){return c>t}function i(c){return r(c)||o(c)}function s(c){return i(c)?r(c)?e:t:c}function a(c){return n?c-n*Math.ceil((c-t)/n):c}return{length:n,max:t,min:e,constrain:s,reachedAny:i,reachedMax:o,reachedMin:r,removeOffset:a}}function VI(e,t,n){const{constrain:r}=xs(0,e),o=e+1;let i=s(t);function s(f){return n?Ut((o+f)%o):r(f)}function a(){return i}function l(f){return i=s(f),u}function c(f){return d().set(a()+f)}function d(){return VI(e,a(),n)}const u={get:a,set:l,add:c,clone:d};return u}function gte(e,t,n,r,o,i,s,a,l,c,d,u,f,h,m,p,y,v,b){const{cross:_,direction:C}=e,N=["INPUT","SELECT","TEXTAREA"],A={passive:!1},R=Ac(),D=Ac(),k=xs(50,225).constrain(h.measure(20)),F={mouse:300,touch:400},W={mouse:500,touch:600},B=m?43:25;let T=!1,Q=0,K=0,Y=!1,ee=!1,G=!1,re=!1;function X(oe){if(!b)return;function $(le){(Jf(b)||b(oe,le))&&H(le)}const j=t;R.add(j,"dragstart",le=>le.preventDefault(),A).add(j,"touchmove",()=>{},A).add(j,"touchend",()=>{}).add(j,"touchstart",$).add(j,"mousedown",$).add(j,"touchcancel",V).add(j,"contextmenu",V).add(j,"click",de,!0)}function J(){R.clear(),D.clear()}function se(){const oe=re?n:t;D.add(oe,"touchmove",ae,A).add(oe,"touchend",V).add(oe,"mousemove",ae,A).add(oe,"mouseup",V)}function L(oe){const $=oe.nodeName||"";return N.includes($)}function ne(){return(m?W:F)[re?"mouse":"touch"]}function fe(oe,$){const j=u.add(Ev(oe)*-1),le=d.byDistance(oe,!m).distance;return m||Ut(oe)<k?le:y&&$?le*.5:d.byIndex(j.get(),0).distance}function H(oe){const $=Nv(oe,r);re=$,G=m&&$&&!oe.buttons&&T,T=Cc(o.get(),s.get())>=2,!($&&oe.button!==0)&&(L(oe.target)||(Y=!0,i.pointerDown(oe),c.useFriction(0).useDuration(0),o.set(s),se(),Q=i.readPoint(oe),K=i.readPoint(oe,_),f.emit("pointerDown")))}function ae(oe){if(!Nv(oe,r)&&oe.touches.length>=2)return V(oe);const j=i.readPoint(oe),le=i.readPoint(oe,_),ve=Cc(j,Q),we=Cc(le,K);if(!ee&&!re&&(!oe.cancelable||(ee=ve>we,!ee)))return V(oe);const M=i.pointerMove(oe);ve>p&&(G=!0),c.useFriction(.3).useDuration(.75),a.start(),o.add(C(M)),oe.preventDefault()}function V(oe){const j=d.byDistance(0,!1).index!==u.get(),le=i.pointerUp(oe)*ne(),ve=fe(C(le),j),we=dte(le,ve),M=B-10*we,q=v+we/50;ee=!1,Y=!1,D.clear(),c.useDuration(M).useFriction(q),l.distance(ve,!m),re=!1,f.emit("pointerUp")}function de(oe){G&&(oe.stopPropagation(),oe.preventDefault(),G=!1)}function ge(){return Y}return{init:X,destroy:J,pointerDown:ge}}function yte(e,t){let r,o;function i(u){return u.timeStamp}function s(u,f){const m=`client${(f||e.scroll)==="x"?"X":"Y"}`;return(Nv(u,t)?u:u.touches[0])[m]}function a(u){return r=u,o=u,s(u)}function l(u){const f=s(u)-s(o),h=i(u)-i(r)>170;return o=u,h&&(r=u),f}function c(u){if(!r||!o)return 0;const f=s(o)-s(r),h=i(u)-i(r),m=i(u)-i(o)>170,p=f/h;return h&&!m&&Ut(p)>.1?p:0}return{pointerDown:a,pointerMove:l,pointerUp:c,readPoint:s}}function wte(){function e(n){const{offsetTop:r,offsetLeft:o,offsetWidth:i,offsetHeight:s}=n;return{top:r,right:o+i,bottom:r+s,left:o,width:i,height:s}}return{measure:e}}function vte(e){function t(r){return e*(r/100)}return{measure:t}}function bte(e,t,n,r,o,i,s){const a=[e].concat(r);let l,c,d=[],u=!1;function f(y){return o.measureSize(s.measure(y))}function h(y){if(!i)return;c=f(e),d=r.map(f);function v(b){for(const _ of b){if(u)return;const C=_.target===e,N=r.indexOf(_.target),A=C?c:d[N],R=f(C?e:r[N]);if(Ut(R-A)>=.5){y.reInit(),t.emit("resize");break}}}l=new ResizeObserver(b=>{(Jf(i)||i(y,b))&&v(b)}),n.requestAnimationFrame(()=>{a.forEach(b=>l.observe(b))})}function m(){u=!0,l&&l.disconnect()}return{init:h,destroy:m}}function _te(e,t,n,r,o,i){let s=0,a=0,l=o,c=i,d=e.get(),u=0;function f(){const A=r.get()-e.get(),R=!l;let D=0;return R?(s=0,n.set(r),e.set(r),D=A):(n.set(e),s+=A/l,s*=c,d+=s,e.add(s),D=d-u),a=Ev(D),u=d,N}function h(){const A=r.get()-t.get();return Ut(A)<.001}function m(){return l}function p(){return a}function y(){return s}function v(){return _(o)}function b(){return C(i)}function _(A){return l=A,N}function C(A){return c=A,N}const N={direction:p,duration:m,velocity:y,seek:f,settled:h,useBaseFriction:b,useBaseDuration:v,useFriction:C,useDuration:_};return N}function Ste(e,t,n,r,o){const i=o.measure(10),s=o.measure(50),a=xs(.1,.99);let l=!1;function c(){return!(l||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function d(h){if(!c())return;const m=e.reachedMin(t.get())?"min":"max",p=Ut(e[m]-t.get()),y=n.get()-t.get(),v=a.constrain(p/s);n.subtract(y*v),!h&&Ut(y)<i&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function u(h){l=!h}return{shouldConstrain:c,constrain:d,toggleActive:u}}function xte(e,t,n,r,o){const i=xs(-t+e,0),s=u(),a=d(),l=f();function c(m,p){return Cc(m,p)<=1}function d(){const m=s[0],p=qr(s),y=s.lastIndexOf(m),v=s.indexOf(p)+1;return xs(y,v)}function u(){return n.map((m,p)=>{const{min:y,max:v}=i,b=i.constrain(m),_=!p,C=Cv(n,p);return _?v:C||c(y,b)?y:c(v,b)?v:b}).map(m=>parseFloat(m.toFixed(3)))}function f(){if(t<=e+o)return[i.max];if(r==="keepSnaps")return s;const{min:m,max:p}=a;return s.slice(m,p)}return{snapsContained:l,scrollContainLimit:a}}function Ete(e,t,n){const r=t[0],o=n?r-e:qr(t);return{limit:xs(o,r)}}function Cte(e,t,n,r){const i=t.min+.1,s=t.max+.1,{reachedMin:a,reachedMax:l}=xs(i,s);function c(f){return f===1?l(n.get()):f===-1?a(n.get()):!1}function d(f){if(!c(f))return;const h=e*(f*-1);r.forEach(m=>m.add(h))}return{loop:d}}function Nte(e){const{max:t,length:n}=e;function r(i){const s=i-t;return n?s/-n:0}return{get:r}}function Rte(e,t,n,r,o){const{startEdge:i,endEdge:s}=e,{groupSlides:a}=o,l=u().map(t.measure),c=f(),d=h();function u(){return a(r).map(p=>qr(p)[s]-p[0][i]).map(Ut)}function f(){return r.map(p=>n[i]-p[i]).map(p=>-Ut(p))}function h(){return a(c).map(p=>p[0]).map((p,y)=>p+l[y])}return{snaps:c,snapsAligned:d}}function Pte(e,t,n,r,o,i){const{groupSlides:s}=o,{min:a,max:l}=r,c=d();function d(){const f=s(i),h=!e||t==="keepSnaps";return n.length===1?[i]:h?f:f.slice(a,l).map((m,p,y)=>{const v=!p,b=Cv(y,p);if(v){const _=qr(y[0])+1;return BI(_)}if(b){const _=Rc(i)-qr(y)[0]+1;return BI(_,qr(y)[0])}return m})}return{slideRegistry:c}}function Ate(e,t,n,r,o){const{reachedAny:i,removeOffset:s,constrain:a}=r;function l(m){return m.concat().sort((p,y)=>Ut(p)-Ut(y))[0]}function c(m){const p=e?s(m):a(m),y=t.map((b,_)=>({diff:d(b-p,0),index:_})).sort((b,_)=>Ut(b.diff)-Ut(_.diff)),{index:v}=y[0];return{index:v,distance:p}}function d(m,p){const y=[m,m+n,m-n];if(!e)return m;if(!p)return l(y);const v=y.filter(b=>Ev(b)===p);return v.length?l(v):qr(y)-n}function u(m,p){const y=t[m]-o.get(),v=d(y,p);return{index:m,distance:v}}function f(m,p){const y=o.get()+m,{index:v,distance:b}=c(y),_=!e&&i(y);if(!p||_)return{index:v,distance:m};const C=t[v]-b,N=m+d(C,0);return{index:v,distance:N}}return{byDistance:f,byIndex:u,shortcut:d}}function Tte(e,t,n,r,o,i,s){function a(u){const f=u.distance,h=u.index!==t.get();i.add(f),f&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),h&&(n.set(t.get()),t.set(u.index),s.emit("select"))}function l(u,f){const h=o.byDistance(u,f);a(h)}function c(u,f){const h=t.clone().set(u),m=o.byIndex(h.get(),f);a(m)}return{distance:l,index:c}}function Dte(e,t,n,r,o,i,s,a){const l={passive:!0,capture:!0};let c=0;function d(h){if(!a)return;function m(p){if(new Date().getTime()-c>10)return;s.emit("slideFocusStart"),e.scrollLeft=0;const b=n.findIndex(_=>_.includes(p));Sv(b)&&(o.useDuration(0),r.index(b,0),s.emit("slideFocus"))}i.add(document,"keydown",u,!1),t.forEach((p,y)=>{i.add(p,"focus",v=>{(Jf(a)||a(h,v))&&m(y)},l)})}function u(h){h.code==="Tab"&&(c=new Date().getTime())}return{init:d}}function Tc(e){let t=e;function n(){return t}function r(l){t=s(l)}function o(l){t+=s(l)}function i(l){t-=s(l)}function s(l){return Sv(l)?l:l.get()}return{get:n,set:r,add:o,subtract:i}}function UI(e,t){const n=e.scroll==="x"?s:a,r=t.style;let o=null,i=!1;function s(f){return`translate3d(${f}px,0px,0px)`}function a(f){return`translate3d(0px,${f}px,0px)`}function l(f){if(i)return;const h=fte(e.direction(f));h!==o&&(r.transform=n(h),o=h)}function c(f){i=!f}function d(){i||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:d,to:l,toggleActive:c}}function Mte(e,t,n,r,o,i,s,a,l){const d=Nc(o),u=Nc(o).reverse(),f=v().concat(b());function h(R,D){return R.reduce((k,F)=>k-o[F],D)}function m(R,D){return R.reduce((k,F)=>h(k,D)>0?k.concat([F]):k,[])}function p(R){return i.map((D,k)=>({start:D-r[k]+.5+R,end:D+t-.5+R}))}function y(R,D,k){const F=p(D);return R.map(W=>{const B=k?0:-n,T=k?n:0,Q=k?"end":"start",K=F[W][Q];return{index:W,loopPoint:K,slideLocation:Tc(-1),translate:UI(e,l[W]),target:()=>a.get()>K?B:T}})}function v(){const R=s[0],D=m(u,R);return y(D,n,!1)}function b(){const R=t-s[0]-1,D=m(d,R);return y(D,-n,!0)}function _(){return f.every(({index:R})=>{const D=d.filter(k=>k!==R);return h(D,t)<=.1})}function C(){f.forEach(R=>{const{target:D,translate:k,slideLocation:F}=R,W=D();W!==F.get()&&(k.to(W),F.set(W))})}function N(){f.forEach(R=>R.translate.clear())}return{canLoop:_,clear:N,loop:C,loopPoints:f}}function Ite(e,t,n){let r,o=!1;function i(l){if(!n)return;function c(d){for(const u of d)if(u.type==="childList"){l.reInit(),t.emit("slidesChanged");break}}r=new MutationObserver(d=>{o||(Jf(n)||n(l,d))&&c(d)}),r.observe(e,{childList:!0})}function s(){r&&r.disconnect(),o=!0}return{init:i,destroy:s}}function Ote(e,t,n,r){const o={};let i=null,s=null,a,l=!1;function c(){a=new IntersectionObserver(m=>{l||(m.forEach(p=>{const y=t.indexOf(p.target);o[y]=p}),i=null,s=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(m=>a.observe(m))}function d(){a&&a.disconnect(),l=!0}function u(m){return Pc(o).reduce((p,y)=>{const v=parseInt(y),{isIntersecting:b}=o[v];return(m&&b||!m&&!b)&&p.push(v),p},[])}function f(m=!0){if(m&&i)return i;if(!m&&s)return s;const p=u(m);return m&&(i=p),m||(s=p),p}return{init:c,destroy:d,get:f}}function kte(e,t,n,r,o,i){const{measureSize:s,startEdge:a,endEdge:l}=e,c=n[0]&&o,d=m(),u=p(),f=n.map(s),h=y();function m(){if(!c)return 0;const b=n[0];return Ut(t[a]-b[a])}function p(){if(!c)return 0;const b=i.getComputedStyle(qr(r));return parseFloat(b.getPropertyValue(`margin-${l}`))}function y(){return n.map((b,_,C)=>{const N=!_,A=Cv(C,_);return N?f[_]+d:A?f[_]+u:C[_+1][a]-b[a]}).map(Ut)}return{slideSizes:f,slideSizesWithGaps:h,startGap:d,endGap:u}}function Lte(e,t,n,r,o,i,s,a,l){const{startEdge:c,endEdge:d,direction:u}=e,f=Sv(n);function h(v,b){return Nc(v).filter(_=>_%b===0).map(_=>v.slice(_,_+b))}function m(v){return v.length?Nc(v).reduce((b,_,C)=>{const N=qr(b)||0,A=N===0,R=_===Rc(v),D=o[c]-i[N][c],k=o[c]-i[_][d],F=!r&&A?u(s):0,W=!r&&R?u(a):0,B=Ut(k-W-(D+F));return C&&B>t+l&&b.push(_),R&&b.push(v.length),b},[]).map((b,_,C)=>{const N=Math.max(C[_-1]||0);return v.slice(N,b)}):[]}function p(v){return f?h(v,n):m(v)}return{groupSlides:p}}function jte(e,t,n,r,o,i,s){const{align:a,axis:l,direction:c,startIndex:d,loop:u,duration:f,dragFree:h,dragThreshold:m,inViewThreshold:p,slidesToScroll:y,skipSnaps:v,containScroll:b,watchResize:_,watchSlides:C,watchDrag:N,watchFocus:A}=i,R=2,D=wte(),k=D.measure(t),F=n.map(D.measure),W=mte(l,c),B=W.measureSize(k),T=vte(B),Q=hte(a,B),K=!u&&!!b,Y=u||!!b,{slideSizes:ee,slideSizesWithGaps:G,startGap:re,endGap:X}=kte(W,k,F,n,Y,o),J=Lte(W,B,y,u,k,F,re,X,R),{snaps:se,snapsAligned:L}=Rte(W,Q,k,F,J),ne=-qr(se)+qr(G),{snapsContained:fe,scrollContainLimit:H}=xte(B,ne,L,b,R),ae=K?fe:L,{limit:V}=Ete(ne,ae,u),de=VI(Rc(ae),d,u),ge=de.clone(),pe=Nc(n),oe=({dragHandler:I,scrollBody:U,scrollBounds:ie,options:{loop:Z}})=>{Z||ie.constrain(I.pointerDown()),U.seek()},$=({scrollBody:I,translate:U,location:ie,offsetLocation:Z,previousLocation:Re,scrollLooper:ct,slideLooper:ft,dragHandler:yt,animation:et,eventHandler:Ie,scrollBounds:at,options:{loop:lt}},qe)=>{const Me=I.settled(),ot=!at.shouldConstrain(),Je=lt?Me:Me&&ot;Je&&!yt.pointerDown()&&(et.stop(),Ie.emit("settle")),Je||Ie.emit("scroll");const xt=ie.get()*qe+Re.get()*(1-qe);Z.set(xt),lt&&(ct.loop(I.direction()),ft.loop()),U.to(Z.get())},j=pte(r,o,()=>oe(E),I=>$(E,I)),le=.68,ve=ae[de.get()],we=Tc(ve),M=Tc(ve),q=Tc(ve),te=Tc(ve),Se=_te(we,q,M,te,f,le),ue=Ate(u,ae,ne,V,te),ye=Tte(j,de,ge,Se,ue,te,s),xe=Nte(V),Ae=Ac(),Ze=Ote(t,n,s,p),{slideRegistry:P}=Pte(K,b,ae,H,J,pe),S=Dte(e,n,P,ye,Se,Ae,s,A),E={ownerDocument:r,ownerWindow:o,eventHandler:s,containerRect:k,slideRects:F,animation:j,axis:W,dragHandler:gte(W,e,r,o,te,yte(W,o),we,j,ye,Se,ue,de,s,T,h,m,v,le,N),eventStore:Ae,percentOfView:T,index:de,indexPrevious:ge,limit:V,location:we,offsetLocation:q,previousLocation:M,options:i,resizeHandler:bte(t,s,o,n,W,_,D),scrollBody:Se,scrollBounds:Ste(V,q,te,Se,T),scrollLooper:Cte(ne,V,q,[we,q,M,te]),scrollProgress:xe,scrollSnapList:ae.map(xe.get),scrollSnaps:ae,scrollTarget:ue,scrollTo:ye,slideLooper:Mte(W,B,ne,ee,G,se,ae,q,n),slideFocus:S,slidesHandler:Ite(t,s,C),slidesInView:Ze,slideIndexes:pe,slideRegistry:P,slidesToScroll:J,target:te,translate:UI(W,t)};return E}function Fte(){let e={},t;function n(c){t=c}function r(c){return e[c]||[]}function o(c){return r(c).forEach(d=>d(t,c)),l}function i(c,d){return e[c]=r(c).concat([d]),l}function s(c,d){return e[c]=r(c).filter(u=>u!==d),l}function a(){e={}}const l={init:n,emit:o,off:s,on:i,clear:a};return l}const $te={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function zte(e){function t(i,s){return WI(i,s||{})}function n(i){const s=i.breakpoints||{},a=Pc(s).filter(l=>e.matchMedia(l).matches).map(l=>s[l]).reduce((l,c)=>t(l,c),{});return t(i,a)}function r(i){return i.map(s=>Pc(s.breakpoints||{})).reduce((s,a)=>s.concat(a),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function Bte(e){let t=[];function n(i,s){return t=s.filter(({options:a})=>e.optionsAtMedia(a).active!==!1),t.forEach(a=>a.init(i,e)),s.reduce((a,l)=>Object.assign(a,{[l.name]:l}),{})}function r(){t=t.filter(i=>i.destroy())}return{init:n,destroy:r}}function Qf(e,t,n){const r=e.ownerDocument,o=r.defaultView,i=zte(o),s=Bte(i),a=Ac(),l=Fte(),{mergeOptions:c,optionsAtMedia:d,optionsMediaQueries:u}=i,{on:f,off:h,emit:m}=l,p=W;let y=!1,v,b=c($te,Qf.globalOptions),_=c(b),C=[],N,A,R;function D(){const{container:pe,slides:oe}=_;A=(xv(pe)?e.querySelector(pe):pe)||e.children[0];const j=xv(oe)?A.querySelectorAll(oe):oe;R=[].slice.call(j||A.children)}function k(pe){const oe=jte(e,A,R,r,o,pe,l);if(pe.loop&&!oe.slideLooper.canLoop()){const $=Object.assign({},pe,{loop:!1});return k($)}return oe}function F(pe,oe){y||(b=c(b,pe),_=d(b),C=oe||C,D(),v=k(_),u([b,...C.map(({options:$})=>$)]).forEach($=>a.add($,"change",W)),_.active&&(v.translate.to(v.location.get()),v.animation.init(),v.slidesInView.init(),v.slideFocus.init(ge),v.eventHandler.init(ge),v.resizeHandler.init(ge),v.slidesHandler.init(ge),v.options.loop&&v.slideLooper.loop(),A.offsetParent&&R.length&&v.dragHandler.init(ge),N=s.init(ge,C)))}function W(pe,oe){const $=J();B(),F(c({startIndex:$},pe),oe),l.emit("reInit")}function B(){v.dragHandler.destroy(),v.eventStore.clear(),v.translate.clear(),v.slideLooper.clear(),v.resizeHandler.destroy(),v.slidesHandler.destroy(),v.slidesInView.destroy(),v.animation.destroy(),s.destroy(),a.clear()}function T(){y||(y=!0,a.clear(),B(),l.emit("destroy"),l.clear())}function Q(pe,oe,$){!_.active||y||(v.scrollBody.useBaseFriction().useDuration(oe===!0?0:_.duration),v.scrollTo.index(pe,$||0))}function K(pe){const oe=v.index.add(1).get();Q(oe,pe,-1)}function Y(pe){const oe=v.index.add(-1).get();Q(oe,pe,1)}function ee(){return v.index.add(1).get()!==J()}function G(){return v.index.add(-1).get()!==J()}function re(){return v.scrollSnapList}function X(){return v.scrollProgress.get(v.location.get())}function J(){return v.index.get()}function se(){return v.indexPrevious.get()}function L(){return v.slidesInView.get()}function ne(){return v.slidesInView.get(!1)}function fe(){return N}function H(){return v}function ae(){return e}function V(){return A}function de(){return R}const ge={canScrollNext:ee,canScrollPrev:G,containerNode:V,internalEngine:H,destroy:T,off:h,on:f,emit:m,plugins:fe,previousScrollSnap:se,reInit:p,rootNode:ae,scrollNext:K,scrollPrev:Y,scrollProgress:X,scrollSnapList:re,scrollTo:Q,selectedScrollSnap:J,slideNodes:de,slidesInView:L,slidesNotInView:ne};return F(t,n),setTimeout(()=>l.emit("init"),0),ge}Qf.globalOptions=void 0;function Rv(e={},t=[]){const n=x.useRef(e),r=x.useRef(t),[o,i]=x.useState(),[s,a]=x.useState(),l=x.useCallback(()=>{o&&o.reInit(n.current,r.current)},[o]);return x.useEffect(()=>{_v(n.current,e)||(n.current=e,l())},[e,l]),x.useEffect(()=>{ute(r.current,t)||(r.current=t,l())},[t,l]),x.useEffect(()=>{if(cte()&&s){Qf.globalOptions=Rv.globalOptions;const c=Qf(s,n.current,r.current);return i(c),()=>c.destroy()}else i(void 0)},[s,i]),[a,o]}Rv.globalOptions=void 0;const HI=x.forwardRef(({orientation:e="horizontal",opts:t,setApi:n,plugins:r,className:o,children:i,...s},a)=>{const[l,c]=Rv({...t,axis:e==="horizontal"?"x":"y"},r),[d,u]=x.useState(!1),[f,h]=x.useState(!1),[m,p]=x.useState(0),y=x.useCallback(()=>{c&&(p(c.selectedScrollSnap()),u(c.canScrollPrev()),h(c.canScrollNext()))},[c]);return x.useEffect(()=>{c&&(y(),c.on("select",y),c.on("reInit",y),n&&n(c))},[c,y,n]),g.jsxs("div",{ref:a,className:ce("relative",o),...s,children:[g.jsx("div",{ref:l,className:"overflow-hidden",dir:"ltr",children:g.jsx("div",{className:ce("flex",e==="horizontal"?"-ml-4":"-mt-4 flex-col",[e==="horizontal"?"touch-pan-x":"touch-pan-y"]),children:x.Children.map(i,v=>g.jsx("div",{className:ce("min-w-0 flex-[0_0_100%]",e==="horizontal"?"pl-4":"pt-4"),children:v}))})}),g.jsxs("div",{className:"flex items-center justify-center gap-2 py-2",children:[g.jsxs(Hr,{variant:"outline",size:"icon",className:ce("h-8 w-8 rounded-full",!d&&"opacity-50"),disabled:!d,onClick:()=>c==null?void 0:c.scrollPrev(),children:[g.jsx(Vf,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Previous slide"})]}),g.jsx("div",{className:"flex gap-1",children:x.Children.map(i,(v,b)=>g.jsx(Hr,{variant:"outline",size:"icon",className:ce("h-2 w-2 rounded-full","bg-primary"),onClick:()=>c==null?void 0:c.scrollTo(b),children:g.jsxs("span",{className:"sr-only",children:["Jump to slide ",b+1]})},b))}),g.jsxs(Hr,{variant:"outline",size:"icon",className:ce("h-8 w-8 rounded-full",!f&&"opacity-50"),disabled:!f,onClick:()=>c==null?void 0:c.scrollNext(),children:[g.jsx(Ti,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Next slide"})]})]})]})});HI.displayName="Carousel";const GI=x.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,role:"list",className:ce("",e),...t}));GI.displayName="CarouselContent";const YI=x.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,role:"listitem",className:ce("",e),...t}));YI.displayName="CarouselItem";const qI=x.forwardRef(({className:e,...t},n)=>g.jsxs(Hr,{ref:n,variant:"outline",size:"icon",className:ce("absolute left-2 top-1/2 h-8 w-8 -translate-y-1/2 rounded-full",e),...t,children:[g.jsx(Vf,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Previous slide"})]}));qI.displayName="CarouselPrevious";const KI=x.forwardRef(({className:e,...t},n)=>g.jsxs(Hr,{ref:n,variant:"outline",size:"icon",className:ce("absolute right-2 top-1/2 h-8 w-8 -translate-y-1/2 rounded-full",e),...t,children:[g.jsx(Ti,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Next slide"})]}));KI.displayName="CarouselNext";const XI=x.forwardRef(({className:e,...t},n)=>g.jsx(PN,{ref:n,className:ce("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:g.jsx(T9,{className:ce("flex items-center justify-center text-current"),children:g.jsx(ja,{className:"h-4 w-4"})})}));XI.displayName=PN.displayName;const Wte=qC,Vte=Bg,JI=x.forwardRef(({children:e,...t},n)=>g.jsx(Vg,{ref:n,className:"data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down",...t,children:e}));JI.displayName="CollapsibleContent";var QI=1,Ute=.9,Hte=.8,Gte=.17,Pv=.1,Av=.999,Yte=.9999,qte=.99,Kte=/[\\\/_+.#"@\[\(\{&]/,Xte=/[\\\/_+.#"@\[\(\{&]/g,Jte=/[\s-]/,ZI=/[\s-]/g;function Tv(e,t,n,r,o,i,s){if(i===t.length)return o===e.length?QI:qte;var a=`${o},${i}`;if(s[a]!==void 0)return s[a];for(var l=r.charAt(i),c=n.indexOf(l,o),d=0,u,f,h,m;c>=0;)u=Tv(e,t,n,r,c+1,i+1,s),u>d&&(c===o?u*=QI:Kte.test(e.charAt(c-1))?(u*=Hte,h=e.slice(o,c-1).match(Xte),h&&o>0&&(u*=Math.pow(Av,h.length))):Jte.test(e.charAt(c-1))?(u*=Ute,m=e.slice(o,c-1).match(ZI),m&&o>0&&(u*=Math.pow(Av,m.length))):(u*=Gte,o>0&&(u*=Math.pow(Av,c-o))),e.charAt(c)!==t.charAt(i)&&(u*=Yte)),(u<Pv&&n.charAt(c-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(c-1)!==r.charAt(i))&&(f=Tv(e,t,n,r,c+1,i+2,s),f*Pv>u&&(u=f*Pv)),u>d&&(d=u),c=n.indexOf(l,c+1);return s[a]=d,d}function eO(e){return e.toLowerCase().replace(ZI," ")}function Qte(e,t){return Tv(e,t,eO(e),eO(t),0,0,{})}function mn(){return mn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mn.apply(null,arguments)}function Es(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 Zte(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function tO(...e){return t=>e.forEach(n=>Zte(n,t))}function Dc(...e){return x.useCallback(tO(...e),e)}function ene(e,t=[]){let n=[];function r(i,s){const a=x.createContext(s),l=n.length;n=[...n,s];function c(u){const{scope:f,children:h,...m}=u,p=(f==null?void 0:f[e][l])||a,y=x.useMemo(()=>m,Object.values(m));return x.createElement(p.Provider,{value:y},h)}function d(u,f){const h=(f==null?void 0:f[e][l])||a,m=x.useContext(h);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${u}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,d]}const o=()=>{const i=n.map(s=>x.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return x.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,tne(o,...t)]}function tne(...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(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const u=l(i)[`__scope${c}`];return{...a,...u}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}const Dv=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},nne=w.useId||(()=>{});let rne=0;function Mv(e){const[t,n]=w.useState(nne());return Dv(()=>{e||n(r=>r??String(rne++))},[e]),e||(t?`radix-${t}`:"")}function Cs(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function one({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=ine({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Cs(n),l=x.useCallback(c=>{if(i){const u=typeof c=="function"?c(e):c;u!==e&&a(u)}else o(c)},[i,e,o,a]);return[s,l]}function ine({defaultProp:e,onChange:t}){const n=x.useState(e),[r]=n,o=x.useRef(r),i=Cs(t);return x.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const Iv=x.forwardRef((e,t)=>{const{children:n,...r}=e,o=x.Children.toArray(n),i=o.find(ane);if(i){const s=i.props.children,a=o.map(l=>l===i?x.Children.count(s)>1?x.Children.only(null):x.isValidElement(s)?s.props.children:null:l);return x.createElement(Ov,mn({},r,{ref:t}),x.isValidElement(s)?x.cloneElement(s,void 0,a):null)}return x.createElement(Ov,mn({},r,{ref:t}),n)});Iv.displayName="Slot";const Ov=x.forwardRef((e,t)=>{const{children:n,...r}=e;return x.isValidElement(n)?x.cloneElement(n,{...lne(r,n.props),ref:tO(t,n.ref)}):x.Children.count(n)>1?x.Children.only(null):null});Ov.displayName="SlotClone";const sne=({children:e})=>x.createElement(x.Fragment,null,e);function ane(e){return x.isValidElement(e)&&e.type===sne}function lne(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?n[r]=(...a)=>{i==null||i(...a),o==null||o(...a)}:r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const Ns=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=x.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?Iv:t;return x.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),x.createElement(a,mn({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function cne(e,t){e&&Zr.flushSync(()=>e.dispatchEvent(t))}function une(e){const t=Cs(e);x.useEffect(()=>{const n=r=>{r.key==="Escape"&&t(r)};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t])}const kv="dismissableLayer.update",dne="dismissableLayer.pointerDownOutside",fne="dismissableLayer.focusOutside";let nO;const hne=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),pne=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=x.useContext(hne),[d,u]=x.useState(null),[,f]=x.useState({}),h=Dc(t,A=>u(A)),m=Array.from(c.layers),[p]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(p),v=d?m.indexOf(d):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,_=v>=y,C=mne(A=>{const R=A.target,D=[...c.branches].some(k=>k.contains(R));!_||D||(o==null||o(A),s==null||s(A),A.defaultPrevented||a==null||a())}),N=gne(A=>{const R=A.target;[...c.branches].some(k=>k.contains(R))||(i==null||i(A),s==null||s(A),A.defaultPrevented||a==null||a())});return une(A=>{v===c.layers.size-1&&(r==null||r(A),!A.defaultPrevented&&a&&(A.preventDefault(),a()))}),x.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(nO=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),rO(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(document.body.style.pointerEvents=nO)}},[d,n,c]),x.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),rO())},[d,c]),x.useEffect(()=>{const A=()=>f({});return document.addEventListener(kv,A),()=>document.removeEventListener(kv,A)},[]),x.createElement(Ns.div,mn({},l,{ref:h,style:{pointerEvents:b?_?"auto":"none":void 0,...e.style},onFocusCapture:Es(e.onFocusCapture,N.onFocusCapture),onBlurCapture:Es(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:Es(e.onPointerDownCapture,C.onPointerDownCapture)}))});function mne(e){const t=Cs(e),n=x.useRef(!1),r=x.useRef(()=>{});return x.useEffect(()=>{const o=s=>{if(s.target&&!n.current){let l=function(){oO(dne,t,a,{discrete:!0})};const a={originalEvent:s};s.pointerType==="touch"?(document.removeEventListener("click",r.current),r.current=l,document.addEventListener("click",r.current,{once:!0})):l()}n.current=!1},i=window.setTimeout(()=>{document.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),document.removeEventListener("pointerdown",o),document.removeEventListener("click",r.current)}},[t]),{onPointerDownCapture:()=>n.current=!0}}function gne(e){const t=Cs(e),n=x.useRef(!1);return x.useEffect(()=>{const r=o=>{o.target&&!n.current&&oO(fne,t,{originalEvent:o},{discrete:!1})};return document.addEventListener("focusin",r),()=>document.removeEventListener("focusin",r)},[t]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function rO(){const e=new CustomEvent(kv);document.dispatchEvent(e)}function oO(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?cne(o,i):o.dispatchEvent(i)}const Lv="focusScope.autoFocusOnMount",jv="focusScope.autoFocusOnUnmount",iO={bubbles:!1,cancelable:!0},yne=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=x.useState(null),c=Cs(o),d=Cs(i),u=x.useRef(null),f=Dc(t,p=>l(p)),h=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let p=function(v){if(h.paused||!a)return;const b=v.target;a.contains(b)?u.current=b:Rs(u.current,{select:!0})},y=function(v){h.paused||!a||a.contains(v.relatedTarget)||Rs(u.current,{select:!0})};return document.addEventListener("focusin",p),document.addEventListener("focusout",y),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",y)}}},[r,a,h.paused]),x.useEffect(()=>{if(a){lO.add(h);const p=document.activeElement;if(!a.contains(p)){const v=new CustomEvent(Lv,iO);a.addEventListener(Lv,c),a.dispatchEvent(v),v.defaultPrevented||(wne(xne(sO(a)),{select:!0}),document.activeElement===p&&Rs(a))}return()=>{a.removeEventListener(Lv,c),setTimeout(()=>{const v=new CustomEvent(jv,iO);a.addEventListener(jv,d),a.dispatchEvent(v),v.defaultPrevented||Rs(p??document.body,{select:!0}),a.removeEventListener(jv,d),lO.remove(h)},0)}}},[a,c,d,h]);const m=x.useCallback(p=>{if(!n&&!r||h.paused)return;const y=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,v=document.activeElement;if(y&&v){const b=p.currentTarget,[_,C]=vne(b);_&&C?!p.shiftKey&&v===C?(p.preventDefault(),n&&Rs(_,{select:!0})):p.shiftKey&&v===_&&(p.preventDefault(),n&&Rs(C,{select:!0})):v===b&&p.preventDefault()}},[n,r,h.paused]);return x.createElement(Ns.div,mn({tabIndex:-1},s,{ref:f,onKeyDown:m}))});function wne(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Rs(r,{select:t}),document.activeElement!==n)return}function vne(e){const t=sO(e),n=aO(t,e),r=aO(t.reverse(),e);return[n,r]}function sO(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 aO(e,t){for(const n of e)if(!bne(n,{upTo:t}))return n}function bne(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 _ne(e){return e instanceof HTMLInputElement&&"select"in e}function Rs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&_ne(e)&&t&&e.select()}}const lO=Sne();function Sne(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=cO(e,t),e.unshift(t)},remove(t){var n;e=cO(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function cO(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function xne(e){return e.filter(t=>t.tagName!=="A")}const Ene=x.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?Zr.createPortal(x.createElement(Ns.div,mn({},o,{ref:t})),r):null});function Cne(e,t){return x.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Zf=e=>{const{present:t,children:n}=e,r=Nne(t),o=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),i=Dc(r.ref,o.ref);return typeof n=="function"||r.isPresent?x.cloneElement(o,{ref:i}):null};Zf.displayName="Presence";function Nne(e){const[t,n]=x.useState(),r=x.useRef({}),o=x.useRef(e),i=x.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Cne(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const c=eh(r.current);i.current=a==="mounted"?c:"none"},[a]),Dv(()=>{const c=r.current,d=o.current;if(d!==e){const f=i.current,h=eh(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&f!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Dv(()=>{if(t){const c=u=>{const h=eh(r.current).includes(u.animationName);u.target===t&&h&&Zr.flushSync(()=>l("ANIMATION_END"))},d=u=>{u.target===t&&(i.current=eh(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:x.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function eh(e){return(e==null?void 0:e.animationName)||"none"}let Fv=0;function Rne(){x.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:uO()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:uO()),Fv++,()=>{Fv===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Fv--}},[])}function uO(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var dO=v1(),$v=function(){},th=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:$v,onWheelCapture:$v,onTouchMoveCapture:$v}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,d=e.enabled,u=e.shards,f=e.sideCar,h=e.noIsolation,m=e.inert,p=e.allowPinchZoom,y=e.as,v=y===void 0?"div":y,b=Zg(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),_=f,C=w1([n,t]),N=Tn(Tn({},b),o);return w.createElement(w.Fragment,null,d&&w.createElement(_,{sideCar:dO,removeScrollBar:c,shards:u,noIsolation:h,inert:m,setCallbacks:i,allowPinchZoom:!!p,lockRef:n}),s?w.cloneElement(w.Children.only(a),Tn(Tn({},N),{ref:C})):w.createElement(v,Tn({},N,{className:l,ref:C}),a))});th.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},th.classNames={fullWidth:Xl,zeroRight:Kl};var zv=!1;if(typeof window<"u")try{var nh=Object.defineProperty({},"passive",{get:function(){return zv=!0,!0}});window.addEventListener("test",nh,nh),window.removeEventListener("test",nh,nh)}catch{zv=!1}var Va=zv?{passive:!1}:!1,Pne=function(e){var t=window.getComputedStyle(e);return t.overflowY!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowY==="visible")},Ane=function(e){var t=window.getComputedStyle(e);return t.overflowX!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowX==="visible")},fO=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=hO(e,n);if(r){var o=pO(e,n),i=o[1],s=o[2];if(i>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},Tne=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Dne=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},hO=function(e,t){return e==="v"?Pne(t):Ane(t)},pO=function(e,t){return e==="v"?Tne(t):Dne(t)},Mne=function(e,t){return e==="h"&&t==="rtl"?-1:1},Ine=function(e,t,n,r,o){var i=Mne(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,d=s>0,u=0,f=0;do{var h=pO(e,a),m=h[0],p=h[1],y=h[2],v=p-y-i*m;(m||v)&&hO(e,a)&&(u+=v,f+=m),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&u===0||!d&&f===0)&&(c=!0),c},rh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},mO=function(e){return[e.deltaX,e.deltaY]},gO=function(e){return e&&"current"in e?e.current:e},One=function(e,t){return e[0]===t[0]&&e[1]===t[1]},kne=function(e){return`
|
|
335
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
336
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
337
|
+
`)},Lne=0,Ua=[];function jne(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),o=w.useState(Lne++)[0],i=w.useState(function(){return ny()})[0],s=w.useRef(e);w.useEffect(function(){s.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=g1([e.lockRef.current],(e.shards||[]).map(gO),!0).filter(Boolean);return p.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=w.useCallback(function(p,y){if("touches"in p&&p.touches.length===2)return!s.current.allowPinchZoom;var v=rh(p),b=n.current,_="deltaX"in p?p.deltaX:b[0]-v[0],C="deltaY"in p?p.deltaY:b[1]-v[1],N,A=p.target,R=Math.abs(_)>Math.abs(C)?"h":"v";if("touches"in p&&R==="h"&&A.type==="range")return!1;var D=fO(R,A);if(!D)return!0;if(D?N=R:(N=R==="v"?"h":"v",D=fO(R,A)),!D)return!1;if(!r.current&&"changedTouches"in p&&(_||C)&&(r.current=N),!N)return!0;var k=r.current||N;return Ine(k,y,p,k==="h"?_:C)},[]),l=w.useCallback(function(p){var y=p;if(!(!Ua.length||Ua[Ua.length-1]!==i)){var v="deltaY"in y?mO(y):rh(y),b=t.current.filter(function(N){return N.name===y.type&&N.target===y.target&&One(N.delta,v)})[0];if(b&&b.should){y.preventDefault();return}if(!b){var _=(s.current.shards||[]).map(gO).filter(Boolean).filter(function(N){return N.contains(y.target)}),C=_.length>0?a(y,_[0]):!s.current.noIsolation;C&&y.preventDefault()}}},[]),c=w.useCallback(function(p,y,v,b){var _={name:p,delta:y,target:v,should:b};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(C){return C!==_})},1)},[]),d=w.useCallback(function(p){n.current=rh(p),r.current=void 0},[]),u=w.useCallback(function(p){c(p.type,mO(p),p.target,a(p,e.lockRef.current))},[]),f=w.useCallback(function(p){c(p.type,rh(p),p.target,a(p,e.lockRef.current))},[]);w.useEffect(function(){return Ua.push(i),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Va),document.addEventListener("touchmove",l,Va),document.addEventListener("touchstart",d,Va),function(){Ua=Ua.filter(function(p){return p!==i}),document.removeEventListener("wheel",l,Va),document.removeEventListener("touchmove",l,Va),document.removeEventListener("touchstart",d,Va)}},[]);var h=e.removeScrollBar,m=e.inert;return w.createElement(w.Fragment,null,m?w.createElement(i,{styles:kne(o)}):null,h?w.createElement(E1,{gapMode:"margin"}):null)}const Fne=_1(dO,jne);var yO=w.forwardRef(function(e,t){return w.createElement(th,Tn({},e,{ref:t,sideCar:Fne}))});yO.classNames=th.classNames;const wO="Dialog",[vO,Uae]=ene(wO),[$ne,No]=vO(wO),zne=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=x.useRef(null),l=x.useRef(null),[c=!1,d]=one({prop:r,defaultProp:o,onChange:i});return x.createElement($ne,{scope:t,triggerRef:a,contentRef:l,contentId:Mv(),titleId:Mv(),descriptionId:Mv(),open:c,onOpenChange:d,onOpenToggle:x.useCallback(()=>d(u=>!u),[d]),modal:s},n)},bO="DialogPortal",[Bne,_O]=vO(bO,{forceMount:void 0}),Wne=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=No(bO,t);return x.createElement(Bne,{scope:t,forceMount:n},x.Children.map(r,s=>x.createElement(Zf,{present:n||i.open},x.createElement(Ene,{asChild:!0,container:o},s))))},Bv="DialogOverlay",Vne=x.forwardRef((e,t)=>{const n=_O(Bv,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=No(Bv,e.__scopeDialog);return i.modal?x.createElement(Zf,{present:r||i.open},x.createElement(Une,mn({},o,{ref:t}))):null}),Une=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=No(Bv,n);return x.createElement(yO,{as:Iv,allowPinchZoom:!0,shards:[o.contentRef]},x.createElement(Ns.div,mn({"data-state":RO(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),Ha="DialogContent",SO=x.forwardRef((e,t)=>{const n=_O(Ha,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=No(Ha,e.__scopeDialog);return x.createElement(Zf,{present:r||i.open},i.modal?x.createElement(Hne,mn({},o,{ref:t})):x.createElement(Gne,mn({},o,{ref:t})))}),Hne=x.forwardRef((e,t)=>{const n=No(Ha,e.__scopeDialog),r=x.useRef(null),o=Dc(t,n.contentRef,r);return x.useEffect(()=>{const i=r.current;if(i)return Ql(i)},[]),x.createElement(xO,mn({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Es(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:Es(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:Es(e.onFocusOutside,i=>i.preventDefault())}))}),Gne=x.forwardRef((e,t)=>{const n=No(Ha,e.__scopeDialog),r=x.useRef(!1);return x.createElement(xO,mn({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i;if((i=e.onCloseAutoFocus)===null||i===void 0||i.call(e,o),!o.defaultPrevented){var s;r.current||(s=n.triggerRef.current)===null||s===void 0||s.focus(),o.preventDefault()}r.current=!1},onInteractOutside:o=>{var i,s;(i=e.onInteractOutside)===null||i===void 0||i.call(e,o),o.defaultPrevented||(r.current=!0);const a=o.target;((s=n.triggerRef.current)===null||s===void 0?void 0:s.contains(a))&&o.preventDefault()}}))}),xO=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=No(Ha,n),l=x.useRef(null),c=Dc(t,l);return Rne(),x.createElement(x.Fragment,null,x.createElement(yne,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},x.createElement(pne,mn({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":RO(a.open)},s,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),EO="DialogTitle",Yne=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=No(EO,n);return x.createElement(Ns.h2,mn({id:o.titleId},r,{ref:t}))}),CO="DialogDescription",qne=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=No(CO,n);return x.createElement(Ns.p,mn({id:o.descriptionId},r,{ref:t}))}),NO="DialogClose",Kne=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=No(NO,n);return x.createElement(Ns.button,mn({type:"button"},r,{ref:t,onClick:Es(e.onClick,()=>o.onOpenChange(!1))}))});function RO(e){return e?"open":"closed"}const Xne=zne,Jne=Wne,Qne=Vne,Zne=SO;var ere='[cmdk-list-sizer=""]',Mc='[cmdk-group=""]',Wv='[cmdk-group-items=""]',tre='[cmdk-group-heading=""]',Vv='[cmdk-item=""]',PO=`${Vv}:not([aria-disabled="true"])`,Uv="cmdk-item-select",Jo="data-value",nre=(e,t)=>Qte(e,t),AO=w.createContext(void 0),Ic=()=>w.useContext(AO),TO=w.createContext(void 0),Hv=()=>w.useContext(TO),DO=w.createContext(void 0),MO=w.forwardRef((e,t)=>{let n=w.useRef(null),r=Ya(()=>{var X,J,se;return{search:"",value:(se=(J=e.value)!=null?J:(X=e.defaultValue)==null?void 0:X.toLowerCase())!=null?se:"",filtered:{count:0,items:new Map,groups:new Set}}}),o=Ya(()=>new Set),i=Ya(()=>new Map),s=Ya(()=>new Map),a=Ya(()=>new Set),l=IO(e),{label:c,children:d,value:u,onValueChange:f,filter:h,shouldFilter:m,vimBindings:p=!0,...y}=e,v=w.useId(),b=w.useId(),_=w.useId(),C=hre();Ga(()=>{if(u!==void 0){let X=u.trim().toLowerCase();r.current.value=X,C(6,W),N.emit()}},[u]);let N=w.useMemo(()=>({subscribe:X=>(a.current.add(X),()=>a.current.delete(X)),snapshot:()=>r.current,setState:(X,J,se)=>{var L,ne,fe;if(!Object.is(r.current[X],J)){if(r.current[X]=J,X==="search")F(),D(),C(1,k);else if(X==="value")if(((L=l.current)==null?void 0:L.value)!==void 0){let H=J??"";(fe=(ne=l.current).onValueChange)==null||fe.call(ne,H);return}else se||C(5,W);N.emit()}},emit:()=>{a.current.forEach(X=>X())}}),[]),A=w.useMemo(()=>({value:(X,J)=>{J!==s.current.get(X)&&(s.current.set(X,J),r.current.filtered.items.set(X,R(J)),C(2,()=>{D(),N.emit()}))},item:(X,J)=>(o.current.add(X),J&&(i.current.has(J)?i.current.get(J).add(X):i.current.set(J,new Set([X]))),C(3,()=>{F(),D(),r.current.value||k(),N.emit()}),()=>{s.current.delete(X),o.current.delete(X),r.current.filtered.items.delete(X);let se=B();C(4,()=>{F(),(se==null?void 0:se.getAttribute("id"))===X&&k(),N.emit()})}),group:X=>(i.current.has(X)||i.current.set(X,new Set),()=>{s.current.delete(X),i.current.delete(X)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],commandRef:n,listId:v,inputId:_,labelId:b}),[]);function R(X){var J,se;let L=(se=(J=l.current)==null?void 0:J.filter)!=null?se:nre;return X?L(X,r.current.search):0}function D(){if(!n.current||!r.current.search||l.current.shouldFilter===!1)return;let X=r.current.filtered.items,J=[];r.current.filtered.groups.forEach(L=>{let ne=i.current.get(L),fe=0;ne.forEach(H=>{let ae=X.get(H);fe=Math.max(ae,fe)}),J.push([L,fe])});let se=n.current.querySelector(ere);T().sort((L,ne)=>{var fe,H;let ae=L.getAttribute(Jo),V=ne.getAttribute(Jo);return((fe=X.get(V))!=null?fe:0)-((H=X.get(ae))!=null?H:0)}).forEach(L=>{let ne=L.closest(Wv);ne?ne.appendChild(L.parentElement===ne?L:L.closest(`${Wv} > *`)):se.appendChild(L.parentElement===se?L:L.closest(`${Wv} > *`))}),J.sort((L,ne)=>ne[1]-L[1]).forEach(L=>{let ne=n.current.querySelector(`${Mc}[${Jo}="${L[0]}"]`);ne==null||ne.parentElement.appendChild(ne)})}function k(){let X=T().find(se=>!se.ariaDisabled),J=X==null?void 0:X.getAttribute(Jo);N.setState("value",J||void 0)}function F(){if(!r.current.search||l.current.shouldFilter===!1){r.current.filtered.count=o.current.size;return}r.current.filtered.groups=new Set;let X=0;for(let J of o.current){let se=s.current.get(J),L=R(se);r.current.filtered.items.set(J,L),L>0&&X++}for(let[J,se]of i.current)for(let L of se)if(r.current.filtered.items.get(L)>0){r.current.filtered.groups.add(J);break}r.current.filtered.count=X}function W(){var X,J,se;let L=B();L&&(((X=L.parentElement)==null?void 0:X.firstChild)===L&&((se=(J=L.closest(Mc))==null?void 0:J.querySelector(tre))==null||se.scrollIntoView({block:"nearest"})),L.scrollIntoView({block:"nearest"}))}function B(){var X;return(X=n.current)==null?void 0:X.querySelector(`${Vv}[aria-selected="true"]`)}function T(){return Array.from(n.current.querySelectorAll(PO))}function Q(X){let J=T()[X];J&&N.setState("value",J.getAttribute(Jo))}function K(X){var J;let se=B(),L=T(),ne=L.findIndex(H=>H===se),fe=L[ne+X];(J=l.current)!=null&&J.loop&&(fe=ne+X<0?L[L.length-1]:ne+X===L.length?L[0]:L[ne+X]),fe&&N.setState("value",fe.getAttribute(Jo))}function Y(X){let J=B(),se=J==null?void 0:J.closest(Mc),L;for(;se&&!L;)se=X>0?dre(se,Mc):fre(se,Mc),L=se==null?void 0:se.querySelector(PO);L?N.setState("value",L.getAttribute(Jo)):K(X)}let ee=()=>Q(T().length-1),G=X=>{X.preventDefault(),X.metaKey?ee():X.altKey?Y(1):K(1)},re=X=>{X.preventDefault(),X.metaKey?Q(0):X.altKey?Y(-1):K(-1)};return w.createElement("div",{ref:Oc([n,t]),...y,"cmdk-root":"",onKeyDown:X=>{var J;if((J=y.onKeyDown)==null||J.call(y,X),!X.defaultPrevented)switch(X.key){case"n":case"j":{p&&X.ctrlKey&&G(X);break}case"ArrowDown":{G(X);break}case"p":case"k":{p&&X.ctrlKey&&re(X);break}case"ArrowUp":{re(X);break}case"Home":{X.preventDefault(),Q(0);break}case"End":{X.preventDefault(),ee();break}case"Enter":if(!X.nativeEvent.isComposing){X.preventDefault();let se=B();if(se){let L=new Event(Uv);se.dispatchEvent(L)}}}}},w.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:pre},c),w.createElement(TO.Provider,{value:N},w.createElement(AO.Provider,{value:A},d)))}),rre=w.forwardRef((e,t)=>{var n,r;let o=w.useId(),i=w.useRef(null),s=w.useContext(DO),a=Ic(),l=IO(e),c=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:s==null?void 0:s.forceMount;Ga(()=>a.item(o,s==null?void 0:s.id),[]);let d=OO(o,i,[e.value,e.children,i]),u=Hv(),f=Ps(N=>N.value&&N.value===d.current),h=Ps(N=>c||a.filter()===!1?!0:N.search?N.filtered.items.get(o)>0:!0);w.useEffect(()=>{let N=i.current;if(!(!N||e.disabled))return N.addEventListener(Uv,m),()=>N.removeEventListener(Uv,m)},[h,e.onSelect,e.disabled]);function m(){var N,A;p(),(A=(N=l.current).onSelect)==null||A.call(N,d.current)}function p(){u.setState("value",d.current,!0)}if(!h)return null;let{disabled:y,value:v,onSelect:b,forceMount:_,...C}=e;return w.createElement("div",{ref:Oc([i,t]),...C,id:o,"cmdk-item":"",role:"option","aria-disabled":y||void 0,"aria-selected":f||void 0,"data-disabled":y||void 0,"data-selected":f||void 0,onPointerMove:y?void 0:p,onClick:y?void 0:m},e.children)}),ore=w.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...i}=e,s=w.useId(),a=w.useRef(null),l=w.useRef(null),c=w.useId(),d=Ic(),u=Ps(m=>o||d.filter()===!1?!0:m.search?m.filtered.groups.has(s):!0);Ga(()=>d.group(s),[]),OO(s,a,[e.value,e.heading,l]);let f=w.useMemo(()=>({id:s,forceMount:o}),[o]),h=w.createElement(DO.Provider,{value:f},r);return w.createElement("div",{ref:Oc([a,t]),...i,"cmdk-group":"",role:"presentation",hidden:u?void 0:!0},n&&w.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),w.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},h))}),ire=w.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=w.useRef(null),i=Ps(s=>!s.search);return!n&&!i?null:w.createElement("div",{ref:Oc([o,t]),...r,"cmdk-separator":"",role:"separator"})}),sre=w.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,i=Hv(),s=Ps(d=>d.search),a=Ps(d=>d.value),l=Ic(),c=w.useMemo(()=>{var d;let u=(d=l.commandRef.current)==null?void 0:d.querySelector(`${Vv}[${Jo}="${a}"]`);return u==null?void 0:u.getAttribute("id")},[a,l.commandRef]);return w.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),w.createElement("input",{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:"text",value:o?e.value:s,onChange:d=>{o||i.setState("search",d.target.value),n==null||n(d.target.value)}})}),are=w.forwardRef((e,t)=>{let{children:n,...r}=e,o=w.useRef(null),i=w.useRef(null),s=Ic();return w.useEffect(()=>{if(i.current&&o.current){let a=i.current,l=o.current,c,d=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let u=a.offsetHeight;l.style.setProperty("--cmdk-list-height",u.toFixed(1)+"px")})});return d.observe(a),()=>{cancelAnimationFrame(c),d.unobserve(a)}}},[]),w.createElement("div",{ref:Oc([o,t]),...r,"cmdk-list":"",role:"listbox","aria-label":"Suggestions",id:s.listId,"aria-labelledby":s.inputId},w.createElement("div",{ref:i,"cmdk-list-sizer":""},n))}),lre=w.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:i,container:s,...a}=e;return w.createElement(Xne,{open:n,onOpenChange:r},w.createElement(Jne,{container:s},w.createElement(Qne,{"cmdk-overlay":"",className:o}),w.createElement(Zne,{"aria-label":e.label,"cmdk-dialog":"",className:i},w.createElement(MO,{ref:t,...a}))))}),cre=w.forwardRef((e,t)=>{let n=w.useRef(!0),r=Ps(o=>o.filtered.count===0);return w.useEffect(()=>{n.current=!1},[]),n.current||!r?null:w.createElement("div",{ref:t,...e,"cmdk-empty":"",role:"presentation"})}),ure=w.forwardRef((e,t)=>{let{progress:n,children:r,...o}=e;return w.createElement("div",{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Loading..."},w.createElement("div",{"aria-hidden":!0},r))}),Xn=Object.assign(MO,{List:are,Item:rre,Input:sre,Group:ore,Separator:ire,Dialog:lre,Empty:cre,Loading:ure});function dre(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function fre(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function IO(e){let t=w.useRef(e);return Ga(()=>{t.current=e}),t}var Ga=typeof window>"u"?w.useEffect:w.useLayoutEffect;function Ya(e){let t=w.useRef();return t.current===void 0&&(t.current=e()),t}function Oc(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Ps(e){let t=Hv(),n=()=>e(t.snapshot());return w.useSyncExternalStore(t.subscribe,n,n)}function OO(e,t,n){let r=w.useRef(),o=Ic();return Ga(()=>{var i;let s=(()=>{var a;for(let l of n){if(typeof l=="string")return l.trim().toLowerCase();if(typeof l=="object"&&"current"in l)return l.current?(a=l.current.textContent)==null?void 0:a.trim().toLowerCase():r.current}})();o.value(e,s),(i=t.current)==null||i.setAttribute(Jo,s),r.current=s}),r}var hre=()=>{let[e,t]=w.useState(),n=Ya(()=>new Map);return Ga(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}},pre={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const kO=rf,mre=of,LO=sf,gre=ba,Gv=x.forwardRef(({className:e,...t},n)=>g.jsx(ga,{ref:n,className:ce("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}));Gv.displayName=ga.displayName;const Yv=x.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(LO,{children:[g.jsx(Gv,{}),g.jsxs(ya,{ref:r,className:ce("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,g.jsxs(ba,{className:"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-foreground",children:[g.jsx(bM,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Yv.displayName=ya.displayName;const jO=({className:e,...t})=>g.jsx("div",{className:ce("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});jO.displayName="DialogHeader";const FO=({className:e,...t})=>g.jsx("div",{className:ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});FO.displayName="DialogFooter";const $O=x.forwardRef(({className:e,...t},n)=>g.jsx(wa,{ref:n,className:ce("text-lg font-semibold leading-none tracking-tight",e),...t}));$O.displayName=wa.displayName;const zO=x.forwardRef(({className:e,...t},n)=>g.jsx(va,{ref:n,className:ce("text-sm text-foreground",e),...t}));zO.displayName=va.displayName;const oh=w.forwardRef(({className:e,...t},n)=>g.jsx(Xn,{ref:n,className:ce("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));oh.displayName=Xn.displayName;const yre=({children:e,...t})=>g.jsx(kO,{...t,children:g.jsx(Yv,{className:"overflow-hidden p-0 shadow-lg",children:g.jsx(oh,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),qv=w.forwardRef(({className:e,...t},n)=>g.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[g.jsx(SJ,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),g.jsx(Xn.Input,{ref:n,className:ce("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));qv.displayName=Xn.Input.displayName;const BO=w.forwardRef(({className:e,...t},n)=>g.jsx(Xn.List,{ref:n,className:ce("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));BO.displayName=Xn.List.displayName;const Kv=w.forwardRef((e,t)=>g.jsx(Xn.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Kv.displayName=Xn.Empty.displayName;const Xv=w.forwardRef(({className:e,...t},n)=>g.jsx(Xn.Group,{ref:n,className:ce("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-foreground",e),...t}));Xv.displayName=Xn.Group.displayName;const WO=w.forwardRef(({className:e,...t},n)=>g.jsx(Xn.Separator,{ref:n,className:ce("-mx-1 h-px bg-border",e),...t}));WO.displayName=Xn.Separator.displayName;const Jv=w.forwardRef(({className:e,...t},n)=>g.jsx(Xn.Item,{ref:n,className:ce("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));Jv.displayName=Xn.Item.displayName;const VO=({className:e,...t})=>g.jsx("span",{className:ce("ml-auto text-xs tracking-widest text-foreground",e),...t});VO.displayName="CommandShortcut";const ih=d6,sh=f6,kc=x.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>g.jsx(h6,{children:g.jsx(nT,{ref:o,align:t,sideOffset:n,className:ce("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));kc.displayName=nT.displayName;function wre({options:e,value:t,onValueChange:n,placeholder:r="Select an option...",emptyText:o="No results found.",className:i}){var l;const[s,a]=x.useState(!1);return g.jsxs(ih,{open:s,onOpenChange:a,children:[g.jsx(sh,{asChild:!0,children:g.jsxs(Hr,{variant:"outline",role:"combobox","aria-expanded":s,className:ce("w-[200px] justify-between",i),children:[t?(l=e.find(c=>c.value===t))==null?void 0:l.label:r,g.jsx(bJ,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),g.jsx(kc,{className:"w-[200px] p-0",children:g.jsxs(oh,{children:[g.jsx(qv,{placeholder:r}),g.jsx(Kv,{children:o}),g.jsx(Xv,{children:e.map(c=>g.jsxs(Jv,{value:c.value,onSelect:d=>{n==null||n(d),a(!1)},children:[g.jsx(ja,{className:ce("mr-2 h-4 w-4",t===c.value?"opacity-100":"opacity-0")}),c.label]},c.value))})]})})]})}const vre=Oq,bre=kq,_re=Lq,Sre=JR,xre=Fq,Ere=jq,UO=x.forwardRef(({className:e,inset:t,children:n,...r},o)=>g.jsxs(iP,{ref:o,className:ce("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...r,children:[n,g.jsx(Ti,{className:"ml-auto h-4 w-4"})]}));UO.displayName=iP.displayName;const HO=x.forwardRef(({className:e,...t},n)=>g.jsx(sP,{ref:n,className:ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));HO.displayName=sP.displayName;const GO=x.forwardRef(({className:e,...t},n)=>g.jsx(JR,{children:g.jsx(QR,{ref:n,className:ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));GO.displayName=QR.displayName;const YO=x.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(eP,{ref:r,className:ce("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));YO.displayName=eP.displayName;const qO=x.forwardRef(({className:e,children:t,checked:n,...r},o)=>g.jsxs(tP,{ref:o,className:ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(rP,{children:g.jsx(ja,{className:"h-4 w-4"})})}),t]}));qO.displayName=tP.displayName;const KO=x.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(nP,{ref:r,className:ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(rP,{children:g.jsx(Uf,{className:"h-2 w-2 fill-current"})})}),t]}));KO.displayName=nP.displayName;const XO=x.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(ZR,{ref:r,className:ce("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...n}));XO.displayName=ZR.displayName;const JO=x.forwardRef(({className:e,...t},n)=>g.jsx(oP,{ref:n,className:ce("-mx-1 my-1 h-px bg-border",e),...t}));JO.displayName=oP.displayName;const QO=({className:e,...t})=>g.jsx("span",{className:ce("ml-auto text-xs tracking-widest text-foreground",e),...t});QO.displayName="ContextMenuShortcut";/**
|
|
338
|
+
* table-core
|
|
339
|
+
*
|
|
340
|
+
* Copyright (c) TanStack
|
|
341
|
+
*
|
|
342
|
+
* This source code is licensed under the MIT license found in the
|
|
343
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
344
|
+
*
|
|
345
|
+
* @license MIT
|
|
346
|
+
*/function Oi(e,t){return typeof e=="function"?e(t):e}function dr(e,t){return n=>{t.setState(r=>({...r,[e]:Oi(n,r[e])}))}}function ah(e){return e instanceof Function}function Cre(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Nre(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=t(i);s!=null&&s.length&&r(s)})};return r(e),n}function $e(e,t,n){let r=[],o;return i=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((d,u)=>r[u]!==d)))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 d=Math.round((Date.now()-s)*100)/100,u=Math.round((Date.now()-c)*100)/100,f=u/16,h=(m,p)=>{for(m=String(m);m.length<p;)m=" "+m;return m};console.info(`%c⏱ ${h(u,5)} /${h(d,5)} ms`,`
|
|
347
|
+
font-size: .6rem;
|
|
348
|
+
font-weight: bold;
|
|
349
|
+
color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function ze(e,t,n,r){return{debug:()=>{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:!1,onChange:r}}function Rre(e,t,n,r){const o=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:$e(()=>[e,n,t,i],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),ze(e.options,"debugCells"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}function Pre(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let c=(o=(i=a.id)!=null?i:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,d;if(a.accessorFn?d=a.accessorFn:l&&(l.includes(".")?d=f=>{let h=f;for(const p of l.split(".")){var m;h=(m=h)==null?void 0:m[p]}return h}:d=f=>f[a.accessorKey]),!c)throw new Error;let u={id:`${String(c)}`,accessorFn:d,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:$e(()=>[!0],()=>{var f;return[u,...(f=u.columns)==null?void 0:f.flatMap(h=>h.getFlatColumns())]},ze(e.options,"debugColumns")),getLeafColumns:$e(()=>[e._getOrderColumnsFn()],f=>{var h;if((h=u.columns)!=null&&h.length){let m=u.columns.flatMap(p=>p.getLeafColumns());return f(m)}return[u]},ze(e.options,"debugColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(u,e);return u}const On="debugHeaders";function ZO(e,t,n){var r;let i={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 s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(i),s},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const Are={createTable:e=>{e.getHeaderGroups=$e(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,s;const a=(i=r==null?void 0:r.map(u=>n.find(f=>f.id===u)).filter(Boolean))!=null?i:[],l=(s=o==null?void 0:o.map(u=>n.find(f=>f.id===u)).filter(Boolean))!=null?s:[],c=n.filter(u=>!(r!=null&&r.includes(u.id))&&!(o!=null&&o.includes(u.id)));return lh(t,[...a,...c,...l],e)},ze(e.options,On)),e.getCenterHeaderGroups=$e(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),lh(t,n,e,"center")),ze(e.options,On)),e.getLeftHeaderGroups=$e(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return lh(t,i,e,"left")},ze(e.options,On)),e.getRightHeaderGroups=$e(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return lh(t,i,e,"right")},ze(e.options,On)),e.getFooterGroups=$e(()=>[e.getHeaderGroups()],t=>[...t].reverse(),ze(e.options,On)),e.getLeftFooterGroups=$e(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),ze(e.options,On)),e.getCenterFooterGroups=$e(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),ze(e.options,On)),e.getRightFooterGroups=$e(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),ze(e.options,On)),e.getFlatHeaders=$e(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),ze(e.options,On)),e.getLeftFlatHeaders=$e(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),ze(e.options,On)),e.getCenterFlatHeaders=$e(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),ze(e.options,On)),e.getRightFlatHeaders=$e(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),ze(e.options,On)),e.getCenterLeafHeaders=$e(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ze(e.options,On)),e.getLeftLeafHeaders=$e(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ze(e.options,On)),e.getRightLeafHeaders=$e(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ze(e.options,On)),e.getLeafHeaders=$e(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,a,l,c;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(d=>d.getLeafHeaders()).flat()},ze(e.options,On))}};function lh(e,t,n,r){var o,i;let s=0;const a=function(f,h){h===void 0&&(h=1),s=Math.max(s,h),f.filter(m=>m.getIsVisible()).forEach(m=>{var p;(p=m.columns)!=null&&p.length&&a(m.columns,h+1)},0)};a(e);let l=[];const c=(f,h)=>{const m={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},p=[];f.forEach(y=>{const v=[...p].reverse()[0],b=y.column.depth===m.depth;let _,C=!1;if(b&&y.column.parent?_=y.column.parent:(_=y.column,C=!0),v&&(v==null?void 0:v.column)===_)v.subHeaders.push(y);else{const N=ZO(n,_,{id:[r,h,_.id,y==null?void 0:y.id].filter(Boolean).join("_"),isPlaceholder:C,placeholderId:C?`${p.filter(A=>A.column===_).length}`:void 0,depth:h,index:p.length});N.subHeaders.push(y),p.push(N)}m.headers.push(y),y.headerGroup=m}),l.push(m),h>0&&c(p,h-1)},d=t.map((f,h)=>ZO(n,f,{depth:s,index:h}));c(d,s-1),l.reverse();const u=f=>f.filter(m=>m.column.getIsVisible()).map(m=>{let p=0,y=0,v=[0];m.subHeaders&&m.subHeaders.length?(v=[],u(m.subHeaders).forEach(_=>{let{colSpan:C,rowSpan:N}=_;p+=C,v.push(N)})):p=1;const b=Math.min(...v);return y=y+b,m.colSpan=p,m.rowSpan=y,{colSpan:p,rowSpan:y}});return u((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const Qv=(e,t,n,r,o,i,s)=>{let a={id:t,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Nre(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],c=a;for(;;){const d=c.getParentRow();if(!d)break;l.push(d),c=d}return l.reverse()},getAllCells:$e(()=>[e.getAllLeafColumns()],l=>l.map(c=>Rre(e,a,c,c.id)),ze(e.options,"debugRows")),_getAllCellsByColumnId:$e(()=>[a.getAllCells()],l=>l.reduce((c,d)=>(c[d.column.id]=d,c),{}),ze(e.options,"debugRows"))};for(let l=0;l<e._features.length;l++){const c=e._features[l];c==null||c.createRow==null||c.createRow(a,e)}return a},Tre={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()}}},ek=(e,t,n)=>{var r,o;const i=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(i))};ek.autoRemove=e=>Kr(e);const tk=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};tk.autoRemove=e=>Kr(e);const nk=(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())};nk.autoRemove=e=>Kr(e);const rk=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};rk.autoRemove=e=>Kr(e);const ok=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});ok.autoRemove=e=>Kr(e)||!(e!=null&&e.length);const ik=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});ik.autoRemove=e=>Kr(e)||!(e!=null&&e.length);const sk=(e,t,n)=>e.getValue(t)===n;sk.autoRemove=e=>Kr(e);const ak=(e,t,n)=>e.getValue(t)==n;ak.autoRemove=e=>Kr(e);const Zv=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};Zv.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(o)?1/0:o;if(i>s){const a=i;i=s,s=a}return[i,s]},Zv.autoRemove=e=>Kr(e)||Kr(e[0])&&Kr(e[1]);const Qo={includesString:ek,includesStringSensitive:tk,equalsString:nk,arrIncludes:rk,arrIncludesAll:ok,arrIncludesSome:ik,equals:sk,weakEquals:ak,inNumberRange:Zv};function Kr(e){return e==null||e===""}const Dre={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:dr("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"?Qo.includesString:typeof r=="number"?Qo.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Qo.equals:Array.isArray(r)?Qo.arrIncludes:Qo.weakEquals},e.getFilterFn=()=>{var n,r;return ah(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:Qo[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(),i=r==null?void 0:r.find(d=>d.id===e.id),s=Oi(n,i?i.value:void 0);if(lk(o,s,e)){var a;return(a=r==null?void 0:r.filter(d=>d.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(i){var c;return(c=r==null?void 0:r.map(d=>d.id===e.id?l:d))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=Oi(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(lk(l,s.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 lk(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const eb={sum:(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),min:(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},max:(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},extent:(e,t,n)=>{let r,o;return n.forEach(i=>{const s=i.getValue(e);s!=null&&(r===void 0?s>=s&&(r=o=s):(r>s&&(r=s),o<s&&(o=s)))}),[r,o]},mean:(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},median:(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!Cre(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,s)=>i-s);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},Mre={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:dr("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 eb.sum;if(Object.prototype.toString.call(r)==="[object Date]")return eb.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return ah(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:eb[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 Ire(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(s=>s.id===i)).filter(Boolean),...r]}const Ore={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:dr("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=$e(n=>[Lc(t,n)],n=>n.findIndex(r=>r.id===e.id),ze(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=Lc(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=Lc(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=$e(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let i=[];if(!(t!=null&&t.length))i=o;else{const s=[...t],a=[...o];for(;a.length&&s.length;){const l=s.shift(),c=a.findIndex(d=>d.id===l);c>-1&&i.push(a.splice(c,1)[0])}i=[...i,...a]}return Ire(i,n,r)},ze(e.options,"debugTable"))}},tb=()=>({left:[],right:[]}),kre={getInitialState:e=>({columnPinning:tb(),...e}),getDefaultOptions:e=>({onColumnPinningChange:dr("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,s;if(n==="right"){var a,l;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(u=>!(r!=null&&r.includes(u))),right:[...((l=o==null?void 0:o.right)!=null?l:[]).filter(u=>!(r!=null&&r.includes(u))),...r]}}if(n==="left"){var c,d;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(u=>!(r!=null&&r.includes(u))),...r],right:((d=o==null?void 0:o.right)!=null?d:[]).filter(u=>!(r!=null&&r.includes(u)))}}return{left:((i=o==null?void 0:o.left)!=null?i:[]).filter(u=>!(r!=null&&r.includes(u))),right:((s=o==null?void 0:o.right)!=null?s:[]).filter(u=>!(r!=null&&r.includes(u)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"left":s?"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=$e(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(s=>!i.includes(s.column.id))},ze(t.options,"debugRows")),e.getLeftVisibleCells=$e(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),ze(t.options,"debugRows")),e.getRightVisibleCells=$e(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),ze(t.options,"debugRows"))},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?tb():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:tb())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=$e(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),ze(e.options,"debugColumns")),e.getRightLeafColumns=$e(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),ze(e.options,"debugColumns")),e.getCenterLeafColumns=$e(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.id))},ze(e.options,"debugColumns"))}},ch={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},nb=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Lre={getDefaultColumnDef:()=>ch,getInitialState:e=>({columnSizing:{},columnSizingInfo:nb(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:dr("columnSizing",e),onColumnSizingInfoChange:dr("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:ch.minSize,(r=i??e.columnDef.size)!=null?r:ch.size),(o=e.columnDef.maxSize)!=null?o:ch.maxSize)},e.getStart=$e(n=>[n,Lc(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),ze(t.options,"debugColumns")),e.getAfter=$e(n=>[n,Lc(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),ze(t.options,"debugColumns")),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 i;n+=(i=o.column.getSize())!=null?i: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 i=>{if(!r||!o||(i.persist==null||i.persist(),rb(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(v=>[v.column.id,v.column.getSize()]):[[r.id,r.getSize()]],l=rb(i)?Math.round(i.touches[0].clientX):i.clientX,c={},d=(v,b)=>{typeof b=="number"&&(t.setColumnSizingInfo(_=>{var C,N;const A=t.options.columnResizeDirection==="rtl"?-1:1,R=(b-((C=_==null?void 0:_.startOffset)!=null?C:0))*A,D=Math.max(R/((N=_==null?void 0:_.startSize)!=null?N:0),-.999999);return _.columnSizingStart.forEach(k=>{let[F,W]=k;c[F]=Math.round(Math.max(W+W*D,0)*100)/100}),{..._,deltaOffset:R,deltaPercentage:D}}),(t.options.columnResizeMode==="onChange"||v==="end")&&t.setColumnSizing(_=>({..._,...c})))},u=v=>d("move",v),f=v=>{d("end",v),t.setColumnSizingInfo(b=>({...b,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=n||typeof document<"u"?document:null,m={moveHandler:v=>u(v.clientX),upHandler:v=>{h==null||h.removeEventListener("mousemove",m.moveHandler),h==null||h.removeEventListener("mouseup",m.upHandler),f(v.clientX)}},p={moveHandler:v=>(v.cancelable&&(v.preventDefault(),v.stopPropagation()),u(v.touches[0].clientX),!1),upHandler:v=>{var b;h==null||h.removeEventListener("touchmove",p.moveHandler),h==null||h.removeEventListener("touchend",p.upHandler),v.cancelable&&(v.preventDefault(),v.stopPropagation()),f((b=v.touches[0])==null?void 0:b.clientX)}},y=jre()?{passive:!1}:!1;rb(i)?(h==null||h.addEventListener("touchmove",p.moveHandler,y),h==null||h.addEventListener("touchend",p.upHandler,y)):(h==null||h.addEventListener("mousemove",m.moveHandler,y),h==null||h.addEventListener("mouseup",m.upHandler,y)),t.setColumnSizingInfo(v=>({...v,startOffset:l,startSize:s,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?nb():(n=e.initialState.columnSizingInfo)!=null?n:nb())},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 uh=null;function jre(){if(typeof uh=="boolean")return uh;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 uh=e,uh}function rb(e){return e.type==="touchstart"}const Fre={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:dr("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(i=>i.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=$e(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),ze(t.options,"debugRows")),e.getVisibleCells=$e(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],ze(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>$e(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),ze(e.options,"debugColumns"));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,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.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 Lc(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const $re={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()}}},zre={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:dr("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,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Qo.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return ah(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Qo[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Bre={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:dr("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,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.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(i=>{const s=i.split(".");r=Math.max(r,s.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 i=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(o=n)!=null?o:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:a,...l}=s;return l}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()}}}},ob=0,ib=10,sb=()=>({pageIndex:ob,pageSize:ib}),Wre={getInitialState:e=>({...e,pagination:{...sb(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:dr("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=i=>Oi(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?sb():(o=e.initialState.pagination)!=null?o:sb())},e.setPageIndex=r=>{e.setPagination(o=>{let i=Oi(r,o.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?ob:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:ob)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?ib:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:ib)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,Oi(r,o.pageSize)),s=o.pageSize*o.pageIndex,a=Math.floor(s/i);return{...o,pageIndex:a,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let s=Oi(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=$e(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},ze(e.options,"debugTable")),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}}},ab=()=>({top:[],bottom:[]}),Vre={getInitialState:e=>({rowPinning:ab(),...e}),getDefaultOptions:e=>({onRowPinningChange:dr("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],s=o?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...s,e.id,...i]);t.setRowPinning(l=>{var c,d;if(n==="bottom"){var u,f;return{top:((u=l==null?void 0:l.top)!=null?u:[]).filter(p=>!(a!=null&&a.has(p))),bottom:[...((f=l==null?void 0:l.bottom)!=null?f:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)]}}if(n==="top"){var h,m;return{top:[...((h=l==null?void 0:l.top)!=null?h:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)],bottom:((m=l==null?void 0:l.bottom)!=null?m:[]).filter(p=>!(a!=null&&a.has(p)))}}return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(p=>!(a!=null&&a.has(p))),bottom:((d=l==null?void 0:l.bottom)!=null?d:[]).filter(p=>!(a!=null&&a.has(p)))}})},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,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=i==null?void 0:i.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?ab():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:ab())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>t.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},e.getTopRows=$e(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),ze(e.options,"debugRows")),e.getBottomRows=$e(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),ze(e.options,"debugRows")),e.getCenterRows=$e(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(i=>!o.has(i.id))},ze(e.options,"debugRows"))}},Ure={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:dr("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(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{lb(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=$e(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?cb(e,n):{rows:[],flatRows:[],rowsById:{}},ze(e.options,"debugTable")),e.getFilteredSelectedRowModel=$e(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?cb(e,n):{rows:[],flatRows:[],rowsById:{}},ze(e.options,"debugTable")),e.getGroupedSelectedRowModel=$e(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?cb(e,n):{rows:[],flatRows:[],rowsById:{}},ze(e.options,"debugTable")),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(i=>{var s;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const a={...i};return lb(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return ub(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return db(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return db(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)}}}},lb=(e,t,n,r,o)=>{var i;const s=o.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>lb(e,a.id,n,r,o))};function cb(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var c;const d=ub(l,n);if(d&&(r.push(l),o[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:i(l.subRows)}),d)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function ub(e,t){var n;return(n=t[e.id])!=null?n:!1}function db(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!o)&&(s.getCanSelect()&&(ub(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=db(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const fb=/([0-9]+)/gm,Hre=(e,t,n)=>ck(ki(e.getValue(n)).toLowerCase(),ki(t.getValue(n)).toLowerCase()),Gre=(e,t,n)=>ck(ki(e.getValue(n)),ki(t.getValue(n))),Yre=(e,t,n)=>hb(ki(e.getValue(n)).toLowerCase(),ki(t.getValue(n)).toLowerCase()),qre=(e,t,n)=>hb(ki(e.getValue(n)),ki(t.getValue(n))),Kre=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},Xre=(e,t,n)=>hb(e.getValue(n),t.getValue(n));function hb(e,t){return e===t?0:e>t?1:-1}function ki(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function ck(e,t){const n=e.split(fb).filter(Boolean),r=t.split(fb).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),s=parseInt(o,10),a=parseInt(i,10),l=[s,a].sort();if(isNaN(l[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const jc={alphanumeric:Hre,alphanumericCaseSensitive:Gre,text:Yre,textCaseSensitive:qre,datetime:Kre,basic:Xre},Jre=[Are,Fre,Ore,kre,Tre,Dre,$re,zre,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:dr("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 i=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return jc.datetime;if(typeof i=="string"&&(r=!0,i.split(fb).length>1))return jc.alphanumeric}return r?jc.text:jc.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 ah(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:jc[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s==null?void 0:s.find(h=>h.id===e.id),l=s==null?void 0:s.findIndex(h=>h.id===e.id);let c=[],d,u=i?n:o==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?d="toggle":d="add":s!=null&&s.length&&l!==s.length-1?d="replace":a?d="toggle":d="replace",d==="toggle"&&(i||o||(d="remove")),d==="add"){var f;c=[...s,{id:e.id,desc:u}],c.splice(0,c.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else d==="toggle"?c=s.map(h=>h.id===e.id?{...h,desc:u}:h):d==="remove"?c=s.filter(h=>h.id!==e.id):c=[{id:e.id,desc:u}];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 i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":i},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())}},Mre,Bre,Wre,Vre,Ure,Lre];function Qre(e){var t,n;const r=[...Jre,...(t=e._features)!=null?t:[]];let o={_features:r};const i=o._features.reduce((f,h)=>Object.assign(f,h.getDefaultOptions==null?void 0:h.getDefaultOptions(o)),{}),s=f=>o.options.mergeOptions?o.options.mergeOptions(i,f):{...i,...f};let l={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(f=>{var h;l=(h=f.getInitialState==null?void 0:f.getInitialState(l))!=null?h:l});const c=[];let d=!1;const u={_features:r,options:{...i,...e},initialState:l,_queue:f=>{c.push(f),d||(d=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();d=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{o.setState(o.initialState)},setOptions:f=>{const h=Oi(f,o.options);o.options=s(h)},getState:()=>o.options.state,setState:f=>{o.options.onStateChange==null||o.options.onStateChange(f)},_getRowId:(f,h,m)=>{var p;return(p=o.options.getRowId==null?void 0:o.options.getRowId(f,h,m))!=null?p:`${m?[m.id,h].join("."):h}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(f,h)=>{let m=(h?o.getPrePaginationRowModel():o.getRowModel()).rowsById[f];if(!m&&(m=o.getCoreRowModel().rowsById[f],!m))throw new Error;return m},_getDefaultColumnDef:$e(()=>[o.options.defaultColumn],f=>{var h;return f=(h=f)!=null?h:{},{header:m=>{const p=m.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:m=>{var p,y;return(p=(y=m.renderValue())==null||y.toString==null?void 0:y.toString())!=null?p:null},...o._features.reduce((m,p)=>Object.assign(m,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...f}},ze(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:$e(()=>[o._getColumnDefs()],f=>{const h=function(m,p,y){return y===void 0&&(y=0),m.map(v=>{const b=Pre(o,v,y,p),_=v;return b.columns=_.columns?h(_.columns,b,y+1):[],b})};return h(f)},ze(e,"debugColumns")),getAllFlatColumns:$e(()=>[o.getAllColumns()],f=>f.flatMap(h=>h.getFlatColumns()),ze(e,"debugColumns")),_getAllFlatColumnsById:$e(()=>[o.getAllFlatColumns()],f=>f.reduce((h,m)=>(h[m.id]=m,h),{}),ze(e,"debugColumns")),getAllLeafColumns:$e(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(f,h)=>{let m=f.flatMap(p=>p.getLeafColumns());return h(m)},ze(e,"debugColumns")),getColumn:f=>o._getAllFlatColumnsById()[f]};Object.assign(o,u);for(let f=0;f<o._features.length;f++){const h=o._features[f];h==null||h.createTable==null||h.createTable(o)}return o}function Zre(){return e=>$e(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let c=0;c<o.length;c++){const d=Qv(e,e._getRowId(o[c],c,s),o[c],c,i,void 0,s==null?void 0:s.id);if(n.flatRows.push(d),n.rowsById[d.id]=d,a.push(d),e.options.getSubRows){var l;d.originalSubRows=e.options.getSubRows(o[c],c),(l=d.originalSubRows)!=null&&l.length&&(d.subRows=r(d.originalSubRows,i+1,d))}}return a};return n.rows=r(t),n},ze(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function eoe(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function uk(e,t,n){return n.options.filterFromLeafRows?toe(e,t,n):noe(e,t,n)}function toe(e,t,n){var r;const o=[],i={},s=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(l,c){c===void 0&&(c=0);const d=[];for(let f=0;f<l.length;f++){var u;let h=l[f];const m=Qv(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);if(m.columnFilters=h.columnFilters,(u=h.subRows)!=null&&u.length&&c<s){if(m.subRows=a(h.subRows,c+1),h=m,t(h)&&!m.subRows.length){d.push(h),i[h.id]=h,o.push(h);continue}if(t(h)||m.subRows.length){d.push(h),i[h.id]=h,o.push(h);continue}}else h=m,t(h)&&(d.push(h),i[h.id]=h,o.push(h))}return d};return{rows:a(e),flatRows:o,rowsById:i}}function noe(e,t,n){var r;const o=[],i={},s=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(l,c){c===void 0&&(c=0);const d=[];for(let f=0;f<l.length;f++){let h=l[f];if(t(h)){var u;if((u=h.subRows)!=null&&u.length&&c<s){const p=Qv(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);p.subRows=a(h.subRows,c+1),h=p}d.push(h),o.push(h),i[h.id]=h}}return d};return{rows:a(e),flatRows:o,rowsById:i}}function roe(){return(e,t)=>$e(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()],(n,r,o)=>{if(!n.rows.length||!(r!=null&&r.length)&&!o)return n;const i=[...r.map(a=>a.id).filter(a=>a!==t),o?"__global__":void 0].filter(Boolean),s=a=>{for(let l=0;l<i.length;l++)if(a.columnFilters[i[l]]===!1)return!1;return!0};return uk(n.rows,s,e)},ze(e.options,"debugTable"))}function ooe(){return(e,t)=>$e(()=>{var n;return[(n=e.getColumn(t))==null?void 0:n.getFacetedRowModel()]},n=>{if(!n)return new Map;let r=new Map;for(let i=0;i<n.flatRows.length;i++){const s=n.flatRows[i].getUniqueValues(t);for(let a=0;a<s.length;a++){const l=s[a];if(r.has(l)){var o;r.set(l,((o=r.get(l))!=null?o:0)+1)}else r.set(l,1)}}return r},ze(e.options,"debugTable"))}function ioe(){return e=>$e(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let f=0;f<t.flatRows.length;f++)t.flatRows[f].columnFilters={},t.flatRows[f].columnFiltersMeta={};return t}const o=[],i=[];(n??[]).forEach(f=>{var h;const m=e.getColumn(f.id);if(!m)return;const p=m.getFilterFn();p&&o.push({id:f.id,filterFn:p,resolvedValue:(h=p.resolveFilterValue==null?void 0:p.resolveFilterValue(f.value))!=null?h:f.value})});const s=(n??[]).map(f=>f.id),a=e.getGlobalFilterFn(),l=e.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());r&&a&&l.length&&(s.push("__global__"),l.forEach(f=>{var h;i.push({id:f.id,filterFn:a,resolvedValue:(h=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?h:r})}));let c,d;for(let f=0;f<t.flatRows.length;f++){const h=t.flatRows[f];if(h.columnFilters={},o.length)for(let m=0;m<o.length;m++){c=o[m];const p=c.id;h.columnFilters[p]=c.filterFn(h,p,c.resolvedValue,y=>{h.columnFiltersMeta[p]=y})}if(i.length){for(let m=0;m<i.length;m++){d=i[m];const p=d.id;if(d.filterFn(h,p,d.resolvedValue,y=>{h.columnFiltersMeta[p]=y})){h.columnFilters.__global__=!0;break}}h.columnFilters.__global__!==!0&&(h.columnFilters.__global__=!1)}}const u=f=>{for(let h=0;h<s.length;h++)if(f.columnFilters[s[h]]===!1)return!1;return!0};return uk(t.rows,u,e)},ze(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function soe(e){return t=>$e(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:i}=n;let{rows:s,flatRows:a,rowsById:l}=r;const c=o*i,d=c+o;s=s.slice(c,d);let u;t.options.paginateExpandedRows?u={rows:s,flatRows:a,rowsById:l}:u=eoe({rows:s,flatRows:a,rowsById:l}),u.flatRows=[];const f=h=>{u.flatRows.push(h),h.subRows.length&&h.subRows.forEach(f)};return u.rows.forEach(f),u},ze(t.options,"debugTable"))}function aoe(){return e=>$e(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],i=r.filter(l=>{var c;return(c=e.getColumn(l.id))==null?void 0:c.getCanSort()}),s={};i.forEach(l=>{const c=e.getColumn(l.id);c&&(s[l.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=l=>{const c=l.map(d=>({...d}));return c.sort((d,u)=>{for(let h=0;h<i.length;h+=1){var f;const m=i[h],p=s[m.id],y=p.sortUndefined,v=(f=m==null?void 0:m.desc)!=null?f:!1;let b=0;if(y){const _=d.getValue(m.id),C=u.getValue(m.id),N=_===void 0,A=C===void 0;if(N||A){if(y==="first")return N?-1:1;if(y==="last")return N?1:-1;b=N&&A?0:N?y:-y}}if(b===0&&(b=p.sortingFn(d,u,m.id)),b!==0)return v&&(b*=-1),p.invertSorting&&(b*=-1),b}return d.index-u.index}),c.forEach(d=>{var u;o.push(d),(u=d.subRows)!=null&&u.length&&(d.subRows=a(d.subRows))}),c};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},ze(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
350
|
+
* react-table
|
|
351
|
+
*
|
|
352
|
+
* Copyright (c) TanStack
|
|
353
|
+
*
|
|
354
|
+
* This source code is licensed under the MIT license found in the
|
|
355
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
356
|
+
*
|
|
357
|
+
* @license MIT
|
|
358
|
+
*/function pb(e,t){return e?loe(e)?w.createElement(e,t):e:null}function loe(e){return coe(e)||typeof e=="function"||uoe(e)}function coe(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function uoe(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function doe(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=w.useState(()=>({current:Qre(t)})),[r,o]=w.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:s=>{o(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}function qa(e,t,n){let r=n.initialDeps??[],o;return()=>{var i,s,a,l;let c;n.key&&((i=n.debug)!=null&&i.call(n))&&(c=Date.now());const d=e();if(!(d.length!==r.length||d.some((h,m)=>r[m]!==h)))return o;r=d;let f;if(n.key&&((s=n.debug)!=null&&s.call(n))&&(f=Date.now()),o=t(...d),n.key&&((a=n.debug)!=null&&a.call(n))){const h=Math.round((Date.now()-c)*100)/100,m=Math.round((Date.now()-f)*100)/100,p=m/16,y=(v,b)=>{for(v=String(v);v.length<b;)v=" "+v;return v};console.info(`%c⏱ ${y(m,5)} /${y(h,5)} ms`,`
|
|
359
|
+
font-size: .6rem;
|
|
360
|
+
font-weight: bold;
|
|
361
|
+
color: hsl(${Math.max(0,Math.min(120-120*p,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(l=n==null?void 0:n.onChange)==null||l.call(n,o),o}}function mb(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const foe=(e,t)=>Math.abs(e-t)<1,hoe=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}},poe=e=>e,moe=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let o=t;o<=n;o++)r.push(o);return r},gb={passive:!0},goe=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=()=>{t({width:n.innerWidth,height:n.innerHeight})};return r(),n.addEventListener("resize",r,gb),()=>{n.removeEventListener("resize",r)}},dk=typeof window>"u"?!0:"onscrollend"in window,yoe=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const i=e.options.useScrollendEvent&&dk?()=>{}:hoe(r,()=>{t(o,!1)},e.options.isScrollingResetDelay),s=d=>()=>{o=n[e.options.horizontal?"scrollX":"scrollY"],i(),t(o,d)},a=s(!0),l=s(!1);l(),n.addEventListener("scroll",a,gb);const c=e.options.useScrollendEvent&&dk;return c&&n.addEventListener("scrollend",l,gb),()=>{n.removeEventListener("scroll",a),c&&n.removeEventListener("scrollend",l)}},woe=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},voe=(e,{adjustments:t=0,behavior:n},r)=>{var o,i;const s=e+t;(i=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[r.options.horizontal?"left":"top"]:s,behavior:n})};class boe{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{const s=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:poe,rangeExtractor:moe,onChange:()=>{},measureElement:woe,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=qa(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,i=new Map;for(let s=r-1;s>=0;s--){const a=n[s];if(o.has(a.lane))continue;const l=i.get(a.lane);if(l==null||a.end>l.end?i.set(a.lane,a):a.end<l.end&&o.set(a.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=qa(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,r,o,i,s)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s}),{key:!1}),this.getMeasurements=qa(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s},a)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(d=>{this.itemSizeCache.set(d.key,d.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,l);for(let d=l;d<n;d++){const u=i(d),f=this.options.lanes===1?c[d-1]:this.getFurthestMeasurement(c,d),h=f?f.end+this.options.gap:r+o,m=a.get(u),p=typeof m=="number"?m:this.options.estimateSize(d),y=h+p,v=f?f.lane:d%this.options.lanes;c[d]={index:d,start:h,size:p,end:y,key:u,lane:v}}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=qa(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,i)=>this.range=n.length>0&&r>0?_oe({measurements:n,outerSize:r,scrollOffset:o,lanes:i}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=qa(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,i,s)=>i===null||s===null?[]:n({startIndex:i,endIndex:s,overscan:r,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const o=this.indexFromElement(n),i=this.measurementsCache[o];if(!i)return;const s=i.key,a=this.elementsCache.get(s);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(s,n)),n.isConnected&&this.resizeItem(o,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const o=this.measurementsCache[n];if(!o)return;const i=this.itemSizeCache.get(o.key)??o.size,s=r-i;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,s,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,o)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(o))});return}this._measureElement(n,void 0)},this.getVirtualItems=qa(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let i=0,s=n.length;i<s;i++){const a=n[i],l=r[a];o.push(l)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return mb(r[fk(0,r.length-1,o=>mb(r[o]).start,n)])},this.getOffsetForAlignment=(n,r,o=0)=>{const i=this.getSize(),s=this.getScrollOffset();r==="auto"&&(r=n>=s+i?"end":"start"),r==="center"?n+=(o-i)/2:r==="end"&&(n-=i);const a=this.options.horizontal?"scrollWidth":"scrollHeight",c=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[a]:this.scrollElement[a]:0)-i;return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.measurementsCache[n];if(!o)return;const i=this.getSize(),s=this.getScrollOffset();if(r==="auto")if(o.end>=s+i-this.options.scrollPaddingEnd)r="end";else if(o.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];const a=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,o.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:r="start",behavior:o}={})=>{this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:o})},this.scrollToIndex=(n,{align:r="auto",behavior:o}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const i=this.getOffsetForIndex(n,r);if(!i)return;const[s,a]=i;this._scrollToOffset(s,{adjustments:void 0,behavior:o}),o!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[c]=mb(this.getOffsetForIndex(n,a));foe(c,this.getScrollOffset())||this.scrollToIndex(n,{align:a,behavior:o})}else this.scrollToIndex(n,{align:a,behavior:o})}))},this.scrollBy=(n,{behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;return r.length===0?o=this.options.paddingStart:o=this.options.lanes===1?((n=r[r.length-1])==null?void 0:n.end)??0:Math.max(...r.slice(-this.options.lanes).map(i=>i.end)),Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const fk=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,i=n(o);if(i<r)e=o+1;else if(i>r)t=o-1;else return o}return e>0?e-1:0};function _oe({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const o=e.length-1;let s=fk(0,o,l=>e[l].start,n),a=s;for(;a<o&&e[a].end<n+t;)a++;return r>1&&(s=Math.max(0,s-s%r),a=Math.min(o,a+(r-1-a%r))),{startIndex:s,endIndex:a}}const hk=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Soe(e){const t=w.useReducer(()=>({}),{})[1],n={...e,onChange:(o,i)=>{var s;i?Zr.flushSync(t):t(),(s=e.onChange)==null||s.call(e,o,i)}},[r]=w.useState(()=>new boe(n));return r.setOptions(n),hk(()=>r._didMount(),[]),hk(()=>r._willUpdate()),r}function xoe(e){return Soe({getScrollElement:()=>typeof document<"u"?window:null,observeElementRect:goe,observeElementOffset:yoe,scrollToFn:voe,initialOffset:()=>typeof document<"u"?window.scrollY:0,...e})}const yb=x.forwardRef(({className:e,...t},n)=>g.jsx("div",{className:"relative w-full overflow-auto",children:g.jsx("table",{ref:n,className:ce("w-full caption-bottom text-sm",e),...t})}));yb.displayName="Table";const wb=x.forwardRef(({className:e,...t},n)=>g.jsx("thead",{ref:n,className:ce("[&_tr]:border-b",e),...t}));wb.displayName="TableHeader";const vb=x.forwardRef(({className:e,...t},n)=>g.jsx("tbody",{ref:n,className:ce("[&_tr:last-child]:border-0",e),...t}));vb.displayName="TableBody";const pk=x.forwardRef(({className:e,...t},n)=>g.jsx("tfoot",{ref:n,className:ce("border-t bg-primary/50 font-medium [&>tr]:last:border-b-0",e),...t}));pk.displayName="TableFooter";const Ka=x.forwardRef(({className:e,...t},n)=>g.jsx("tr",{ref:n,className:ce("border-b transition-colors hover:bg-primary/50 data-[state=selected]:bg-primary",e),...t}));Ka.displayName="TableRow";const bb=x.forwardRef(({className:e,...t},n)=>g.jsx("th",{ref:n,className:ce("h-12 px-4 text-left align-middle font-medium text-foreground [&:has([role=checkbox])]:pr-0",e),...t}));bb.displayName="TableHead";const Fc=x.forwardRef(({className:e,...t},n)=>g.jsx("td",{ref:n,className:ce("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Fc.displayName="TableCell";const mk=x.forwardRef(({className:e,...t},n)=>g.jsx("caption",{ref:n,className:ce("mt-4 text-sm text-foreground",e),...t}));mk.displayName="TableCaption";function Eoe({columns:e,data:t,virtualizeRows:n=!1}){var p,y,v,b;const[r,o]=x.useState({}),[i,s]=x.useState({}),[a,l]=x.useState([]),[c,d]=x.useState([]),u=doe({data:t,columns:e,state:{sorting:c,columnVisibility:i,rowSelection:r,columnFilters:a},enableRowSelection:!0,onRowSelectionChange:o,onSortingChange:d,onColumnFiltersChange:l,onColumnVisibilityChange:s,getCoreRowModel:Zre(),getFilteredRowModel:ioe(),getPaginationRowModel:soe(),getSortedRowModel:aoe(),getFacetedRowModel:roe(),getFacetedUniqueValues:ooe()}),f=x.useRef(null),{rows:h}=u.getRowModel(),m=xoe({count:h.length,estimateSize:()=>40,scrollMargin:((p=f.current)==null?void 0:p.offsetTop)??0});return g.jsx("div",{ref:f,className:"relative w-full overflow-auto",children:g.jsxs(yb,{children:[g.jsx(wb,{children:u.getHeaderGroups().map(_=>g.jsx(Ka,{children:_.headers.map(C=>g.jsxs(bb,{colSpan:C.colSpan,className:ce("select-none",C.column.getCanSort()&&"cursor-pointer"),onClick:C.column.getToggleSortingHandler(),children:[C.isPlaceholder?null:pb(C.column.columnDef.header,C.getContext()),{asc:" 🔼",desc:" 🔽"}[C.column.getIsSorted()]??null]},C.id))},_.id))}),g.jsx(vb,{children:n?g.jsxs(g.Fragment,{children:[g.jsx("tr",{children:g.jsx("td",{style:{height:`${((y=m.getVirtualItems()[0])==null?void 0:y.start)??0}px`}})}),m.getVirtualItems().map(_=>{const C=h[_.index];return g.jsx(Ka,{"data-state":(C==null?void 0:C.getIsSelected())&&"selected",style:{height:`${_.size}px`},children:C==null?void 0:C.getVisibleCells().map(N=>g.jsx(Fc,{children:pb(N.column.columnDef.cell,N.getContext())},N.id))},C==null?void 0:C.id)}),g.jsx("tr",{children:g.jsx("td",{style:{height:`${m.getTotalSize()-(((v=m.getVirtualItems()[m.getVirtualItems().length-1])==null?void 0:v.end)??0)}px`}})})]}):g.jsx(g.Fragment,{children:(b=u.getRowModel().rows)!=null&&b.length?u.getRowModel().rows.map(_=>g.jsx(Ka,{"data-state":_.getIsSelected()&&"selected",children:_.getVisibleCells().map(C=>g.jsx(Fc,{children:pb(C.column.columnDef.cell,C.getContext())},C.id))},_.id)):g.jsx(Ka,{children:g.jsx(Fc,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})})]})})}function Coe({date:e,onDateChange:t,placeholder:n="Pick a date",disabled:r=!1,className:o}){const[i,s]=x.useState(!1);return g.jsxs(ih,{open:i,onOpenChange:s,children:[g.jsx(sh,{asChild:!0,children:g.jsxs(Hr,{variant:"outline",className:ce("w-[240px] justify-start text-left font-normal",!e&&"text-foreground",o),disabled:r,children:[g.jsx(vM,{className:"mr-2 h-4 w-4"}),e?Co(e,"PPP"):n]})}),g.jsx(kc,{className:"w-auto p-0",align:"start",children:g.jsx(Xf,{mode:"single",selected:e,onSelect:a=>{t==null||t(a),s(!1)},initialFocus:!0})})]})}function Noe({dateRange:e,onDateRangeChange:t,placeholder:n="Pick a date range",disabled:r=!1,className:o}){const[i,s]=x.useState(!1);return g.jsxs(ih,{open:i,onOpenChange:s,children:[g.jsx(sh,{asChild:!0,children:g.jsxs(Hr,{variant:"outline",className:ce("w-[300px] justify-start text-left font-normal",!(e!=null&&e.from)&&!(e!=null&&e.to)&&"text-foreground",o),disabled:r,children:[g.jsx(vM,{className:"mr-2 h-4 w-4"}),e!=null&&e.from||e!=null&&e.to?g.jsxs(g.Fragment,{children:[e.from&&Co(e.from,"PPP"),e.to&&" - ",e.to&&Co(e.to,"PPP")]}):n]})}),g.jsx(kc,{className:"w-auto p-0",align:"start",children:g.jsx(Xf,{mode:"range",selected:{from:e==null?void 0:e.from,to:e==null?void 0:e.to},onSelect:a=>{t==null||t(a??{}),a!=null&&a.from&&(a!=null&&a.to)&&s(!1)},initialFocus:!0,numberOfMonths:2})})]})}function Roe(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const gk=x.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),Xa=()=>{const e=x.useContext(gk);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};Roe(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
|
|
362
|
+
[data-state=closed]
|
|
363
|
+
){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function Poe(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function Aoe(){return _b(/^Mac/)}function Toe(){return _b(/^iPhone/)}function yk(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Doe(){return _b(/^iPad/)||Aoe()&&navigator.maxTouchPoints>1}function wk(){return Toe()||Doe()}function _b(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const Moe=24,Ioe=typeof window<"u"?x.useLayoutEffect:x.useEffect;function vk(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const Sb=typeof document<"u"&&window.visualViewport;function bk(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function _k(e){for(bk(e)&&(e=e.parentElement);e&&!bk(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const Ooe=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let dh=0,xb;function koe(e={}){let{isDisabled:t}=e;Ioe(()=>{if(!t)return dh++,dh===1&&wk()&&(xb=Loe()),()=>{dh--,dh===0&&(xb==null||xb())}},[t])}function Loe(){let e,t=0,n=u=>{e=_k(u.target),!(e===document.documentElement&&e===document.body)&&(t=u.changedTouches[0].pageY)},r=u=>{if(!e||e===document.documentElement||e===document.body){u.preventDefault();return}let f=u.changedTouches[0].pageY,h=e.scrollTop,m=e.scrollHeight-e.clientHeight;m!==0&&((h<=0&&f>t||h>=m&&f<t)&&u.preventDefault(),t=f)},o=u=>{let f=u.target;Eb(f)&&f!==document.activeElement&&(u.preventDefault(),f.style.transform="translateY(-2000px)",f.focus(),requestAnimationFrame(()=>{f.style.transform=""}))},i=u=>{let f=u.target;Eb(f)&&(f.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{f.style.transform="",Sb&&(Sb.height<window.innerHeight?requestAnimationFrame(()=>{Sk(f)}):Sb.addEventListener("resize",()=>Sk(f),{once:!0}))}))},s=()=>{window.scrollTo(0,0)},a=window.pageXOffset,l=window.pageYOffset,c=vk(joe(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let d=vk($c(document,"touchstart",n,{passive:!1,capture:!0}),$c(document,"touchmove",r,{passive:!1,capture:!0}),$c(document,"touchend",o,{passive:!1,capture:!0}),$c(document,"focus",i,!0),$c(window,"scroll",s));return()=>{c(),d(),window.scrollTo(a,l)}}function joe(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function $c(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Sk(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=_k(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,o=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;const s=n.getBoundingClientRect().bottom+Moe;i>s&&(n.scrollTop+=o-r)}e=n.parentElement}}function Eb(e){return e instanceof HTMLInputElement&&!Ooe.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function Foe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function $oe(...e){return t=>e.forEach(n=>Foe(n,t))}function xk(...e){return w.useCallback($oe(...e),e)}const Ek=new WeakMap;function dn(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([o,i])=>{if(o.startsWith("--")){e.style.setProperty(o,i);return}r[o]=e.style[o],e.style[o]=i}),!n&&Ek.set(e,r)}function zoe(e,t){if(!e||!(e instanceof HTMLElement))return;let n=Ek.get(e);n&&(e.style[t]=n[t])}const ln=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function fh(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[ln(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[ln(t)?5:4]):null)}function Boe(e){return 8*(Math.log(e+1)-2)}function Cb(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function Woe(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const Ht={DURATION:.5,EASE:[.32,.72,0,1]},Ck=.4,Voe=.25,Uoe=100,Nk=8,hh=16,Nb=26,Rb="vaul-dragging";function Rk(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function Hoe({defaultProp:e,onChange:t}){const n=x.useState(e),[r]=n,o=x.useRef(r),i=Rk(t);return x.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function Pk({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Hoe({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Rk(n),l=x.useCallback(c=>{if(i){const u=typeof c=="function"?c(e):c;u!==e&&a(u)}else o(c)},[i,e,o,a]);return[s,l]}function Goe({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:o,fadeFromIndex:i,onSnapPointChange:s,direction:a="bottom",container:l,snapToSequentialPoint:c}){const[d,u]=Pk({prop:e,defaultProp:n==null?void 0:n[0],onChange:t}),[f,h]=x.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);x.useEffect(()=>{function R(){h({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",R),()=>window.removeEventListener("resize",R)},[]);const m=x.useMemo(()=>d===(n==null?void 0:n[n.length-1])||null,[n,d]),p=x.useMemo(()=>{var R;return(R=n==null?void 0:n.findIndex(D=>D===d))!=null?R:null},[n,d]),y=n&&n.length>0&&(i||i===0)&&!Number.isNaN(i)&&n[i]===d||!n,v=x.useMemo(()=>{const R=l?{width:l.getBoundingClientRect().width,height:l.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var D;return(D=n==null?void 0:n.map(k=>{const F=typeof k=="string";let W=0;if(F&&(W=parseInt(k,10)),ln(a)){const T=F?W:f?k*R.height:0;return f?a==="bottom"?R.height-T:-R.height+T:T}const B=F?W:f?k*R.width:0;return f?a==="right"?R.width-B:-R.width+B:B}))!=null?D:[]},[n,f,l]),b=x.useMemo(()=>p!==null?v==null?void 0:v[p]:null,[v,p]),_=x.useCallback(R=>{var D;const k=(D=v==null?void 0:v.findIndex(F=>F===R))!=null?D:null;s(k),dn(r.current,{transition:`transform ${Ht.DURATION}s cubic-bezier(${Ht.EASE.join(",")})`,transform:ln(a)?`translate3d(0, ${R}px, 0)`:`translate3d(${R}px, 0, 0)`}),v&&k!==v.length-1&&i!==void 0&&k!==i&&k<i?dn(o.current,{transition:`opacity ${Ht.DURATION}s cubic-bezier(${Ht.EASE.join(",")})`,opacity:"0"}):dn(o.current,{transition:`opacity ${Ht.DURATION}s cubic-bezier(${Ht.EASE.join(",")})`,opacity:"1"}),u(n==null?void 0:n[Math.max(k,0)])},[r.current,n,v,i,o,u]);x.useEffect(()=>{if(d||e){var R;const D=(R=n==null?void 0:n.findIndex(k=>k===e||k===d))!=null?R:-1;v&&D!==-1&&typeof v[D]=="number"&&_(v[D])}},[d,e,n,v,_]);function C({draggedDistance:R,closeDrawer:D,velocity:k,dismissible:F}){if(i===void 0)return;const W=a==="bottom"||a==="right"?(b??0)-R:(b??0)+R,B=p===i-1,T=p===0,Q=R>0;if(B&&dn(o.current,{transition:`opacity ${Ht.DURATION}s cubic-bezier(${Ht.EASE.join(",")})`}),!c&&k>2&&!Q){F?D():_(v[0]);return}if(!c&&k>2&&Q&&v&&n){_(v[n.length-1]);return}const K=v==null?void 0:v.reduce((ee,G)=>typeof ee!="number"||typeof G!="number"?ee:Math.abs(G-W)<Math.abs(ee-W)?G:ee),Y=ln(a)?window.innerHeight:window.innerWidth;if(k>Ck&&Math.abs(R)<Y*.4){const ee=Q?1:-1;if(ee>0&&m&&n){_(v[n.length-1]);return}if(T&&ee<0&&F&&D(),p===null)return;_(v[p+ee]);return}_(K)}function N({draggedDistance:R}){if(b===null)return;const D=a==="bottom"||a==="right"?b-R:b+R;(a==="bottom"||a==="right")&&D<v[v.length-1]||(a==="top"||a==="left")&&D>v[v.length-1]||dn(r.current,{transform:ln(a)?`translate3d(0, ${D}px, 0)`:`translate3d(${D}px, 0, 0)`})}function A(R,D){if(!n||typeof p!="number"||!v||i===void 0)return null;const k=p===i-1;if(p>=i&&D)return 0;if(k&&!D)return 1;if(!y&&!k)return null;const W=k?p+1:p-1,B=k?v[W]-v[W-1]:v[W+1]-v[W],T=R/Math.abs(B);return k?1-T:T}return{isLastSnapPoint:m,activeSnapPoint:d,shouldFade:y,getPercentageDragged:A,setActiveSnapPoint:u,activeSnapPointIndex:p,onRelease:C,onDrag:N,snapPointsOffset:v}}const Yoe=()=>()=>{};function qoe(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:o}=Xa(),i=x.useRef(null),s=x.useMemo(()=>document.body.style.backgroundColor,[]);function a(){return(window.innerWidth-Nb)/window.innerWidth}x.useEffect(()=>{if(t&&n){i.current&&clearTimeout(i.current);const l=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!l)return;Woe(r&&!o?Cb(document.body,{background:"black"}):Yoe,Cb(l,{transformOrigin:ln(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${Ht.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Ht.EASE.join(",")})`}));const c=Cb(l,{borderRadius:`${Nk}px`,overflow:"hidden",...ln(e)?{transform:`scale(${a()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${a()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{c(),i.current=window.setTimeout(()=>{s?document.body.style.background=s:document.body.style.removeProperty("background")},Ht.DURATION*1e3)}}},[t,n,s])}let zc=null;function Koe({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:o,noBodyStyles:i}){const[s,a]=x.useState(()=>typeof window<"u"?window.location.href:""),l=x.useRef(0),c=x.useCallback(()=>{if(yk()&&zc===null&&e&&!i){zc={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:u,innerHeight:f}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-l.current}px`,left:`${-u}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const h=f-window.innerHeight;h&&l.current>=f&&(document.body.style.top=`${-(l.current+h)}px`)}),300)}},[e]),d=x.useCallback(()=>{if(yk()&&zc!==null&&!i){const u=-parseInt(document.body.style.top,10),f=-parseInt(document.body.style.left,10);Object.assign(document.body.style,zc),window.requestAnimationFrame(()=>{if(o&&s!==window.location.href){a(window.location.href);return}window.scrollTo(f,u)}),zc=null}},[s]);return x.useEffect(()=>{function u(){l.current=window.scrollY}return u(),window.addEventListener("scroll",u),()=>{window.removeEventListener("scroll",u)}},[]),x.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||d()}},[t,d]),x.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&c(),t||window.setTimeout(()=>{d()},500)):d())},[e,r,s,t,n,c,d]),{restorePositionSetting:d}}function Ak({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:o,snapPoints:i,shouldScaleBackground:s=!1,setBackgroundColorOnScale:a=!0,closeThreshold:l=Voe,scrollLockTimeout:c=Uoe,dismissible:d=!0,handleOnly:u=!1,fadeFromIndex:f=i&&i.length-1,activeSnapPoint:h,setActiveSnapPoint:m,fixed:p,modal:y=!0,onClose:v,nested:b,noBodyStyles:_=!1,direction:C="bottom",defaultOpen:N=!1,disablePreventScroll:A=!0,snapToSequentialPoint:R=!1,preventScrollRestoration:D=!1,repositionInputs:k=!0,onAnimationEnd:F,container:W,autoFocus:B=!1}){var T,Q;const[K=!1,Y]=Pk({defaultProp:N,prop:e,onChange:Ie=>{t==null||t(Ie),!Ie&&!b&&P(),setTimeout(()=>{F==null||F(Ie)},Ht.DURATION*1e3),Ie&&!y&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),Ie||(document.body.style.pointerEvents="auto")}}),[ee,G]=x.useState(!1),[re,X]=x.useState(!1),[J,se]=x.useState(!1),L=x.useRef(null),ne=x.useRef(null),fe=x.useRef(null),H=x.useRef(null),ae=x.useRef(null),V=x.useRef(!1),de=x.useRef(null),ge=x.useRef(0),pe=x.useRef(!1),oe=x.useRef(!N),$=x.useRef(0),j=x.useRef(null),le=x.useRef(((T=j.current)==null?void 0:T.getBoundingClientRect().height)||0),ve=x.useRef(((Q=j.current)==null?void 0:Q.getBoundingClientRect().width)||0),we=x.useRef(0),M=x.useCallback(Ie=>{i&&Ie===ye.length-1&&(ne.current=new Date)},[]),{activeSnapPoint:q,activeSnapPointIndex:te,setActiveSnapPoint:Se,onRelease:ue,snapPointsOffset:ye,onDrag:xe,shouldFade:Ae,getPercentageDragged:Ze}=Goe({snapPoints:i,activeSnapPointProp:h,setActiveSnapPointProp:m,drawerRef:j,fadeFromIndex:f,overlayRef:L,onSnapPointChange:M,direction:C,container:W,snapToSequentialPoint:R});koe({isDisabled:!K||re||!y||J||!ee||!k||!A});const{restorePositionSetting:P}=Koe({isOpen:K,modal:y,nested:b??!1,hasBeenOpened:ee,preventScrollRestoration:D,noBodyStyles:_});function S(){return(window.innerWidth-Nb)/window.innerWidth}function E(Ie){var at,lt;!d&&!i||j.current&&!j.current.contains(Ie.target)||(le.current=((at=j.current)==null?void 0:at.getBoundingClientRect().height)||0,ve.current=((lt=j.current)==null?void 0:lt.getBoundingClientRect().width)||0,X(!0),fe.current=new Date,wk()&&window.addEventListener("touchend",()=>V.current=!1,{once:!0}),Ie.target.setPointerCapture(Ie.pointerId),ge.current=ln(C)?Ie.pageY:Ie.pageX)}function I(Ie,at){var lt;let qe=Ie;const Me=(lt=window.getSelection())==null?void 0:lt.toString(),ot=j.current?fh(j.current,C):null,Je=new Date;if(qe.tagName==="SELECT"||qe.hasAttribute("data-vaul-no-drag")||qe.closest("[data-vaul-no-drag]"))return!1;if(C==="right"||C==="left")return!0;if(ne.current&&Je.getTime()-ne.current.getTime()<500)return!1;if(ot!==null&&(C==="bottom"?ot>0:ot<0))return!0;if(Me&&Me.length>0)return!1;if(ae.current&&Je.getTime()-ae.current.getTime()<c&&ot===0||at)return ae.current=Je,!1;for(;qe;){if(qe.scrollHeight>qe.clientHeight){if(qe.scrollTop!==0)return ae.current=new Date,!1;if(qe.getAttribute("role")==="dialog")return!0}qe=qe.parentNode}return!0}function U(Ie){if(j.current&&re){const at=C==="bottom"||C==="right"?1:-1,lt=(ge.current-(ln(C)?Ie.pageY:Ie.pageX))*at,qe=lt>0,Me=i&&!d&&!qe;if(Me&&te===0)return;const ot=Math.abs(lt),Je=document.querySelector("[data-vaul-drawer-wrapper]"),xt=C==="bottom"||C==="top"?le.current:ve.current;let O=ot/xt;const z=Ze(ot,qe);if(z!==null&&(O=z),Me&&O>=1||!V.current&&!I(Ie.target,qe))return;if(j.current.classList.add(Rb),V.current=!0,dn(j.current,{transition:"none"}),dn(L.current,{transition:"none"}),i&&xe({draggedDistance:lt}),qe&&!i){const Ne=Boe(lt),Te=Math.min(Ne*-1,0)*at;dn(j.current,{transform:ln(C)?`translate3d(0, ${Te}px, 0)`:`translate3d(${Te}px, 0, 0)`});return}const Ee=1-O;if((Ae||f&&te===f-1)&&(r==null||r(Ie,O),dn(L.current,{opacity:`${Ee}`,transition:"none"},!0)),Je&&L.current&&s){const Ne=Math.min(S()+O*(1-S()),1),Te=8-O*8,pt=Math.max(0,14-O*14);dn(Je,{borderRadius:`${Te}px`,transform:ln(C)?`scale(${Ne}) translate3d(0, ${pt}px, 0)`:`scale(${Ne}) translate3d(${pt}px, 0, 0)`,transition:"none"},!0)}if(!i){const Ne=ot*at;dn(j.current,{transform:ln(C)?`translate3d(0, ${Ne}px, 0)`:`translate3d(${Ne}px, 0, 0)`})}}}x.useEffect(()=>{window.requestAnimationFrame(()=>{oe.current=!0})},[]),x.useEffect(()=>{var Ie;function at(){if(!j.current||!k)return;const lt=document.activeElement;if(Eb(lt)||pe.current){var qe;const Me=((qe=window.visualViewport)==null?void 0:qe.height)||0,ot=window.innerHeight;let Je=ot-Me;const xt=j.current.getBoundingClientRect().height||0,O=xt>ot*.8;we.current||(we.current=xt);const z=j.current.getBoundingClientRect().top;if(Math.abs($.current-Je)>60&&(pe.current=!pe.current),i&&i.length>0&&ye&&te){const Ee=ye[te]||0;Je+=Ee}if($.current=Je,xt>Me||pe.current){const Ee=j.current.getBoundingClientRect().height;let Ne=Ee;Ee>Me&&(Ne=Me-(O?z:Nb)),p?j.current.style.height=`${Ee-Math.max(Je,0)}px`:j.current.style.height=`${Math.max(Ne,Me-z)}px`}else Poe()||(j.current.style.height=`${we.current}px`);i&&i.length>0&&!pe.current?j.current.style.bottom="0px":j.current.style.bottom=`${Math.max(Je,0)}px`}}return(Ie=window.visualViewport)==null||Ie.addEventListener("resize",at),()=>{var lt;return(lt=window.visualViewport)==null?void 0:lt.removeEventListener("resize",at)}},[te,i,ye]);function ie(Ie){Re(),v==null||v(),Ie||Y(!1),setTimeout(()=>{i&&Se(i[0])},Ht.DURATION*1e3)}function Z(){if(!j.current)return;const Ie=document.querySelector("[data-vaul-drawer-wrapper]"),at=fh(j.current,C);dn(j.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${Ht.DURATION}s cubic-bezier(${Ht.EASE.join(",")})`}),dn(L.current,{transition:`opacity ${Ht.DURATION}s cubic-bezier(${Ht.EASE.join(",")})`,opacity:"1"}),s&&at&&at>0&&K&&dn(Ie,{borderRadius:`${Nk}px`,overflow:"hidden",...ln(C)?{transform:`scale(${S()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${S()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${Ht.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Ht.EASE.join(",")})`},!0)}function Re(){!re||!j.current||(j.current.classList.remove(Rb),V.current=!1,X(!1),H.current=new Date)}function ct(Ie){if(!re||!j.current)return;j.current.classList.remove(Rb),V.current=!1,X(!1),H.current=new Date;const at=fh(j.current,C);if(!Ie||!I(Ie.target,!1)||!at||Number.isNaN(at)||fe.current===null)return;const lt=H.current.getTime()-fe.current.getTime(),qe=ge.current-(ln(C)?Ie.pageY:Ie.pageX),Me=Math.abs(qe)/lt;if(Me>.05&&(se(!0),setTimeout(()=>{se(!1)},200)),i){ue({draggedDistance:qe*(C==="bottom"||C==="right"?1:-1),closeDrawer:ie,velocity:Me,dismissible:d}),o==null||o(Ie,!0);return}if(C==="bottom"||C==="right"?qe>0:qe<0){Z(),o==null||o(Ie,!0);return}if(Me>Ck){ie(),o==null||o(Ie,!1);return}var ot;const Je=Math.min((ot=j.current.getBoundingClientRect().height)!=null?ot:0,window.innerHeight);var xt;const O=Math.min((xt=j.current.getBoundingClientRect().width)!=null?xt:0,window.innerWidth),z=C==="left"||C==="right";if(Math.abs(at)>=(z?O:Je)*l){ie(),o==null||o(Ie,!1);return}o==null||o(Ie,!0),Z()}x.useEffect(()=>(K&&(dn(document.documentElement,{scrollBehavior:"auto"}),ne.current=new Date),()=>{zoe(document.documentElement,"scrollBehavior")}),[K]);function ft(Ie){const at=Ie?(window.innerWidth-hh)/window.innerWidth:1,lt=Ie?-16:0;de.current&&window.clearTimeout(de.current),dn(j.current,{transition:`transform ${Ht.DURATION}s cubic-bezier(${Ht.EASE.join(",")})`,transform:ln(C)?`scale(${at}) translate3d(0, ${lt}px, 0)`:`scale(${at}) translate3d(${lt}px, 0, 0)`}),!Ie&&j.current&&(de.current=setTimeout(()=>{const qe=fh(j.current,C);dn(j.current,{transition:"none",transform:ln(C)?`translate3d(0, ${qe}px, 0)`:`translate3d(${qe}px, 0, 0)`})},500))}function yt(Ie,at){if(at<0)return;const lt=(window.innerWidth-hh)/window.innerWidth,qe=lt+at*(1-lt),Me=-16+at*hh;dn(j.current,{transform:ln(C)?`scale(${qe}) translate3d(0, ${Me}px, 0)`:`scale(${qe}) translate3d(${Me}px, 0, 0)`,transition:"none"})}function et(Ie,at){const lt=ln(C)?window.innerHeight:window.innerWidth,qe=at?(lt-hh)/lt:1,Me=at?-16:0;at&&dn(j.current,{transition:`transform ${Ht.DURATION}s cubic-bezier(${Ht.EASE.join(",")})`,transform:ln(C)?`scale(${qe}) translate3d(0, ${Me}px, 0)`:`scale(${qe}) translate3d(${Me}px, 0, 0)`})}return x.useEffect(()=>{y||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[y]),x.createElement(rf,{defaultOpen:N,onOpenChange:Ie=>{!d&&!Ie||(Ie?G(!0):ie(!0),Y(Ie))},open:K},x.createElement(gk.Provider,{value:{activeSnapPoint:q,snapPoints:i,setActiveSnapPoint:Se,drawerRef:j,overlayRef:L,onOpenChange:t,onPress:E,onRelease:ct,onDrag:U,dismissible:d,shouldAnimate:oe,handleOnly:u,isOpen:K,isDragging:re,shouldFade:Ae,closeDrawer:ie,onNestedDrag:yt,onNestedOpenChange:ft,onNestedRelease:et,keyboardIsOpen:pe,modal:y,snapPointsOffset:ye,activeSnapPointIndex:te,direction:C,shouldScaleBackground:s,setBackgroundColorOnScale:a,noBodyStyles:_,container:W,autoFocus:B}},n))}const Tk=x.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:o,shouldFade:i,isOpen:s,modal:a,shouldAnimate:l}=Xa(),c=xk(t,n),d=r&&r.length>0;if(!a)return null;const u=x.useCallback(f=>o(f),[o]);return x.createElement(ga,{onMouseUp:u,ref:c,"data-vaul-overlay":"","data-vaul-snap-points":s&&d?"true":"false","data-vaul-snap-points-overlay":s&&i?"true":"false","data-vaul-animate":l!=null&&l.current?"true":"false",...e})});Tk.displayName="Drawer.Overlay";const Dk=x.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},o){const{drawerRef:i,onPress:s,onRelease:a,onDrag:l,keyboardIsOpen:c,snapPointsOffset:d,activeSnapPointIndex:u,modal:f,isOpen:h,direction:m,snapPoints:p,container:y,handleOnly:v,shouldAnimate:b,autoFocus:_}=Xa(),[C,N]=x.useState(!1),A=xk(o,i),R=x.useRef(null),D=x.useRef(null),k=x.useRef(!1),F=p&&p.length>0;qoe();const W=(T,Q,K=0)=>{if(k.current)return!0;const Y=Math.abs(T.y),ee=Math.abs(T.x),G=ee>Y,re=["bottom","right"].includes(Q)?1:-1;if(Q==="left"||Q==="right"){if(!(T.x*re<0)&&ee>=0&&ee<=K)return G}else if(!(T.y*re<0)&&Y>=0&&Y<=K)return!G;return k.current=!0,!0};x.useEffect(()=>{F&&window.requestAnimationFrame(()=>{N(!0)})},[]);function B(T){R.current=null,k.current=!1,a(T)}return x.createElement(ya,{"data-vaul-drawer-direction":m,"data-vaul-drawer":"","data-vaul-delayed-snap-points":C?"true":"false","data-vaul-snap-points":h&&F?"true":"false","data-vaul-custom-container":y?"true":"false","data-vaul-animate":b!=null&&b.current?"true":"false",...r,ref:A,style:d&&d.length>0?{"--snap-point-height":`${d[u??0]}px`,...t}:t,onPointerDown:T=>{v||(r.onPointerDown==null||r.onPointerDown.call(r,T),R.current={x:T.pageX,y:T.pageY},s(T))},onOpenAutoFocus:T=>{n==null||n(T),_||T.preventDefault()},onPointerDownOutside:T=>{if(e==null||e(T),!f||T.defaultPrevented){T.preventDefault();return}c.current&&(c.current=!1)},onFocusOutside:T=>{if(!f){T.preventDefault();return}},onPointerMove:T=>{if(D.current=T,v||(r.onPointerMove==null||r.onPointerMove.call(r,T),!R.current))return;const Q=T.pageY-R.current.y,K=T.pageX-R.current.x,Y=T.pointerType==="touch"?10:2;W({x:K,y:Q},m,Y)?l(T):(Math.abs(K)>Y||Math.abs(Q)>Y)&&(R.current=null)},onPointerUp:T=>{r.onPointerUp==null||r.onPointerUp.call(r,T),R.current=null,k.current=!1,a(T)},onPointerOut:T=>{r.onPointerOut==null||r.onPointerOut.call(r,T),B(D.current)},onContextMenu:T=>{r.onContextMenu==null||r.onContextMenu.call(r,T),D.current&&B(D.current)}})});Dk.displayName="Drawer.Content";const Xoe=250,Joe=120,Mk=x.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:o,isDragging:i,snapPoints:s,activeSnapPoint:a,setActiveSnapPoint:l,dismissible:c,handleOnly:d,isOpen:u,onPress:f,onDrag:h}=Xa(),m=x.useRef(null),p=x.useRef(!1);function y(){if(p.current){_();return}window.setTimeout(()=>{v()},Joe)}function v(){if(i||e||p.current){_();return}if(_(),!s||s.length===0){c||o();return}if(a===s[s.length-1]&&c){o();return}const N=s.findIndex(R=>R===a);if(N===-1)return;const A=s[N+1];l(A)}function b(){m.current=window.setTimeout(()=>{p.current=!0},Xoe)}function _(){m.current&&window.clearTimeout(m.current),p.current=!1}return x.createElement("div",{onClick:y,onPointerCancel:_,onPointerDown:C=>{d&&f(C),b()},onPointerMove:C=>{d&&h(C)},ref:r,"data-vaul-drawer-visible":u?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},x.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});Mk.displayName="Drawer.Handle";function Qoe({onDrag:e,onOpenChange:t,open:n,...r}){const{onNestedDrag:o,onNestedOpenChange:i,onNestedRelease:s}=Xa();if(!o)throw new Error("Drawer.NestedRoot must be placed in another drawer");return x.createElement(Ak,{nested:!0,open:n,onClose:()=>{i(!1)},onDrag:(a,l)=>{o(a,l),e==null||e(a,l)},onOpenChange:a=>{a&&i(a),t==null||t(a)},onRelease:s,...r})}function Zoe(e){const t=Xa(),{container:n=t.container,...r}=e;return x.createElement(sf,{container:n,...r})}const Xr={Root:Ak,NestedRoot:Qoe,Content:Dk,Overlay:Tk,Trigger:of,Portal:Zoe,Handle:Mk,Close:ba,Title:wa,Description:va},Ik=({shouldScaleBackground:e=!0,...t})=>g.jsx(Xr.Root,{shouldScaleBackground:e,...t});Ik.displayName="Drawer";const eie=Xr.Trigger,Ok=Xr.Portal,tie=Xr.Close,Pb=x.forwardRef(({className:e,...t},n)=>g.jsx(Xr.Overlay,{ref:n,className:ce("fixed inset-0 z-50 bg-black/80",e),...t}));Pb.displayName=Xr.Overlay.displayName;const kk=x.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(Ok,{children:[g.jsx(Pb,{}),g.jsxs(Xr.Content,{ref:r,className:ce("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",e),...n,children:[g.jsx("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-primary"}),t]})]}));kk.displayName="DrawerContent";const Lk=({className:e,...t})=>g.jsx("div",{className:ce("grid gap-1.5 p-4 text-center sm:text-left",e),...t});Lk.displayName="DrawerHeader";const jk=({className:e,...t})=>g.jsx("div",{className:ce("mt-auto flex flex-col gap-2 p-4",e),...t});jk.displayName="DrawerFooter";const Fk=x.forwardRef(({className:e,...t},n)=>g.jsx(Xr.Title,{ref:n,className:ce("text-lg font-semibold leading-none tracking-tight",e),...t}));Fk.displayName=Xr.Title.displayName;const $k=x.forwardRef(({className:e,...t},n)=>g.jsx(Xr.Description,{ref:n,className:ce("text-sm text-foreground",e),...t}));$k.displayName=Xr.Description.displayName;const nie=tK,rie=nK,oie=rK,iie=EP,sie=iK,aie=oK,zk=x.forwardRef(({className:e,inset:t,children:n,...r},o)=>g.jsxs(MP,{ref:o,className:ce("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,g.jsx(Ti,{className:"ml-auto h-4 w-4"})]}));zk.displayName=MP.displayName;const Bk=x.forwardRef(({className:e,...t},n)=>g.jsx(IP,{ref:n,className:ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Bk.displayName=IP.displayName;const Wk=x.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(EP,{children:g.jsx(CP,{ref:r,sideOffset:t,className:ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Wk.displayName=CP.displayName;const Vk=x.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(RP,{ref:r,className:ce("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));Vk.displayName=RP.displayName;const Uk=x.forwardRef(({className:e,children:t,checked:n,...r},o)=>g.jsxs(PP,{ref:o,className:ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(TP,{children:g.jsx(ja,{className:"h-4 w-4"})})}),t]}));Uk.displayName=PP.displayName;const Hk=x.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(AP,{ref:r,className:ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(TP,{children:g.jsx(Uf,{className:"h-2 w-2 fill-current"})})}),t]}));Hk.displayName=AP.displayName;const Gk=x.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(NP,{ref:r,className:ce("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Gk.displayName=NP.displayName;const Yk=x.forwardRef(({className:e,...t},n)=>g.jsx(DP,{ref:n,className:ce("-mx-1 my-1 h-px bg-primary",e),...t}));Yk.displayName=DP.displayName;const qk=({className:e,...t})=>g.jsx("span",{className:ce("ml-auto text-xs tracking-widest opacity-60",e),...t});qk.displayName="DropdownMenuShortcut";let Kk=0;function lie(e="id"){const t=x.useRef(null);return t.current===null&&(Kk+=1,t.current=`${e}-${Kk}`),t.current}const cie=cr("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ab=x.forwardRef(({className:e,...t},n)=>g.jsx(kP,{ref:n,className:ce(cie(),e),...t}));Ab.displayName=kP.displayName;const uie=sG,Xk=x.createContext({}),die=({...e})=>g.jsx(Xk.Provider,{value:{name:e.name},children:g.jsx(uG,{...e})}),Bc=()=>{const e=x.useContext(Xk),t=x.useContext(Jk),{getFieldState:n,formState:r}=$d(),o=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...o}},Jk=x.createContext({}),Qk=x.forwardRef(({className:e,...t},n)=>{const r=lie();return g.jsx(Jk.Provider,{value:{id:r},children:g.jsx("div",{ref:n,className:ce("space-y-2",e),...t})})});Qk.displayName="FormItem";const Zk=x.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:o}=Bc();return g.jsx(Ab,{ref:n,className:ce(r&&"text-destructive",e),htmlFor:o,...t})});Zk.displayName="FormLabel";const eL=x.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:o,formMessageId:i}=Bc();return g.jsx($r,{ref:t,id:r,"aria-describedby":n?`${o} ${i}`:`${o}`,"aria-invalid":!!n,...e})});eL.displayName="FormControl";const tL=x.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=Bc();return g.jsx("p",{ref:n,id:r,className:ce("text-sm text-foreground",e),...t})});tL.displayName="FormDescription";const nL=x.forwardRef(({className:e,children:t,...n},r)=>{const{error:o,formMessageId:i}=Bc(),s=o?String(o==null?void 0:o.message):t;return s?g.jsx("p",{ref:r,id:i,className:ce("text-sm font-medium text-destructive",e),...n,children:s}):null});nL.displayName="FormMessage";const fie=pK,hie=mK,rL=x.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>g.jsx(BP,{ref:o,align:t,sideOffset:n,className:ce("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));rL.displayName=BP.displayName;const oL=x.forwardRef(({className:e,type:t,...n},r)=>g.jsx("input",{type:t,className:ce("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));oL.displayName="Input";const pie=kK,mie=LK,gie=cA,yie=FK,wie=jK,iL=x.forwardRef(({className:e,...t},n)=>g.jsx(aA,{ref:n,className:ce("flex h-10 items-center space-x-1 rounded-md border bg-background p-1",e),...t}));iL.displayName=aA.displayName;const sL=x.forwardRef(({className:e,...t},n)=>g.jsx(lA,{ref:n,className:ce("flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e),...t}));sL.displayName=lA.displayName;const aL=x.forwardRef(({className:e,inset:t,children:n,...r},o)=>g.jsxs(yA,{ref:o,className:ce("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...r,children:[n,g.jsx(Ti,{className:"ml-auto h-4 w-4"})]}));aL.displayName=yA.displayName;const lL=x.forwardRef(({className:e,...t},n)=>g.jsx(wA,{ref:n,className:ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));lL.displayName=wA.displayName;const cL=x.forwardRef(({className:e,align:t="start",alignOffset:n=-4,sideOffset:r=8,...o},i)=>g.jsx(cA,{children:g.jsx(uA,{ref:i,align:t,alignOffset:n,sideOffset:r,className:ce("z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));cL.displayName=uA.displayName;const uL=x.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(fA,{ref:r,className:ce("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));uL.displayName=fA.displayName;const dL=x.forwardRef(({className:e,children:t,checked:n,...r},o)=>g.jsxs(hA,{ref:o,className:ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(mA,{children:g.jsx(ja,{className:"h-4 w-4"})})}),t]}));dL.displayName=hA.displayName;const fL=x.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(pA,{ref:r,className:ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(mA,{children:g.jsx(Uf,{className:"h-2 w-2 fill-current"})})}),t]}));fL.displayName=pA.displayName;const hL=x.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(dA,{ref:r,className:ce("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));hL.displayName=dA.displayName;const pL=x.forwardRef(({className:e,...t},n)=>g.jsx(gA,{ref:n,className:ce("-mx-1 my-1 h-px bg-primary",e),...t}));pL.displayName=gA.displayName;const mL=({className:e,...t})=>g.jsx("span",{className:ce("ml-auto text-xs tracking-widest text-foreground",e),...t});mL.displayName="MenubarShortcut";const gL=x.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(zA,{ref:r,className:ce("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...n,children:[t,g.jsx(Tb,{})]}));gL.displayName=zA.displayName;const yL=x.forwardRef(({className:e,...t},n)=>g.jsx(BA,{ref:n,className:ce("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));yL.displayName=BA.displayName;const vie=e6,wL=cr("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"),vL=x.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(WA,{ref:r,className:ce(wL(),"group",e),...n,children:[t," ",g.jsx(Wf,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));vL.displayName=WA.displayName;const bL=x.forwardRef(({className:e,...t},n)=>g.jsx(UA,{ref:n,className:ce("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",e),...t}));bL.displayName=UA.displayName;const bie=t6,Tb=x.forwardRef(({className:e,...t},n)=>g.jsx("div",{className:ce("absolute left-0 top-full flex justify-center"),children:g.jsx(HA,{className:ce("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",e),ref:n,...t})}));Tb.displayName=HA.displayName;const _L=x.forwardRef(({className:e,...t},n)=>g.jsx(VA,{ref:n,className:ce("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:g.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));_L.displayName=VA.displayName;const SL=({className:e,...t})=>g.jsx("nav",{role:"navigation","aria-label":"pagination",className:ce("mx-auto flex w-full justify-center",e),...t});SL.displayName="Pagination";const xL=x.forwardRef(({className:e,...t},n)=>g.jsx("ul",{ref:n,className:ce("flex flex-row items-center gap-1",e),...t}));xL.displayName="PaginationContent";const EL=x.forwardRef(({className:e,...t},n)=>g.jsx("li",{ref:n,className:ce("",e),...t}));EL.displayName="PaginationItem";const Ja=x.forwardRef(({className:e,isActive:t,disabled:n,...r},o)=>g.jsx(Hr,{ref:o,"aria-current":t?"page":void 0,disabled:n,className:ce("h-9 w-9",{"pointer-events-none bg-accent":t,"pointer-events-none opacity-50":n},e),...r}));Ja.displayName="PaginationLink";const CL=x.forwardRef(({className:e,...t},n)=>g.jsxs(Ja,{ref:n,"aria-label":"Go to previous page",className:ce("gap-1 px-2 min-w-[100px]",e),...t,children:[g.jsx(Vf,{className:"h-4 w-4"}),g.jsx("span",{children:"Previous"})]}));CL.displayName="PaginationPrevious";const NL=x.forwardRef(({className:e,...t},n)=>g.jsxs(Ja,{ref:n,"aria-label":"Go to next page",className:ce("gap-1 px-2 min-w-[100px]",e),...t,children:[g.jsx("span",{children:"Next"}),g.jsx(Ti,{className:"h-4 w-4"})]}));NL.displayName="PaginationNext";const RL=x.forwardRef(({className:e,...t},n)=>g.jsx(Ja,{ref:n,"aria-label":"Go to first page",className:ce("",e),...t,children:g.jsx(wJ,{className:"h-4 w-4"})}));RL.displayName="PaginationFirst";const PL=x.forwardRef(({className:e,...t},n)=>g.jsx(Ja,{ref:n,"aria-label":"Go to last page",className:ce("",e),...t,children:g.jsx(vJ,{className:"h-4 w-4"})}));PL.displayName="PaginationLast";const AL=({className:e,...t})=>g.jsxs("span",{"aria-hidden":!0,className:ce("flex h-9 w-9 items-center justify-center",e),...t,children:[g.jsx(_J,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"More pages"})]});AL.displayName="PaginationEllipsis";const TL=x.forwardRef(({className:e,value:t,...n},r)=>g.jsx(cT,{ref:r,className:ce("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:g.jsx(b6,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));TL.displayName=cT.displayName;const DL=x.forwardRef(({className:e,...t},n)=>g.jsx(_T,{className:ce("grid gap-2",e),...t,ref:n}));DL.displayName=_T.displayName;const ML=x.forwardRef(({className:e,...t},n)=>g.jsx(ST,{ref:n,className:ce("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:g.jsx(T6,{className:"flex items-center justify-center",children:g.jsx(Uf,{className:"h-2.5 w-2.5 fill-current text-current"})})}));ML.displayName=ST.displayName;const{createElement:Qa,createContext:_ie,createRef:tle,forwardRef:IL,useCallback:Jn,useContext:OL,useEffect:As,useImperativeHandle:kL,useLayoutEffect:Sie,useMemo:xie,useRef:Qn,useState:Za}=w,LL=w[`useId${Math.random()}`.slice(0,5)],Eie=Sie,ph=_ie(null);ph.displayName="PanelGroupContext";const Ts=Eie,Cie=typeof LL=="function"?LL:()=>null;let Nie=0;function Db(e=null){const t=Cie(),n=Qn(e||t||null);return n.current===null&&(n.current=""+Nie++),e??n.current}function jL({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:o,forwardedRef:i,id:s,maxSize:a,minSize:l,onCollapse:c,onExpand:d,onResize:u,order:f,style:h,tagName:m="div",...p}){const y=OL(ph);if(y===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:v,expandPanel:b,getPanelSize:_,getPanelStyle:C,groupId:N,isPanelCollapsed:A,reevaluatePanelConstraints:R,registerPanel:D,resizePanel:k,unregisterPanel:F}=y,W=Db(s),B=Qn({callbacks:{onCollapse:c,onExpand:d,onResize:u},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:a,minSize:l},id:W,idIsFromProps:s!==void 0,order:f});Qn({didLogMissingDefaultSizeWarning:!1}),Ts(()=>{const{callbacks:Q,constraints:K}=B.current,Y={...K};B.current.id=W,B.current.idIsFromProps=s!==void 0,B.current.order=f,Q.onCollapse=c,Q.onExpand=d,Q.onResize=u,K.collapsedSize=n,K.collapsible=r,K.defaultSize=o,K.maxSize=a,K.minSize=l,(Y.collapsedSize!==K.collapsedSize||Y.collapsible!==K.collapsible||Y.maxSize!==K.maxSize||Y.minSize!==K.minSize)&&R(B.current,Y)}),Ts(()=>{const Q=B.current;return D(Q),()=>{F(Q)}},[f,W,D,F]),kL(i,()=>({collapse:()=>{v(B.current)},expand:Q=>{b(B.current,Q)},getId(){return W},getSize(){return _(B.current)},isCollapsed(){return A(B.current)},isExpanded(){return!A(B.current)},resize:Q=>{k(B.current,Q)}}),[v,b,_,A,W,k]);const T=C(B.current,o);return Qa(m,{...p,children:e,className:t,id:s,style:{...T,...h},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":N,"data-panel-id":W,"data-panel-size":parseFloat(""+T.flexGrow).toFixed(1)})}const FL=IL((e,t)=>Qa(jL,{...e,forwardedRef:t}));jL.displayName="Panel",FL.displayName="forwardRef(Panel)";let Mb=null,Ds=null;function Rie(e,t){if(t){const n=(t&GL)!==0,r=(t&YL)!==0,o=(t&qL)!==0,i=(t&KL)!==0;if(n)return o?"se-resize":i?"ne-resize":"e-resize";if(r)return o?"sw-resize":i?"nw-resize":"w-resize";if(o)return"s-resize";if(i)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function Pie(){Ds!==null&&(document.head.removeChild(Ds),Mb=null,Ds=null)}function Ib(e,t){const n=Rie(e,t);Mb!==n&&(Mb=n,Ds===null&&(Ds=document.createElement("style"),document.head.appendChild(Ds)),Ds.innerHTML=`*{cursor: ${n}!important;}`)}function $L(e){return e.type==="keydown"}function zL(e){return e.type.startsWith("pointer")}function BL(e){return e.type.startsWith("mouse")}function mh(e){if(zL(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(BL(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function Aie(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Tie(e,t,n){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Die(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:UL(e),b:UL(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;rt(r,"Stacking order can only be calculated for elements with a common ancestor");const o={a:VL(WL(n.a)),b:VL(WL(n.b))};if(o.a===o.b){const i=r.childNodes,s={a:n.a.at(-1),b:n.b.at(-1)};let a=i.length;for(;a--;){const l=i[a];if(l===s.a)return 1;if(l===s.b)return-1}}return Math.sign(o.a-o.b)}const Mie=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Iie(e){var t;const n=getComputedStyle((t=HL(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function Oie(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||Iie(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||Mie.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function WL(e){let t=e.length;for(;t--;){const n=e[t];if(rt(n,"Missing node"),Oie(n))return n}return null}function VL(e){return e&&Number(getComputedStyle(e).zIndex)||0}function UL(e){const t=[];for(;e;)t.push(e),e=HL(e);return t}function HL(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const GL=1,YL=2,qL=4,KL=8,kie=Aie()==="coarse";let Jr=[],el=!1,Li=new Map,gh=new Map;const Wc=new Set;function Lie(e,t,n,r,o){var i;const{ownerDocument:s}=t,a={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:o},l=(i=Li.get(s))!==null&&i!==void 0?i:0;return Li.set(s,l+1),Wc.add(a),yh(),function(){var d;gh.delete(e),Wc.delete(a);const u=(d=Li.get(s))!==null&&d!==void 0?d:1;if(Li.set(s,u-1),yh(),u===1&&Li.delete(s),Jr.includes(a)){const f=Jr.indexOf(a);f>=0&&Jr.splice(f,1),Lb(),o("up",!0,null)}}}function XL(e){const{target:t}=e,{x:n,y:r}=mh(e);el=!0,Ob({target:t,x:n,y:r}),yh(),Jr.length>0&&(wh("down",e),e.preventDefault(),e.stopPropagation())}function Vc(e){const{x:t,y:n}=mh(e);if(el&&e.buttons===0&&(el=!1,wh("up",e)),!el){const{target:r}=e;Ob({target:r,x:t,y:n})}wh("move",e),Lb(),Jr.length>0&&e.preventDefault()}function tl(e){const{target:t}=e,{x:n,y:r}=mh(e);gh.clear(),el=!1,Jr.length>0&&e.preventDefault(),wh("up",e),Ob({target:t,x:n,y:r}),Lb(),yh()}function Ob({target:e,x:t,y:n}){Jr.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),Wc.forEach(o=>{const{element:i,hitAreaMargins:s}=o,a=i.getBoundingClientRect(),{bottom:l,left:c,right:d,top:u}=a,f=kie?s.coarse:s.fine;if(t>=c-f&&t<=d+f&&n>=u-f&&n<=l+f){if(r!==null&&document.contains(r)&&i!==r&&!i.contains(r)&&!r.contains(i)&&Die(r,i)>0){let m=r,p=!1;for(;m&&!m.contains(i);){if(Tie(m.getBoundingClientRect(),a)){p=!0;break}m=m.parentElement}if(p)return}Jr.push(o)}})}function kb(e,t){gh.set(e,t)}function Lb(){let e=!1,t=!1;Jr.forEach(r=>{const{direction:o}=r;o==="horizontal"?e=!0:t=!0});let n=0;gh.forEach(r=>{n|=r}),e&&t?Ib("intersection",n):e?Ib("horizontal",n):t?Ib("vertical",n):Pie()}function yh(){Li.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",tl),n.removeEventListener("pointerdown",XL),n.removeEventListener("pointerleave",Vc),n.removeEventListener("pointermove",Vc)}),window.removeEventListener("pointerup",tl),window.removeEventListener("pointercancel",tl),Wc.size>0&&(el?(Jr.length>0&&Li.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",tl),n.addEventListener("pointerleave",Vc),n.addEventListener("pointermove",Vc))}),window.addEventListener("pointerup",tl),window.addEventListener("pointercancel",tl)):Li.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("pointerdown",XL,{capture:!0}),n.addEventListener("pointermove",Vc))}))}function wh(e,t){Wc.forEach(n=>{const{setResizeHandlerState:r}=n,o=Jr.includes(n);r(e,o,t)})}function jie(){const[e,t]=Za(0);return Jn(()=>t(n=>n+1),[])}function rt(e,t){if(!e)throw console.error(t),Error(t)}const jb=10;function Ms(e,t,n=jb){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function Zo(e,t,n=jb){return Ms(e,t,n)===0}function fr(e,t,n){return Ms(e,t,n)===0}function Fie(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const o=e[r],i=t[r];if(!fr(o,i,n))return!1}return!0}function nl({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];rt(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:o=0,collapsible:i,maxSize:s=100,minSize:a=0}=r;if(Ms(n,a)<0)if(i){const l=(o+a)/2;Ms(n,l)<0?n=o:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(jb)),n}function Uc({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:o,trigger:i}){if(fr(e,0))return t;const s=[...t],[a,l]=r;rt(a!=null,"Invalid first pivot index"),rt(l!=null,"Invalid second pivot index");let c=0;if(i==="keyboard"){{const u=e<0?l:a,f=n[u];rt(f,`Panel constraints not found for index ${u}`);const{collapsedSize:h=0,collapsible:m,minSize:p=0}=f;if(m){const y=t[u];if(rt(y!=null,`Previous layout not found for panel index ${u}`),fr(y,h)){const v=p-y;Ms(v,Math.abs(e))>0&&(e=e<0?0-v:v)}}}{const u=e<0?a:l,f=n[u];rt(f,`No panel constraints found for index ${u}`);const{collapsedSize:h=0,collapsible:m,minSize:p=0}=f;if(m){const y=t[u];if(rt(y!=null,`Previous layout not found for panel index ${u}`),fr(y,p)){const v=y-h;Ms(v,Math.abs(e))>0&&(e=e<0?0-v:v)}}}}{const u=e<0?1:-1;let f=e<0?l:a,h=0;for(;;){const p=t[f];rt(p!=null,`Previous layout not found for panel index ${f}`);const v=nl({panelConstraints:n,panelIndex:f,size:100})-p;if(h+=v,f+=u,f<0||f>=n.length)break}const m=Math.min(Math.abs(e),Math.abs(h));e=e<0?0-m:m}{let f=e<0?a:l;for(;f>=0&&f<n.length;){const h=Math.abs(e)-Math.abs(c),m=t[f];rt(m!=null,`Previous layout not found for panel index ${f}`);const p=m-h,y=nl({panelConstraints:n,panelIndex:f,size:p});if(!fr(m,y)&&(c+=m-y,s[f]=y,c.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(Fie(o,s))return o;{const u=e<0?l:a,f=t[u];rt(f!=null,`Previous layout not found for panel index ${u}`);const h=f+c,m=nl({panelConstraints:n,panelIndex:u,size:h});if(s[u]=m,!fr(m,h)){let p=h-m,v=e<0?l:a;for(;v>=0&&v<n.length;){const b=s[v];rt(b!=null,`Previous layout not found for panel index ${v}`);const _=b+p,C=nl({panelConstraints:n,panelIndex:v,size:_});if(fr(b,C)||(p-=C-b,s[v]=C),fr(p,0))break;e>0?v--:v++}}}const d=s.reduce((u,f)=>f+u,0);return fr(d,100)?s:o}function $ie({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,i=0,s=0;const a=n[0];rt(a!=null,"No pivot index found"),t.forEach((u,f)=>{const{constraints:h}=u,{maxSize:m=100,minSize:p=0}=h;f===a?(r=p,o=m):(i+=p,s+=m)});const l=Math.min(o,100-i),c=Math.max(r,100-s),d=e[a];return{valueMax:l,valueMin:c,valueNow:d}}function Hc(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function JL(e,t,n=document){const o=Hc(e,n).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===t);return o??null}function QL(e,t,n){const r=JL(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function ZL(e,t=document){var n;if(t instanceof HTMLElement&&(t==null||(n=t.dataset)===null||n===void 0?void 0:n.panelGroupId)==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function vh(e,t=document){const n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function zie(e,t,n,r=document){var o,i,s,a;const l=vh(t,r),c=Hc(e,r),d=l?c.indexOf(l):-1,u=(o=(i=n[d])===null||i===void 0?void 0:i.id)!==null&&o!==void 0?o:null,f=(s=(a=n[d+1])===null||a===void 0?void 0:a.id)!==null&&s!==void 0?s:null;return[u,f]}function Bie({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,panelGroupElement:i,setLayout:s}){Qn({didWarnAboutMissingResizeHandle:!1}),Ts(()=>{if(!i)return;const a=Hc(n,i);for(let l=0;l<o.length-1;l++){const{valueMax:c,valueMin:d,valueNow:u}=$ie({layout:r,panelsArray:o,pivotIndices:[l,l+1]}),f=a[l];if(f!=null){const h=o[l];rt(h,`No panel data found for index "${l}"`),f.setAttribute("aria-controls",h.id),f.setAttribute("aria-valuemax",""+Math.round(c)),f.setAttribute("aria-valuemin",""+Math.round(d)),f.setAttribute("aria-valuenow",u!=null?""+Math.round(u):"")}}return()=>{a.forEach((l,c)=>{l.removeAttribute("aria-controls"),l.removeAttribute("aria-valuemax"),l.removeAttribute("aria-valuemin"),l.removeAttribute("aria-valuenow")})}},[n,r,o,i]),As(()=>{if(!i)return;const a=t.current;rt(a,"Eager values not found");const{panelDataArray:l}=a,c=ZL(n,i);rt(c!=null,`No group found for id "${n}"`);const d=Hc(n,i);rt(d,`No resize handles found for group id "${n}"`);const u=d.map(f=>{const h=f.getAttribute("data-panel-resize-handle-id");rt(h,"Resize handle element has no handle id attribute");const[m,p]=zie(n,h,l,i);if(m==null||p==null)return()=>{};const y=v=>{if(!v.defaultPrevented)switch(v.key){case"Enter":{v.preventDefault();const b=l.findIndex(_=>_.id===m);if(b>=0){const _=l[b];rt(_,`No panel data found for index ${b}`);const C=r[b],{collapsedSize:N=0,collapsible:A,minSize:R=0}=_.constraints;if(C!=null&&A){const D=Uc({delta:fr(C,N)?R-N:N-C,initialLayout:r,panelConstraints:l.map(k=>k.constraints),pivotIndices:QL(n,h,i),prevLayout:r,trigger:"keyboard"});r!==D&&s(D)}}break}}};return f.addEventListener("keydown",y),()=>{f.removeEventListener("keydown",y)}});return()=>{u.forEach(f=>f())}},[i,e,t,n,r,o,s])}function ej(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function tj(e,t){const n=e==="horizontal",{x:r,y:o}=mh(t);return n?r:o}function Wie(e,t,n,r,o){const i=n==="horizontal",s=vh(t,o);rt(s,`No resize handle element found for id "${t}"`);const a=s.getAttribute("data-panel-group-id");rt(a,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=r;const c=tj(n,e),d=ZL(a,o);rt(d,`No group element found for id "${a}"`);const u=d.getBoundingClientRect(),f=i?u.width:u.height;return(c-l)/f*100}function Vie(e,t,n,r,o,i){if($L(e)){const s=n==="horizontal";let a=0;e.shiftKey?a=100:o!=null?a=o:a=10;let l=0;switch(e.key){case"ArrowDown":l=s?0:a;break;case"ArrowLeft":l=s?-a:0;break;case"ArrowRight":l=s?a:0;break;case"ArrowUp":l=s?0:-a;break;case"End":l=100;break;case"Home":l=-100;break}return l}else return r==null?0:Wie(e,t,n,r,i)}function Uie({panelDataArray:e}){const t=Array(e.length),n=e.map(i=>i.constraints);let r=0,o=100;for(let i=0;i<e.length;i++){const s=n[i];rt(s,`Panel constraints not found for index ${i}`);const{defaultSize:a}=s;a!=null&&(r++,t[i]=a,o-=a)}for(let i=0;i<e.length;i++){const s=n[i];rt(s,`Panel constraints not found for index ${i}`);const{defaultSize:a}=s;if(a!=null)continue;const l=e.length-r,c=o/l;r++,t[i]=c,o-=c}return t}function rl(e,t,n){t.forEach((r,o)=>{const i=e[o];rt(i,`Panel data not found for index ${o}`);const{callbacks:s,constraints:a,id:l}=i,{collapsedSize:c=0,collapsible:d}=a,u=n[l];if(u==null||r!==u){n[l]=r;const{onCollapse:f,onExpand:h,onResize:m}=s;m&&m(r,u),d&&(f||h)&&(h&&(u==null||Zo(u,c))&&!Zo(r,c)&&h(),f&&(u==null||!Zo(u,c))&&Zo(r,c)&&f())}})}function bh(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function Hie({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:o,precision:i=3}){const s=n[o];let a;return s==null?a=e!=null?e.toPrecision(i):"1":r.length===1?a="1":a=s.toPrecision(i),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function Gie(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function nj(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function rj(e){return`react-resizable-panels:${e}`}function oj(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:o,order:i}=t;return o?r:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function ij(e,t){try{const n=rj(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function Yie(e,t,n){var r,o;const i=(r=ij(e,n))!==null&&r!==void 0?r:{},s=oj(t);return(o=i[s])!==null&&o!==void 0?o:null}function qie(e,t,n,r,o){var i;const s=rj(e),a=oj(t),l=(i=ij(e,o))!==null&&i!==void 0?i:{};l[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{o.setItem(s,JSON.stringify(l))}catch(c){console.error(c)}}function sj({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((i,s)=>i+s,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!fr(r,100)&&n.length>0)for(let i=0;i<t.length;i++){const s=n[i];rt(s!=null,`No layout data found for index ${i}`);const a=100/r*s;n[i]=a}let o=0;for(let i=0;i<t.length;i++){const s=n[i];rt(s!=null,`No layout data found for index ${i}`);const a=nl({panelConstraints:t,panelIndex:i,size:s});s!=a&&(o+=s-a,n[i]=a)}if(!fr(o,0))for(let i=0;i<t.length;i++){const s=n[i];rt(s!=null,`No layout data found for index ${i}`);const a=s+o,l=nl({panelConstraints:t,panelIndex:i,size:a});if(s!==l&&(o-=l-s,n[i]=l,fr(o,0)))break}return n}const Kie=100,Gc={getItem:e=>(nj(Gc),Gc.getItem(e)),setItem:(e,t)=>{nj(Gc),Gc.setItem(e,t)}},aj={};function lj({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=Gc,style:c,tagName:d="div",...u}){const f=Db(i),h=Qn(null),[m,p]=Za(null),[y,v]=Za([]),b=jie(),_=Qn({}),C=Qn(new Map),N=Qn(0),A=Qn({autoSaveId:e,direction:r,dragState:m,id:f,keyboardResizeBy:a,onLayout:s,storage:l}),R=Qn({layout:y,panelDataArray:[],panelDataArrayChanged:!1});Qn({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),kL(o,()=>({getId:()=>A.current.id,getLayout:()=>{const{layout:L}=R.current;return L},setLayout:L=>{const{onLayout:ne}=A.current,{layout:fe,panelDataArray:H}=R.current,ae=sj({layout:L,panelConstraints:H.map(V=>V.constraints)});ej(fe,ae)||(v(ae),R.current.layout=ae,ne&&ne(ae),rl(H,ae,_.current))}}),[]),Ts(()=>{A.current.autoSaveId=e,A.current.direction=r,A.current.dragState=m,A.current.id=f,A.current.onLayout=s,A.current.storage=l}),Bie({committedValuesRef:A,eagerValuesRef:R,groupId:f,layout:y,panelDataArray:R.current.panelDataArray,setLayout:v,panelGroupElement:h.current}),As(()=>{const{panelDataArray:L}=R.current;if(e){if(y.length===0||y.length!==L.length)return;let ne=aj[e];ne==null&&(ne=Gie(qie,Kie),aj[e]=ne);const fe=[...L],H=new Map(C.current);ne(e,fe,H,y,l)}},[e,y,l]),As(()=>{});const D=Jn(L=>{const{onLayout:ne}=A.current,{layout:fe,panelDataArray:H}=R.current;if(L.constraints.collapsible){const ae=H.map(pe=>pe.constraints),{collapsedSize:V=0,panelSize:de,pivotIndices:ge}=Is(H,L,fe);if(rt(de!=null,`Panel size not found for panel "${L.id}"`),!Zo(de,V)){C.current.set(L.id,de);const oe=ol(H,L)===H.length-1?de-V:V-de,$=Uc({delta:oe,initialLayout:fe,panelConstraints:ae,pivotIndices:ge,prevLayout:fe,trigger:"imperative-api"});bh(fe,$)||(v($),R.current.layout=$,ne&&ne($),rl(H,$,_.current))}}},[]),k=Jn((L,ne)=>{const{onLayout:fe}=A.current,{layout:H,panelDataArray:ae}=R.current;if(L.constraints.collapsible){const V=ae.map(j=>j.constraints),{collapsedSize:de=0,panelSize:ge=0,minSize:pe=0,pivotIndices:oe}=Is(ae,L,H),$=ne??pe;if(Zo(ge,de)){const j=C.current.get(L.id),le=j!=null&&j>=$?j:$,we=ol(ae,L)===ae.length-1?ge-le:le-ge,M=Uc({delta:we,initialLayout:H,panelConstraints:V,pivotIndices:oe,prevLayout:H,trigger:"imperative-api"});bh(H,M)||(v(M),R.current.layout=M,fe&&fe(M),rl(ae,M,_.current))}}},[]),F=Jn(L=>{const{layout:ne,panelDataArray:fe}=R.current,{panelSize:H}=Is(fe,L,ne);return rt(H!=null,`Panel size not found for panel "${L.id}"`),H},[]),W=Jn((L,ne)=>{const{panelDataArray:fe}=R.current,H=ol(fe,L);return Hie({defaultSize:ne,dragState:m,layout:y,panelData:fe,panelIndex:H})},[m,y]),B=Jn(L=>{const{layout:ne,panelDataArray:fe}=R.current,{collapsedSize:H=0,collapsible:ae,panelSize:V}=Is(fe,L,ne);return rt(V!=null,`Panel size not found for panel "${L.id}"`),ae===!0&&Zo(V,H)},[]),T=Jn(L=>{const{layout:ne,panelDataArray:fe}=R.current,{collapsedSize:H=0,collapsible:ae,panelSize:V}=Is(fe,L,ne);return rt(V!=null,`Panel size not found for panel "${L.id}"`),!ae||Ms(V,H)>0},[]),Q=Jn(L=>{const{panelDataArray:ne}=R.current;ne.push(L),ne.sort((fe,H)=>{const ae=fe.order,V=H.order;return ae==null&&V==null?0:ae==null?-1:V==null?1:ae-V}),R.current.panelDataArrayChanged=!0,b()},[b]);Ts(()=>{if(R.current.panelDataArrayChanged){R.current.panelDataArrayChanged=!1;const{autoSaveId:L,onLayout:ne,storage:fe}=A.current,{layout:H,panelDataArray:ae}=R.current;let V=null;if(L){const ge=Yie(L,ae,fe);ge&&(C.current=new Map(Object.entries(ge.expandToSizes)),V=ge.layout)}V==null&&(V=Uie({panelDataArray:ae}));const de=sj({layout:V,panelConstraints:ae.map(ge=>ge.constraints)});ej(H,de)||(v(de),R.current.layout=de,ne&&ne(de),rl(ae,de,_.current))}}),Ts(()=>{const L=R.current;return()=>{L.layout=[]}},[]);const K=Jn(L=>{let ne=!1;const fe=h.current;return fe&&window.getComputedStyle(fe,null).getPropertyValue("direction")==="rtl"&&(ne=!0),function(ae){ae.preventDefault();const V=h.current;if(!V)return()=>null;const{direction:de,dragState:ge,id:pe,keyboardResizeBy:oe,onLayout:$}=A.current,{layout:j,panelDataArray:le}=R.current,{initialLayout:ve}=ge??{},we=QL(pe,L,V);let M=Vie(ae,L,de,ge,oe,V);const q=de==="horizontal";q&&ne&&(M=-M);const te=le.map(ye=>ye.constraints),Se=Uc({delta:M,initialLayout:ve??j,panelConstraints:te,pivotIndices:we,prevLayout:j,trigger:$L(ae)?"keyboard":"mouse-or-touch"}),ue=!bh(j,Se);(zL(ae)||BL(ae))&&N.current!=M&&(N.current=M,!ue&&M!==0?q?kb(L,M<0?GL:YL):kb(L,M<0?qL:KL):kb(L,0)),ue&&(v(Se),R.current.layout=Se,$&&$(Se),rl(le,Se,_.current))}},[]),Y=Jn((L,ne)=>{const{onLayout:fe}=A.current,{layout:H,panelDataArray:ae}=R.current,V=ae.map(j=>j.constraints),{panelSize:de,pivotIndices:ge}=Is(ae,L,H);rt(de!=null,`Panel size not found for panel "${L.id}"`);const oe=ol(ae,L)===ae.length-1?de-ne:ne-de,$=Uc({delta:oe,initialLayout:H,panelConstraints:V,pivotIndices:ge,prevLayout:H,trigger:"imperative-api"});bh(H,$)||(v($),R.current.layout=$,fe&&fe($),rl(ae,$,_.current))},[]),ee=Jn((L,ne)=>{const{layout:fe,panelDataArray:H}=R.current,{collapsedSize:ae=0,collapsible:V}=ne,{collapsedSize:de=0,collapsible:ge,maxSize:pe=100,minSize:oe=0}=L.constraints,{panelSize:$}=Is(H,L,fe);$!=null&&(V&&ge&&Zo($,ae)?Zo(ae,de)||Y(L,de):$<oe?Y(L,oe):$>pe&&Y(L,pe))},[Y]),G=Jn((L,ne)=>{const{direction:fe}=A.current,{layout:H}=R.current;if(!h.current)return;const ae=vh(L,h.current);rt(ae,`Drag handle element not found for id "${L}"`);const V=tj(fe,ne);p({dragHandleId:L,dragHandleRect:ae.getBoundingClientRect(),initialCursorPosition:V,initialLayout:H})},[]),re=Jn(()=>{p(null)},[]),X=Jn(L=>{const{panelDataArray:ne}=R.current,fe=ol(ne,L);fe>=0&&(ne.splice(fe,1),delete _.current[L.id],R.current.panelDataArrayChanged=!0,b())},[b]),J=xie(()=>({collapsePanel:D,direction:r,dragState:m,expandPanel:k,getPanelSize:F,getPanelStyle:W,groupId:f,isPanelCollapsed:B,isPanelExpanded:T,reevaluatePanelConstraints:ee,registerPanel:Q,registerResizeHandle:K,resizePanel:Y,startDragging:G,stopDragging:re,unregisterPanel:X,panelGroupElement:h.current}),[D,m,r,k,F,W,f,B,T,ee,Q,K,Y,G,re,X]),se={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Qa(ph.Provider,{value:J},Qa(d,{...u,children:t,className:n,id:i,ref:h,style:{...se,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":f}))}const cj=IL((e,t)=>Qa(lj,{...e,forwardedRef:t}));lj.displayName="PanelGroup",cj.displayName="forwardRef(PanelGroup)";function ol(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Is(e,t,n){const r=ol(e,t),i=r===e.length-1?[r-1,r]:[r,r+1],s=n[r];return{...t.constraints,panelSize:s,pivotIndices:i}}function Xie({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){As(()=>{if(e||n==null||r==null)return;const o=vh(t,r);if(o==null)return;const i=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),n(s);break}case"F6":{s.preventDefault();const a=o.getAttribute("data-panel-group-id");rt(a,`No group element found for id "${a}"`);const l=Hc(a,r),c=JL(a,t,r);rt(c!==null,`No resize element found for id "${t}"`);const d=s.shiftKey?c>0?c-1:l.length-1:c+1<l.length?c+1:0;l[d].focus();break}}};return o.addEventListener("keydown",i),()=>{o.removeEventListener("keydown",i)}},[r,e,t,n])}function uj({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:o,onBlur:i,onDragging:s,onFocus:a,style:l={},tabIndex:c=0,tagName:d="div",...u}){var f,h;const m=Qn(null),p=Qn({onDragging:s});As(()=>{p.current.onDragging=s});const y=OL(ph);if(y===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:v,groupId:b,registerResizeHandle:_,startDragging:C,stopDragging:N,panelGroupElement:A}=y,R=Db(o),[D,k]=Za("inactive"),[F,W]=Za(!1),[B,T]=Za(null),Q=Qn({state:D});Ts(()=>{Q.current.state=D}),As(()=>{if(n)T(null);else{const G=_(R);T(()=>G)}},[n,R,_]);const K=(f=r==null?void 0:r.coarse)!==null&&f!==void 0?f:15,Y=(h=r==null?void 0:r.fine)!==null&&h!==void 0?h:5;return As(()=>{if(n||B==null)return;const G=m.current;return rt(G,"Element ref not attached"),Lie(R,G,v,{coarse:K,fine:Y},(X,J,se)=>{if(J)switch(X){case"down":{k("drag"),rt(se,'Expected event to be defined for "down" action'),C(R,se);const{onDragging:L}=p.current;L&&L(!0);break}case"move":{const{state:L}=Q.current;L!=="drag"&&k("hover"),rt(se,'Expected event to be defined for "move" action'),B(se);break}case"up":{k("hover"),N();const{onDragging:L}=p.current;L&&L(!1);break}}else k("inactive")})},[K,v,n,Y,_,R,B,C,N]),Xie({disabled:n,handleId:R,resizeHandler:B,panelGroupElement:A}),Qa(d,{...u,children:e,className:t,id:o,onBlur:()=>{W(!1),i==null||i()},onFocus:()=>{W(!0),a==null||a()},ref:m,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...l},tabIndex:c,"data-panel-group-direction":v,"data-panel-group-id":b,"data-resize-handle":"","data-resize-handle-active":D==="drag"?"pointer":F?"keyboard":void 0,"data-resize-handle-state":D,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":R})}uj.displayName="PanelResizeHandle";const dj=x.forwardRef(({className:e,...t},n)=>g.jsx(cj,{ref:n,className:ce("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}));dj.displayName="ResizablePanelGroup";const fj=x.forwardRef(({className:e,...t},n)=>g.jsx(FL,{ref:n,className:ce("relative flex h-full w-full",e),...t}));fj.displayName="ResizablePanel";const hj=({className:e,...t})=>g.jsx(uj,{className:ce("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-4 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-4 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",e),...t,children:g.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"8",height:"8",viewBox:"0 0 8 8",fill:"currentColor",children:[g.jsx("circle",{cx:"2",cy:"4",r:"0.75"}),g.jsx("circle",{cx:"6",cy:"4",r:"0.75"})]})})});hj.displayName="ResizableHandle";const pj=x.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(LT,{ref:r,className:ce("relative overflow-hidden",e),...n,children:[g.jsx(W6,{className:"h-full w-full rounded-[inherit]",children:t}),g.jsx(Fb,{}),g.jsx(V6,{})]}));pj.displayName=LT.displayName;const Fb=x.forwardRef(({className:e,orientation:t="vertical",...n},r)=>g.jsx(Nw,{ref:r,orientation:t,className:ce("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:g.jsx(TT,{className:"relative flex-1 rounded-full bg-border"})}));Fb.displayName=Nw.displayName;const Jie=lX,Qie=hX,Zie=cX,mj=x.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(fD,{ref:r,className:ce("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,g.jsx(uX,{asChild:!0,children:g.jsx(Wf,{className:"h-4 w-4 opacity-50"})})]}));mj.displayName=fD.displayName;const $b=x.forwardRef(({className:e,...t},n)=>g.jsx(gD,{ref:n,className:ce("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(yJ,{className:"h-4 w-4"})}));$b.displayName=gD.displayName;const zb=x.forwardRef(({className:e,...t},n)=>g.jsx(yD,{ref:n,className:ce("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(Wf,{className:"h-4 w-4"})}));zb.displayName=yD.displayName;const gj=x.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>g.jsx(dX,{children:g.jsxs(hD,{ref:o,className:ce("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[g.jsx($b,{}),g.jsx(fX,{className:ce("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),g.jsx(zb,{})]})}));gj.displayName=hD.displayName;const yj=x.forwardRef(({className:e,...t},n)=>g.jsx(pD,{ref:n,className:ce("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));yj.displayName=pD.displayName;const wj=x.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(mD,{ref:r,className:ce("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(mX,{children:g.jsx(ja,{className:"h-4 w-4"})})}),g.jsx(pX,{children:t})]}));wj.displayName=mD.displayName;const vj=x.forwardRef(({className:e,...t},n)=>g.jsx(wD,{ref:n,className:ce("-mx-1 my-1 h-px bg-primary",e),...t}));vj.displayName=wD.displayName;const bj=x.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>g.jsx(_D,{ref:o,decorative:n,orientation:t,className:ce("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));bj.displayName=_D.displayName;const ese=rf,tse=of,_j=ba,Sj=sf,Bb=x.forwardRef(({className:e,...t},n)=>g.jsx(ga,{className:ce("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,ref:n}));Bb.displayName=ga.displayName;const nse=cr("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),xj=x.forwardRef(({side:e="right",className:t,children:n,...r},o)=>g.jsxs(Sj,{children:[g.jsx(Bb,{}),g.jsxs(ya,{ref:o,className:ce(nse({side:e}),t),...r,children:[n,g.jsxs(_j,{className:"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-secondary",children:[g.jsx(bM,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));xj.displayName=ya.displayName;const Ej=({className:e,...t})=>g.jsx("div",{className:ce("flex flex-col space-y-2 text-center sm:text-left",e),...t});Ej.displayName="SheetHeader";const Cj=({className:e,...t})=>g.jsx("div",{className:ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Cj.displayName="SheetFooter";const Nj=x.forwardRef(({className:e,...t},n)=>g.jsx(wa,{ref:n,className:ce("text-lg font-semibold text-foreground",e),...t}));Nj.displayName=wa.displayName;const Rj=x.forwardRef(({className:e,...t},n)=>g.jsx(va,{ref:n,className:ce("text-sm text-foreground",e),...t}));Rj.displayName=va.displayName;const Pj=x.forwardRef(({className:e,variant:t,size:n,collapsed:r,fixed:o,...i},s)=>{const{variants:a}=Mi(),l=x.useMemo(()=>cr(a.sidebar.defaultStyles,{variants:a.sidebar.variantStyles,defaultVariants:a.sidebar.defaultVariants}),[a]);return g.jsx("div",{ref:s,className:ce(l({variant:t,size:n,collapsed:r}),o&&"fixed inset-y-0 left-0",e),...i})});Pj.displayName="Sidebar";const Aj=x.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:ce("flex items-center justify-center py-4",e),...t}));Aj.displayName="SidebarHeader";const Tj=x.forwardRef(({className:e,...t},n)=>g.jsx("nav",{ref:n,className:ce("flex-1 space-y-1",e),...t}));Tj.displayName="SidebarNav";const Dj=x.forwardRef(({className:e,children:t,icon:n,badge:r,variant:o,active:i,...s},a)=>{const{variants:l}=Mi(),c=x.useMemo(()=>cr(l.sidebarItem.defaultStyles,{variants:l.sidebarItem.variantStyles,defaultVariants:l.sidebarItem.defaultVariants}),[l]);return g.jsxs("div",{ref:a,className:ce(c({variant:i?"active":o}),e),...s,children:[n&&g.jsx("span",{className:"shrink-0",children:n}),g.jsx("span",{className:"flex-1 truncate",children:t}),r&&g.jsx("span",{children:r})]})});Dj.displayName="SidebarItem";const Mj=x.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:ce("space-y-3 py-2",e),role:"group",...t}));Mj.displayName="SidebarGroup";const Ij=x.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:ce("mt-auto",e),...t}));Ij.displayName="SidebarFooter";function rse({className:e,...t}){return g.jsx("div",{className:ce("animate-pulse rounded-md bg-primary",e),...t})}const Oj=x.forwardRef(({className:e,...t},n)=>g.jsxs(kD,{ref:n,className:ce("relative flex w-full touch-none select-none items-center",e),...t,children:[g.jsx(OX,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:g.jsx(kX,{className:"absolute h-full bg-primary"})}),g.jsx(LX,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));Oj.displayName=kD.displayName;var ose=(e,t,n,r,o,i,s,a)=>{let l=document.documentElement,c=["light","dark"];function d(h){(Array.isArray(e)?e:[e]).forEach(m=>{let p=m==="class",y=p&&i?o.map(v=>i[v]||v):o;p?(l.classList.remove(...y),l.classList.add(h)):l.setAttribute(m,h)}),u(h)}function u(h){a&&c.includes(h)&&(l.style.colorScheme=h)}function f(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)d(r);else try{let h=localStorage.getItem(t)||n,m=s&&h==="system"?f():h;d(m)}catch{}},ise=w.createContext(void 0),sse={setTheme:e=>{},themes:[]},ase=()=>{var e;return(e=w.useContext(ise))!=null?e:sse};w.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:i,value:s,themes:a,nonce:l,scriptProps:c})=>{let d=JSON.stringify([n,t,i,e,a,s,r,o]).slice(1,-1);return w.createElement("script",{...c,suppressHydrationWarning:!0,nonce:typeof window>"u"?l:"",dangerouslySetInnerHTML:{__html:`(${ose.toString()})(${d})`}})});function lse(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const cse=e=>{switch(e){case"success":return fse;case"info":return pse;case"warning":return hse;case"error":return mse;default:return null}},use=Array(12).fill(0),dse=({visible:e,className:t})=>x.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},x.createElement("div",{className:"sonner-spinner"},use.map((n,r)=>x.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),fse=x.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},x.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),hse=x.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},x.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),pse=x.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},x.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),mse=x.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},x.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),gse=x.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},x.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),x.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),yse=()=>{const[e,t]=x.useState(document.hidden);return x.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Wb=1;class wse{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...o}=t,i=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Wb++,s=this.toasts.find(l=>l.id===i),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),s?this.toasts=this.toasts.map(l=>l.id===i?(this.publish({...l,...t,id:i,title:r}),{...l,...t,id:i,dismissible:a,title:r}):l):this.addToast({title:r,...o,dismissible:a,id:i}),i},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0}))),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let i=r!==void 0,s;const a=o.then(async c=>{if(s=["resolve",c],x.isValidElement(c))i=!1,this.create({id:r,type:"default",message:c});else if(bse(c)&&!c.ok){i=!1;const u=typeof n.error=="function"?await n.error(`HTTP error! status: ${c.status}`):n.error,f=typeof n.description=="function"?await n.description(`HTTP error! status: ${c.status}`):n.description,h=typeof u=="object"?u:{message:u};this.create({id:r,type:"error",description:f,...h})}else if(c instanceof Error){i=!1;const u=typeof n.error=="function"?await n.error(c):n.error,f=typeof n.description=="function"?await n.description(c):n.description,h=typeof u=="object"?u:{message:u};this.create({id:r,type:"error",description:f,...h})}else if(n.success!==void 0){i=!1;const u=typeof n.success=="function"?await n.success(c):n.success,f=typeof n.description=="function"?await n.description(c):n.description,h=typeof u=="object"?u:{message:u};this.create({id:r,type:"success",description:f,...h})}}).catch(async c=>{if(s=["reject",c],n.error!==void 0){i=!1;const d=typeof n.error=="function"?await n.error(c):n.error,u=typeof n.description=="function"?await n.description(c):n.description,f=typeof d=="object"?d:{message:d};this.create({id:r,type:"error",description:u,...f})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),l=()=>new Promise((c,d)=>a.then(()=>s[0]==="reject"?d(s[1]):c(s[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||Wb++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Zn=new wse,vse=(e,t)=>{const n=(t==null?void 0:t.id)||Wb++;return Zn.addToast({title:e,...t,id:n}),n},bse=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",_se=vse,Sse=()=>Zn.toasts,xse=()=>Zn.getActiveToasts();Object.assign(_se,{success:Zn.success,info:Zn.info,warning:Zn.warning,error:Zn.error,custom:Zn.custom,message:Zn.message,promise:Zn.promise,dismiss:Zn.dismiss,loading:Zn.loading},{getHistory:Sse,getToasts:xse}),lse("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}[data-sonner-toaster][data-lifted=true]{transform:translateY(-8px)}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function _h(e){return e.label!==void 0}const Ese=3,Cse="24px",Nse="16px",kj=4e3,Rse=356,Pse=14,Ase=45,Tse=200;function Ro(...e){return e.filter(Boolean).join(" ")}function Dse(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const Mse=e=>{var t,n,r,o,i,s,a,l,c;const{invert:d,toast:u,unstyled:f,interacting:h,setHeights:m,visibleToasts:p,heights:y,index:v,toasts:b,expanded:_,removeToast:C,defaultRichColors:N,closeButton:A,style:R,cancelButtonStyle:D,actionButtonStyle:k,className:F="",descriptionClassName:W="",duration:B,position:T,gap:Q,expandByDefault:K,classNames:Y,icons:ee,closeButtonAriaLabel:G="Close toast"}=e,[re,X]=x.useState(null),[J,se]=x.useState(null),[L,ne]=x.useState(!1),[fe,H]=x.useState(!1),[ae,V]=x.useState(!1),[de,ge]=x.useState(!1),[pe,oe]=x.useState(!1),[$,j]=x.useState(0),[le,ve]=x.useState(0),we=x.useRef(u.duration||B||kj),M=x.useRef(null),q=x.useRef(null),te=v===0,Se=v+1<=p,ue=u.type,ye=u.dismissible!==!1,xe=u.className||"",Ae=u.descriptionClassName||"",Ze=x.useMemo(()=>y.findIndex(Me=>Me.toastId===u.id)||0,[y,u.id]),P=x.useMemo(()=>{var Me;return(Me=u.closeButton)!=null?Me:A},[u.closeButton,A]),S=x.useMemo(()=>u.duration||B||kj,[u.duration,B]),E=x.useRef(0),I=x.useRef(0),U=x.useRef(0),ie=x.useRef(null),[Z,Re]=T.split("-"),ct=x.useMemo(()=>y.reduce((Me,ot,Je)=>Je>=Ze?Me:Me+ot.height,0),[y,Ze]),ft=yse(),yt=u.invert||d,et=ue==="loading";I.current=x.useMemo(()=>Ze*Q+ct,[Ze,ct]),x.useEffect(()=>{we.current=S},[S]),x.useEffect(()=>{ne(!0)},[]),x.useEffect(()=>{const Me=q.current;if(Me){const ot=Me.getBoundingClientRect().height;return ve(ot),m(Je=>[{toastId:u.id,height:ot,position:u.position},...Je]),()=>m(Je=>Je.filter(xt=>xt.toastId!==u.id))}},[m,u.id]),x.useLayoutEffect(()=>{if(!L)return;const Me=q.current,ot=Me.style.height;Me.style.height="auto";const Je=Me.getBoundingClientRect().height;Me.style.height=ot,ve(Je),m(xt=>xt.find(z=>z.toastId===u.id)?xt.map(z=>z.toastId===u.id?{...z,height:Je}:z):[{toastId:u.id,height:Je,position:u.position},...xt])},[L,u.title,u.description,m,u.id]);const Ie=x.useCallback(()=>{H(!0),j(I.current),m(Me=>Me.filter(ot=>ot.toastId!==u.id)),setTimeout(()=>{C(u)},Tse)},[u,C,m,I]);x.useEffect(()=>{if(u.promise&&ue==="loading"||u.duration===1/0||u.type==="loading")return;let Me;return _||h||ft?(()=>{if(U.current<E.current){const xt=new Date().getTime()-E.current;we.current=we.current-xt}U.current=new Date().getTime()})():(()=>{we.current!==1/0&&(E.current=new Date().getTime(),Me=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),Ie()},we.current))})(),()=>clearTimeout(Me)},[_,h,u,ue,ft,Ie]),x.useEffect(()=>{u.delete&&Ie()},[Ie,u.delete]);function at(){var Me;if(ee!=null&&ee.loading){var ot;return x.createElement("div",{className:Ro(Y==null?void 0:Y.loader,u==null||(ot=u.classNames)==null?void 0:ot.loader,"sonner-loader"),"data-visible":ue==="loading"},ee.loading)}return x.createElement(dse,{className:Ro(Y==null?void 0:Y.loader,u==null||(Me=u.classNames)==null?void 0:Me.loader),visible:ue==="loading"})}var lt,qe;return x.createElement("li",{tabIndex:0,ref:q,className:Ro(F,xe,Y==null?void 0:Y.toast,u==null||(t=u.classNames)==null?void 0:t.toast,Y==null?void 0:Y.default,Y==null?void 0:Y[ue],u==null||(n=u.classNames)==null?void 0:n[ue]),"data-sonner-toast":"","data-rich-colors":(lt=u.richColors)!=null?lt:N,"data-styled":!(u.jsx||u.unstyled||f),"data-mounted":L,"data-promise":!!u.promise,"data-swiped":pe,"data-removed":fe,"data-visible":Se,"data-y-position":Z,"data-x-position":Re,"data-index":v,"data-front":te,"data-swiping":ae,"data-dismissible":ye,"data-type":ue,"data-invert":yt,"data-swipe-out":de,"data-swipe-direction":J,"data-expanded":!!(_||K&&L),style:{"--index":v,"--toasts-before":v,"--z-index":b.length-v,"--offset":`${fe?$:I.current}px`,"--initial-height":K?"auto":`${le}px`,...R,...u.style},onDragEnd:()=>{V(!1),X(null),ie.current=null},onPointerDown:Me=>{et||!ye||(M.current=new Date,j(I.current),Me.target.setPointerCapture(Me.pointerId),Me.target.tagName!=="BUTTON"&&(V(!0),ie.current={x:Me.clientX,y:Me.clientY}))},onPointerUp:()=>{var Me,ot,Je;if(de||!ye)return;ie.current=null;const xt=Number(((Me=q.current)==null?void 0:Me.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),O=Number(((ot=q.current)==null?void 0:ot.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),z=new Date().getTime()-((Je=M.current)==null?void 0:Je.getTime()),Ee=re==="x"?xt:O,Ne=Math.abs(Ee)/z;if(Math.abs(Ee)>=Ase||Ne>.11){j(I.current),u.onDismiss==null||u.onDismiss.call(u,u),se(re==="x"?xt>0?"right":"left":O>0?"down":"up"),Ie(),ge(!0);return}else{var Te,pt;(Te=q.current)==null||Te.style.setProperty("--swipe-amount-x","0px"),(pt=q.current)==null||pt.style.setProperty("--swipe-amount-y","0px")}oe(!1),V(!1),X(null)},onPointerMove:Me=>{var ot,Je,xt;if(!ie.current||!ye||((ot=window.getSelection())==null?void 0:ot.toString().length)>0)return;const z=Me.clientY-ie.current.y,Ee=Me.clientX-ie.current.x;var Ne;const Te=(Ne=e.swipeDirections)!=null?Ne:Dse(T);!re&&(Math.abs(Ee)>1||Math.abs(z)>1)&&X(Math.abs(Ee)>Math.abs(z)?"x":"y");let pt={x:0,y:0};const gn=hr=>1/(1.5+Math.abs(hr)/20);if(re==="y"){if(Te.includes("top")||Te.includes("bottom"))if(Te.includes("top")&&z<0||Te.includes("bottom")&&z>0)pt.y=z;else{const hr=z*gn(z);pt.y=Math.abs(hr)<Math.abs(z)?hr:z}}else if(re==="x"&&(Te.includes("left")||Te.includes("right")))if(Te.includes("left")&&Ee<0||Te.includes("right")&&Ee>0)pt.x=Ee;else{const hr=Ee*gn(Ee);pt.x=Math.abs(hr)<Math.abs(Ee)?hr:Ee}(Math.abs(pt.x)>0||Math.abs(pt.y)>0)&&oe(!0),(Je=q.current)==null||Je.style.setProperty("--swipe-amount-x",`${pt.x}px`),(xt=q.current)==null||xt.style.setProperty("--swipe-amount-y",`${pt.y}px`)}},P&&!u.jsx&&ue!=="loading"?x.createElement("button",{"aria-label":G,"data-disabled":et,"data-close-button":!0,onClick:et||!ye?()=>{}:()=>{Ie(),u.onDismiss==null||u.onDismiss.call(u,u)},className:Ro(Y==null?void 0:Y.closeButton,u==null||(r=u.classNames)==null?void 0:r.closeButton)},(qe=ee==null?void 0:ee.close)!=null?qe:gse):null,ue||u.icon||u.promise?x.createElement("div",{"data-icon":"",className:Ro(Y==null?void 0:Y.icon,u==null||(o=u.classNames)==null?void 0:o.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||at():null,u.type!=="loading"?u.icon||(ee==null?void 0:ee[ue])||cse(ue):null):null,x.createElement("div",{"data-content":"",className:Ro(Y==null?void 0:Y.content,u==null||(i=u.classNames)==null?void 0:i.content)},x.createElement("div",{"data-title":"",className:Ro(Y==null?void 0:Y.title,u==null||(s=u.classNames)==null?void 0:s.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?x.createElement("div",{"data-description":"",className:Ro(W,Ae,Y==null?void 0:Y.description,u==null||(a=u.classNames)==null?void 0:a.description)},typeof u.description=="function"?u.description():u.description):null),x.isValidElement(u.cancel)?u.cancel:u.cancel&&_h(u.cancel)?x.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||D,onClick:Me=>{_h(u.cancel)&&ye&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,Me),Ie())},className:Ro(Y==null?void 0:Y.cancelButton,u==null||(l=u.classNames)==null?void 0:l.cancelButton)},u.cancel.label):null,x.isValidElement(u.action)?u.action:u.action&&_h(u.action)?x.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||k,onClick:Me=>{_h(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,Me),!Me.defaultPrevented&&Ie())},className:Ro(Y==null?void 0:Y.actionButton,u==null||(c=u.classNames)==null?void 0:c.actionButton)},u.action.label):null)};function Lj(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Ise(e,t){const n={};return[e,t].forEach((r,o)=>{const i=o===1,s=i?"--mobile-offset":"--offset",a=i?Nse:Cse;function l(c){["top","right","bottom","left"].forEach(d=>{n[`${s}-${d}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${s}-${c}`]=a:n[`${s}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(a)}),n}const Ose=x.forwardRef(function(t,n){const{invert:r,position:o="bottom-right",hotkey:i=["altKey","KeyT"],expand:s,closeButton:a,className:l,offset:c,mobileOffset:d,theme:u="light",richColors:f,duration:h,style:m,visibleToasts:p=Ese,toastOptions:y,dir:v=Lj(),gap:b=Pse,icons:_,containerAriaLabel:C="Notifications"}=t,[N,A]=x.useState([]),R=x.useMemo(()=>Array.from(new Set([o].concat(N.filter(J=>J.position).map(J=>J.position)))),[N,o]),[D,k]=x.useState([]),[F,W]=x.useState(!1),[B,T]=x.useState(!1),[Q,K]=x.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Y=x.useRef(null),ee=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),G=x.useRef(null),re=x.useRef(!1),X=x.useCallback(J=>{A(se=>{var L;return(L=se.find(ne=>ne.id===J.id))!=null&&L.delete||Zn.dismiss(J.id),se.filter(({id:ne})=>ne!==J.id)})},[]);return x.useEffect(()=>Zn.subscribe(J=>{if(J.dismiss){const se=N.map(L=>L.id===J.id?{...L,delete:!0}:L);requestAnimationFrame(()=>{A(se)});return}setTimeout(()=>{Zr.flushSync(()=>{A(se=>{const L=se.findIndex(ne=>ne.id===J.id);return L!==-1?[...se.slice(0,L),{...se[L],...J},...se.slice(L+1)]:[J,...se]})})})}),[N]),x.useEffect(()=>{if(u!=="system"){K(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?K("dark"):K("light")),typeof window>"u")return;const J=window.matchMedia("(prefers-color-scheme: dark)");try{J.addEventListener("change",({matches:se})=>{K(se?"dark":"light")})}catch{J.addListener(({matches:L})=>{try{K(L?"dark":"light")}catch(ne){console.error(ne)}})}},[u]),x.useEffect(()=>{N.length<=1&&W(!1)},[N]),x.useEffect(()=>{const J=se=>{var L;if(i.every(H=>se[H]||se.code===H)){var fe;W(!0),(fe=Y.current)==null||fe.focus()}se.code==="Escape"&&(document.activeElement===Y.current||(L=Y.current)!=null&&L.contains(document.activeElement))&&W(!1)};return document.addEventListener("keydown",J),()=>document.removeEventListener("keydown",J)},[i]),x.useEffect(()=>{if(Y.current)return()=>{G.current&&(G.current.focus({preventScroll:!0}),G.current=null,re.current=!1)}},[Y.current]),x.createElement("section",{ref:n,"aria-label":`${C} ${ee}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((J,se)=>{var L;const[ne,fe]=J.split("-");return N.length?x.createElement("ol",{key:J,dir:v==="auto"?Lj():v,tabIndex:-1,ref:Y,className:l,"data-sonner-toaster":!0,"data-sonner-theme":Q,"data-y-position":ne,"data-lifted":F&&N.length>1&&!s,"data-x-position":fe,style:{"--front-toast-height":`${((L=D[0])==null?void 0:L.height)||0}px`,"--width":`${Rse}px`,"--gap":`${b}px`,...m,...Ise(c,d)},onBlur:H=>{re.current&&!H.currentTarget.contains(H.relatedTarget)&&(re.current=!1,G.current&&(G.current.focus({preventScroll:!0}),G.current=null))},onFocus:H=>{H.target instanceof HTMLElement&&H.target.dataset.dismissible==="false"||re.current||(re.current=!0,G.current=H.relatedTarget)},onMouseEnter:()=>W(!0),onMouseMove:()=>W(!0),onMouseLeave:()=>{B||W(!1)},onDragEnd:()=>W(!1),onPointerDown:H=>{H.target instanceof HTMLElement&&H.target.dataset.dismissible==="false"||T(!0)},onPointerUp:()=>T(!1)},N.filter(H=>!H.position&&se===0||H.position===J).map((H,ae)=>{var V,de;return x.createElement(Mse,{key:H.id,icons:_,index:ae,toast:H,defaultRichColors:f,duration:(V=y==null?void 0:y.duration)!=null?V:h,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:r,visibleToasts:p,closeButton:(de=y==null?void 0:y.closeButton)!=null?de:a,interacting:B,position:J,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,closeButtonAriaLabel:y==null?void 0:y.closeButtonAriaLabel,removeToast:X,toasts:N.filter(ge=>ge.position==H.position),heights:D.filter(ge=>ge.position==H.position),setHeights:k,expandByDefault:s,gap:b,expanded:F,swipeDirections:t.swipeDirections})})):null}))}),kse=({...e})=>{const{theme:t="system"}=ase();return g.jsx(Ose,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-primary group-[.toast]:text-foreground"}},...e})},jj=x.forwardRef(({className:e,...t},n)=>g.jsx(zD,{className:ce("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:g.jsx(BX,{className:ce("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));jj.displayName=zD.displayName;const Lse=UX,Fj=w.forwardRef(({className:e,...t},n)=>g.jsx(JD,{ref:n,className:ce("inline-flex h-10 items-center justify-center rounded-md bg-primary p-1 text-foreground",e),...t}));Fj.displayName=JD.displayName;const $j=w.forwardRef(({className:e,...t},n)=>g.jsx(QD,{ref:n,className:ce("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 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-sm",e),...t}));$j.displayName=QD.displayName;const zj=w.forwardRef(({className:e,...t},n)=>g.jsx(ZD,{ref:n,className:ce("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));zj.displayName=ZD.displayName;const Bj=x.forwardRef(({className:e,...t},n)=>g.jsx("textarea",{className:ce("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Bj.displayName="Textarea";const Wj=cr("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-primary hover:text-foreground 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=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),Vj=x.forwardRef(({className:e,variant:t,size:n,...r},o)=>{const{variants:i}=Mi(),s=x.useMemo(()=>cr(i.toggle.defaultStyles,{variants:i.toggle.variantStyles,defaultVariants:i.toggle.defaultVariants}),[i]);return g.jsx(eM,{ref:o,className:ce(s({variant:t,size:n,className:e})),...r})});Vj.displayName=eM.displayName;const Uj=x.createContext({size:"default",variant:"default"}),Hj=x.forwardRef(({className:e,variant:t,size:n,children:r,...o},i)=>g.jsx(lM,{ref:i,className:ce("flex items-center justify-center gap-1",e),...o,children:g.jsx(Uj.Provider,{value:{variant:t,size:n},children:r})}));Hj.displayName=lM.displayName;const Gj=x.forwardRef(({className:e,children:t,variant:n,size:r,...o},i)=>{const s=x.useContext(Uj);return g.jsx(cM,{ref:i,className:ce(Wj({variant:s.variant||n,size:s.size||r}),e),...o,children:t})});Gj.displayName=cM.displayName;const jse=dJ,Fse=fJ,$se=hJ,Yj=x.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(yM,{ref:r,sideOffset:t,className:ce("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md 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}));Yj.displayName=yM.displayName;const zse=Object.freeze(Object.defineProperty({__proto__:null,Accordion:cQ,AccordionContent:OM,AccordionItem:MM,AccordionTrigger:IM,Alert:FM,AlertDescription:zM,AlertDialog:yQ,AlertDialogAction:YM,AlertDialogCancel:qM,AlertDialogContent:WM,AlertDialogDescription:GM,AlertDialogFooter:UM,AlertDialogHeader:VM,AlertDialogTitle:HM,AlertDialogTrigger:wQ,AlertTitle:$M,AspectRatio:bQ,Avatar:KM,AvatarFallback:JM,AvatarImage:XM,Badge:SQ,Breadcrumb:QM,BreadcrumbItem:eI,BreadcrumbLink:tI,BreadcrumbList:ZM,BreadcrumbPage:nI,BreadcrumbSeparator:rI,Button:Hr,Calendar:Xf,Card:MI,CardContent:LI,CardDescription:kI,CardFooter:jI,CardHeader:II,CardTitle:OI,Carousel:HI,CarouselContent:GI,CarouselItem:YI,CarouselNext:KI,CarouselPrevious:qI,Checkbox:XI,Collapsible:Wte,CollapsibleContent:JI,CollapsibleTrigger:Vte,Combobox:wre,Command:oh,CommandDialog:yre,CommandEmpty:Kv,CommandGroup:Xv,CommandInput:qv,CommandItem:Jv,CommandList:BO,CommandSeparator:WO,CommandShortcut:VO,ContextMenu:vre,ContextMenuCheckboxItem:qO,ContextMenuContent:GO,ContextMenuGroup:_re,ContextMenuItem:YO,ContextMenuLabel:XO,ContextMenuPortal:Sre,ContextMenuRadioGroup:Ere,ContextMenuRadioItem:KO,ContextMenuSeparator:JO,ContextMenuShortcut:QO,ContextMenuSub:xre,ContextMenuSubContent:HO,ContextMenuSubTrigger:UO,ContextMenuTrigger:bre,DataTable:Eoe,DatePicker:Coe,DateRangePicker:Noe,Dialog:kO,DialogClose:gre,DialogContent:Yv,DialogDescription:zO,DialogFooter:FO,DialogHeader:jO,DialogOverlay:Gv,DialogPortal:LO,DialogTitle:$O,DialogTrigger:mre,Drawer:Ik,DrawerClose:tie,DrawerContent:kk,DrawerDescription:$k,DrawerFooter:jk,DrawerHeader:Lk,DrawerOverlay:Pb,DrawerPortal:Ok,DrawerTitle:Fk,DrawerTrigger:eie,DropdownMenu:nie,DropdownMenuCheckboxItem:Uk,DropdownMenuContent:Wk,DropdownMenuGroup:oie,DropdownMenuItem:Vk,DropdownMenuLabel:Gk,DropdownMenuPortal:iie,DropdownMenuRadioGroup:aie,DropdownMenuRadioItem:Hk,DropdownMenuSeparator:Yk,DropdownMenuShortcut:qk,DropdownMenuSub:sie,DropdownMenuSubContent:Bk,DropdownMenuSubTrigger:zk,DropdownMenuTrigger:rie,Form:uie,FormControl:eL,FormDescription:tL,FormField:die,FormItem:Qk,FormLabel:Zk,FormMessage:nL,HoverCard:fie,HoverCardContent:rL,HoverCardTrigger:hie,Input:oL,Label:Ab,Menubar:iL,MenubarCheckboxItem:dL,MenubarContent:cL,MenubarGroup:mie,MenubarItem:uL,MenubarLabel:hL,MenubarMenu:pie,MenubarPortal:gie,MenubarRadioGroup:wie,MenubarRadioItem:fL,MenubarSeparator:pL,MenubarShortcut:mL,MenubarSub:yie,MenubarSubContent:lL,MenubarSubTrigger:aL,MenubarTrigger:sL,NavigationMenu:gL,NavigationMenuContent:bL,NavigationMenuIndicator:_L,NavigationMenuItem:vie,NavigationMenuLink:bie,NavigationMenuList:yL,NavigationMenuTrigger:vL,NavigationMenuViewport:Tb,Pagination:SL,PaginationContent:xL,PaginationEllipsis:AL,PaginationFirst:RL,PaginationItem:EL,PaginationLast:PL,PaginationLink:Ja,PaginationNext:NL,PaginationPrevious:CL,Popover:ih,PopoverContent:kc,PopoverTrigger:sh,Progress:TL,RadioGroup:DL,RadioGroupItem:ML,ResizableHandle:hj,ResizablePanel:fj,ResizablePanelGroup:dj,ScrollArea:pj,ScrollBar:Fb,Select:Jie,SelectContent:gj,SelectGroup:Qie,SelectItem:wj,SelectLabel:yj,SelectScrollDownButton:zb,SelectScrollUpButton:$b,SelectSeparator:vj,SelectTrigger:mj,SelectValue:Zie,Separator:bj,Sheet:ese,SheetClose:_j,SheetContent:xj,SheetDescription:Rj,SheetFooter:Cj,SheetHeader:Ej,SheetOverlay:Bb,SheetPortal:Sj,SheetTitle:Nj,SheetTrigger:tse,Sidebar:Pj,SidebarFooter:Ij,SidebarGroup:Mj,SidebarHeader:Aj,SidebarItem:Dj,SidebarNav:Tj,Skeleton:rse,Slider:Oj,Switch:jj,Table:yb,TableBody:vb,TableCaption:mk,TableCell:Fc,TableFooter:pk,TableHead:bb,TableHeader:wb,TableRow:Ka,Tabs:Lse,TabsContent:zj,TabsList:Fj,TabsTrigger:$j,Textarea:Bj,Toaster:kse,Toggle:Vj,ToggleGroup:Hj,ToggleGroupItem:Gj,Tooltip:Fse,TooltipContent:Yj,TooltipProvider:jse,TooltipTrigger:$se,Variants:uQ,badgeVariants:_Q,buttonVariants:xQ,navigationMenuTriggerStyle:wL,toggleVariants:Wj,useForm:xG,useFormField:Bc},Symbol.toStringTag,{value:"Module"})),Bse=()=>{typeof window<"u"&&(window.Buffer=ut.Buffer,window.fs=new VF("fs"),window.pfs=window.fs.promises,window.miDir="/mi")};Be.APIHandler=Lm,Be.APIProxyHandler=jm,Be.DreamspaceElements=zse,Be.MiniApp=QH,Be.ProjectProvider=dV,Be.RGComponent=ZH,Be.RGComponentErrorBoundary=eG,Be.RGDroppable=tG,Be.RGEditLayout=qH,Be.RGPreviewLayout=wC,Be.RGProvider=fE,Be.TailwindThemeContext=fQ,Be.TailwindThemeHooks=gQ,Be.applySxtIgnore=e3,Be.checkoutCommit=r3,Be.getCommits=n3,Be.getHeadCommit=K8,Be.getRedoTargetCommitForFile=J8,Be.getTags=vm,Be.getUndoTargetCommitForFile=X8,Be.initializeMakeInfinite=Bse,Be.listAllFiles=t3,Be.listDir=A0,Be.loadLibraryComponents=F8,Be.loadProjectComponents=k0,Be.setTailwindTheme=L0,Be.syncAndRetry=Tl,Be.useAPI=uE,Be.useAppMetadata=z8,Be.useAppSettings=B8,Be.useAppVersions=W8,Be.useB64UrlForProjectImage=j0,Be.useProject=$m,Be.useRGContext=Om,Be.useWebSocketManager=rG,Object.defineProperty(Be,Symbol.toStringTag,{value:"Module"})});
|