diff --git a/typescript/vscode-extension/.eslintrc.json b/typescript/vscode-extension/.eslintrc.json index 91b0cbc6..52906b54 100644 --- a/typescript/vscode-extension/.eslintrc.json +++ b/typescript/vscode-extension/.eslintrc.json @@ -16,12 +16,19 @@ "plugin:react/jsx-runtime" ], "rules": { + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unsafe-member-access": "off", + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-unsafe-parameter": "off", + "@typescript-eslint/no-unsafe-argument": "off", + "@typescript-eslint/no-unsafe-return": "off", "@typescript-eslint/naming-convention": "warn", "@typescript-eslint/semi": "warn", + "no-unused-vars": ["error", { "argsIgnorePattern": "^_" }], "curly": "warn", "eqeqeq": "warn", "no-throw-literal": "warn", - "semi": "off" + "semi": "off" }, "ignorePatterns": [ "out", diff --git a/typescript/vscode-extension/.vscodeignore b/typescript/vscode-extension/.vscodeignore index 74bdc4b9..b0ac62e9 100644 --- a/typescript/vscode-extension/.vscodeignore +++ b/typescript/vscode-extension/.vscodeignore @@ -6,7 +6,10 @@ # Ignore test files .vscode-test/** + +# Ignore build artifacts out/** +!out/extension.js # Ignore source code src/** diff --git a/typescript/vscode-extension/CHANGELOG.md b/typescript/vscode-extension/CHANGELOG.md index a237c12c..b38ad29d 100644 --- a/typescript/vscode-extension/CHANGELOG.md +++ b/typescript/vscode-extension/CHANGELOG.md @@ -6,9 +6,6 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how ## [Unreleased] -## 0.0.4 +## 0.1.2 - Warn about requiring suibase to be installed. - - Clean-up sidebar buttons. -## 0.0.1 - - Initial release \ No newline at end of file diff --git a/typescript/vscode-extension/dist/extension.js b/typescript/vscode-extension/dist/extension.js index 1a3404b3..c96edca3 100644 --- a/typescript/vscode-extension/dist/extension.js +++ b/typescript/vscode-extension/dist/extension.js @@ -1,12 +1,12 @@ -"use strict";var Hc=Object.create;var Hr=Object.defineProperty;var Gc=Object.getOwnPropertyDescriptor;var Yc=Object.getOwnPropertyNames;var Qc=Object.getPrototypeOf,Jc=Object.prototype.hasOwnProperty;var $=(n,t)=>()=>(n&&(t=n(n=0)),t);var N=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),pi=(n,t)=>{for(var r in t)Hr(n,r,{get:t[r],enumerable:!0})},Po=(n,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Yc(t))!Jc.call(n,o)&&o!==r&&Hr(n,o,{get:()=>t[o],enumerable:!(s=Gc(t,o))||s.enumerable});return n};var V=(n,t,r)=>(r=n!=null?Hc(Qc(n)):{},Po(t||!n||!n.__esModule?Hr(r,"default",{value:n,enumerable:!0}):r,n)),Kc=n=>Po(Hr({},"__esModule",{value:!0}),n);var Uo=N((fh,qo)=>{"use strict";var{Duplex:Xc}=require("stream");function Io(n){n.emit("close")}function Zc(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Do(n){this.removeListener("error",Do),this.destroy(),this.listenerCount("error")===0&&this.emit("error",n)}function ef(n,t){let r=!0,s=new Xc({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return n.on("message",function(l,c){let _=!c&&s._readableState.objectMode?l.toString():l;s.push(_)||n.pause()}),n.once("error",function(l){s.destroyed||(r=!1,s.destroy(l))}),n.once("close",function(){s.destroyed||s.push(null)}),s._destroy=function(o,l){if(n.readyState===n.CLOSED){l(o),process.nextTick(Io,s);return}let c=!1;n.once("error",function(p){c=!0,l(p)}),n.once("close",function(){c||l(o),process.nextTick(Io,s)}),r&&n.terminate()},s._final=function(o){if(n.readyState===n.CONNECTING){n.once("open",function(){s._final(o)});return}n._socket!==null&&(n._socket._writableState.finished?(o(),s._readableState.endEmitted&&s.destroy()):(n._socket.once("finish",function(){o()}),n.close()))},s._read=function(){n.isPaused&&n.resume()},s._write=function(o,l,c){if(n.readyState===n.CONNECTING){n.once("open",function(){s._write(o,l,c)});return}n.send(o,c)},s.on("end",Zc),s.on("error",Do),s}qo.exports=ef});var Ye=N((dh,Fo)=>{"use strict";Fo.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var ta=N((hh,ea)=>{var jo=require("fs"),Be=require("path"),zo=require("os"),Vo=typeof __webpack_require__=="function"?__non_webpack_require__:require,tf=process.config&&process.config.variables||{},rf=!!process.env.PREBUILDS_ONLY,No=process.versions.modules,_i=of()?"electron":sf()?"node-webkit":"node",yi=process.env.npm_config_arch||zo.arch(),gi=process.env.npm_config_platform||zo.platform(),Ho=process.env.LIBC||(af(gi)?"musl":"glibc"),Si=process.env.ARM_VERSION||(yi==="arm64"?"8":tf.arm_version)||"",Go=(process.versions.uv||"").split(".")[0];ea.exports=ge;function ge(n){return Vo(ge.resolve(n))}ge.resolve=ge.path=function(n){n=Be.resolve(n||".");try{var t=Vo(Be.join(n,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[t+"_PREBUILD"]&&(n=process.env[t+"_PREBUILD"])}catch{}if(!rf){var r=Mo(Be.join(n,"build/Release"),$o);if(r)return r;var s=Mo(Be.join(n,"build/Debug"),$o);if(s)return s}var o=_(n);if(o)return o;var l=_(Be.dirname(process.execPath));if(l)return l;var c=["platform="+gi,"arch="+yi,"runtime="+_i,"abi="+No,"uv="+Go,Si?"armv="+Si:"","libc="+Ho,"node="+process.versions.node,process.versions.electron?"electron="+process.versions.electron:"",typeof __webpack_require__=="function"?"webpack=true":""].filter(Boolean).join(" ");throw new Error("No native build was found for "+c+` +"use strict";var Hc=Object.create;var Hr=Object.defineProperty;var Gc=Object.getOwnPropertyDescriptor;var Yc=Object.getOwnPropertyNames;var Qc=Object.getPrototypeOf,Jc=Object.prototype.hasOwnProperty;var $=(n,t)=>()=>(n&&(t=n(n=0)),t);var N=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),pi=(n,t)=>{for(var r in t)Hr(n,r,{get:t[r],enumerable:!0})},Po=(n,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Yc(t))!Jc.call(n,o)&&o!==r&&Hr(n,o,{get:()=>t[o],enumerable:!(s=Gc(t,o))||s.enumerable});return n};var V=(n,t,r)=>(r=n!=null?Hc(Qc(n)):{},Po(t||!n||!n.__esModule?Hr(r,"default",{value:n,enumerable:!0}):r,n)),Kc=n=>Po(Hr({},"__esModule",{value:!0}),n);var Uo=N((fh,qo)=>{"use strict";var{Duplex:Xc}=require("stream");function Io(n){n.emit("close")}function Zc(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Do(n){this.removeListener("error",Do),this.destroy(),this.listenerCount("error")===0&&this.emit("error",n)}function ef(n,t){let r=!0,s=new Xc({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return n.on("message",function(l,c){let _=!c&&s._readableState.objectMode?l.toString():l;s.push(_)||n.pause()}),n.once("error",function(l){s.destroyed||(r=!1,s.destroy(l))}),n.once("close",function(){s.destroyed||s.push(null)}),s._destroy=function(o,l){if(n.readyState===n.CLOSED){l(o),process.nextTick(Io,s);return}let c=!1;n.once("error",function(p){c=!0,l(p)}),n.once("close",function(){c||l(o),process.nextTick(Io,s)}),r&&n.terminate()},s._final=function(o){if(n.readyState===n.CONNECTING){n.once("open",function(){s._final(o)});return}n._socket!==null&&(n._socket._writableState.finished?(o(),s._readableState.endEmitted&&s.destroy()):(n._socket.once("finish",function(){o()}),n.close()))},s._read=function(){n.isPaused&&n.resume()},s._write=function(o,l,c){if(n.readyState===n.CONNECTING){n.once("open",function(){s._write(o,l,c)});return}n.send(o,c)},s.on("end",Zc),s.on("error",Do),s}qo.exports=ef});var Ye=N((dh,Fo)=>{"use strict";Fo.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var ta=N((hh,ea)=>{var jo=require("fs"),Be=require("path"),zo=require("os"),Vo=typeof __webpack_require__=="function"?__non_webpack_require__:require,tf=process.config&&process.config.variables||{},rf=!!process.env.PREBUILDS_ONLY,No=process.versions.modules,bi=of()?"electron":sf()?"node-webkit":"node",_i=process.env.npm_config_arch||zo.arch(),yi=process.env.npm_config_platform||zo.platform(),Ho=process.env.LIBC||(af(yi)?"musl":"glibc"),gi=process.env.ARM_VERSION||(_i==="arm64"?"8":tf.arm_version)||"",Go=(process.versions.uv||"").split(".")[0];ea.exports=ge;function ge(n){return Vo(ge.resolve(n))}ge.resolve=ge.path=function(n){n=Be.resolve(n||".");try{var t=Vo(Be.join(n,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[t+"_PREBUILD"]&&(n=process.env[t+"_PREBUILD"])}catch{}if(!rf){var r=Mo(Be.join(n,"build/Release"),$o);if(r)return r;var s=Mo(Be.join(n,"build/Debug"),$o);if(s)return s}var o=_(n);if(o)return o;var l=_(Be.dirname(process.execPath));if(l)return l;var c=["platform="+yi,"arch="+_i,"runtime="+bi,"abi="+No,"uv="+Go,gi?"armv="+gi:"","libc="+Ho,"node="+process.versions.node,process.versions.electron?"electron="+process.versions.electron:"",typeof __webpack_require__=="function"?"webpack=true":""].filter(Boolean).join(" ");throw new Error("No native build was found for "+c+` loaded from: `+n+` -`);function _(p){var d=wi(Be.join(p,"prebuilds")).map(Yo),h=d.filter(Qo(gi,yi)).sort(Jo)[0];if(h){var g=Be.join(p,"prebuilds",h.name),v=wi(g).map(Ko),P=v.filter(Xo(_i,No)),y=P.sort(Zo(_i))[0];if(y)return Be.join(g,y.file)}}};function wi(n){try{return jo.readdirSync(n)}catch{return[]}}function Mo(n,t){var r=wi(n).filter(t);return r[0]&&Be.join(n,r[0])}function $o(n){return/\.node$/.test(n)}function Yo(n){var t=n.split("-");if(t.length===2){var r=t[0],s=t[1].split("+");if(r&&s.length&&s.every(Boolean))return{name:n,platform:r,architectures:s}}}function Qo(n,t){return function(r){return r==null||r.platform!==n?!1:r.architectures.includes(t)}}function Jo(n,t){return n.architectures.length-t.architectures.length}function Ko(n){var t=n.split("."),r=t.pop(),s={file:n,specificity:0};if(r==="node"){for(var o=0;or.specificity?-1:1:0}}function sf(){return!!(process.versions&&process.versions.nw)}function of(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<"u"&&window.process&&window.process.type==="renderer"}function af(n){return n==="linux"&&jo.existsSync("/etc/alpine-release")}ge.parseTags=Ko;ge.matchTags=Xo;ge.compareTags=Zo;ge.parseTuple=Yo;ge.matchTuple=Qo;ge.compareTuples=Jo});var Ri=N((ph,Ei)=>{var vi=typeof __webpack_require__=="function"?__non_webpack_require__:require;typeof vi.addon=="function"?Ei.exports=vi.addon.bind(vi):Ei.exports=ta()});var na=N((mh,ra)=>{"use strict";var lf=(n,t,r,s,o)=>{for(var l=0;l{let r=n.length;for(var s=0;s{"use strict";try{Ti.exports=Ri()(__dirname)}catch{Ti.exports=na()}});var Gt=N((_h,Jr)=>{"use strict";var{EMPTY_BUFFER:cf}=Ye(),Ci=Buffer[Symbol.species];function ff(n,t){if(n.length===0)return cf;if(n.length===1)return n[0];let r=Buffer.allocUnsafe(t),s=0;for(let o=0;o{"use strict";var aa=Symbol("kDone"),ki=Symbol("kRun"),Pi=class{constructor(t){this[aa]=()=>{this.pending--,this[ki]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[ki]()}[ki](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[aa])}}};la.exports=Pi});var Jt=N((gh,ha)=>{"use strict";var Yt=require("zlib"),ca=Gt(),hf=ua(),{kStatusCode:fa}=Ye(),pf=Buffer[Symbol.species],mf=Buffer.from([0,0,255,255]),Zr=Symbol("permessage-deflate"),We=Symbol("total-length"),Qt=Symbol("callback"),Qe=Symbol("buffers"),Xr=Symbol("error"),Kr,Ai=class{constructor(t,r,s){if(this._maxPayload=s|0,this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!r,this._deflate=null,this._inflate=null,this.params=null,!Kr){let o=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Kr=new hf(o)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[Qt];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,s=t.find(o=>!(r.serverNoContextTakeover===!1&&o.server_no_context_takeover||o.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>o.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!o.client_max_window_bits));if(!s)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(s.server_no_context_takeover=!0),r.clientNoContextTakeover&&(s.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(s.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?s.client_max_window_bits=r.clientMaxWindowBits:(s.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete s.client_max_window_bits,s}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(s=>{let o=r[s];if(o.length>1)throw new Error(`Parameter "${s}" must have only a single value`);if(o=o[0],s==="client_max_window_bits"){if(o!==!0){let l=+o;if(!Number.isInteger(l)||l<8||l>15)throw new TypeError(`Invalid value for parameter "${s}": ${o}`);o=l}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${s}": ${o}`)}else if(s==="server_max_window_bits"){let l=+o;if(!Number.isInteger(l)||l<8||l>15)throw new TypeError(`Invalid value for parameter "${s}": ${o}`);o=l}else if(s==="client_no_context_takeover"||s==="server_no_context_takeover"){if(o!==!0)throw new TypeError(`Invalid value for parameter "${s}": ${o}`)}else throw new Error(`Unknown parameter "${s}"`);r[s]=o})}),t}decompress(t,r,s){Kr.add(o=>{this._decompress(t,r,(l,c)=>{o(),s(l,c)})})}compress(t,r,s){Kr.add(o=>{this._compress(t,r,(l,c)=>{o(),s(l,c)})})}_decompress(t,r,s){let o=this._isServer?"client":"server";if(!this._inflate){let l=`${o}_max_window_bits`,c=typeof this.params[l]!="number"?Yt.Z_DEFAULT_WINDOWBITS:this.params[l];this._inflate=Yt.createInflateRaw({...this._options.zlibInflateOptions,windowBits:c}),this._inflate[Zr]=this,this._inflate[We]=0,this._inflate[Qe]=[],this._inflate.on("error",_f),this._inflate.on("data",da)}this._inflate[Qt]=s,this._inflate.write(t),r&&this._inflate.write(mf),this._inflate.flush(()=>{let l=this._inflate[Xr];if(l){this._inflate.close(),this._inflate=null,s(l);return}let c=ca.concat(this._inflate[Qe],this._inflate[We]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[We]=0,this._inflate[Qe]=[],r&&this.params[`${o}_no_context_takeover`]&&this._inflate.reset()),s(null,c)})}_compress(t,r,s){let o=this._isServer?"server":"client";if(!this._deflate){let l=`${o}_max_window_bits`,c=typeof this.params[l]!="number"?Yt.Z_DEFAULT_WINDOWBITS:this.params[l];this._deflate=Yt.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:c}),this._deflate[We]=0,this._deflate[Qe]=[],this._deflate.on("data",bf)}this._deflate[Qt]=s,this._deflate.write(t),this._deflate.flush(Yt.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let l=ca.concat(this._deflate[Qe],this._deflate[We]);r&&(l=new pf(l.buffer,l.byteOffset,l.length-4)),this._deflate[Qt]=null,this._deflate[We]=0,this._deflate[Qe]=[],r&&this.params[`${o}_no_context_takeover`]&&this._deflate.reset(),s(null,l)})}};ha.exports=Ai;function bf(n){this[Qe].push(n),this[We]+=n.length}function da(n){if(this[We]+=n.length,this[Zr]._maxPayload<1||this[We]<=this[Zr]._maxPayload){this[Qe].push(n);return}this[Xr]=new RangeError("Max payload size exceeded"),this[Xr].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Xr][fa]=1009,this.removeListener("data",da),this.reset()}function _f(n){this[Zr]._inflate=null,n[fa]=1007,this[Qt](n)}});var ma=N((Sh,pa)=>{"use strict";function yf(n){let t=n.length,r=0;for(;r=t||(n[r+1]&192)!==128||(n[r+2]&192)!==128||n[r]===224&&(n[r+1]&224)===128||n[r]===237&&(n[r+1]&224)===160)return!1;r+=3}else if((n[r]&248)===240){if(r+3>=t||(n[r+1]&192)!==128||(n[r+2]&192)!==128||(n[r+3]&192)!==128||n[r]===240&&(n[r+1]&240)===128||n[r]===244&&n[r+1]>143||n[r]>244)return!1;r+=4}else return!1;return!0}pa.exports=yf});var ba=N((wh,Oi)=>{"use strict";try{Oi.exports=Ri()(__dirname)}catch{Oi.exports=ma()}});var Kt=N((vh,en)=>{"use strict";var{isUtf8:_a}=require("buffer"),gf=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function Sf(n){return n>=1e3&&n<=1014&&n!==1004&&n!==1005&&n!==1006||n>=3e3&&n<=4999}function Bi(n){let t=n.length,r=0;for(;r=t||(n[r+1]&192)!==128||(n[r+2]&192)!==128||n[r]===224&&(n[r+1]&224)===128||n[r]===237&&(n[r+1]&224)===160)return!1;r+=3}else if((n[r]&248)===240){if(r+3>=t||(n[r+1]&192)!==128||(n[r+2]&192)!==128||(n[r+3]&192)!==128||n[r]===240&&(n[r+1]&240)===128||n[r]===244&&n[r+1]>143||n[r]>244)return!1;r+=4}else return!1;return!0}en.exports={isValidStatusCode:Sf,isValidUTF8:Bi,tokenChars:gf};if(_a)en.exports.isValidUTF8=function(n){return n.length<24?Bi(n):_a(n)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let n=ba();en.exports.isValidUTF8=function(t){return t.length<32?Bi(t):n(t)}}catch{}});var qi=N((Eh,Ra)=>{"use strict";var{Writable:wf}=require("stream"),ya=Jt(),{BINARY_TYPES:vf,EMPTY_BUFFER:ga,kStatusCode:Ef,kWebSocket:Rf}=Ye(),{concat:Wi,toArrayBuffer:Tf,unmask:Cf}=Gt(),{isValidStatusCode:xf,isValidUTF8:Sa}=Kt(),tn=Buffer[Symbol.species],ae=0,wa=1,va=2,Ea=3,Li=4,Ii=5,rn=6,Di=class extends wf{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||vf[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[Rf]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=ae}_write(t,r,s){if(this._opcode===8&&this._state==ae)return s();this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(s)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t=s.length?r.set(this._buffers.shift(),o):(r.set(new Uint8Array(s.buffer,s.byteOffset,t),o),this._buffers[0]=new tn(s.buffer,s.byteOffset+t,s.length-t)),t-=s.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case ae:this.getInfo(t);break;case wa:this.getPayloadLength16(t);break;case va:this.getPayloadLength64(t);break;case Ea:this.getMask();break;case Li:this.getData(t);break;case Ii:case rn:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if(r[0]&48){let o=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(o);return}let s=(r[0]&64)===64;if(s&&!this._extensions[ya.extensionName]){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(o);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(s){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(o);return}if(!this._fragmented){let o=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(o);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let o=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(o);return}this._compressed=s}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let o=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(o);return}if(s){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(o);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let o=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(o);return}}else{let o=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(o);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let o=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(o);return}}else if(this._masked){let o=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(o);return}this._payloadLength===126?this._state=wa:this._payloadLength===127?this._state=va:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),s=r.readUInt32BE(0);if(s>Math.pow(2,21)-1){let o=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(o);return}this._payloadLength=s*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(r);return}this._masked?this._state=Ea:this._state=Li}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Li}getData(t){let r=ga;if(this._payloadLength){if(this._bufferedBytes7){this.controlMessage(r,t);return}if(this._compressed){this._state=Ii,this.decompress(r,t);return}r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(r)),this.dataMessage(t)}decompress(t,r){this._extensions[ya.extensionName].decompress(t,this._fin,(o,l)=>{if(o)return r(o);if(l.length){if(this._messageLength+=l.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let c=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(c);return}this._fragments.push(l)}this.dataMessage(r),this._state===ae&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=ae;return}let r=this._messageLength,s=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let o;this._binaryType==="nodebuffer"?o=Wi(s,r):this._binaryType==="arraybuffer"?o=Tf(Wi(s,r)):o=s,this._allowSynchronousEvents?(this.emit("message",o,!0),this._state=ae):(this._state=rn,setImmediate(()=>{this.emit("message",o,!0),this._state=ae,this.startLoop(t)}))}else{let o=Wi(s,r);if(!this._skipUTF8Validation&&!Sa(o)){let l=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(l);return}this._state===Ii||this._allowSynchronousEvents?(this.emit("message",o,!1),this._state=ae):(this._state=rn,setImmediate(()=>{this.emit("message",o,!1),this._state=ae,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,ga),this.end();else{let s=t.readUInt16BE(0);if(!xf(s)){let l=this.createError(RangeError,`invalid status code ${s}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(l);return}let o=new tn(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!Sa(o)){let l=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(l);return}this._loop=!1,this.emit("conclude",s,o),this.end()}this._state=ae;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=ae):(this._state=rn,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=ae,this.startLoop(r)}))}createError(t,r,s,o,l){this._loop=!1,this._errored=!0;let c=new t(s?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(c,this.createError),c.code=l,c[Ef]=o,c}};Ra.exports=Di});var Fi=N((Th,xa)=>{"use strict";var{Duplex:Rh}=require("stream"),{randomFillSync:kf}=require("crypto"),Ta=Jt(),{EMPTY_BUFFER:Pf}=Ye(),{isValidStatusCode:Af}=Kt(),{mask:Ca,toBuffer:At}=Gt(),pe=Symbol("kByteLength"),Of=Buffer.alloc(4),Ui=class n{constructor(t,r,s){this._extensions=r||{},s&&(this._generateMask=s,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(t,r){let s,o=!1,l=2,c=!1;r.mask&&(s=r.maskBuffer||Of,r.generateMask?r.generateMask(s):kf(s,0,4),c=(s[0]|s[1]|s[2]|s[3])===0,l=6);let _;typeof t=="string"?(!r.mask||c)&&r[pe]!==void 0?_=r[pe]:(t=Buffer.from(t),_=t.length):(_=t.length,o=r.mask&&r.readOnly&&!c);let p=_;_>=65536?(l+=8,p=127):_>125&&(l+=2,p=126);let d=Buffer.allocUnsafe(o?_+l:l);return d[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(d[0]|=64),d[1]=p,p===126?d.writeUInt16BE(_,2):p===127&&(d[2]=d[3]=0,d.writeUIntBE(_,4,6)),r.mask?(d[1]|=128,d[l-4]=s[0],d[l-3]=s[1],d[l-2]=s[2],d[l-1]=s[3],c?[d,t]:o?(Ca(t,s,d,l,_),[d]):(Ca(t,s,t,0,_),[d,t])):[d,t]}close(t,r,s,o){let l;if(t===void 0)l=Pf;else{if(typeof t!="number"||!Af(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)l=Buffer.allocUnsafe(2),l.writeUInt16BE(t,0);else{let _=Buffer.byteLength(r);if(_>123)throw new RangeError("The message must not be greater than 123 bytes");l=Buffer.allocUnsafe(2+_),l.writeUInt16BE(t,0),typeof r=="string"?l.write(r,2):l.set(r,2)}}let c={[pe]:l.length,fin:!0,generateMask:this._generateMask,mask:s,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._deflating?this.enqueue([this.dispatch,l,!1,c,o]):this.sendFrame(n.frame(l,c),o)}ping(t,r,s){let o,l;if(typeof t=="string"?(o=Buffer.byteLength(t),l=!1):(t=At(t),o=t.length,l=At.readOnly),o>125)throw new RangeError("The data size must not be greater than 125 bytes");let c={[pe]:o,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:l,rsv1:!1};this._deflating?this.enqueue([this.dispatch,t,!1,c,s]):this.sendFrame(n.frame(t,c),s)}pong(t,r,s){let o,l;if(typeof t=="string"?(o=Buffer.byteLength(t),l=!1):(t=At(t),o=t.length,l=At.readOnly),o>125)throw new RangeError("The data size must not be greater than 125 bytes");let c={[pe]:o,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:l,rsv1:!1};this._deflating?this.enqueue([this.dispatch,t,!1,c,s]):this.sendFrame(n.frame(t,c),s)}send(t,r,s){let o=this._extensions[Ta.extensionName],l=r.binary?2:1,c=r.compress,_,p;if(typeof t=="string"?(_=Buffer.byteLength(t),p=!1):(t=At(t),_=t.length,p=At.readOnly),this._firstFragment?(this._firstFragment=!1,c&&o&&o.params[o._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(c=_>=o._threshold),this._compress=c):(c=!1,l=0),r.fin&&(this._firstFragment=!0),o){let d={[pe]:_,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:l,readOnly:p,rsv1:c};this._deflating?this.enqueue([this.dispatch,t,this._compress,d,s]):this.dispatch(t,this._compress,d,s)}else this.sendFrame(n.frame(t,{[pe]:_,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:l,readOnly:p,rsv1:!1}),s)}dispatch(t,r,s,o){if(!r){this.sendFrame(n.frame(t,s),o);return}let l=this._extensions[Ta.extensionName];this._bufferedBytes+=s[pe],this._deflating=!0,l.compress(t,s.fin,(c,_)=>{if(this._socket.destroyed){let p=new Error("The socket was closed while data was being compressed");typeof o=="function"&&o(p);for(let d=0;d{"use strict";var{kForOnEventAttribute:Xt,kListener:Ni}=Ye(),ka=Symbol("kCode"),Pa=Symbol("kData"),Aa=Symbol("kError"),Oa=Symbol("kMessage"),Ba=Symbol("kReason"),Ot=Symbol("kTarget"),Wa=Symbol("kType"),La=Symbol("kWasClean"),Le=class{constructor(t){this[Ot]=null,this[Wa]=t}get target(){return this[Ot]}get type(){return this[Wa]}};Object.defineProperty(Le.prototype,"target",{enumerable:!0});Object.defineProperty(Le.prototype,"type",{enumerable:!0});var ct=class extends Le{constructor(t,r={}){super(t),this[ka]=r.code===void 0?0:r.code,this[Ba]=r.reason===void 0?"":r.reason,this[La]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[ka]}get reason(){return this[Ba]}get wasClean(){return this[La]}};Object.defineProperty(ct.prototype,"code",{enumerable:!0});Object.defineProperty(ct.prototype,"reason",{enumerable:!0});Object.defineProperty(ct.prototype,"wasClean",{enumerable:!0});var Bt=class extends Le{constructor(t,r={}){super(t),this[Aa]=r.error===void 0?null:r.error,this[Oa]=r.message===void 0?"":r.message}get error(){return this[Aa]}get message(){return this[Oa]}};Object.defineProperty(Bt.prototype,"error",{enumerable:!0});Object.defineProperty(Bt.prototype,"message",{enumerable:!0});var Zt=class extends Le{constructor(t,r={}){super(t),this[Pa]=r.data===void 0?null:r.data}get data(){return this[Pa]}};Object.defineProperty(Zt.prototype,"data",{enumerable:!0});var Bf={addEventListener(n,t,r={}){for(let o of this.listeners(n))if(!r[Xt]&&o[Ni]===t&&!o[Xt])return;let s;if(n==="message")s=function(l,c){let _=new Zt("message",{data:c?l:l.toString()});_[Ot]=this,nn(t,this,_)};else if(n==="close")s=function(l,c){let _=new ct("close",{code:l,reason:c.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});_[Ot]=this,nn(t,this,_)};else if(n==="error")s=function(l){let c=new Bt("error",{error:l,message:l.message});c[Ot]=this,nn(t,this,c)};else if(n==="open")s=function(){let l=new Le("open");l[Ot]=this,nn(t,this,l)};else return;s[Xt]=!!r[Xt],s[Ni]=t,r.once?this.once(n,s):this.on(n,s)},removeEventListener(n,t){for(let r of this.listeners(n))if(r[Ni]===t&&!r[Xt]){this.removeListener(n,r);break}}};Ia.exports={CloseEvent:ct,ErrorEvent:Bt,Event:Le,EventTarget:Bf,MessageEvent:Zt};function nn(n,t,r){typeof n=="object"&&n.handleEvent?n.handleEvent.call(n,r):n.call(t,r)}});var Mi=N((xh,qa)=>{"use strict";var{tokenChars:er}=Kt();function Se(n,t,r){n[t]===void 0?n[t]=[r]:n[t].push(r)}function Wf(n){let t=Object.create(null),r=Object.create(null),s=!1,o=!1,l=!1,c,_,p=-1,d=-1,h=-1,g=0;for(;g{let r=n[t];return Array.isArray(r)||(r=[r]),r.map(s=>[t].concat(Object.keys(s).map(o=>{let l=s[o];return Array.isArray(l)||(l=[l]),l.map(c=>c===!0?o:`${o}=${c}`).join("; ")})).join("; ")).join(", ")}).join(", ")}qa.exports={format:Lf,parse:Wf}});var Hi=N((Ah,Ya)=>{"use strict";var If=require("events"),Df=require("https"),qf=require("http"),Na=require("net"),Uf=require("tls"),{randomBytes:Ff,createHash:Nf}=require("crypto"),{Duplex:kh,Readable:Ph}=require("stream"),{URL:$i}=require("url"),Je=Jt(),Mf=qi(),$f=Fi(),{BINARY_TYPES:Ua,EMPTY_BUFFER:sn,GUID:jf,kForOnEventAttribute:ji,kListener:zf,kStatusCode:Vf,kWebSocket:H,NOOP:Ma}=Ye(),{EventTarget:{addEventListener:Hf,removeEventListener:Gf}}=Da(),{format:Yf,parse:Qf}=Mi(),{toBuffer:Jf}=Gt(),Kf=30*1e3,$a=Symbol("kAborted"),zi=[8,13],Ie=["CONNECTING","OPEN","CLOSING","CLOSED"],Xf=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,M=class n extends If{constructor(t,r,s){super(),this._binaryType=Ua[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=sn,this._closeTimer=null,this._extensions={},this._paused=!1,this._protocol="",this._readyState=n.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(s=r,r=[]):r=[r]),ja(this,t,r,s)):(this._autoPong=s.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){Ua.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,s){let o=new Mf({allowSynchronousEvents:s.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:s.maxPayload,skipUTF8Validation:s.skipUTF8Validation});this._sender=new $f(t,this._extensions,s.generateMask),this._receiver=o,this._socket=t,o[H]=this,t[H]=this,o.on("conclude",td),o.on("drain",rd),o.on("error",nd),o.on("message",id),o.on("ping",sd),o.on("pong",od),t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",Va),t.on("data",an),t.on("end",Ha),t.on("error",Ga),this._readyState=n.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=n.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Je.extensionName]&&this._extensions[Je.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=n.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==n.CLOSED){if(this.readyState===n.CONNECTING){ee(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===n.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=n.CLOSING,this._sender.close(t,r,!this._isServer,s=>{s||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),Kf)}}pause(){this.readyState===n.CONNECTING||this.readyState===n.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,s){if(this.readyState===n.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(s=t,t=r=void 0):typeof r=="function"&&(s=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==n.OPEN){Vi(this,t,s);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||sn,r,s)}pong(t,r,s){if(this.readyState===n.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(s=t,t=r=void 0):typeof r=="function"&&(s=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==n.OPEN){Vi(this,t,s);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||sn,r,s)}resume(){this.readyState===n.CONNECTING||this.readyState===n.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,s){if(this.readyState===n.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(s=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==n.OPEN){Vi(this,t,s);return}let o={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[Je.extensionName]||(o.compress=!1),this._sender.send(t||sn,o,s)}terminate(){if(this.readyState!==n.CLOSED){if(this.readyState===n.CONNECTING){ee(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=n.CLOSING,this._socket.destroy())}}};Object.defineProperty(M,"CONNECTING",{enumerable:!0,value:Ie.indexOf("CONNECTING")});Object.defineProperty(M.prototype,"CONNECTING",{enumerable:!0,value:Ie.indexOf("CONNECTING")});Object.defineProperty(M,"OPEN",{enumerable:!0,value:Ie.indexOf("OPEN")});Object.defineProperty(M.prototype,"OPEN",{enumerable:!0,value:Ie.indexOf("OPEN")});Object.defineProperty(M,"CLOSING",{enumerable:!0,value:Ie.indexOf("CLOSING")});Object.defineProperty(M.prototype,"CLOSING",{enumerable:!0,value:Ie.indexOf("CLOSING")});Object.defineProperty(M,"CLOSED",{enumerable:!0,value:Ie.indexOf("CLOSED")});Object.defineProperty(M.prototype,"CLOSED",{enumerable:!0,value:Ie.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(n=>{Object.defineProperty(M.prototype,n,{enumerable:!0})});["open","error","close","message"].forEach(n=>{Object.defineProperty(M.prototype,`on${n}`,{enumerable:!0,get(){for(let t of this.listeners(n))if(t[ji])return t[zf];return null},set(t){for(let r of this.listeners(n))if(r[ji]){this.removeListener(n,r);break}typeof t=="function"&&this.addEventListener(n,t,{[ji]:!0})}})});M.prototype.addEventListener=Hf;M.prototype.removeEventListener=Gf;Ya.exports=M;function ja(n,t,r,s){let o={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:zi[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...s,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(n._autoPong=o.autoPong,!zi.includes(o.protocolVersion))throw new RangeError(`Unsupported protocol version: ${o.protocolVersion} (supported versions: ${zi.join(", ")})`);let l;if(t instanceof $i)l=t;else try{l=new $i(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}l.protocol==="http:"?l.protocol="ws:":l.protocol==="https:"&&(l.protocol="wss:"),n._url=l.href;let c=l.protocol==="wss:",_=l.protocol==="ws+unix:",p;if(l.protocol!=="ws:"&&!c&&!_?p=`The URL's protocol must be one of "ws:", "wss:", "http:", "https", or "ws+unix:"`:_&&!l.pathname?p="The URL's pathname is empty":l.hash&&(p="The URL contains a fragment identifier"),p){let w=new SyntaxError(p);if(n._redirects===0)throw w;on(n,w);return}let d=c?443:80,h=Ff(16).toString("base64"),g=c?Df.request:qf.request,v=new Set,P;if(o.createConnection=o.createConnection||(c?ed:Zf),o.defaultPort=o.defaultPort||d,o.port=l.port||d,o.host=l.hostname.startsWith("[")?l.hostname.slice(1,-1):l.hostname,o.headers={...o.headers,"Sec-WebSocket-Version":o.protocolVersion,"Sec-WebSocket-Key":h,Connection:"Upgrade",Upgrade:"websocket"},o.path=l.pathname+l.search,o.timeout=o.handshakeTimeout,o.perMessageDeflate&&(P=new Je(o.perMessageDeflate!==!0?o.perMessageDeflate:{},!1,o.maxPayload),o.headers["Sec-WebSocket-Extensions"]=Yf({[Je.extensionName]:P.offer()})),r.length){for(let w of r){if(typeof w!="string"||!Xf.test(w)||v.has(w))throw new SyntaxError("An invalid or duplicated subprotocol was specified");v.add(w)}o.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(o.origin&&(o.protocolVersion<13?o.headers["Sec-WebSocket-Origin"]=o.origin:o.headers.Origin=o.origin),(l.username||l.password)&&(o.auth=`${l.username}:${l.password}`),_){let w=o.path.split(":");o.socketPath=w[0],o.path=w[1]}let y;if(o.followRedirects){if(n._redirects===0){n._originalIpc=_,n._originalSecure=c,n._originalHostOrSocketPath=_?o.socketPath:l.host;let w=s&&s.headers;if(s={...s,headers:{}},w)for(let[T,k]of Object.entries(w))s.headers[T.toLowerCase()]=k}else if(n.listenerCount("redirect")===0){let w=_?n._originalIpc?o.socketPath===n._originalHostOrSocketPath:!1:n._originalIpc?!1:l.host===n._originalHostOrSocketPath;(!w||n._originalSecure&&!c)&&(delete o.headers.authorization,delete o.headers.cookie,w||delete o.headers.host,o.auth=void 0)}o.auth&&!s.headers.authorization&&(s.headers.authorization="Basic "+Buffer.from(o.auth).toString("base64")),y=n._req=g(o),n._redirects&&n.emit("redirect",n.url,y)}else y=n._req=g(o);o.timeout&&y.on("timeout",()=>{ee(n,y,"Opening handshake has timed out")}),y.on("error",w=>{y===null||y[$a]||(y=n._req=null,on(n,w))}),y.on("response",w=>{let T=w.headers.location,k=w.statusCode;if(T&&o.followRedirects&&k>=300&&k<400){if(++n._redirects>o.maxRedirects){ee(n,y,"Maximum redirects exceeded");return}y.abort();let L;try{L=new $i(T,t)}catch{let O=new SyntaxError(`Invalid URL: ${T}`);on(n,O);return}ja(n,L,r,s)}else n.emit("unexpected-response",y,w)||ee(n,y,`Unexpected server response: ${w.statusCode}`)}),y.on("upgrade",(w,T,k)=>{if(n.emit("upgrade",w),n.readyState!==M.CONNECTING)return;if(y=n._req=null,w.headers.upgrade.toLowerCase()!=="websocket"){ee(n,T,"Invalid Upgrade header");return}let L=Nf("sha1").update(h+jf).digest("base64");if(w.headers["sec-websocket-accept"]!==L){ee(n,T,"Invalid Sec-WebSocket-Accept header");return}let F=w.headers["sec-websocket-protocol"],O;if(F!==void 0?v.size?v.has(F)||(O="Server sent an invalid subprotocol"):O="Server sent a subprotocol but none was requested":v.size&&(O="Server sent no subprotocol"),O){ee(n,T,O);return}F&&(n._protocol=F);let W=w.headers["sec-websocket-extensions"];if(W!==void 0){if(!P){ee(n,T,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let I;try{I=Qf(W)}catch{ee(n,T,"Invalid Sec-WebSocket-Extensions header");return}let ue=Object.keys(I);if(ue.length!==1||ue[0]!==Je.extensionName){ee(n,T,"Server indicated an extension that was not requested");return}try{P.accept(I[Je.extensionName])}catch{ee(n,T,"Invalid Sec-WebSocket-Extensions header");return}n._extensions[Je.extensionName]=P}n.setSocket(T,k,{allowSynchronousEvents:o.allowSynchronousEvents,generateMask:o.generateMask,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation})}),o.finishRequest?o.finishRequest(y,n):y.end()}function on(n,t){n._readyState=M.CLOSING,n.emit("error",t),n.emitClose()}function Zf(n){return n.path=n.socketPath,Na.connect(n)}function ed(n){return n.path=void 0,!n.servername&&n.servername!==""&&(n.servername=Na.isIP(n.host)?"":n.host),Uf.connect(n)}function ee(n,t,r){n._readyState=M.CLOSING;let s=new Error(r);Error.captureStackTrace(s,ee),t.setHeader?(t[$a]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(on,n,s)):(t.destroy(s),t.once("error",n.emit.bind(n,"error")),t.once("close",n.emitClose.bind(n)))}function Vi(n,t,r){if(t){let s=Jf(t).length;n._socket?n._sender._bufferedBytes+=s:n._bufferedAmount+=s}if(r){let s=new Error(`WebSocket is not open: readyState ${n.readyState} (${Ie[n.readyState]})`);process.nextTick(r,s)}}function td(n,t){let r=this[H];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=n,r._socket[H]!==void 0&&(r._socket.removeListener("data",an),process.nextTick(za,r._socket),n===1005?r.close():r.close(n,t))}function rd(){let n=this[H];n.isPaused||n._socket.resume()}function nd(n){let t=this[H];t._socket[H]!==void 0&&(t._socket.removeListener("data",an),process.nextTick(za,t._socket),t.close(n[Vf])),t.emit("error",n)}function Fa(){this[H].emitClose()}function id(n,t){this[H].emit("message",n,t)}function sd(n){let t=this[H];t._autoPong&&t.pong(n,!this._isServer,Ma),t.emit("ping",n)}function od(n){this[H].emit("pong",n)}function za(n){n.resume()}function Va(){let n=this[H];this.removeListener("close",Va),this.removeListener("data",an),this.removeListener("end",Ha),n._readyState=M.CLOSING;let t;!this._readableState.endEmitted&&!n._closeFrameReceived&&!n._receiver._writableState.errorEmitted&&(t=n._socket.read())!==null&&n._receiver.write(t),n._receiver.end(),this[H]=void 0,clearTimeout(n._closeTimer),n._receiver._writableState.finished||n._receiver._writableState.errorEmitted?n.emitClose():(n._receiver.on("error",Fa),n._receiver.on("finish",Fa))}function an(n){this[H]._receiver.write(n)||this.pause()}function Ha(){let n=this[H];n._readyState=M.CLOSING,n._receiver.end(),this.end()}function Ga(){let n=this[H];this.removeListener("error",Ga),this.on("error",Ma),n&&(n._readyState=M.CLOSING,this.destroy())}});var Ja=N((Oh,Qa)=>{"use strict";var{tokenChars:ad}=Kt();function ld(n){let t=new Set,r=-1,s=-1,o=0;for(o;o{"use strict";var ud=require("events"),ln=require("http"),{Duplex:Bh}=require("stream"),{createHash:cd}=require("crypto"),Ka=Mi(),ft=Jt(),fd=Ja(),dd=Hi(),{GUID:hd,kWebSocket:pd}=Ye(),md=/^[+/0-9A-Za-z]{22}==$/,Xa=0,Za=1,tl=2,Gi=class extends ud{constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:dd,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=ln.createServer((s,o)=>{let l=ln.STATUS_CODES[426];o.writeHead(426,{"Content-Length":l.length,"Content-Type":"text/plain"}),o.end(l)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let s=this.emit.bind(this,"connection");this._removeListeners=bd(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(o,l,c)=>{this.handleUpgrade(o,l,c,s)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=Xa}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===tl){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(tr,this);return}if(t&&this.once("close",t),this._state!==Za)if(this._state=Za,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(tr,this):process.nextTick(tr,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{tr(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,s,o){r.on("error",el);let l=t.headers["sec-websocket-key"],c=+t.headers["sec-websocket-version"];if(t.method!=="GET"){dt(this,t,r,405,"Invalid HTTP method");return}if(t.headers.upgrade.toLowerCase()!=="websocket"){dt(this,t,r,400,"Invalid Upgrade header");return}if(!l||!md.test(l)){dt(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(c!==8&&c!==13){dt(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header");return}if(!this.shouldHandle(t)){rr(r,400);return}let _=t.headers["sec-websocket-protocol"],p=new Set;if(_!==void 0)try{p=fd.parse(_)}catch{dt(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let d=t.headers["sec-websocket-extensions"],h={};if(this.options.perMessageDeflate&&d!==void 0){let g=new ft(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let v=Ka.parse(d);v[ft.extensionName]&&(g.accept(v[ft.extensionName]),h[ft.extensionName]=g)}catch{dt(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let g={origin:t.headers[`${c===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(g,(v,P,y,w)=>{if(!v)return rr(r,P||401,y,w);this.completeUpgrade(h,l,p,t,r,s,o)});return}if(!this.options.verifyClient(g))return rr(r,401)}this.completeUpgrade(h,l,p,t,r,s,o)}completeUpgrade(t,r,s,o,l,c,_){if(!l.readable||!l.writable)return l.destroy();if(l[pd])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Xa)return rr(l,503);let d=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${cd("sha1").update(r+hd).digest("base64")}`],h=new this.options.WebSocket(null,void 0,this.options);if(s.size){let g=this.options.handleProtocols?this.options.handleProtocols(s,o):s.values().next().value;g&&(d.push(`Sec-WebSocket-Protocol: ${g}`),h._protocol=g)}if(t[ft.extensionName]){let g=t[ft.extensionName].params,v=Ka.format({[ft.extensionName]:[g]});d.push(`Sec-WebSocket-Extensions: ${v}`),h._extensions=t}this.emit("headers",d,o),l.write(d.concat(`\r +`);function _(p){var d=Si(Be.join(p,"prebuilds")).map(Yo),h=d.filter(Qo(yi,_i)).sort(Jo)[0];if(h){var g=Be.join(p,"prebuilds",h.name),v=Si(g).map(Ko),P=v.filter(Xo(bi,No)),y=P.sort(Zo(bi))[0];if(y)return Be.join(g,y.file)}}};function Si(n){try{return jo.readdirSync(n)}catch{return[]}}function Mo(n,t){var r=Si(n).filter(t);return r[0]&&Be.join(n,r[0])}function $o(n){return/\.node$/.test(n)}function Yo(n){var t=n.split("-");if(t.length===2){var r=t[0],s=t[1].split("+");if(r&&s.length&&s.every(Boolean))return{name:n,platform:r,architectures:s}}}function Qo(n,t){return function(r){return r==null||r.platform!==n?!1:r.architectures.includes(t)}}function Jo(n,t){return n.architectures.length-t.architectures.length}function Ko(n){var t=n.split("."),r=t.pop(),s={file:n,specificity:0};if(r==="node"){for(var o=0;or.specificity?-1:1:0}}function sf(){return!!(process.versions&&process.versions.nw)}function of(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<"u"&&window.process&&window.process.type==="renderer"}function af(n){return n==="linux"&&jo.existsSync("/etc/alpine-release")}ge.parseTags=Ko;ge.matchTags=Xo;ge.compareTags=Zo;ge.parseTuple=Yo;ge.matchTuple=Qo;ge.compareTuples=Jo});var Ei=N((ph,vi)=>{var wi=typeof __webpack_require__=="function"?__non_webpack_require__:require;typeof wi.addon=="function"?vi.exports=wi.addon.bind(wi):vi.exports=ta()});var na=N((mh,ra)=>{"use strict";var lf=(n,t,r,s,o)=>{for(var l=0;l{let r=n.length;for(var s=0;s{"use strict";try{Ri.exports=Ei()(__dirname)}catch{Ri.exports=na()}});var Gt=N((_h,Kr)=>{"use strict";var{EMPTY_BUFFER:cf}=Ye(),Ti=Buffer[Symbol.species];function ff(n,t){if(n.length===0)return cf;if(n.length===1)return n[0];let r=Buffer.allocUnsafe(t),s=0;for(let o=0;o{"use strict";var aa=Symbol("kDone"),xi=Symbol("kRun"),ki=class{constructor(t){this[aa]=()=>{this.pending--,this[xi]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[xi]()}[xi](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[aa])}}};la.exports=ki});var Jt=N((gh,ha)=>{"use strict";var Yt=require("zlib"),ca=Gt(),hf=ua(),{kStatusCode:fa}=Ye(),pf=Buffer[Symbol.species],mf=Buffer.from([0,0,255,255]),en=Symbol("permessage-deflate"),We=Symbol("total-length"),Qt=Symbol("callback"),Qe=Symbol("buffers"),Zr=Symbol("error"),Xr,Pi=class{constructor(t,r,s){if(this._maxPayload=s|0,this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!r,this._deflate=null,this._inflate=null,this.params=null,!Xr){let o=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Xr=new hf(o)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[Qt];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,s=t.find(o=>!(r.serverNoContextTakeover===!1&&o.server_no_context_takeover||o.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>o.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!o.client_max_window_bits));if(!s)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(s.server_no_context_takeover=!0),r.clientNoContextTakeover&&(s.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(s.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?s.client_max_window_bits=r.clientMaxWindowBits:(s.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete s.client_max_window_bits,s}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(s=>{let o=r[s];if(o.length>1)throw new Error(`Parameter "${s}" must have only a single value`);if(o=o[0],s==="client_max_window_bits"){if(o!==!0){let l=+o;if(!Number.isInteger(l)||l<8||l>15)throw new TypeError(`Invalid value for parameter "${s}": ${o}`);o=l}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${s}": ${o}`)}else if(s==="server_max_window_bits"){let l=+o;if(!Number.isInteger(l)||l<8||l>15)throw new TypeError(`Invalid value for parameter "${s}": ${o}`);o=l}else if(s==="client_no_context_takeover"||s==="server_no_context_takeover"){if(o!==!0)throw new TypeError(`Invalid value for parameter "${s}": ${o}`)}else throw new Error(`Unknown parameter "${s}"`);r[s]=o})}),t}decompress(t,r,s){Xr.add(o=>{this._decompress(t,r,(l,c)=>{o(),s(l,c)})})}compress(t,r,s){Xr.add(o=>{this._compress(t,r,(l,c)=>{o(),s(l,c)})})}_decompress(t,r,s){let o=this._isServer?"client":"server";if(!this._inflate){let l=`${o}_max_window_bits`,c=typeof this.params[l]!="number"?Yt.Z_DEFAULT_WINDOWBITS:this.params[l];this._inflate=Yt.createInflateRaw({...this._options.zlibInflateOptions,windowBits:c}),this._inflate[en]=this,this._inflate[We]=0,this._inflate[Qe]=[],this._inflate.on("error",_f),this._inflate.on("data",da)}this._inflate[Qt]=s,this._inflate.write(t),r&&this._inflate.write(mf),this._inflate.flush(()=>{let l=this._inflate[Zr];if(l){this._inflate.close(),this._inflate=null,s(l);return}let c=ca.concat(this._inflate[Qe],this._inflate[We]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[We]=0,this._inflate[Qe]=[],r&&this.params[`${o}_no_context_takeover`]&&this._inflate.reset()),s(null,c)})}_compress(t,r,s){let o=this._isServer?"server":"client";if(!this._deflate){let l=`${o}_max_window_bits`,c=typeof this.params[l]!="number"?Yt.Z_DEFAULT_WINDOWBITS:this.params[l];this._deflate=Yt.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:c}),this._deflate[We]=0,this._deflate[Qe]=[],this._deflate.on("data",bf)}this._deflate[Qt]=s,this._deflate.write(t),this._deflate.flush(Yt.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let l=ca.concat(this._deflate[Qe],this._deflate[We]);r&&(l=new pf(l.buffer,l.byteOffset,l.length-4)),this._deflate[Qt]=null,this._deflate[We]=0,this._deflate[Qe]=[],r&&this.params[`${o}_no_context_takeover`]&&this._deflate.reset(),s(null,l)})}};ha.exports=Pi;function bf(n){this[Qe].push(n),this[We]+=n.length}function da(n){if(this[We]+=n.length,this[en]._maxPayload<1||this[We]<=this[en]._maxPayload){this[Qe].push(n);return}this[Zr]=new RangeError("Max payload size exceeded"),this[Zr].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Zr][fa]=1009,this.removeListener("data",da),this.reset()}function _f(n){this[en]._inflate=null,n[fa]=1007,this[Qt](n)}});var ma=N((Sh,pa)=>{"use strict";function yf(n){let t=n.length,r=0;for(;r=t||(n[r+1]&192)!==128||(n[r+2]&192)!==128||n[r]===224&&(n[r+1]&224)===128||n[r]===237&&(n[r+1]&224)===160)return!1;r+=3}else if((n[r]&248)===240){if(r+3>=t||(n[r+1]&192)!==128||(n[r+2]&192)!==128||(n[r+3]&192)!==128||n[r]===240&&(n[r+1]&240)===128||n[r]===244&&n[r+1]>143||n[r]>244)return!1;r+=4}else return!1;return!0}pa.exports=yf});var ba=N((wh,Ai)=>{"use strict";try{Ai.exports=Ei()(__dirname)}catch{Ai.exports=ma()}});var Kt=N((vh,tn)=>{"use strict";var{isUtf8:_a}=require("buffer"),gf=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function Sf(n){return n>=1e3&&n<=1014&&n!==1004&&n!==1005&&n!==1006||n>=3e3&&n<=4999}function Oi(n){let t=n.length,r=0;for(;r=t||(n[r+1]&192)!==128||(n[r+2]&192)!==128||n[r]===224&&(n[r+1]&224)===128||n[r]===237&&(n[r+1]&224)===160)return!1;r+=3}else if((n[r]&248)===240){if(r+3>=t||(n[r+1]&192)!==128||(n[r+2]&192)!==128||(n[r+3]&192)!==128||n[r]===240&&(n[r+1]&240)===128||n[r]===244&&n[r+1]>143||n[r]>244)return!1;r+=4}else return!1;return!0}tn.exports={isValidStatusCode:Sf,isValidUTF8:Oi,tokenChars:gf};if(_a)tn.exports.isValidUTF8=function(n){return n.length<24?Oi(n):_a(n)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let n=ba();tn.exports.isValidUTF8=function(t){return t.length<32?Oi(t):n(t)}}catch{}});var Di=N((Eh,Ra)=>{"use strict";var{Writable:wf}=require("stream"),ya=Jt(),{BINARY_TYPES:vf,EMPTY_BUFFER:ga,kStatusCode:Ef,kWebSocket:Rf}=Ye(),{concat:Bi,toArrayBuffer:Tf,unmask:Cf}=Gt(),{isValidStatusCode:xf,isValidUTF8:Sa}=Kt(),rn=Buffer[Symbol.species],ae=0,wa=1,va=2,Ea=3,Wi=4,Li=5,nn=6,Ii=class extends wf{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||vf[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[Rf]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=ae}_write(t,r,s){if(this._opcode===8&&this._state==ae)return s();this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(s)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t=s.length?r.set(this._buffers.shift(),o):(r.set(new Uint8Array(s.buffer,s.byteOffset,t),o),this._buffers[0]=new rn(s.buffer,s.byteOffset+t,s.length-t)),t-=s.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case ae:this.getInfo(t);break;case wa:this.getPayloadLength16(t);break;case va:this.getPayloadLength64(t);break;case Ea:this.getMask();break;case Wi:this.getData(t);break;case Li:case nn:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if(r[0]&48){let o=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(o);return}let s=(r[0]&64)===64;if(s&&!this._extensions[ya.extensionName]){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(o);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(s){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(o);return}if(!this._fragmented){let o=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(o);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let o=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(o);return}this._compressed=s}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let o=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(o);return}if(s){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(o);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let o=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(o);return}}else{let o=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(o);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let o=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(o);return}}else if(this._masked){let o=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(o);return}this._payloadLength===126?this._state=wa:this._payloadLength===127?this._state=va:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),s=r.readUInt32BE(0);if(s>Math.pow(2,21)-1){let o=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(o);return}this._payloadLength=s*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(r);return}this._masked?this._state=Ea:this._state=Wi}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Wi}getData(t){let r=ga;if(this._payloadLength){if(this._bufferedBytes7){this.controlMessage(r,t);return}if(this._compressed){this._state=Li,this.decompress(r,t);return}r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(r)),this.dataMessage(t)}decompress(t,r){this._extensions[ya.extensionName].decompress(t,this._fin,(o,l)=>{if(o)return r(o);if(l.length){if(this._messageLength+=l.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let c=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(c);return}this._fragments.push(l)}this.dataMessage(r),this._state===ae&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=ae;return}let r=this._messageLength,s=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let o;this._binaryType==="nodebuffer"?o=Bi(s,r):this._binaryType==="arraybuffer"?o=Tf(Bi(s,r)):o=s,this._allowSynchronousEvents?(this.emit("message",o,!0),this._state=ae):(this._state=nn,setImmediate(()=>{this.emit("message",o,!0),this._state=ae,this.startLoop(t)}))}else{let o=Bi(s,r);if(!this._skipUTF8Validation&&!Sa(o)){let l=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(l);return}this._state===Li||this._allowSynchronousEvents?(this.emit("message",o,!1),this._state=ae):(this._state=nn,setImmediate(()=>{this.emit("message",o,!1),this._state=ae,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,ga),this.end();else{let s=t.readUInt16BE(0);if(!xf(s)){let l=this.createError(RangeError,`invalid status code ${s}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(l);return}let o=new rn(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!Sa(o)){let l=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(l);return}this._loop=!1,this.emit("conclude",s,o),this.end()}this._state=ae;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=ae):(this._state=nn,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=ae,this.startLoop(r)}))}createError(t,r,s,o,l){this._loop=!1,this._errored=!0;let c=new t(s?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(c,this.createError),c.code=l,c[Ef]=o,c}};Ra.exports=Ii});var Ui=N((Th,xa)=>{"use strict";var{Duplex:Rh}=require("stream"),{randomFillSync:kf}=require("crypto"),Ta=Jt(),{EMPTY_BUFFER:Pf}=Ye(),{isValidStatusCode:Af}=Kt(),{mask:Ca,toBuffer:At}=Gt(),pe=Symbol("kByteLength"),Of=Buffer.alloc(4),qi=class n{constructor(t,r,s){this._extensions=r||{},s&&(this._generateMask=s,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(t,r){let s,o=!1,l=2,c=!1;r.mask&&(s=r.maskBuffer||Of,r.generateMask?r.generateMask(s):kf(s,0,4),c=(s[0]|s[1]|s[2]|s[3])===0,l=6);let _;typeof t=="string"?(!r.mask||c)&&r[pe]!==void 0?_=r[pe]:(t=Buffer.from(t),_=t.length):(_=t.length,o=r.mask&&r.readOnly&&!c);let p=_;_>=65536?(l+=8,p=127):_>125&&(l+=2,p=126);let d=Buffer.allocUnsafe(o?_+l:l);return d[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(d[0]|=64),d[1]=p,p===126?d.writeUInt16BE(_,2):p===127&&(d[2]=d[3]=0,d.writeUIntBE(_,4,6)),r.mask?(d[1]|=128,d[l-4]=s[0],d[l-3]=s[1],d[l-2]=s[2],d[l-1]=s[3],c?[d,t]:o?(Ca(t,s,d,l,_),[d]):(Ca(t,s,t,0,_),[d,t])):[d,t]}close(t,r,s,o){let l;if(t===void 0)l=Pf;else{if(typeof t!="number"||!Af(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)l=Buffer.allocUnsafe(2),l.writeUInt16BE(t,0);else{let _=Buffer.byteLength(r);if(_>123)throw new RangeError("The message must not be greater than 123 bytes");l=Buffer.allocUnsafe(2+_),l.writeUInt16BE(t,0),typeof r=="string"?l.write(r,2):l.set(r,2)}}let c={[pe]:l.length,fin:!0,generateMask:this._generateMask,mask:s,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._deflating?this.enqueue([this.dispatch,l,!1,c,o]):this.sendFrame(n.frame(l,c),o)}ping(t,r,s){let o,l;if(typeof t=="string"?(o=Buffer.byteLength(t),l=!1):(t=At(t),o=t.length,l=At.readOnly),o>125)throw new RangeError("The data size must not be greater than 125 bytes");let c={[pe]:o,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:l,rsv1:!1};this._deflating?this.enqueue([this.dispatch,t,!1,c,s]):this.sendFrame(n.frame(t,c),s)}pong(t,r,s){let o,l;if(typeof t=="string"?(o=Buffer.byteLength(t),l=!1):(t=At(t),o=t.length,l=At.readOnly),o>125)throw new RangeError("The data size must not be greater than 125 bytes");let c={[pe]:o,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:l,rsv1:!1};this._deflating?this.enqueue([this.dispatch,t,!1,c,s]):this.sendFrame(n.frame(t,c),s)}send(t,r,s){let o=this._extensions[Ta.extensionName],l=r.binary?2:1,c=r.compress,_,p;if(typeof t=="string"?(_=Buffer.byteLength(t),p=!1):(t=At(t),_=t.length,p=At.readOnly),this._firstFragment?(this._firstFragment=!1,c&&o&&o.params[o._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(c=_>=o._threshold),this._compress=c):(c=!1,l=0),r.fin&&(this._firstFragment=!0),o){let d={[pe]:_,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:l,readOnly:p,rsv1:c};this._deflating?this.enqueue([this.dispatch,t,this._compress,d,s]):this.dispatch(t,this._compress,d,s)}else this.sendFrame(n.frame(t,{[pe]:_,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:l,readOnly:p,rsv1:!1}),s)}dispatch(t,r,s,o){if(!r){this.sendFrame(n.frame(t,s),o);return}let l=this._extensions[Ta.extensionName];this._bufferedBytes+=s[pe],this._deflating=!0,l.compress(t,s.fin,(c,_)=>{if(this._socket.destroyed){let p=new Error("The socket was closed while data was being compressed");typeof o=="function"&&o(p);for(let d=0;d{"use strict";var{kForOnEventAttribute:Xt,kListener:Fi}=Ye(),ka=Symbol("kCode"),Pa=Symbol("kData"),Aa=Symbol("kError"),Oa=Symbol("kMessage"),Ba=Symbol("kReason"),Ot=Symbol("kTarget"),Wa=Symbol("kType"),La=Symbol("kWasClean"),Le=class{constructor(t){this[Ot]=null,this[Wa]=t}get target(){return this[Ot]}get type(){return this[Wa]}};Object.defineProperty(Le.prototype,"target",{enumerable:!0});Object.defineProperty(Le.prototype,"type",{enumerable:!0});var ct=class extends Le{constructor(t,r={}){super(t),this[ka]=r.code===void 0?0:r.code,this[Ba]=r.reason===void 0?"":r.reason,this[La]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[ka]}get reason(){return this[Ba]}get wasClean(){return this[La]}};Object.defineProperty(ct.prototype,"code",{enumerable:!0});Object.defineProperty(ct.prototype,"reason",{enumerable:!0});Object.defineProperty(ct.prototype,"wasClean",{enumerable:!0});var Bt=class extends Le{constructor(t,r={}){super(t),this[Aa]=r.error===void 0?null:r.error,this[Oa]=r.message===void 0?"":r.message}get error(){return this[Aa]}get message(){return this[Oa]}};Object.defineProperty(Bt.prototype,"error",{enumerable:!0});Object.defineProperty(Bt.prototype,"message",{enumerable:!0});var Zt=class extends Le{constructor(t,r={}){super(t),this[Pa]=r.data===void 0?null:r.data}get data(){return this[Pa]}};Object.defineProperty(Zt.prototype,"data",{enumerable:!0});var Bf={addEventListener(n,t,r={}){for(let o of this.listeners(n))if(!r[Xt]&&o[Fi]===t&&!o[Xt])return;let s;if(n==="message")s=function(l,c){let _=new Zt("message",{data:c?l:l.toString()});_[Ot]=this,sn(t,this,_)};else if(n==="close")s=function(l,c){let _=new ct("close",{code:l,reason:c.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});_[Ot]=this,sn(t,this,_)};else if(n==="error")s=function(l){let c=new Bt("error",{error:l,message:l.message});c[Ot]=this,sn(t,this,c)};else if(n==="open")s=function(){let l=new Le("open");l[Ot]=this,sn(t,this,l)};else return;s[Xt]=!!r[Xt],s[Fi]=t,r.once?this.once(n,s):this.on(n,s)},removeEventListener(n,t){for(let r of this.listeners(n))if(r[Fi]===t&&!r[Xt]){this.removeListener(n,r);break}}};Ia.exports={CloseEvent:ct,ErrorEvent:Bt,Event:Le,EventTarget:Bf,MessageEvent:Zt};function sn(n,t,r){typeof n=="object"&&n.handleEvent?n.handleEvent.call(n,r):n.call(t,r)}});var Ni=N((xh,qa)=>{"use strict";var{tokenChars:er}=Kt();function Se(n,t,r){n[t]===void 0?n[t]=[r]:n[t].push(r)}function Wf(n){let t=Object.create(null),r=Object.create(null),s=!1,o=!1,l=!1,c,_,p=-1,d=-1,h=-1,g=0;for(;g{let r=n[t];return Array.isArray(r)||(r=[r]),r.map(s=>[t].concat(Object.keys(s).map(o=>{let l=s[o];return Array.isArray(l)||(l=[l]),l.map(c=>c===!0?o:`${o}=${c}`).join("; ")})).join("; ")).join(", ")}).join(", ")}qa.exports={format:Lf,parse:Wf}});var Vi=N((Ah,Ya)=>{"use strict";var If=require("events"),Df=require("https"),qf=require("http"),Na=require("net"),Uf=require("tls"),{randomBytes:Ff,createHash:Nf}=require("crypto"),{Duplex:kh,Readable:Ph}=require("stream"),{URL:Mi}=require("url"),Je=Jt(),Mf=Di(),$f=Ui(),{BINARY_TYPES:Ua,EMPTY_BUFFER:on,GUID:jf,kForOnEventAttribute:$i,kListener:zf,kStatusCode:Vf,kWebSocket:G,NOOP:Ma}=Ye(),{EventTarget:{addEventListener:Hf,removeEventListener:Gf}}=Da(),{format:Yf,parse:Qf}=Ni(),{toBuffer:Jf}=Gt(),Kf=30*1e3,$a=Symbol("kAborted"),ji=[8,13],Ie=["CONNECTING","OPEN","CLOSING","CLOSED"],Xf=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,M=class n extends If{constructor(t,r,s){super(),this._binaryType=Ua[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=on,this._closeTimer=null,this._extensions={},this._paused=!1,this._protocol="",this._readyState=n.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(s=r,r=[]):r=[r]),ja(this,t,r,s)):(this._autoPong=s.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){Ua.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,s){let o=new Mf({allowSynchronousEvents:s.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:s.maxPayload,skipUTF8Validation:s.skipUTF8Validation});this._sender=new $f(t,this._extensions,s.generateMask),this._receiver=o,this._socket=t,o[G]=this,t[G]=this,o.on("conclude",td),o.on("drain",rd),o.on("error",nd),o.on("message",id),o.on("ping",sd),o.on("pong",od),t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",Va),t.on("data",ln),t.on("end",Ha),t.on("error",Ga),this._readyState=n.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=n.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Je.extensionName]&&this._extensions[Je.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=n.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==n.CLOSED){if(this.readyState===n.CONNECTING){ee(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===n.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=n.CLOSING,this._sender.close(t,r,!this._isServer,s=>{s||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),Kf)}}pause(){this.readyState===n.CONNECTING||this.readyState===n.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,s){if(this.readyState===n.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(s=t,t=r=void 0):typeof r=="function"&&(s=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==n.OPEN){zi(this,t,s);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||on,r,s)}pong(t,r,s){if(this.readyState===n.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(s=t,t=r=void 0):typeof r=="function"&&(s=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==n.OPEN){zi(this,t,s);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||on,r,s)}resume(){this.readyState===n.CONNECTING||this.readyState===n.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,s){if(this.readyState===n.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(s=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==n.OPEN){zi(this,t,s);return}let o={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[Je.extensionName]||(o.compress=!1),this._sender.send(t||on,o,s)}terminate(){if(this.readyState!==n.CLOSED){if(this.readyState===n.CONNECTING){ee(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=n.CLOSING,this._socket.destroy())}}};Object.defineProperty(M,"CONNECTING",{enumerable:!0,value:Ie.indexOf("CONNECTING")});Object.defineProperty(M.prototype,"CONNECTING",{enumerable:!0,value:Ie.indexOf("CONNECTING")});Object.defineProperty(M,"OPEN",{enumerable:!0,value:Ie.indexOf("OPEN")});Object.defineProperty(M.prototype,"OPEN",{enumerable:!0,value:Ie.indexOf("OPEN")});Object.defineProperty(M,"CLOSING",{enumerable:!0,value:Ie.indexOf("CLOSING")});Object.defineProperty(M.prototype,"CLOSING",{enumerable:!0,value:Ie.indexOf("CLOSING")});Object.defineProperty(M,"CLOSED",{enumerable:!0,value:Ie.indexOf("CLOSED")});Object.defineProperty(M.prototype,"CLOSED",{enumerable:!0,value:Ie.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(n=>{Object.defineProperty(M.prototype,n,{enumerable:!0})});["open","error","close","message"].forEach(n=>{Object.defineProperty(M.prototype,`on${n}`,{enumerable:!0,get(){for(let t of this.listeners(n))if(t[$i])return t[zf];return null},set(t){for(let r of this.listeners(n))if(r[$i]){this.removeListener(n,r);break}typeof t=="function"&&this.addEventListener(n,t,{[$i]:!0})}})});M.prototype.addEventListener=Hf;M.prototype.removeEventListener=Gf;Ya.exports=M;function ja(n,t,r,s){let o={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:ji[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...s,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(n._autoPong=o.autoPong,!ji.includes(o.protocolVersion))throw new RangeError(`Unsupported protocol version: ${o.protocolVersion} (supported versions: ${ji.join(", ")})`);let l;if(t instanceof Mi)l=t;else try{l=new Mi(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}l.protocol==="http:"?l.protocol="ws:":l.protocol==="https:"&&(l.protocol="wss:"),n._url=l.href;let c=l.protocol==="wss:",_=l.protocol==="ws+unix:",p;if(l.protocol!=="ws:"&&!c&&!_?p=`The URL's protocol must be one of "ws:", "wss:", "http:", "https", or "ws+unix:"`:_&&!l.pathname?p="The URL's pathname is empty":l.hash&&(p="The URL contains a fragment identifier"),p){let w=new SyntaxError(p);if(n._redirects===0)throw w;an(n,w);return}let d=c?443:80,h=Ff(16).toString("base64"),g=c?Df.request:qf.request,v=new Set,P;if(o.createConnection=o.createConnection||(c?ed:Zf),o.defaultPort=o.defaultPort||d,o.port=l.port||d,o.host=l.hostname.startsWith("[")?l.hostname.slice(1,-1):l.hostname,o.headers={...o.headers,"Sec-WebSocket-Version":o.protocolVersion,"Sec-WebSocket-Key":h,Connection:"Upgrade",Upgrade:"websocket"},o.path=l.pathname+l.search,o.timeout=o.handshakeTimeout,o.perMessageDeflate&&(P=new Je(o.perMessageDeflate!==!0?o.perMessageDeflate:{},!1,o.maxPayload),o.headers["Sec-WebSocket-Extensions"]=Yf({[Je.extensionName]:P.offer()})),r.length){for(let w of r){if(typeof w!="string"||!Xf.test(w)||v.has(w))throw new SyntaxError("An invalid or duplicated subprotocol was specified");v.add(w)}o.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(o.origin&&(o.protocolVersion<13?o.headers["Sec-WebSocket-Origin"]=o.origin:o.headers.Origin=o.origin),(l.username||l.password)&&(o.auth=`${l.username}:${l.password}`),_){let w=o.path.split(":");o.socketPath=w[0],o.path=w[1]}let y;if(o.followRedirects){if(n._redirects===0){n._originalIpc=_,n._originalSecure=c,n._originalHostOrSocketPath=_?o.socketPath:l.host;let w=s&&s.headers;if(s={...s,headers:{}},w)for(let[T,k]of Object.entries(w))s.headers[T.toLowerCase()]=k}else if(n.listenerCount("redirect")===0){let w=_?n._originalIpc?o.socketPath===n._originalHostOrSocketPath:!1:n._originalIpc?!1:l.host===n._originalHostOrSocketPath;(!w||n._originalSecure&&!c)&&(delete o.headers.authorization,delete o.headers.cookie,w||delete o.headers.host,o.auth=void 0)}o.auth&&!s.headers.authorization&&(s.headers.authorization="Basic "+Buffer.from(o.auth).toString("base64")),y=n._req=g(o),n._redirects&&n.emit("redirect",n.url,y)}else y=n._req=g(o);o.timeout&&y.on("timeout",()=>{ee(n,y,"Opening handshake has timed out")}),y.on("error",w=>{y===null||y[$a]||(y=n._req=null,an(n,w))}),y.on("response",w=>{let T=w.headers.location,k=w.statusCode;if(T&&o.followRedirects&&k>=300&&k<400){if(++n._redirects>o.maxRedirects){ee(n,y,"Maximum redirects exceeded");return}y.abort();let L;try{L=new Mi(T,t)}catch{let O=new SyntaxError(`Invalid URL: ${T}`);an(n,O);return}ja(n,L,r,s)}else n.emit("unexpected-response",y,w)||ee(n,y,`Unexpected server response: ${w.statusCode}`)}),y.on("upgrade",(w,T,k)=>{if(n.emit("upgrade",w),n.readyState!==M.CONNECTING)return;if(y=n._req=null,w.headers.upgrade.toLowerCase()!=="websocket"){ee(n,T,"Invalid Upgrade header");return}let L=Nf("sha1").update(h+jf).digest("base64");if(w.headers["sec-websocket-accept"]!==L){ee(n,T,"Invalid Sec-WebSocket-Accept header");return}let F=w.headers["sec-websocket-protocol"],O;if(F!==void 0?v.size?v.has(F)||(O="Server sent an invalid subprotocol"):O="Server sent a subprotocol but none was requested":v.size&&(O="Server sent no subprotocol"),O){ee(n,T,O);return}F&&(n._protocol=F);let W=w.headers["sec-websocket-extensions"];if(W!==void 0){if(!P){ee(n,T,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let I;try{I=Qf(W)}catch{ee(n,T,"Invalid Sec-WebSocket-Extensions header");return}let ue=Object.keys(I);if(ue.length!==1||ue[0]!==Je.extensionName){ee(n,T,"Server indicated an extension that was not requested");return}try{P.accept(I[Je.extensionName])}catch{ee(n,T,"Invalid Sec-WebSocket-Extensions header");return}n._extensions[Je.extensionName]=P}n.setSocket(T,k,{allowSynchronousEvents:o.allowSynchronousEvents,generateMask:o.generateMask,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation})}),o.finishRequest?o.finishRequest(y,n):y.end()}function an(n,t){n._readyState=M.CLOSING,n.emit("error",t),n.emitClose()}function Zf(n){return n.path=n.socketPath,Na.connect(n)}function ed(n){return n.path=void 0,!n.servername&&n.servername!==""&&(n.servername=Na.isIP(n.host)?"":n.host),Uf.connect(n)}function ee(n,t,r){n._readyState=M.CLOSING;let s=new Error(r);Error.captureStackTrace(s,ee),t.setHeader?(t[$a]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(an,n,s)):(t.destroy(s),t.once("error",n.emit.bind(n,"error")),t.once("close",n.emitClose.bind(n)))}function zi(n,t,r){if(t){let s=Jf(t).length;n._socket?n._sender._bufferedBytes+=s:n._bufferedAmount+=s}if(r){let s=new Error(`WebSocket is not open: readyState ${n.readyState} (${Ie[n.readyState]})`);process.nextTick(r,s)}}function td(n,t){let r=this[G];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=n,r._socket[G]!==void 0&&(r._socket.removeListener("data",ln),process.nextTick(za,r._socket),n===1005?r.close():r.close(n,t))}function rd(){let n=this[G];n.isPaused||n._socket.resume()}function nd(n){let t=this[G];t._socket[G]!==void 0&&(t._socket.removeListener("data",ln),process.nextTick(za,t._socket),t.close(n[Vf])),t.emit("error",n)}function Fa(){this[G].emitClose()}function id(n,t){this[G].emit("message",n,t)}function sd(n){let t=this[G];t._autoPong&&t.pong(n,!this._isServer,Ma),t.emit("ping",n)}function od(n){this[G].emit("pong",n)}function za(n){n.resume()}function Va(){let n=this[G];this.removeListener("close",Va),this.removeListener("data",ln),this.removeListener("end",Ha),n._readyState=M.CLOSING;let t;!this._readableState.endEmitted&&!n._closeFrameReceived&&!n._receiver._writableState.errorEmitted&&(t=n._socket.read())!==null&&n._receiver.write(t),n._receiver.end(),this[G]=void 0,clearTimeout(n._closeTimer),n._receiver._writableState.finished||n._receiver._writableState.errorEmitted?n.emitClose():(n._receiver.on("error",Fa),n._receiver.on("finish",Fa))}function ln(n){this[G]._receiver.write(n)||this.pause()}function Ha(){let n=this[G];n._readyState=M.CLOSING,n._receiver.end(),this.end()}function Ga(){let n=this[G];this.removeListener("error",Ga),this.on("error",Ma),n&&(n._readyState=M.CLOSING,this.destroy())}});var Ja=N((Oh,Qa)=>{"use strict";var{tokenChars:ad}=Kt();function ld(n){let t=new Set,r=-1,s=-1,o=0;for(o;o{"use strict";var ud=require("events"),un=require("http"),{Duplex:Bh}=require("stream"),{createHash:cd}=require("crypto"),Ka=Ni(),ft=Jt(),fd=Ja(),dd=Vi(),{GUID:hd,kWebSocket:pd}=Ye(),md=/^[+/0-9A-Za-z]{22}==$/,Xa=0,Za=1,tl=2,Hi=class extends ud{constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:dd,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=un.createServer((s,o)=>{let l=un.STATUS_CODES[426];o.writeHead(426,{"Content-Length":l.length,"Content-Type":"text/plain"}),o.end(l)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let s=this.emit.bind(this,"connection");this._removeListeners=bd(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(o,l,c)=>{this.handleUpgrade(o,l,c,s)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=Xa}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===tl){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(tr,this);return}if(t&&this.once("close",t),this._state!==Za)if(this._state=Za,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(tr,this):process.nextTick(tr,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{tr(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,s,o){r.on("error",el);let l=t.headers["sec-websocket-key"],c=+t.headers["sec-websocket-version"];if(t.method!=="GET"){dt(this,t,r,405,"Invalid HTTP method");return}if(t.headers.upgrade.toLowerCase()!=="websocket"){dt(this,t,r,400,"Invalid Upgrade header");return}if(!l||!md.test(l)){dt(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(c!==8&&c!==13){dt(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header");return}if(!this.shouldHandle(t)){rr(r,400);return}let _=t.headers["sec-websocket-protocol"],p=new Set;if(_!==void 0)try{p=fd.parse(_)}catch{dt(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let d=t.headers["sec-websocket-extensions"],h={};if(this.options.perMessageDeflate&&d!==void 0){let g=new ft(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let v=Ka.parse(d);v[ft.extensionName]&&(g.accept(v[ft.extensionName]),h[ft.extensionName]=g)}catch{dt(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let g={origin:t.headers[`${c===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(g,(v,P,y,w)=>{if(!v)return rr(r,P||401,y,w);this.completeUpgrade(h,l,p,t,r,s,o)});return}if(!this.options.verifyClient(g))return rr(r,401)}this.completeUpgrade(h,l,p,t,r,s,o)}completeUpgrade(t,r,s,o,l,c,_){if(!l.readable||!l.writable)return l.destroy();if(l[pd])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Xa)return rr(l,503);let d=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${cd("sha1").update(r+hd).digest("base64")}`],h=new this.options.WebSocket(null,void 0,this.options);if(s.size){let g=this.options.handleProtocols?this.options.handleProtocols(s,o):s.values().next().value;g&&(d.push(`Sec-WebSocket-Protocol: ${g}`),h._protocol=g)}if(t[ft.extensionName]){let g=t[ft.extensionName].params,v=Ka.format({[ft.extensionName]:[g]});d.push(`Sec-WebSocket-Extensions: ${v}`),h._extensions=t}this.emit("headers",d,o),l.write(d.concat(`\r `).join(`\r -`)),l.removeListener("error",el),h.setSocket(l,c,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(h),h.on("close",()=>{this.clients.delete(h),this._shouldEmitClose&&!this.clients.size&&process.nextTick(tr,this)})),_(h,o)}};rl.exports=Gi;function bd(n,t){for(let r of Object.keys(t))n.on(r,t[r]);return function(){for(let s of Object.keys(t))n.removeListener(s,t[s])}}function tr(n){n._state=tl,n.emit("close")}function el(){this.destroy()}function rr(n,t,r,s){r=r||ln.STATUS_CODES[t],s={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...s},n.once("finish",n.destroy),n.end(`HTTP/1.1 ${t} ${ln.STATUS_CODES[t]}\r +`)),l.removeListener("error",el),h.setSocket(l,c,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(h),h.on("close",()=>{this.clients.delete(h),this._shouldEmitClose&&!this.clients.size&&process.nextTick(tr,this)})),_(h,o)}};rl.exports=Hi;function bd(n,t){for(let r of Object.keys(t))n.on(r,t[r]);return function(){for(let s of Object.keys(t))n.removeListener(s,t[s])}}function tr(n){n._state=tl,n.emit("close")}function el(){this.destroy()}function rr(n,t,r,s){r=r||un.STATUS_CODES[t],s={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...s},n.once("finish",n.destroy),n.end(`HTTP/1.1 ${t} ${un.STATUS_CODES[t]}\r `+Object.keys(s).map(o=>`${o}: ${s[o]}`).join(`\r `)+`\r \r -`+r)}function dt(n,t,r,s,o){if(n.listenerCount("wsClientError")){let l=new Error(o);Error.captureStackTrace(l,dt),n.emit("wsClientError",l,r,t)}else rr(r,s,o)}});function Td(n){if(!/^data:/i.test(n))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');n=n.replace(/\r?\n/g,"");let t=n.indexOf(",");if(t===-1||t<=4)throw new TypeError("malformed data: URI");let r=n.substring(5,t).split(";"),s="",o=!1,l=r[0]||"text/plain",c=l;for(let h=1;h{ll=Td});var fl=N((bn,cl)=>{(function(n,t){typeof bn=="object"&&typeof cl<"u"?t(bn):typeof define=="function"&&define.amd?define(["exports"],t):(n=typeof globalThis<"u"?globalThis:n||self,t(n.WebStreamsPolyfill={}))})(bn,function(n){"use strict";function t(){}function r(e){return typeof e=="object"&&e!==null||typeof e=="function"}let s=t;function o(e,i){try{Object.defineProperty(e,"name",{value:i,configurable:!0})}catch{}}let l=Promise,c=Promise.prototype.then,_=Promise.reject.bind(l);function p(e){return new l(e)}function d(e){return p(i=>i(e))}function h(e){return _(e)}function g(e,i,a){return c.call(e,i,a)}function v(e,i,a){g(g(e,i,a),void 0,s)}function P(e,i){v(e,i)}function y(e,i){v(e,void 0,i)}function w(e,i,a){return g(e,i,a)}function T(e){g(e,void 0,s)}let k=e=>{if(typeof queueMicrotask=="function")k=queueMicrotask;else{let i=d(void 0);k=a=>g(i,a)}return k(e)};function L(e,i,a){if(typeof e!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,i,a)}function F(e,i,a){try{return d(L(e,i,a))}catch(u){return h(u)}}let O=16384;class W{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(i){let a=this._back,u=a;a._elements.length===O-1&&(u={_elements:[],_next:void 0}),a._elements.push(i),u!==a&&(this._back=u,a._next=u),++this._size}shift(){let i=this._front,a=i,u=this._cursor,f=u+1,m=i._elements,b=m[u];return f===O&&(a=i._next,f=0),--this._size,this._cursor=f,i!==a&&(this._front=a),m[u]=void 0,b}forEach(i){let a=this._cursor,u=this._front,f=u._elements;for(;(a!==f.length||u._next!==void 0)&&!(a===f.length&&(u=u._next,f=u._elements,a=0,f.length===0));)i(f[a]),++a}peek(){let i=this._front,a=this._cursor;return i._elements[a]}}let I=Symbol("[[AbortSteps]]"),ue=Symbol("[[ErrorSteps]]"),Ee=Symbol("[[CancelSteps]]"),It=Symbol("[[PullSteps]]"),Pn=Symbol("[[ReleaseSteps]]");function ds(e,i){e._ownerReadableStream=i,i._reader=e,i._state==="readable"?On(e):i._state==="closed"?ru(e):hs(e,i._storedError)}function An(e,i){let a=e._ownerReadableStream;return fe(a,i)}function Re(e){let i=e._ownerReadableStream;i._state==="readable"?Bn(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):nu(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),i._readableStreamController[Pn](),i._reader=void 0,e._ownerReadableStream=void 0}function br(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function On(e){e._closedPromise=p((i,a)=>{e._closedPromise_resolve=i,e._closedPromise_reject=a})}function hs(e,i){On(e),Bn(e,i)}function ru(e){On(e),ps(e)}function Bn(e,i){e._closedPromise_reject!==void 0&&(T(e._closedPromise),e._closedPromise_reject(i),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function nu(e,i){hs(e,i)}function ps(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}let ms=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},iu=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function su(e){return typeof e=="object"||typeof e=="function"}function _e(e,i){if(e!==void 0&&!su(e))throw new TypeError(`${i} is not an object.`)}function ie(e,i){if(typeof e!="function")throw new TypeError(`${i} is not a function.`)}function ou(e){return typeof e=="object"&&e!==null||typeof e=="function"}function bs(e,i){if(!ou(e))throw new TypeError(`${i} is not an object.`)}function Te(e,i,a){if(e===void 0)throw new TypeError(`Parameter ${i} is required in '${a}'.`)}function Wn(e,i,a){if(e===void 0)throw new TypeError(`${i} is required in '${a}'.`)}function Ln(e){return Number(e)}function _s(e){return e===0?0:e}function au(e){return _s(iu(e))}function In(e,i){let u=Number.MAX_SAFE_INTEGER,f=Number(e);if(f=_s(f),!ms(f))throw new TypeError(`${i} is not a finite number`);if(f=au(f),f<0||f>u)throw new TypeError(`${i} is outside the accepted range of 0 to ${u}, inclusive`);return!ms(f)||f===0?0:f}function Dn(e,i){if(!ze(e))throw new TypeError(`${i} is not a ReadableStream.`)}function _t(e){return new Ue(e)}function ys(e,i){e._reader._readRequests.push(i)}function qn(e,i,a){let f=e._reader._readRequests.shift();a?f._closeSteps():f._chunkSteps(i)}function _r(e){return e._reader._readRequests.length}function gs(e){let i=e._reader;return!(i===void 0||!Fe(i))}class Ue{constructor(i){if(Te(i,1,"ReadableStreamDefaultReader"),Dn(i,"First parameter"),Ve(i))throw new TypeError("This stream has already been locked for exclusive reading by another reader");ds(this,i),this._readRequests=new W}get closed(){return Fe(this)?this._closedPromise:h(yr("closed"))}cancel(i=void 0){return Fe(this)?this._ownerReadableStream===void 0?h(br("cancel")):An(this,i):h(yr("cancel"))}read(){if(!Fe(this))return h(yr("read"));if(this._ownerReadableStream===void 0)return h(br("read from"));let i,a,u=p((m,b)=>{i=m,a=b});return Dt(this,{_chunkSteps:m=>i({value:m,done:!1}),_closeSteps:()=>i({value:void 0,done:!0}),_errorSteps:m=>a(m)}),u}releaseLock(){if(!Fe(this))throw yr("releaseLock");this._ownerReadableStream!==void 0&&lu(this)}}Object.defineProperties(Ue.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),o(Ue.prototype.cancel,"cancel"),o(Ue.prototype.read,"read"),o(Ue.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ue.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function Fe(e){return!r(e)||!Object.prototype.hasOwnProperty.call(e,"_readRequests")?!1:e instanceof Ue}function Dt(e,i){let a=e._ownerReadableStream;a._disturbed=!0,a._state==="closed"?i._closeSteps():a._state==="errored"?i._errorSteps(a._storedError):a._readableStreamController[It](i)}function lu(e){Re(e);let i=new TypeError("Reader was released");Ss(e,i)}function Ss(e,i){let a=e._readRequests;e._readRequests=new W,a.forEach(u=>{u._errorSteps(i)})}function yr(e){return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}let uu=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class ws{constructor(i,a){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=i,this._preventCancel=a}next(){let i=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?w(this._ongoingPromise,i,i):i(),this._ongoingPromise}return(i){let a=()=>this._returnSteps(i);return this._ongoingPromise?w(this._ongoingPromise,a,a):a()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let i=this._reader,a,u,f=p((b,S)=>{a=b,u=S});return Dt(i,{_chunkSteps:b=>{this._ongoingPromise=void 0,k(()=>a({value:b,done:!1}))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,Re(i),a({value:void 0,done:!0})},_errorSteps:b=>{this._ongoingPromise=void 0,this._isFinished=!0,Re(i),u(b)}}),f}_returnSteps(i){if(this._isFinished)return Promise.resolve({value:i,done:!0});this._isFinished=!0;let a=this._reader;if(!this._preventCancel){let u=An(a,i);return Re(a),w(u,()=>({value:i,done:!0}))}return Re(a),d({value:i,done:!0})}}let vs={next(){return Es(this)?this._asyncIteratorImpl.next():h(Rs("next"))},return(e){return Es(this)?this._asyncIteratorImpl.return(e):h(Rs("return"))}};Object.setPrototypeOf(vs,uu);function cu(e,i){let a=_t(e),u=new ws(a,i),f=Object.create(vs);return f._asyncIteratorImpl=u,f}function Es(e){if(!r(e)||!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl"))return!1;try{return e._asyncIteratorImpl instanceof ws}catch{return!1}}function Rs(e){return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}let Ts=Number.isNaN||function(e){return e!==e};var Un,Fn,Nn;function qt(e){return e.slice()}function Cs(e,i,a,u,f){new Uint8Array(e).set(new Uint8Array(a,u,f),i)}let Ce=e=>(typeof e.transfer=="function"?Ce=i=>i.transfer():typeof structuredClone=="function"?Ce=i=>structuredClone(i,{transfer:[i]}):Ce=i=>i,Ce(e)),Ne=e=>(typeof e.detached=="boolean"?Ne=i=>i.detached:Ne=i=>i.byteLength===0,Ne(e));function xs(e,i,a){if(e.slice)return e.slice(i,a);let u=a-i,f=new ArrayBuffer(u);return Cs(f,0,e,i,u),f}function gr(e,i){let a=e[i];if(a!=null){if(typeof a!="function")throw new TypeError(`${String(i)} is not a function`);return a}}function fu(e){let i={[Symbol.iterator]:()=>e.iterator},a=async function*(){return yield*i}(),u=a.next;return{iterator:a,nextMethod:u,done:!1}}let Mn=(Nn=(Un=Symbol.asyncIterator)!==null&&Un!==void 0?Un:(Fn=Symbol.for)===null||Fn===void 0?void 0:Fn.call(Symbol,"Symbol.asyncIterator"))!==null&&Nn!==void 0?Nn:"@@asyncIterator";function ks(e,i="sync",a){if(a===void 0)if(i==="async"){if(a=gr(e,Mn),a===void 0){let m=gr(e,Symbol.iterator),b=ks(e,"sync",m);return fu(b)}}else a=gr(e,Symbol.iterator);if(a===void 0)throw new TypeError("The object is not iterable");let u=L(a,e,[]);if(!r(u))throw new TypeError("The iterator method must return an object");let f=u.next;return{iterator:u,nextMethod:f,done:!1}}function du(e){let i=L(e.nextMethod,e.iterator,[]);if(!r(i))throw new TypeError("The iterator.next() method must return an object");return i}function hu(e){return!!e.done}function pu(e){return e.value}function mu(e){return!(typeof e!="number"||Ts(e)||e<0)}function Ps(e){let i=xs(e.buffer,e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(i)}function $n(e){let i=e._queue.shift();return e._queueTotalSize-=i.size,e._queueTotalSize<0&&(e._queueTotalSize=0),i.value}function jn(e,i,a){if(!mu(a)||a===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");e._queue.push({value:i,size:a}),e._queueTotalSize+=a}function bu(e){return e._queue.peek().value}function Me(e){e._queue=new W,e._queueTotalSize=0}function As(e){return e===DataView}function _u(e){return As(e.constructor)}function yu(e){return As(e)?1:e.BYTES_PER_ELEMENT}class tt{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!zn(this))throw Qn("view");return this._view}respond(i){if(!zn(this))throw Qn("respond");if(Te(i,1,"respond"),i=In(i,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(Ne(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");Er(this._associatedReadableByteStreamController,i)}respondWithNewView(i){if(!zn(this))throw Qn("respondWithNewView");if(Te(i,1,"respondWithNewView"),!ArrayBuffer.isView(i))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(Ne(i.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");Rr(this._associatedReadableByteStreamController,i)}}Object.defineProperties(tt.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),o(tt.prototype.respond,"respond"),o(tt.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(tt.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class xe{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!rt(this))throw Ft("byobRequest");return Yn(this)}get desiredSize(){if(!rt(this))throw Ft("desiredSize");return Ns(this)}close(){if(!rt(this))throw Ft("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let i=this._controlledReadableByteStream._state;if(i!=="readable")throw new TypeError(`The stream (in ${i} state) is not in the readable state and cannot be closed`);Ut(this)}enqueue(i){if(!rt(this))throw Ft("enqueue");if(Te(i,1,"enqueue"),!ArrayBuffer.isView(i))throw new TypeError("chunk must be an array buffer view");if(i.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(i.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let a=this._controlledReadableByteStream._state;if(a!=="readable")throw new TypeError(`The stream (in ${a} state) is not in the readable state and cannot be enqueued to`);vr(this,i)}error(i=void 0){if(!rt(this))throw Ft("error");se(this,i)}[Ee](i){Os(this),Me(this);let a=this._cancelAlgorithm(i);return wr(this),a}[It](i){let a=this._controlledReadableByteStream;if(this._queueTotalSize>0){Fs(this,i);return}let u=this._autoAllocateChunkSize;if(u!==void 0){let f;try{f=new ArrayBuffer(u)}catch(b){i._errorSteps(b);return}let m={buffer:f,bufferByteLength:u,byteOffset:0,byteLength:u,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(m)}ys(a,i),nt(this)}[Pn](){if(this._pendingPullIntos.length>0){let i=this._pendingPullIntos.peek();i.readerType="none",this._pendingPullIntos=new W,this._pendingPullIntos.push(i)}}}Object.defineProperties(xe.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),o(xe.prototype.close,"close"),o(xe.prototype.enqueue,"enqueue"),o(xe.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(xe.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function rt(e){return!r(e)||!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")?!1:e instanceof xe}function zn(e){return!r(e)||!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")?!1:e instanceof tt}function nt(e){if(!Eu(e))return;if(e._pulling){e._pullAgain=!0;return}e._pulling=!0;let a=e._pullAlgorithm();v(a,()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,nt(e)),null),u=>(se(e,u),null))}function Os(e){Hn(e),e._pendingPullIntos=new W}function Vn(e,i){let a=!1;e._state==="closed"&&(a=!0);let u=Bs(i);i.readerType==="default"?qn(e,u,a):Pu(e,u,a)}function Bs(e){let i=e.bytesFilled,a=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,i/a)}function Sr(e,i,a,u){e._queue.push({buffer:i,byteOffset:a,byteLength:u}),e._queueTotalSize+=u}function Ws(e,i,a,u){let f;try{f=xs(i,a,a+u)}catch(m){throw se(e,m),m}Sr(e,f,0,u)}function Ls(e,i){i.bytesFilled>0&&Ws(e,i.buffer,i.byteOffset,i.bytesFilled),yt(e)}function Is(e,i){let a=Math.min(e._queueTotalSize,i.byteLength-i.bytesFilled),u=i.bytesFilled+a,f=a,m=!1,b=u%i.elementSize,S=u-b;S>=i.minimumFill&&(f=S-i.bytesFilled,m=!0);let C=e._queue;for(;f>0;){let E=C.peek(),x=Math.min(f,E.byteLength),A=i.byteOffset+i.bytesFilled;Cs(i.buffer,A,E.buffer,E.byteOffset,x),E.byteLength===x?C.shift():(E.byteOffset+=x,E.byteLength-=x),e._queueTotalSize-=x,Ds(e,x,i),f-=x}return m}function Ds(e,i,a){a.bytesFilled+=i}function qs(e){e._queueTotalSize===0&&e._closeRequested?(wr(e),Vt(e._controlledReadableByteStream)):nt(e)}function Hn(e){e._byobRequest!==null&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function Gn(e){for(;e._pendingPullIntos.length>0;){if(e._queueTotalSize===0)return;let i=e._pendingPullIntos.peek();Is(e,i)&&(yt(e),Vn(e._controlledReadableByteStream,i))}}function gu(e){let i=e._controlledReadableByteStream._reader;for(;i._readRequests.length>0;){if(e._queueTotalSize===0)return;let a=i._readRequests.shift();Fs(e,a)}}function Su(e,i,a,u){let f=e._controlledReadableByteStream,m=i.constructor,b=yu(m),{byteOffset:S,byteLength:C}=i,E=a*b,x;try{x=Ce(i.buffer)}catch(D){u._errorSteps(D);return}let A={buffer:x,bufferByteLength:x.byteLength,byteOffset:S,byteLength:C,bytesFilled:0,minimumFill:E,elementSize:b,viewConstructor:m,readerType:"byob"};if(e._pendingPullIntos.length>0){e._pendingPullIntos.push(A),js(f,u);return}if(f._state==="closed"){let D=new m(A.buffer,A.byteOffset,0);u._closeSteps(D);return}if(e._queueTotalSize>0){if(Is(e,A)){let D=Bs(A);qs(e),u._chunkSteps(D);return}if(e._closeRequested){let D=new TypeError("Insufficient bytes to fill elements in the given buffer");se(e,D),u._errorSteps(D);return}}e._pendingPullIntos.push(A),js(f,u),nt(e)}function wu(e,i){i.readerType==="none"&&yt(e);let a=e._controlledReadableByteStream;if(Jn(a))for(;zs(a)>0;){let u=yt(e);Vn(a,u)}}function vu(e,i,a){if(Ds(e,i,a),a.readerType==="none"){Ls(e,a),Gn(e);return}if(a.bytesFilled0){let f=a.byteOffset+a.bytesFilled;Ws(e,a.buffer,f-u,u)}a.bytesFilled-=u,Vn(e._controlledReadableByteStream,a),Gn(e)}function Us(e,i){let a=e._pendingPullIntos.peek();Hn(e),e._controlledReadableByteStream._state==="closed"?wu(e,a):vu(e,i,a),nt(e)}function yt(e){return e._pendingPullIntos.shift()}function Eu(e){let i=e._controlledReadableByteStream;return i._state!=="readable"||e._closeRequested||!e._started?!1:!!(gs(i)&&_r(i)>0||Jn(i)&&zs(i)>0||Ns(e)>0)}function wr(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function Ut(e){let i=e._controlledReadableByteStream;if(!(e._closeRequested||i._state!=="readable")){if(e._queueTotalSize>0){e._closeRequested=!0;return}if(e._pendingPullIntos.length>0){let a=e._pendingPullIntos.peek();if(a.bytesFilled%a.elementSize!==0){let u=new TypeError("Insufficient bytes to fill elements in the given buffer");throw se(e,u),u}}wr(e),Vt(i)}}function vr(e,i){let a=e._controlledReadableByteStream;if(e._closeRequested||a._state!=="readable")return;let{buffer:u,byteOffset:f,byteLength:m}=i;if(Ne(u))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let b=Ce(u);if(e._pendingPullIntos.length>0){let S=e._pendingPullIntos.peek();if(Ne(S.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");Hn(e),S.buffer=Ce(S.buffer),S.readerType==="none"&&Ls(e,S)}if(gs(a))if(gu(e),_r(a)===0)Sr(e,b,f,m);else{e._pendingPullIntos.length>0&&yt(e);let S=new Uint8Array(b,f,m);qn(a,S,!1)}else Jn(a)?(Sr(e,b,f,m),Gn(e)):Sr(e,b,f,m);nt(e)}function se(e,i){let a=e._controlledReadableByteStream;a._state==="readable"&&(Os(e),Me(e),wr(e),mo(a,i))}function Fs(e,i){let a=e._queue.shift();e._queueTotalSize-=a.byteLength,qs(e);let u=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);i._chunkSteps(u)}function Yn(e){if(e._byobRequest===null&&e._pendingPullIntos.length>0){let i=e._pendingPullIntos.peek(),a=new Uint8Array(i.buffer,i.byteOffset+i.bytesFilled,i.byteLength-i.bytesFilled),u=Object.create(tt.prototype);Tu(u,e,a),e._byobRequest=u}return e._byobRequest}function Ns(e){let i=e._controlledReadableByteStream._state;return i==="errored"?null:i==="closed"?0:e._strategyHWM-e._queueTotalSize}function Er(e,i){let a=e._pendingPullIntos.peek();if(e._controlledReadableByteStream._state==="closed"){if(i!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(i===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(a.bytesFilled+i>a.byteLength)throw new RangeError("bytesWritten out of range")}a.buffer=Ce(a.buffer),Us(e,i)}function Rr(e,i){let a=e._pendingPullIntos.peek();if(e._controlledReadableByteStream._state==="closed"){if(i.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(i.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(a.byteOffset+a.bytesFilled!==i.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(a.bufferByteLength!==i.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(a.bytesFilled+i.byteLength>a.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let f=i.byteLength;a.buffer=Ce(i.buffer),Us(e,f)}function Ms(e,i,a,u,f,m,b){i._controlledReadableByteStream=e,i._pullAgain=!1,i._pulling=!1,i._byobRequest=null,i._queue=i._queueTotalSize=void 0,Me(i),i._closeRequested=!1,i._started=!1,i._strategyHWM=m,i._pullAlgorithm=u,i._cancelAlgorithm=f,i._autoAllocateChunkSize=b,i._pendingPullIntos=new W,e._readableStreamController=i;let S=a();v(d(S),()=>(i._started=!0,nt(i),null),C=>(se(i,C),null))}function Ru(e,i,a){let u=Object.create(xe.prototype),f,m,b;i.start!==void 0?f=()=>i.start(u):f=()=>{},i.pull!==void 0?m=()=>i.pull(u):m=()=>d(void 0),i.cancel!==void 0?b=C=>i.cancel(C):b=()=>d(void 0);let S=i.autoAllocateChunkSize;if(S===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");Ms(e,u,f,m,b,a,S)}function Tu(e,i,a){e._associatedReadableByteStreamController=i,e._view=a}function Qn(e){return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function Ft(e){return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function Cu(e,i){_e(e,i);let a=e?.mode;return{mode:a===void 0?void 0:xu(a,`${i} has member 'mode' that`)}}function xu(e,i){if(e=`${e}`,e!=="byob")throw new TypeError(`${i} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function ku(e,i){var a;_e(e,i);let u=(a=e?.min)!==null&&a!==void 0?a:1;return{min:In(u,`${i} has member 'min' that`)}}function $s(e){return new $e(e)}function js(e,i){e._reader._readIntoRequests.push(i)}function Pu(e,i,a){let f=e._reader._readIntoRequests.shift();a?f._closeSteps(i):f._chunkSteps(i)}function zs(e){return e._reader._readIntoRequests.length}function Jn(e){let i=e._reader;return!(i===void 0||!it(i))}class $e{constructor(i){if(Te(i,1,"ReadableStreamBYOBReader"),Dn(i,"First parameter"),Ve(i))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!rt(i._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");ds(this,i),this._readIntoRequests=new W}get closed(){return it(this)?this._closedPromise:h(Tr("closed"))}cancel(i=void 0){return it(this)?this._ownerReadableStream===void 0?h(br("cancel")):An(this,i):h(Tr("cancel"))}read(i,a={}){if(!it(this))return h(Tr("read"));if(!ArrayBuffer.isView(i))return h(new TypeError("view must be an array buffer view"));if(i.byteLength===0)return h(new TypeError("view must have non-zero byteLength"));if(i.buffer.byteLength===0)return h(new TypeError("view's buffer must have non-zero byteLength"));if(Ne(i.buffer))return h(new TypeError("view's buffer has been detached"));let u;try{u=ku(a,"options")}catch(E){return h(E)}let f=u.min;if(f===0)return h(new TypeError("options.min must be greater than 0"));if(_u(i)){if(f>i.byteLength)return h(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(f>i.length)return h(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return h(br("read from"));let m,b,S=p((E,x)=>{m=E,b=x});return Vs(this,i,f,{_chunkSteps:E=>m({value:E,done:!1}),_closeSteps:E=>m({value:E,done:!0}),_errorSteps:E=>b(E)}),S}releaseLock(){if(!it(this))throw Tr("releaseLock");this._ownerReadableStream!==void 0&&Au(this)}}Object.defineProperties($e.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),o($e.prototype.cancel,"cancel"),o($e.prototype.read,"read"),o($e.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty($e.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function it(e){return!r(e)||!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")?!1:e instanceof $e}function Vs(e,i,a,u){let f=e._ownerReadableStream;f._disturbed=!0,f._state==="errored"?u._errorSteps(f._storedError):Su(f._readableStreamController,i,a,u)}function Au(e){Re(e);let i=new TypeError("Reader was released");Hs(e,i)}function Hs(e,i){let a=e._readIntoRequests;e._readIntoRequests=new W,a.forEach(u=>{u._errorSteps(i)})}function Tr(e){return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function Nt(e,i){let{highWaterMark:a}=e;if(a===void 0)return i;if(Ts(a)||a<0)throw new RangeError("Invalid highWaterMark");return a}function Cr(e){let{size:i}=e;return i||(()=>1)}function xr(e,i){_e(e,i);let a=e?.highWaterMark,u=e?.size;return{highWaterMark:a===void 0?void 0:Ln(a),size:u===void 0?void 0:Ou(u,`${i} has member 'size' that`)}}function Ou(e,i){return ie(e,i),a=>Ln(e(a))}function Bu(e,i){_e(e,i);let a=e?.abort,u=e?.close,f=e?.start,m=e?.type,b=e?.write;return{abort:a===void 0?void 0:Wu(a,e,`${i} has member 'abort' that`),close:u===void 0?void 0:Lu(u,e,`${i} has member 'close' that`),start:f===void 0?void 0:Iu(f,e,`${i} has member 'start' that`),write:b===void 0?void 0:Du(b,e,`${i} has member 'write' that`),type:m}}function Wu(e,i,a){return ie(e,a),u=>F(e,i,[u])}function Lu(e,i,a){return ie(e,a),()=>F(e,i,[])}function Iu(e,i,a){return ie(e,a),u=>L(e,i,[u])}function Du(e,i,a){return ie(e,a),(u,f)=>F(e,i,[u,f])}function Gs(e,i){if(!gt(e))throw new TypeError(`${i} is not a WritableStream.`)}function qu(e){if(typeof e!="object"||e===null)return!1;try{return typeof e.aborted=="boolean"}catch{return!1}}let Uu=typeof AbortController=="function";function Fu(){if(Uu)return new AbortController}class je{constructor(i={},a={}){i===void 0?i=null:bs(i,"First parameter");let u=xr(a,"Second parameter"),f=Bu(i,"First parameter");if(Qs(this),f.type!==void 0)throw new RangeError("Invalid type is specified");let b=Cr(u),S=Nt(u,1);Zu(this,f,S,b)}get locked(){if(!gt(this))throw Br("locked");return St(this)}abort(i=void 0){return gt(this)?St(this)?h(new TypeError("Cannot abort a stream that already has a writer")):kr(this,i):h(Br("abort"))}close(){return gt(this)?St(this)?h(new TypeError("Cannot close a stream that already has a writer")):ye(this)?h(new TypeError("Cannot close an already-closing stream")):Js(this):h(Br("close"))}getWriter(){if(!gt(this))throw Br("getWriter");return Ys(this)}}Object.defineProperties(je.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),o(je.prototype.abort,"abort"),o(je.prototype.close,"close"),o(je.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(je.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function Ys(e){return new ke(e)}function Nu(e,i,a,u,f=1,m=()=>1){let b=Object.create(je.prototype);Qs(b);let S=Object.create(wt.prototype);return ro(b,S,e,i,a,u,f,m),b}function Qs(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new W,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function gt(e){return!r(e)||!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")?!1:e instanceof je}function St(e){return e._writer!==void 0}function kr(e,i){var a;if(e._state==="closed"||e._state==="errored")return d(void 0);e._writableStreamController._abortReason=i,(a=e._writableStreamController._abortController)===null||a===void 0||a.abort(i);let u=e._state;if(u==="closed"||u==="errored")return d(void 0);if(e._pendingAbortRequest!==void 0)return e._pendingAbortRequest._promise;let f=!1;u==="erroring"&&(f=!0,i=void 0);let m=p((b,S)=>{e._pendingAbortRequest={_promise:void 0,_resolve:b,_reject:S,_reason:i,_wasAlreadyErroring:f}});return e._pendingAbortRequest._promise=m,f||Xn(e,i),m}function Js(e){let i=e._state;if(i==="closed"||i==="errored")return h(new TypeError(`The stream (in ${i} state) is not in the writable state and cannot be closed`));let a=p((f,m)=>{let b={_resolve:f,_reject:m};e._closeRequest=b}),u=e._writer;return u!==void 0&&e._backpressure&&i==="writable"&&oi(u),ec(e._writableStreamController),a}function Mu(e){return p((a,u)=>{let f={_resolve:a,_reject:u};e._writeRequests.push(f)})}function Kn(e,i){if(e._state==="writable"){Xn(e,i);return}Zn(e)}function Xn(e,i){let a=e._writableStreamController;e._state="erroring",e._storedError=i;let u=e._writer;u!==void 0&&Xs(u,i),!Hu(e)&&a._started&&Zn(e)}function Zn(e){e._state="errored",e._writableStreamController[ue]();let i=e._storedError;if(e._writeRequests.forEach(f=>{f._reject(i)}),e._writeRequests=new W,e._pendingAbortRequest===void 0){Pr(e);return}let a=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,a._wasAlreadyErroring){a._reject(i),Pr(e);return}let u=e._writableStreamController[I](a._reason);v(u,()=>(a._resolve(),Pr(e),null),f=>(a._reject(f),Pr(e),null))}function $u(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0}function ju(e,i){e._inFlightWriteRequest._reject(i),e._inFlightWriteRequest=void 0,Kn(e,i)}function zu(e){e._inFlightCloseRequest._resolve(void 0),e._inFlightCloseRequest=void 0,e._state==="erroring"&&(e._storedError=void 0,e._pendingAbortRequest!==void 0&&(e._pendingAbortRequest._resolve(),e._pendingAbortRequest=void 0)),e._state="closed";let a=e._writer;a!==void 0&&oo(a)}function Vu(e,i){e._inFlightCloseRequest._reject(i),e._inFlightCloseRequest=void 0,e._pendingAbortRequest!==void 0&&(e._pendingAbortRequest._reject(i),e._pendingAbortRequest=void 0),Kn(e,i)}function ye(e){return!(e._closeRequest===void 0&&e._inFlightCloseRequest===void 0)}function Hu(e){return!(e._inFlightWriteRequest===void 0&&e._inFlightCloseRequest===void 0)}function Gu(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0}function Yu(e){e._inFlightWriteRequest=e._writeRequests.shift()}function Pr(e){e._closeRequest!==void 0&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);let i=e._writer;i!==void 0&&ii(i,e._storedError)}function ei(e,i){let a=e._writer;a!==void 0&&i!==e._backpressure&&(i?ac(a):oi(a)),e._backpressure=i}class ke{constructor(i){if(Te(i,1,"WritableStreamDefaultWriter"),Gs(i,"First parameter"),St(i))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=i,i._writer=this;let a=i._state;if(a==="writable")!ye(i)&&i._backpressure?Lr(this):ao(this),Wr(this);else if(a==="erroring")si(this,i._storedError),Wr(this);else if(a==="closed")ao(this),sc(this);else{let u=i._storedError;si(this,u),so(this,u)}}get closed(){return st(this)?this._closedPromise:h(ot("closed"))}get desiredSize(){if(!st(this))throw ot("desiredSize");if(this._ownerWritableStream===void 0)throw $t("desiredSize");return Xu(this)}get ready(){return st(this)?this._readyPromise:h(ot("ready"))}abort(i=void 0){return st(this)?this._ownerWritableStream===void 0?h($t("abort")):Qu(this,i):h(ot("abort"))}close(){if(!st(this))return h(ot("close"));let i=this._ownerWritableStream;return i===void 0?h($t("close")):ye(i)?h(new TypeError("Cannot close an already-closing stream")):Ks(this)}releaseLock(){if(!st(this))throw ot("releaseLock");this._ownerWritableStream!==void 0&&Zs(this)}write(i=void 0){return st(this)?this._ownerWritableStream===void 0?h($t("write to")):eo(this,i):h(ot("write"))}}Object.defineProperties(ke.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),o(ke.prototype.abort,"abort"),o(ke.prototype.close,"close"),o(ke.prototype.releaseLock,"releaseLock"),o(ke.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(ke.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function st(e){return!r(e)||!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")?!1:e instanceof ke}function Qu(e,i){let a=e._ownerWritableStream;return kr(a,i)}function Ks(e){let i=e._ownerWritableStream;return Js(i)}function Ju(e){let i=e._ownerWritableStream,a=i._state;return ye(i)||a==="closed"?d(void 0):a==="errored"?h(i._storedError):Ks(e)}function Ku(e,i){e._closedPromiseState==="pending"?ii(e,i):oc(e,i)}function Xs(e,i){e._readyPromiseState==="pending"?lo(e,i):lc(e,i)}function Xu(e){let i=e._ownerWritableStream,a=i._state;return a==="errored"||a==="erroring"?null:a==="closed"?0:no(i._writableStreamController)}function Zs(e){let i=e._ownerWritableStream,a=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Xs(e,a),Ku(e,a),i._writer=void 0,e._ownerWritableStream=void 0}function eo(e,i){let a=e._ownerWritableStream,u=a._writableStreamController,f=tc(u,i);if(a!==e._ownerWritableStream)return h($t("write to"));let m=a._state;if(m==="errored")return h(a._storedError);if(ye(a)||m==="closed")return h(new TypeError("The stream is closing or closed and cannot be written to"));if(m==="erroring")return h(a._storedError);let b=Mu(a);return rc(u,i,f),b}let to={};class wt{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!ti(this))throw ni("abortReason");return this._abortReason}get signal(){if(!ti(this))throw ni("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(i=void 0){if(!ti(this))throw ni("error");this._controlledWritableStream._state==="writable"&&io(this,i)}[I](i){let a=this._abortAlgorithm(i);return Ar(this),a}[ue](){Me(this)}}Object.defineProperties(wt.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(wt.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function ti(e){return!r(e)||!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")?!1:e instanceof wt}function ro(e,i,a,u,f,m,b,S){i._controlledWritableStream=e,e._writableStreamController=i,i._queue=void 0,i._queueTotalSize=void 0,Me(i),i._abortReason=void 0,i._abortController=Fu(),i._started=!1,i._strategySizeAlgorithm=S,i._strategyHWM=b,i._writeAlgorithm=u,i._closeAlgorithm=f,i._abortAlgorithm=m;let C=ri(i);ei(e,C);let E=a(),x=d(E);v(x,()=>(i._started=!0,Or(i),null),A=>(i._started=!0,Kn(e,A),null))}function Zu(e,i,a,u){let f=Object.create(wt.prototype),m,b,S,C;i.start!==void 0?m=()=>i.start(f):m=()=>{},i.write!==void 0?b=E=>i.write(E,f):b=()=>d(void 0),i.close!==void 0?S=()=>i.close():S=()=>d(void 0),i.abort!==void 0?C=E=>i.abort(E):C=()=>d(void 0),ro(e,f,m,b,S,C,a,u)}function Ar(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function ec(e){jn(e,to,0),Or(e)}function tc(e,i){try{return e._strategySizeAlgorithm(i)}catch(a){return Mt(e,a),1}}function no(e){return e._strategyHWM-e._queueTotalSize}function rc(e,i,a){try{jn(e,i,a)}catch(f){Mt(e,f);return}let u=e._controlledWritableStream;if(!ye(u)&&u._state==="writable"){let f=ri(e);ei(u,f)}Or(e)}function Or(e){let i=e._controlledWritableStream;if(!e._started||i._inFlightWriteRequest!==void 0)return;if(i._state==="erroring"){Zn(i);return}if(e._queue.length===0)return;let u=bu(e);u===to?nc(e):ic(e,u)}function Mt(e,i){e._controlledWritableStream._state==="writable"&&io(e,i)}function nc(e){let i=e._controlledWritableStream;Gu(i),$n(e);let a=e._closeAlgorithm();Ar(e),v(a,()=>(zu(i),null),u=>(Vu(i,u),null))}function ic(e,i){let a=e._controlledWritableStream;Yu(a);let u=e._writeAlgorithm(i);v(u,()=>{$u(a);let f=a._state;if($n(e),!ye(a)&&f==="writable"){let m=ri(e);ei(a,m)}return Or(e),null},f=>(a._state==="writable"&&Ar(e),ju(a,f),null))}function ri(e){return no(e)<=0}function io(e,i){let a=e._controlledWritableStream;Ar(e),Xn(a,i)}function Br(e){return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function ni(e){return new TypeError(`WritableStreamDefaultController.prototype.${e} can only be used on a WritableStreamDefaultController`)}function ot(e){return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function $t(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function Wr(e){e._closedPromise=p((i,a)=>{e._closedPromise_resolve=i,e._closedPromise_reject=a,e._closedPromiseState="pending"})}function so(e,i){Wr(e),ii(e,i)}function sc(e){Wr(e),oo(e)}function ii(e,i){e._closedPromise_reject!==void 0&&(T(e._closedPromise),e._closedPromise_reject(i),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function oc(e,i){so(e,i)}function oo(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function Lr(e){e._readyPromise=p((i,a)=>{e._readyPromise_resolve=i,e._readyPromise_reject=a}),e._readyPromiseState="pending"}function si(e,i){Lr(e),lo(e,i)}function ao(e){Lr(e),oi(e)}function lo(e,i){e._readyPromise_reject!==void 0&&(T(e._readyPromise),e._readyPromise_reject(i),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function ac(e){Lr(e)}function lc(e,i){si(e,i)}function oi(e){e._readyPromise_resolve!==void 0&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}function uc(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global}let ai=uc();function cc(e){if(!(typeof e=="function"||typeof e=="object")||e.name!=="DOMException")return!1;try{return new e,!0}catch{return!1}}function fc(){let e=ai?.DOMException;return cc(e)?e:void 0}function dc(){let e=function(a,u){this.message=a||"",this.name=u||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return o(e,"DOMException"),e.prototype=Object.create(Error.prototype),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,configurable:!0}),e}let hc=fc()||dc();function uo(e,i,a,u,f,m){let b=_t(e),S=Ys(i);e._disturbed=!0;let C=!1,E=d(void 0);return p((x,A)=>{let D;if(m!==void 0){if(D=()=>{let R=m.reason!==void 0?m.reason:new hc("Aborted","AbortError"),B=[];u||B.push(()=>i._state==="writable"?kr(i,R):d(void 0)),f||B.push(()=>e._state==="readable"?fe(e,R):d(void 0)),J(()=>Promise.all(B.map(q=>q())),!0,R)},m.aborted){D();return}m.addEventListener("abort",D)}function de(){return p((R,B)=>{function q(Z){Z?R():g(Tt(),q,B)}q(!1)})}function Tt(){return C?d(!0):g(S._readyPromise,()=>p((R,B)=>{Dt(b,{_chunkSteps:q=>{E=g(eo(S,q),void 0,t),R(!1)},_closeSteps:()=>R(!0),_errorSteps:B})}))}if(Ae(e,b._closedPromise,R=>(u?oe(!0,R):J(()=>kr(i,R),!0,R),null)),Ae(i,S._closedPromise,R=>(f?oe(!0,R):J(()=>fe(e,R),!0,R),null)),G(e,b._closedPromise,()=>(a?oe():J(()=>Ju(S)),null)),ye(i)||i._state==="closed"){let R=new TypeError("the destination writable stream closed before all data could be piped to it");f?oe(!0,R):J(()=>fe(e,R),!0,R)}T(de());function Ge(){let R=E;return g(E,()=>R!==E?Ge():void 0)}function Ae(R,B,q){R._state==="errored"?q(R._storedError):y(B,q)}function G(R,B,q){R._state==="closed"?q():P(B,q)}function J(R,B,q){if(C)return;C=!0,i._state==="writable"&&!ye(i)?P(Ge(),Z):Z();function Z(){return v(R(),()=>Oe(B,q),Ct=>Oe(!0,Ct)),null}}function oe(R,B){C||(C=!0,i._state==="writable"&&!ye(i)?P(Ge(),()=>Oe(R,B)):Oe(R,B))}function Oe(R,B){return Zs(S),Re(b),m!==void 0&&m.removeEventListener("abort",D),R?A(B):x(void 0),null}})}class Pe{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Ir(this))throw qr("desiredSize");return li(this)}close(){if(!Ir(this))throw qr("close");if(!Et(this))throw new TypeError("The stream is not in a state that permits close");at(this)}enqueue(i=void 0){if(!Ir(this))throw qr("enqueue");if(!Et(this))throw new TypeError("The stream is not in a state that permits enqueue");return vt(this,i)}error(i=void 0){if(!Ir(this))throw qr("error");ce(this,i)}[Ee](i){Me(this);let a=this._cancelAlgorithm(i);return Dr(this),a}[It](i){let a=this._controlledReadableStream;if(this._queue.length>0){let u=$n(this);this._closeRequested&&this._queue.length===0?(Dr(this),Vt(a)):jt(this),i._chunkSteps(u)}else ys(a,i),jt(this)}[Pn](){}}Object.defineProperties(Pe.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),o(Pe.prototype.close,"close"),o(Pe.prototype.enqueue,"enqueue"),o(Pe.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Pe.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function Ir(e){return!r(e)||!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")?!1:e instanceof Pe}function jt(e){if(!co(e))return;if(e._pulling){e._pullAgain=!0;return}e._pulling=!0;let a=e._pullAlgorithm();v(a,()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,jt(e)),null),u=>(ce(e,u),null))}function co(e){let i=e._controlledReadableStream;return!Et(e)||!e._started?!1:!!(Ve(i)&&_r(i)>0||li(e)>0)}function Dr(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function at(e){if(!Et(e))return;let i=e._controlledReadableStream;e._closeRequested=!0,e._queue.length===0&&(Dr(e),Vt(i))}function vt(e,i){if(!Et(e))return;let a=e._controlledReadableStream;if(Ve(a)&&_r(a)>0)qn(a,i,!1);else{let u;try{u=e._strategySizeAlgorithm(i)}catch(f){throw ce(e,f),f}try{jn(e,i,u)}catch(f){throw ce(e,f),f}}jt(e)}function ce(e,i){let a=e._controlledReadableStream;a._state==="readable"&&(Me(e),Dr(e),mo(a,i))}function li(e){let i=e._controlledReadableStream._state;return i==="errored"?null:i==="closed"?0:e._strategyHWM-e._queueTotalSize}function pc(e){return!co(e)}function Et(e){let i=e._controlledReadableStream._state;return!e._closeRequested&&i==="readable"}function fo(e,i,a,u,f,m,b){i._controlledReadableStream=e,i._queue=void 0,i._queueTotalSize=void 0,Me(i),i._started=!1,i._closeRequested=!1,i._pullAgain=!1,i._pulling=!1,i._strategySizeAlgorithm=b,i._strategyHWM=m,i._pullAlgorithm=u,i._cancelAlgorithm=f,e._readableStreamController=i;let S=a();v(d(S),()=>(i._started=!0,jt(i),null),C=>(ce(i,C),null))}function mc(e,i,a,u){let f=Object.create(Pe.prototype),m,b,S;i.start!==void 0?m=()=>i.start(f):m=()=>{},i.pull!==void 0?b=()=>i.pull(f):b=()=>d(void 0),i.cancel!==void 0?S=C=>i.cancel(C):S=()=>d(void 0),fo(e,f,m,b,S,a,u)}function qr(e){return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function bc(e,i){return rt(e._readableStreamController)?yc(e):_c(e)}function _c(e,i){let a=_t(e),u=!1,f=!1,m=!1,b=!1,S,C,E,x,A,D=p(G=>{A=G});function de(){return u?(f=!0,d(void 0)):(u=!0,Dt(a,{_chunkSteps:J=>{k(()=>{f=!1;let oe=J,Oe=J;m||vt(E._readableStreamController,oe),b||vt(x._readableStreamController,Oe),u=!1,f&&de()})},_closeSteps:()=>{u=!1,m||at(E._readableStreamController),b||at(x._readableStreamController),(!m||!b)&&A(void 0)},_errorSteps:()=>{u=!1}}),d(void 0))}function Tt(G){if(m=!0,S=G,b){let J=qt([S,C]),oe=fe(e,J);A(oe)}return D}function Ge(G){if(b=!0,C=G,m){let J=qt([S,C]),oe=fe(e,J);A(oe)}return D}function Ae(){}return E=zt(Ae,de,Tt),x=zt(Ae,de,Ge),y(a._closedPromise,G=>(ce(E._readableStreamController,G),ce(x._readableStreamController,G),(!m||!b)&&A(void 0),null)),[E,x]}function yc(e){let i=_t(e),a=!1,u=!1,f=!1,m=!1,b=!1,S,C,E,x,A,D=p(R=>{A=R});function de(R){y(R._closedPromise,B=>(R!==i||(se(E._readableStreamController,B),se(x._readableStreamController,B),(!m||!b)&&A(void 0)),null))}function Tt(){it(i)&&(Re(i),i=_t(e),de(i)),Dt(i,{_chunkSteps:B=>{k(()=>{u=!1,f=!1;let q=B,Z=B;if(!m&&!b)try{Z=Ps(B)}catch(Ct){se(E._readableStreamController,Ct),se(x._readableStreamController,Ct),A(fe(e,Ct));return}m||vr(E._readableStreamController,q),b||vr(x._readableStreamController,Z),a=!1,u?Ae():f&&G()})},_closeSteps:()=>{a=!1,m||Ut(E._readableStreamController),b||Ut(x._readableStreamController),E._readableStreamController._pendingPullIntos.length>0&&Er(E._readableStreamController,0),x._readableStreamController._pendingPullIntos.length>0&&Er(x._readableStreamController,0),(!m||!b)&&A(void 0)},_errorSteps:()=>{a=!1}})}function Ge(R,B){Fe(i)&&(Re(i),i=$s(e),de(i));let q=B?x:E,Z=B?E:x;Vs(i,R,1,{_chunkSteps:xt=>{k(()=>{u=!1,f=!1;let kt=B?b:m;if(B?m:b)kt||Rr(q._readableStreamController,xt);else{let ko;try{ko=Ps(xt)}catch(hi){se(q._readableStreamController,hi),se(Z._readableStreamController,hi),A(fe(e,hi));return}kt||Rr(q._readableStreamController,xt),vr(Z._readableStreamController,ko)}a=!1,u?Ae():f&&G()})},_closeSteps:xt=>{a=!1;let kt=B?b:m,Vr=B?m:b;kt||Ut(q._readableStreamController),Vr||Ut(Z._readableStreamController),xt!==void 0&&(kt||Rr(q._readableStreamController,xt),!Vr&&Z._readableStreamController._pendingPullIntos.length>0&&Er(Z._readableStreamController,0)),(!kt||!Vr)&&A(void 0)},_errorSteps:()=>{a=!1}})}function Ae(){if(a)return u=!0,d(void 0);a=!0;let R=Yn(E._readableStreamController);return R===null?Tt():Ge(R._view,!1),d(void 0)}function G(){if(a)return f=!0,d(void 0);a=!0;let R=Yn(x._readableStreamController);return R===null?Tt():Ge(R._view,!0),d(void 0)}function J(R){if(m=!0,S=R,b){let B=qt([S,C]),q=fe(e,B);A(q)}return D}function oe(R){if(b=!0,C=R,m){let B=qt([S,C]),q=fe(e,B);A(q)}return D}function Oe(){}return E=po(Oe,Ae,J),x=po(Oe,G,oe),de(i),[E,x]}function gc(e){return r(e)&&typeof e.getReader<"u"}function Sc(e){return gc(e)?vc(e.getReader()):wc(e)}function wc(e){let i,a=ks(e,"async"),u=t;function f(){let b;try{b=du(a)}catch(C){return h(C)}let S=d(b);return w(S,C=>{if(!r(C))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(hu(C))at(i._readableStreamController);else{let x=pu(C);vt(i._readableStreamController,x)}})}function m(b){let S=a.iterator,C;try{C=gr(S,"return")}catch(A){return h(A)}if(C===void 0)return d(void 0);let E;try{E=L(C,S,[b])}catch(A){return h(A)}let x=d(E);return w(x,A=>{if(!r(A))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return i=zt(u,f,m,0),i}function vc(e){let i,a=t;function u(){let m;try{m=e.read()}catch(b){return h(b)}return w(m,b=>{if(!r(b))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(b.done)at(i._readableStreamController);else{let S=b.value;vt(i._readableStreamController,S)}})}function f(m){try{return d(e.cancel(m))}catch(b){return h(b)}}return i=zt(a,u,f,0),i}function Ec(e,i){_e(e,i);let a=e,u=a?.autoAllocateChunkSize,f=a?.cancel,m=a?.pull,b=a?.start,S=a?.type;return{autoAllocateChunkSize:u===void 0?void 0:In(u,`${i} has member 'autoAllocateChunkSize' that`),cancel:f===void 0?void 0:Rc(f,a,`${i} has member 'cancel' that`),pull:m===void 0?void 0:Tc(m,a,`${i} has member 'pull' that`),start:b===void 0?void 0:Cc(b,a,`${i} has member 'start' that`),type:S===void 0?void 0:xc(S,`${i} has member 'type' that`)}}function Rc(e,i,a){return ie(e,a),u=>F(e,i,[u])}function Tc(e,i,a){return ie(e,a),u=>F(e,i,[u])}function Cc(e,i,a){return ie(e,a),u=>L(e,i,[u])}function xc(e,i){if(e=`${e}`,e!=="bytes")throw new TypeError(`${i} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function kc(e,i){return _e(e,i),{preventCancel:!!e?.preventCancel}}function ho(e,i){_e(e,i);let a=e?.preventAbort,u=e?.preventCancel,f=e?.preventClose,m=e?.signal;return m!==void 0&&Pc(m,`${i} has member 'signal' that`),{preventAbort:!!a,preventCancel:!!u,preventClose:!!f,signal:m}}function Pc(e,i){if(!qu(e))throw new TypeError(`${i} is not an AbortSignal.`)}function Ac(e,i){_e(e,i);let a=e?.readable;Wn(a,"readable","ReadableWritablePair"),Dn(a,`${i} has member 'readable' that`);let u=e?.writable;return Wn(u,"writable","ReadableWritablePair"),Gs(u,`${i} has member 'writable' that`),{readable:a,writable:u}}class z{constructor(i={},a={}){i===void 0?i=null:bs(i,"First parameter");let u=xr(a,"Second parameter"),f=Ec(i,"First parameter");if(ui(this),f.type==="bytes"){if(u.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let m=Nt(u,0);Ru(this,f,m)}else{let m=Cr(u),b=Nt(u,1);mc(this,f,b,m)}}get locked(){if(!ze(this))throw lt("locked");return Ve(this)}cancel(i=void 0){return ze(this)?Ve(this)?h(new TypeError("Cannot cancel a stream that already has a reader")):fe(this,i):h(lt("cancel"))}getReader(i=void 0){if(!ze(this))throw lt("getReader");return Cu(i,"First parameter").mode===void 0?_t(this):$s(this)}pipeThrough(i,a={}){if(!ze(this))throw lt("pipeThrough");Te(i,1,"pipeThrough");let u=Ac(i,"First parameter"),f=ho(a,"Second parameter");if(Ve(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(St(u.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let m=uo(this,u.writable,f.preventClose,f.preventAbort,f.preventCancel,f.signal);return T(m),u.readable}pipeTo(i,a={}){if(!ze(this))return h(lt("pipeTo"));if(i===void 0)return h("Parameter 1 is required in 'pipeTo'.");if(!gt(i))return h(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let u;try{u=ho(a,"Second parameter")}catch(f){return h(f)}return Ve(this)?h(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):St(i)?h(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):uo(this,i,u.preventClose,u.preventAbort,u.preventCancel,u.signal)}tee(){if(!ze(this))throw lt("tee");let i=bc(this);return qt(i)}values(i=void 0){if(!ze(this))throw lt("values");let a=kc(i,"First parameter");return cu(this,a.preventCancel)}[Mn](i){return this.values(i)}static from(i){return Sc(i)}}Object.defineProperties(z,{from:{enumerable:!0}}),Object.defineProperties(z.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),o(z.from,"from"),o(z.prototype.cancel,"cancel"),o(z.prototype.getReader,"getReader"),o(z.prototype.pipeThrough,"pipeThrough"),o(z.prototype.pipeTo,"pipeTo"),o(z.prototype.tee,"tee"),o(z.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(z.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(z.prototype,Mn,{value:z.prototype.values,writable:!0,configurable:!0});function zt(e,i,a,u=1,f=()=>1){let m=Object.create(z.prototype);ui(m);let b=Object.create(Pe.prototype);return fo(m,b,e,i,a,u,f),m}function po(e,i,a){let u=Object.create(z.prototype);ui(u);let f=Object.create(xe.prototype);return Ms(u,f,e,i,a,0,void 0),u}function ui(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function ze(e){return!r(e)||!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")?!1:e instanceof z}function Ve(e){return e._reader!==void 0}function fe(e,i){if(e._disturbed=!0,e._state==="closed")return d(void 0);if(e._state==="errored")return h(e._storedError);Vt(e);let a=e._reader;if(a!==void 0&&it(a)){let f=a._readIntoRequests;a._readIntoRequests=new W,f.forEach(m=>{m._closeSteps(void 0)})}let u=e._readableStreamController[Ee](i);return w(u,t)}function Vt(e){e._state="closed";let i=e._reader;if(i!==void 0&&(ps(i),Fe(i))){let a=i._readRequests;i._readRequests=new W,a.forEach(u=>{u._closeSteps()})}}function mo(e,i){e._state="errored",e._storedError=i;let a=e._reader;a!==void 0&&(Bn(a,i),Fe(a)?Ss(a,i):Hs(a,i))}function lt(e){return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function bo(e,i){_e(e,i);let a=e?.highWaterMark;return Wn(a,"highWaterMark","QueuingStrategyInit"),{highWaterMark:Ln(a)}}let _o=e=>e.byteLength;o(_o,"size");class Ur{constructor(i){Te(i,1,"ByteLengthQueuingStrategy"),i=bo(i,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=i.highWaterMark}get highWaterMark(){if(!go(this))throw yo("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!go(this))throw yo("size");return _o}}Object.defineProperties(Ur.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ur.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function yo(e){return new TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`)}function go(e){return!r(e)||!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")?!1:e instanceof Ur}let So=()=>1;o(So,"size");class Fr{constructor(i){Te(i,1,"CountQueuingStrategy"),i=bo(i,"First parameter"),this._countQueuingStrategyHighWaterMark=i.highWaterMark}get highWaterMark(){if(!vo(this))throw wo("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!vo(this))throw wo("size");return So}}Object.defineProperties(Fr.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Fr.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function wo(e){return new TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`)}function vo(e){return!r(e)||!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")?!1:e instanceof Fr}function Oc(e,i){_e(e,i);let a=e?.cancel,u=e?.flush,f=e?.readableType,m=e?.start,b=e?.transform,S=e?.writableType;return{cancel:a===void 0?void 0:Ic(a,e,`${i} has member 'cancel' that`),flush:u===void 0?void 0:Bc(u,e,`${i} has member 'flush' that`),readableType:f,start:m===void 0?void 0:Wc(m,e,`${i} has member 'start' that`),transform:b===void 0?void 0:Lc(b,e,`${i} has member 'transform' that`),writableType:S}}function Bc(e,i,a){return ie(e,a),u=>F(e,i,[u])}function Wc(e,i,a){return ie(e,a),u=>L(e,i,[u])}function Lc(e,i,a){return ie(e,a),(u,f)=>F(e,i,[u,f])}function Ic(e,i,a){return ie(e,a),u=>F(e,i,[u])}class Nr{constructor(i={},a={},u={}){i===void 0&&(i=null);let f=xr(a,"Second parameter"),m=xr(u,"Third parameter"),b=Oc(i,"First parameter");if(b.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(b.writableType!==void 0)throw new RangeError("Invalid writableType specified");let S=Nt(m,0),C=Cr(m),E=Nt(f,1),x=Cr(f),A,D=p(de=>{A=de});Dc(this,D,E,x,S,C),Uc(this,b),b.start!==void 0?A(b.start(this._transformStreamController)):A(void 0)}get readable(){if(!Eo(this))throw xo("readable");return this._readable}get writable(){if(!Eo(this))throw xo("writable");return this._writable}}Object.defineProperties(Nr.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Nr.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function Dc(e,i,a,u,f,m){function b(){return i}function S(D){return Mc(e,D)}function C(D){return $c(e,D)}function E(){return jc(e)}e._writable=Nu(b,S,E,C,a,u);function x(){return zc(e)}function A(D){return Vc(e,D)}e._readable=zt(b,x,A,f,m),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,Mr(e,!0),e._transformStreamController=void 0}function Eo(e){return!r(e)||!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")?!1:e instanceof Nr}function Ro(e,i){ce(e._readable._readableStreamController,i),ci(e,i)}function ci(e,i){jr(e._transformStreamController),Mt(e._writable._writableStreamController,i),fi(e)}function fi(e){e._backpressure&&Mr(e,!1)}function Mr(e,i){e._backpressureChangePromise!==void 0&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=p(a=>{e._backpressureChangePromise_resolve=a}),e._backpressure=i}class He{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!$r(this))throw zr("desiredSize");let i=this._controlledTransformStream._readable._readableStreamController;return li(i)}enqueue(i=void 0){if(!$r(this))throw zr("enqueue");To(this,i)}error(i=void 0){if(!$r(this))throw zr("error");Fc(this,i)}terminate(){if(!$r(this))throw zr("terminate");Nc(this)}}Object.defineProperties(He.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),o(He.prototype.enqueue,"enqueue"),o(He.prototype.error,"error"),o(He.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(He.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function $r(e){return!r(e)||!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")?!1:e instanceof He}function qc(e,i,a,u,f){i._controlledTransformStream=e,e._transformStreamController=i,i._transformAlgorithm=a,i._flushAlgorithm=u,i._cancelAlgorithm=f,i._finishPromise=void 0,i._finishPromise_resolve=void 0,i._finishPromise_reject=void 0}function Uc(e,i){let a=Object.create(He.prototype),u,f,m;i.transform!==void 0?u=b=>i.transform(b,a):u=b=>{try{return To(a,b),d(void 0)}catch(S){return h(S)}},i.flush!==void 0?f=()=>i.flush(a):f=()=>d(void 0),i.cancel!==void 0?m=b=>i.cancel(b):m=()=>d(void 0),qc(e,a,u,f,m)}function jr(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0,e._cancelAlgorithm=void 0}function To(e,i){let a=e._controlledTransformStream,u=a._readable._readableStreamController;if(!Et(u))throw new TypeError("Readable side is not in a state that permits enqueue");try{vt(u,i)}catch(m){throw ci(a,m),a._readable._storedError}pc(u)!==a._backpressure&&Mr(a,!0)}function Fc(e,i){Ro(e._controlledTransformStream,i)}function Co(e,i){let a=e._transformAlgorithm(i);return w(a,void 0,u=>{throw Ro(e._controlledTransformStream,u),u})}function Nc(e){let i=e._controlledTransformStream,a=i._readable._readableStreamController;at(a);let u=new TypeError("TransformStream terminated");ci(i,u)}function Mc(e,i){let a=e._transformStreamController;if(e._backpressure){let u=e._backpressureChangePromise;return w(u,()=>{let f=e._writable;if(f._state==="erroring")throw f._storedError;return Co(a,i)})}return Co(a,i)}function $c(e,i){let a=e._transformStreamController;if(a._finishPromise!==void 0)return a._finishPromise;let u=e._readable;a._finishPromise=p((m,b)=>{a._finishPromise_resolve=m,a._finishPromise_reject=b});let f=a._cancelAlgorithm(i);return jr(a),v(f,()=>(u._state==="errored"?Rt(a,u._storedError):(ce(u._readableStreamController,i),di(a)),null),m=>(ce(u._readableStreamController,m),Rt(a,m),null)),a._finishPromise}function jc(e){let i=e._transformStreamController;if(i._finishPromise!==void 0)return i._finishPromise;let a=e._readable;i._finishPromise=p((f,m)=>{i._finishPromise_resolve=f,i._finishPromise_reject=m});let u=i._flushAlgorithm();return jr(i),v(u,()=>(a._state==="errored"?Rt(i,a._storedError):(at(a._readableStreamController),di(i)),null),f=>(ce(a._readableStreamController,f),Rt(i,f),null)),i._finishPromise}function zc(e){return Mr(e,!1),e._backpressureChangePromise}function Vc(e,i){let a=e._transformStreamController;if(a._finishPromise!==void 0)return a._finishPromise;let u=e._writable;a._finishPromise=p((m,b)=>{a._finishPromise_resolve=m,a._finishPromise_reject=b});let f=a._cancelAlgorithm(i);return jr(a),v(f,()=>(u._state==="errored"?Rt(a,u._storedError):(Mt(u._writableStreamController,i),fi(e),di(a)),null),m=>(Mt(u._writableStreamController,m),fi(e),Rt(a,m),null)),a._finishPromise}function zr(e){return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function di(e){e._finishPromise_resolve!==void 0&&(e._finishPromise_resolve(),e._finishPromise_resolve=void 0,e._finishPromise_reject=void 0)}function Rt(e,i){e._finishPromise_reject!==void 0&&(T(e._finishPromise),e._finishPromise_reject(i),e._finishPromise_resolve=void 0,e._finishPromise_reject=void 0)}function xo(e){return new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}n.ByteLengthQueuingStrategy=Ur,n.CountQueuingStrategy=Fr,n.ReadableByteStreamController=xe,n.ReadableStream=z,n.ReadableStreamBYOBReader=$e,n.ReadableStreamBYOBRequest=tt,n.ReadableStreamDefaultController=Pe,n.ReadableStreamDefaultReader=Ue,n.TransformStream=Nr,n.TransformStreamDefaultController=He,n.WritableStream=je,n.WritableStreamDefaultController=wt,n.WritableStreamDefaultWriter=ke})});var dl=N(()=>{if(!globalThis.ReadableStream)try{let n=require("node:process"),{emitWarning:t}=n;try{n.emitWarning=()=>{},Object.assign(globalThis,require("node:stream/web")),n.emitWarning=t}catch(r){throw n.emitWarning=t,r}}catch{Object.assign(globalThis,fl())}try{let{Blob:n}=require("buffer");n&&!n.prototype.stream&&(n.prototype.stream=function(r){let s=0,o=this;return new ReadableStream({type:"bytes",async pull(l){let _=await o.slice(s,Math.min(o.size,s+65536)).arrayBuffer();s+=_.byteLength,l.enqueue(new Uint8Array(_)),s===o.size&&l.close()}})})}catch{}});async function*Ji(n,t=!0){for(let r of n)if("stream"in r)yield*r.stream();else if(ArrayBuffer.isView(r))if(t){let s=r.byteOffset,o=r.byteOffset+r.byteLength;for(;s!==o;){let l=Math.min(o-s,hl),c=r.buffer.slice(s,s+l);s+=c.byteLength,yield new Uint8Array(c)}}else yield r;else{let s=0,o=r;for(;s!==o.size;){let c=await o.slice(s,Math.min(o.size,s+hl)).arrayBuffer();s+=c.byteLength,yield new Uint8Array(c)}}}var tp,hl,pl,Cd,me,ar=$(()=>{tp=V(dl(),1);hl=65536;pl=class Ki{#e=[];#t="";#r=0;#n="transparent";constructor(t=[],r={}){if(typeof t!="object"||t===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(typeof t[Symbol.iterator]!="function")throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof r!="object"&&typeof r!="function")throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");r===null&&(r={});let s=new TextEncoder;for(let l of t){let c;ArrayBuffer.isView(l)?c=new Uint8Array(l.buffer.slice(l.byteOffset,l.byteOffset+l.byteLength)):l instanceof ArrayBuffer?c=new Uint8Array(l.slice(0)):l instanceof Ki?c=l:c=s.encode(`${l}`),this.#r+=ArrayBuffer.isView(c)?c.byteLength:c.size,this.#e.push(c)}this.#n=`${r.endings===void 0?"transparent":r.endings}`;let o=r.type===void 0?"":String(r.type);this.#t=/^[\x20-\x7E]*$/.test(o)?o:""}get size(){return this.#r}get type(){return this.#t}async text(){let t=new TextDecoder,r="";for await(let s of Ji(this.#e,!1))r+=t.decode(s,{stream:!0});return r+=t.decode(),r}async arrayBuffer(){let t=new Uint8Array(this.size),r=0;for await(let s of Ji(this.#e,!1))t.set(s,r),r+=s.length;return t.buffer}stream(){let t=Ji(this.#e,!0);return new globalThis.ReadableStream({type:"bytes",async pull(r){let s=await t.next();s.done?r.close():r.enqueue(s.value)},async cancel(){await t.return()}})}slice(t=0,r=this.size,s=""){let{size:o}=this,l=t<0?Math.max(o+t,0):Math.min(t,o),c=r<0?Math.max(o+r,0):Math.min(r,o),_=Math.max(c-l,0),p=this.#e,d=[],h=0;for(let v of p){if(h>=_)break;let P=ArrayBuffer.isView(v)?v.byteLength:v.size;if(l&&P<=l)l-=P,c-=P;else{let y;ArrayBuffer.isView(v)?(y=v.subarray(l,Math.min(P,c)),h+=y.byteLength):(y=v.slice(l,Math.min(P,c)),h+=y.size),c-=P,d.push(y),l=0}}let g=new Ki([],{type:String(s).toLowerCase()});return g.#r=_,g.#e=d,g}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](t){return t&&typeof t=="object"&&typeof t.constructor=="function"&&(typeof t.stream=="function"||typeof t.arrayBuffer=="function")&&/^(Blob|File)$/.test(t[Symbol.toStringTag])}};Object.defineProperties(pl.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});Cd=pl,me=Cd});var xd,kd,Ke,Xi=$(()=>{ar();xd=class extends me{#e=0;#t="";constructor(t,r,s={}){if(arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);super(t,s),s===null&&(s={});let o=s.lastModified===void 0?Date.now():Number(s.lastModified);Number.isNaN(o)||(this.#e=o),this.#t=String(r)}get name(){return this.#t}get lastModified(){return this.#e}get[Symbol.toStringTag](){return"File"}static[Symbol.hasInstance](t){return!!t&&t instanceof me&&/^(File)$/.test(t[Symbol.toStringTag])}},kd=xd,Ke=kd});function _l(n,t=me){var r=`${ml()}${ml()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),s=[],o=`--${r}\r +`+r)}function dt(n,t,r,s,o){if(n.listenerCount("wsClientError")){let l=new Error(o);Error.captureStackTrace(l,dt),n.emit("wsClientError",l,r,t)}else rr(r,s,o)}});function Td(n){if(!/^data:/i.test(n))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');n=n.replace(/\r?\n/g,"");let t=n.indexOf(",");if(t===-1||t<=4)throw new TypeError("malformed data: URI");let r=n.substring(5,t).split(";"),s="",o=!1,l=r[0]||"text/plain",c=l;for(let h=1;h{ll=Td});var fl=N((bn,cl)=>{(function(n,t){typeof bn=="object"&&typeof cl<"u"?t(bn):typeof define=="function"&&define.amd?define(["exports"],t):(n=typeof globalThis<"u"?globalThis:n||self,t(n.WebStreamsPolyfill={}))})(bn,function(n){"use strict";function t(){}function r(e){return typeof e=="object"&&e!==null||typeof e=="function"}let s=t;function o(e,i){try{Object.defineProperty(e,"name",{value:i,configurable:!0})}catch{}}let l=Promise,c=Promise.prototype.then,_=Promise.reject.bind(l);function p(e){return new l(e)}function d(e){return p(i=>i(e))}function h(e){return _(e)}function g(e,i,a){return c.call(e,i,a)}function v(e,i,a){g(g(e,i,a),void 0,s)}function P(e,i){v(e,i)}function y(e,i){v(e,void 0,i)}function w(e,i,a){return g(e,i,a)}function T(e){g(e,void 0,s)}let k=e=>{if(typeof queueMicrotask=="function")k=queueMicrotask;else{let i=d(void 0);k=a=>g(i,a)}return k(e)};function L(e,i,a){if(typeof e!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,i,a)}function F(e,i,a){try{return d(L(e,i,a))}catch(u){return h(u)}}let O=16384;class W{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(i){let a=this._back,u=a;a._elements.length===O-1&&(u={_elements:[],_next:void 0}),a._elements.push(i),u!==a&&(this._back=u,a._next=u),++this._size}shift(){let i=this._front,a=i,u=this._cursor,f=u+1,m=i._elements,b=m[u];return f===O&&(a=i._next,f=0),--this._size,this._cursor=f,i!==a&&(this._front=a),m[u]=void 0,b}forEach(i){let a=this._cursor,u=this._front,f=u._elements;for(;(a!==f.length||u._next!==void 0)&&!(a===f.length&&(u=u._next,f=u._elements,a=0,f.length===0));)i(f[a]),++a}peek(){let i=this._front,a=this._cursor;return i._elements[a]}}let I=Symbol("[[AbortSteps]]"),ue=Symbol("[[ErrorSteps]]"),Ee=Symbol("[[CancelSteps]]"),It=Symbol("[[PullSteps]]"),Pn=Symbol("[[ReleaseSteps]]");function ds(e,i){e._ownerReadableStream=i,i._reader=e,i._state==="readable"?On(e):i._state==="closed"?ru(e):hs(e,i._storedError)}function An(e,i){let a=e._ownerReadableStream;return fe(a,i)}function Re(e){let i=e._ownerReadableStream;i._state==="readable"?Bn(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):nu(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),i._readableStreamController[Pn](),i._reader=void 0,e._ownerReadableStream=void 0}function br(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function On(e){e._closedPromise=p((i,a)=>{e._closedPromise_resolve=i,e._closedPromise_reject=a})}function hs(e,i){On(e),Bn(e,i)}function ru(e){On(e),ps(e)}function Bn(e,i){e._closedPromise_reject!==void 0&&(T(e._closedPromise),e._closedPromise_reject(i),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function nu(e,i){hs(e,i)}function ps(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}let ms=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},iu=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function su(e){return typeof e=="object"||typeof e=="function"}function _e(e,i){if(e!==void 0&&!su(e))throw new TypeError(`${i} is not an object.`)}function ie(e,i){if(typeof e!="function")throw new TypeError(`${i} is not a function.`)}function ou(e){return typeof e=="object"&&e!==null||typeof e=="function"}function bs(e,i){if(!ou(e))throw new TypeError(`${i} is not an object.`)}function Te(e,i,a){if(e===void 0)throw new TypeError(`Parameter ${i} is required in '${a}'.`)}function Wn(e,i,a){if(e===void 0)throw new TypeError(`${i} is required in '${a}'.`)}function Ln(e){return Number(e)}function _s(e){return e===0?0:e}function au(e){return _s(iu(e))}function In(e,i){let u=Number.MAX_SAFE_INTEGER,f=Number(e);if(f=_s(f),!ms(f))throw new TypeError(`${i} is not a finite number`);if(f=au(f),f<0||f>u)throw new TypeError(`${i} is outside the accepted range of 0 to ${u}, inclusive`);return!ms(f)||f===0?0:f}function Dn(e,i){if(!ze(e))throw new TypeError(`${i} is not a ReadableStream.`)}function _t(e){return new Ue(e)}function ys(e,i){e._reader._readRequests.push(i)}function qn(e,i,a){let f=e._reader._readRequests.shift();a?f._closeSteps():f._chunkSteps(i)}function _r(e){return e._reader._readRequests.length}function gs(e){let i=e._reader;return!(i===void 0||!Fe(i))}class Ue{constructor(i){if(Te(i,1,"ReadableStreamDefaultReader"),Dn(i,"First parameter"),Ve(i))throw new TypeError("This stream has already been locked for exclusive reading by another reader");ds(this,i),this._readRequests=new W}get closed(){return Fe(this)?this._closedPromise:h(yr("closed"))}cancel(i=void 0){return Fe(this)?this._ownerReadableStream===void 0?h(br("cancel")):An(this,i):h(yr("cancel"))}read(){if(!Fe(this))return h(yr("read"));if(this._ownerReadableStream===void 0)return h(br("read from"));let i,a,u=p((m,b)=>{i=m,a=b});return Dt(this,{_chunkSteps:m=>i({value:m,done:!1}),_closeSteps:()=>i({value:void 0,done:!0}),_errorSteps:m=>a(m)}),u}releaseLock(){if(!Fe(this))throw yr("releaseLock");this._ownerReadableStream!==void 0&&lu(this)}}Object.defineProperties(Ue.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),o(Ue.prototype.cancel,"cancel"),o(Ue.prototype.read,"read"),o(Ue.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ue.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function Fe(e){return!r(e)||!Object.prototype.hasOwnProperty.call(e,"_readRequests")?!1:e instanceof Ue}function Dt(e,i){let a=e._ownerReadableStream;a._disturbed=!0,a._state==="closed"?i._closeSteps():a._state==="errored"?i._errorSteps(a._storedError):a._readableStreamController[It](i)}function lu(e){Re(e);let i=new TypeError("Reader was released");Ss(e,i)}function Ss(e,i){let a=e._readRequests;e._readRequests=new W,a.forEach(u=>{u._errorSteps(i)})}function yr(e){return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}let uu=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class ws{constructor(i,a){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=i,this._preventCancel=a}next(){let i=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?w(this._ongoingPromise,i,i):i(),this._ongoingPromise}return(i){let a=()=>this._returnSteps(i);return this._ongoingPromise?w(this._ongoingPromise,a,a):a()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let i=this._reader,a,u,f=p((b,S)=>{a=b,u=S});return Dt(i,{_chunkSteps:b=>{this._ongoingPromise=void 0,k(()=>a({value:b,done:!1}))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,Re(i),a({value:void 0,done:!0})},_errorSteps:b=>{this._ongoingPromise=void 0,this._isFinished=!0,Re(i),u(b)}}),f}_returnSteps(i){if(this._isFinished)return Promise.resolve({value:i,done:!0});this._isFinished=!0;let a=this._reader;if(!this._preventCancel){let u=An(a,i);return Re(a),w(u,()=>({value:i,done:!0}))}return Re(a),d({value:i,done:!0})}}let vs={next(){return Es(this)?this._asyncIteratorImpl.next():h(Rs("next"))},return(e){return Es(this)?this._asyncIteratorImpl.return(e):h(Rs("return"))}};Object.setPrototypeOf(vs,uu);function cu(e,i){let a=_t(e),u=new ws(a,i),f=Object.create(vs);return f._asyncIteratorImpl=u,f}function Es(e){if(!r(e)||!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl"))return!1;try{return e._asyncIteratorImpl instanceof ws}catch{return!1}}function Rs(e){return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}let Ts=Number.isNaN||function(e){return e!==e};var Un,Fn,Nn;function qt(e){return e.slice()}function Cs(e,i,a,u,f){new Uint8Array(e).set(new Uint8Array(a,u,f),i)}let Ce=e=>(typeof e.transfer=="function"?Ce=i=>i.transfer():typeof structuredClone=="function"?Ce=i=>structuredClone(i,{transfer:[i]}):Ce=i=>i,Ce(e)),Ne=e=>(typeof e.detached=="boolean"?Ne=i=>i.detached:Ne=i=>i.byteLength===0,Ne(e));function xs(e,i,a){if(e.slice)return e.slice(i,a);let u=a-i,f=new ArrayBuffer(u);return Cs(f,0,e,i,u),f}function gr(e,i){let a=e[i];if(a!=null){if(typeof a!="function")throw new TypeError(`${String(i)} is not a function`);return a}}function fu(e){let i={[Symbol.iterator]:()=>e.iterator},a=async function*(){return yield*i}(),u=a.next;return{iterator:a,nextMethod:u,done:!1}}let Mn=(Nn=(Un=Symbol.asyncIterator)!==null&&Un!==void 0?Un:(Fn=Symbol.for)===null||Fn===void 0?void 0:Fn.call(Symbol,"Symbol.asyncIterator"))!==null&&Nn!==void 0?Nn:"@@asyncIterator";function ks(e,i="sync",a){if(a===void 0)if(i==="async"){if(a=gr(e,Mn),a===void 0){let m=gr(e,Symbol.iterator),b=ks(e,"sync",m);return fu(b)}}else a=gr(e,Symbol.iterator);if(a===void 0)throw new TypeError("The object is not iterable");let u=L(a,e,[]);if(!r(u))throw new TypeError("The iterator method must return an object");let f=u.next;return{iterator:u,nextMethod:f,done:!1}}function du(e){let i=L(e.nextMethod,e.iterator,[]);if(!r(i))throw new TypeError("The iterator.next() method must return an object");return i}function hu(e){return!!e.done}function pu(e){return e.value}function mu(e){return!(typeof e!="number"||Ts(e)||e<0)}function Ps(e){let i=xs(e.buffer,e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(i)}function $n(e){let i=e._queue.shift();return e._queueTotalSize-=i.size,e._queueTotalSize<0&&(e._queueTotalSize=0),i.value}function jn(e,i,a){if(!mu(a)||a===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");e._queue.push({value:i,size:a}),e._queueTotalSize+=a}function bu(e){return e._queue.peek().value}function Me(e){e._queue=new W,e._queueTotalSize=0}function As(e){return e===DataView}function _u(e){return As(e.constructor)}function yu(e){return As(e)?1:e.BYTES_PER_ELEMENT}class tt{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!zn(this))throw Qn("view");return this._view}respond(i){if(!zn(this))throw Qn("respond");if(Te(i,1,"respond"),i=In(i,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(Ne(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");Er(this._associatedReadableByteStreamController,i)}respondWithNewView(i){if(!zn(this))throw Qn("respondWithNewView");if(Te(i,1,"respondWithNewView"),!ArrayBuffer.isView(i))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(Ne(i.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");Rr(this._associatedReadableByteStreamController,i)}}Object.defineProperties(tt.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),o(tt.prototype.respond,"respond"),o(tt.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(tt.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class xe{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!rt(this))throw Ft("byobRequest");return Yn(this)}get desiredSize(){if(!rt(this))throw Ft("desiredSize");return Ns(this)}close(){if(!rt(this))throw Ft("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let i=this._controlledReadableByteStream._state;if(i!=="readable")throw new TypeError(`The stream (in ${i} state) is not in the readable state and cannot be closed`);Ut(this)}enqueue(i){if(!rt(this))throw Ft("enqueue");if(Te(i,1,"enqueue"),!ArrayBuffer.isView(i))throw new TypeError("chunk must be an array buffer view");if(i.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(i.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let a=this._controlledReadableByteStream._state;if(a!=="readable")throw new TypeError(`The stream (in ${a} state) is not in the readable state and cannot be enqueued to`);vr(this,i)}error(i=void 0){if(!rt(this))throw Ft("error");se(this,i)}[Ee](i){Os(this),Me(this);let a=this._cancelAlgorithm(i);return wr(this),a}[It](i){let a=this._controlledReadableByteStream;if(this._queueTotalSize>0){Fs(this,i);return}let u=this._autoAllocateChunkSize;if(u!==void 0){let f;try{f=new ArrayBuffer(u)}catch(b){i._errorSteps(b);return}let m={buffer:f,bufferByteLength:u,byteOffset:0,byteLength:u,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(m)}ys(a,i),nt(this)}[Pn](){if(this._pendingPullIntos.length>0){let i=this._pendingPullIntos.peek();i.readerType="none",this._pendingPullIntos=new W,this._pendingPullIntos.push(i)}}}Object.defineProperties(xe.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),o(xe.prototype.close,"close"),o(xe.prototype.enqueue,"enqueue"),o(xe.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(xe.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function rt(e){return!r(e)||!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")?!1:e instanceof xe}function zn(e){return!r(e)||!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")?!1:e instanceof tt}function nt(e){if(!Eu(e))return;if(e._pulling){e._pullAgain=!0;return}e._pulling=!0;let a=e._pullAlgorithm();v(a,()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,nt(e)),null),u=>(se(e,u),null))}function Os(e){Hn(e),e._pendingPullIntos=new W}function Vn(e,i){let a=!1;e._state==="closed"&&(a=!0);let u=Bs(i);i.readerType==="default"?qn(e,u,a):Pu(e,u,a)}function Bs(e){let i=e.bytesFilled,a=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,i/a)}function Sr(e,i,a,u){e._queue.push({buffer:i,byteOffset:a,byteLength:u}),e._queueTotalSize+=u}function Ws(e,i,a,u){let f;try{f=xs(i,a,a+u)}catch(m){throw se(e,m),m}Sr(e,f,0,u)}function Ls(e,i){i.bytesFilled>0&&Ws(e,i.buffer,i.byteOffset,i.bytesFilled),yt(e)}function Is(e,i){let a=Math.min(e._queueTotalSize,i.byteLength-i.bytesFilled),u=i.bytesFilled+a,f=a,m=!1,b=u%i.elementSize,S=u-b;S>=i.minimumFill&&(f=S-i.bytesFilled,m=!0);let C=e._queue;for(;f>0;){let E=C.peek(),x=Math.min(f,E.byteLength),A=i.byteOffset+i.bytesFilled;Cs(i.buffer,A,E.buffer,E.byteOffset,x),E.byteLength===x?C.shift():(E.byteOffset+=x,E.byteLength-=x),e._queueTotalSize-=x,Ds(e,x,i),f-=x}return m}function Ds(e,i,a){a.bytesFilled+=i}function qs(e){e._queueTotalSize===0&&e._closeRequested?(wr(e),Vt(e._controlledReadableByteStream)):nt(e)}function Hn(e){e._byobRequest!==null&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function Gn(e){for(;e._pendingPullIntos.length>0;){if(e._queueTotalSize===0)return;let i=e._pendingPullIntos.peek();Is(e,i)&&(yt(e),Vn(e._controlledReadableByteStream,i))}}function gu(e){let i=e._controlledReadableByteStream._reader;for(;i._readRequests.length>0;){if(e._queueTotalSize===0)return;let a=i._readRequests.shift();Fs(e,a)}}function Su(e,i,a,u){let f=e._controlledReadableByteStream,m=i.constructor,b=yu(m),{byteOffset:S,byteLength:C}=i,E=a*b,x;try{x=Ce(i.buffer)}catch(D){u._errorSteps(D);return}let A={buffer:x,bufferByteLength:x.byteLength,byteOffset:S,byteLength:C,bytesFilled:0,minimumFill:E,elementSize:b,viewConstructor:m,readerType:"byob"};if(e._pendingPullIntos.length>0){e._pendingPullIntos.push(A),js(f,u);return}if(f._state==="closed"){let D=new m(A.buffer,A.byteOffset,0);u._closeSteps(D);return}if(e._queueTotalSize>0){if(Is(e,A)){let D=Bs(A);qs(e),u._chunkSteps(D);return}if(e._closeRequested){let D=new TypeError("Insufficient bytes to fill elements in the given buffer");se(e,D),u._errorSteps(D);return}}e._pendingPullIntos.push(A),js(f,u),nt(e)}function wu(e,i){i.readerType==="none"&&yt(e);let a=e._controlledReadableByteStream;if(Jn(a))for(;zs(a)>0;){let u=yt(e);Vn(a,u)}}function vu(e,i,a){if(Ds(e,i,a),a.readerType==="none"){Ls(e,a),Gn(e);return}if(a.bytesFilled0){let f=a.byteOffset+a.bytesFilled;Ws(e,a.buffer,f-u,u)}a.bytesFilled-=u,Vn(e._controlledReadableByteStream,a),Gn(e)}function Us(e,i){let a=e._pendingPullIntos.peek();Hn(e),e._controlledReadableByteStream._state==="closed"?wu(e,a):vu(e,i,a),nt(e)}function yt(e){return e._pendingPullIntos.shift()}function Eu(e){let i=e._controlledReadableByteStream;return i._state!=="readable"||e._closeRequested||!e._started?!1:!!(gs(i)&&_r(i)>0||Jn(i)&&zs(i)>0||Ns(e)>0)}function wr(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function Ut(e){let i=e._controlledReadableByteStream;if(!(e._closeRequested||i._state!=="readable")){if(e._queueTotalSize>0){e._closeRequested=!0;return}if(e._pendingPullIntos.length>0){let a=e._pendingPullIntos.peek();if(a.bytesFilled%a.elementSize!==0){let u=new TypeError("Insufficient bytes to fill elements in the given buffer");throw se(e,u),u}}wr(e),Vt(i)}}function vr(e,i){let a=e._controlledReadableByteStream;if(e._closeRequested||a._state!=="readable")return;let{buffer:u,byteOffset:f,byteLength:m}=i;if(Ne(u))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let b=Ce(u);if(e._pendingPullIntos.length>0){let S=e._pendingPullIntos.peek();if(Ne(S.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");Hn(e),S.buffer=Ce(S.buffer),S.readerType==="none"&&Ls(e,S)}if(gs(a))if(gu(e),_r(a)===0)Sr(e,b,f,m);else{e._pendingPullIntos.length>0&&yt(e);let S=new Uint8Array(b,f,m);qn(a,S,!1)}else Jn(a)?(Sr(e,b,f,m),Gn(e)):Sr(e,b,f,m);nt(e)}function se(e,i){let a=e._controlledReadableByteStream;a._state==="readable"&&(Os(e),Me(e),wr(e),mo(a,i))}function Fs(e,i){let a=e._queue.shift();e._queueTotalSize-=a.byteLength,qs(e);let u=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);i._chunkSteps(u)}function Yn(e){if(e._byobRequest===null&&e._pendingPullIntos.length>0){let i=e._pendingPullIntos.peek(),a=new Uint8Array(i.buffer,i.byteOffset+i.bytesFilled,i.byteLength-i.bytesFilled),u=Object.create(tt.prototype);Tu(u,e,a),e._byobRequest=u}return e._byobRequest}function Ns(e){let i=e._controlledReadableByteStream._state;return i==="errored"?null:i==="closed"?0:e._strategyHWM-e._queueTotalSize}function Er(e,i){let a=e._pendingPullIntos.peek();if(e._controlledReadableByteStream._state==="closed"){if(i!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(i===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(a.bytesFilled+i>a.byteLength)throw new RangeError("bytesWritten out of range")}a.buffer=Ce(a.buffer),Us(e,i)}function Rr(e,i){let a=e._pendingPullIntos.peek();if(e._controlledReadableByteStream._state==="closed"){if(i.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(i.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(a.byteOffset+a.bytesFilled!==i.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(a.bufferByteLength!==i.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(a.bytesFilled+i.byteLength>a.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let f=i.byteLength;a.buffer=Ce(i.buffer),Us(e,f)}function Ms(e,i,a,u,f,m,b){i._controlledReadableByteStream=e,i._pullAgain=!1,i._pulling=!1,i._byobRequest=null,i._queue=i._queueTotalSize=void 0,Me(i),i._closeRequested=!1,i._started=!1,i._strategyHWM=m,i._pullAlgorithm=u,i._cancelAlgorithm=f,i._autoAllocateChunkSize=b,i._pendingPullIntos=new W,e._readableStreamController=i;let S=a();v(d(S),()=>(i._started=!0,nt(i),null),C=>(se(i,C),null))}function Ru(e,i,a){let u=Object.create(xe.prototype),f,m,b;i.start!==void 0?f=()=>i.start(u):f=()=>{},i.pull!==void 0?m=()=>i.pull(u):m=()=>d(void 0),i.cancel!==void 0?b=C=>i.cancel(C):b=()=>d(void 0);let S=i.autoAllocateChunkSize;if(S===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");Ms(e,u,f,m,b,a,S)}function Tu(e,i,a){e._associatedReadableByteStreamController=i,e._view=a}function Qn(e){return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function Ft(e){return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function Cu(e,i){_e(e,i);let a=e?.mode;return{mode:a===void 0?void 0:xu(a,`${i} has member 'mode' that`)}}function xu(e,i){if(e=`${e}`,e!=="byob")throw new TypeError(`${i} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function ku(e,i){var a;_e(e,i);let u=(a=e?.min)!==null&&a!==void 0?a:1;return{min:In(u,`${i} has member 'min' that`)}}function $s(e){return new $e(e)}function js(e,i){e._reader._readIntoRequests.push(i)}function Pu(e,i,a){let f=e._reader._readIntoRequests.shift();a?f._closeSteps(i):f._chunkSteps(i)}function zs(e){return e._reader._readIntoRequests.length}function Jn(e){let i=e._reader;return!(i===void 0||!it(i))}class $e{constructor(i){if(Te(i,1,"ReadableStreamBYOBReader"),Dn(i,"First parameter"),Ve(i))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!rt(i._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");ds(this,i),this._readIntoRequests=new W}get closed(){return it(this)?this._closedPromise:h(Tr("closed"))}cancel(i=void 0){return it(this)?this._ownerReadableStream===void 0?h(br("cancel")):An(this,i):h(Tr("cancel"))}read(i,a={}){if(!it(this))return h(Tr("read"));if(!ArrayBuffer.isView(i))return h(new TypeError("view must be an array buffer view"));if(i.byteLength===0)return h(new TypeError("view must have non-zero byteLength"));if(i.buffer.byteLength===0)return h(new TypeError("view's buffer must have non-zero byteLength"));if(Ne(i.buffer))return h(new TypeError("view's buffer has been detached"));let u;try{u=ku(a,"options")}catch(E){return h(E)}let f=u.min;if(f===0)return h(new TypeError("options.min must be greater than 0"));if(_u(i)){if(f>i.byteLength)return h(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(f>i.length)return h(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return h(br("read from"));let m,b,S=p((E,x)=>{m=E,b=x});return Vs(this,i,f,{_chunkSteps:E=>m({value:E,done:!1}),_closeSteps:E=>m({value:E,done:!0}),_errorSteps:E=>b(E)}),S}releaseLock(){if(!it(this))throw Tr("releaseLock");this._ownerReadableStream!==void 0&&Au(this)}}Object.defineProperties($e.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),o($e.prototype.cancel,"cancel"),o($e.prototype.read,"read"),o($e.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty($e.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function it(e){return!r(e)||!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")?!1:e instanceof $e}function Vs(e,i,a,u){let f=e._ownerReadableStream;f._disturbed=!0,f._state==="errored"?u._errorSteps(f._storedError):Su(f._readableStreamController,i,a,u)}function Au(e){Re(e);let i=new TypeError("Reader was released");Hs(e,i)}function Hs(e,i){let a=e._readIntoRequests;e._readIntoRequests=new W,a.forEach(u=>{u._errorSteps(i)})}function Tr(e){return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function Nt(e,i){let{highWaterMark:a}=e;if(a===void 0)return i;if(Ts(a)||a<0)throw new RangeError("Invalid highWaterMark");return a}function Cr(e){let{size:i}=e;return i||(()=>1)}function xr(e,i){_e(e,i);let a=e?.highWaterMark,u=e?.size;return{highWaterMark:a===void 0?void 0:Ln(a),size:u===void 0?void 0:Ou(u,`${i} has member 'size' that`)}}function Ou(e,i){return ie(e,i),a=>Ln(e(a))}function Bu(e,i){_e(e,i);let a=e?.abort,u=e?.close,f=e?.start,m=e?.type,b=e?.write;return{abort:a===void 0?void 0:Wu(a,e,`${i} has member 'abort' that`),close:u===void 0?void 0:Lu(u,e,`${i} has member 'close' that`),start:f===void 0?void 0:Iu(f,e,`${i} has member 'start' that`),write:b===void 0?void 0:Du(b,e,`${i} has member 'write' that`),type:m}}function Wu(e,i,a){return ie(e,a),u=>F(e,i,[u])}function Lu(e,i,a){return ie(e,a),()=>F(e,i,[])}function Iu(e,i,a){return ie(e,a),u=>L(e,i,[u])}function Du(e,i,a){return ie(e,a),(u,f)=>F(e,i,[u,f])}function Gs(e,i){if(!gt(e))throw new TypeError(`${i} is not a WritableStream.`)}function qu(e){if(typeof e!="object"||e===null)return!1;try{return typeof e.aborted=="boolean"}catch{return!1}}let Uu=typeof AbortController=="function";function Fu(){if(Uu)return new AbortController}class je{constructor(i={},a={}){i===void 0?i=null:bs(i,"First parameter");let u=xr(a,"Second parameter"),f=Bu(i,"First parameter");if(Qs(this),f.type!==void 0)throw new RangeError("Invalid type is specified");let b=Cr(u),S=Nt(u,1);Zu(this,f,S,b)}get locked(){if(!gt(this))throw Br("locked");return St(this)}abort(i=void 0){return gt(this)?St(this)?h(new TypeError("Cannot abort a stream that already has a writer")):kr(this,i):h(Br("abort"))}close(){return gt(this)?St(this)?h(new TypeError("Cannot close a stream that already has a writer")):ye(this)?h(new TypeError("Cannot close an already-closing stream")):Js(this):h(Br("close"))}getWriter(){if(!gt(this))throw Br("getWriter");return Ys(this)}}Object.defineProperties(je.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),o(je.prototype.abort,"abort"),o(je.prototype.close,"close"),o(je.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(je.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function Ys(e){return new ke(e)}function Nu(e,i,a,u,f=1,m=()=>1){let b=Object.create(je.prototype);Qs(b);let S=Object.create(wt.prototype);return ro(b,S,e,i,a,u,f,m),b}function Qs(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new W,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function gt(e){return!r(e)||!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")?!1:e instanceof je}function St(e){return e._writer!==void 0}function kr(e,i){var a;if(e._state==="closed"||e._state==="errored")return d(void 0);e._writableStreamController._abortReason=i,(a=e._writableStreamController._abortController)===null||a===void 0||a.abort(i);let u=e._state;if(u==="closed"||u==="errored")return d(void 0);if(e._pendingAbortRequest!==void 0)return e._pendingAbortRequest._promise;let f=!1;u==="erroring"&&(f=!0,i=void 0);let m=p((b,S)=>{e._pendingAbortRequest={_promise:void 0,_resolve:b,_reject:S,_reason:i,_wasAlreadyErroring:f}});return e._pendingAbortRequest._promise=m,f||Xn(e,i),m}function Js(e){let i=e._state;if(i==="closed"||i==="errored")return h(new TypeError(`The stream (in ${i} state) is not in the writable state and cannot be closed`));let a=p((f,m)=>{let b={_resolve:f,_reject:m};e._closeRequest=b}),u=e._writer;return u!==void 0&&e._backpressure&&i==="writable"&&oi(u),ec(e._writableStreamController),a}function Mu(e){return p((a,u)=>{let f={_resolve:a,_reject:u};e._writeRequests.push(f)})}function Kn(e,i){if(e._state==="writable"){Xn(e,i);return}Zn(e)}function Xn(e,i){let a=e._writableStreamController;e._state="erroring",e._storedError=i;let u=e._writer;u!==void 0&&Xs(u,i),!Hu(e)&&a._started&&Zn(e)}function Zn(e){e._state="errored",e._writableStreamController[ue]();let i=e._storedError;if(e._writeRequests.forEach(f=>{f._reject(i)}),e._writeRequests=new W,e._pendingAbortRequest===void 0){Pr(e);return}let a=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,a._wasAlreadyErroring){a._reject(i),Pr(e);return}let u=e._writableStreamController[I](a._reason);v(u,()=>(a._resolve(),Pr(e),null),f=>(a._reject(f),Pr(e),null))}function $u(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0}function ju(e,i){e._inFlightWriteRequest._reject(i),e._inFlightWriteRequest=void 0,Kn(e,i)}function zu(e){e._inFlightCloseRequest._resolve(void 0),e._inFlightCloseRequest=void 0,e._state==="erroring"&&(e._storedError=void 0,e._pendingAbortRequest!==void 0&&(e._pendingAbortRequest._resolve(),e._pendingAbortRequest=void 0)),e._state="closed";let a=e._writer;a!==void 0&&oo(a)}function Vu(e,i){e._inFlightCloseRequest._reject(i),e._inFlightCloseRequest=void 0,e._pendingAbortRequest!==void 0&&(e._pendingAbortRequest._reject(i),e._pendingAbortRequest=void 0),Kn(e,i)}function ye(e){return!(e._closeRequest===void 0&&e._inFlightCloseRequest===void 0)}function Hu(e){return!(e._inFlightWriteRequest===void 0&&e._inFlightCloseRequest===void 0)}function Gu(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0}function Yu(e){e._inFlightWriteRequest=e._writeRequests.shift()}function Pr(e){e._closeRequest!==void 0&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);let i=e._writer;i!==void 0&&ii(i,e._storedError)}function ei(e,i){let a=e._writer;a!==void 0&&i!==e._backpressure&&(i?ac(a):oi(a)),e._backpressure=i}class ke{constructor(i){if(Te(i,1,"WritableStreamDefaultWriter"),Gs(i,"First parameter"),St(i))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=i,i._writer=this;let a=i._state;if(a==="writable")!ye(i)&&i._backpressure?Lr(this):ao(this),Wr(this);else if(a==="erroring")si(this,i._storedError),Wr(this);else if(a==="closed")ao(this),sc(this);else{let u=i._storedError;si(this,u),so(this,u)}}get closed(){return st(this)?this._closedPromise:h(ot("closed"))}get desiredSize(){if(!st(this))throw ot("desiredSize");if(this._ownerWritableStream===void 0)throw $t("desiredSize");return Xu(this)}get ready(){return st(this)?this._readyPromise:h(ot("ready"))}abort(i=void 0){return st(this)?this._ownerWritableStream===void 0?h($t("abort")):Qu(this,i):h(ot("abort"))}close(){if(!st(this))return h(ot("close"));let i=this._ownerWritableStream;return i===void 0?h($t("close")):ye(i)?h(new TypeError("Cannot close an already-closing stream")):Ks(this)}releaseLock(){if(!st(this))throw ot("releaseLock");this._ownerWritableStream!==void 0&&Zs(this)}write(i=void 0){return st(this)?this._ownerWritableStream===void 0?h($t("write to")):eo(this,i):h(ot("write"))}}Object.defineProperties(ke.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),o(ke.prototype.abort,"abort"),o(ke.prototype.close,"close"),o(ke.prototype.releaseLock,"releaseLock"),o(ke.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(ke.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function st(e){return!r(e)||!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")?!1:e instanceof ke}function Qu(e,i){let a=e._ownerWritableStream;return kr(a,i)}function Ks(e){let i=e._ownerWritableStream;return Js(i)}function Ju(e){let i=e._ownerWritableStream,a=i._state;return ye(i)||a==="closed"?d(void 0):a==="errored"?h(i._storedError):Ks(e)}function Ku(e,i){e._closedPromiseState==="pending"?ii(e,i):oc(e,i)}function Xs(e,i){e._readyPromiseState==="pending"?lo(e,i):lc(e,i)}function Xu(e){let i=e._ownerWritableStream,a=i._state;return a==="errored"||a==="erroring"?null:a==="closed"?0:no(i._writableStreamController)}function Zs(e){let i=e._ownerWritableStream,a=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Xs(e,a),Ku(e,a),i._writer=void 0,e._ownerWritableStream=void 0}function eo(e,i){let a=e._ownerWritableStream,u=a._writableStreamController,f=tc(u,i);if(a!==e._ownerWritableStream)return h($t("write to"));let m=a._state;if(m==="errored")return h(a._storedError);if(ye(a)||m==="closed")return h(new TypeError("The stream is closing or closed and cannot be written to"));if(m==="erroring")return h(a._storedError);let b=Mu(a);return rc(u,i,f),b}let to={};class wt{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!ti(this))throw ni("abortReason");return this._abortReason}get signal(){if(!ti(this))throw ni("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(i=void 0){if(!ti(this))throw ni("error");this._controlledWritableStream._state==="writable"&&io(this,i)}[I](i){let a=this._abortAlgorithm(i);return Ar(this),a}[ue](){Me(this)}}Object.defineProperties(wt.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(wt.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function ti(e){return!r(e)||!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")?!1:e instanceof wt}function ro(e,i,a,u,f,m,b,S){i._controlledWritableStream=e,e._writableStreamController=i,i._queue=void 0,i._queueTotalSize=void 0,Me(i),i._abortReason=void 0,i._abortController=Fu(),i._started=!1,i._strategySizeAlgorithm=S,i._strategyHWM=b,i._writeAlgorithm=u,i._closeAlgorithm=f,i._abortAlgorithm=m;let C=ri(i);ei(e,C);let E=a(),x=d(E);v(x,()=>(i._started=!0,Or(i),null),A=>(i._started=!0,Kn(e,A),null))}function Zu(e,i,a,u){let f=Object.create(wt.prototype),m,b,S,C;i.start!==void 0?m=()=>i.start(f):m=()=>{},i.write!==void 0?b=E=>i.write(E,f):b=()=>d(void 0),i.close!==void 0?S=()=>i.close():S=()=>d(void 0),i.abort!==void 0?C=E=>i.abort(E):C=()=>d(void 0),ro(e,f,m,b,S,C,a,u)}function Ar(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function ec(e){jn(e,to,0),Or(e)}function tc(e,i){try{return e._strategySizeAlgorithm(i)}catch(a){return Mt(e,a),1}}function no(e){return e._strategyHWM-e._queueTotalSize}function rc(e,i,a){try{jn(e,i,a)}catch(f){Mt(e,f);return}let u=e._controlledWritableStream;if(!ye(u)&&u._state==="writable"){let f=ri(e);ei(u,f)}Or(e)}function Or(e){let i=e._controlledWritableStream;if(!e._started||i._inFlightWriteRequest!==void 0)return;if(i._state==="erroring"){Zn(i);return}if(e._queue.length===0)return;let u=bu(e);u===to?nc(e):ic(e,u)}function Mt(e,i){e._controlledWritableStream._state==="writable"&&io(e,i)}function nc(e){let i=e._controlledWritableStream;Gu(i),$n(e);let a=e._closeAlgorithm();Ar(e),v(a,()=>(zu(i),null),u=>(Vu(i,u),null))}function ic(e,i){let a=e._controlledWritableStream;Yu(a);let u=e._writeAlgorithm(i);v(u,()=>{$u(a);let f=a._state;if($n(e),!ye(a)&&f==="writable"){let m=ri(e);ei(a,m)}return Or(e),null},f=>(a._state==="writable"&&Ar(e),ju(a,f),null))}function ri(e){return no(e)<=0}function io(e,i){let a=e._controlledWritableStream;Ar(e),Xn(a,i)}function Br(e){return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function ni(e){return new TypeError(`WritableStreamDefaultController.prototype.${e} can only be used on a WritableStreamDefaultController`)}function ot(e){return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function $t(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function Wr(e){e._closedPromise=p((i,a)=>{e._closedPromise_resolve=i,e._closedPromise_reject=a,e._closedPromiseState="pending"})}function so(e,i){Wr(e),ii(e,i)}function sc(e){Wr(e),oo(e)}function ii(e,i){e._closedPromise_reject!==void 0&&(T(e._closedPromise),e._closedPromise_reject(i),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function oc(e,i){so(e,i)}function oo(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function Lr(e){e._readyPromise=p((i,a)=>{e._readyPromise_resolve=i,e._readyPromise_reject=a}),e._readyPromiseState="pending"}function si(e,i){Lr(e),lo(e,i)}function ao(e){Lr(e),oi(e)}function lo(e,i){e._readyPromise_reject!==void 0&&(T(e._readyPromise),e._readyPromise_reject(i),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function ac(e){Lr(e)}function lc(e,i){si(e,i)}function oi(e){e._readyPromise_resolve!==void 0&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}function uc(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global}let ai=uc();function cc(e){if(!(typeof e=="function"||typeof e=="object")||e.name!=="DOMException")return!1;try{return new e,!0}catch{return!1}}function fc(){let e=ai?.DOMException;return cc(e)?e:void 0}function dc(){let e=function(a,u){this.message=a||"",this.name=u||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return o(e,"DOMException"),e.prototype=Object.create(Error.prototype),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,configurable:!0}),e}let hc=fc()||dc();function uo(e,i,a,u,f,m){let b=_t(e),S=Ys(i);e._disturbed=!0;let C=!1,E=d(void 0);return p((x,A)=>{let D;if(m!==void 0){if(D=()=>{let R=m.reason!==void 0?m.reason:new hc("Aborted","AbortError"),B=[];u||B.push(()=>i._state==="writable"?kr(i,R):d(void 0)),f||B.push(()=>e._state==="readable"?fe(e,R):d(void 0)),J(()=>Promise.all(B.map(q=>q())),!0,R)},m.aborted){D();return}m.addEventListener("abort",D)}function de(){return p((R,B)=>{function q(Z){Z?R():g(Tt(),q,B)}q(!1)})}function Tt(){return C?d(!0):g(S._readyPromise,()=>p((R,B)=>{Dt(b,{_chunkSteps:q=>{E=g(eo(S,q),void 0,t),R(!1)},_closeSteps:()=>R(!0),_errorSteps:B})}))}if(Ae(e,b._closedPromise,R=>(u?oe(!0,R):J(()=>kr(i,R),!0,R),null)),Ae(i,S._closedPromise,R=>(f?oe(!0,R):J(()=>fe(e,R),!0,R),null)),Y(e,b._closedPromise,()=>(a?oe():J(()=>Ju(S)),null)),ye(i)||i._state==="closed"){let R=new TypeError("the destination writable stream closed before all data could be piped to it");f?oe(!0,R):J(()=>fe(e,R),!0,R)}T(de());function Ge(){let R=E;return g(E,()=>R!==E?Ge():void 0)}function Ae(R,B,q){R._state==="errored"?q(R._storedError):y(B,q)}function Y(R,B,q){R._state==="closed"?q():P(B,q)}function J(R,B,q){if(C)return;C=!0,i._state==="writable"&&!ye(i)?P(Ge(),Z):Z();function Z(){return v(R(),()=>Oe(B,q),Ct=>Oe(!0,Ct)),null}}function oe(R,B){C||(C=!0,i._state==="writable"&&!ye(i)?P(Ge(),()=>Oe(R,B)):Oe(R,B))}function Oe(R,B){return Zs(S),Re(b),m!==void 0&&m.removeEventListener("abort",D),R?A(B):x(void 0),null}})}class Pe{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Ir(this))throw qr("desiredSize");return li(this)}close(){if(!Ir(this))throw qr("close");if(!Et(this))throw new TypeError("The stream is not in a state that permits close");at(this)}enqueue(i=void 0){if(!Ir(this))throw qr("enqueue");if(!Et(this))throw new TypeError("The stream is not in a state that permits enqueue");return vt(this,i)}error(i=void 0){if(!Ir(this))throw qr("error");ce(this,i)}[Ee](i){Me(this);let a=this._cancelAlgorithm(i);return Dr(this),a}[It](i){let a=this._controlledReadableStream;if(this._queue.length>0){let u=$n(this);this._closeRequested&&this._queue.length===0?(Dr(this),Vt(a)):jt(this),i._chunkSteps(u)}else ys(a,i),jt(this)}[Pn](){}}Object.defineProperties(Pe.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),o(Pe.prototype.close,"close"),o(Pe.prototype.enqueue,"enqueue"),o(Pe.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Pe.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function Ir(e){return!r(e)||!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")?!1:e instanceof Pe}function jt(e){if(!co(e))return;if(e._pulling){e._pullAgain=!0;return}e._pulling=!0;let a=e._pullAlgorithm();v(a,()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,jt(e)),null),u=>(ce(e,u),null))}function co(e){let i=e._controlledReadableStream;return!Et(e)||!e._started?!1:!!(Ve(i)&&_r(i)>0||li(e)>0)}function Dr(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function at(e){if(!Et(e))return;let i=e._controlledReadableStream;e._closeRequested=!0,e._queue.length===0&&(Dr(e),Vt(i))}function vt(e,i){if(!Et(e))return;let a=e._controlledReadableStream;if(Ve(a)&&_r(a)>0)qn(a,i,!1);else{let u;try{u=e._strategySizeAlgorithm(i)}catch(f){throw ce(e,f),f}try{jn(e,i,u)}catch(f){throw ce(e,f),f}}jt(e)}function ce(e,i){let a=e._controlledReadableStream;a._state==="readable"&&(Me(e),Dr(e),mo(a,i))}function li(e){let i=e._controlledReadableStream._state;return i==="errored"?null:i==="closed"?0:e._strategyHWM-e._queueTotalSize}function pc(e){return!co(e)}function Et(e){let i=e._controlledReadableStream._state;return!e._closeRequested&&i==="readable"}function fo(e,i,a,u,f,m,b){i._controlledReadableStream=e,i._queue=void 0,i._queueTotalSize=void 0,Me(i),i._started=!1,i._closeRequested=!1,i._pullAgain=!1,i._pulling=!1,i._strategySizeAlgorithm=b,i._strategyHWM=m,i._pullAlgorithm=u,i._cancelAlgorithm=f,e._readableStreamController=i;let S=a();v(d(S),()=>(i._started=!0,jt(i),null),C=>(ce(i,C),null))}function mc(e,i,a,u){let f=Object.create(Pe.prototype),m,b,S;i.start!==void 0?m=()=>i.start(f):m=()=>{},i.pull!==void 0?b=()=>i.pull(f):b=()=>d(void 0),i.cancel!==void 0?S=C=>i.cancel(C):S=()=>d(void 0),fo(e,f,m,b,S,a,u)}function qr(e){return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function bc(e,i){return rt(e._readableStreamController)?yc(e):_c(e)}function _c(e,i){let a=_t(e),u=!1,f=!1,m=!1,b=!1,S,C,E,x,A,D=p(Y=>{A=Y});function de(){return u?(f=!0,d(void 0)):(u=!0,Dt(a,{_chunkSteps:J=>{k(()=>{f=!1;let oe=J,Oe=J;m||vt(E._readableStreamController,oe),b||vt(x._readableStreamController,Oe),u=!1,f&&de()})},_closeSteps:()=>{u=!1,m||at(E._readableStreamController),b||at(x._readableStreamController),(!m||!b)&&A(void 0)},_errorSteps:()=>{u=!1}}),d(void 0))}function Tt(Y){if(m=!0,S=Y,b){let J=qt([S,C]),oe=fe(e,J);A(oe)}return D}function Ge(Y){if(b=!0,C=Y,m){let J=qt([S,C]),oe=fe(e,J);A(oe)}return D}function Ae(){}return E=zt(Ae,de,Tt),x=zt(Ae,de,Ge),y(a._closedPromise,Y=>(ce(E._readableStreamController,Y),ce(x._readableStreamController,Y),(!m||!b)&&A(void 0),null)),[E,x]}function yc(e){let i=_t(e),a=!1,u=!1,f=!1,m=!1,b=!1,S,C,E,x,A,D=p(R=>{A=R});function de(R){y(R._closedPromise,B=>(R!==i||(se(E._readableStreamController,B),se(x._readableStreamController,B),(!m||!b)&&A(void 0)),null))}function Tt(){it(i)&&(Re(i),i=_t(e),de(i)),Dt(i,{_chunkSteps:B=>{k(()=>{u=!1,f=!1;let q=B,Z=B;if(!m&&!b)try{Z=Ps(B)}catch(Ct){se(E._readableStreamController,Ct),se(x._readableStreamController,Ct),A(fe(e,Ct));return}m||vr(E._readableStreamController,q),b||vr(x._readableStreamController,Z),a=!1,u?Ae():f&&Y()})},_closeSteps:()=>{a=!1,m||Ut(E._readableStreamController),b||Ut(x._readableStreamController),E._readableStreamController._pendingPullIntos.length>0&&Er(E._readableStreamController,0),x._readableStreamController._pendingPullIntos.length>0&&Er(x._readableStreamController,0),(!m||!b)&&A(void 0)},_errorSteps:()=>{a=!1}})}function Ge(R,B){Fe(i)&&(Re(i),i=$s(e),de(i));let q=B?x:E,Z=B?E:x;Vs(i,R,1,{_chunkSteps:xt=>{k(()=>{u=!1,f=!1;let kt=B?b:m;if(B?m:b)kt||Rr(q._readableStreamController,xt);else{let ko;try{ko=Ps(xt)}catch(hi){se(q._readableStreamController,hi),se(Z._readableStreamController,hi),A(fe(e,hi));return}kt||Rr(q._readableStreamController,xt),vr(Z._readableStreamController,ko)}a=!1,u?Ae():f&&Y()})},_closeSteps:xt=>{a=!1;let kt=B?b:m,Vr=B?m:b;kt||Ut(q._readableStreamController),Vr||Ut(Z._readableStreamController),xt!==void 0&&(kt||Rr(q._readableStreamController,xt),!Vr&&Z._readableStreamController._pendingPullIntos.length>0&&Er(Z._readableStreamController,0)),(!kt||!Vr)&&A(void 0)},_errorSteps:()=>{a=!1}})}function Ae(){if(a)return u=!0,d(void 0);a=!0;let R=Yn(E._readableStreamController);return R===null?Tt():Ge(R._view,!1),d(void 0)}function Y(){if(a)return f=!0,d(void 0);a=!0;let R=Yn(x._readableStreamController);return R===null?Tt():Ge(R._view,!0),d(void 0)}function J(R){if(m=!0,S=R,b){let B=qt([S,C]),q=fe(e,B);A(q)}return D}function oe(R){if(b=!0,C=R,m){let B=qt([S,C]),q=fe(e,B);A(q)}return D}function Oe(){}return E=po(Oe,Ae,J),x=po(Oe,Y,oe),de(i),[E,x]}function gc(e){return r(e)&&typeof e.getReader<"u"}function Sc(e){return gc(e)?vc(e.getReader()):wc(e)}function wc(e){let i,a=ks(e,"async"),u=t;function f(){let b;try{b=du(a)}catch(C){return h(C)}let S=d(b);return w(S,C=>{if(!r(C))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(hu(C))at(i._readableStreamController);else{let x=pu(C);vt(i._readableStreamController,x)}})}function m(b){let S=a.iterator,C;try{C=gr(S,"return")}catch(A){return h(A)}if(C===void 0)return d(void 0);let E;try{E=L(C,S,[b])}catch(A){return h(A)}let x=d(E);return w(x,A=>{if(!r(A))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return i=zt(u,f,m,0),i}function vc(e){let i,a=t;function u(){let m;try{m=e.read()}catch(b){return h(b)}return w(m,b=>{if(!r(b))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(b.done)at(i._readableStreamController);else{let S=b.value;vt(i._readableStreamController,S)}})}function f(m){try{return d(e.cancel(m))}catch(b){return h(b)}}return i=zt(a,u,f,0),i}function Ec(e,i){_e(e,i);let a=e,u=a?.autoAllocateChunkSize,f=a?.cancel,m=a?.pull,b=a?.start,S=a?.type;return{autoAllocateChunkSize:u===void 0?void 0:In(u,`${i} has member 'autoAllocateChunkSize' that`),cancel:f===void 0?void 0:Rc(f,a,`${i} has member 'cancel' that`),pull:m===void 0?void 0:Tc(m,a,`${i} has member 'pull' that`),start:b===void 0?void 0:Cc(b,a,`${i} has member 'start' that`),type:S===void 0?void 0:xc(S,`${i} has member 'type' that`)}}function Rc(e,i,a){return ie(e,a),u=>F(e,i,[u])}function Tc(e,i,a){return ie(e,a),u=>F(e,i,[u])}function Cc(e,i,a){return ie(e,a),u=>L(e,i,[u])}function xc(e,i){if(e=`${e}`,e!=="bytes")throw new TypeError(`${i} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function kc(e,i){return _e(e,i),{preventCancel:!!e?.preventCancel}}function ho(e,i){_e(e,i);let a=e?.preventAbort,u=e?.preventCancel,f=e?.preventClose,m=e?.signal;return m!==void 0&&Pc(m,`${i} has member 'signal' that`),{preventAbort:!!a,preventCancel:!!u,preventClose:!!f,signal:m}}function Pc(e,i){if(!qu(e))throw new TypeError(`${i} is not an AbortSignal.`)}function Ac(e,i){_e(e,i);let a=e?.readable;Wn(a,"readable","ReadableWritablePair"),Dn(a,`${i} has member 'readable' that`);let u=e?.writable;return Wn(u,"writable","ReadableWritablePair"),Gs(u,`${i} has member 'writable' that`),{readable:a,writable:u}}class z{constructor(i={},a={}){i===void 0?i=null:bs(i,"First parameter");let u=xr(a,"Second parameter"),f=Ec(i,"First parameter");if(ui(this),f.type==="bytes"){if(u.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let m=Nt(u,0);Ru(this,f,m)}else{let m=Cr(u),b=Nt(u,1);mc(this,f,b,m)}}get locked(){if(!ze(this))throw lt("locked");return Ve(this)}cancel(i=void 0){return ze(this)?Ve(this)?h(new TypeError("Cannot cancel a stream that already has a reader")):fe(this,i):h(lt("cancel"))}getReader(i=void 0){if(!ze(this))throw lt("getReader");return Cu(i,"First parameter").mode===void 0?_t(this):$s(this)}pipeThrough(i,a={}){if(!ze(this))throw lt("pipeThrough");Te(i,1,"pipeThrough");let u=Ac(i,"First parameter"),f=ho(a,"Second parameter");if(Ve(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(St(u.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let m=uo(this,u.writable,f.preventClose,f.preventAbort,f.preventCancel,f.signal);return T(m),u.readable}pipeTo(i,a={}){if(!ze(this))return h(lt("pipeTo"));if(i===void 0)return h("Parameter 1 is required in 'pipeTo'.");if(!gt(i))return h(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let u;try{u=ho(a,"Second parameter")}catch(f){return h(f)}return Ve(this)?h(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):St(i)?h(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):uo(this,i,u.preventClose,u.preventAbort,u.preventCancel,u.signal)}tee(){if(!ze(this))throw lt("tee");let i=bc(this);return qt(i)}values(i=void 0){if(!ze(this))throw lt("values");let a=kc(i,"First parameter");return cu(this,a.preventCancel)}[Mn](i){return this.values(i)}static from(i){return Sc(i)}}Object.defineProperties(z,{from:{enumerable:!0}}),Object.defineProperties(z.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),o(z.from,"from"),o(z.prototype.cancel,"cancel"),o(z.prototype.getReader,"getReader"),o(z.prototype.pipeThrough,"pipeThrough"),o(z.prototype.pipeTo,"pipeTo"),o(z.prototype.tee,"tee"),o(z.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(z.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(z.prototype,Mn,{value:z.prototype.values,writable:!0,configurable:!0});function zt(e,i,a,u=1,f=()=>1){let m=Object.create(z.prototype);ui(m);let b=Object.create(Pe.prototype);return fo(m,b,e,i,a,u,f),m}function po(e,i,a){let u=Object.create(z.prototype);ui(u);let f=Object.create(xe.prototype);return Ms(u,f,e,i,a,0,void 0),u}function ui(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function ze(e){return!r(e)||!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")?!1:e instanceof z}function Ve(e){return e._reader!==void 0}function fe(e,i){if(e._disturbed=!0,e._state==="closed")return d(void 0);if(e._state==="errored")return h(e._storedError);Vt(e);let a=e._reader;if(a!==void 0&&it(a)){let f=a._readIntoRequests;a._readIntoRequests=new W,f.forEach(m=>{m._closeSteps(void 0)})}let u=e._readableStreamController[Ee](i);return w(u,t)}function Vt(e){e._state="closed";let i=e._reader;if(i!==void 0&&(ps(i),Fe(i))){let a=i._readRequests;i._readRequests=new W,a.forEach(u=>{u._closeSteps()})}}function mo(e,i){e._state="errored",e._storedError=i;let a=e._reader;a!==void 0&&(Bn(a,i),Fe(a)?Ss(a,i):Hs(a,i))}function lt(e){return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function bo(e,i){_e(e,i);let a=e?.highWaterMark;return Wn(a,"highWaterMark","QueuingStrategyInit"),{highWaterMark:Ln(a)}}let _o=e=>e.byteLength;o(_o,"size");class Ur{constructor(i){Te(i,1,"ByteLengthQueuingStrategy"),i=bo(i,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=i.highWaterMark}get highWaterMark(){if(!go(this))throw yo("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!go(this))throw yo("size");return _o}}Object.defineProperties(Ur.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ur.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function yo(e){return new TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`)}function go(e){return!r(e)||!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")?!1:e instanceof Ur}let So=()=>1;o(So,"size");class Fr{constructor(i){Te(i,1,"CountQueuingStrategy"),i=bo(i,"First parameter"),this._countQueuingStrategyHighWaterMark=i.highWaterMark}get highWaterMark(){if(!vo(this))throw wo("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!vo(this))throw wo("size");return So}}Object.defineProperties(Fr.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Fr.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function wo(e){return new TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`)}function vo(e){return!r(e)||!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")?!1:e instanceof Fr}function Oc(e,i){_e(e,i);let a=e?.cancel,u=e?.flush,f=e?.readableType,m=e?.start,b=e?.transform,S=e?.writableType;return{cancel:a===void 0?void 0:Ic(a,e,`${i} has member 'cancel' that`),flush:u===void 0?void 0:Bc(u,e,`${i} has member 'flush' that`),readableType:f,start:m===void 0?void 0:Wc(m,e,`${i} has member 'start' that`),transform:b===void 0?void 0:Lc(b,e,`${i} has member 'transform' that`),writableType:S}}function Bc(e,i,a){return ie(e,a),u=>F(e,i,[u])}function Wc(e,i,a){return ie(e,a),u=>L(e,i,[u])}function Lc(e,i,a){return ie(e,a),(u,f)=>F(e,i,[u,f])}function Ic(e,i,a){return ie(e,a),u=>F(e,i,[u])}class Nr{constructor(i={},a={},u={}){i===void 0&&(i=null);let f=xr(a,"Second parameter"),m=xr(u,"Third parameter"),b=Oc(i,"First parameter");if(b.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(b.writableType!==void 0)throw new RangeError("Invalid writableType specified");let S=Nt(m,0),C=Cr(m),E=Nt(f,1),x=Cr(f),A,D=p(de=>{A=de});Dc(this,D,E,x,S,C),Uc(this,b),b.start!==void 0?A(b.start(this._transformStreamController)):A(void 0)}get readable(){if(!Eo(this))throw xo("readable");return this._readable}get writable(){if(!Eo(this))throw xo("writable");return this._writable}}Object.defineProperties(Nr.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Nr.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function Dc(e,i,a,u,f,m){function b(){return i}function S(D){return Mc(e,D)}function C(D){return $c(e,D)}function E(){return jc(e)}e._writable=Nu(b,S,E,C,a,u);function x(){return zc(e)}function A(D){return Vc(e,D)}e._readable=zt(b,x,A,f,m),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,Mr(e,!0),e._transformStreamController=void 0}function Eo(e){return!r(e)||!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")?!1:e instanceof Nr}function Ro(e,i){ce(e._readable._readableStreamController,i),ci(e,i)}function ci(e,i){jr(e._transformStreamController),Mt(e._writable._writableStreamController,i),fi(e)}function fi(e){e._backpressure&&Mr(e,!1)}function Mr(e,i){e._backpressureChangePromise!==void 0&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=p(a=>{e._backpressureChangePromise_resolve=a}),e._backpressure=i}class He{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!$r(this))throw zr("desiredSize");let i=this._controlledTransformStream._readable._readableStreamController;return li(i)}enqueue(i=void 0){if(!$r(this))throw zr("enqueue");To(this,i)}error(i=void 0){if(!$r(this))throw zr("error");Fc(this,i)}terminate(){if(!$r(this))throw zr("terminate");Nc(this)}}Object.defineProperties(He.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),o(He.prototype.enqueue,"enqueue"),o(He.prototype.error,"error"),o(He.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(He.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function $r(e){return!r(e)||!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")?!1:e instanceof He}function qc(e,i,a,u,f){i._controlledTransformStream=e,e._transformStreamController=i,i._transformAlgorithm=a,i._flushAlgorithm=u,i._cancelAlgorithm=f,i._finishPromise=void 0,i._finishPromise_resolve=void 0,i._finishPromise_reject=void 0}function Uc(e,i){let a=Object.create(He.prototype),u,f,m;i.transform!==void 0?u=b=>i.transform(b,a):u=b=>{try{return To(a,b),d(void 0)}catch(S){return h(S)}},i.flush!==void 0?f=()=>i.flush(a):f=()=>d(void 0),i.cancel!==void 0?m=b=>i.cancel(b):m=()=>d(void 0),qc(e,a,u,f,m)}function jr(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0,e._cancelAlgorithm=void 0}function To(e,i){let a=e._controlledTransformStream,u=a._readable._readableStreamController;if(!Et(u))throw new TypeError("Readable side is not in a state that permits enqueue");try{vt(u,i)}catch(m){throw ci(a,m),a._readable._storedError}pc(u)!==a._backpressure&&Mr(a,!0)}function Fc(e,i){Ro(e._controlledTransformStream,i)}function Co(e,i){let a=e._transformAlgorithm(i);return w(a,void 0,u=>{throw Ro(e._controlledTransformStream,u),u})}function Nc(e){let i=e._controlledTransformStream,a=i._readable._readableStreamController;at(a);let u=new TypeError("TransformStream terminated");ci(i,u)}function Mc(e,i){let a=e._transformStreamController;if(e._backpressure){let u=e._backpressureChangePromise;return w(u,()=>{let f=e._writable;if(f._state==="erroring")throw f._storedError;return Co(a,i)})}return Co(a,i)}function $c(e,i){let a=e._transformStreamController;if(a._finishPromise!==void 0)return a._finishPromise;let u=e._readable;a._finishPromise=p((m,b)=>{a._finishPromise_resolve=m,a._finishPromise_reject=b});let f=a._cancelAlgorithm(i);return jr(a),v(f,()=>(u._state==="errored"?Rt(a,u._storedError):(ce(u._readableStreamController,i),di(a)),null),m=>(ce(u._readableStreamController,m),Rt(a,m),null)),a._finishPromise}function jc(e){let i=e._transformStreamController;if(i._finishPromise!==void 0)return i._finishPromise;let a=e._readable;i._finishPromise=p((f,m)=>{i._finishPromise_resolve=f,i._finishPromise_reject=m});let u=i._flushAlgorithm();return jr(i),v(u,()=>(a._state==="errored"?Rt(i,a._storedError):(at(a._readableStreamController),di(i)),null),f=>(ce(a._readableStreamController,f),Rt(i,f),null)),i._finishPromise}function zc(e){return Mr(e,!1),e._backpressureChangePromise}function Vc(e,i){let a=e._transformStreamController;if(a._finishPromise!==void 0)return a._finishPromise;let u=e._writable;a._finishPromise=p((m,b)=>{a._finishPromise_resolve=m,a._finishPromise_reject=b});let f=a._cancelAlgorithm(i);return jr(a),v(f,()=>(u._state==="errored"?Rt(a,u._storedError):(Mt(u._writableStreamController,i),fi(e),di(a)),null),m=>(Mt(u._writableStreamController,m),fi(e),Rt(a,m),null)),a._finishPromise}function zr(e){return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function di(e){e._finishPromise_resolve!==void 0&&(e._finishPromise_resolve(),e._finishPromise_resolve=void 0,e._finishPromise_reject=void 0)}function Rt(e,i){e._finishPromise_reject!==void 0&&(T(e._finishPromise),e._finishPromise_reject(i),e._finishPromise_resolve=void 0,e._finishPromise_reject=void 0)}function xo(e){return new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}n.ByteLengthQueuingStrategy=Ur,n.CountQueuingStrategy=Fr,n.ReadableByteStreamController=xe,n.ReadableStream=z,n.ReadableStreamBYOBReader=$e,n.ReadableStreamBYOBRequest=tt,n.ReadableStreamDefaultController=Pe,n.ReadableStreamDefaultReader=Ue,n.TransformStream=Nr,n.TransformStreamDefaultController=He,n.WritableStream=je,n.WritableStreamDefaultController=wt,n.WritableStreamDefaultWriter=ke})});var dl=N(()=>{if(!globalThis.ReadableStream)try{let n=require("node:process"),{emitWarning:t}=n;try{n.emitWarning=()=>{},Object.assign(globalThis,require("node:stream/web")),n.emitWarning=t}catch(r){throw n.emitWarning=t,r}}catch{Object.assign(globalThis,fl())}try{let{Blob:n}=require("buffer");n&&!n.prototype.stream&&(n.prototype.stream=function(r){let s=0,o=this;return new ReadableStream({type:"bytes",async pull(l){let _=await o.slice(s,Math.min(o.size,s+65536)).arrayBuffer();s+=_.byteLength,l.enqueue(new Uint8Array(_)),s===o.size&&l.close()}})})}catch{}});async function*Ji(n,t=!0){for(let r of n)if("stream"in r)yield*r.stream();else if(ArrayBuffer.isView(r))if(t){let s=r.byteOffset,o=r.byteOffset+r.byteLength;for(;s!==o;){let l=Math.min(o-s,hl),c=r.buffer.slice(s,s+l);s+=c.byteLength,yield new Uint8Array(c)}}else yield r;else{let s=0,o=r;for(;s!==o.size;){let c=await o.slice(s,Math.min(o.size,s+hl)).arrayBuffer();s+=c.byteLength,yield new Uint8Array(c)}}}var tp,hl,pl,Cd,me,ar=$(()=>{tp=V(dl(),1);hl=65536;pl=class Ki{#e=[];#t="";#r=0;#n="transparent";constructor(t=[],r={}){if(typeof t!="object"||t===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(typeof t[Symbol.iterator]!="function")throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof r!="object"&&typeof r!="function")throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");r===null&&(r={});let s=new TextEncoder;for(let l of t){let c;ArrayBuffer.isView(l)?c=new Uint8Array(l.buffer.slice(l.byteOffset,l.byteOffset+l.byteLength)):l instanceof ArrayBuffer?c=new Uint8Array(l.slice(0)):l instanceof Ki?c=l:c=s.encode(`${l}`),this.#r+=ArrayBuffer.isView(c)?c.byteLength:c.size,this.#e.push(c)}this.#n=`${r.endings===void 0?"transparent":r.endings}`;let o=r.type===void 0?"":String(r.type);this.#t=/^[\x20-\x7E]*$/.test(o)?o:""}get size(){return this.#r}get type(){return this.#t}async text(){let t=new TextDecoder,r="";for await(let s of Ji(this.#e,!1))r+=t.decode(s,{stream:!0});return r+=t.decode(),r}async arrayBuffer(){let t=new Uint8Array(this.size),r=0;for await(let s of Ji(this.#e,!1))t.set(s,r),r+=s.length;return t.buffer}stream(){let t=Ji(this.#e,!0);return new globalThis.ReadableStream({type:"bytes",async pull(r){let s=await t.next();s.done?r.close():r.enqueue(s.value)},async cancel(){await t.return()}})}slice(t=0,r=this.size,s=""){let{size:o}=this,l=t<0?Math.max(o+t,0):Math.min(t,o),c=r<0?Math.max(o+r,0):Math.min(r,o),_=Math.max(c-l,0),p=this.#e,d=[],h=0;for(let v of p){if(h>=_)break;let P=ArrayBuffer.isView(v)?v.byteLength:v.size;if(l&&P<=l)l-=P,c-=P;else{let y;ArrayBuffer.isView(v)?(y=v.subarray(l,Math.min(P,c)),h+=y.byteLength):(y=v.slice(l,Math.min(P,c)),h+=y.size),c-=P,d.push(y),l=0}}let g=new Ki([],{type:String(s).toLowerCase()});return g.#r=_,g.#e=d,g}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](t){return t&&typeof t=="object"&&typeof t.constructor=="function"&&(typeof t.stream=="function"||typeof t.arrayBuffer=="function")&&/^(Blob|File)$/.test(t[Symbol.toStringTag])}};Object.defineProperties(pl.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});Cd=pl,me=Cd});var xd,kd,Ke,Xi=$(()=>{ar();xd=class extends me{#e=0;#t="";constructor(t,r,s={}){if(arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);super(t,s),s===null&&(s={});let o=s.lastModified===void 0?Date.now():Number(s.lastModified);Number.isNaN(o)||(this.#e=o),this.#t=String(r)}get name(){return this.#t}get lastModified(){return this.#e}get[Symbol.toStringTag](){return"File"}static[Symbol.hasInstance](t){return!!t&&t instanceof me&&/^(File)$/.test(t[Symbol.toStringTag])}},kd=xd,Ke=kd});function _l(n,t=me){var r=`${ml()}${ml()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),s=[],o=`--${r}\r Content-Disposition: form-data; name="`;return n.forEach((l,c)=>typeof l=="string"?s.push(o+Zi(c)+`"\r \r ${l.replace(/\r(?!\n)|(?{if(t.lengthtypeof t[r]!="function")}append(...t){ht("append",arguments,2),this.#e.push(bl(...t))}delete(t){ht("delete",arguments,1),t+="",this.#e=this.#e.filter(([r])=>r!==t)}get(t){ht("get",arguments,1),t+="";for(var r=this.#e,s=r.length,o=0;os[0]===t&&r.push(s[1])),r}has(t){return ht("has",arguments,1),t+="",this.#e.some(r=>r[0]===t)}forEach(t,r){ht("forEach",arguments,1);for(var[s,o]of this)t.call(r,o,s,this)}set(...t){ht("set",arguments,2);var r=[],s=!0;t=bl(...t),this.#e.forEach(o=>{o[0]===t[0]?s&&(s=!r.push(t)):r.push(o)}),s&&r.push(t),this.#e=r}*entries(){yield*this.#e}*keys(){for(var[t]of this)yield t}*values(){for(var[,t]of this)yield t}}});var De,yn=$(()=>{De=class extends Error{constructor(t,r){super(t),Error.captureStackTrace(this,this.constructor),this.type=r}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}}});var Q,es=$(()=>{yn();Q=class extends De{constructor(t,r,s){super(t,r),s&&(this.code=this.errno=s.code,this.erroredSysCall=s.syscall)}}});var gn,ts,ur,yl,gl,Sl,Sn=$(()=>{gn=Symbol.toStringTag,ts=n=>typeof n=="object"&&typeof n.append=="function"&&typeof n.delete=="function"&&typeof n.get=="function"&&typeof n.getAll=="function"&&typeof n.has=="function"&&typeof n.set=="function"&&typeof n.sort=="function"&&n[gn]==="URLSearchParams",ur=n=>n&&typeof n=="object"&&typeof n.arrayBuffer=="function"&&typeof n.type=="string"&&typeof n.stream=="function"&&typeof n.constructor=="function"&&/^(Blob|File)$/.test(n[gn]),yl=n=>typeof n=="object"&&(n[gn]==="AbortSignal"||n[gn]==="EventTarget"),gl=(n,t)=>{let r=new URL(t).hostname,s=new URL(n).hostname;return r===s||r.endsWith(`.${s}`)},Sl=(n,t)=>{let r=new URL(t).protocol,s=new URL(n).protocol;return r===s}});var vl=N((pp,wl)=>{if(!globalThis.DOMException)try{let{MessageChannel:n}=require("worker_threads"),t=new n().port1,r=new ArrayBuffer;t.postMessage(r,[r,r])}catch(n){n.constructor.name==="DOMException"&&(globalThis.DOMException=n.constructor)}wl.exports=globalThis.DOMException});var pt,El,Rl,rs,Tl,Cl,xl,kl,Pl,Al,wn,ns=$(()=>{pt=require("node:fs"),El=require("node:path"),Rl=V(vl(),1);Xi();ar();({stat:rs}=pt.promises),Tl=(n,t)=>Pl((0,pt.statSync)(n),n,t),Cl=(n,t)=>rs(n).then(r=>Pl(r,n,t)),xl=(n,t)=>rs(n).then(r=>Al(r,n,t)),kl=(n,t)=>Al((0,pt.statSync)(n),n,t),Pl=(n,t,r="")=>new me([new wn({path:t,size:n.size,lastModified:n.mtimeMs,start:0})],{type:r}),Al=(n,t,r="")=>new Ke([new wn({path:t,size:n.size,lastModified:n.mtimeMs,start:0})],(0,El.basename)(t),{type:r,lastModified:n.mtimeMs}),wn=class n{#e;#t;constructor(t){this.#e=t.path,this.#t=t.start,this.size=t.size,this.lastModified=t.lastModified}slice(t,r){return new n({path:this.#e,lastModified:this.lastModified,size:r-t,start:this.#t+t})}async*stream(){let{mtimeMs:t}=await rs(this.#e);if(t>this.lastModified)throw new Rl.default("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.","NotReadableError");yield*(0,pt.createReadStream)(this.#e,{start:this.#t,end:this.#t+this.size-1})}get[Symbol.toStringTag](){return"Blob"}}});var Bl={};pi(Bl,{toFormData:()=>Ud});function qd(n){let t=n.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!t)return;let r=t[2]||t[3]||"",s=r.slice(r.lastIndexOf("\\")+1);return s=s.replace(/%22/g,'"'),s=s.replace(/&#(\d{4});/g,(o,l)=>String.fromCharCode(l)),s}async function Ud(n,t){if(!/multipart/i.test(t))throw new TypeError("Failed to fetch");let r=t.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!r)throw new TypeError("no or bad content-type header, no multipart boundary");let s=new is(r[1]||r[2]),o,l,c,_,p,d,h=[],g=new Xe,v=k=>{c+=T.decode(k,{stream:!0})},P=k=>{h.push(k)},y=()=>{let k=new Ke(h,d,{type:p});g.append(_,k)},w=()=>{g.append(_,c)},T=new TextDecoder("utf-8");T.decode(),s.onPartBegin=function(){s.onPartData=v,s.onPartEnd=w,o="",l="",c="",_="",p="",d=null,h.length=0},s.onHeaderField=function(k){o+=T.decode(k,{stream:!0})},s.onHeaderValue=function(k){l+=T.decode(k,{stream:!0})},s.onHeaderEnd=function(){if(l+=T.decode(),o=o.toLowerCase(),o==="content-disposition"){let k=l.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);k&&(_=k[2]||k[3]||""),d=qd(l),d&&(s.onPartData=P,s.onPartEnd=y)}else o==="content-type"&&(p=l);l="",o=""};for await(let k of n)s.write(k);return s.end(),g}var we,U,Ol,Ze,vn,En,Bd,cr,Wd,Ld,Id,Dd,mt,is,Wl=$(()=>{ns();_n();we=0,U={START_BOUNDARY:we++,HEADER_FIELD_START:we++,HEADER_FIELD:we++,HEADER_VALUE_START:we++,HEADER_VALUE:we++,HEADER_VALUE_ALMOST_DONE:we++,HEADERS_ALMOST_DONE:we++,PART_DATA_START:we++,PART_DATA:we++,END:we++},Ol=1,Ze={PART_BOUNDARY:Ol,LAST_BOUNDARY:Ol*=2},vn=10,En=13,Bd=32,cr=45,Wd=58,Ld=97,Id=122,Dd=n=>n|32,mt=()=>{},is=class{constructor(t){this.index=0,this.flags=0,this.onHeaderEnd=mt,this.onHeaderField=mt,this.onHeadersEnd=mt,this.onHeaderValue=mt,this.onPartBegin=mt,this.onPartData=mt,this.onPartEnd=mt,this.boundaryChars={},t=`\r --`+t;let r=new Uint8Array(t.length);for(let s=0;s{this[O+"Mark"]=r},k=O=>{delete this[O+"Mark"]},L=(O,W,I,ue)=>{(W===void 0||W!==I)&&this[O](ue&&ue.subarray(W,I))},F=(O,W)=>{let I=O+"Mark";I in this&&(W?(L(O,this[I],r,t),delete this[I]):(L(O,this[I],t.length,t),this[I]=0))};for(r=0;rId)return;break;case U.HEADER_VALUE_START:if(y===Bd)break;T("onHeaderValue"),d=U.HEADER_VALUE;case U.HEADER_VALUE:y===En&&(F("onHeaderValue",!0),L("onHeaderEnd"),d=U.HEADER_VALUE_ALMOST_DONE);break;case U.HEADER_VALUE_ALMOST_DONE:if(y!==vn)return;d=U.HEADER_FIELD_START;break;case U.HEADERS_ALMOST_DONE:if(y!==vn)return;L("onHeadersEnd"),d=U.PART_DATA_START;break;case U.PART_DATA_START:d=U.PART_DATA,T("onPartData");case U.PART_DATA:if(o=p,p===0){for(r+=v;r0)l[p-1]=y;else if(o>0){let O=new Uint8Array(l.buffer,l.byteOffset,l.byteLength);L("onPartData",0,o,O),o=0,T("onPartData"),r--}break;case U.END:break;default:throw new Error(`Unexpected state entered: ${d}`)}F("onHeaderField"),F("onHeaderValue"),F("onPartData"),this.index=p,this.state=d,this.flags=h}end(){if(this.state===U.HEADER_FIELD_START&&this.index===0||this.state===U.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==U.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}}});async function ss(n){if(n[K].disturbed)throw new TypeError(`body used already for: ${n.url}`);if(n[K].disturbed=!0,n[K].error)throw n[K].error;let{body:t}=n;if(t===null)return te.Buffer.alloc(0);if(!(t instanceof le.default))return te.Buffer.alloc(0);let r=[],s=0;try{for await(let o of t){if(n.size>0&&s+o.length>n.size){let l=new Q(`content size at ${n.url} over limit: ${n.size}`,"max-size");throw t.destroy(l),l}s+=o.length,r.push(o)}}catch(o){throw o instanceof De?o:new Q(`Invalid response body while trying to fetch ${n.url}: ${o.message}`,"system",o)}if(t.readableEnded===!0||t._readableState.ended===!0)try{return r.every(o=>typeof o=="string")?te.Buffer.from(r.join("")):te.Buffer.concat(r,s)}catch(o){throw new Q(`Could not create Buffer from response body for ${n.url}: ${o.message}`,"system",o)}else throw new Q(`Premature close of server response while trying to fetch ${n.url}`)}var le,qe,te,Fd,K,ve,Wt,Nd,Rn,Ll,Il,Tn=$(()=>{le=V(require("node:stream"),1),qe=require("node:util"),te=require("node:buffer");ar();_n();es();yn();Sn();Fd=(0,qe.promisify)(le.default.pipeline),K=Symbol("Body internals"),ve=class{constructor(t,{size:r=0}={}){let s=null;t===null?t=null:ts(t)?t=te.Buffer.from(t.toString()):ur(t)||te.Buffer.isBuffer(t)||(qe.types.isAnyArrayBuffer(t)?t=te.Buffer.from(t):ArrayBuffer.isView(t)?t=te.Buffer.from(t.buffer,t.byteOffset,t.byteLength):t instanceof le.default||(t instanceof Xe?(t=_l(t),s=t.type.split("=")[1]):t=te.Buffer.from(String(t))));let o=t;te.Buffer.isBuffer(t)?o=le.default.Readable.from(t):ur(t)&&(o=le.default.Readable.from(t.stream())),this[K]={body:t,stream:o,boundary:s,disturbed:!1,error:null},this.size=r,t instanceof le.default&&t.on("error",l=>{let c=l instanceof De?l:new Q(`Invalid response body while trying to fetch ${this.url}: ${l.message}`,"system",l);this[K].error=c})}get body(){return this[K].stream}get bodyUsed(){return this[K].disturbed}async arrayBuffer(){let{buffer:t,byteOffset:r,byteLength:s}=await ss(this);return t.slice(r,r+s)}async formData(){let t=this.headers.get("content-type");if(t.startsWith("application/x-www-form-urlencoded")){let s=new Xe,o=new URLSearchParams(await this.text());for(let[l,c]of o)s.append(l,c);return s}let{toFormData:r}=await Promise.resolve().then(()=>(Wl(),Bl));return r(this.body,t)}async blob(){let t=this.headers&&this.headers.get("content-type")||this[K].body&&this[K].body.type||"",r=await this.arrayBuffer();return new me([r],{type:t})}async json(){let t=await this.text();return JSON.parse(t)}async text(){let t=await ss(this);return new TextDecoder().decode(t)}buffer(){return ss(this)}};ve.prototype.buffer=(0,qe.deprecate)(ve.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(ve.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,qe.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});Wt=(n,t)=>{let r,s,{body:o}=n[K];if(n.bodyUsed)throw new Error("cannot clone body after it is used");return o instanceof le.default&&typeof o.getBoundary!="function"&&(r=new le.PassThrough({highWaterMark:t}),s=new le.PassThrough({highWaterMark:t}),o.pipe(r),o.pipe(s),n[K].stream=r,o=s),o},Nd=(0,qe.deprecate)(n=>n.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),Rn=(n,t)=>n===null?null:typeof n=="string"?"text/plain;charset=UTF-8":ts(n)?"application/x-www-form-urlencoded;charset=UTF-8":ur(n)?n.type||null:te.Buffer.isBuffer(n)||qe.types.isAnyArrayBuffer(n)||ArrayBuffer.isView(n)?null:n instanceof Xe?`multipart/form-data; boundary=${t[K].boundary}`:n&&typeof n.getBoundary=="function"?`multipart/form-data;boundary=${Nd(n)}`:n instanceof le.default?null:"text/plain;charset=UTF-8",Ll=n=>{let{body:t}=n[K];return t===null?0:ur(t)?t.size:te.Buffer.isBuffer(t)?t.length:t&&typeof t.getLengthSync=="function"&&t.hasKnownLength&&t.hasKnownLength()?t.getLengthSync():null},Il=async(n,{body:t})=>{t===null?n.end():await Fd(t,n)}});function Dl(n=[]){return new X(n.reduce((t,r,s,o)=>(s%2===0&&t.push(o.slice(s,s+2)),t),[]).filter(([t,r])=>{try{return Cn(t),as(t,String(r)),!0}catch{return!1}}))}var os,fr,Cn,as,X,xn=$(()=>{os=require("node:util"),fr=V(require("node:http"),1),Cn=typeof fr.default.validateHeaderName=="function"?fr.default.validateHeaderName:n=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(n)){let t=new TypeError(`Header name must be a valid HTTP token [${n}]`);throw Object.defineProperty(t,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),t}},as=typeof fr.default.validateHeaderValue=="function"?fr.default.validateHeaderValue:(n,t)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(t)){let r=new TypeError(`Invalid character in header content ["${n}"]`);throw Object.defineProperty(r,"code",{value:"ERR_INVALID_CHAR"}),r}},X=class n extends URLSearchParams{constructor(t){let r=[];if(t instanceof n){let s=t.raw();for(let[o,l]of Object.entries(s))r.push(...l.map(c=>[o,c]))}else if(t!=null)if(typeof t=="object"&&!os.types.isBoxedPrimitive(t)){let s=t[Symbol.iterator];if(s==null)r.push(...Object.entries(t));else{if(typeof s!="function")throw new TypeError("Header pairs must be iterable");r=[...t].map(o=>{if(typeof o!="object"||os.types.isBoxedPrimitive(o))throw new TypeError("Each header pair must be an iterable object");return[...o]}).map(o=>{if(o.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...o]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence> or record)");return r=r.length>0?r.map(([s,o])=>(Cn(s),as(s,String(o)),[String(s).toLowerCase(),String(o)])):void 0,super(r),new Proxy(this,{get(s,o,l){switch(o){case"append":case"set":return(c,_)=>(Cn(c),as(c,String(_)),URLSearchParams.prototype[o].call(s,String(c).toLowerCase(),String(_)));case"delete":case"has":case"getAll":return c=>(Cn(c),URLSearchParams.prototype[o].call(s,String(c).toLowerCase()));case"keys":return()=>(s.sort(),new Set(URLSearchParams.prototype.keys.call(s)).keys());default:return Reflect.get(s,o,l)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(t){let r=this.getAll(t);if(r.length===0)return null;let s=r.join(", ");return/^content-encoding$/i.test(t)&&(s=s.toLowerCase()),s}forEach(t,r=void 0){for(let s of this.keys())Reflect.apply(t,r,[this.get(s),s,this])}*values(){for(let t of this.keys())yield this.get(t)}*entries(){for(let t of this.keys())yield[t,this.get(t)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((t,r)=>(t[r]=this.getAll(r),t),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((t,r)=>{let s=this.getAll(r);return r==="host"?t[r]=s[0]:t[r]=s.length>1?s:s[0],t},{})}};Object.defineProperties(X.prototype,["get","entries","forEach","values"].reduce((n,t)=>(n[t]={enumerable:!0},n),{}))});var Md,dr,ls=$(()=>{Md=new Set([301,302,303,307,308]),dr=n=>Md.has(n)});var be,re,ql=$(()=>{xn();Tn();ls();be=Symbol("Response internals"),re=class n extends ve{constructor(t=null,r={}){super(t,r);let s=r.status!=null?r.status:200,o=new X(r.headers);if(t!==null&&!o.has("Content-Type")){let l=Rn(t,this);l&&o.append("Content-Type",l)}this[be]={type:"default",url:r.url,status:s,statusText:r.statusText||"",headers:o,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[be].type}get url(){return this[be].url||""}get status(){return this[be].status}get ok(){return this[be].status>=200&&this[be].status<300}get redirected(){return this[be].counter>0}get statusText(){return this[be].statusText}get headers(){return this[be].headers}get highWaterMark(){return this[be].highWaterMark}clone(){return new n(Wt(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(t,r=302){if(!dr(r))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new n(null,{headers:{location:new URL(t).toString()},status:r})}static error(){let t=new n(null,{status:0,statusText:""});return t[be].type="error",t}static json(t=void 0,r={}){let s=JSON.stringify(t);if(s===void 0)throw new TypeError("data is not JSON serializable");let o=new X(r&&r.headers);return o.has("content-type")||o.set("content-type","application/json"),new n(s,{...r,headers:o})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(re.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})});var Ul,Fl=$(()=>{Ul=n=>{if(n.search)return n.search;let t=n.href.length-1,r=n.hash||(n.href[t]==="#"?"#":"");return n.href[t-r.length]==="?"?"?":""}});function Nl(n,t=!1){return n==null||(n=new URL(n),/^(about|blob|data):$/.test(n.protocol))?"no-referrer":(n.username="",n.password="",n.hash="",t&&(n.pathname="",n.search=""),n)}function zl(n){if(!$l.has(n))throw new TypeError(`Invalid referrerPolicy: ${n}`);return n}function $d(n){if(/^(http|ws)s:$/.test(n.protocol))return!0;let t=n.host.replace(/(^\[)|(]$)/g,""),r=(0,Ml.isIP)(t);return r===4&&/^127\./.test(t)||r===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(t)?!0:n.host==="localhost"||n.host.endsWith(".localhost")?!1:n.protocol==="file:"}function Lt(n){return/^about:(blank|srcdoc)$/.test(n)||n.protocol==="data:"||/^(blob|filesystem):$/.test(n.protocol)?!0:$d(n)}function Vl(n,{referrerURLCallback:t,referrerOriginCallback:r}={}){if(n.referrer==="no-referrer"||n.referrerPolicy==="")return null;let s=n.referrerPolicy;if(n.referrer==="about:client")return"no-referrer";let o=n.referrer,l=Nl(o),c=Nl(o,!0);l.toString().length>4096&&(l=c),t&&(l=t(l)),r&&(c=r(c));let _=new URL(n.url);switch(s){case"no-referrer":return"no-referrer";case"origin":return c;case"unsafe-url":return l;case"strict-origin":return Lt(l)&&!Lt(_)?"no-referrer":c.toString();case"strict-origin-when-cross-origin":return l.origin===_.origin?l:Lt(l)&&!Lt(_)?"no-referrer":c;case"same-origin":return l.origin===_.origin?l:"no-referrer";case"origin-when-cross-origin":return l.origin===_.origin?l:c;case"no-referrer-when-downgrade":return Lt(l)&&!Lt(_)?"no-referrer":l;default:throw new TypeError(`Invalid referrerPolicy: ${s}`)}}function Hl(n){let t=(n.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let s of t)s&&$l.has(s)&&(r=s);return r}var Ml,$l,jl,us=$(()=>{Ml=require("node:net");$l=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),jl="strict-origin-when-cross-origin"});var Gl,Yl,j,hr,jd,et,Ql,Jl=$(()=>{Gl=require("node:url"),Yl=require("node:util");xn();Tn();Sn();Fl();us();j=Symbol("Request internals"),hr=n=>typeof n=="object"&&typeof n[j]=="object",jd=(0,Yl.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),et=class n extends ve{constructor(t,r={}){let s;if(hr(t)?s=new URL(t.url):(s=new URL(t),t={}),s.username!==""||s.password!=="")throw new TypeError(`${s} is an url with embedded credentials.`);let o=r.method||t.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(o)&&(o=o.toUpperCase()),!hr(r)&&"data"in r&&jd(),(r.body!=null||hr(t)&&t.body!==null)&&(o==="GET"||o==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let l=r.body?r.body:hr(t)&&t.body!==null?Wt(t):null;super(l,{size:r.size||t.size||0});let c=new X(r.headers||t.headers||{});if(l!==null&&!c.has("Content-Type")){let d=Rn(l,this);d&&c.set("Content-Type",d)}let _=hr(t)?t.signal:null;if("signal"in r&&(_=r.signal),_!=null&&!yl(_))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let p=r.referrer==null?t.referrer:r.referrer;if(p==="")p="no-referrer";else if(p){let d=new URL(p);p=/^about:(\/\/)?client$/.test(d)?"client":d}else p=void 0;this[j]={method:o,redirect:r.redirect||t.redirect||"follow",headers:c,parsedURL:s,signal:_,referrer:p},this.follow=r.follow===void 0?t.follow===void 0?20:t.follow:r.follow,this.compress=r.compress===void 0?t.compress===void 0?!0:t.compress:r.compress,this.counter=r.counter||t.counter||0,this.agent=r.agent||t.agent,this.highWaterMark=r.highWaterMark||t.highWaterMark||16384,this.insecureHTTPParser=r.insecureHTTPParser||t.insecureHTTPParser||!1,this.referrerPolicy=r.referrerPolicy||t.referrerPolicy||""}get method(){return this[j].method}get url(){return(0,Gl.format)(this[j].parsedURL)}get headers(){return this[j].headers}get redirect(){return this[j].redirect}get signal(){return this[j].signal}get referrer(){if(this[j].referrer==="no-referrer")return"";if(this[j].referrer==="client")return"about:client";if(this[j].referrer)return this[j].referrer.toString()}get referrerPolicy(){return this[j].referrerPolicy}set referrerPolicy(t){this[j].referrerPolicy=zl(t)}clone(){return new n(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(et.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}});Ql=n=>{let{parsedURL:t}=n[j],r=new X(n[j].headers);r.has("Accept")||r.set("Accept","*/*");let s=null;if(n.body===null&&/^(post|put)$/i.test(n.method)&&(s="0"),n.body!==null){let _=Ll(n);typeof _=="number"&&!Number.isNaN(_)&&(s=String(_))}s&&r.set("Content-Length",s),n.referrerPolicy===""&&(n.referrerPolicy=jl),n.referrer&&n.referrer!=="no-referrer"?n[j].referrer=Vl(n):n[j].referrer="no-referrer",n[j].referrer instanceof URL&&r.set("Referer",n.referrer),r.has("User-Agent")||r.set("User-Agent","node-fetch"),n.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip, deflate, br");let{agent:o}=n;typeof o=="function"&&(o=o(t));let l=Ul(t),c={path:t.pathname+l,method:n.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:n.insecureHTTPParser,agent:o};return{parsedURL:t,options:c}}});var pr,Kl=$(()=>{yn();pr=class extends De{constructor(t,r="aborted"){super(t,r)}}});var eu={};pi(eu,{AbortError:()=>pr,Blob:()=>me,FetchError:()=>Q,File:()=>Ke,FormData:()=>Xe,Headers:()=>X,Request:()=>et,Response:()=>re,blobFrom:()=>Cl,blobFromSync:()=>Tl,default:()=>cs,fileFrom:()=>xl,fileFromSync:()=>kl,isRedirect:()=>dr});async function cs(n,t){return new Promise((r,s)=>{let o=new et(n,t),{parsedURL:l,options:c}=Ql(o);if(!zd.has(l.protocol))throw new TypeError(`node-fetch cannot load ${n}. URL scheme "${l.protocol.replace(/:$/,"")}" is not supported.`);if(l.protocol==="data:"){let y=ll(o.url),w=new re(y,{headers:{"Content-Type":y.typeFull}});r(w);return}let _=(l.protocol==="https:"?Zl.default:Xl.default).request,{signal:p}=o,d=null,h=()=>{let y=new pr("The operation was aborted.");s(y),o.body&&o.body instanceof ne.default.Readable&&o.body.destroy(y),!(!d||!d.body)&&d.body.emit("error",y)};if(p&&p.aborted){h();return}let g=()=>{h(),P()},v=_(l.toString(),c);p&&p.addEventListener("abort",g);let P=()=>{v.abort(),p&&p.removeEventListener("abort",g)};v.on("error",y=>{s(new Q(`request to ${o.url} failed, reason: ${y.message}`,"system",y)),P()}),Vd(v,y=>{d&&d.body&&d.body.destroy(y)}),process.version<"v14"&&v.on("socket",y=>{let w;y.prependListener("end",()=>{w=y._eventsCount}),y.prependListener("close",T=>{if(d&&w{v.setTimeout(0);let w=Dl(y.rawHeaders);if(dr(y.statusCode)){let O=w.get("Location"),W=null;try{W=O===null?null:new URL(O,o.url)}catch{if(o.redirect!=="manual"){s(new Q(`uri requested responds with an invalid redirect URL: ${O}`,"invalid-redirect")),P();return}}switch(o.redirect){case"error":s(new Q(`uri requested responds with a redirect, redirect mode is set to error: ${o.url}`,"no-redirect")),P();return;case"manual":break;case"follow":{if(W===null)break;if(o.counter>=o.follow){s(new Q(`maximum redirect reached at: ${o.url}`,"max-redirect")),P();return}let I={headers:new X(o.headers),follow:o.follow,counter:o.counter+1,agent:o.agent,compress:o.compress,method:o.method,body:Wt(o),signal:o.signal,size:o.size,referrer:o.referrer,referrerPolicy:o.referrerPolicy};if(!gl(o.url,W)||!Sl(o.url,W))for(let Ee of["authorization","www-authenticate","cookie","cookie2"])I.headers.delete(Ee);if(y.statusCode!==303&&o.body&&t.body instanceof ne.default.Readable){s(new Q("Cannot follow redirect with body being a readable stream","unsupported-redirect")),P();return}(y.statusCode===303||(y.statusCode===301||y.statusCode===302)&&o.method==="POST")&&(I.method="GET",I.body=void 0,I.headers.delete("content-length"));let ue=Hl(w);ue&&(I.referrerPolicy=ue),r(cs(new et(W,I))),P();return}default:return s(new TypeError(`Redirect option '${o.redirect}' is not a valid value of RequestRedirect`))}}p&&y.once("end",()=>{p.removeEventListener("abort",g)});let T=(0,ne.pipeline)(y,new ne.PassThrough,O=>{O&&s(O)});process.version<"v12.10"&&y.on("aborted",g);let k={url:o.url,status:y.statusCode,statusText:y.statusMessage,headers:w,size:o.size,counter:o.counter,highWaterMark:o.highWaterMark},L=w.get("Content-Encoding");if(!o.compress||o.method==="HEAD"||L===null||y.statusCode===204||y.statusCode===304){d=new re(T,k),r(d);return}let F={flush:bt.default.Z_SYNC_FLUSH,finishFlush:bt.default.Z_SYNC_FLUSH};if(L==="gzip"||L==="x-gzip"){T=(0,ne.pipeline)(T,bt.default.createGunzip(F),O=>{O&&s(O)}),d=new re(T,k),r(d);return}if(L==="deflate"||L==="x-deflate"){let O=(0,ne.pipeline)(y,new ne.PassThrough,W=>{W&&s(W)});O.once("data",W=>{(W[0]&15)===8?T=(0,ne.pipeline)(T,bt.default.createInflate(),I=>{I&&s(I)}):T=(0,ne.pipeline)(T,bt.default.createInflateRaw(),I=>{I&&s(I)}),d=new re(T,k),r(d)}),O.once("end",()=>{d||(d=new re(T,k),r(d))});return}if(L==="br"){T=(0,ne.pipeline)(T,bt.default.createBrotliDecompress(),O=>{O&&s(O)}),d=new re(T,k),r(d);return}d=new re(T,k),r(d)}),Il(v,o).catch(s)})}function Vd(n,t){let r=mr.Buffer.from(`0\r \r -`),s=!1,o=!1,l;n.on("response",c=>{let{headers:_}=c;s=_["transfer-encoding"]==="chunked"&&!_["content-length"]}),n.on("socket",c=>{let _=()=>{if(s&&!o){let d=new Error("Premature close");d.code="ERR_STREAM_PREMATURE_CLOSE",t(d)}},p=d=>{o=mr.Buffer.compare(d.slice(-5),r)===0,!o&&l&&(o=mr.Buffer.compare(l.slice(-3),r.slice(0,3))===0&&mr.Buffer.compare(d.slice(-2),r.slice(3))===0),l=d};c.prependListener("close",_),c.on("data",p),n.on("close",()=>{c.removeListener("close",_),c.removeListener("data",p)})})}var Xl,Zl,bt,ne,mr,zd,tu=$(()=>{Xl=V(require("node:http"),1),Zl=V(require("node:https"),1),bt=V(require("node:zlib"),1),ne=V(require("node:stream"),1),mr=require("node:buffer");ul();Tn();ql();xn();Jl();es();Kl();ls();_n();Sn();us();ns();zd=new Set(["data:","http:","https:"])});var Yd={};pi(Yd,{activate:()=>Hd,deactivate:()=>Gd});module.exports=Kc(Yd);var Lo=V(require("vscode"));var he=require("vscode");var Ao=require("vscode");function Gr(n,t,r){return n.asWebviewUri(Ao.Uri.joinPath(t,...r))}function Oo(){let n="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let r=0;r<32;r++)n+=t.charAt(Math.floor(Math.random()*t.length));return n}var Y=class n{constructor(t,r){this.extensionUris=[];this.disposables=[];n.context?(this.extensionUri=n.context.extensionUri,this.extensionUris=[he.Uri.joinPath(n.context.extensionUri,"out"),he.Uri.joinPath(n.context.extensionUri,"webview-ui/build"),he.Uri.joinPath(n.context.extensionUri,"assets"),he.Uri.joinPath(n.context.extensionUri,"webview-ui/node_modules/@vscode/codicons/dist")]):(console.log("Error: BaseWebview.constructor called before activate()"),this.extensionUri=he.Uri.parse("file:///undefined")),this.key=t,this.title=r,n.instances[t]=this}static{this.instances={}}static setBackendSyncMessageCallback(t){n.backendSyncMessageCallback=t}getWebview(){return this.panel?this.panel.webview:this.webview}getPanel(){return this.panel}getKey(){return this.key}getTitle(){return this.title}static activate(t){n.context=t,n.backendSyncMessageCallback=r=>{console.error(`BaseWebview.backendSyncMessageCallback() called before set for message: ${JSON.stringify(r)}`)}}static deactivate(){console.log("Webview Deactivate called");for(let t in n.instances){let r=n.instances[t];r.panel=void 0,r.webview=void 0}n.instances={},n.context=void 0}resolveWebviewView(t,r,s){this.webview=t.webview,t.webview.options={enableScripts:!0,localResourceRoots:this.extensionUris},t.webview.html=this._getWebviewContent(),t.webview.onDidReceiveMessage(o=>{this.handleMessage(o),n.backendSyncMessageCallback?.(o)},void 0,this.disposables)}renderPanel(){this.panel!==void 0?(this.panel.reveal(he.ViewColumn.One),console.log("BaseWebview render_panel reveal() called")):(console.log("BaseWebview render_panel called"),this.panel=he.window.createWebviewPanel(this.key,this.title,he.ViewColumn.One,{enableScripts:!0,localResourceRoots:this.extensionUris,retainContextWhenHidden:!0}),this.panel.onDidDispose(()=>this.dispose(),null,this.disposables),this.panel.webview.html=this._getWebviewContent(),this.panel.webview.onDidReceiveMessage(t=>{this.handleMessage(t),n.backendSyncMessageCallback?.(t)},void 0,this.disposables))}dispose(){for(this.panel&&(this.panel.dispose(),this.panel=void 0),this.webview&&(this.webview=void 0);this.disposables.length;){let t=this.disposables.pop();t&&t.dispose()}}_getWebviewContent(){let t=this.getWebview();if(!t)return"Error: Missing webview instance";let r=Gr(t,this.extensionUri,["webview-ui","build","assets","index.css"]),s=Gr(t,this.extensionUri,["webview-ui","build","assets","index.js"]),o=Gr(t,this.extensionUri,["webview-ui","node_modules","@vscode/codicons","dist","codicon.css"]),l=Oo(),c=t.cspSource;return` +`),s=!1,o=!1,l;n.on("response",c=>{let{headers:_}=c;s=_["transfer-encoding"]==="chunked"&&!_["content-length"]}),n.on("socket",c=>{let _=()=>{if(s&&!o){let d=new Error("Premature close");d.code="ERR_STREAM_PREMATURE_CLOSE",t(d)}},p=d=>{o=mr.Buffer.compare(d.slice(-5),r)===0,!o&&l&&(o=mr.Buffer.compare(l.slice(-3),r.slice(0,3))===0&&mr.Buffer.compare(d.slice(-2),r.slice(3))===0),l=d};c.prependListener("close",_),c.on("data",p),n.on("close",()=>{c.removeListener("close",_),c.removeListener("data",p)})})}var Xl,Zl,bt,ne,mr,zd,tu=$(()=>{Xl=V(require("node:http"),1),Zl=V(require("node:https"),1),bt=V(require("node:zlib"),1),ne=V(require("node:stream"),1),mr=require("node:buffer");ul();Tn();ql();xn();Jl();es();Kl();ls();_n();Sn();us();ns();zd=new Set(["data:","http:","https:"])});var Yd={};pi(Yd,{activate:()=>Hd,deactivate:()=>Gd});module.exports=Kc(Yd);var Lo=V(require("vscode"));var he=require("vscode");var Ao=require("vscode");function Gr(n,t,r){return n.asWebviewUri(Ao.Uri.joinPath(t,...r))}function Oo(){let n="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let r=0;r<32;r++)n+=t.charAt(Math.floor(Math.random()*t.length));return n}var H=class n{constructor(t,r){this.extensionUris=[];this.disposables=[];n.context?(this.extensionUri=n.context.extensionUri,this.extensionUris=[he.Uri.joinPath(n.context.extensionUri,"out"),he.Uri.joinPath(n.context.extensionUri,"webview-ui/build"),he.Uri.joinPath(n.context.extensionUri,"assets"),he.Uri.joinPath(n.context.extensionUri,"webview-ui/node_modules/@vscode/codicons/dist")]):(console.log("Error: BaseWebview.constructor called before activate()"),this.extensionUri=he.Uri.parse("file:///undefined")),this.key=t,this.title=r,n.instances[t]=this}static{this.instances={}}static setBackendSyncMessageCallback(t){n.backendSyncMessageCallback=t}getWebview(){return this.panel?this.panel.webview:this.webview}getPanel(){return this.panel}getKey(){return this.key}getTitle(){return this.title}static activate(t){n.context=t,n.backendSyncMessageCallback=r=>{console.error(`BaseWebview.backendSyncMessageCallback() called before set for message: ${JSON.stringify(r)}`)}}static deactivate(){console.log("Webview Deactivate called");for(let t in n.instances){let r=n.instances[t];r.panel=void 0,r.webview=void 0}n.instances={},n.context=void 0}resolveWebviewView(t,r,s){this.webview=t.webview,t.webview.options={enableScripts:!0,localResourceRoots:this.extensionUris},t.webview.html=this._getWebviewContent(),t.webview.onDidReceiveMessage(o=>{this.handleMessage(o),n.backendSyncMessageCallback?.(o)},void 0,this.disposables)}renderPanel(){this.panel!==void 0?(this.panel.reveal(he.ViewColumn.One),console.log("BaseWebview render_panel reveal() called")):(console.log("BaseWebview render_panel called"),this.panel=he.window.createWebviewPanel(this.key,this.title,he.ViewColumn.One,{enableScripts:!0,localResourceRoots:this.extensionUris,retainContextWhenHidden:!0}),this.panel.onDidDispose(()=>this.dispose(),null,this.disposables),this.panel.webview.html=this._getWebviewContent(),this.panel.webview.onDidReceiveMessage(t=>{this.handleMessage(t),n.backendSyncMessageCallback?.(t)},void 0,this.disposables))}dispose(){for(this.panel&&(this.panel.dispose(),this.panel=void 0),this.webview&&(this.webview=void 0);this.disposables.length;){let t=this.disposables.pop();t&&t.dispose()}}_getWebviewContent(){let t=this.getWebview();if(!t)return"Error: Missing webview instance";let r=Gr(t,this.extensionUri,["webview-ui","build","assets","index.css"]).toString(),s=Gr(t,this.extensionUri,["webview-ui","build","assets","index.js"]).toString(),o=Gr(t,this.extensionUri,["webview-ui","node_modules","@vscode/codicons","dist","codicon.css"]).toString(),l=Oo(),c=t.cspSource;return` @@ -39,8 +39,8 @@ Content-Type: ${l.type||"application/octet-stream"}\r - `}handleMessage(t){}postMessage(t){if(n.context===void 0){console.log("Warning: postMessage() called on deactivated view");return}this.panel?this.panel.webview.postMessage(t):this.webview&&this.webview.postMessage(t)}static broadcastMessage(t){for(let r in n.instances)n.instances[r].postMessage(t)}static postMessageTo(t,r){let s=n.instances[t];s&&s.postMessage(r)}};var mi=class{constructor(){this.loaded=!1;this.uiSelectedContext="DSUI";this.uiSelectedContextCallback=t=>{}}serialize(){return JSON.stringify(this,(t,r)=>{if(t!=="uiSelectedContextCallback")return r})}deserialize(t){let r=JSON.parse(t),s=!1;r.uiSelectedContextCallback!==this.uiSelectedContextCallback&&(s=!0),Object.assign(this,r),s&&this.uiSelectedContextCallback(this.uiSelectedContext)}},Pt=class n{static getInstance(){return n.instance||(n.instance=new n),n.instance}constructor(){this.globalStates=new mi}static activate(){if(console.log("SuibaseData.activateForExtension() called"),n.instance){console.log("Error: SuibaseData.activate() called more than once");return}n.getInstance()}static deactivate(){n.instance?(delete n.instance,n.instance=void 0):console.log("Error: SuibaseData.deactivate() called out of order")}};var ut=["mainnet","testnet","devnet","localnet"];var Bo="http://0.0.0.0:44399",Yr="suibase.dashboard",Qr="suibase.console",Wo="suibase.explorer",bi="suibase.backend";var Ht=class n extends Y{constructor(){super(Wo,"Sui Sidebar")}static activate(t){if(console.log("SuibaseSidebar.activate() called"),n.instance){console.log("Error: SuibaseSidebar.activate() called more than once");return}n.instance=new n;let r=Lo.window.registerWebviewViewProvider("explorerView",n.instance,{webviewOptions:{retainContextWhenHidden:!0}});t.subscriptions.push(r)}static deactivate(){n.instance?(n.instance.dispose(),delete n.instance,n.instance=void 0):console.log("Error: SuibaseSidebar.deactivate() called out of order")}dispose(){console.log("SuibaseSidebar.dispose() called"),n.instance?(super.dispose(),delete n.instance,n.instance=void 0):console.log("Error: dispose() called out of order")}handleMessage(t){let r=Pt.getInstance();switch(t.type){case"init-view":super.postMessage({type:"init-global-states",message:r.globalStates.serialize()});break}}};var ol=V(require("child_process"));var _d=V(Uo(),1),yd=V(qi(),1),gd=V(Fi(),1),il=V(Hi(),1),Sd=V(nl(),1);var sl=il.default;var Yi=n=>new Promise((t,r)=>{ol.exec(n,(s,o)=>s?r(s):t(o))}),nr=class n{constructor(){this.cache={};this.ws=new sl("ws://localhost:44399"),this.ws.on("open",()=>{console.log("WebSocket connection opened")}),this.ws.on("close",()=>{console.log("WebSocket connection closed")}),this.ws.on("message",t=>{let r=JSON.parse(t);this.cache.response=r.result,console.log(r.result)})}dispose(){this.ws&&(this.ws.close(),delete this.ws,this.ws=void 0)}static activate(t){if(n.context){console.log("Error: SuibaseExec.activate() called more than once");return}n.context=t,n.instance=new n}static deactivate(){n.instance?(n.instance.dispose(),delete n.instance,n.instance=void 0):console.log("Error: SuibaseExec.deactivate() called out of order"),n.context=void 0}static getInstance(){return n.instance||console.log("Error: SuibaseExec.getInstance() called before activate()"),n.instance}async version(){try{let t=await Yi("localnet --version");return console.log(t),Promise.resolve(t)}catch(t){return Promise.reject(t)}}async startDaemon(){let t=!1;try{let s=(await Yi("lsof /tmp/.suibase/suibase-daemon.lock")).split(` -`);for(let o=0;osetTimeout(s,500))}}makeJsonRpcCall(){let t=n.getInstance();if(t&&t.ws){let r={jsonrpc:"2.0",method:"getLinks",params:{workdir:"localnet"},id:1};t.ws.send(JSON.stringify(r))}}async getLinks(){try{return this.makeJsonRpcCall(),Promise.resolve("sent")}catch(t){return Promise.reject(t)}}};var ir=V(require("vscode"));var un=class n extends Y{constructor(){super(Yr,"Suibase Dashboard")}static render(){n.instance||(n.instance=new n),n.instance.renderPanel()}dispose(){n.instance?(super.dispose(),delete n.instance,n.instance=void 0):console.log("Error: dispose() called out of order")}handleMessage(t){}};var cn=class n extends Y{constructor(){super(Qr,"Sui Console")}static render(){n.instance||(n.instance=new n),n.instance.renderPanel()}dispose(){console.log("ConsolePanel.dispose() called"),n.instance?(super.dispose(),delete n.instance,n.instance=void 0):console.log("Error: dispose() called out of order")}};var sr=class n{constructor(){}dispose(){}static activate(t){if(n.instance){console.error("SuibaseCommands.activate() called more than once");return}n.context=t,n.instance=new n;{let r=ir.commands.registerCommand(Yr,()=>{n.getInstance()?.settings()});t.subscriptions.push(r)}{let r=ir.commands.registerCommand(Qr,()=>{n.getInstance()?.console()});t.subscriptions.push(r)}{let r=ir.commands.registerCommand("suibase.refresh",()=>{n.getInstance()?.refresh()});t.subscriptions.push(r)}setInterval(()=>{ir.commands.executeCommand("suibase.refresh")},3e3)}static deactivate(){n.instance?(n.instance.dispose(),delete n.instance,n.instance=void 0):console.log("Error: SuibaseCommands.deactivate() called out of order"),n.context=void 0}static getInstance(){if(!n.instance){console.log("Error: SuibaseCommands.getInstance() called before activate()");return}return n.instance}refresh(t){}settings(){n.context&&un.render()}console(){n.context&&cn.render()}};var Gh=new Error("timeout while waiting for mutex to become available"),Yh=new Error("mutex already locked"),wd=new Error("request for lock canceled"),vd=function(n,t,r,s){function o(l){return l instanceof r?l:new r(function(c){c(l)})}return new(r||(r=Promise))(function(l,c){function _(h){try{d(s.next(h))}catch(g){c(g)}}function p(h){try{d(s.throw(h))}catch(g){c(g)}}function d(h){h.done?l(h.value):o(h.value).then(_,p)}d((s=s.apply(n,t||[])).next())})},Qi=class{constructor(t,r=wd){this._value=t,this._cancelError=r,this._queue=[],this._weightedWaiters=[]}acquire(t=1,r=0){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);return new Promise((s,o)=>{let l={resolve:s,reject:o,weight:t,priority:r},c=al(this._queue,_=>r<=_.priority);c===-1&&t<=this._value?this._dispatchItem(l):this._queue.splice(c+1,0,l)})}runExclusive(t){return vd(this,arguments,void 0,function*(r,s=1,o=0){let[l,c]=yield this.acquire(s,o);try{return yield r(l)}finally{c()}})}waitForUnlock(t=1,r=0){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);return this._couldLockImmediately(t,r)?Promise.resolve():new Promise(s=>{this._weightedWaiters[t-1]||(this._weightedWaiters[t-1]=[]),Ed(this._weightedWaiters[t-1],{resolve:s,priority:r})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(t){this._value=t,this._dispatchQueue()}release(t=1){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);this._value+=t,this._dispatchQueue()}cancel(){this._queue.forEach(t=>t.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(t){let r=this._value;this._value-=t.weight,t.resolve([r,this._newReleaser(t.weight)])}_newReleaser(t){let r=!1;return()=>{r||(r=!0,this.release(t))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let t=this._value;t>0;t--){let r=this._weightedWaiters[t-1];r&&(r.forEach(s=>s.resolve()),this._weightedWaiters[t-1]=[])}else{let t=this._queue[0].priority;for(let r=this._value;r>0;r--){let s=this._weightedWaiters[r-1];if(!s)continue;let o=s.findIndex(l=>l.priority<=t);(o===-1?s:s.splice(0,o)).forEach(l=>l.resolve())}}}_couldLockImmediately(t,r){return(this._queue.length===0||this._queue[0].priorityt.priority<=s.priority);n.splice(r+1,0,t)}function al(n,t){for(let r=n.length-1;r>=0;r--)if(t(n[r]))return r;return-1}var Rd=function(n,t,r,s){function o(l){return l instanceof r?l:new r(function(c){c(l)})}return new(r||(r=Promise))(function(l,c){function _(h){try{d(s.next(h))}catch(g){c(g)}}function p(h){try{d(s.throw(h))}catch(g){c(g)}}function d(h){h.done?l(h.value):o(h.value).then(_,p)}d((s=s.apply(n,t||[])).next())})},fn=class{constructor(t){this._semaphore=new Qi(1,t)}acquire(){return Rd(this,arguments,void 0,function*(t=0){let[,r]=yield this._semaphore.acquire(1,t);return r})}runExclusive(t,r=0){return this._semaphore.runExclusive(()=>t(),1,r)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(t=0){return this._semaphore.waitForUnlock(1,t)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}};var dn=class{constructor(t,r){this.name=t,this.sender=r}},hn=class extends dn{constructor(t,r,s){super("UpdateVersions",t),this.workdirIdx=r,this.json=s}},pn=class extends dn{constructor(t,r,s){super("UpdateWorkdirStatus",t),this.workdirIdx=r,this.json=s}};var or=class{constructor(){this.method="",this.methodUuid="",this.dataUuid="",this.json=null}getMethod(){return this.method}getMethodUuid(){return this.methodUuid}getDataUuid(){return this.dataUuid}getJson(){return this.json}update(t){let r=t.header.method,s=t.header.methodUuid,o=t.header.dataUuid;return this.method!==""&&r!==this.method?(console.error(`Trying to update [${this.json.method}] using a JSON from [${r}]`),!1):this.json===null||this.methodUuid!==s||o>this.dataUuid?(this.method=r,this.methodUuid=s,this.dataUuid=o,this.json=t,this.deltaDetected(),!0):!1}deltaDetected(){}},mn=class extends or{isWorkdirStatusUpdateNeeded(t){try{let r=t===null||t.getJson()===null||t.getMethod()===""||t.getMethodUuid()===""||t.getDataUuid()==="";for(let s of this.getJson().versions)if(s.method==="getWorkdirStatus"){let o=s.methodUuid,l=s.dataUuid;if(r||t.getMethodUuid()!==o||t.getDataUuid(){n.sInstance&&n.sInstance.syncLoop()},1)),n.sInstance}get workdir(){return this.mWorkdir}handleViewMessage(t){try{if(t.name==="ForceVersionsRefresh"||t.name==="InitView")this.forceRefresh();else if(t.name==="WorkdirCommand"){let r="";t.workdirIdx>=0&&t.workdirIdxconsole.log(r))}async asyncLoop(t){await this.loopMutex.runExclusive(async()=>{this.update(t),t===!1&&setTimeout(()=>{this.syncLoop(t)},1e3)})}async fetchBackend(t,r={}){let s={"Content-Type":"application/json"},o={id:1,jsonrpc:"2.0",method:t,params:r};try{let c=await(await Promise.resolve().then(()=>(tu(),eu)).then(p=>p.default))(Bo,{method:"POST",headers:s,body:JSON.stringify(o)});if(!c.ok)throw new Error(`${t} ${r} not ok`);let _=await c.json();return n.validateHeader(_,t),_}catch(l){let c=`Error in fetchBackend ${t} ${r}: ${l}`;throw console.error(c),l}}async fetchGetVersions(t){return await this.fetchBackend("getVersions",{workdir:t})}async fetchGetWorkdirStatus(t){return await this.fetchBackend("getWorkdirStatus",{workdir:t})}async fetchWorkdirCommand(t,r){return await this.fetchBackend("workdirCommand",{workdir:t,command:r})}static validateHeader(t,r){if(t.jsonrpc!=="2.0")throw new Error("Invalid JSON-RPC version");if(t.result.header.method!==r)throw new Error("Invalid method")}async update(t){try{await this.updateUsingBackend(t)}catch{}}async updateUsingBackend(t){for(let r=0;r{}}serialize(){return JSON.stringify(this,(t,r)=>{if(t!=="uiSelectedContextCallback")return r})}deserialize(t){let r=JSON.parse(t),s=!1;r.uiSelectedContextCallback!==this.uiSelectedContextCallback&&(s=!0),Object.assign(this,r),s&&this.uiSelectedContextCallback(this.uiSelectedContext)}},Pt=class n{static getInstance(){return n.instance||(n.instance=new n),n.instance}constructor(){this.globalStates=new mi}static activate(){if(console.log("SuibaseData.activateForExtension() called"),n.instance){console.log("Error: SuibaseData.activate() called more than once");return}n.getInstance()}static deactivate(){n.instance?(delete n.instance,n.instance=void 0):console.log("Error: SuibaseData.deactivate() called out of order")}};var ut=["mainnet","testnet","devnet","localnet"];var Bo="http://0.0.0.0:44399",Yr="suibase.dashboard",Qr="suibase.console",Wo="suibase.explorer",Jr="suibase.backend";var Ht=class n extends H{constructor(){super(Wo,"Sui Sidebar")}static activate(t){if(console.log("SuibaseSidebar.activate() called"),n.instance){console.log("Error: SuibaseSidebar.activate() called more than once");return}n.instance=new n;let r=Lo.window.registerWebviewViewProvider("explorerView",n.instance,{webviewOptions:{retainContextWhenHidden:!0}});t.subscriptions.push(r)}static deactivate(){n.instance?(n.instance.dispose(),delete n.instance,n.instance=void 0):console.log("Error: SuibaseSidebar.deactivate() called out of order")}dispose(){console.log("SuibaseSidebar.dispose() called"),n.instance?(super.dispose(),delete n.instance,n.instance=void 0):console.log("Error: dispose() called out of order")}handleMessage(t){let r=Pt.getInstance();switch(t.type){case"init-view":super.postMessage({type:"init-global-states",message:r.globalStates.serialize()});break}}};var ol=V(require("child_process"));var _d=V(Uo(),1),yd=V(Di(),1),gd=V(Ui(),1),il=V(Vi(),1),Sd=V(nl(),1);var sl=il.default;var Gi=n=>new Promise((t,r)=>{ol.exec(n,(s,o)=>s?r(s):t(o))}),nr=class n{constructor(){this.cache={};this.ws=new sl("ws://localhost:44399"),this.ws.on("open",()=>{console.log("WebSocket connection opened")}),this.ws.on("close",()=>{console.log("WebSocket connection closed")}),this.ws.on("message",t=>{let r=JSON.parse(t);this.cache.response=r.result,console.log(r.result)})}dispose(){this.ws&&(this.ws.close(),delete this.ws,this.ws=void 0)}static activate(t){if(n.context){console.log("Error: SuibaseExec.activate() called more than once");return}n.context=t,n.instance=new n}static deactivate(){n.instance?(n.instance.dispose(),delete n.instance,n.instance=void 0):console.log("Error: SuibaseExec.deactivate() called out of order"),n.context=void 0}static getInstance(){return n.instance||console.log("Error: SuibaseExec.getInstance() called before activate()"),n.instance}async version(){try{let t=await Gi("localnet --version");return console.log(t),Promise.resolve(t)}catch(t){return Promise.reject(t)}}async startDaemon(){let t=!1;try{let s=(await Gi("lsof /tmp/.suibase/suibase-daemon.lock")).split(` +`);for(let o=0;osetTimeout(r,500)))}makeJsonRpcCall(){let t=n.getInstance();if(t&&t.ws){let r={jsonrpc:"2.0",method:"getLinks",params:{workdir:"localnet"},id:1};t.ws.send(JSON.stringify(r))}}async getLinks(){try{return this.makeJsonRpcCall(),Promise.resolve("sent")}catch(t){return Promise.reject(t)}}};var Yi=V(require("vscode"));var cn=class n extends H{constructor(){super(Yr,"Suibase Dashboard")}static render(){n.instance||(n.instance=new n),n.instance.renderPanel()}dispose(){n.instance?(super.dispose(),delete n.instance,n.instance=void 0):console.log("Error: dispose() called out of order")}handleMessage(t){}};var fn=class n extends H{constructor(){super(Qr,"Sui Console")}static render(){n.instance||(n.instance=new n),n.instance.renderPanel()}dispose(){console.log("ConsolePanel.dispose() called"),n.instance?(super.dispose(),delete n.instance,n.instance=void 0):console.log("Error: dispose() called out of order")}};var ir=class n{constructor(){}dispose(){}static activate(t){if(n.instance){console.error("SuibaseCommands.activate() called more than once");return}n.context=t,n.instance=new n;{let r=Yi.commands.registerCommand(Yr,()=>{n.getInstance()?.settings()});t.subscriptions.push(r)}{let r=Yi.commands.registerCommand(Qr,()=>{n.getInstance()?.console()});t.subscriptions.push(r)}}static deactivate(){n.instance?(n.instance.dispose(),delete n.instance,n.instance=void 0):console.log("Error: SuibaseCommands.deactivate() called out of order"),n.context=void 0}static getInstance(){if(!n.instance){console.log("Error: SuibaseCommands.getInstance() called before activate()");return}return n.instance}settings(){n.context&&cn.render()}console(){n.context&&fn.render()}};var Gh=new Error("timeout while waiting for mutex to become available"),Yh=new Error("mutex already locked"),wd=new Error("request for lock canceled"),vd=function(n,t,r,s){function o(l){return l instanceof r?l:new r(function(c){c(l)})}return new(r||(r=Promise))(function(l,c){function _(h){try{d(s.next(h))}catch(g){c(g)}}function p(h){try{d(s.throw(h))}catch(g){c(g)}}function d(h){h.done?l(h.value):o(h.value).then(_,p)}d((s=s.apply(n,t||[])).next())})},Qi=class{constructor(t,r=wd){this._value=t,this._cancelError=r,this._queue=[],this._weightedWaiters=[]}acquire(t=1,r=0){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);return new Promise((s,o)=>{let l={resolve:s,reject:o,weight:t,priority:r},c=al(this._queue,_=>r<=_.priority);c===-1&&t<=this._value?this._dispatchItem(l):this._queue.splice(c+1,0,l)})}runExclusive(t){return vd(this,arguments,void 0,function*(r,s=1,o=0){let[l,c]=yield this.acquire(s,o);try{return yield r(l)}finally{c()}})}waitForUnlock(t=1,r=0){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);return this._couldLockImmediately(t,r)?Promise.resolve():new Promise(s=>{this._weightedWaiters[t-1]||(this._weightedWaiters[t-1]=[]),Ed(this._weightedWaiters[t-1],{resolve:s,priority:r})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(t){this._value=t,this._dispatchQueue()}release(t=1){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);this._value+=t,this._dispatchQueue()}cancel(){this._queue.forEach(t=>t.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(t){let r=this._value;this._value-=t.weight,t.resolve([r,this._newReleaser(t.weight)])}_newReleaser(t){let r=!1;return()=>{r||(r=!0,this.release(t))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let t=this._value;t>0;t--){let r=this._weightedWaiters[t-1];r&&(r.forEach(s=>s.resolve()),this._weightedWaiters[t-1]=[])}else{let t=this._queue[0].priority;for(let r=this._value;r>0;r--){let s=this._weightedWaiters[r-1];if(!s)continue;let o=s.findIndex(l=>l.priority<=t);(o===-1?s:s.splice(0,o)).forEach(l=>l.resolve())}}}_couldLockImmediately(t,r){return(this._queue.length===0||this._queue[0].priorityt.priority<=s.priority);n.splice(r+1,0,t)}function al(n,t){for(let r=n.length-1;r>=0;r--)if(t(n[r]))return r;return-1}var Rd=function(n,t,r,s){function o(l){return l instanceof r?l:new r(function(c){c(l)})}return new(r||(r=Promise))(function(l,c){function _(h){try{d(s.next(h))}catch(g){c(g)}}function p(h){try{d(s.throw(h))}catch(g){c(g)}}function d(h){h.done?l(h.value):o(h.value).then(_,p)}d((s=s.apply(n,t||[])).next())})},dn=class{constructor(t){this._semaphore=new Qi(1,t)}acquire(){return Rd(this,arguments,void 0,function*(t=0){let[,r]=yield this._semaphore.acquire(1,t);return r})}runExclusive(t,r=0){return this._semaphore.runExclusive(()=>t(),1,r)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(t=0){return this._semaphore.waitForUnlock(1,t)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}};var hn=class{constructor(t,r){this.name=t,this.sender=r}},sr=class extends hn{constructor(t,r,s){super("UpdateVersions",t),this.workdirIdx=r,this.setupIssue=void 0,this.json=s}setSetupIssue(t){t===""?this.setupIssue=void 0:this.setupIssue=t}},pn=class extends hn{constructor(t,r,s){super("UpdateWorkdirStatus",t),this.workdirIdx=r,this.json=s}};var or=class{constructor(){this.method="",this.methodUuid="",this.dataUuid="",this.json=null}getMethod(){return this.method}getMethodUuid(){return this.methodUuid}getDataUuid(){return this.dataUuid}getJson(){return this.json}update(t){let r=t.header.method,s=t.header.methodUuid,o=t.header.dataUuid;return this.method!==""&&r!==this.method?(console.error(`Trying to update [${this.json.method}] using a JSON from [${r}]`),!1):this.json===null||this.methodUuid!==s||o>this.dataUuid?(this.method=r,this.methodUuid=s,this.dataUuid=o,this.json=t,this.deltaDetected(),!0):!1}deltaDetected(){}},mn=class extends or{isWorkdirStatusUpdateNeeded(t){try{let r=t===null||t.getJson()===null||t.getMethod()===""||t.getMethodUuid()===""||t.getDataUuid()==="";for(let s of this.getJson().versions)if(s.method==="getWorkdirStatus"){let o=s.methodUuid,l=s.dataUuid;if(r||t.getMethodUuid()!==o||t.getDataUuid(){n.sInstance&&n.sInstance.syncLoop()},1)),n.sInstance}get workdir(){return this.mWorkdir}handleViewMessage(t){try{if(t.name==="ForceVersionsRefresh"||t.name==="InitView")this.forceRefresh();else if(t.name==="WorkdirCommand"){let r="";t.workdirIdx>=0&&t.workdirIdxconsole.log(r))}async asyncLoop(t){await this.loopMutex.runExclusive(async()=>{await this.update(t),t===!1&&setTimeout(()=>{this.syncLoop(t)},1e3)})}async fetchBackend(t,r={}){let s={"Content-Type":"application/json"},o={id:1,jsonrpc:"2.0",method:t,params:r};try{let c=await(await Promise.resolve().then(()=>(tu(),eu)).then(p=>p.default))(Bo,{method:"POST",headers:s,body:JSON.stringify(o)});if(!c.ok)throw new Error(`${t} ${JSON.stringify(r)} not ok`);let _=await c.json();return n.validateHeader(_,t),_}catch(l){let c=`Error in fetchBackend ${t} ${JSON.stringify(r)}: ${JSON.stringify(l)}`;throw console.error(c),l}}async fetchGetVersions(t){return await this.fetchBackend("getVersions",{workdir:t})}async fetchGetWorkdirStatus(t){return await this.fetchBackend("getWorkdirStatus",{workdir:t})}async fetchWorkdirCommand(t,r){return await this.fetchBackend("workdirCommand",{workdir:t,command:r})}static validateHeader(t,r){if(t.jsonrpc!=="2.0")throw new Error("Invalid JSON-RPC version");if(t.result.header.method!==r)throw new Error("Invalid method")}async update(t){try{await this.updateUsingBackend(t)}catch{}}diagnoseBackendError(t){this.mForceRefreshOnNextReconnect=!0;let r=new sr(Jr,t,void 0);r.setSetupIssue("Suibase not responding. Is it installed?"),H.broadcastMessage(r)}async updateUsingBackend(t){for(let r=0;r= 0 && message.workdirIdx < WORKDIRS_KEYS.length) { workdir = WORKDIRS_KEYS[message.workdirIdx]; } - this.fetchWorkdirCommand(workdir, message.command); + void this.fetchWorkdirCommand(workdir, message.command); } else if (message.name === "RequestWorkdirStatus") { - this.replyWorkdirStatus(message as RequestWorkdirStatus); + void this.replyWorkdirStatus(message as RequestWorkdirStatus); } } catch (error) { - console.error(`Error in handleViewMessage: ${error}`); + console.error(`Error in handleViewMessage: ${JSON.stringify(error)}`); } } @@ -108,7 +110,7 @@ export class BackendSync { private async asyncLoop(forceRefresh: boolean): Promise { await this.loopMutex.runExclusive(async () => { - this.update(forceRefresh); + await this.update(forceRefresh); if (forceRefresh === false) { // Schedule another call in one second. @@ -145,13 +147,13 @@ export class BackendSync { body: JSON.stringify(body), }); if (!response.ok) { - throw new Error(`${method} ${params} not ok`); + throw new Error(`${method} ${JSON.stringify(params)} not ok`); } - let json: T = (await response.json()) as T; + const json: T = (await response.json()) as T; BackendSync.validateHeader(json, method); return json; } catch (error) { - let errorMsg = `Error in fetchBackend ${method} ${params}: ${error}`; + const errorMsg = `Error in fetchBackend ${method} ${JSON.stringify(params)}: ${JSON.stringify(error)}`; console.error(errorMsg); throw error; } @@ -196,6 +198,16 @@ export class BackendSync { } } + private diagnoseBackendError(workdirIdx: number) { + // This is a helper function to diagnose the backend error. + // It will send a message to the views to display the error message. + // For now, always broadcast a message to all views that the backend is not responding. + this.mForceRefreshOnNextReconnect = true; + const msg = new UpdateVersions(WEBVIEW_BACKEND, workdirIdx, undefined); + msg.setSetupIssue("Suibase not responding. Is it installed?"); + BaseWebview.broadcastMessage(msg); + } + private async updateUsingBackend(forceRefresh: boolean) { // Do getVersions for every possible workdir. // @@ -203,8 +215,14 @@ export class BackendSync { // Iterate the WORKDIRS_KEYS for (let workdirIdx = 0; workdirIdx < WORKDIRS_KEYS.length; workdirIdx++) { - let workdir = WORKDIRS_KEYS[workdirIdx]; - const data = await this.fetchGetVersions(workdir); + const workdir = WORKDIRS_KEYS[workdirIdx]; + let data = undefined; + try { + data = await this.fetchGetVersions(workdir); + } catch (error) { + this.diagnoseBackendError(workdirIdx); + return; + } if (data) { try { // This is an example of data: @@ -223,11 +241,14 @@ export class BackendSync { // Broadcast UpdateVersions message to all the views when change detected or requested. // The views will then decide if they need to synchronize further with the extension. - if (hasChanged || forceRefresh) { + if (hasChanged || forceRefresh || this.mForceRefreshOnNextReconnect) { + this.mForceRefreshOnNextReconnect = false; BaseWebview.broadcastMessage(new UpdateVersions(WEBVIEW_BACKEND, workdirIdx, data.result)); } } catch (error) { - const errorMsg = `Error in updateUsingBackend: ${error}. Data: ${JSON.stringify(data)}`; + const errorMsg = `Error in updateUsingBackend: ${JSON.stringify(error)}. Data: ${JSON.stringify( + data + )}`; console.error(errorMsg); throw new Error(errorMsg); } @@ -238,12 +259,12 @@ export class BackendSync { private async replyWorkdirStatus(message: RequestWorkdirStatus) { const sender = message.sender; // Will reply to sender only. const workdirIdx = message.workdirIdx; - const methodUuid= message.methodUuid; + const methodUuid = message.methodUuid; const dataUuid = message.dataUuid; let data = null; try { - let workdir = WORKDIRS_KEYS[workdirIdx]; + const workdir = WORKDIRS_KEYS[workdirIdx]; const workdirTracking = this.mWorkdirTrackings[workdirIdx]; const tracking = workdirTracking.workdirStatus; data = tracking.getJson(); // Start with what is already in-memory (fetch only as needed) @@ -262,9 +283,9 @@ export class BackendSync { // {"label":"Multi-link RPC","status":"OK","statusInfo":null,"helpInfo":null,"pid":null}]},"id":2} // // Update the SuibaseJson instance for the workdir. - BaseWebview.postMessageTo(sender,new UpdateWorkdirStatus(WEBVIEW_BACKEND, workdirIdx, data)); + BaseWebview.postMessageTo(sender, new UpdateWorkdirStatus(WEBVIEW_BACKEND, workdirIdx, data)); } catch (error) { - const errorMsg = `Error in replyWorkdirStatus: ${error}. Data: ${JSON.stringify(data)}`; + const errorMsg = `Error in replyWorkdirStatus: ${JSON.stringify(error)}. Data: ${JSON.stringify(data)}`; console.error(errorMsg); //throw new Error(errorMsg); } diff --git a/typescript/vscode-extension/src/SuibaseCommands.ts b/typescript/vscode-extension/src/SuibaseCommands.ts index 213ff8ce..b457e071 100644 --- a/typescript/vscode-extension/src/SuibaseCommands.ts +++ b/typescript/vscode-extension/src/SuibaseCommands.ts @@ -3,7 +3,6 @@ // a UI interaction (e.g. pressing a "refresh" button). // import * as vscode from "vscode"; -import { SuibaseExec } from "./SuibaseExec"; import { DashboardPanel } from "./panels/DashboardPanel"; import { ConsolePanel } from "./panels/ConsolePanel"; @@ -13,7 +12,9 @@ export class SuibaseCommands { private static instance?: SuibaseCommands; private static context?: vscode.ExtensionContext; + // eslint-disable-next-line @typescript-eslint/no-empty-function private constructor() {} // Called from activate() only. + // eslint-disable-next-line @typescript-eslint/no-empty-function private dispose() {} // Called from deactivate() only. public static activate(context: vscode.ExtensionContext) { @@ -26,19 +27,19 @@ export class SuibaseCommands { SuibaseCommands.instance = new SuibaseCommands(); { - let disposable = vscode.commands.registerCommand(WEBVIEW_DASHBOARD, () => { + const disposable = vscode.commands.registerCommand(WEBVIEW_DASHBOARD, () => { SuibaseCommands.getInstance()?.settings(); }); context.subscriptions.push(disposable); } { - let disposable = vscode.commands.registerCommand(WEBVIEW_CONSOLE, () => { + const disposable = vscode.commands.registerCommand(WEBVIEW_CONSOLE, () => { SuibaseCommands.getInstance()?.console(); }); context.subscriptions.push(disposable); } - + /* { let disposable = vscode.commands.registerCommand("suibase.refresh", () => { SuibaseCommands.getInstance()?.refresh(); @@ -50,6 +51,7 @@ export class SuibaseCommands { setInterval(() => { vscode.commands.executeCommand("suibase.refresh"); }, 3000); // 3 seconds + */ } public static deactivate() { @@ -72,18 +74,6 @@ export class SuibaseCommands { return SuibaseCommands.instance; } - public refresh(workdir?: string) { - //const str = "SuibaseCommands.refresh() called"; - //console.log(str); - // TODO Debouncing to avoid excessive global refresh. - // Do a JSON-RPC call to the suibase server API. - // - // If workdir is not specified, update them all. - // This is a best-effort request and reactions to the - // eventual response are handled somewhere else... - //SuibaseExec.getInstance()?.getLinks(); - } - public settings() { if (!SuibaseCommands.context) { return; diff --git a/typescript/vscode-extension/src/SuibaseExec.ts b/typescript/vscode-extension/src/SuibaseExec.ts index 98728ce4..c3249c7d 100644 --- a/typescript/vscode-extension/src/SuibaseExec.ts +++ b/typescript/vscode-extension/src/SuibaseExec.ts @@ -49,7 +49,7 @@ export class SuibaseExec { // Store the response in the cache //let self = SuibaseExec.getInstance(); - this.cache["response"] = response.result; + this.cache.response = response.result; console.log(response.result); }); } @@ -115,7 +115,7 @@ export class SuibaseExec { for (let i = 0; i < lines.length && !suibaseRunning; i++) { const line = lines[i]; const columns = line.split(" "); - if (columns[0].indexOf("suibase") === 0) { + if (columns[0].startsWith("suibase")) { suibaseRunning = true; } } @@ -125,7 +125,7 @@ export class SuibaseExec { if (!suibaseRunning) { // Start suibase daemon - const result = await execShell("~/suibase/scripts/common/run-daemon.sh suibase &"); + await execShell("~/suibase/scripts/common/run-daemon.sh suibase &"); // TODO Implement retry and error handling of run-daemon.sh for faster startup. @@ -147,7 +147,7 @@ export class SuibaseExec { // The caller get the response (or last known state) with // a lookup for the data in the cache. // - let sb = SuibaseExec.getInstance(); + const sb = SuibaseExec.getInstance(); if (!sb) { return; } diff --git a/typescript/vscode-extension/src/bases/BaseWebview.ts b/typescript/vscode-extension/src/bases/BaseWebview.ts index b143461d..3c98a6a7 100644 --- a/typescript/vscode-extension/src/bases/BaseWebview.ts +++ b/typescript/vscode-extension/src/bases/BaseWebview.ts @@ -28,7 +28,7 @@ export class BaseWebview implements vscode.WebviewViewProvider { // Keep track of all BaseWebview instances. They // can be accessed by "name" for some message handling. - private static instances: { [key: string]: BaseWebview } = {}; + private static instances: Record = {}; // Allow BackendSync to peek at every message for all views. private static backendSyncMessageCallback: (message: any) => void; @@ -106,7 +106,9 @@ export class BaseWebview implements vscode.WebviewViewProvider { public resolveWebviewView( webviewView: vscode.WebviewView, + // eslint-disable-next-line @typescript-eslint/no-unused-vars _context: vscode.WebviewViewResolveContext, + // eslint-disable-next-line @typescript-eslint/no-unused-vars _token: vscode.CancellationToken ) { this.webview = webviewView.webview; @@ -228,17 +230,27 @@ export class BaseWebview implements vscode.WebviewViewProvider { * rendered within the webview panel */ private _getWebviewContent() { - let webview = this.getWebview(); + const webview = this.getWebview(); if (!webview) { // Should never happen, but just in case... show an error so the user can see (and report). return "Error: Missing webview instance"; } // The CSS file from the Svelte build output - const stylesUri = getUri(webview, this.extensionUri, ["webview-ui", "build", "assets", "index.css"]); + const stylesUri = getUri(webview, this.extensionUri, [ + "webview-ui", + "build", + "assets", + "index.css", + ]).toString(); // The JS file from the Svelte build output - const scriptUri = getUri(webview, this.extensionUri, ["webview-ui", "build", "assets", "index.js"]); + const scriptUri = getUri(webview, this.extensionUri, [ + "webview-ui", + "build", + "assets", + "index.js", + ]).toString(); // The icon library being used. const iconsUri = getUri(webview, this.extensionUri, [ @@ -247,7 +259,7 @@ export class BaseWebview implements vscode.WebviewViewProvider { "@vscode/codicons", "dist", "codicon.css", - ]); + ]).toString(); const nonce = getNonce(); @@ -279,6 +291,7 @@ export class BaseWebview implements vscode.WebviewViewProvider { `; } + // eslint-disable-next-line @typescript-eslint/no-unused-vars protected handleMessage(_message: any): void { // This is a placeholder for the derived class to implement. // The derived class should override this method to handle messages @@ -293,9 +306,9 @@ export class BaseWebview implements vscode.WebviewViewProvider { } if (this.panel) { - this.panel.webview.postMessage(message); + void this.panel.webview.postMessage(message); } else if (this.webview) { - this.webview.postMessage(message); + void this.webview.postMessage(message); } } diff --git a/typescript/vscode-extension/src/common/SuibaseData.ts b/typescript/vscode-extension/src/common/SuibaseData.ts index e700b04b..17f27aa5 100644 --- a/typescript/vscode-extension/src/common/SuibaseData.ts +++ b/typescript/vscode-extension/src/common/SuibaseData.ts @@ -7,12 +7,13 @@ // The actual mean to get the data is outside this object. // export class SuibaseGlobalStates { - public loaded: boolean = false; + public loaded = false; - public uiSelectedContext: string = "DSUI"; + public uiSelectedContext = "DSUI"; public uiSelectedContextCallback: (newUiSelectedContext: string) => void = ( // eslint-disable-next-line _newUiSelectedContext: string + // eslint-disable-next-line @typescript-eslint/no-empty-function ) => {}; public serialize(): string { diff --git a/typescript/vscode-extension/src/common/SuibaseJson.ts b/typescript/vscode-extension/src/common/SuibaseJson.ts index a5ee3491..5f35fbb8 100644 --- a/typescript/vscode-extension/src/common/SuibaseJson.ts +++ b/typescript/vscode-extension/src/common/SuibaseJson.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ // The purpose of the SuibaseJson is to : // - Compare very quickly two JSON storage and optionally update the storage. // - Detect delta using UUID. @@ -120,7 +119,7 @@ export class SuibaseJsonVersions extends SuibaseJson { console.error( `Problem comparing versions for SuibaseJsonWorkdirStatus ${JSON.stringify( candidate - )} and versions ${JSON.stringify(this.getJson())}: error [${error}]` + )} and versions ${JSON.stringify(this.getJson())}: error [${JSON.stringify(error)}]` ); } // Normal because candidate is same or not latest... or could be an error... @@ -158,7 +157,7 @@ export class SuibaseJsonWorkdirStatus extends SuibaseJson { } this.isLoaded = true; } catch (error) { - console.error(`Problem with SuibaseJsonWorkdirStatus loading: ${error}`); + console.error(`Problem with SuibaseJsonWorkdirStatus loading: ${JSON.stringify(error)}`); } } } diff --git a/typescript/vscode-extension/src/common/ViewMessages.ts b/typescript/vscode-extension/src/common/ViewMessages.ts index 7dde0bf4..7cd2b70b 100644 --- a/typescript/vscode-extension/src/common/ViewMessages.ts +++ b/typescript/vscode-extension/src/common/ViewMessages.ts @@ -1,5 +1,7 @@ // Messages exchanged between the views and the extension. +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ + // ********************************** // Message from Extension to Views // ********************************** @@ -16,23 +18,29 @@ export class ViewMessages { export class UpdateVersions extends ViewMessages { workdirIdx: number; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + setupIssue: string | undefined; // Info for user when Suibase backend not available. json: any; - // eslint-disable-next-line @typescript-eslint/no-explicit-any constructor(sender: string, workdirIdx: number, json: any) { super("UpdateVersions", sender); this.workdirIdx = workdirIdx; + this.setupIssue = undefined; this.json = json; } + + setSetupIssue(issue: string) { + if (issue === "") { + this.setupIssue = undefined; + } else { + this.setupIssue = issue; + } + } } export class UpdateWorkdirStatus extends ViewMessages { workdirIdx: number; - // eslint-disable-next-line @typescript-eslint/no-explicit-any json: any; - // eslint-disable-next-line @typescript-eslint/no-explicit-any constructor(sender: string, workdirIdx: number, json: any) { super("UpdateWorkdirStatus", sender); this.workdirIdx = workdirIdx; diff --git a/typescript/vscode-extension/src/panels/DashboardPanel.ts b/typescript/vscode-extension/src/panels/DashboardPanel.ts index 32fccc97..1ed01cd1 100644 --- a/typescript/vscode-extension/src/panels/DashboardPanel.ts +++ b/typescript/vscode-extension/src/panels/DashboardPanel.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ import { BaseWebview } from "../bases/BaseWebview"; import { WEBVIEW_DASHBOARD } from "../common/Consts"; @@ -46,7 +45,7 @@ export class DashboardPanel extends BaseWebview { } // eslint-disable-next-line @typescript-eslint/no-unused-vars - protected handleMessage(message: any): void { + protected handleMessage(_message: any): void { //console.log(message); } } diff --git a/typescript/vscode-extension/src/sidebar/SuibaseSidebar.ts b/typescript/vscode-extension/src/sidebar/SuibaseSidebar.ts index 9d7c5aaa..d910431f 100644 --- a/typescript/vscode-extension/src/sidebar/SuibaseSidebar.ts +++ b/typescript/vscode-extension/src/sidebar/SuibaseSidebar.ts @@ -52,12 +52,11 @@ export class SuibaseSidebar extends BaseWebview { } // Override BaseWebview::handleMessage - // eslint-disable-next-line @typescript-eslint/no-explicit-any + protected handleMessage(message: any): void { //console.log("SuibaseSidebar.handleMessage() called"); //console.log(message); const sbData = SuibaseData.getInstance(); - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access switch (message.type) { case "init-view": super.postMessage({ type: "init-global-states", message: sbData.globalStates.serialize() }); diff --git a/typescript/vscode-extension/src/test/runTest.ts b/typescript/vscode-extension/src/test/runTest.ts index 93a4441d..738725f3 100644 --- a/typescript/vscode-extension/src/test/runTest.ts +++ b/typescript/vscode-extension/src/test/runTest.ts @@ -20,4 +20,5 @@ async function main() { } } +// eslint-disable-next-line @typescript-eslint/no-floating-promises main(); diff --git a/typescript/vscode-extension/src/test/suite/extension.test.ts b/typescript/vscode-extension/src/test/suite/extension.test.ts index 4ca0ab41..88f03d58 100644 --- a/typescript/vscode-extension/src/test/suite/extension.test.ts +++ b/typescript/vscode-extension/src/test/suite/extension.test.ts @@ -6,6 +6,7 @@ import * as vscode from 'vscode'; // import * as myExtension from '../../extension'; suite('Extension Test Suite', () => { + // eslint-disable-next-line @typescript-eslint/no-floating-promises vscode.window.showInformationMessage('Start all tests.'); test('Sample test', () => { diff --git a/typescript/vscode-extension/webview-ui/build/assets/index.js b/typescript/vscode-extension/webview-ui/build/assets/index.js index 199dd992..67e7816b 100644 --- a/typescript/vscode-extension/webview-ui/build/assets/index.js +++ b/typescript/vscode-extension/webview-ui/build/assets/index.js @@ -1,4 +1,4 @@ -var gb=Object.defineProperty;var vb=(e,t,n)=>t in e?gb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ue=(e,t,n)=>(vb(e,typeof t!="symbol"?t+"":t,n),n);function yb(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function bb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ur(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 i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Rm={exports:{}},ql={},Om={exports:{}},U={};/** +var gb=Object.defineProperty;var vb=(e,t,n)=>t in e?gb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ze=(e,t,n)=>(vb(e,typeof t!="symbol"?t+"":t,n),n);function yb(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function bb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ur(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 i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Rm={exports:{}},Ql={},Om={exports:{}},U={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var gb=Object.defineProperty;var vb=(e,t,n)=>t in e?gb(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var ts=Symbol.for("react.element"),xb=Symbol.for("react.portal"),wb=Symbol.for("react.fragment"),kb=Symbol.for("react.strict_mode"),Cb=Symbol.for("react.profiler"),Sb=Symbol.for("react.provider"),$b=Symbol.for("react.context"),Tb=Symbol.for("react.forward_ref"),Eb=Symbol.for("react.suspense"),Rb=Symbol.for("react.memo"),Ob=Symbol.for("react.lazy"),Qf=Symbol.iterator;function Pb(e){return e===null||typeof e!="object"?null:(e=Qf&&e[Qf]||e["@@iterator"],typeof e=="function"?e:null)}var Pm={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Im=Object.assign,_m={};function _i(e,t,n){this.props=e,this.context=t,this.refs=_m,this.updater=n||Pm}_i.prototype.isReactComponent={};_i.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};_i.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Am(){}Am.prototype=_i.prototype;function ld(e,t,n){this.props=e,this.context=t,this.refs=_m,this.updater=n||Pm}var ad=ld.prototype=new Am;ad.constructor=ld;Im(ad,_i.prototype);ad.isPureReactComponent=!0;var Xf=Array.isArray,Dm=Object.prototype.hasOwnProperty,cd={current:null},Mm={key:!0,ref:!0,__self:!0,__source:!0};function Lm(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)Dm.call(t,r)&&!Mm.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1t in e?gb(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Mb=C,Lb=Symbol.for("react.element"),Nb=Symbol.for("react.fragment"),Fb=Object.prototype.hasOwnProperty,Bb=Mb.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,zb={key:!0,ref:!0,__self:!0,__source:!0};function Fm(e,t,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)Fb.call(t,r)&&!zb.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Lb,type:e,key:o,ref:s,props:i,_owner:Bb.current}}ql.Fragment=Nb;ql.jsx=Fm;ql.jsxs=Fm;Rm.exports=ql;var E=Rm.exports,Qc={},Bm={exports:{}},Ot={},zm={exports:{}},jm={};/** + */var Mb=C,Lb=Symbol.for("react.element"),Nb=Symbol.for("react.fragment"),Fb=Object.prototype.hasOwnProperty,Bb=Mb.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,zb={key:!0,ref:!0,__self:!0,__source:!0};function Fm(e,t,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)Fb.call(t,r)&&!zb.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Lb,type:e,key:o,ref:s,props:i,_owner:Bb.current}}Ql.Fragment=Nb;Ql.jsx=Fm;Ql.jsxs=Fm;Rm.exports=Ql;var T=Rm.exports,Xc={},Bm={exports:{}},Ot={},zm={exports:{}},jm={};/** * @license React * scheduler.production.min.js * @@ -22,7 +22,7 @@ var gb=Object.defineProperty;var vb=(e,t,n)=>t in e?gb(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(e){function t(P,L){var N=P.length;P.push(L);e:for(;0>>1,fe=P[te];if(0>>1;tei(Dt,N))nti(Nn,Dt)?(P[te]=Nn,P[nt]=N,te=nt):(P[te]=Dt,P[Me]=N,te=Me);else if(nti(Nn,N))P[te]=Nn,P[nt]=N,te=nt;else break e}}return L}function i(P,L){var N=P.sortIndex-L.sortIndex;return N!==0?N:P.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var a=[],c=[],u=1,d=null,f=3,y=!1,v=!1,g=!1,T=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(P){for(var L=n(c);L!==null;){if(L.callback===null)r(c);else if(L.startTime<=P)r(c),L.sortIndex=L.expirationTime,t(a,L);else break;L=n(c)}}function x(P){if(g=!1,m(P),!v)if(n(a)!==null)v=!0,Ie(w);else{var L=n(c);L!==null&&tt(x,L.startTime-P)}}function w(P,L){v=!1,g&&(g=!1,p(I),I=-1),y=!0;var N=f;try{for(m(L),d=n(a);d!==null&&(!(d.expirationTime>L)||P&&!B());){var te=d.callback;if(typeof te=="function"){d.callback=null,f=d.priorityLevel;var fe=te(d.expirationTime<=L);L=e.unstable_now(),typeof fe=="function"?d.callback=fe:d===n(a)&&r(a),m(L)}else r(a);d=n(a)}if(d!==null)var bn=!0;else{var Me=n(c);Me!==null&&tt(x,Me.startTime-L),bn=!1}return bn}finally{d=null,f=N,y=!1}}var k=!1,S=null,I=-1,z=5,M=-1;function B(){return!(e.unstable_now()-MP||125te?(P.sortIndex=N,t(c,P),n(a)===null&&P===n(c)&&(g?(p(I),I=-1):g=!0,tt(x,N-te))):(P.sortIndex=fe,t(a,P),v||y||(v=!0,Ie(w))),P},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(P){var L=f;return function(){var N=f;f=L;try{return P.apply(this,arguments)}finally{f=N}}}})(jm);zm.exports=jm;var jb=zm.exports;/** + */(function(e){function t(I,L){var N=I.length;I.push(L);e:for(;0>>1,fe=I[te];if(0>>1;tei(Dt,N))nti(Nn,Dt)?(I[te]=Nn,I[nt]=N,te=nt):(I[te]=Dt,I[Me]=N,te=Me);else if(nti(Nn,N))I[te]=Nn,I[nt]=N,te=nt;else break e}}return L}function i(I,L){var N=I.sortIndex-L.sortIndex;return N!==0?N:I.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var a=[],c=[],u=1,d=null,f=3,y=!1,v=!1,g=!1,E=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(I){for(var L=n(c);L!==null;){if(L.callback===null)r(c);else if(L.startTime<=I)r(c),L.sortIndex=L.expirationTime,t(a,L);else break;L=n(c)}}function x(I){if(g=!1,m(I),!v)if(n(a)!==null)v=!0,Pe(w);else{var L=n(c);L!==null&&tt(x,L.startTime-I)}}function w(I,L){v=!1,g&&(g=!1,p(P),P=-1),y=!0;var N=f;try{for(m(L),d=n(a);d!==null&&(!(d.expirationTime>L)||I&&!B());){var te=d.callback;if(typeof te=="function"){d.callback=null,f=d.priorityLevel;var fe=te(d.expirationTime<=L);L=e.unstable_now(),typeof fe=="function"?d.callback=fe:d===n(a)&&r(a),m(L)}else r(a);d=n(a)}if(d!==null)var bn=!0;else{var Me=n(c);Me!==null&&tt(x,Me.startTime-L),bn=!1}return bn}finally{d=null,f=N,y=!1}}var k=!1,S=null,P=-1,z=5,M=-1;function B(){return!(e.unstable_now()-MI||125te?(I.sortIndex=N,t(c,I),n(a)===null&&I===n(c)&&(g?(p(P),P=-1):g=!0,tt(x,N-te))):(I.sortIndex=fe,t(a,I),v||y||(v=!0,Pe(w))),I},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(I){var L=f;return function(){var N=f;f=L;try{return I.apply(this,arguments)}finally{f=N}}}})(jm);zm.exports=jm;var jb=zm.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ var gb=Object.defineProperty;var vb=(e,t,n)=>t in e?gb(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Vb=C,Rt=jb;function R(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xc=Object.prototype.hasOwnProperty,Hb=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Zf={},Kf={};function Ub(e){return Xc.call(Kf,e)?!0:Xc.call(Zf,e)?!1:Hb.test(e)?Kf[e]=!0:(Zf[e]=!0,!1)}function Wb(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Gb(e,t,n,r){if(t===null||typeof t>"u"||Wb(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function dt(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var He={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){He[e]=new dt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];He[t]=new dt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){He[e]=new dt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){He[e]=new dt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){He[e]=new dt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){He[e]=new dt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){He[e]=new dt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){He[e]=new dt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){He[e]=new dt(e,5,!1,e.toLowerCase(),null,!1,!1)});var dd=/[\-:]([a-z])/g;function fd(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(dd,fd);He[t]=new dt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(dd,fd);He[t]=new dt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(dd,fd);He[t]=new dt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){He[e]=new dt(e,1,!1,e.toLowerCase(),null,!1,!1)});He.xlinkHref=new dt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){He[e]=new dt(e,1,!1,e.toLowerCase(),null,!0,!0)});function hd(e,t,n,r){var i=He.hasOwnProperty(t)?He[t]:null;(i!==null?i.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Yc=Object.prototype.hasOwnProperty,Hb=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Zf={},Kf={};function Ub(e){return Yc.call(Kf,e)?!0:Yc.call(Zf,e)?!1:Hb.test(e)?Kf[e]=!0:(Zf[e]=!0,!1)}function Wb(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Gb(e,t,n,r){if(t===null||typeof t>"u"||Wb(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function dt(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var Ue={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ue[e]=new dt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ue[t]=new dt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ue[e]=new dt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ue[e]=new dt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ue[e]=new dt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ue[e]=new dt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ue[e]=new dt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ue[e]=new dt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ue[e]=new dt(e,5,!1,e.toLowerCase(),null,!1,!1)});var dd=/[\-:]([a-z])/g;function fd(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(dd,fd);Ue[t]=new dt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(dd,fd);Ue[t]=new dt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(dd,fd);Ue[t]=new dt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ue[e]=new dt(e,1,!1,e.toLowerCase(),null,!1,!1)});Ue.xlinkHref=new dt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ue[e]=new dt(e,1,!1,e.toLowerCase(),null,!0,!0)});function hd(e,t,n,r){var i=Ue.hasOwnProperty(t)?Ue[t]:null;(i!==null?i.type!==0:r||!(2l||i[s]!==o[l]){var a=` -`+i[s].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=s&&0<=l);break}}}finally{nc=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ao(e):""}function qb(e){switch(e.tag){case 5:return ao(e.type);case 16:return ao("Lazy");case 13:return ao("Suspense");case 19:return ao("SuspenseList");case 0:case 2:case 15:return e=rc(e.type,!1),e;case 11:return e=rc(e.type.render,!1),e;case 1:return e=rc(e.type,!0),e;default:return""}}function Kc(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Qr:return"Fragment";case qr:return"Portal";case Yc:return"Profiler";case pd:return"StrictMode";case Jc:return"Suspense";case Zc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Um:return(e.displayName||"Context")+".Consumer";case Hm:return(e._context.displayName||"Context")+".Provider";case md:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case gd:return t=e.displayName||null,t!==null?t:Kc(e.type)||"Memo";case Hn:t=e._payload,e=e._init;try{return Kc(e(t))}catch{}}return null}function Qb(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Kc(t);case 8:return t===pd?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function sr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Gm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Xb(e){var t=Gm(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ks(e){e._valueTracker||(e._valueTracker=Xb(e))}function qm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Gm(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ml(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function eu(e,t){var n=t.checked;return ge({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function th(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=sr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Qm(e,t){t=t.checked,t!=null&&hd(e,"checked",t,!1)}function tu(e,t){Qm(e,t);var n=sr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?nu(e,t.type,n):t.hasOwnProperty("defaultValue")&&nu(e,t.type,sr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function nh(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function nu(e,t,n){(t!=="number"||ml(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var co=Array.isArray;function li(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Cs.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Oo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var po={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Yb=["Webkit","ms","Moz","O"];Object.keys(po).forEach(function(e){Yb.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),po[t]=po[e]})});function Zm(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||po.hasOwnProperty(e)&&po[e]?(""+t).trim():t+"px"}function Km(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Zm(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Jb=ge({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ou(e,t){if(t){if(Jb[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(R(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(R(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(R(61))}if(t.style!=null&&typeof t.style!="object")throw Error(R(62))}}function su(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var lu=null;function vd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var au=null,ai=null,ci=null;function oh(e){if(e=is(e)){if(typeof au!="function")throw Error(R(280));var t=e.stateNode;t&&(t=Zl(t),au(e.stateNode,e.type,t))}}function eg(e){ai?ci?ci.push(e):ci=[e]:ai=e}function tg(){if(ai){var e=ai,t=ci;if(ci=ai=null,oh(e),t)for(e=0;e>>=0,e===0?32:31-(a1(e)/c1|0)|0}var Ss=64,$s=4194304;function uo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function bl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~i;l!==0?r=uo(l):(o&=s,o!==0&&(r=uo(o)))}else s=n&~i,s!==0?r=uo(s):o!==0&&(r=uo(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function ns(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-rn(t),e[t]=n}function h1(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=go),ph=" ",mh=!1;function wg(e,t){switch(e){case"keyup":return j1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xr=!1;function H1(e,t){switch(e){case"compositionend":return kg(t);case"keypress":return t.which!==32?null:(mh=!0,ph);case"textInput":return e=t.data,e===ph&&mh?null:e;default:return null}}function U1(e,t){if(Xr)return e==="compositionend"||!$d&&wg(e,t)?(e=bg(),Zs=kd=Xn=null,Xr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=bh(n)}}function Tg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Tg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Eg(){for(var e=window,t=ml();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ml(e.document)}return t}function Td(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function K1(e){var t=Eg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Tg(n.ownerDocument.documentElement,n)){if(r!==null&&Td(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=xh(n,o);var s=xh(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Yr=null,pu=null,yo=null,mu=!1;function wh(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;mu||Yr==null||Yr!==ml(r)||(r=Yr,"selectionStart"in r&&Td(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),yo&&Mo(yo,r)||(yo=r,r=kl(pu,"onSelect"),0Kr||(e.current=wu[Kr],wu[Kr]=null,Kr--)}function ne(e,t){Kr++,wu[Kr]=e.current,e.current=t}var lr={},Ye=fr(lr),mt=fr(!1),Pr=lr;function xi(e,t){var n=e.type.contextTypes;if(!n)return lr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function gt(e){return e=e.childContextTypes,e!=null}function Sl(){oe(mt),oe(Ye)}function Rh(e,t,n){if(Ye.current!==lr)throw Error(R(168));ne(Ye,t),ne(mt,n)}function Lg(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(R(108,Qb(e)||"Unknown",i));return ge({},n,r)}function $l(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||lr,Pr=Ye.current,ne(Ye,e),ne(mt,mt.current),!0}function Oh(e,t,n){var r=e.stateNode;if(!r)throw Error(R(169));n?(e=Lg(e,t,Pr),r.__reactInternalMemoizedMergedChildContext=e,oe(mt),oe(Ye),ne(Ye,e)):oe(mt),ne(mt,n)}var kn=null,Kl=!1,vc=!1;function Ng(e){kn===null?kn=[e]:kn.push(e)}function dx(e){Kl=!0,Ng(e)}function hr(){if(!vc&&kn!==null){vc=!0;var e=0,t=Z;try{var n=kn;for(Z=1;e>=s,i-=s,$n=1<<32-rn(t)+i|n<I?(z=S,S=null):z=S.sibling;var M=f(p,S,m[I],x);if(M===null){S===null&&(S=z);break}e&&S&&M.alternate===null&&t(p,S),h=o(M,h,I),k===null?w=M:k.sibling=M,k=M,S=z}if(I===m.length)return n(p,S),ce&&yr(p,I),w;if(S===null){for(;II?(z=S,S=null):z=S.sibling;var B=f(p,S,M.value,x);if(B===null){S===null&&(S=z);break}e&&S&&B.alternate===null&&t(p,S),h=o(B,h,I),k===null?w=B:k.sibling=B,k=B,S=z}if(M.done)return n(p,S),ce&&yr(p,I),w;if(S===null){for(;!M.done;I++,M=m.next())M=d(p,M.value,x),M!==null&&(h=o(M,h,I),k===null?w=M:k.sibling=M,k=M);return ce&&yr(p,I),w}for(S=r(p,S);!M.done;I++,M=m.next())M=y(S,p,I,M.value,x),M!==null&&(e&&M.alternate!==null&&S.delete(M.key===null?I:M.key),h=o(M,h,I),k===null?w=M:k.sibling=M,k=M);return e&&S.forEach(function(J){return t(p,J)}),ce&&yr(p,I),w}function T(p,h,m,x){if(typeof m=="object"&&m!==null&&m.type===Qr&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case ws:e:{for(var w=m.key,k=h;k!==null;){if(k.key===w){if(w=m.type,w===Qr){if(k.tag===7){n(p,k.sibling),h=i(k,m.props.children),h.return=p,p=h;break e}}else if(k.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Hn&&_h(w)===k.type){n(p,k.sibling),h=i(k,m.props),h.ref=Zi(p,k,m),h.return=p,p=h;break e}n(p,k);break}else t(p,k);k=k.sibling}m.type===Qr?(h=Er(m.props.children,p.mode,x,m.key),h.return=p,p=h):(x=sl(m.type,m.key,m.props,null,p.mode,x),x.ref=Zi(p,h,m),x.return=p,p=x)}return s(p);case qr:e:{for(k=m.key;h!==null;){if(h.key===k)if(h.tag===4&&h.stateNode.containerInfo===m.containerInfo&&h.stateNode.implementation===m.implementation){n(p,h.sibling),h=i(h,m.children||[]),h.return=p,p=h;break e}else{n(p,h);break}else t(p,h);h=h.sibling}h=$c(m,p.mode,x),h.return=p,p=h}return s(p);case Hn:return k=m._init,T(p,h,k(m._payload),x)}if(co(m))return v(p,h,m,x);if(qi(m))return g(p,h,m,x);_s(p,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,h!==null&&h.tag===6?(n(p,h.sibling),h=i(h,m),h.return=p,p=h):(n(p,h),h=Sc(m,p.mode,x),h.return=p,p=h),s(p)):n(p,h)}return T}var ki=jg(!0),Vg=jg(!1),Rl=fr(null),Ol=null,ni=null,Pd=null;function Id(){Pd=ni=Ol=null}function _d(e){var t=Rl.current;oe(Rl),e._currentValue=t}function Su(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function di(e,t){Ol=e,Pd=ni=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(pt=!0),e.firstContext=null)}function Ht(e){var t=e._currentValue;if(Pd!==e)if(e={context:e,memoizedValue:t,next:null},ni===null){if(Ol===null)throw Error(R(308));ni=e,Ol.dependencies={lanes:0,firstContext:e}}else ni=ni.next=e;return t}var kr=null;function Ad(e){kr===null?kr=[e]:kr.push(e)}function Hg(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Ad(t)):(n.next=i.next,i.next=n),t.interleaved=n,In(e,r)}function In(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Un=!1;function Dd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ug(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Rn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function tr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,q&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,In(e,n)}return i=r.interleaved,i===null?(t.next=t,Ad(r)):(t.next=i.next,i.next=t),r.interleaved=t,In(e,n)}function el(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,bd(e,n)}}function Ah(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Pl(e,t,n,r){var i=e.updateQueue;Un=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var a=l,c=a.next;a.next=null,s===null?o=c:s.next=c,s=a;var u=e.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==s&&(l===null?u.firstBaseUpdate=c:l.next=c,u.lastBaseUpdate=a))}if(o!==null){var d=i.baseState;s=0,u=c=a=null,l=o;do{var f=l.lane,y=l.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:y,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,g=l;switch(f=t,y=n,g.tag){case 1:if(v=g.payload,typeof v=="function"){d=v.call(y,d,f);break e}d=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=g.payload,f=typeof v=="function"?v.call(y,d,f):v,f==null)break e;d=ge({},d,f);break e;case 2:Un=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[l]:f.push(l))}else y={eventTime:y,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(c=u=y,a=d):u=u.next=y,s|=f;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;f=l,l=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(u===null&&(a=d),i.baseState=a,i.firstBaseUpdate=c,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);Ar|=s,e.lanes=s,e.memoizedState=d}}function Dh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=bc.transition;bc.transition={};try{e(!1),t()}finally{Z=n,bc.transition=r}}function lv(){return Ut().memoizedState}function mx(e,t,n){var r=rr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},av(e))cv(t,n);else if(n=Hg(e,t,n,r),n!==null){var i=st();on(n,e,r,i),uv(n,t,r)}}function gx(e,t,n){var r=rr(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(av(e))cv(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,l=o(s,n);if(i.hasEagerState=!0,i.eagerState=l,sn(l,s)){var a=t.interleaved;a===null?(i.next=i,Ad(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=Hg(e,t,i,r),n!==null&&(i=st(),on(n,e,r,i),uv(n,t,r))}}function av(e){var t=e.alternate;return e===me||t!==null&&t===me}function cv(e,t){bo=_l=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function uv(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,bd(e,n)}}var Al={readContext:Ht,useCallback:We,useContext:We,useEffect:We,useImperativeHandle:We,useInsertionEffect:We,useLayoutEffect:We,useMemo:We,useReducer:We,useRef:We,useState:We,useDebugValue:We,useDeferredValue:We,useTransition:We,useMutableSource:We,useSyncExternalStore:We,useId:We,unstable_isNewReconciler:!1},vx={readContext:Ht,useCallback:function(e,t){return dn().memoizedState=[e,t===void 0?null:t],e},useContext:Ht,useEffect:Lh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,nl(4194308,4,nv.bind(null,t,e),n)},useLayoutEffect:function(e,t){return nl(4194308,4,e,t)},useInsertionEffect:function(e,t){return nl(4,2,e,t)},useMemo:function(e,t){var n=dn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=dn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=mx.bind(null,me,e),[r.memoizedState,e]},useRef:function(e){var t=dn();return e={current:e},t.memoizedState=e},useState:Mh,useDebugValue:Vd,useDeferredValue:function(e){return dn().memoizedState=e},useTransition:function(){var e=Mh(!1),t=e[0];return e=px.bind(null,e[1]),dn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=me,i=dn();if(ce){if(n===void 0)throw Error(R(407));n=n()}else{if(n=t(),Fe===null)throw Error(R(349));_r&30||Qg(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Lh(Yg.bind(null,r,o,e),[e]),r.flags|=2048,Ho(9,Xg.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=dn(),t=Fe.identifierPrefix;if(ce){var n=Tn,r=$n;n=(r&~(1<<32-rn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=jo++,0")&&(a=a.replace("",e.displayName)),a}while(1<=s&&0<=l);break}}}finally{rc=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?co(e):""}function qb(e){switch(e.tag){case 5:return co(e.type);case 16:return co("Lazy");case 13:return co("Suspense");case 19:return co("SuspenseList");case 0:case 2:case 15:return e=ic(e.type,!1),e;case 11:return e=ic(e.type.render,!1),e;case 1:return e=ic(e.type,!0),e;default:return""}}function eu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Xr:return"Fragment";case Qr:return"Portal";case Jc:return"Profiler";case pd:return"StrictMode";case Zc:return"Suspense";case Kc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Um:return(e.displayName||"Context")+".Consumer";case Hm:return(e._context.displayName||"Context")+".Provider";case md:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case gd:return t=e.displayName||null,t!==null?t:eu(e.type)||"Memo";case Hn:t=e._payload,e=e._init;try{return eu(e(t))}catch{}}return null}function Qb(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return eu(t);case 8:return t===pd?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function sr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Gm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Xb(e){var t=Gm(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Cs(e){e._valueTracker||(e._valueTracker=Xb(e))}function qm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Gm(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ml(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function tu(e,t){var n=t.checked;return ge({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function th(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=sr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Qm(e,t){t=t.checked,t!=null&&hd(e,"checked",t,!1)}function nu(e,t){Qm(e,t);var n=sr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ru(e,t.type,n):t.hasOwnProperty("defaultValue")&&ru(e,t.type,sr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function nh(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ru(e,t,n){(t!=="number"||ml(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var uo=Array.isArray;function ai(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Ss.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Io(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var mo={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Yb=["Webkit","ms","Moz","O"];Object.keys(mo).forEach(function(e){Yb.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),mo[t]=mo[e]})});function Zm(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||mo.hasOwnProperty(e)&&mo[e]?(""+t).trim():t+"px"}function Km(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Zm(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Jb=ge({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function su(e,t){if(t){if(Jb[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(R(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(R(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(R(61))}if(t.style!=null&&typeof t.style!="object")throw Error(R(62))}}function lu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var au=null;function vd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var cu=null,ci=null,ui=null;function oh(e){if(e=os(e)){if(typeof cu!="function")throw Error(R(280));var t=e.stateNode;t&&(t=Kl(t),cu(e.stateNode,e.type,t))}}function eg(e){ci?ui?ui.push(e):ui=[e]:ci=e}function tg(){if(ci){var e=ci,t=ui;if(ui=ci=null,oh(e),t)for(e=0;e>>=0,e===0?32:31-(a1(e)/c1|0)|0}var $s=64,Ts=4194304;function fo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function bl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~i;l!==0?r=fo(l):(o&=s,o!==0&&(r=fo(o)))}else s=n&~i,s!==0?r=fo(s):o!==0&&(r=fo(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function rs(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-rn(t),e[t]=n}function h1(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=vo),ph=" ",mh=!1;function wg(e,t){switch(e){case"keyup":return j1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Yr=!1;function H1(e,t){switch(e){case"compositionend":return kg(t);case"keypress":return t.which!==32?null:(mh=!0,ph);case"textInput":return e=t.data,e===ph&&mh?null:e;default:return null}}function U1(e,t){if(Yr)return e==="compositionend"||!$d&&wg(e,t)?(e=bg(),Zs=kd=Xn=null,Yr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=bh(n)}}function Tg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Tg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Eg(){for(var e=window,t=ml();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ml(e.document)}return t}function Td(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function K1(e){var t=Eg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Tg(n.ownerDocument.documentElement,n)){if(r!==null&&Td(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=xh(n,o);var s=xh(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Jr=null,mu=null,bo=null,gu=!1;function wh(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;gu||Jr==null||Jr!==ml(r)||(r=Jr,"selectionStart"in r&&Td(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),bo&&Lo(bo,r)||(bo=r,r=kl(mu,"onSelect"),0ei||(e.current=ku[ei],ku[ei]=null,ei--)}function ne(e,t){ei++,ku[ei]=e.current,e.current=t}var lr={},Ye=fr(lr),mt=fr(!1),Ir=lr;function wi(e,t){var n=e.type.contextTypes;if(!n)return lr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function gt(e){return e=e.childContextTypes,e!=null}function Sl(){oe(mt),oe(Ye)}function Rh(e,t,n){if(Ye.current!==lr)throw Error(R(168));ne(Ye,t),ne(mt,n)}function Lg(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(R(108,Qb(e)||"Unknown",i));return ge({},n,r)}function $l(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||lr,Ir=Ye.current,ne(Ye,e),ne(mt,mt.current),!0}function Oh(e,t,n){var r=e.stateNode;if(!r)throw Error(R(169));n?(e=Lg(e,t,Ir),r.__reactInternalMemoizedMergedChildContext=e,oe(mt),oe(Ye),ne(Ye,e)):oe(mt),ne(mt,n)}var kn=null,ea=!1,yc=!1;function Ng(e){kn===null?kn=[e]:kn.push(e)}function dx(e){ea=!0,Ng(e)}function hr(){if(!yc&&kn!==null){yc=!0;var e=0,t=Z;try{var n=kn;for(Z=1;e>=s,i-=s,$n=1<<32-rn(t)+i|n<P?(z=S,S=null):z=S.sibling;var M=f(p,S,m[P],x);if(M===null){S===null&&(S=z);break}e&&S&&M.alternate===null&&t(p,S),h=o(M,h,P),k===null?w=M:k.sibling=M,k=M,S=z}if(P===m.length)return n(p,S),ce&&yr(p,P),w;if(S===null){for(;PP?(z=S,S=null):z=S.sibling;var B=f(p,S,M.value,x);if(B===null){S===null&&(S=z);break}e&&S&&B.alternate===null&&t(p,S),h=o(B,h,P),k===null?w=B:k.sibling=B,k=B,S=z}if(M.done)return n(p,S),ce&&yr(p,P),w;if(S===null){for(;!M.done;P++,M=m.next())M=d(p,M.value,x),M!==null&&(h=o(M,h,P),k===null?w=M:k.sibling=M,k=M);return ce&&yr(p,P),w}for(S=r(p,S);!M.done;P++,M=m.next())M=y(S,p,P,M.value,x),M!==null&&(e&&M.alternate!==null&&S.delete(M.key===null?P:M.key),h=o(M,h,P),k===null?w=M:k.sibling=M,k=M);return e&&S.forEach(function(J){return t(p,J)}),ce&&yr(p,P),w}function E(p,h,m,x){if(typeof m=="object"&&m!==null&&m.type===Xr&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case ks:e:{for(var w=m.key,k=h;k!==null;){if(k.key===w){if(w=m.type,w===Xr){if(k.tag===7){n(p,k.sibling),h=i(k,m.props.children),h.return=p,p=h;break e}}else if(k.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Hn&&_h(w)===k.type){n(p,k.sibling),h=i(k,m.props),h.ref=Ki(p,k,m),h.return=p,p=h;break e}n(p,k);break}else t(p,k);k=k.sibling}m.type===Xr?(h=Er(m.props.children,p.mode,x,m.key),h.return=p,p=h):(x=sl(m.type,m.key,m.props,null,p.mode,x),x.ref=Ki(p,h,m),x.return=p,p=x)}return s(p);case Qr:e:{for(k=m.key;h!==null;){if(h.key===k)if(h.tag===4&&h.stateNode.containerInfo===m.containerInfo&&h.stateNode.implementation===m.implementation){n(p,h.sibling),h=i(h,m.children||[]),h.return=p,p=h;break e}else{n(p,h);break}else t(p,h);h=h.sibling}h=Tc(m,p.mode,x),h.return=p,p=h}return s(p);case Hn:return k=m._init,E(p,h,k(m._payload),x)}if(uo(m))return v(p,h,m,x);if(Qi(m))return g(p,h,m,x);As(p,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,h!==null&&h.tag===6?(n(p,h.sibling),h=i(h,m),h.return=p,p=h):(n(p,h),h=$c(m,p.mode,x),h.return=p,p=h),s(p)):n(p,h)}return E}var Ci=jg(!0),Vg=jg(!1),Rl=fr(null),Ol=null,ri=null,Id=null;function Pd(){Id=ri=Ol=null}function _d(e){var t=Rl.current;oe(Rl),e._currentValue=t}function $u(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function fi(e,t){Ol=e,Id=ri=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(pt=!0),e.firstContext=null)}function Ht(e){var t=e._currentValue;if(Id!==e)if(e={context:e,memoizedValue:t,next:null},ri===null){if(Ol===null)throw Error(R(308));ri=e,Ol.dependencies={lanes:0,firstContext:e}}else ri=ri.next=e;return t}var kr=null;function Ad(e){kr===null?kr=[e]:kr.push(e)}function Hg(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Ad(t)):(n.next=i.next,i.next=n),t.interleaved=n,Pn(e,r)}function Pn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Un=!1;function Dd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ug(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Rn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function tr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,q&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Pn(e,n)}return i=r.interleaved,i===null?(t.next=t,Ad(r)):(t.next=i.next,i.next=t),r.interleaved=t,Pn(e,n)}function el(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,bd(e,n)}}function Ah(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Il(e,t,n,r){var i=e.updateQueue;Un=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var a=l,c=a.next;a.next=null,s===null?o=c:s.next=c,s=a;var u=e.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==s&&(l===null?u.firstBaseUpdate=c:l.next=c,u.lastBaseUpdate=a))}if(o!==null){var d=i.baseState;s=0,u=c=a=null,l=o;do{var f=l.lane,y=l.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:y,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,g=l;switch(f=t,y=n,g.tag){case 1:if(v=g.payload,typeof v=="function"){d=v.call(y,d,f);break e}d=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=g.payload,f=typeof v=="function"?v.call(y,d,f):v,f==null)break e;d=ge({},d,f);break e;case 2:Un=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[l]:f.push(l))}else y={eventTime:y,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(c=u=y,a=d):u=u.next=y,s|=f;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;f=l,l=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(u===null&&(a=d),i.baseState=a,i.firstBaseUpdate=c,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);Ar|=s,e.lanes=s,e.memoizedState=d}}function Dh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=xc.transition;xc.transition={};try{e(!1),t()}finally{Z=n,xc.transition=r}}function lv(){return Ut().memoizedState}function mx(e,t,n){var r=rr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},av(e))cv(t,n);else if(n=Hg(e,t,n,r),n!==null){var i=st();on(n,e,r,i),uv(n,t,r)}}function gx(e,t,n){var r=rr(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(av(e))cv(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,l=o(s,n);if(i.hasEagerState=!0,i.eagerState=l,sn(l,s)){var a=t.interleaved;a===null?(i.next=i,Ad(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=Hg(e,t,i,r),n!==null&&(i=st(),on(n,e,r,i),uv(n,t,r))}}function av(e){var t=e.alternate;return e===me||t!==null&&t===me}function cv(e,t){xo=_l=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function uv(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,bd(e,n)}}var Al={readContext:Ht,useCallback:We,useContext:We,useEffect:We,useImperativeHandle:We,useInsertionEffect:We,useLayoutEffect:We,useMemo:We,useReducer:We,useRef:We,useState:We,useDebugValue:We,useDeferredValue:We,useTransition:We,useMutableSource:We,useSyncExternalStore:We,useId:We,unstable_isNewReconciler:!1},vx={readContext:Ht,useCallback:function(e,t){return dn().memoizedState=[e,t===void 0?null:t],e},useContext:Ht,useEffect:Lh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,nl(4194308,4,nv.bind(null,t,e),n)},useLayoutEffect:function(e,t){return nl(4194308,4,e,t)},useInsertionEffect:function(e,t){return nl(4,2,e,t)},useMemo:function(e,t){var n=dn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=dn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=mx.bind(null,me,e),[r.memoizedState,e]},useRef:function(e){var t=dn();return e={current:e},t.memoizedState=e},useState:Mh,useDebugValue:Vd,useDeferredValue:function(e){return dn().memoizedState=e},useTransition:function(){var e=Mh(!1),t=e[0];return e=px.bind(null,e[1]),dn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=me,i=dn();if(ce){if(n===void 0)throw Error(R(407));n=n()}else{if(n=t(),Fe===null)throw Error(R(349));_r&30||Qg(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Lh(Yg.bind(null,r,o,e),[e]),r.flags|=2048,Uo(9,Xg.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=dn(),t=Fe.identifierPrefix;if(ce){var n=Tn,r=$n;n=(r&~(1<<32-rn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Vo++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[pn]=t,e[Fo]=r,xv(e,t,!1,!1),t.stateNode=e;e:{switch(s=su(n,r),n){case"dialog":re("cancel",e),re("close",e),i=r;break;case"iframe":case"object":case"embed":re("load",e),i=r;break;case"video":case"audio":for(i=0;i$i&&(t.flags|=128,r=!0,Ki(o,!1),t.lanes=4194304)}else{if(!r)if(e=Il(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ki(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!ce)return Ge(t),null}else 2*Ce()-o.renderingStartTime>$i&&n!==1073741824&&(t.flags|=128,r=!0,Ki(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ce(),t.sibling=null,n=pe.current,ne(pe,r?n&1|2:n&1),t):(Ge(t),null);case 22:case 23:return Qd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ct&1073741824&&(Ge(t),t.subtreeFlags&6&&(t.flags|=8192)):Ge(t),null;case 24:return null;case 25:return null}throw Error(R(156,t.tag))}function $x(e,t){switch(Rd(t),t.tag){case 1:return gt(t.type)&&Sl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ci(),oe(mt),oe(Ye),Nd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ld(t),null;case 13:if(oe(pe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(R(340));wi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return oe(pe),null;case 4:return Ci(),null;case 10:return _d(t.type._context),null;case 22:case 23:return Qd(),null;case 24:return null;default:return null}}var Ds=!1,Qe=!1,Tx=typeof WeakSet=="function"?WeakSet:Set,A=null;function ri(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){xe(e,t,r)}else n.current=null}function Au(e,t,n){try{n()}catch(r){xe(e,t,r)}}var qh=!1;function Ex(e,t){if(gu=xl,e=Eg(),Td(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,l=-1,a=-1,c=0,u=0,d=e,f=null;t:for(;;){for(var y;d!==n||i!==0&&d.nodeType!==3||(l=s+i),d!==o||r!==0&&d.nodeType!==3||(a=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(y=d.firstChild)!==null;)f=d,d=y;for(;;){if(d===e)break t;if(f===n&&++c===i&&(l=s),f===o&&++u===r&&(a=s),(y=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=y}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(vu={focusedElem:e,selectionRange:n},xl=!1,A=t;A!==null;)if(t=A,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,A=e;else for(;A!==null;){t=A;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var g=v.memoizedProps,T=v.memoizedState,p=t.stateNode,h=p.getSnapshotBeforeUpdate(t.elementType===t.type?g:Kt(t.type,g),T);p.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(R(163))}}catch(x){xe(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,A=e;break}A=t.return}return v=qh,qh=!1,v}function xo(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&Au(t,n,o)}i=i.next}while(i!==r)}}function na(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Du(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Cv(e){var t=e.alternate;t!==null&&(e.alternate=null,Cv(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[pn],delete t[Fo],delete t[xu],delete t[cx],delete t[ux])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Sv(e){return e.tag===5||e.tag===3||e.tag===4}function Qh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Sv(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Mu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Cl));else if(r!==4&&(e=e.child,e!==null))for(Mu(e,t,n),e=e.sibling;e!==null;)Mu(e,t,n),e=e.sibling}function Lu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Lu(e,t,n),e=e.sibling;e!==null;)Lu(e,t,n),e=e.sibling}var ze=null,en=!1;function Fn(e,t,n){for(n=n.child;n!==null;)$v(e,t,n),n=n.sibling}function $v(e,t,n){if(mn&&typeof mn.onCommitFiberUnmount=="function")try{mn.onCommitFiberUnmount(Ql,n)}catch{}switch(n.tag){case 5:Qe||ri(n,t);case 6:var r=ze,i=en;ze=null,Fn(e,t,n),ze=r,en=i,ze!==null&&(en?(e=ze,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ze.removeChild(n.stateNode));break;case 18:ze!==null&&(en?(e=ze,n=n.stateNode,e.nodeType===8?gc(e.parentNode,n):e.nodeType===1&&gc(e,n),Ao(e)):gc(ze,n.stateNode));break;case 4:r=ze,i=en,ze=n.stateNode.containerInfo,en=!0,Fn(e,t,n),ze=r,en=i;break;case 0:case 11:case 14:case 15:if(!Qe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&Au(n,t,s),i=i.next}while(i!==r)}Fn(e,t,n);break;case 1:if(!Qe&&(ri(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){xe(n,t,l)}Fn(e,t,n);break;case 21:Fn(e,t,n);break;case 22:n.mode&1?(Qe=(r=Qe)||n.memoizedState!==null,Fn(e,t,n),Qe=r):Fn(e,t,n);break;default:Fn(e,t,n)}}function Xh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Tx),t.forEach(function(r){var i=Lx.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Zt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=Ce()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ox(r/1960))-r,10e?16:e,Yn===null)var r=!1;else{if(e=Yn,Yn=null,Ll=0,q&6)throw Error(R(331));var i=q;for(q|=4,A=e.current;A!==null;){var o=A,s=o.child;if(A.flags&16){var l=o.deletions;if(l!==null){for(var a=0;aCe()-Gd?Tr(e,0):Wd|=n),vt(e,t)}function Av(e,t){t===0&&(e.mode&1?(t=$s,$s<<=1,!($s&130023424)&&($s=4194304)):t=1);var n=st();e=In(e,t),e!==null&&(ns(e,t,n),vt(e,n))}function Mx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Av(e,n)}function Lx(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(R(314))}r!==null&&r.delete(t),Av(e,n)}var Dv;Dv=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||mt.current)pt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return pt=!1,Cx(e,t,n);pt=!!(e.flags&131072)}else pt=!1,ce&&t.flags&1048576&&Fg(t,El,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;rl(e,t),e=t.pendingProps;var i=xi(t,Ye.current);di(t,n),i=Bd(null,t,r,e,i,n);var o=zd();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,gt(r)?(o=!0,$l(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Dd(t),i.updater=ta,t.stateNode=i,i._reactInternals=t,Tu(t,r,e,n),t=Ou(null,t,r,!0,o,n)):(t.tag=0,ce&&o&&Ed(t),it(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(rl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Fx(r),e=Kt(r,e),i){case 0:t=Ru(null,t,r,e,n);break e;case 1:t=Uh(null,t,r,e,n);break e;case 11:t=Vh(null,t,r,e,n);break e;case 14:t=Hh(null,t,r,Kt(r.type,e),n);break e}throw Error(R(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Kt(r,i),Ru(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Kt(r,i),Uh(e,t,r,i,n);case 3:e:{if(vv(t),e===null)throw Error(R(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Ug(e,t),Pl(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Si(Error(R(423)),t),t=Wh(e,t,r,n,i);break e}else if(r!==i){i=Si(Error(R(424)),t),t=Wh(e,t,r,n,i);break e}else for($t=er(t.stateNode.containerInfo.firstChild),Tt=t,ce=!0,tn=null,n=Vg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(wi(),r===i){t=_n(e,t,n);break e}it(e,t,r,n)}t=t.child}return t;case 5:return Wg(t),e===null&&Cu(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,yu(r,i)?s=null:o!==null&&yu(r,o)&&(t.flags|=32),gv(e,t),it(e,t,s,n),t.child;case 6:return e===null&&Cu(t),null;case 13:return yv(e,t,n);case 4:return Md(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ki(t,null,r,n):it(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Kt(r,i),Vh(e,t,r,i,n);case 7:return it(e,t,t.pendingProps,n),t.child;case 8:return it(e,t,t.pendingProps.children,n),t.child;case 12:return it(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,ne(Rl,r._currentValue),r._currentValue=s,o!==null)if(sn(o.value,s)){if(o.children===i.children&&!mt.current){t=_n(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){s=o.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(o.tag===1){a=Rn(-1,n&-n),a.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?a.next=a:(a.next=u.next,u.next=a),c.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Su(o.return,n,t),l.lanes|=n;break}a=a.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(R(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Su(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}it(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,di(t,n),i=Ht(i),r=r(i),t.flags|=1,it(e,t,r,n),t.child;case 14:return r=t.type,i=Kt(r,t.pendingProps),i=Kt(r.type,i),Hh(e,t,r,i,n);case 15:return pv(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Kt(r,i),rl(e,t),t.tag=1,gt(r)?(e=!0,$l(t)):e=!1,di(t,n),dv(t,r,i),Tu(t,r,i,n),Ou(null,t,r,!0,e,n);case 19:return bv(e,t,n);case 22:return mv(e,t,n)}throw Error(R(156,t.tag))};function Mv(e,t){return ag(e,t)}function Nx(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jt(e,t,n,r){return new Nx(e,t,n,r)}function Yd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fx(e){if(typeof e=="function")return Yd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===md)return 11;if(e===gd)return 14}return 2}function ir(e,t){var n=e.alternate;return n===null?(n=jt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function sl(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")Yd(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Qr:return Er(n.children,i,o,t);case pd:s=8,i|=8;break;case Yc:return e=jt(12,n,t,i|2),e.elementType=Yc,e.lanes=o,e;case Jc:return e=jt(13,n,t,i),e.elementType=Jc,e.lanes=o,e;case Zc:return e=jt(19,n,t,i),e.elementType=Zc,e.lanes=o,e;case Wm:return ia(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Hm:s=10;break e;case Um:s=9;break e;case md:s=11;break e;case gd:s=14;break e;case Hn:s=16,r=null;break e}throw Error(R(130,e==null?e:typeof e,""))}return t=jt(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Er(e,t,n,r){return e=jt(7,e,r,t),e.lanes=n,e}function ia(e,t,n,r){return e=jt(22,e,r,t),e.elementType=Wm,e.lanes=n,e.stateNode={isHidden:!1},e}function Sc(e,t,n){return e=jt(6,e,null,t),e.lanes=n,e}function $c(e,t,n){return t=jt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Bx(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=oc(0),this.expirationTimes=oc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=oc(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Jd(e,t,n,r,i,o,s,l,a){return e=new Bx(e,t,n,l,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=jt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Dd(o),e}function zx(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Bv)}catch(e){console.error(e)}}Bv(),Bm.exports=Ot;var Wx=Bm.exports,rp=Wx;Qc.createRoot=rp.createRoot,Qc.hydrateRoot=rp.hydrateRoot;const zv=C.createContext({message:null,setMessage:e=>{}}),Gx=({children:e})=>{const[t,n]=C.useState(null);return E.jsx(zv.Provider,{value:{message:t,setMessage:n},children:e})},jv=()=>C.useContext(zv),qx=()=>E.jsxs(E.Fragment,{children:["Note: Not implemented yet.",E.jsx("br",{})," Will show events from your last published module(s)."]});class Vv{constructor(){this.method="",this.methodUuid="",this.dataUuid="",this.json=null}getMethod(){return this.method}getMethodUuid(){return this.methodUuid}getDataUuid(){return this.dataUuid}getJson(){return this.json}update(t){const n=t.header.method,r=t.header.methodUuid,i=t.header.dataUuid;return this.method!==""&&n!==this.method?(console.error(`Trying to update [${this.json.method}] using a JSON from [${n}]`),!1):this.json===null||this.methodUuid!==r||i>this.dataUuid?(this.method=n,this.methodUuid=r,this.dataUuid=i,this.json=t,this.deltaDetected(),!0):!1}deltaDetected(){}}class Qx extends Vv{isWorkdirStatusUpdateNeeded(t){try{const n=t===null||t.getJson()===null||t.getMethod()===""||t.getMethodUuid()===""||t.getDataUuid()==="";for(const r of this.getJson().versions)if(r.method==="getWorkdirStatus"){const i=r.methodUuid,o=r.dataUuid;if(n||t.getMethodUuid()!==i||t.getDataUuid()0?this.suiClientVersionShort=this.suiClientVersion.split("-")[0]:this.suiClientVersionShort="",this.isLoaded=!0}catch(t){console.error(`Problem with SuibaseJsonWorkdirStatus loading: ${t}`)}}}const Rr=["mainnet","testnet","devnet","localnet"],ju=["Mainnet","Testnet","Devnet","Localnet"],Vu="suibase.dashboard",Yx="suibase.console",Hu="suibase.explorer";class Jx{constructor(){Ue(this,"vsCodeApi");typeof acquireVsCodeApi=="function"&&(this.vsCodeApi=acquireVsCodeApi())}postMessage(t){this.vsCodeApi?this.vsCodeApi.postMessage(t):console.log(t)}getState(){if(this.vsCodeApi)return this.vsCodeApi.getState();{const t=localStorage.getItem("vscodeState");return t?JSON.parse(t):void 0}}setState(t){return this.vsCodeApi?this.vsCodeApi.setState(t):(localStorage.setItem("vscodeState",JSON.stringify(t)),t)}}const Bl=new Jx;class tf{constructor(t,n){this.name=t,this.sender=n}}class Hv extends tf{constructor(t,n,r){super("WorkdirCommand",t),this.workdirIdx=n,this.command=r}}class Zx extends tf{constructor(t){super("InitView",t)}}class Kx extends tf{constructor(t,n,r,i){super("RequestWorkdirStatus",t),this.workdirIdx=n,this.methodUuid=r,this.dataUuid=i}}class ew{constructor(t,n){Ue(this,"label");Ue(this,"workdir");Ue(this,"workdirIdx");Ue(this,"versions");Ue(this,"workdirStatus");this.label=t.charAt(0).toUpperCase()+t.slice(1),this.workdir=t,this.workdirIdx=n,this.versions=new Qx,this.workdirStatus=new Xx}}class tw{constructor(){Ue(this,"_activeWorkdir");Ue(this,"_activeWorkdirIdx");Ue(this,"_activeLoaded");this._activeWorkdir="",this._activeWorkdirIdx=0,this._activeLoaded=!1}get activeWorkdir(){return this._activeWorkdir}set activeWorkdir(t){const n=Rr.indexOf(t);if(n<0){console.error(`Invalid workdir: ${t}`);return}this._activeWorkdirIdx=n,this._activeWorkdir=t,this._activeLoaded=!0}get activeWorkdirIdx(){return this._activeWorkdirIdx}set activeWorkdirIdx(t){if(t<0||t>=Rr.length){console.error(`Invalid workdirIdx: ${t}`);return}this._activeWorkdir=Rr[t],this._activeWorkdirIdx=t,this._activeLoaded=!0}get activeLoaded(){return this._activeLoaded}}const Uv=e=>{const{message:t}=jv(),n=C.useRef(new tw),[r]=C.useState(Rr.map((s,l)=>new ew(s,l))),[i,o]=C.useState(!1);return C.useEffect(()=>{let s=n.current.activeLoaded===!1;if(!s){for(let l=0;l{try{if(t&&t.name){let s=!1;switch(t.name){case"UpdateVersions":{const l=r[t.workdirIdx];if(l.versions.update(t.json)){s=!0;const[c,u,d]=l.versions.isWorkdirStatusUpdateNeeded(l.workdirStatus);c&&Bl.postMessage(new Kx(e,t.workdirIdx,u,d))}n.current.activeWorkdir!==t.json.asuiSelection&&(n.current.activeWorkdir=t.json.asuiSelection,s=!0);break}case"UpdateWorkdirStatus":{r[t.workdirIdx].workdirStatus.update(t.json)&&(s=!0);break}default:console.log("Received an unknown command",t)}s&&o(l=>!l)}}catch(s){console.error("An error occurred in useCommonController:",s)}},[t,r,e]),{commonTrigger:i,common:n,workdirs:r}},ar=function(){if(typeof globalThis<"u")return globalThis;if(typeof global<"u")return global;if(typeof self<"u")return self;if(typeof window<"u")return window;try{return new Function("return this")()}catch{return{}}}();ar.trustedTypes===void 0&&(ar.trustedTypes={createPolicy:(e,t)=>t});const Wv={configurable:!1,enumerable:!1,writable:!1};ar.FAST===void 0&&Reflect.defineProperty(ar,"FAST",Object.assign({value:Object.create(null)},Wv));const Wo=ar.FAST;if(Wo.getById===void 0){const e=Object.create(null);Reflect.defineProperty(Wo,"getById",Object.assign({value(t,n){let r=e[t];return r===void 0&&(r=n?e[t]=n():null),r}},Wv))}const Or=Object.freeze([]);function Gv(){const e=new WeakMap;return function(t){let n=e.get(t);if(n===void 0){let r=Reflect.getPrototypeOf(t);for(;n===void 0&&r!==null;)n=e.get(r),r=Reflect.getPrototypeOf(r);n=n===void 0?[]:n.slice(0),e.set(t,n)}return n}}const Tc=ar.FAST.getById(1,()=>{const e=[],t=[];function n(){if(t.length)throw t.shift()}function r(s){try{s.call()}catch(l){t.push(l),setTimeout(n,0)}}function i(){let l=0;for(;l1024){for(let a=0,c=e.length-l;ae});let Ec=qv;const Co=`fast-${Math.random().toString(36).substring(2,8)}`,Qv=`${Co}{`,nf=`}${Co}`,H=Object.freeze({supportsAdoptedStyleSheets:Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype,setHTMLPolicy(e){if(Ec!==qv)throw new Error("The HTML policy can only be set once.");Ec=e},createHTML(e){return Ec.createHTML(e)},isMarker(e){return e&&e.nodeType===8&&e.data.startsWith(Co)},extractDirectiveIndexFromMarker(e){return parseInt(e.data.replace(`${Co}:`,""))},createInterpolationPlaceholder(e){return`${Qv}${e}${nf}`},createCustomAttributePlaceholder(e,t){return`${e}="${this.createInterpolationPlaceholder(t)}"`},createBlockPlaceholder(e){return``},queueUpdate:Tc.enqueue,processUpdates:Tc.process,nextUpdate(){return new Promise(Tc.enqueue)},setAttribute(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)},setBooleanAttribute(e,t,n){n?e.setAttribute(t,""):e.removeAttribute(t)},removeChildNodes(e){for(let t=e.firstChild;t!==null;t=e.firstChild)e.removeChild(t)},createTemplateWalker(e){return document.createTreeWalker(e,133,null,!1)}});class zl{constructor(t,n){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.source=t,this.sub1=n}has(t){return this.spillover===void 0?this.sub1===t||this.sub2===t:this.spillover.indexOf(t)!==-1}subscribe(t){const n=this.spillover;if(n===void 0){if(this.has(t))return;if(this.sub1===void 0){this.sub1=t;return}if(this.sub2===void 0){this.sub2=t;return}this.spillover=[this.sub1,this.sub2,t],this.sub1=void 0,this.sub2=void 0}else n.indexOf(t)===-1&&n.push(t)}unsubscribe(t){const n=this.spillover;if(n===void 0)this.sub1===t?this.sub1=void 0:this.sub2===t&&(this.sub2=void 0);else{const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}notify(t){const n=this.spillover,r=this.source;if(n===void 0){const i=this.sub1,o=this.sub2;i!==void 0&&i.handleChange(r,t),o!==void 0&&o.handleChange(r,t)}else for(let i=0,o=n.length;i{const e=/(:|&&|\|\||if)/,t=new WeakMap,n=H.queueUpdate;let r,i=c=>{throw new Error("Must call enableArrayObservation before observing arrays.")};function o(c){let u=c.$fastController||t.get(c);return u===void 0&&(Array.isArray(c)?u=i(c):t.set(c,u=new Xv(c))),u}const s=Gv();class l{constructor(u){this.name=u,this.field=`_${u}`,this.callback=`${u}Changed`}getValue(u){return r!==void 0&&r.watch(u,this.name),u[this.field]}setValue(u,d){const f=this.field,y=u[f];if(y!==d){u[f]=d;const v=u[this.callback];typeof v=="function"&&v.call(u,y,d),o(u).notify(this.name)}}}class a extends zl{constructor(u,d,f=!1){super(u,d),this.binding=u,this.isVolatileBinding=f,this.needsRefresh=!0,this.needsQueue=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}observe(u,d){this.needsRefresh&&this.last!==null&&this.disconnect();const f=r;r=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;const y=this.binding(u,d);return r=f,y}disconnect(){if(this.last!==null){let u=this.first;for(;u!==void 0;)u.notifier.unsubscribe(this,u.propertyName),u=u.next;this.last=null,this.needsRefresh=this.needsQueue=!0}}watch(u,d){const f=this.last,y=o(u),v=f===null?this.first:{};if(v.propertySource=u,v.propertyName=d,v.notifier=y,y.subscribe(this,d),f!==null){if(!this.needsRefresh){let g;r=void 0,g=f.propertySource[f.propertyName],r=this,u===g&&(this.needsRefresh=!0)}f.next=v}this.last=v}handleChange(){this.needsQueue&&(this.needsQueue=!1,n(this))}call(){this.last!==null&&(this.needsQueue=!0,this.notify(this))}records(){let u=this.first;return{next:()=>{const d=u;return d===void 0?{value:void 0,done:!0}:(u=u.next,{value:d,done:!1})},[Symbol.iterator]:function(){return this}}}}return Object.freeze({setArrayObserverFactory(c){i=c},getNotifier:o,track(c,u){r!==void 0&&r.watch(c,u)},trackVolatile(){r!==void 0&&(r.needsRefresh=!0)},notify(c,u){o(c).notify(u)},defineProperty(c,u){typeof u=="string"&&(u=new l(u)),s(c).push(u),Reflect.defineProperty(c,u.name,{enumerable:!0,get:function(){return u.getValue(this)},set:function(d){u.setValue(this,d)}})},getAccessors:s,binding(c,u,d=this.isVolatileBinding(c)){return new a(c,u,d)},isVolatileBinding(c){return e.test(c.toString())}})});function D(e,t){V.defineProperty(e,t)}function nw(e,t,n){return Object.assign({},n,{get:function(){return V.trackVolatile(),n.get.apply(this)}})}const ip=Wo.getById(3,()=>{let e=null;return{get(){return e},set(t){e=t}}});class Go{constructor(){this.index=0,this.length=0,this.parent=null,this.parentContext=null}get event(){return ip.get()}get isEven(){return this.index%2===0}get isOdd(){return this.index%2!==0}get isFirst(){return this.index===0}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}static setEvent(t){ip.set(t)}}V.defineProperty(Go.prototype,"index");V.defineProperty(Go.prototype,"length");const So=Object.seal(new Go);class ca{constructor(){this.targetIndex=0}}class Yv extends ca{constructor(){super(...arguments),this.createPlaceholder=H.createInterpolationPlaceholder}}class rf extends ca{constructor(t,n,r){super(),this.name=t,this.behavior=n,this.options=r}createPlaceholder(t){return H.createCustomAttributePlaceholder(this.name,t)}createBehavior(t){return new this.behavior(t,this.options)}}function rw(e,t){this.source=e,this.context=t,this.bindingObserver===null&&(this.bindingObserver=V.binding(this.binding,this,this.isBindingVolatile)),this.updateTarget(this.bindingObserver.observe(e,t))}function iw(e,t){this.source=e,this.context=t,this.target.addEventListener(this.targetName,this)}function ow(){this.bindingObserver.disconnect(),this.source=null,this.context=null}function sw(){this.bindingObserver.disconnect(),this.source=null,this.context=null;const e=this.target.$fastView;e!==void 0&&e.isComposed&&(e.unbind(),e.needsBindOnly=!0)}function lw(){this.target.removeEventListener(this.targetName,this),this.source=null,this.context=null}function aw(e){H.setAttribute(this.target,this.targetName,e)}function cw(e){H.setBooleanAttribute(this.target,this.targetName,e)}function uw(e){if(e==null&&(e=""),e.create){this.target.textContent="";let t=this.target.$fastView;t===void 0?t=e.create():this.target.$fastTemplate!==e&&(t.isComposed&&(t.remove(),t.unbind()),t=e.create()),t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(this.source,this.context)):(t.isComposed=!0,t.bind(this.source,this.context),t.insertBefore(this.target),this.target.$fastView=t,this.target.$fastTemplate=e)}else{const t=this.target.$fastView;t!==void 0&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),this.target.textContent=e}}function dw(e){this.target[this.targetName]=e}function fw(e){const t=this.classVersions||Object.create(null),n=this.target;let r=this.version||0;if(e!=null&&e.length){const i=e.split(/\s+/);for(let o=0,s=i.length;oH.createHTML(n(r,i))}break;case"?":this.cleanedTargetName=t.substr(1),this.updateTarget=cw;break;case"@":this.cleanedTargetName=t.substr(1),this.bind=iw,this.unbind=lw;break;default:this.cleanedTargetName=t,t==="class"&&(this.updateTarget=fw);break}}targetAtContent(){this.updateTarget=uw,this.unbind=sw}createBehavior(t){return new hw(t,this.binding,this.isBindingVolatile,this.bind,this.unbind,this.updateTarget,this.cleanedTargetName)}}class hw{constructor(t,n,r,i,o,s,l){this.source=null,this.context=null,this.bindingObserver=null,this.target=t,this.binding=n,this.isBindingVolatile=r,this.bind=i,this.unbind=o,this.updateTarget=s,this.targetName=l}handleChange(){this.updateTarget(this.bindingObserver.observe(this.source,this.context))}handleEvent(t){Go.setEvent(t);const n=this.binding(this.source,this.context);Go.setEvent(null),n!==!0&&t.preventDefault()}}let Rc=null;class sf{addFactory(t){t.targetIndex=this.targetIndex,this.behaviorFactories.push(t)}captureContentBinding(t){t.targetAtContent(),this.addFactory(t)}reset(){this.behaviorFactories=[],this.targetIndex=-1}release(){Rc=this}static borrow(t){const n=Rc||new sf;return n.directives=t,n.reset(),Rc=null,n}}function pw(e){if(e.length===1)return e[0];let t;const n=e.length,r=e.map(s=>typeof s=="string"?()=>s:(t=s.targetName||t,s.binding)),i=(s,l)=>{let a="";for(let c=0;cl),c.targetName=s.name):c=pw(a),c!==null&&(t.removeAttributeNode(s),i--,o--,e.addFactory(c))}}function gw(e,t,n){const r=Jv(e,t.textContent);if(r!==null){let i=t;for(let o=0,s=r.length;o0}const n=this.fragment.cloneNode(!0),r=this.viewBehaviorFactories,i=new Array(this.behaviorCount),o=H.createTemplateWalker(n);let s=0,l=this.targetOffset,a=o.nextNode();for(let c=r.length;s=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function Y(e,...t){const n=[];let r="";for(let i=0,o=e.length-1;ia}if(typeof l=="function"&&(l=new of(l)),l instanceof Yv){const a=yw.exec(s);a!==null&&(l.targetName=a[2])}l instanceof ca?(r+=l.createPlaceholder(n.length),n.push(l)):r+=l}return r+=e[e.length-1],new sp(r,n)}class yt{constructor(){this.targets=new WeakSet}addStylesTo(t){this.targets.add(t)}removeStylesFrom(t){this.targets.delete(t)}isAttachedTo(t){return this.targets.has(t)}withBehaviors(...t){return this.behaviors=this.behaviors===null?t:this.behaviors.concat(t),this}}yt.create=(()=>{if(H.supportsAdoptedStyleSheets){const e=new Map;return t=>new bw(t,e)}return e=>new kw(e)})();function lf(e){return e.map(t=>t instanceof yt?lf(t.styles):[t]).reduce((t,n)=>t.concat(n),[])}function Kv(e){return e.map(t=>t instanceof yt?t.behaviors:null).reduce((t,n)=>n===null?t:(t===null&&(t=[]),t.concat(n)),null)}const ey=Symbol("prependToAdoptedStyleSheets");function ty(e){const t=[],n=[];return e.forEach(r=>(r[ey]?t:n).push(r)),{prepend:t,append:n}}let ny=(e,t)=>{const{prepend:n,append:r}=ty(t);e.adoptedStyleSheets=[...n,...e.adoptedStyleSheets,...r]},ry=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter(n=>t.indexOf(n)===-1)};if(H.supportsAdoptedStyleSheets)try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),ny=(e,t)=>{const{prepend:n,append:r}=ty(t);e.adoptedStyleSheets.splice(0,0,...n),e.adoptedStyleSheets.push(...r)},ry=(e,t)=>{for(const n of t){const r=e.adoptedStyleSheets.indexOf(n);r!==-1&&e.adoptedStyleSheets.splice(r,1)}}}catch{}class bw extends yt{constructor(t,n){super(),this.styles=t,this.styleSheetCache=n,this._styleSheets=void 0,this.behaviors=Kv(t)}get styleSheets(){if(this._styleSheets===void 0){const t=this.styles,n=this.styleSheetCache;this._styleSheets=lf(t).map(r=>{if(r instanceof CSSStyleSheet)return r;let i=n.get(r);return i===void 0&&(i=new CSSStyleSheet,i.replaceSync(r),n.set(r,i)),i})}return this._styleSheets}addStylesTo(t){ny(t,this.styleSheets),super.addStylesTo(t)}removeStylesFrom(t){ry(t,this.styleSheets),super.removeStylesFrom(t)}}let xw=0;function ww(){return`fast-style-class-${++xw}`}class kw extends yt{constructor(t){super(),this.styles=t,this.behaviors=null,this.behaviors=Kv(t),this.styleSheets=lf(t),this.styleClass=ww()}addStylesTo(t){const n=this.styleSheets,r=this.styleClass;t=this.normalizeTarget(t);for(let i=0;i{r.add(t);const i=t[this.fieldName];switch(n){case"reflect":const o=this.converter;H.setAttribute(t,this.attribute,o!==void 0?o.toView(i):i);break;case"boolean":H.setBooleanAttribute(t,this.attribute,i);break}r.delete(t)})}static collect(t,...n){const r=[];n.push(jl.locate(t));for(let i=0,o=n.length;i1&&(n.property=o),jl.locate(i.constructor).push(n)}if(arguments.length>1){n={},r(e,t);return}return n=e===void 0?{}:e,r}const lp={mode:"open"},ap={},Uu=Wo.getById(4,()=>{const e=new Map;return Object.freeze({register(t){return e.has(t.type)?!1:(e.set(t.type,t),!0)},getByType(t){return e.get(t)}})});class ss{constructor(t,n=t.definition){typeof n=="string"&&(n={name:n}),this.type=t,this.name=n.name,this.template=n.template;const r=Vl.collect(t,n.attributes),i=new Array(r.length),o={},s={};for(let l=0,a=r.length;l0){const o=this.boundObservables=Object.create(null);for(let s=0,l=i.length;s0||n>0;){if(t===0){i.push(Wu),n--;continue}if(n===0){i.push(Gu),t--;continue}const o=e[t-1][n-1],s=e[t-1][n],l=e[t][n-1];let a;s=0){e.splice(l,1),l--,s-=a.addedCount-a.removed.length,i.addedCount+=a.addedCount-c;const u=i.removed.length+a.removed.length-c;if(!i.addedCount&&!u)o=!0;else{let d=a.removed;if(i.indexa.index+a.addedCount){const f=i.removed.slice(a.index+a.addedCount-i.index);up.apply(d,f)}i.removed=d,a.indexr?n=r-e.addedCount:n<0&&(n=r+e.removed.length+n-e.addedCount),n<0&&(n=0),e.index=n,e}class Aw extends zl{constructor(t){super(t),this.oldCollection=void 0,this.splices=void 0,this.needsQueue=!0,this.call=this.flush,Reflect.defineProperty(t,"$fastController",{value:this,enumerable:!1})}subscribe(t){this.flush(),super.subscribe(t)}addSplice(t){this.splices===void 0?this.splices=[t]:this.splices.push(t),this.needsQueue&&(this.needsQueue=!1,H.queueUpdate(this))}reset(t){this.oldCollection=t,this.needsQueue&&(this.needsQueue=!1,H.queueUpdate(this))}flush(){const t=this.splices,n=this.oldCollection;if(t===void 0&&n===void 0)return;this.needsQueue=!0,this.splices=void 0,this.oldCollection=void 0;const r=n===void 0?_w(this.source,t):cy(this.source,0,this.source.length,n,0,n.length);this.notify(r)}}function Dw(){if(dp)return;dp=!0,V.setArrayObserverFactory(a=>new Aw(a));const e=Array.prototype;if(e.$fastPatch)return;Reflect.defineProperty(e,"$fastPatch",{value:1,enumerable:!1});const t=e.pop,n=e.push,r=e.reverse,i=e.shift,o=e.sort,s=e.splice,l=e.unshift;e.pop=function(){const a=this.length>0,c=t.apply(this,arguments),u=this.$fastController;return u!==void 0&&a&&u.addSplice(nn(this.length,[c],0)),c},e.push=function(){const a=n.apply(this,arguments),c=this.$fastController;return c!==void 0&&c.addSplice(Ic(nn(this.length-arguments.length,[],arguments.length),this)),a},e.reverse=function(){let a;const c=this.$fastController;c!==void 0&&(c.flush(),a=this.slice());const u=r.apply(this,arguments);return c!==void 0&&c.reset(a),u},e.shift=function(){const a=this.length>0,c=i.apply(this,arguments),u=this.$fastController;return u!==void 0&&a&&u.addSplice(nn(0,[c],0)),c},e.sort=function(){let a;const c=this.$fastController;c!==void 0&&(c.flush(),a=this.slice());const u=o.apply(this,arguments);return c!==void 0&&c.reset(a),u},e.splice=function(){const a=s.apply(this,arguments),c=this.$fastController;return c!==void 0&&c.addSplice(Ic(nn(+arguments[0],a,arguments.length>2?arguments.length-2:0),this)),a},e.unshift=function(){const a=l.apply(this,arguments),c=this.$fastController;return c!==void 0&&c.addSplice(Ic(nn(0,[],arguments.length),this)),a}}class Mw{constructor(t,n){this.target=t,this.propertyName=n}bind(t){t[this.propertyName]=this.target}unbind(){}}function at(e){return new rf("fast-ref",Mw,e)}const uy=e=>typeof e=="function",Lw=()=>null;function fp(e){return e===void 0?Lw:uy(e)?e:()=>e}function cf(e,t,n){const r=uy(e)?e:()=>e,i=fp(t),o=fp(n);return(s,l)=>r(s,l)?i(s,l):o(s,l)}function Nw(e,t,n,r){e.bind(t[n],r)}function Fw(e,t,n,r){const i=Object.create(r);i.index=n,i.length=t.length,e.bind(t[n],i)}class Bw{constructor(t,n,r,i,o,s){this.location=t,this.itemsBinding=n,this.templateBinding=i,this.options=s,this.source=null,this.views=[],this.items=null,this.itemsObserver=null,this.originalContext=void 0,this.childContext=void 0,this.bindView=Nw,this.itemsBindingObserver=V.binding(n,this,r),this.templateBindingObserver=V.binding(i,this,o),s.positioning&&(this.bindView=Fw)}bind(t,n){this.source=t,this.originalContext=n,this.childContext=Object.create(n),this.childContext.parent=t,this.childContext.parentContext=this.originalContext,this.items=this.itemsBindingObserver.observe(t,this.originalContext),this.template=this.templateBindingObserver.observe(t,this.originalContext),this.observeItems(!0),this.refreshAllViews()}unbind(){this.source=null,this.items=null,this.itemsObserver!==null&&this.itemsObserver.unsubscribe(this),this.unbindAllViews(),this.itemsBindingObserver.disconnect(),this.templateBindingObserver.disconnect()}handleChange(t,n){t===this.itemsBinding?(this.items=this.itemsBindingObserver.observe(this.source,this.originalContext),this.observeItems(),this.refreshAllViews()):t===this.templateBinding?(this.template=this.templateBindingObserver.observe(this.source,this.originalContext),this.refreshAllViews(!0)):this.updateViews(n)}observeItems(t=!1){if(!this.items){this.items=Or;return}const n=this.itemsObserver,r=this.itemsObserver=V.getNotifier(this.items),i=n!==r;i&&n!==null&&n.unsubscribe(this),(i||t)&&r.subscribe(this)}updateViews(t){const n=this.childContext,r=this.views,i=this.bindView,o=this.items,s=this.template,l=this.options.recycle,a=[];let c=0,u=0;for(let d=0,f=t.length;d0?(g<=m&&h.length>0?(k=h[g],g++):(k=a[c],c++),u--):k=s.create(),r.splice(T,0,k),i(k,o,T,n),k.insertBefore(w)}h[g]&&a.push(...h.slice(g))}for(let d=c,f=a.length;dr.name===n),this.source=t,this.updateTarget(this.computeNodes()),this.shouldUpdate&&this.observe()}unbind(){this.updateTarget(Or),this.source=null,this.shouldUpdate&&this.disconnect()}handleEvent(){this.updateTarget(this.computeNodes())}computeNodes(){let t=this.getNodes();return this.options.filter!==void 0&&(t=t.filter(this.options.filter)),t}updateTarget(t){this.source[this.options.property]=t}}class zw extends fy{constructor(t,n){super(t,n)}observe(){this.target.addEventListener("slotchange",this)}disconnect(){this.target.removeEventListener("slotchange",this)}getNodes(){return this.target.assignedNodes(this.options)}}function Wt(e){return typeof e=="string"&&(e={property:e}),new rf("fast-slotted",zw,e)}class jw extends fy{constructor(t,n){super(t,n),this.observer=null,n.childList=!0}observe(){this.observer===null&&(this.observer=new MutationObserver(this.handleEvent.bind(this))),this.observer.observe(this.target,this.options)}disconnect(){this.observer.disconnect()}getNodes(){return"subtree"in this.options?Array.from(this.target.querySelectorAll(this.options.selector)):Array.from(this.target.childNodes)}}function hy(e){return typeof e=="string"&&(e={property:e}),new rf("fast-children",jw,e)}class Mi{handleStartContentChange(){this.startContainer.classList.toggle("start",this.start.assignedNodes().length>0)}handleEndContentChange(){this.endContainer.classList.toggle("end",this.end.assignedNodes().length>0)}}const Li=(e,t)=>Y` +`+o.stack}return{value:e,source:t,stack:i,digest:null}}function Cc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ru(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var xx=typeof WeakMap=="function"?WeakMap:Map;function fv(e,t,n){n=Rn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ml||(Ml=!0,Fu=r),Ru(e,t)},n}function hv(e,t,n){n=Rn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Ru(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){Ru(e,t),typeof r!="function"&&(nr===null?nr=new Set([this]):nr.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Bh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new xx;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Dx.bind(null,e,t,n),t.then(e,e))}function zh(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function jh(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Rn(-1,1),t.tag=2,tr(n,t,1))),n.lanes|=1),e)}var wx=Dn.ReactCurrentOwner,pt=!1;function it(e,t,n,r){t.child=e===null?Vg(t,null,n,r):Ci(t,e.child,n,r)}function Vh(e,t,n,r,i){n=n.render;var o=t.ref;return fi(t,i),r=Bd(e,t,n,r,o,i),n=zd(),e!==null&&!pt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,_n(e,t,i)):(ce&&n&&Ed(t),t.flags|=1,it(e,t,r,i),t.child)}function Hh(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!Yd(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,pv(e,t,o,r,i)):(e=sl(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:Lo,n(s,r)&&e.ref===t.ref)return _n(e,t,i)}return t.flags|=1,e=ir(o,r),e.ref=t.ref,e.return=t,t.child=e}function pv(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(Lo(o,r)&&e.ref===t.ref)if(pt=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(pt=!0);else return t.lanes=e.lanes,_n(e,t,i)}return Ou(e,t,n,r,i)}function mv(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ne(oi,Ct),Ct|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ne(oi,Ct),Ct|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,ne(oi,Ct),Ct|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,ne(oi,Ct),Ct|=r;return it(e,t,i,n),t.child}function gv(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ou(e,t,n,r,i){var o=gt(n)?Ir:Ye.current;return o=wi(t,o),fi(t,i),n=Bd(e,t,n,r,o,i),r=zd(),e!==null&&!pt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,_n(e,t,i)):(ce&&r&&Ed(t),t.flags|=1,it(e,t,n,i),t.child)}function Uh(e,t,n,r,i){if(gt(n)){var o=!0;$l(t)}else o=!1;if(fi(t,i),t.stateNode===null)rl(e,t),dv(t,n,r),Eu(t,n,r,i),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var a=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=Ht(c):(c=gt(n)?Ir:Ye.current,c=wi(t,c));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||a!==c)&&Fh(t,s,r,c),Un=!1;var f=t.memoizedState;s.state=f,Il(t,r,s,i),a=t.memoizedState,l!==r||f!==a||mt.current||Un?(typeof u=="function"&&(Tu(t,n,u,r),a=t.memoizedState),(l=Un||Nh(t,n,l,r,f,a,c))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),s.props=r,s.state=a,s.context=c,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,Ug(e,t),l=t.memoizedProps,c=t.type===t.elementType?l:Kt(t.type,l),s.props=c,d=t.pendingProps,f=s.context,a=n.contextType,typeof a=="object"&&a!==null?a=Ht(a):(a=gt(n)?Ir:Ye.current,a=wi(t,a));var y=n.getDerivedStateFromProps;(u=typeof y=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==d||f!==a)&&Fh(t,s,r,a),Un=!1,f=t.memoizedState,s.state=f,Il(t,r,s,i);var v=t.memoizedState;l!==d||f!==v||mt.current||Un?(typeof y=="function"&&(Tu(t,n,y,r),v=t.memoizedState),(c=Un||Nh(t,n,c,r,f,v,a)||!1)?(u||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,v,a),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,v,a)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),s.props=r,s.state=v,s.context=a,r=c):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Iu(e,t,n,r,o,i)}function Iu(e,t,n,r,i,o){gv(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return i&&Oh(t,n,!1),_n(e,t,o);r=t.stateNode,wx.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Ci(t,e.child,null,o),t.child=Ci(t,null,l,o)):it(e,t,l,o),t.memoizedState=r.state,i&&Oh(t,n,!0),t.child}function vv(e){var t=e.stateNode;t.pendingContext?Rh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Rh(e,t.context,!1),Md(e,t.containerInfo)}function Wh(e,t,n,r,i){return ki(),Od(i),t.flags|=256,it(e,t,n,r),t.child}var Pu={dehydrated:null,treeContext:null,retryLane:0};function _u(e){return{baseLanes:e,cachePool:null,transitions:null}}function yv(e,t,n){var r=t.pendingProps,i=pe.current,o=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),ne(pe,i&1),e===null)return Su(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,o?(r=t.mode,o=t.child,s={mode:"hidden",children:s},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=s):o=oa(s,r,0,null),e=Er(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=_u(n),t.memoizedState=Pu,e):Hd(t,s));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return kx(e,t,s,r,l,i,n);if(o){o=r.fallback,s=t.mode,i=e.child,l=i.sibling;var a={mode:"hidden",children:r.children};return!(s&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=ir(i,a),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?o=ir(l,o):(o=Er(o,s,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,s=e.child.memoizedState,s=s===null?_u(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=e.childLanes&~n,t.memoizedState=Pu,r}return o=e.child,e=o.sibling,r=ir(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Hd(e,t){return t=oa({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ds(e,t,n,r){return r!==null&&Od(r),Ci(t,e.child,null,n),e=Hd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function kx(e,t,n,r,i,o,s){if(n)return t.flags&256?(t.flags&=-257,r=Cc(Error(R(422))),Ds(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=oa({mode:"visible",children:r.children},i,0,null),o=Er(o,i,s,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&Ci(t,e.child,null,s),t.child.memoizedState=_u(s),t.memoizedState=Pu,o);if(!(t.mode&1))return Ds(e,t,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,o=Error(R(419)),r=Cc(o,r,void 0),Ds(e,t,s,r)}if(l=(s&e.childLanes)!==0,pt||l){if(r=Fe,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|s)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,Pn(e,i),on(r,e,i,-1))}return Xd(),r=Cc(Error(R(421))),Ds(e,t,s,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=Mx.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,$t=er(i.nextSibling),Tt=t,ce=!0,tn=null,e!==null&&(Nt[Ft++]=$n,Nt[Ft++]=Tn,Nt[Ft++]=Pr,$n=e.id,Tn=e.overflow,Pr=t),t=Hd(t,r.children),t.flags|=4096,t)}function Gh(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),$u(e.return,t,n)}function Sc(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function bv(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(it(e,t,r.children,n),r=pe.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Gh(e,n,t);else if(e.tag===19)Gh(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ne(pe,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Pl(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Sc(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Pl(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Sc(t,!0,n,null,o);break;case"together":Sc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function rl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function _n(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ar|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(R(153));if(t.child!==null){for(e=t.child,n=ir(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ir(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Cx(e,t,n){switch(t.tag){case 3:vv(t),ki();break;case 5:Wg(t);break;case 1:gt(t.type)&&$l(t);break;case 4:Md(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;ne(Rl,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ne(pe,pe.current&1),t.flags|=128,null):n&t.child.childLanes?yv(e,t,n):(ne(pe,pe.current&1),e=_n(e,t,n),e!==null?e.sibling:null);ne(pe,pe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return bv(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ne(pe,pe.current),r)break;return null;case 22:case 23:return t.lanes=0,mv(e,t,n)}return _n(e,t,n)}var xv,Au,wv,kv;xv=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Au=function(){};wv=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Cr(gn.current);var o=null;switch(n){case"input":i=tu(e,i),r=tu(e,r),o=[];break;case"select":i=ge({},i,{value:void 0}),r=ge({},r,{value:void 0}),o=[];break;case"textarea":i=iu(e,i),r=iu(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Cl)}su(n,r);var s;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var l=i[c];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Oo.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var a=r[c];if(l=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&a!==l&&(a!=null||l!=null))if(c==="style")if(l){for(s in l)!l.hasOwnProperty(s)||a&&a.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in a)a.hasOwnProperty(s)&&l[s]!==a[s]&&(n||(n={}),n[s]=a[s])}else n||(o||(o=[]),o.push(c,n)),n=a;else c==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(o=o||[]).push(c,a)):c==="children"?typeof a!="string"&&typeof a!="number"||(o=o||[]).push(c,""+a):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Oo.hasOwnProperty(c)?(a!=null&&c==="onScroll"&&re("scroll",e),o||l===a||(o=[])):(o=o||[]).push(c,a))}n&&(o=o||[]).push("style",n);var c=o;(t.updateQueue=c)&&(t.flags|=4)}};kv=function(e,t,n,r){n!==r&&(t.flags|=4)};function eo(e,t){if(!ce)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ge(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Sx(e,t,n){var r=t.pendingProps;switch(Rd(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ge(t),null;case 1:return gt(t.type)&&Sl(),Ge(t),null;case 3:return r=t.stateNode,Si(),oe(mt),oe(Ye),Nd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(_s(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,tn!==null&&(ju(tn),tn=null))),Au(e,t),Ge(t),null;case 5:Ld(t);var i=Cr(jo.current);if(n=t.type,e!==null&&t.stateNode!=null)wv(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(R(166));return Ge(t),null}if(e=Cr(gn.current),_s(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[pn]=t,r[Bo]=o,e=(t.mode&1)!==0,n){case"dialog":re("cancel",r),re("close",r);break;case"iframe":case"object":case"embed":re("load",r);break;case"video":case"audio":for(i=0;i<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[pn]=t,e[Bo]=r,xv(e,t,!1,!1),t.stateNode=e;e:{switch(s=lu(n,r),n){case"dialog":re("cancel",e),re("close",e),i=r;break;case"iframe":case"object":case"embed":re("load",e),i=r;break;case"video":case"audio":for(i=0;iTi&&(t.flags|=128,r=!0,eo(o,!1),t.lanes=4194304)}else{if(!r)if(e=Pl(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),eo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!ce)return Ge(t),null}else 2*Ce()-o.renderingStartTime>Ti&&n!==1073741824&&(t.flags|=128,r=!0,eo(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ce(),t.sibling=null,n=pe.current,ne(pe,r?n&1|2:n&1),t):(Ge(t),null);case 22:case 23:return Qd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ct&1073741824&&(Ge(t),t.subtreeFlags&6&&(t.flags|=8192)):Ge(t),null;case 24:return null;case 25:return null}throw Error(R(156,t.tag))}function $x(e,t){switch(Rd(t),t.tag){case 1:return gt(t.type)&&Sl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Si(),oe(mt),oe(Ye),Nd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ld(t),null;case 13:if(oe(pe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(R(340));ki()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return oe(pe),null;case 4:return Si(),null;case 10:return _d(t.type._context),null;case 22:case 23:return Qd(),null;case 24:return null;default:return null}}var Ms=!1,Qe=!1,Tx=typeof WeakSet=="function"?WeakSet:Set,A=null;function ii(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){xe(e,t,r)}else n.current=null}function Du(e,t,n){try{n()}catch(r){xe(e,t,r)}}var qh=!1;function Ex(e,t){if(vu=xl,e=Eg(),Td(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,l=-1,a=-1,c=0,u=0,d=e,f=null;t:for(;;){for(var y;d!==n||i!==0&&d.nodeType!==3||(l=s+i),d!==o||r!==0&&d.nodeType!==3||(a=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(y=d.firstChild)!==null;)f=d,d=y;for(;;){if(d===e)break t;if(f===n&&++c===i&&(l=s),f===o&&++u===r&&(a=s),(y=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=y}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(yu={focusedElem:e,selectionRange:n},xl=!1,A=t;A!==null;)if(t=A,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,A=e;else for(;A!==null;){t=A;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var g=v.memoizedProps,E=v.memoizedState,p=t.stateNode,h=p.getSnapshotBeforeUpdate(t.elementType===t.type?g:Kt(t.type,g),E);p.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(R(163))}}catch(x){xe(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,A=e;break}A=t.return}return v=qh,qh=!1,v}function wo(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&Du(t,n,o)}i=i.next}while(i!==r)}}function ra(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Mu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Cv(e){var t=e.alternate;t!==null&&(e.alternate=null,Cv(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[pn],delete t[Bo],delete t[wu],delete t[cx],delete t[ux])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Sv(e){return e.tag===5||e.tag===3||e.tag===4}function Qh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Sv(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Lu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Cl));else if(r!==4&&(e=e.child,e!==null))for(Lu(e,t,n),e=e.sibling;e!==null;)Lu(e,t,n),e=e.sibling}function Nu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Nu(e,t,n),e=e.sibling;e!==null;)Nu(e,t,n),e=e.sibling}var je=null,en=!1;function Fn(e,t,n){for(n=n.child;n!==null;)$v(e,t,n),n=n.sibling}function $v(e,t,n){if(mn&&typeof mn.onCommitFiberUnmount=="function")try{mn.onCommitFiberUnmount(Xl,n)}catch{}switch(n.tag){case 5:Qe||ii(n,t);case 6:var r=je,i=en;je=null,Fn(e,t,n),je=r,en=i,je!==null&&(en?(e=je,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):je.removeChild(n.stateNode));break;case 18:je!==null&&(en?(e=je,n=n.stateNode,e.nodeType===8?vc(e.parentNode,n):e.nodeType===1&&vc(e,n),Do(e)):vc(je,n.stateNode));break;case 4:r=je,i=en,je=n.stateNode.containerInfo,en=!0,Fn(e,t,n),je=r,en=i;break;case 0:case 11:case 14:case 15:if(!Qe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&Du(n,t,s),i=i.next}while(i!==r)}Fn(e,t,n);break;case 1:if(!Qe&&(ii(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){xe(n,t,l)}Fn(e,t,n);break;case 21:Fn(e,t,n);break;case 22:n.mode&1?(Qe=(r=Qe)||n.memoizedState!==null,Fn(e,t,n),Qe=r):Fn(e,t,n);break;default:Fn(e,t,n)}}function Xh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Tx),t.forEach(function(r){var i=Lx.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Zt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=Ce()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ox(r/1960))-r,10e?16:e,Yn===null)var r=!1;else{if(e=Yn,Yn=null,Ll=0,q&6)throw Error(R(331));var i=q;for(q|=4,A=e.current;A!==null;){var o=A,s=o.child;if(A.flags&16){var l=o.deletions;if(l!==null){for(var a=0;aCe()-Gd?Tr(e,0):Wd|=n),vt(e,t)}function Av(e,t){t===0&&(e.mode&1?(t=Ts,Ts<<=1,!(Ts&130023424)&&(Ts=4194304)):t=1);var n=st();e=Pn(e,t),e!==null&&(rs(e,t,n),vt(e,n))}function Mx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Av(e,n)}function Lx(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(R(314))}r!==null&&r.delete(t),Av(e,n)}var Dv;Dv=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||mt.current)pt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return pt=!1,Cx(e,t,n);pt=!!(e.flags&131072)}else pt=!1,ce&&t.flags&1048576&&Fg(t,El,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;rl(e,t),e=t.pendingProps;var i=wi(t,Ye.current);fi(t,n),i=Bd(null,t,r,e,i,n);var o=zd();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,gt(r)?(o=!0,$l(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Dd(t),i.updater=na,t.stateNode=i,i._reactInternals=t,Eu(t,r,e,n),t=Iu(null,t,r,!0,o,n)):(t.tag=0,ce&&o&&Ed(t),it(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(rl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Fx(r),e=Kt(r,e),i){case 0:t=Ou(null,t,r,e,n);break e;case 1:t=Uh(null,t,r,e,n);break e;case 11:t=Vh(null,t,r,e,n);break e;case 14:t=Hh(null,t,r,Kt(r.type,e),n);break e}throw Error(R(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Kt(r,i),Ou(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Kt(r,i),Uh(e,t,r,i,n);case 3:e:{if(vv(t),e===null)throw Error(R(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Ug(e,t),Il(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=$i(Error(R(423)),t),t=Wh(e,t,r,n,i);break e}else if(r!==i){i=$i(Error(R(424)),t),t=Wh(e,t,r,n,i);break e}else for($t=er(t.stateNode.containerInfo.firstChild),Tt=t,ce=!0,tn=null,n=Vg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ki(),r===i){t=_n(e,t,n);break e}it(e,t,r,n)}t=t.child}return t;case 5:return Wg(t),e===null&&Su(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,bu(r,i)?s=null:o!==null&&bu(r,o)&&(t.flags|=32),gv(e,t),it(e,t,s,n),t.child;case 6:return e===null&&Su(t),null;case 13:return yv(e,t,n);case 4:return Md(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ci(t,null,r,n):it(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Kt(r,i),Vh(e,t,r,i,n);case 7:return it(e,t,t.pendingProps,n),t.child;case 8:return it(e,t,t.pendingProps.children,n),t.child;case 12:return it(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,ne(Rl,r._currentValue),r._currentValue=s,o!==null)if(sn(o.value,s)){if(o.children===i.children&&!mt.current){t=_n(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){s=o.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(o.tag===1){a=Rn(-1,n&-n),a.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?a.next=a:(a.next=u.next,u.next=a),c.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),$u(o.return,n,t),l.lanes|=n;break}a=a.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(R(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),$u(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}it(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,fi(t,n),i=Ht(i),r=r(i),t.flags|=1,it(e,t,r,n),t.child;case 14:return r=t.type,i=Kt(r,t.pendingProps),i=Kt(r.type,i),Hh(e,t,r,i,n);case 15:return pv(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Kt(r,i),rl(e,t),t.tag=1,gt(r)?(e=!0,$l(t)):e=!1,fi(t,n),dv(t,r,i),Eu(t,r,i,n),Iu(null,t,r,!0,e,n);case 19:return bv(e,t,n);case 22:return mv(e,t,n)}throw Error(R(156,t.tag))};function Mv(e,t){return ag(e,t)}function Nx(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jt(e,t,n,r){return new Nx(e,t,n,r)}function Yd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fx(e){if(typeof e=="function")return Yd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===md)return 11;if(e===gd)return 14}return 2}function ir(e,t){var n=e.alternate;return n===null?(n=jt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function sl(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")Yd(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Xr:return Er(n.children,i,o,t);case pd:s=8,i|=8;break;case Jc:return e=jt(12,n,t,i|2),e.elementType=Jc,e.lanes=o,e;case Zc:return e=jt(13,n,t,i),e.elementType=Zc,e.lanes=o,e;case Kc:return e=jt(19,n,t,i),e.elementType=Kc,e.lanes=o,e;case Wm:return oa(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Hm:s=10;break e;case Um:s=9;break e;case md:s=11;break e;case gd:s=14;break e;case Hn:s=16,r=null;break e}throw Error(R(130,e==null?e:typeof e,""))}return t=jt(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Er(e,t,n,r){return e=jt(7,e,r,t),e.lanes=n,e}function oa(e,t,n,r){return e=jt(22,e,r,t),e.elementType=Wm,e.lanes=n,e.stateNode={isHidden:!1},e}function $c(e,t,n){return e=jt(6,e,null,t),e.lanes=n,e}function Tc(e,t,n){return t=jt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Bx(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=sc(0),this.expirationTimes=sc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sc(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Jd(e,t,n,r,i,o,s,l,a){return e=new Bx(e,t,n,l,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=jt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Dd(o),e}function zx(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Bv)}catch(e){console.error(e)}}Bv(),Bm.exports=Ot;var Wx=Bm.exports,rp=Wx;Xc.createRoot=rp.createRoot,Xc.hydrateRoot=rp.hydrateRoot;const zv=C.createContext({message:null,setMessage:e=>{}}),Gx=({children:e})=>{const[t,n]=C.useState(null);return T.jsx(zv.Provider,{value:{message:t,setMessage:n},children:e})},jv=()=>C.useContext(zv),qx=()=>T.jsxs(T.Fragment,{children:["Note: Not implemented yet.",T.jsx("br",{})," Will show events from your last published module(s)."]});class Vv{constructor(){this.method="",this.methodUuid="",this.dataUuid="",this.json=null}getMethod(){return this.method}getMethodUuid(){return this.methodUuid}getDataUuid(){return this.dataUuid}getJson(){return this.json}update(t){const n=t.header.method,r=t.header.methodUuid,i=t.header.dataUuid;return this.method!==""&&n!==this.method?(console.error(`Trying to update [${this.json.method}] using a JSON from [${n}]`),!1):this.json===null||this.methodUuid!==r||i>this.dataUuid?(this.method=n,this.methodUuid=r,this.dataUuid=i,this.json=t,this.deltaDetected(),!0):!1}deltaDetected(){}}class Qx extends Vv{isWorkdirStatusUpdateNeeded(t){try{const n=t===null||t.getJson()===null||t.getMethod()===""||t.getMethodUuid()===""||t.getDataUuid()==="";for(const r of this.getJson().versions)if(r.method==="getWorkdirStatus"){const i=r.methodUuid,o=r.dataUuid;if(n||t.getMethodUuid()!==i||t.getDataUuid()0?this.suiClientVersionShort=this.suiClientVersion.split("-")[0]:this.suiClientVersionShort="",this.isLoaded=!0}catch(t){console.error(`Problem with SuibaseJsonWorkdirStatus loading: ${JSON.stringify(t)}`)}}}const Rr=["mainnet","testnet","devnet","localnet"],Vu=["Mainnet","Testnet","Devnet","Localnet"],Hu="suibase.dashboard",Yx="suibase.console",Uu="suibase.explorer";class Jx{constructor(){ze(this,"vsCodeApi");typeof acquireVsCodeApi=="function"&&(this.vsCodeApi=acquireVsCodeApi())}postMessage(t){this.vsCodeApi?this.vsCodeApi.postMessage(t):console.log(t)}getState(){if(this.vsCodeApi)return this.vsCodeApi.getState();{const t=localStorage.getItem("vscodeState");return t?JSON.parse(t):void 0}}setState(t){return this.vsCodeApi?this.vsCodeApi.setState(t):(localStorage.setItem("vscodeState",JSON.stringify(t)),t)}}const Bl=new Jx;class tf{constructor(t,n){this.name=t,this.sender=n}}class Hv extends tf{constructor(t,n,r){super("WorkdirCommand",t),this.workdirIdx=n,this.command=r}}class Zx extends tf{constructor(t){super("InitView",t)}}class Kx extends tf{constructor(t,n,r,i){super("RequestWorkdirStatus",t),this.workdirIdx=n,this.methodUuid=r,this.dataUuid=i}}class ew{constructor(t,n){ze(this,"label");ze(this,"workdir");ze(this,"workdirIdx");ze(this,"versions");ze(this,"workdirStatus");this.label=t.charAt(0).toUpperCase()+t.slice(1),this.workdir=t,this.workdirIdx=n,this.versions=new Qx,this.workdirStatus=new Xx}}class tw{constructor(){ze(this,"_activeWorkdir");ze(this,"_activeWorkdirIdx");ze(this,"_activeLoaded");ze(this,"_setupIssue");this._activeWorkdir="",this._activeWorkdirIdx=0,this._activeLoaded=!1,this._setupIssue=""}get activeWorkdir(){return this._activeWorkdir}get activeWorkdirIdx(){return this._activeWorkdirIdx}get activeLoaded(){return this._activeLoaded}get setupIssue(){return this._setupIssue}set activeWorkdir(t){const n=Rr.indexOf(t);if(n<0){console.error(`Invalid workdir: ${t}`);return}this._activeWorkdirIdx=n,this._activeWorkdir=t,this._activeLoaded=!0}set activeWorkdirIdx(t){if(t<0||t>=Rr.length){console.error(`Invalid workdirIdx: ${t}`);return}this._activeWorkdir=Rr[t],this._activeWorkdirIdx=t,this._activeLoaded=!0}set setupIssue(t){this._setupIssue=t}}const Uv=e=>{const{message:t}=jv(),n=C.useRef(new tw),[r]=C.useState(Rr.map((s,l)=>new ew(s,l))),[i,o]=C.useState(!1);return C.useEffect(()=>{let s=n.current.activeLoaded===!1;if(!s){for(let l=0;l{try{if(t&&t.name){let s=!1;switch(t.name){case"UpdateVersions":{let l=!1;if(t.setupIssue){const a=t.setupIssue;a!==n.current.setupIssue&&(n.current.setupIssue=a,s=!0),a!==""&&(l=!0)}if(l===!1&&n.current.setupIssue!==""&&(n.current.setupIssue="",s=!0),l===!1&&t.json){const a=r[t.workdirIdx];if(a.versions.update(t.json)){s=!0;const[u,d,f]=a.versions.isWorkdirStatusUpdateNeeded(a.workdirStatus);u&&Bl.postMessage(new Kx(e,t.workdirIdx,d,f))}n.current.activeWorkdir!==t.json.asuiSelection&&(n.current.activeWorkdir=t.json.asuiSelection,s=!0)}break}case"UpdateWorkdirStatus":{r[t.workdirIdx].workdirStatus.update(t.json)&&(s=!0);break}default:console.log("Received an unknown command",t)}s&&o(l=>!l)}}catch(s){console.error("An error occurred in useCommonController:",s)}},[t,r,e]),{commonTrigger:i,common:n,workdirs:r}},ar=function(){if(typeof globalThis<"u")return globalThis;if(typeof global<"u")return global;if(typeof self<"u")return self;if(typeof window<"u")return window;try{return new Function("return this")()}catch{return{}}}();ar.trustedTypes===void 0&&(ar.trustedTypes={createPolicy:(e,t)=>t});const Wv={configurable:!1,enumerable:!1,writable:!1};ar.FAST===void 0&&Reflect.defineProperty(ar,"FAST",Object.assign({value:Object.create(null)},Wv));const Go=ar.FAST;if(Go.getById===void 0){const e=Object.create(null);Reflect.defineProperty(Go,"getById",Object.assign({value(t,n){let r=e[t];return r===void 0&&(r=n?e[t]=n():null),r}},Wv))}const Or=Object.freeze([]);function Gv(){const e=new WeakMap;return function(t){let n=e.get(t);if(n===void 0){let r=Reflect.getPrototypeOf(t);for(;n===void 0&&r!==null;)n=e.get(r),r=Reflect.getPrototypeOf(r);n=n===void 0?[]:n.slice(0),e.set(t,n)}return n}}const Ec=ar.FAST.getById(1,()=>{const e=[],t=[];function n(){if(t.length)throw t.shift()}function r(s){try{s.call()}catch(l){t.push(l),setTimeout(n,0)}}function i(){let l=0;for(;l1024){for(let a=0,c=e.length-l;ae});let Rc=qv;const So=`fast-${Math.random().toString(36).substring(2,8)}`,Qv=`${So}{`,nf=`}${So}`,H=Object.freeze({supportsAdoptedStyleSheets:Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype,setHTMLPolicy(e){if(Rc!==qv)throw new Error("The HTML policy can only be set once.");Rc=e},createHTML(e){return Rc.createHTML(e)},isMarker(e){return e&&e.nodeType===8&&e.data.startsWith(So)},extractDirectiveIndexFromMarker(e){return parseInt(e.data.replace(`${So}:`,""))},createInterpolationPlaceholder(e){return`${Qv}${e}${nf}`},createCustomAttributePlaceholder(e,t){return`${e}="${this.createInterpolationPlaceholder(t)}"`},createBlockPlaceholder(e){return``},queueUpdate:Ec.enqueue,processUpdates:Ec.process,nextUpdate(){return new Promise(Ec.enqueue)},setAttribute(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)},setBooleanAttribute(e,t,n){n?e.setAttribute(t,""):e.removeAttribute(t)},removeChildNodes(e){for(let t=e.firstChild;t!==null;t=e.firstChild)e.removeChild(t)},createTemplateWalker(e){return document.createTreeWalker(e,133,null,!1)}});class zl{constructor(t,n){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.source=t,this.sub1=n}has(t){return this.spillover===void 0?this.sub1===t||this.sub2===t:this.spillover.indexOf(t)!==-1}subscribe(t){const n=this.spillover;if(n===void 0){if(this.has(t))return;if(this.sub1===void 0){this.sub1=t;return}if(this.sub2===void 0){this.sub2=t;return}this.spillover=[this.sub1,this.sub2,t],this.sub1=void 0,this.sub2=void 0}else n.indexOf(t)===-1&&n.push(t)}unsubscribe(t){const n=this.spillover;if(n===void 0)this.sub1===t?this.sub1=void 0:this.sub2===t&&(this.sub2=void 0);else{const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}notify(t){const n=this.spillover,r=this.source;if(n===void 0){const i=this.sub1,o=this.sub2;i!==void 0&&i.handleChange(r,t),o!==void 0&&o.handleChange(r,t)}else for(let i=0,o=n.length;i{const e=/(:|&&|\|\||if)/,t=new WeakMap,n=H.queueUpdate;let r,i=c=>{throw new Error("Must call enableArrayObservation before observing arrays.")};function o(c){let u=c.$fastController||t.get(c);return u===void 0&&(Array.isArray(c)?u=i(c):t.set(c,u=new Xv(c))),u}const s=Gv();class l{constructor(u){this.name=u,this.field=`_${u}`,this.callback=`${u}Changed`}getValue(u){return r!==void 0&&r.watch(u,this.name),u[this.field]}setValue(u,d){const f=this.field,y=u[f];if(y!==d){u[f]=d;const v=u[this.callback];typeof v=="function"&&v.call(u,y,d),o(u).notify(this.name)}}}class a extends zl{constructor(u,d,f=!1){super(u,d),this.binding=u,this.isVolatileBinding=f,this.needsRefresh=!0,this.needsQueue=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}observe(u,d){this.needsRefresh&&this.last!==null&&this.disconnect();const f=r;r=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;const y=this.binding(u,d);return r=f,y}disconnect(){if(this.last!==null){let u=this.first;for(;u!==void 0;)u.notifier.unsubscribe(this,u.propertyName),u=u.next;this.last=null,this.needsRefresh=this.needsQueue=!0}}watch(u,d){const f=this.last,y=o(u),v=f===null?this.first:{};if(v.propertySource=u,v.propertyName=d,v.notifier=y,y.subscribe(this,d),f!==null){if(!this.needsRefresh){let g;r=void 0,g=f.propertySource[f.propertyName],r=this,u===g&&(this.needsRefresh=!0)}f.next=v}this.last=v}handleChange(){this.needsQueue&&(this.needsQueue=!1,n(this))}call(){this.last!==null&&(this.needsQueue=!0,this.notify(this))}records(){let u=this.first;return{next:()=>{const d=u;return d===void 0?{value:void 0,done:!0}:(u=u.next,{value:d,done:!1})},[Symbol.iterator]:function(){return this}}}}return Object.freeze({setArrayObserverFactory(c){i=c},getNotifier:o,track(c,u){r!==void 0&&r.watch(c,u)},trackVolatile(){r!==void 0&&(r.needsRefresh=!0)},notify(c,u){o(c).notify(u)},defineProperty(c,u){typeof u=="string"&&(u=new l(u)),s(c).push(u),Reflect.defineProperty(c,u.name,{enumerable:!0,get:function(){return u.getValue(this)},set:function(d){u.setValue(this,d)}})},getAccessors:s,binding(c,u,d=this.isVolatileBinding(c)){return new a(c,u,d)},isVolatileBinding(c){return e.test(c.toString())}})});function D(e,t){V.defineProperty(e,t)}function nw(e,t,n){return Object.assign({},n,{get:function(){return V.trackVolatile(),n.get.apply(this)}})}const ip=Go.getById(3,()=>{let e=null;return{get(){return e},set(t){e=t}}});class qo{constructor(){this.index=0,this.length=0,this.parent=null,this.parentContext=null}get event(){return ip.get()}get isEven(){return this.index%2===0}get isOdd(){return this.index%2!==0}get isFirst(){return this.index===0}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}static setEvent(t){ip.set(t)}}V.defineProperty(qo.prototype,"index");V.defineProperty(qo.prototype,"length");const $o=Object.seal(new qo);class ua{constructor(){this.targetIndex=0}}class Yv extends ua{constructor(){super(...arguments),this.createPlaceholder=H.createInterpolationPlaceholder}}class rf extends ua{constructor(t,n,r){super(),this.name=t,this.behavior=n,this.options=r}createPlaceholder(t){return H.createCustomAttributePlaceholder(this.name,t)}createBehavior(t){return new this.behavior(t,this.options)}}function rw(e,t){this.source=e,this.context=t,this.bindingObserver===null&&(this.bindingObserver=V.binding(this.binding,this,this.isBindingVolatile)),this.updateTarget(this.bindingObserver.observe(e,t))}function iw(e,t){this.source=e,this.context=t,this.target.addEventListener(this.targetName,this)}function ow(){this.bindingObserver.disconnect(),this.source=null,this.context=null}function sw(){this.bindingObserver.disconnect(),this.source=null,this.context=null;const e=this.target.$fastView;e!==void 0&&e.isComposed&&(e.unbind(),e.needsBindOnly=!0)}function lw(){this.target.removeEventListener(this.targetName,this),this.source=null,this.context=null}function aw(e){H.setAttribute(this.target,this.targetName,e)}function cw(e){H.setBooleanAttribute(this.target,this.targetName,e)}function uw(e){if(e==null&&(e=""),e.create){this.target.textContent="";let t=this.target.$fastView;t===void 0?t=e.create():this.target.$fastTemplate!==e&&(t.isComposed&&(t.remove(),t.unbind()),t=e.create()),t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(this.source,this.context)):(t.isComposed=!0,t.bind(this.source,this.context),t.insertBefore(this.target),this.target.$fastView=t,this.target.$fastTemplate=e)}else{const t=this.target.$fastView;t!==void 0&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),this.target.textContent=e}}function dw(e){this.target[this.targetName]=e}function fw(e){const t=this.classVersions||Object.create(null),n=this.target;let r=this.version||0;if(e!=null&&e.length){const i=e.split(/\s+/);for(let o=0,s=i.length;oH.createHTML(n(r,i))}break;case"?":this.cleanedTargetName=t.substr(1),this.updateTarget=cw;break;case"@":this.cleanedTargetName=t.substr(1),this.bind=iw,this.unbind=lw;break;default:this.cleanedTargetName=t,t==="class"&&(this.updateTarget=fw);break}}targetAtContent(){this.updateTarget=uw,this.unbind=sw}createBehavior(t){return new hw(t,this.binding,this.isBindingVolatile,this.bind,this.unbind,this.updateTarget,this.cleanedTargetName)}}class hw{constructor(t,n,r,i,o,s,l){this.source=null,this.context=null,this.bindingObserver=null,this.target=t,this.binding=n,this.isBindingVolatile=r,this.bind=i,this.unbind=o,this.updateTarget=s,this.targetName=l}handleChange(){this.updateTarget(this.bindingObserver.observe(this.source,this.context))}handleEvent(t){qo.setEvent(t);const n=this.binding(this.source,this.context);qo.setEvent(null),n!==!0&&t.preventDefault()}}let Oc=null;class sf{addFactory(t){t.targetIndex=this.targetIndex,this.behaviorFactories.push(t)}captureContentBinding(t){t.targetAtContent(),this.addFactory(t)}reset(){this.behaviorFactories=[],this.targetIndex=-1}release(){Oc=this}static borrow(t){const n=Oc||new sf;return n.directives=t,n.reset(),Oc=null,n}}function pw(e){if(e.length===1)return e[0];let t;const n=e.length,r=e.map(s=>typeof s=="string"?()=>s:(t=s.targetName||t,s.binding)),i=(s,l)=>{let a="";for(let c=0;cl),c.targetName=s.name):c=pw(a),c!==null&&(t.removeAttributeNode(s),i--,o--,e.addFactory(c))}}function gw(e,t,n){const r=Jv(e,t.textContent);if(r!==null){let i=t;for(let o=0,s=r.length;o0}const n=this.fragment.cloneNode(!0),r=this.viewBehaviorFactories,i=new Array(this.behaviorCount),o=H.createTemplateWalker(n);let s=0,l=this.targetOffset,a=o.nextNode();for(let c=r.length;s=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function Y(e,...t){const n=[];let r="";for(let i=0,o=e.length-1;ia}if(typeof l=="function"&&(l=new of(l)),l instanceof Yv){const a=yw.exec(s);a!==null&&(l.targetName=a[2])}l instanceof ua?(r+=l.createPlaceholder(n.length),n.push(l)):r+=l}return r+=e[e.length-1],new sp(r,n)}class yt{constructor(){this.targets=new WeakSet}addStylesTo(t){this.targets.add(t)}removeStylesFrom(t){this.targets.delete(t)}isAttachedTo(t){return this.targets.has(t)}withBehaviors(...t){return this.behaviors=this.behaviors===null?t:this.behaviors.concat(t),this}}yt.create=(()=>{if(H.supportsAdoptedStyleSheets){const e=new Map;return t=>new bw(t,e)}return e=>new kw(e)})();function lf(e){return e.map(t=>t instanceof yt?lf(t.styles):[t]).reduce((t,n)=>t.concat(n),[])}function Kv(e){return e.map(t=>t instanceof yt?t.behaviors:null).reduce((t,n)=>n===null?t:(t===null&&(t=[]),t.concat(n)),null)}const ey=Symbol("prependToAdoptedStyleSheets");function ty(e){const t=[],n=[];return e.forEach(r=>(r[ey]?t:n).push(r)),{prepend:t,append:n}}let ny=(e,t)=>{const{prepend:n,append:r}=ty(t);e.adoptedStyleSheets=[...n,...e.adoptedStyleSheets,...r]},ry=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter(n=>t.indexOf(n)===-1)};if(H.supportsAdoptedStyleSheets)try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),ny=(e,t)=>{const{prepend:n,append:r}=ty(t);e.adoptedStyleSheets.splice(0,0,...n),e.adoptedStyleSheets.push(...r)},ry=(e,t)=>{for(const n of t){const r=e.adoptedStyleSheets.indexOf(n);r!==-1&&e.adoptedStyleSheets.splice(r,1)}}}catch{}class bw extends yt{constructor(t,n){super(),this.styles=t,this.styleSheetCache=n,this._styleSheets=void 0,this.behaviors=Kv(t)}get styleSheets(){if(this._styleSheets===void 0){const t=this.styles,n=this.styleSheetCache;this._styleSheets=lf(t).map(r=>{if(r instanceof CSSStyleSheet)return r;let i=n.get(r);return i===void 0&&(i=new CSSStyleSheet,i.replaceSync(r),n.set(r,i)),i})}return this._styleSheets}addStylesTo(t){ny(t,this.styleSheets),super.addStylesTo(t)}removeStylesFrom(t){ry(t,this.styleSheets),super.removeStylesFrom(t)}}let xw=0;function ww(){return`fast-style-class-${++xw}`}class kw extends yt{constructor(t){super(),this.styles=t,this.behaviors=null,this.behaviors=Kv(t),this.styleSheets=lf(t),this.styleClass=ww()}addStylesTo(t){const n=this.styleSheets,r=this.styleClass;t=this.normalizeTarget(t);for(let i=0;i{r.add(t);const i=t[this.fieldName];switch(n){case"reflect":const o=this.converter;H.setAttribute(t,this.attribute,o!==void 0?o.toView(i):i);break;case"boolean":H.setBooleanAttribute(t,this.attribute,i);break}r.delete(t)})}static collect(t,...n){const r=[];n.push(jl.locate(t));for(let i=0,o=n.length;i1&&(n.property=o),jl.locate(i.constructor).push(n)}if(arguments.length>1){n={},r(e,t);return}return n=e===void 0?{}:e,r}const lp={mode:"open"},ap={},Wu=Go.getById(4,()=>{const e=new Map;return Object.freeze({register(t){return e.has(t.type)?!1:(e.set(t.type,t),!0)},getByType(t){return e.get(t)}})});class ls{constructor(t,n=t.definition){typeof n=="string"&&(n={name:n}),this.type=t,this.name=n.name,this.template=n.template;const r=Vl.collect(t,n.attributes),i=new Array(r.length),o={},s={};for(let l=0,a=r.length;l0){const o=this.boundObservables=Object.create(null);for(let s=0,l=i.length;s0||n>0;){if(t===0){i.push(Gu),n--;continue}if(n===0){i.push(qu),t--;continue}const o=e[t-1][n-1],s=e[t-1][n],l=e[t][n-1];let a;s=0){e.splice(l,1),l--,s-=a.addedCount-a.removed.length,i.addedCount+=a.addedCount-c;const u=i.removed.length+a.removed.length-c;if(!i.addedCount&&!u)o=!0;else{let d=a.removed;if(i.indexa.index+a.addedCount){const f=i.removed.slice(a.index+a.addedCount-i.index);up.apply(d,f)}i.removed=d,a.indexr?n=r-e.addedCount:n<0&&(n=r+e.removed.length+n-e.addedCount),n<0&&(n=0),e.index=n,e}class Aw extends zl{constructor(t){super(t),this.oldCollection=void 0,this.splices=void 0,this.needsQueue=!0,this.call=this.flush,Reflect.defineProperty(t,"$fastController",{value:this,enumerable:!1})}subscribe(t){this.flush(),super.subscribe(t)}addSplice(t){this.splices===void 0?this.splices=[t]:this.splices.push(t),this.needsQueue&&(this.needsQueue=!1,H.queueUpdate(this))}reset(t){this.oldCollection=t,this.needsQueue&&(this.needsQueue=!1,H.queueUpdate(this))}flush(){const t=this.splices,n=this.oldCollection;if(t===void 0&&n===void 0)return;this.needsQueue=!0,this.splices=void 0,this.oldCollection=void 0;const r=n===void 0?_w(this.source,t):cy(this.source,0,this.source.length,n,0,n.length);this.notify(r)}}function Dw(){if(dp)return;dp=!0,V.setArrayObserverFactory(a=>new Aw(a));const e=Array.prototype;if(e.$fastPatch)return;Reflect.defineProperty(e,"$fastPatch",{value:1,enumerable:!1});const t=e.pop,n=e.push,r=e.reverse,i=e.shift,o=e.sort,s=e.splice,l=e.unshift;e.pop=function(){const a=this.length>0,c=t.apply(this,arguments),u=this.$fastController;return u!==void 0&&a&&u.addSplice(nn(this.length,[c],0)),c},e.push=function(){const a=n.apply(this,arguments),c=this.$fastController;return c!==void 0&&c.addSplice(_c(nn(this.length-arguments.length,[],arguments.length),this)),a},e.reverse=function(){let a;const c=this.$fastController;c!==void 0&&(c.flush(),a=this.slice());const u=r.apply(this,arguments);return c!==void 0&&c.reset(a),u},e.shift=function(){const a=this.length>0,c=i.apply(this,arguments),u=this.$fastController;return u!==void 0&&a&&u.addSplice(nn(0,[c],0)),c},e.sort=function(){let a;const c=this.$fastController;c!==void 0&&(c.flush(),a=this.slice());const u=o.apply(this,arguments);return c!==void 0&&c.reset(a),u},e.splice=function(){const a=s.apply(this,arguments),c=this.$fastController;return c!==void 0&&c.addSplice(_c(nn(+arguments[0],a,arguments.length>2?arguments.length-2:0),this)),a},e.unshift=function(){const a=l.apply(this,arguments),c=this.$fastController;return c!==void 0&&c.addSplice(_c(nn(0,[],arguments.length),this)),a}}class Mw{constructor(t,n){this.target=t,this.propertyName=n}bind(t){t[this.propertyName]=this.target}unbind(){}}function at(e){return new rf("fast-ref",Mw,e)}const uy=e=>typeof e=="function",Lw=()=>null;function fp(e){return e===void 0?Lw:uy(e)?e:()=>e}function cf(e,t,n){const r=uy(e)?e:()=>e,i=fp(t),o=fp(n);return(s,l)=>r(s,l)?i(s,l):o(s,l)}function Nw(e,t,n,r){e.bind(t[n],r)}function Fw(e,t,n,r){const i=Object.create(r);i.index=n,i.length=t.length,e.bind(t[n],i)}class Bw{constructor(t,n,r,i,o,s){this.location=t,this.itemsBinding=n,this.templateBinding=i,this.options=s,this.source=null,this.views=[],this.items=null,this.itemsObserver=null,this.originalContext=void 0,this.childContext=void 0,this.bindView=Nw,this.itemsBindingObserver=V.binding(n,this,r),this.templateBindingObserver=V.binding(i,this,o),s.positioning&&(this.bindView=Fw)}bind(t,n){this.source=t,this.originalContext=n,this.childContext=Object.create(n),this.childContext.parent=t,this.childContext.parentContext=this.originalContext,this.items=this.itemsBindingObserver.observe(t,this.originalContext),this.template=this.templateBindingObserver.observe(t,this.originalContext),this.observeItems(!0),this.refreshAllViews()}unbind(){this.source=null,this.items=null,this.itemsObserver!==null&&this.itemsObserver.unsubscribe(this),this.unbindAllViews(),this.itemsBindingObserver.disconnect(),this.templateBindingObserver.disconnect()}handleChange(t,n){t===this.itemsBinding?(this.items=this.itemsBindingObserver.observe(this.source,this.originalContext),this.observeItems(),this.refreshAllViews()):t===this.templateBinding?(this.template=this.templateBindingObserver.observe(this.source,this.originalContext),this.refreshAllViews(!0)):this.updateViews(n)}observeItems(t=!1){if(!this.items){this.items=Or;return}const n=this.itemsObserver,r=this.itemsObserver=V.getNotifier(this.items),i=n!==r;i&&n!==null&&n.unsubscribe(this),(i||t)&&r.subscribe(this)}updateViews(t){const n=this.childContext,r=this.views,i=this.bindView,o=this.items,s=this.template,l=this.options.recycle,a=[];let c=0,u=0;for(let d=0,f=t.length;d0?(g<=m&&h.length>0?(k=h[g],g++):(k=a[c],c++),u--):k=s.create(),r.splice(E,0,k),i(k,o,E,n),k.insertBefore(w)}h[g]&&a.push(...h.slice(g))}for(let d=c,f=a.length;dr.name===n),this.source=t,this.updateTarget(this.computeNodes()),this.shouldUpdate&&this.observe()}unbind(){this.updateTarget(Or),this.source=null,this.shouldUpdate&&this.disconnect()}handleEvent(){this.updateTarget(this.computeNodes())}computeNodes(){let t=this.getNodes();return this.options.filter!==void 0&&(t=t.filter(this.options.filter)),t}updateTarget(t){this.source[this.options.property]=t}}class zw extends fy{constructor(t,n){super(t,n)}observe(){this.target.addEventListener("slotchange",this)}disconnect(){this.target.removeEventListener("slotchange",this)}getNodes(){return this.target.assignedNodes(this.options)}}function Wt(e){return typeof e=="string"&&(e={property:e}),new rf("fast-slotted",zw,e)}class jw extends fy{constructor(t,n){super(t,n),this.observer=null,n.childList=!0}observe(){this.observer===null&&(this.observer=new MutationObserver(this.handleEvent.bind(this))),this.observer.observe(this.target,this.options)}disconnect(){this.observer.disconnect()}getNodes(){return"subtree"in this.options?Array.from(this.target.querySelectorAll(this.options.selector)):Array.from(this.target.childNodes)}}function hy(e){return typeof e=="string"&&(e={property:e}),new rf("fast-children",jw,e)}class Li{handleStartContentChange(){this.startContainer.classList.toggle("start",this.start.assignedNodes().length>0)}handleEndContentChange(){this.endContainer.classList.toggle("end",this.end.assignedNodes().length>0)}}const Ni=(e,t)=>Y` -`,Ni=(e,t)=>Y` +`,Fi=(e,t)=>Y` =0;l--)(s=e[l])&&(o=(i<3?s(o):i>3?s(t,n,o):s(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}const _c=new Map;"metadata"in Reflect||(Reflect.metadata=function(e,t){return function(n){Reflect.defineMetadata(e,t,n)}},Reflect.defineMetadata=function(e,t,n){let r=_c.get(n);r===void 0&&_c.set(n,r=new Map),r.set(e,t)},Reflect.getOwnMetadata=function(e,t){const n=_c.get(t);if(n!==void 0)return n.get(e)});class Vw{constructor(t,n){this.container=t,this.key=n}instance(t){return this.registerResolver(0,t)}singleton(t){return this.registerResolver(1,t)}transient(t){return this.registerResolver(2,t)}callback(t){return this.registerResolver(3,t)}cachedCallback(t){return this.registerResolver(3,my(t))}aliasTo(t){return this.registerResolver(5,t)}registerResolver(t,n){const{container:r,key:i}=this;return this.container=this.key=void 0,r.registerResolver(i,new Bt(i,t,n))}}function to(e){const t=e.slice(),n=Object.keys(e),r=n.length;let i;for(let o=0;onull,responsibleForOwnerRequests:!1,defaultResolver:Hw.singleton})}),hp=new Map;function pp(e){return t=>Reflect.getOwnMetadata(e,t)}let mp=null;const he=Object.freeze({createContainer(e){return new $o(null,Object.assign({},Ac.default,e))},findResponsibleContainer(e){const t=e.$$container$$;return t&&t.responsibleForOwnerRequests?t:he.findParentContainer(e)},findParentContainer(e){const t=new CustomEvent(py,{bubbles:!0,composed:!0,cancelable:!0,detail:{container:void 0}});return e.dispatchEvent(t),t.detail.container||he.getOrCreateDOMContainer()},getOrCreateDOMContainer(e,t){return e?e.$$container$$||new $o(e,Object.assign({},Ac.default,t,{parentLocator:he.findParentContainer})):mp||(mp=new $o(null,Object.assign({},Ac.default,t,{parentLocator:()=>null})))},getDesignParamtypes:pp("design:paramtypes"),getAnnotationParamtypes:pp("di:paramtypes"),getOrCreateAnnotationParamTypes(e){let t=this.getAnnotationParamtypes(e);return t===void 0&&Reflect.defineMetadata("di:paramtypes",t=[],e),t},getDependencies(e){let t=hp.get(e);if(t===void 0){const n=e.inject;if(n===void 0){const r=he.getDesignParamtypes(e),i=he.getAnnotationParamtypes(e);if(r===void 0)if(i===void 0){const o=Object.getPrototypeOf(e);typeof o=="function"&&o!==Function.prototype?t=to(he.getDependencies(o)):t=[]}else t=to(i);else if(i===void 0)t=to(r);else{t=to(r);let o=i.length,s;for(let c=0;c{const u=he.findResponsibleContainer(this).get(n),d=this[i];u!==d&&(this[i]=o,l.notify(t))};l.subscribe({handleChange:a},"isConnected")}return o}})},createInterface(e,t){const n=typeof e=="function"?e:t,r=typeof e=="string"?e:e&&"friendlyName"in e&&e.friendlyName||bp,i=typeof e=="string"?!1:e&&"respectConnection"in e&&e.respectConnection||!1,o=function(s,l,a){if(s==null||new.target!==void 0)throw new Error(`No registration for interface: '${o.friendlyName}'`);if(l)he.defineProperty(s,l,o,i);else{const c=he.getOrCreateAnnotationParamTypes(s);c[a]=o}};return o.$isInterface=!0,o.friendlyName=r??"(anonymous)",n!=null&&(o.register=function(s,l){return n(new Vw(s,l??o))}),o.toString=function(){return`InterfaceSymbol<${o.friendlyName}>`},o},inject(...e){return function(t,n,r){if(typeof r=="number"){const i=he.getOrCreateAnnotationParamTypes(t),o=e[0];o!==void 0&&(i[r]=o)}else if(n)he.defineProperty(t,n,e[0]);else{const i=r?he.getOrCreateAnnotationParamTypes(r.value):he.getOrCreateAnnotationParamTypes(t);let o;for(let s=0;s{r.composedPath()[0]!==this.owner&&(r.detail.container=this,r.stopImmediatePropagation())})}get parent(){return this._parent===void 0&&(this._parent=this.config.parentLocator(this.owner)),this._parent}get depth(){return this.parent===null?0:this.parent.depth+1}get responsibleForOwnerRequests(){return this.config.responsibleForOwnerRequests}registerWithContext(t,...n){return this.context=t,this.register(...n),this.context=null,this}register(...t){if(++this.registerDepth===100)throw new Error("Unable to autoregister dependency");let n,r,i,o,s;const l=this.context;for(let a=0,c=t.length;athis}))}jitRegister(t,n){if(typeof t!="function")throw new Error(`Attempted to jitRegister something that is not a constructor: '${t}'. Did you forget to register this dependency?`);if(Jw.has(t.name))throw new Error(`Attempted to jitRegister an intrinsic type: ${t.name}. Did you forget to add @inject(Key)`);if(ll(t)){const r=t.register(n);if(!(r instanceof Object)||r.resolve==null){const i=n.resolvers.get(t);if(i!=null)return i;throw new Error("A valid resolver was not returned from the static register method")}return r}else{if(t.$isInterface)throw new Error(`Attempted to jitRegister an interface: ${t.friendlyName}`);{const r=this.config.defaultResolver(t,n);return n.resolvers.set(t,r),r}}}}const Mc=new WeakMap;function my(e){return function(t,n,r){if(Mc.has(r))return Mc.get(r);const i=e(t,n,r);return Mc.set(r,i),i}}const qo=Object.freeze({instance(e,t){return new Bt(e,0,t)},singleton(e,t){return new Bt(e,1,t)},transient(e,t){return new Bt(e,2,t)},callback(e,t){return new Bt(e,3,t)},cachedCallback(e,t){return new Bt(e,3,my(t))},aliasTo(e,t){return new Bt(t,5,e)}});function Ns(e){if(e==null)throw new Error("key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?")}function yp(e,t,n){if(e instanceof Bt&&e.strategy===4){const r=e.state;let i=r.length;const o=new Array(i);for(;i--;)o[i]=r[i].resolve(t,n);return o}return[e.resolve(t,n)]}const bp="(anonymous)";function xp(e){return typeof e=="object"&&e!==null||typeof e=="function"}const Zw=function(){const e=new WeakMap;let t=!1,n="",r=0;return function(i){return t=e.get(i),t===void 0&&(n=i.toString(),r=n.length,t=r>=29&&r<=100&&n.charCodeAt(r-1)===125&&n.charCodeAt(r-2)<=32&&n.charCodeAt(r-3)===93&&n.charCodeAt(r-4)===101&&n.charCodeAt(r-5)===100&&n.charCodeAt(r-6)===111&&n.charCodeAt(r-7)===99&&n.charCodeAt(r-8)===32&&n.charCodeAt(r-9)===101&&n.charCodeAt(r-10)===118&&n.charCodeAt(r-11)===105&&n.charCodeAt(r-12)===116&&n.charCodeAt(r-13)===97&&n.charCodeAt(r-14)===110&&n.charCodeAt(r-15)===88,e.set(i,t)),t}}(),Fs={};function gy(e){switch(typeof e){case"number":return e>=0&&(e|0)===e;case"string":{const t=Fs[e];if(t!==void 0)return t;const n=e.length;if(n===0)return Fs[e]=!1;let r=0;for(let i=0;i1||r<48||r>57)return Fs[e]=!1;return Fs[e]=!0}default:return!1}}function wp(e){return`${e.toLowerCase()}:presentation`}const Bs=new Map,vy=Object.freeze({define(e,t,n){const r=wp(e);Bs.get(r)===void 0?Bs.set(r,t):Bs.set(r,!1),n.register(qo.instance(r,t))},forTag(e,t){const n=wp(e),r=Bs.get(n);return r===!1?he.findResponsibleContainer(t).get(n):r||null}});class Kw{constructor(t,n){this.template=t||null,this.styles=n===void 0?null:Array.isArray(n)?yt.create(n):n instanceof yt?n:yt.create([n])}applyTo(t){const n=t.$fastController;n.template===null&&(n.template=this.template),n.styles===null&&(n.styles=this.styles)}}class ue extends ua{constructor(){super(...arguments),this._presentation=void 0}get $presentation(){return this._presentation===void 0&&(this._presentation=vy.forTag(this.tagName,this)),this._presentation}templateChanged(){this.template!==void 0&&(this.$fastController.template=this.template)}stylesChanged(){this.styles!==void 0&&(this.$fastController.styles=this.styles)}connectedCallback(){this.$presentation!==null&&this.$presentation.applyTo(this),super.connectedCallback()}static compose(t){return(n={})=>new yy(this===ue?class extends ue{}:this,t,n)}}b([D],ue.prototype,"template",void 0);b([D],ue.prototype,"styles",void 0);function no(e,t,n){return typeof e=="function"?e(t,n):e}class yy{constructor(t,n,r){this.type=t,this.elementDefinition=n,this.overrideDefinition=r,this.definition=Object.assign(Object.assign({},this.elementDefinition),this.overrideDefinition)}register(t,n){const r=this.definition,i=this.overrideDefinition,s=`${r.prefix||n.elementPrefix}-${r.baseName}`;n.tryDefineElement({name:s,type:this.type,baseClass:this.elementDefinition.baseClass,callback:l=>{const a=new Kw(no(r.template,l,r),no(r.styles,l,r));l.definePresentation(a);let c=no(r.shadowOptions,l,r);l.shadowRootMode&&(c?i.shadowOptions||(c.mode=l.shadowRootMode):c!==null&&(c={mode:l.shadowRootMode})),l.defineElement({elementOptions:no(r.elementOptions,l,r),shadowOptions:c,attributes:no(r.attributes,l,r)})}})}}function wt(e,...t){const n=jl.locate(e);t.forEach(r=>{Object.getOwnPropertyNames(r.prototype).forEach(o=>{o!=="constructor"&&Object.defineProperty(e.prototype,o,Object.getOwnPropertyDescriptor(r.prototype,o))}),jl.locate(r).forEach(o=>n.push(o))})}const df={horizontal:"horizontal",vertical:"vertical"};function ek(e,t){let n=e.length;for(;n--;)if(t(e[n],n,e))return n;return-1}function tk(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function nk(...e){return e.every(t=>t instanceof HTMLElement)}function rk(){const e=document.querySelector('meta[property="csp-nonce"]');return e?e.getAttribute("content"):null}let vr;function ik(){if(typeof vr=="boolean")return vr;if(!tk())return vr=!1,vr;const e=document.createElement("style"),t=rk();t!==null&&e.setAttribute("nonce",t),document.head.appendChild(e);try{e.sheet.insertRule("foo:focus-visible {color:inherit}",0),vr=!0}catch{vr=!1}finally{document.head.removeChild(e)}return vr}const kp="focus",Cp="focusin",Ti="focusout",Ei="keydown";var Sp;(function(e){e[e.alt=18]="alt",e[e.arrowDown=40]="arrowDown",e[e.arrowLeft=37]="arrowLeft",e[e.arrowRight=39]="arrowRight",e[e.arrowUp=38]="arrowUp",e[e.back=8]="back",e[e.backSlash=220]="backSlash",e[e.break=19]="break",e[e.capsLock=20]="capsLock",e[e.closeBracket=221]="closeBracket",e[e.colon=186]="colon",e[e.colon2=59]="colon2",e[e.comma=188]="comma",e[e.ctrl=17]="ctrl",e[e.delete=46]="delete",e[e.end=35]="end",e[e.enter=13]="enter",e[e.equals=187]="equals",e[e.equals2=61]="equals2",e[e.equals3=107]="equals3",e[e.escape=27]="escape",e[e.forwardSlash=191]="forwardSlash",e[e.function1=112]="function1",e[e.function10=121]="function10",e[e.function11=122]="function11",e[e.function12=123]="function12",e[e.function2=113]="function2",e[e.function3=114]="function3",e[e.function4=115]="function4",e[e.function5=116]="function5",e[e.function6=117]="function6",e[e.function7=118]="function7",e[e.function8=119]="function8",e[e.function9=120]="function9",e[e.home=36]="home",e[e.insert=45]="insert",e[e.menu=93]="menu",e[e.minus=189]="minus",e[e.minus2=109]="minus2",e[e.numLock=144]="numLock",e[e.numPad0=96]="numPad0",e[e.numPad1=97]="numPad1",e[e.numPad2=98]="numPad2",e[e.numPad3=99]="numPad3",e[e.numPad4=100]="numPad4",e[e.numPad5=101]="numPad5",e[e.numPad6=102]="numPad6",e[e.numPad7=103]="numPad7",e[e.numPad8=104]="numPad8",e[e.numPad9=105]="numPad9",e[e.numPadDivide=111]="numPadDivide",e[e.numPadDot=110]="numPadDot",e[e.numPadMinus=109]="numPadMinus",e[e.numPadMultiply=106]="numPadMultiply",e[e.numPadPlus=107]="numPadPlus",e[e.openBracket=219]="openBracket",e[e.pageDown=34]="pageDown",e[e.pageUp=33]="pageUp",e[e.period=190]="period",e[e.print=44]="print",e[e.quote=222]="quote",e[e.scrollLock=145]="scrollLock",e[e.shift=16]="shift",e[e.space=32]="space",e[e.tab=9]="tab",e[e.tilde=192]="tilde",e[e.windowsLeft=91]="windowsLeft",e[e.windowsOpera=219]="windowsOpera",e[e.windowsRight=92]="windowsRight"})(Sp||(Sp={}));const Nr="ArrowDown",Qo="ArrowLeft",Xo="ArrowRight",Fr="ArrowUp",ls="Enter",da="Escape",Fi="Home",Bi="End",ok="F2",sk="PageDown",lk="PageUp",as=" ",ff="Tab",ak={ArrowDown:Nr,ArrowLeft:Qo,ArrowRight:Xo,ArrowUp:Fr};var Ri;(function(e){e.ltr="ltr",e.rtl="rtl"})(Ri||(Ri={}));function ck(e,t,n){return Math.min(Math.max(n,e),t)}function zs(e,t,n=0){return[t,n]=[t,n].sort((r,i)=>r-i),t<=e&&eY` +***************************************************************************** */function b(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(o=(i<3?s(o):i>3?s(t,n,o):s(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}const Ac=new Map;"metadata"in Reflect||(Reflect.metadata=function(e,t){return function(n){Reflect.defineMetadata(e,t,n)}},Reflect.defineMetadata=function(e,t,n){let r=Ac.get(n);r===void 0&&Ac.set(n,r=new Map),r.set(e,t)},Reflect.getOwnMetadata=function(e,t){const n=Ac.get(t);if(n!==void 0)return n.get(e)});class Vw{constructor(t,n){this.container=t,this.key=n}instance(t){return this.registerResolver(0,t)}singleton(t){return this.registerResolver(1,t)}transient(t){return this.registerResolver(2,t)}callback(t){return this.registerResolver(3,t)}cachedCallback(t){return this.registerResolver(3,my(t))}aliasTo(t){return this.registerResolver(5,t)}registerResolver(t,n){const{container:r,key:i}=this;return this.container=this.key=void 0,r.registerResolver(i,new Bt(i,t,n))}}function no(e){const t=e.slice(),n=Object.keys(e),r=n.length;let i;for(let o=0;onull,responsibleForOwnerRequests:!1,defaultResolver:Hw.singleton})}),hp=new Map;function pp(e){return t=>Reflect.getOwnMetadata(e,t)}let mp=null;const he=Object.freeze({createContainer(e){return new To(null,Object.assign({},Dc.default,e))},findResponsibleContainer(e){const t=e.$$container$$;return t&&t.responsibleForOwnerRequests?t:he.findParentContainer(e)},findParentContainer(e){const t=new CustomEvent(py,{bubbles:!0,composed:!0,cancelable:!0,detail:{container:void 0}});return e.dispatchEvent(t),t.detail.container||he.getOrCreateDOMContainer()},getOrCreateDOMContainer(e,t){return e?e.$$container$$||new To(e,Object.assign({},Dc.default,t,{parentLocator:he.findParentContainer})):mp||(mp=new To(null,Object.assign({},Dc.default,t,{parentLocator:()=>null})))},getDesignParamtypes:pp("design:paramtypes"),getAnnotationParamtypes:pp("di:paramtypes"),getOrCreateAnnotationParamTypes(e){let t=this.getAnnotationParamtypes(e);return t===void 0&&Reflect.defineMetadata("di:paramtypes",t=[],e),t},getDependencies(e){let t=hp.get(e);if(t===void 0){const n=e.inject;if(n===void 0){const r=he.getDesignParamtypes(e),i=he.getAnnotationParamtypes(e);if(r===void 0)if(i===void 0){const o=Object.getPrototypeOf(e);typeof o=="function"&&o!==Function.prototype?t=no(he.getDependencies(o)):t=[]}else t=no(i);else if(i===void 0)t=no(r);else{t=no(r);let o=i.length,s;for(let c=0;c{const u=he.findResponsibleContainer(this).get(n),d=this[i];u!==d&&(this[i]=o,l.notify(t))};l.subscribe({handleChange:a},"isConnected")}return o}})},createInterface(e,t){const n=typeof e=="function"?e:t,r=typeof e=="string"?e:e&&"friendlyName"in e&&e.friendlyName||bp,i=typeof e=="string"?!1:e&&"respectConnection"in e&&e.respectConnection||!1,o=function(s,l,a){if(s==null||new.target!==void 0)throw new Error(`No registration for interface: '${o.friendlyName}'`);if(l)he.defineProperty(s,l,o,i);else{const c=he.getOrCreateAnnotationParamTypes(s);c[a]=o}};return o.$isInterface=!0,o.friendlyName=r??"(anonymous)",n!=null&&(o.register=function(s,l){return n(new Vw(s,l??o))}),o.toString=function(){return`InterfaceSymbol<${o.friendlyName}>`},o},inject(...e){return function(t,n,r){if(typeof r=="number"){const i=he.getOrCreateAnnotationParamTypes(t),o=e[0];o!==void 0&&(i[r]=o)}else if(n)he.defineProperty(t,n,e[0]);else{const i=r?he.getOrCreateAnnotationParamTypes(r.value):he.getOrCreateAnnotationParamTypes(t);let o;for(let s=0;s{r.composedPath()[0]!==this.owner&&(r.detail.container=this,r.stopImmediatePropagation())})}get parent(){return this._parent===void 0&&(this._parent=this.config.parentLocator(this.owner)),this._parent}get depth(){return this.parent===null?0:this.parent.depth+1}get responsibleForOwnerRequests(){return this.config.responsibleForOwnerRequests}registerWithContext(t,...n){return this.context=t,this.register(...n),this.context=null,this}register(...t){if(++this.registerDepth===100)throw new Error("Unable to autoregister dependency");let n,r,i,o,s;const l=this.context;for(let a=0,c=t.length;athis}))}jitRegister(t,n){if(typeof t!="function")throw new Error(`Attempted to jitRegister something that is not a constructor: '${t}'. Did you forget to register this dependency?`);if(Jw.has(t.name))throw new Error(`Attempted to jitRegister an intrinsic type: ${t.name}. Did you forget to add @inject(Key)`);if(ll(t)){const r=t.register(n);if(!(r instanceof Object)||r.resolve==null){const i=n.resolvers.get(t);if(i!=null)return i;throw new Error("A valid resolver was not returned from the static register method")}return r}else{if(t.$isInterface)throw new Error(`Attempted to jitRegister an interface: ${t.friendlyName}`);{const r=this.config.defaultResolver(t,n);return n.resolvers.set(t,r),r}}}}const Lc=new WeakMap;function my(e){return function(t,n,r){if(Lc.has(r))return Lc.get(r);const i=e(t,n,r);return Lc.set(r,i),i}}const Qo=Object.freeze({instance(e,t){return new Bt(e,0,t)},singleton(e,t){return new Bt(e,1,t)},transient(e,t){return new Bt(e,2,t)},callback(e,t){return new Bt(e,3,t)},cachedCallback(e,t){return new Bt(e,3,my(t))},aliasTo(e,t){return new Bt(t,5,e)}});function Fs(e){if(e==null)throw new Error("key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?")}function yp(e,t,n){if(e instanceof Bt&&e.strategy===4){const r=e.state;let i=r.length;const o=new Array(i);for(;i--;)o[i]=r[i].resolve(t,n);return o}return[e.resolve(t,n)]}const bp="(anonymous)";function xp(e){return typeof e=="object"&&e!==null||typeof e=="function"}const Zw=function(){const e=new WeakMap;let t=!1,n="",r=0;return function(i){return t=e.get(i),t===void 0&&(n=i.toString(),r=n.length,t=r>=29&&r<=100&&n.charCodeAt(r-1)===125&&n.charCodeAt(r-2)<=32&&n.charCodeAt(r-3)===93&&n.charCodeAt(r-4)===101&&n.charCodeAt(r-5)===100&&n.charCodeAt(r-6)===111&&n.charCodeAt(r-7)===99&&n.charCodeAt(r-8)===32&&n.charCodeAt(r-9)===101&&n.charCodeAt(r-10)===118&&n.charCodeAt(r-11)===105&&n.charCodeAt(r-12)===116&&n.charCodeAt(r-13)===97&&n.charCodeAt(r-14)===110&&n.charCodeAt(r-15)===88,e.set(i,t)),t}}(),Bs={};function gy(e){switch(typeof e){case"number":return e>=0&&(e|0)===e;case"string":{const t=Bs[e];if(t!==void 0)return t;const n=e.length;if(n===0)return Bs[e]=!1;let r=0;for(let i=0;i1||r<48||r>57)return Bs[e]=!1;return Bs[e]=!0}default:return!1}}function wp(e){return`${e.toLowerCase()}:presentation`}const zs=new Map,vy=Object.freeze({define(e,t,n){const r=wp(e);zs.get(r)===void 0?zs.set(r,t):zs.set(r,!1),n.register(Qo.instance(r,t))},forTag(e,t){const n=wp(e),r=zs.get(n);return r===!1?he.findResponsibleContainer(t).get(n):r||null}});class Kw{constructor(t,n){this.template=t||null,this.styles=n===void 0?null:Array.isArray(n)?yt.create(n):n instanceof yt?n:yt.create([n])}applyTo(t){const n=t.$fastController;n.template===null&&(n.template=this.template),n.styles===null&&(n.styles=this.styles)}}class ue extends da{constructor(){super(...arguments),this._presentation=void 0}get $presentation(){return this._presentation===void 0&&(this._presentation=vy.forTag(this.tagName,this)),this._presentation}templateChanged(){this.template!==void 0&&(this.$fastController.template=this.template)}stylesChanged(){this.styles!==void 0&&(this.$fastController.styles=this.styles)}connectedCallback(){this.$presentation!==null&&this.$presentation.applyTo(this),super.connectedCallback()}static compose(t){return(n={})=>new yy(this===ue?class extends ue{}:this,t,n)}}b([D],ue.prototype,"template",void 0);b([D],ue.prototype,"styles",void 0);function ro(e,t,n){return typeof e=="function"?e(t,n):e}class yy{constructor(t,n,r){this.type=t,this.elementDefinition=n,this.overrideDefinition=r,this.definition=Object.assign(Object.assign({},this.elementDefinition),this.overrideDefinition)}register(t,n){const r=this.definition,i=this.overrideDefinition,s=`${r.prefix||n.elementPrefix}-${r.baseName}`;n.tryDefineElement({name:s,type:this.type,baseClass:this.elementDefinition.baseClass,callback:l=>{const a=new Kw(ro(r.template,l,r),ro(r.styles,l,r));l.definePresentation(a);let c=ro(r.shadowOptions,l,r);l.shadowRootMode&&(c?i.shadowOptions||(c.mode=l.shadowRootMode):c!==null&&(c={mode:l.shadowRootMode})),l.defineElement({elementOptions:ro(r.elementOptions,l,r),shadowOptions:c,attributes:ro(r.attributes,l,r)})}})}}function wt(e,...t){const n=jl.locate(e);t.forEach(r=>{Object.getOwnPropertyNames(r.prototype).forEach(o=>{o!=="constructor"&&Object.defineProperty(e.prototype,o,Object.getOwnPropertyDescriptor(r.prototype,o))}),jl.locate(r).forEach(o=>n.push(o))})}const df={horizontal:"horizontal",vertical:"vertical"};function ek(e,t){let n=e.length;for(;n--;)if(t(e[n],n,e))return n;return-1}function tk(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function nk(...e){return e.every(t=>t instanceof HTMLElement)}function rk(){const e=document.querySelector('meta[property="csp-nonce"]');return e?e.getAttribute("content"):null}let vr;function ik(){if(typeof vr=="boolean")return vr;if(!tk())return vr=!1,vr;const e=document.createElement("style"),t=rk();t!==null&&e.setAttribute("nonce",t),document.head.appendChild(e);try{e.sheet.insertRule("foo:focus-visible {color:inherit}",0),vr=!0}catch{vr=!1}finally{document.head.removeChild(e)}return vr}const kp="focus",Cp="focusin",Ei="focusout",Ri="keydown";var Sp;(function(e){e[e.alt=18]="alt",e[e.arrowDown=40]="arrowDown",e[e.arrowLeft=37]="arrowLeft",e[e.arrowRight=39]="arrowRight",e[e.arrowUp=38]="arrowUp",e[e.back=8]="back",e[e.backSlash=220]="backSlash",e[e.break=19]="break",e[e.capsLock=20]="capsLock",e[e.closeBracket=221]="closeBracket",e[e.colon=186]="colon",e[e.colon2=59]="colon2",e[e.comma=188]="comma",e[e.ctrl=17]="ctrl",e[e.delete=46]="delete",e[e.end=35]="end",e[e.enter=13]="enter",e[e.equals=187]="equals",e[e.equals2=61]="equals2",e[e.equals3=107]="equals3",e[e.escape=27]="escape",e[e.forwardSlash=191]="forwardSlash",e[e.function1=112]="function1",e[e.function10=121]="function10",e[e.function11=122]="function11",e[e.function12=123]="function12",e[e.function2=113]="function2",e[e.function3=114]="function3",e[e.function4=115]="function4",e[e.function5=116]="function5",e[e.function6=117]="function6",e[e.function7=118]="function7",e[e.function8=119]="function8",e[e.function9=120]="function9",e[e.home=36]="home",e[e.insert=45]="insert",e[e.menu=93]="menu",e[e.minus=189]="minus",e[e.minus2=109]="minus2",e[e.numLock=144]="numLock",e[e.numPad0=96]="numPad0",e[e.numPad1=97]="numPad1",e[e.numPad2=98]="numPad2",e[e.numPad3=99]="numPad3",e[e.numPad4=100]="numPad4",e[e.numPad5=101]="numPad5",e[e.numPad6=102]="numPad6",e[e.numPad7=103]="numPad7",e[e.numPad8=104]="numPad8",e[e.numPad9=105]="numPad9",e[e.numPadDivide=111]="numPadDivide",e[e.numPadDot=110]="numPadDot",e[e.numPadMinus=109]="numPadMinus",e[e.numPadMultiply=106]="numPadMultiply",e[e.numPadPlus=107]="numPadPlus",e[e.openBracket=219]="openBracket",e[e.pageDown=34]="pageDown",e[e.pageUp=33]="pageUp",e[e.period=190]="period",e[e.print=44]="print",e[e.quote=222]="quote",e[e.scrollLock=145]="scrollLock",e[e.shift=16]="shift",e[e.space=32]="space",e[e.tab=9]="tab",e[e.tilde=192]="tilde",e[e.windowsLeft=91]="windowsLeft",e[e.windowsOpera=219]="windowsOpera",e[e.windowsRight=92]="windowsRight"})(Sp||(Sp={}));const Nr="ArrowDown",Xo="ArrowLeft",Yo="ArrowRight",Fr="ArrowUp",as="Enter",fa="Escape",Bi="Home",zi="End",ok="F2",sk="PageDown",lk="PageUp",cs=" ",ff="Tab",ak={ArrowDown:Nr,ArrowLeft:Xo,ArrowRight:Yo,ArrowUp:Fr};var Oi;(function(e){e.ltr="ltr",e.rtl="rtl"})(Oi||(Oi={}));function ck(e,t,n){return Math.min(Math.max(n,e),t)}function js(e,t,n=0){return[t,n]=[t,n].sort((r,i)=>r-i),t<=e&&eY` - ${Ni(e,t)} + ${Fi(e,t)} - ${Li(e,t)} + ${Ni(e,t)} -`;class de{}b([$({attribute:"aria-atomic"})],de.prototype,"ariaAtomic",void 0);b([$({attribute:"aria-busy"})],de.prototype,"ariaBusy",void 0);b([$({attribute:"aria-controls"})],de.prototype,"ariaControls",void 0);b([$({attribute:"aria-current"})],de.prototype,"ariaCurrent",void 0);b([$({attribute:"aria-describedby"})],de.prototype,"ariaDescribedby",void 0);b([$({attribute:"aria-details"})],de.prototype,"ariaDetails",void 0);b([$({attribute:"aria-disabled"})],de.prototype,"ariaDisabled",void 0);b([$({attribute:"aria-errormessage"})],de.prototype,"ariaErrormessage",void 0);b([$({attribute:"aria-flowto"})],de.prototype,"ariaFlowto",void 0);b([$({attribute:"aria-haspopup"})],de.prototype,"ariaHaspopup",void 0);b([$({attribute:"aria-hidden"})],de.prototype,"ariaHidden",void 0);b([$({attribute:"aria-invalid"})],de.prototype,"ariaInvalid",void 0);b([$({attribute:"aria-keyshortcuts"})],de.prototype,"ariaKeyshortcuts",void 0);b([$({attribute:"aria-label"})],de.prototype,"ariaLabel",void 0);b([$({attribute:"aria-labelledby"})],de.prototype,"ariaLabelledby",void 0);b([$({attribute:"aria-live"})],de.prototype,"ariaLive",void 0);b([$({attribute:"aria-owns"})],de.prototype,"ariaOwns",void 0);b([$({attribute:"aria-relevant"})],de.prototype,"ariaRelevant",void 0);b([$({attribute:"aria-roledescription"})],de.prototype,"ariaRoledescription",void 0);class an extends ue{constructor(){super(...arguments),this.handleUnsupportedDelegatesFocus=()=>{var t;window.ShadowRoot&&!window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus")&&(!((t=this.$fastController.definition.shadowOptions)===null||t===void 0)&&t.delegatesFocus)&&(this.focus=()=>{var n;(n=this.control)===null||n===void 0||n.focus()})}}connectedCallback(){super.connectedCallback(),this.handleUnsupportedDelegatesFocus()}}b([$],an.prototype,"download",void 0);b([$],an.prototype,"href",void 0);b([$],an.prototype,"hreflang",void 0);b([$],an.prototype,"ping",void 0);b([$],an.prototype,"referrerpolicy",void 0);b([$],an.prototype,"rel",void 0);b([$],an.prototype,"target",void 0);b([$],an.prototype,"type",void 0);b([D],an.prototype,"defaultSlottedContent",void 0);class hf{}b([$({attribute:"aria-expanded"})],hf.prototype,"ariaExpanded",void 0);wt(hf,de);wt(an,Mi,hf);const fk=e=>{const t=e.closest("[dir]");return t!==null&&t.dir==="rtl"?Ri.rtl:Ri.ltr},by=(e,t)=>Y` +`;class de{}b([$({attribute:"aria-atomic"})],de.prototype,"ariaAtomic",void 0);b([$({attribute:"aria-busy"})],de.prototype,"ariaBusy",void 0);b([$({attribute:"aria-controls"})],de.prototype,"ariaControls",void 0);b([$({attribute:"aria-current"})],de.prototype,"ariaCurrent",void 0);b([$({attribute:"aria-describedby"})],de.prototype,"ariaDescribedby",void 0);b([$({attribute:"aria-details"})],de.prototype,"ariaDetails",void 0);b([$({attribute:"aria-disabled"})],de.prototype,"ariaDisabled",void 0);b([$({attribute:"aria-errormessage"})],de.prototype,"ariaErrormessage",void 0);b([$({attribute:"aria-flowto"})],de.prototype,"ariaFlowto",void 0);b([$({attribute:"aria-haspopup"})],de.prototype,"ariaHaspopup",void 0);b([$({attribute:"aria-hidden"})],de.prototype,"ariaHidden",void 0);b([$({attribute:"aria-invalid"})],de.prototype,"ariaInvalid",void 0);b([$({attribute:"aria-keyshortcuts"})],de.prototype,"ariaKeyshortcuts",void 0);b([$({attribute:"aria-label"})],de.prototype,"ariaLabel",void 0);b([$({attribute:"aria-labelledby"})],de.prototype,"ariaLabelledby",void 0);b([$({attribute:"aria-live"})],de.prototype,"ariaLive",void 0);b([$({attribute:"aria-owns"})],de.prototype,"ariaOwns",void 0);b([$({attribute:"aria-relevant"})],de.prototype,"ariaRelevant",void 0);b([$({attribute:"aria-roledescription"})],de.prototype,"ariaRoledescription",void 0);class an extends ue{constructor(){super(...arguments),this.handleUnsupportedDelegatesFocus=()=>{var t;window.ShadowRoot&&!window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus")&&(!((t=this.$fastController.definition.shadowOptions)===null||t===void 0)&&t.delegatesFocus)&&(this.focus=()=>{var n;(n=this.control)===null||n===void 0||n.focus()})}}connectedCallback(){super.connectedCallback(),this.handleUnsupportedDelegatesFocus()}}b([$],an.prototype,"download",void 0);b([$],an.prototype,"href",void 0);b([$],an.prototype,"hreflang",void 0);b([$],an.prototype,"ping",void 0);b([$],an.prototype,"referrerpolicy",void 0);b([$],an.prototype,"rel",void 0);b([$],an.prototype,"target",void 0);b([$],an.prototype,"type",void 0);b([D],an.prototype,"defaultSlottedContent",void 0);class hf{}b([$({attribute:"aria-expanded"})],hf.prototype,"ariaExpanded",void 0);wt(hf,de);wt(an,Li,hf);const fk=e=>{const t=e.closest("[dir]");return t!==null&&t.dir==="rtl"?Oi.rtl:Oi.ltr},by=(e,t)=>Y` -`;let cs=class extends ue{constructor(){super(...arguments),this.generateBadgeStyle=()=>{if(!this.fill&&!this.color)return;const t=`background-color: var(--badge-fill-${this.fill});`,n=`color: var(--badge-color-${this.color});`;return this.fill&&!this.color?t:this.color&&!this.fill?n:`${n} ${t}`}}};b([$({attribute:"fill"})],cs.prototype,"fill",void 0);b([$({attribute:"color"})],cs.prototype,"color",void 0);b([$({mode:"boolean"})],cs.prototype,"circular",void 0);const hk=(e,t)=>Y` +`;let us=class extends ue{constructor(){super(...arguments),this.generateBadgeStyle=()=>{if(!this.fill&&!this.color)return;const t=`background-color: var(--badge-fill-${this.fill});`,n=`color: var(--badge-color-${this.color});`;return this.fill&&!this.color?t:this.color&&!this.fill?n:`${n} ${t}`}}};b([$({attribute:"fill"})],us.prototype,"fill",void 0);b([$({attribute:"color"})],us.prototype,"color",void 0);b([$({mode:"boolean"})],us.prototype,"circular",void 0);const hk=(e,t)=>Y` -`,$p="form-associated-proxy",Tp="ElementInternals",Ep=Tp in window&&"setFormValue"in window[Tp].prototype,Rp=new WeakMap;function us(e){const t=class extends e{constructor(...n){super(...n),this.dirtyValue=!1,this.disabled=!1,this.proxyEventsToBlock=["change","click"],this.proxyInitialized=!1,this.required=!1,this.initialValue=this.initialValue||"",this.elementInternals||(this.formResetCallback=this.formResetCallback.bind(this))}static get formAssociated(){return Ep}get validity(){return this.elementInternals?this.elementInternals.validity:this.proxy.validity}get form(){return this.elementInternals?this.elementInternals.form:this.proxy.form}get validationMessage(){return this.elementInternals?this.elementInternals.validationMessage:this.proxy.validationMessage}get willValidate(){return this.elementInternals?this.elementInternals.willValidate:this.proxy.willValidate}get labels(){if(this.elementInternals)return Object.freeze(Array.from(this.elementInternals.labels));if(this.proxy instanceof HTMLElement&&this.proxy.ownerDocument&&this.id){const n=this.proxy.labels,r=Array.from(this.proxy.getRootNode().querySelectorAll(`[for='${this.id}']`)),i=n?r.concat(Array.from(n)):r;return Object.freeze(i)}else return Or}valueChanged(n,r){this.dirtyValue=!0,this.proxy instanceof HTMLElement&&(this.proxy.value=this.value),this.currentValue=this.value,this.setFormValue(this.value),this.validate()}currentValueChanged(){this.value=this.currentValue}initialValueChanged(n,r){this.dirtyValue||(this.value=this.initialValue,this.dirtyValue=!1)}disabledChanged(n,r){this.proxy instanceof HTMLElement&&(this.proxy.disabled=this.disabled),H.queueUpdate(()=>this.classList.toggle("disabled",this.disabled))}nameChanged(n,r){this.proxy instanceof HTMLElement&&(this.proxy.name=this.name)}requiredChanged(n,r){this.proxy instanceof HTMLElement&&(this.proxy.required=this.required),H.queueUpdate(()=>this.classList.toggle("required",this.required)),this.validate()}get elementInternals(){if(!Ep)return null;let n=Rp.get(this);return n||(n=this.attachInternals(),Rp.set(this,n)),n}connectedCallback(){super.connectedCallback(),this.addEventListener("keypress",this._keypressHandler),this.value||(this.value=this.initialValue,this.dirtyValue=!1),this.elementInternals||(this.attachProxy(),this.form&&this.form.addEventListener("reset",this.formResetCallback))}disconnectedCallback(){super.disconnectedCallback(),this.proxyEventsToBlock.forEach(n=>this.proxy.removeEventListener(n,this.stopPropagation)),!this.elementInternals&&this.form&&this.form.removeEventListener("reset",this.formResetCallback)}checkValidity(){return this.elementInternals?this.elementInternals.checkValidity():this.proxy.checkValidity()}reportValidity(){return this.elementInternals?this.elementInternals.reportValidity():this.proxy.reportValidity()}setValidity(n,r,i){this.elementInternals?this.elementInternals.setValidity(n,r,i):typeof r=="string"&&this.proxy.setCustomValidity(r)}formDisabledCallback(n){this.disabled=n}formResetCallback(){this.value=this.initialValue,this.dirtyValue=!1}attachProxy(){var n;this.proxyInitialized||(this.proxyInitialized=!0,this.proxy.style.display="none",this.proxyEventsToBlock.forEach(r=>this.proxy.addEventListener(r,this.stopPropagation)),this.proxy.disabled=this.disabled,this.proxy.required=this.required,typeof this.name=="string"&&(this.proxy.name=this.name),typeof this.value=="string"&&(this.proxy.value=this.value),this.proxy.setAttribute("slot",$p),this.proxySlot=document.createElement("slot"),this.proxySlot.setAttribute("name",$p)),(n=this.shadowRoot)===null||n===void 0||n.appendChild(this.proxySlot),this.appendChild(this.proxy)}detachProxy(){var n;this.removeChild(this.proxy),(n=this.shadowRoot)===null||n===void 0||n.removeChild(this.proxySlot)}validate(n){this.proxy instanceof HTMLElement&&this.setValidity(this.proxy.validity,this.proxy.validationMessage,n)}setFormValue(n,r){this.elementInternals&&this.elementInternals.setFormValue(n,r||n)}_keypressHandler(n){switch(n.key){case ls:if(this.form instanceof HTMLFormElement){const r=this.form.querySelector("[type=submit]");r==null||r.click()}break}}stopPropagation(n){n.stopPropagation()}};return $({mode:"boolean"})(t.prototype,"disabled"),$({mode:"fromView",attribute:"value"})(t.prototype,"initialValue"),$({attribute:"current-value"})(t.prototype,"currentValue"),$(t.prototype,"name"),$({mode:"boolean"})(t.prototype,"required"),D(t.prototype,"value"),t}function xy(e){class t extends us(e){}class n extends t{constructor(...i){super(i),this.dirtyChecked=!1,this.checkedAttribute=!1,this.checked=!1,this.dirtyChecked=!1}checkedAttributeChanged(){this.defaultChecked=this.checkedAttribute}defaultCheckedChanged(){this.dirtyChecked||(this.checked=this.defaultChecked,this.dirtyChecked=!1)}checkedChanged(i,o){this.dirtyChecked||(this.dirtyChecked=!0),this.currentChecked=this.checked,this.updateForm(),this.proxy instanceof HTMLInputElement&&(this.proxy.checked=this.checked),i!==void 0&&this.$emit("change"),this.validate()}currentCheckedChanged(i,o){this.checked=this.currentChecked}updateForm(){const i=this.checked?this.value:null;this.setFormValue(i,i)}connectedCallback(){super.connectedCallback(),this.updateForm()}formResetCallback(){super.formResetCallback(),this.checked=!!this.checkedAttribute,this.dirtyChecked=!1}}return $({attribute:"checked",mode:"boolean"})(n.prototype,"checkedAttribute"),$({attribute:"current-checked",converter:iy})(n.prototype,"currentChecked"),D(n.prototype,"defaultChecked"),D(n.prototype,"checked"),n}class pk extends ue{}class mk extends us(pk){constructor(){super(...arguments),this.proxy=document.createElement("input")}}let cn=class extends mk{constructor(){super(...arguments),this.handleClick=t=>{var n;this.disabled&&((n=this.defaultSlottedContent)===null||n===void 0?void 0:n.length)<=1&&t.stopPropagation()},this.handleSubmission=()=>{if(!this.form)return;const t=this.proxy.isConnected;t||this.attachProxy(),typeof this.form.requestSubmit=="function"?this.form.requestSubmit(this.proxy):this.proxy.click(),t||this.detachProxy()},this.handleFormReset=()=>{var t;(t=this.form)===null||t===void 0||t.reset()},this.handleUnsupportedDelegatesFocus=()=>{var t;window.ShadowRoot&&!window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus")&&(!((t=this.$fastController.definition.shadowOptions)===null||t===void 0)&&t.delegatesFocus)&&(this.focus=()=>{this.control.focus()})}}formactionChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formAction=this.formaction)}formenctypeChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formEnctype=this.formenctype)}formmethodChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formMethod=this.formmethod)}formnovalidateChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formNoValidate=this.formnovalidate)}formtargetChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formTarget=this.formtarget)}typeChanged(t,n){this.proxy instanceof HTMLInputElement&&(this.proxy.type=this.type),n==="submit"&&this.addEventListener("click",this.handleSubmission),t==="submit"&&this.removeEventListener("click",this.handleSubmission),n==="reset"&&this.addEventListener("click",this.handleFormReset),t==="reset"&&this.removeEventListener("click",this.handleFormReset)}validate(){super.validate(this.control)}connectedCallback(){var t;super.connectedCallback(),this.proxy.setAttribute("type",this.type),this.handleUnsupportedDelegatesFocus();const n=Array.from((t=this.control)===null||t===void 0?void 0:t.children);n&&n.forEach(r=>{r.addEventListener("click",this.handleClick)})}disconnectedCallback(){var t;super.disconnectedCallback();const n=Array.from((t=this.control)===null||t===void 0?void 0:t.children);n&&n.forEach(r=>{r.removeEventListener("click",this.handleClick)})}};b([$({mode:"boolean"})],cn.prototype,"autofocus",void 0);b([$({attribute:"form"})],cn.prototype,"formId",void 0);b([$],cn.prototype,"formaction",void 0);b([$],cn.prototype,"formenctype",void 0);b([$],cn.prototype,"formmethod",void 0);b([$({mode:"boolean"})],cn.prototype,"formnovalidate",void 0);b([$],cn.prototype,"formtarget",void 0);b([$],cn.prototype,"type",void 0);b([D],cn.prototype,"defaultSlottedContent",void 0);class fa{}b([$({attribute:"aria-expanded"})],fa.prototype,"ariaExpanded",void 0);b([$({attribute:"aria-pressed"})],fa.prototype,"ariaPressed",void 0);wt(fa,de);wt(cn,Mi,fa);const js={none:"none",default:"default",sticky:"sticky"},Bn={default:"default",columnHeader:"columnheader",rowHeader:"rowheader"},To={default:"default",header:"header",stickyHeader:"sticky-header"};let Ze=class extends ue{constructor(){super(...arguments),this.rowType=To.default,this.rowData=null,this.columnDefinitions=null,this.isActiveRow=!1,this.cellsRepeatBehavior=null,this.cellsPlaceholder=null,this.focusColumnIndex=0,this.refocusOnLoad=!1,this.updateRowStyle=()=>{this.style.gridTemplateColumns=this.gridTemplateColumns}}gridTemplateColumnsChanged(){this.$fastController.isConnected&&this.updateRowStyle()}rowTypeChanged(){this.$fastController.isConnected&&this.updateItemTemplate()}rowDataChanged(){if(this.rowData!==null&&this.isActiveRow){this.refocusOnLoad=!0;return}}cellItemTemplateChanged(){this.updateItemTemplate()}headerCellItemTemplateChanged(){this.updateItemTemplate()}connectedCallback(){super.connectedCallback(),this.cellsRepeatBehavior===null&&(this.cellsPlaceholder=document.createComment(""),this.appendChild(this.cellsPlaceholder),this.updateItemTemplate(),this.cellsRepeatBehavior=new dy(t=>t.columnDefinitions,t=>t.activeCellItemTemplate,{positioning:!0}).createBehavior(this.cellsPlaceholder),this.$fastController.addBehaviors([this.cellsRepeatBehavior])),this.addEventListener("cell-focused",this.handleCellFocus),this.addEventListener(Ti,this.handleFocusout),this.addEventListener(Ei,this.handleKeydown),this.updateRowStyle(),this.refocusOnLoad&&(this.refocusOnLoad=!1,this.cellElements.length>this.focusColumnIndex&&this.cellElements[this.focusColumnIndex].focus())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cell-focused",this.handleCellFocus),this.removeEventListener(Ti,this.handleFocusout),this.removeEventListener(Ei,this.handleKeydown)}handleFocusout(t){this.contains(t.target)||(this.isActiveRow=!1,this.focusColumnIndex=0)}handleCellFocus(t){this.isActiveRow=!0,this.focusColumnIndex=this.cellElements.indexOf(t.target),this.$emit("row-focused",this)}handleKeydown(t){if(t.defaultPrevented)return;let n=0;switch(t.key){case Qo:n=Math.max(0,this.focusColumnIndex-1),this.cellElements[n].focus(),t.preventDefault();break;case Xo:n=Math.min(this.cellElements.length-1,this.focusColumnIndex+1),this.cellElements[n].focus(),t.preventDefault();break;case Fi:t.ctrlKey||(this.cellElements[0].focus(),t.preventDefault());break;case Bi:t.ctrlKey||(this.cellElements[this.cellElements.length-1].focus(),t.preventDefault());break}}updateItemTemplate(){this.activeCellItemTemplate=this.rowType===To.default&&this.cellItemTemplate!==void 0?this.cellItemTemplate:this.rowType===To.default&&this.cellItemTemplate===void 0?this.defaultCellItemTemplate:this.headerCellItemTemplate!==void 0?this.headerCellItemTemplate:this.defaultHeaderCellItemTemplate}};b([$({attribute:"grid-template-columns"})],Ze.prototype,"gridTemplateColumns",void 0);b([$({attribute:"row-type"})],Ze.prototype,"rowType",void 0);b([D],Ze.prototype,"rowData",void 0);b([D],Ze.prototype,"columnDefinitions",void 0);b([D],Ze.prototype,"cellItemTemplate",void 0);b([D],Ze.prototype,"headerCellItemTemplate",void 0);b([D],Ze.prototype,"rowIndex",void 0);b([D],Ze.prototype,"isActiveRow",void 0);b([D],Ze.prototype,"activeCellItemTemplate",void 0);b([D],Ze.prototype,"defaultCellItemTemplate",void 0);b([D],Ze.prototype,"defaultHeaderCellItemTemplate",void 0);b([D],Ze.prototype,"cellElements",void 0);function gk(e){const t=e.tagFor(Ze);return Y` +`,$p="form-associated-proxy",Tp="ElementInternals",Ep=Tp in window&&"setFormValue"in window[Tp].prototype,Rp=new WeakMap;function ds(e){const t=class extends e{constructor(...n){super(...n),this.dirtyValue=!1,this.disabled=!1,this.proxyEventsToBlock=["change","click"],this.proxyInitialized=!1,this.required=!1,this.initialValue=this.initialValue||"",this.elementInternals||(this.formResetCallback=this.formResetCallback.bind(this))}static get formAssociated(){return Ep}get validity(){return this.elementInternals?this.elementInternals.validity:this.proxy.validity}get form(){return this.elementInternals?this.elementInternals.form:this.proxy.form}get validationMessage(){return this.elementInternals?this.elementInternals.validationMessage:this.proxy.validationMessage}get willValidate(){return this.elementInternals?this.elementInternals.willValidate:this.proxy.willValidate}get labels(){if(this.elementInternals)return Object.freeze(Array.from(this.elementInternals.labels));if(this.proxy instanceof HTMLElement&&this.proxy.ownerDocument&&this.id){const n=this.proxy.labels,r=Array.from(this.proxy.getRootNode().querySelectorAll(`[for='${this.id}']`)),i=n?r.concat(Array.from(n)):r;return Object.freeze(i)}else return Or}valueChanged(n,r){this.dirtyValue=!0,this.proxy instanceof HTMLElement&&(this.proxy.value=this.value),this.currentValue=this.value,this.setFormValue(this.value),this.validate()}currentValueChanged(){this.value=this.currentValue}initialValueChanged(n,r){this.dirtyValue||(this.value=this.initialValue,this.dirtyValue=!1)}disabledChanged(n,r){this.proxy instanceof HTMLElement&&(this.proxy.disabled=this.disabled),H.queueUpdate(()=>this.classList.toggle("disabled",this.disabled))}nameChanged(n,r){this.proxy instanceof HTMLElement&&(this.proxy.name=this.name)}requiredChanged(n,r){this.proxy instanceof HTMLElement&&(this.proxy.required=this.required),H.queueUpdate(()=>this.classList.toggle("required",this.required)),this.validate()}get elementInternals(){if(!Ep)return null;let n=Rp.get(this);return n||(n=this.attachInternals(),Rp.set(this,n)),n}connectedCallback(){super.connectedCallback(),this.addEventListener("keypress",this._keypressHandler),this.value||(this.value=this.initialValue,this.dirtyValue=!1),this.elementInternals||(this.attachProxy(),this.form&&this.form.addEventListener("reset",this.formResetCallback))}disconnectedCallback(){super.disconnectedCallback(),this.proxyEventsToBlock.forEach(n=>this.proxy.removeEventListener(n,this.stopPropagation)),!this.elementInternals&&this.form&&this.form.removeEventListener("reset",this.formResetCallback)}checkValidity(){return this.elementInternals?this.elementInternals.checkValidity():this.proxy.checkValidity()}reportValidity(){return this.elementInternals?this.elementInternals.reportValidity():this.proxy.reportValidity()}setValidity(n,r,i){this.elementInternals?this.elementInternals.setValidity(n,r,i):typeof r=="string"&&this.proxy.setCustomValidity(r)}formDisabledCallback(n){this.disabled=n}formResetCallback(){this.value=this.initialValue,this.dirtyValue=!1}attachProxy(){var n;this.proxyInitialized||(this.proxyInitialized=!0,this.proxy.style.display="none",this.proxyEventsToBlock.forEach(r=>this.proxy.addEventListener(r,this.stopPropagation)),this.proxy.disabled=this.disabled,this.proxy.required=this.required,typeof this.name=="string"&&(this.proxy.name=this.name),typeof this.value=="string"&&(this.proxy.value=this.value),this.proxy.setAttribute("slot",$p),this.proxySlot=document.createElement("slot"),this.proxySlot.setAttribute("name",$p)),(n=this.shadowRoot)===null||n===void 0||n.appendChild(this.proxySlot),this.appendChild(this.proxy)}detachProxy(){var n;this.removeChild(this.proxy),(n=this.shadowRoot)===null||n===void 0||n.removeChild(this.proxySlot)}validate(n){this.proxy instanceof HTMLElement&&this.setValidity(this.proxy.validity,this.proxy.validationMessage,n)}setFormValue(n,r){this.elementInternals&&this.elementInternals.setFormValue(n,r||n)}_keypressHandler(n){switch(n.key){case as:if(this.form instanceof HTMLFormElement){const r=this.form.querySelector("[type=submit]");r==null||r.click()}break}}stopPropagation(n){n.stopPropagation()}};return $({mode:"boolean"})(t.prototype,"disabled"),$({mode:"fromView",attribute:"value"})(t.prototype,"initialValue"),$({attribute:"current-value"})(t.prototype,"currentValue"),$(t.prototype,"name"),$({mode:"boolean"})(t.prototype,"required"),D(t.prototype,"value"),t}function xy(e){class t extends ds(e){}class n extends t{constructor(...i){super(i),this.dirtyChecked=!1,this.checkedAttribute=!1,this.checked=!1,this.dirtyChecked=!1}checkedAttributeChanged(){this.defaultChecked=this.checkedAttribute}defaultCheckedChanged(){this.dirtyChecked||(this.checked=this.defaultChecked,this.dirtyChecked=!1)}checkedChanged(i,o){this.dirtyChecked||(this.dirtyChecked=!0),this.currentChecked=this.checked,this.updateForm(),this.proxy instanceof HTMLInputElement&&(this.proxy.checked=this.checked),i!==void 0&&this.$emit("change"),this.validate()}currentCheckedChanged(i,o){this.checked=this.currentChecked}updateForm(){const i=this.checked?this.value:null;this.setFormValue(i,i)}connectedCallback(){super.connectedCallback(),this.updateForm()}formResetCallback(){super.formResetCallback(),this.checked=!!this.checkedAttribute,this.dirtyChecked=!1}}return $({attribute:"checked",mode:"boolean"})(n.prototype,"checkedAttribute"),$({attribute:"current-checked",converter:iy})(n.prototype,"currentChecked"),D(n.prototype,"defaultChecked"),D(n.prototype,"checked"),n}class pk extends ue{}class mk extends ds(pk){constructor(){super(...arguments),this.proxy=document.createElement("input")}}let cn=class extends mk{constructor(){super(...arguments),this.handleClick=t=>{var n;this.disabled&&((n=this.defaultSlottedContent)===null||n===void 0?void 0:n.length)<=1&&t.stopPropagation()},this.handleSubmission=()=>{if(!this.form)return;const t=this.proxy.isConnected;t||this.attachProxy(),typeof this.form.requestSubmit=="function"?this.form.requestSubmit(this.proxy):this.proxy.click(),t||this.detachProxy()},this.handleFormReset=()=>{var t;(t=this.form)===null||t===void 0||t.reset()},this.handleUnsupportedDelegatesFocus=()=>{var t;window.ShadowRoot&&!window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus")&&(!((t=this.$fastController.definition.shadowOptions)===null||t===void 0)&&t.delegatesFocus)&&(this.focus=()=>{this.control.focus()})}}formactionChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formAction=this.formaction)}formenctypeChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formEnctype=this.formenctype)}formmethodChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formMethod=this.formmethod)}formnovalidateChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formNoValidate=this.formnovalidate)}formtargetChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formTarget=this.formtarget)}typeChanged(t,n){this.proxy instanceof HTMLInputElement&&(this.proxy.type=this.type),n==="submit"&&this.addEventListener("click",this.handleSubmission),t==="submit"&&this.removeEventListener("click",this.handleSubmission),n==="reset"&&this.addEventListener("click",this.handleFormReset),t==="reset"&&this.removeEventListener("click",this.handleFormReset)}validate(){super.validate(this.control)}connectedCallback(){var t;super.connectedCallback(),this.proxy.setAttribute("type",this.type),this.handleUnsupportedDelegatesFocus();const n=Array.from((t=this.control)===null||t===void 0?void 0:t.children);n&&n.forEach(r=>{r.addEventListener("click",this.handleClick)})}disconnectedCallback(){var t;super.disconnectedCallback();const n=Array.from((t=this.control)===null||t===void 0?void 0:t.children);n&&n.forEach(r=>{r.removeEventListener("click",this.handleClick)})}};b([$({mode:"boolean"})],cn.prototype,"autofocus",void 0);b([$({attribute:"form"})],cn.prototype,"formId",void 0);b([$],cn.prototype,"formaction",void 0);b([$],cn.prototype,"formenctype",void 0);b([$],cn.prototype,"formmethod",void 0);b([$({mode:"boolean"})],cn.prototype,"formnovalidate",void 0);b([$],cn.prototype,"formtarget",void 0);b([$],cn.prototype,"type",void 0);b([D],cn.prototype,"defaultSlottedContent",void 0);class ha{}b([$({attribute:"aria-expanded"})],ha.prototype,"ariaExpanded",void 0);b([$({attribute:"aria-pressed"})],ha.prototype,"ariaPressed",void 0);wt(ha,de);wt(cn,Li,ha);const Vs={none:"none",default:"default",sticky:"sticky"},Bn={default:"default",columnHeader:"columnheader",rowHeader:"rowheader"},Eo={default:"default",header:"header",stickyHeader:"sticky-header"};let Ze=class extends ue{constructor(){super(...arguments),this.rowType=Eo.default,this.rowData=null,this.columnDefinitions=null,this.isActiveRow=!1,this.cellsRepeatBehavior=null,this.cellsPlaceholder=null,this.focusColumnIndex=0,this.refocusOnLoad=!1,this.updateRowStyle=()=>{this.style.gridTemplateColumns=this.gridTemplateColumns}}gridTemplateColumnsChanged(){this.$fastController.isConnected&&this.updateRowStyle()}rowTypeChanged(){this.$fastController.isConnected&&this.updateItemTemplate()}rowDataChanged(){if(this.rowData!==null&&this.isActiveRow){this.refocusOnLoad=!0;return}}cellItemTemplateChanged(){this.updateItemTemplate()}headerCellItemTemplateChanged(){this.updateItemTemplate()}connectedCallback(){super.connectedCallback(),this.cellsRepeatBehavior===null&&(this.cellsPlaceholder=document.createComment(""),this.appendChild(this.cellsPlaceholder),this.updateItemTemplate(),this.cellsRepeatBehavior=new dy(t=>t.columnDefinitions,t=>t.activeCellItemTemplate,{positioning:!0}).createBehavior(this.cellsPlaceholder),this.$fastController.addBehaviors([this.cellsRepeatBehavior])),this.addEventListener("cell-focused",this.handleCellFocus),this.addEventListener(Ei,this.handleFocusout),this.addEventListener(Ri,this.handleKeydown),this.updateRowStyle(),this.refocusOnLoad&&(this.refocusOnLoad=!1,this.cellElements.length>this.focusColumnIndex&&this.cellElements[this.focusColumnIndex].focus())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cell-focused",this.handleCellFocus),this.removeEventListener(Ei,this.handleFocusout),this.removeEventListener(Ri,this.handleKeydown)}handleFocusout(t){this.contains(t.target)||(this.isActiveRow=!1,this.focusColumnIndex=0)}handleCellFocus(t){this.isActiveRow=!0,this.focusColumnIndex=this.cellElements.indexOf(t.target),this.$emit("row-focused",this)}handleKeydown(t){if(t.defaultPrevented)return;let n=0;switch(t.key){case Xo:n=Math.max(0,this.focusColumnIndex-1),this.cellElements[n].focus(),t.preventDefault();break;case Yo:n=Math.min(this.cellElements.length-1,this.focusColumnIndex+1),this.cellElements[n].focus(),t.preventDefault();break;case Bi:t.ctrlKey||(this.cellElements[0].focus(),t.preventDefault());break;case zi:t.ctrlKey||(this.cellElements[this.cellElements.length-1].focus(),t.preventDefault());break}}updateItemTemplate(){this.activeCellItemTemplate=this.rowType===Eo.default&&this.cellItemTemplate!==void 0?this.cellItemTemplate:this.rowType===Eo.default&&this.cellItemTemplate===void 0?this.defaultCellItemTemplate:this.headerCellItemTemplate!==void 0?this.headerCellItemTemplate:this.defaultHeaderCellItemTemplate}};b([$({attribute:"grid-template-columns"})],Ze.prototype,"gridTemplateColumns",void 0);b([$({attribute:"row-type"})],Ze.prototype,"rowType",void 0);b([D],Ze.prototype,"rowData",void 0);b([D],Ze.prototype,"columnDefinitions",void 0);b([D],Ze.prototype,"cellItemTemplate",void 0);b([D],Ze.prototype,"headerCellItemTemplate",void 0);b([D],Ze.prototype,"rowIndex",void 0);b([D],Ze.prototype,"isActiveRow",void 0);b([D],Ze.prototype,"activeCellItemTemplate",void 0);b([D],Ze.prototype,"defaultCellItemTemplate",void 0);b([D],Ze.prototype,"defaultHeaderCellItemTemplate",void 0);b([D],Ze.prototype,"cellElements",void 0);function gk(e){const t=e.tagFor(Ze);return Y` <${t} :rowData="${n=>n}" :cellItemTemplate="${(n,r)=>r.parent.cellItemTemplate}" @@ -196,7 +196,7 @@ PERFORMANCE OF THIS SOFTWARE. > - `};let Ke=class qu extends ue{constructor(){super(),this.noTabbing=!1,this.generateHeader=js.default,this.rowsData=[],this.columnDefinitions=null,this.focusRowIndex=0,this.focusColumnIndex=0,this.rowsPlaceholder=null,this.generatedHeader=null,this.isUpdatingFocus=!1,this.pendingFocusUpdate=!1,this.rowindexUpdateQueued=!1,this.columnDefinitionsStale=!0,this.generatedGridTemplateColumns="",this.focusOnCell=(t,n,r)=>{if(this.rowElements.length===0){this.focusRowIndex=0,this.focusColumnIndex=0;return}const i=Math.max(0,Math.min(this.rowElements.length-1,t)),s=this.rowElements[i].querySelectorAll('[role="cell"], [role="gridcell"], [role="columnheader"], [role="rowheader"]'),l=Math.max(0,Math.min(s.length-1,n)),a=s[l];r&&this.scrollHeight!==this.clientHeight&&(i0||i>this.focusRowIndex&&this.scrollTop{t&&t.length&&(t.forEach(r=>{r.addedNodes.forEach(i=>{i.nodeType===1&&i.getAttribute("role")==="row"&&(i.columnDefinitions=this.columnDefinitions)})}),this.queueRowIndexUpdate())},this.queueRowIndexUpdate=()=>{this.rowindexUpdateQueued||(this.rowindexUpdateQueued=!0,H.queueUpdate(this.updateRowIndexes))},this.updateRowIndexes=()=>{let t=this.gridTemplateColumns;if(t===void 0){if(this.generatedGridTemplateColumns===""&&this.rowElements.length>0){const n=this.rowElements[0];this.generatedGridTemplateColumns=new Array(n.cellElements.length).fill("1fr").join(" ")}t=this.generatedGridTemplateColumns}this.rowElements.forEach((n,r)=>{const i=n;i.rowIndex=r,i.gridTemplateColumns=t,this.columnDefinitionsStale&&(i.columnDefinitions=this.columnDefinitions)}),this.rowindexUpdateQueued=!1,this.columnDefinitionsStale=!1}}static generateTemplateColumns(t){let n="";return t.forEach(r=>{n=`${n}${n===""?"":" "}1fr`}),n}noTabbingChanged(){this.$fastController.isConnected&&(this.noTabbing?this.setAttribute("tabIndex","-1"):this.setAttribute("tabIndex",this.contains(document.activeElement)||this===document.activeElement?"-1":"0"))}generateHeaderChanged(){this.$fastController.isConnected&&this.toggleGeneratedHeader()}gridTemplateColumnsChanged(){this.$fastController.isConnected&&this.updateRowIndexes()}rowsDataChanged(){this.columnDefinitions===null&&this.rowsData.length>0&&(this.columnDefinitions=qu.generateColumns(this.rowsData[0])),this.$fastController.isConnected&&this.toggleGeneratedHeader()}columnDefinitionsChanged(){if(this.columnDefinitions===null){this.generatedGridTemplateColumns="";return}this.generatedGridTemplateColumns=qu.generateTemplateColumns(this.columnDefinitions),this.$fastController.isConnected&&(this.columnDefinitionsStale=!0,this.queueRowIndexUpdate())}headerCellItemTemplateChanged(){this.$fastController.isConnected&&this.generatedHeader!==null&&(this.generatedHeader.headerCellItemTemplate=this.headerCellItemTemplate)}focusRowIndexChanged(){this.$fastController.isConnected&&this.queueFocusUpdate()}focusColumnIndexChanged(){this.$fastController.isConnected&&this.queueFocusUpdate()}connectedCallback(){super.connectedCallback(),this.rowItemTemplate===void 0&&(this.rowItemTemplate=this.defaultRowItemTemplate),this.rowsPlaceholder=document.createComment(""),this.appendChild(this.rowsPlaceholder),this.toggleGeneratedHeader(),this.rowsRepeatBehavior=new dy(t=>t.rowsData,t=>t.rowItemTemplate,{positioning:!0}).createBehavior(this.rowsPlaceholder),this.$fastController.addBehaviors([this.rowsRepeatBehavior]),this.addEventListener("row-focused",this.handleRowFocus),this.addEventListener(kp,this.handleFocus),this.addEventListener(Ei,this.handleKeydown),this.addEventListener(Ti,this.handleFocusOut),this.observer=new MutationObserver(this.onChildListChange),this.observer.observe(this,{childList:!0}),this.noTabbing&&this.setAttribute("tabindex","-1"),H.queueUpdate(this.queueRowIndexUpdate)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("row-focused",this.handleRowFocus),this.removeEventListener(kp,this.handleFocus),this.removeEventListener(Ei,this.handleKeydown),this.removeEventListener(Ti,this.handleFocusOut),this.observer.disconnect(),this.rowsPlaceholder=null,this.generatedHeader=null}handleRowFocus(t){this.isUpdatingFocus=!0;const n=t.target;this.focusRowIndex=this.rowElements.indexOf(n),this.focusColumnIndex=n.focusColumnIndex,this.setAttribute("tabIndex","-1"),this.isUpdatingFocus=!1}handleFocus(t){this.focusOnCell(this.focusRowIndex,this.focusColumnIndex,!0)}handleFocusOut(t){(t.relatedTarget===null||!this.contains(t.relatedTarget))&&this.setAttribute("tabIndex",this.noTabbing?"-1":"0")}handleKeydown(t){if(t.defaultPrevented)return;let n;const r=this.rowElements.length-1,i=this.offsetHeight+this.scrollTop,o=this.rowElements[r];switch(t.key){case Fr:t.preventDefault(),this.focusOnCell(this.focusRowIndex-1,this.focusColumnIndex,!0);break;case Nr:t.preventDefault(),this.focusOnCell(this.focusRowIndex+1,this.focusColumnIndex,!0);break;case lk:if(t.preventDefault(),this.rowElements.length===0){this.focusOnCell(0,0,!1);break}if(this.focusRowIndex===0){this.focusOnCell(0,this.focusColumnIndex,!1);return}for(n=this.focusRowIndex-1,n;n>=0;n--){const s=this.rowElements[n];if(s.offsetTop=r||o.offsetTop+o.offsetHeight<=i){this.focusOnCell(r,this.focusColumnIndex,!1);return}for(n=this.focusRowIndex+1,n;n<=r;n++){const s=this.rowElements[n];if(s.offsetTop+s.offsetHeight>i){let l=0;this.generateHeader===js.sticky&&this.generatedHeader!==null&&(l=this.generatedHeader.clientHeight),this.scrollTop=s.offsetTop-l;break}}this.focusOnCell(n,this.focusColumnIndex,!1);break;case Fi:t.ctrlKey&&(t.preventDefault(),this.focusOnCell(0,0,!0));break;case Bi:t.ctrlKey&&this.columnDefinitions!==null&&(t.preventDefault(),this.focusOnCell(this.rowElements.length-1,this.columnDefinitions.length-1,!0));break}}queueFocusUpdate(){this.isUpdatingFocus&&(this.contains(document.activeElement)||this===document.activeElement)||this.pendingFocusUpdate===!1&&(this.pendingFocusUpdate=!0,H.queueUpdate(()=>this.updateFocus()))}updateFocus(){this.pendingFocusUpdate=!1,this.focusOnCell(this.focusRowIndex,this.focusColumnIndex,!0)}toggleGeneratedHeader(){if(this.generatedHeader!==null&&(this.removeChild(this.generatedHeader),this.generatedHeader=null),this.generateHeader!==js.none&&this.rowsData.length>0){const t=document.createElement(this.rowElementTag);this.generatedHeader=t,this.generatedHeader.columnDefinitions=this.columnDefinitions,this.generatedHeader.gridTemplateColumns=this.gridTemplateColumns,this.generatedHeader.rowType=this.generateHeader===js.sticky?To.stickyHeader:To.header,(this.firstChild!==null||this.rowsPlaceholder!==null)&&this.insertBefore(t,this.firstChild!==null?this.firstChild:this.rowsPlaceholder);return}}};Ke.generateColumns=e=>Object.getOwnPropertyNames(e).map((t,n)=>({columnDataKey:t,gridColumn:`${n}`}));b([$({attribute:"no-tabbing",mode:"boolean"})],Ke.prototype,"noTabbing",void 0);b([$({attribute:"generate-header"})],Ke.prototype,"generateHeader",void 0);b([$({attribute:"grid-template-columns"})],Ke.prototype,"gridTemplateColumns",void 0);b([D],Ke.prototype,"rowsData",void 0);b([D],Ke.prototype,"columnDefinitions",void 0);b([D],Ke.prototype,"rowItemTemplate",void 0);b([D],Ke.prototype,"cellItemTemplate",void 0);b([D],Ke.prototype,"headerCellItemTemplate",void 0);b([D],Ke.prototype,"focusRowIndex",void 0);b([D],Ke.prototype,"focusColumnIndex",void 0);b([D],Ke.prototype,"defaultRowItemTemplate",void 0);b([D],Ke.prototype,"rowElementTag",void 0);b([D],Ke.prototype,"rowElements",void 0);const yk=Y` + `};let Ke=class Qu extends ue{constructor(){super(),this.noTabbing=!1,this.generateHeader=Vs.default,this.rowsData=[],this.columnDefinitions=null,this.focusRowIndex=0,this.focusColumnIndex=0,this.rowsPlaceholder=null,this.generatedHeader=null,this.isUpdatingFocus=!1,this.pendingFocusUpdate=!1,this.rowindexUpdateQueued=!1,this.columnDefinitionsStale=!0,this.generatedGridTemplateColumns="",this.focusOnCell=(t,n,r)=>{if(this.rowElements.length===0){this.focusRowIndex=0,this.focusColumnIndex=0;return}const i=Math.max(0,Math.min(this.rowElements.length-1,t)),s=this.rowElements[i].querySelectorAll('[role="cell"], [role="gridcell"], [role="columnheader"], [role="rowheader"]'),l=Math.max(0,Math.min(s.length-1,n)),a=s[l];r&&this.scrollHeight!==this.clientHeight&&(i0||i>this.focusRowIndex&&this.scrollTop{t&&t.length&&(t.forEach(r=>{r.addedNodes.forEach(i=>{i.nodeType===1&&i.getAttribute("role")==="row"&&(i.columnDefinitions=this.columnDefinitions)})}),this.queueRowIndexUpdate())},this.queueRowIndexUpdate=()=>{this.rowindexUpdateQueued||(this.rowindexUpdateQueued=!0,H.queueUpdate(this.updateRowIndexes))},this.updateRowIndexes=()=>{let t=this.gridTemplateColumns;if(t===void 0){if(this.generatedGridTemplateColumns===""&&this.rowElements.length>0){const n=this.rowElements[0];this.generatedGridTemplateColumns=new Array(n.cellElements.length).fill("1fr").join(" ")}t=this.generatedGridTemplateColumns}this.rowElements.forEach((n,r)=>{const i=n;i.rowIndex=r,i.gridTemplateColumns=t,this.columnDefinitionsStale&&(i.columnDefinitions=this.columnDefinitions)}),this.rowindexUpdateQueued=!1,this.columnDefinitionsStale=!1}}static generateTemplateColumns(t){let n="";return t.forEach(r=>{n=`${n}${n===""?"":" "}1fr`}),n}noTabbingChanged(){this.$fastController.isConnected&&(this.noTabbing?this.setAttribute("tabIndex","-1"):this.setAttribute("tabIndex",this.contains(document.activeElement)||this===document.activeElement?"-1":"0"))}generateHeaderChanged(){this.$fastController.isConnected&&this.toggleGeneratedHeader()}gridTemplateColumnsChanged(){this.$fastController.isConnected&&this.updateRowIndexes()}rowsDataChanged(){this.columnDefinitions===null&&this.rowsData.length>0&&(this.columnDefinitions=Qu.generateColumns(this.rowsData[0])),this.$fastController.isConnected&&this.toggleGeneratedHeader()}columnDefinitionsChanged(){if(this.columnDefinitions===null){this.generatedGridTemplateColumns="";return}this.generatedGridTemplateColumns=Qu.generateTemplateColumns(this.columnDefinitions),this.$fastController.isConnected&&(this.columnDefinitionsStale=!0,this.queueRowIndexUpdate())}headerCellItemTemplateChanged(){this.$fastController.isConnected&&this.generatedHeader!==null&&(this.generatedHeader.headerCellItemTemplate=this.headerCellItemTemplate)}focusRowIndexChanged(){this.$fastController.isConnected&&this.queueFocusUpdate()}focusColumnIndexChanged(){this.$fastController.isConnected&&this.queueFocusUpdate()}connectedCallback(){super.connectedCallback(),this.rowItemTemplate===void 0&&(this.rowItemTemplate=this.defaultRowItemTemplate),this.rowsPlaceholder=document.createComment(""),this.appendChild(this.rowsPlaceholder),this.toggleGeneratedHeader(),this.rowsRepeatBehavior=new dy(t=>t.rowsData,t=>t.rowItemTemplate,{positioning:!0}).createBehavior(this.rowsPlaceholder),this.$fastController.addBehaviors([this.rowsRepeatBehavior]),this.addEventListener("row-focused",this.handleRowFocus),this.addEventListener(kp,this.handleFocus),this.addEventListener(Ri,this.handleKeydown),this.addEventListener(Ei,this.handleFocusOut),this.observer=new MutationObserver(this.onChildListChange),this.observer.observe(this,{childList:!0}),this.noTabbing&&this.setAttribute("tabindex","-1"),H.queueUpdate(this.queueRowIndexUpdate)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("row-focused",this.handleRowFocus),this.removeEventListener(kp,this.handleFocus),this.removeEventListener(Ri,this.handleKeydown),this.removeEventListener(Ei,this.handleFocusOut),this.observer.disconnect(),this.rowsPlaceholder=null,this.generatedHeader=null}handleRowFocus(t){this.isUpdatingFocus=!0;const n=t.target;this.focusRowIndex=this.rowElements.indexOf(n),this.focusColumnIndex=n.focusColumnIndex,this.setAttribute("tabIndex","-1"),this.isUpdatingFocus=!1}handleFocus(t){this.focusOnCell(this.focusRowIndex,this.focusColumnIndex,!0)}handleFocusOut(t){(t.relatedTarget===null||!this.contains(t.relatedTarget))&&this.setAttribute("tabIndex",this.noTabbing?"-1":"0")}handleKeydown(t){if(t.defaultPrevented)return;let n;const r=this.rowElements.length-1,i=this.offsetHeight+this.scrollTop,o=this.rowElements[r];switch(t.key){case Fr:t.preventDefault(),this.focusOnCell(this.focusRowIndex-1,this.focusColumnIndex,!0);break;case Nr:t.preventDefault(),this.focusOnCell(this.focusRowIndex+1,this.focusColumnIndex,!0);break;case lk:if(t.preventDefault(),this.rowElements.length===0){this.focusOnCell(0,0,!1);break}if(this.focusRowIndex===0){this.focusOnCell(0,this.focusColumnIndex,!1);return}for(n=this.focusRowIndex-1,n;n>=0;n--){const s=this.rowElements[n];if(s.offsetTop=r||o.offsetTop+o.offsetHeight<=i){this.focusOnCell(r,this.focusColumnIndex,!1);return}for(n=this.focusRowIndex+1,n;n<=r;n++){const s=this.rowElements[n];if(s.offsetTop+s.offsetHeight>i){let l=0;this.generateHeader===Vs.sticky&&this.generatedHeader!==null&&(l=this.generatedHeader.clientHeight),this.scrollTop=s.offsetTop-l;break}}this.focusOnCell(n,this.focusColumnIndex,!1);break;case Bi:t.ctrlKey&&(t.preventDefault(),this.focusOnCell(0,0,!0));break;case zi:t.ctrlKey&&this.columnDefinitions!==null&&(t.preventDefault(),this.focusOnCell(this.rowElements.length-1,this.columnDefinitions.length-1,!0));break}}queueFocusUpdate(){this.isUpdatingFocus&&(this.contains(document.activeElement)||this===document.activeElement)||this.pendingFocusUpdate===!1&&(this.pendingFocusUpdate=!0,H.queueUpdate(()=>this.updateFocus()))}updateFocus(){this.pendingFocusUpdate=!1,this.focusOnCell(this.focusRowIndex,this.focusColumnIndex,!0)}toggleGeneratedHeader(){if(this.generatedHeader!==null&&(this.removeChild(this.generatedHeader),this.generatedHeader=null),this.generateHeader!==Vs.none&&this.rowsData.length>0){const t=document.createElement(this.rowElementTag);this.generatedHeader=t,this.generatedHeader.columnDefinitions=this.columnDefinitions,this.generatedHeader.gridTemplateColumns=this.gridTemplateColumns,this.generatedHeader.rowType=this.generateHeader===Vs.sticky?Eo.stickyHeader:Eo.header,(this.firstChild!==null||this.rowsPlaceholder!==null)&&this.insertBefore(t,this.firstChild!==null?this.firstChild:this.rowsPlaceholder);return}}};Ke.generateColumns=e=>Object.getOwnPropertyNames(e).map((t,n)=>({columnDataKey:t,gridColumn:`${n}`}));b([$({attribute:"no-tabbing",mode:"boolean"})],Ke.prototype,"noTabbing",void 0);b([$({attribute:"generate-header"})],Ke.prototype,"generateHeader",void 0);b([$({attribute:"grid-template-columns"})],Ke.prototype,"gridTemplateColumns",void 0);b([D],Ke.prototype,"rowsData",void 0);b([D],Ke.prototype,"columnDefinitions",void 0);b([D],Ke.prototype,"rowItemTemplate",void 0);b([D],Ke.prototype,"cellItemTemplate",void 0);b([D],Ke.prototype,"headerCellItemTemplate",void 0);b([D],Ke.prototype,"focusRowIndex",void 0);b([D],Ke.prototype,"focusColumnIndex",void 0);b([D],Ke.prototype,"defaultRowItemTemplate",void 0);b([D],Ke.prototype,"rowElementTag",void 0);b([D],Ke.prototype,"rowElements",void 0);const yk=Y` @@ -204,7 +204,7 @@ PERFORMANCE OF THIS SOFTWARE. -`;let pr=class extends ue{constructor(){super(...arguments),this.cellType=Bn.default,this.rowData=null,this.columnDefinition=null,this.isActiveCell=!1,this.customCellView=null,this.updateCellStyle=()=>{this.style.gridColumn=this.gridColumn}}cellTypeChanged(){this.$fastController.isConnected&&this.updateCellView()}gridColumnChanged(){this.$fastController.isConnected&&this.updateCellStyle()}columnDefinitionChanged(t,n){this.$fastController.isConnected&&this.updateCellView()}connectedCallback(){var t;super.connectedCallback(),this.addEventListener(Cp,this.handleFocusin),this.addEventListener(Ti,this.handleFocusout),this.addEventListener(Ei,this.handleKeydown),this.style.gridColumn=`${((t=this.columnDefinition)===null||t===void 0?void 0:t.gridColumn)===void 0?0:this.columnDefinition.gridColumn}`,this.updateCellView(),this.updateCellStyle()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(Cp,this.handleFocusin),this.removeEventListener(Ti,this.handleFocusout),this.removeEventListener(Ei,this.handleKeydown),this.disconnectCellView()}handleFocusin(t){if(!this.isActiveCell){switch(this.isActiveCell=!0,this.cellType){case Bn.columnHeader:if(this.columnDefinition!==null&&this.columnDefinition.headerCellInternalFocusQueue!==!0&&typeof this.columnDefinition.headerCellFocusTargetCallback=="function"){const n=this.columnDefinition.headerCellFocusTargetCallback(this);n!==null&&n.focus()}break;default:if(this.columnDefinition!==null&&this.columnDefinition.cellInternalFocusQueue!==!0&&typeof this.columnDefinition.cellFocusTargetCallback=="function"){const n=this.columnDefinition.cellFocusTargetCallback(this);n!==null&&n.focus()}break}this.$emit("cell-focused",this)}}handleFocusout(t){this!==document.activeElement&&!this.contains(document.activeElement)&&(this.isActiveCell=!1)}handleKeydown(t){if(!(t.defaultPrevented||this.columnDefinition===null||this.cellType===Bn.default&&this.columnDefinition.cellInternalFocusQueue!==!0||this.cellType===Bn.columnHeader&&this.columnDefinition.headerCellInternalFocusQueue!==!0))switch(t.key){case ls:case ok:if(this.contains(document.activeElement)&&document.activeElement!==this)return;switch(this.cellType){case Bn.columnHeader:if(this.columnDefinition.headerCellFocusTargetCallback!==void 0){const n=this.columnDefinition.headerCellFocusTargetCallback(this);n!==null&&n.focus(),t.preventDefault()}break;default:if(this.columnDefinition.cellFocusTargetCallback!==void 0){const n=this.columnDefinition.cellFocusTargetCallback(this);n!==null&&n.focus(),t.preventDefault()}break}break;case da:this.contains(document.activeElement)&&document.activeElement!==this&&(this.focus(),t.preventDefault());break}}updateCellView(){if(this.disconnectCellView(),this.columnDefinition!==null)switch(this.cellType){case Bn.columnHeader:this.columnDefinition.headerCellTemplate!==void 0?this.customCellView=this.columnDefinition.headerCellTemplate.render(this,this):this.customCellView=bk.render(this,this);break;case void 0:case Bn.rowHeader:case Bn.default:this.columnDefinition.cellTemplate!==void 0?this.customCellView=this.columnDefinition.cellTemplate.render(this,this):this.customCellView=yk.render(this,this);break}}disconnectCellView(){this.customCellView!==null&&(this.customCellView.dispose(),this.customCellView=null)}};b([$({attribute:"cell-type"})],pr.prototype,"cellType",void 0);b([$({attribute:"grid-column"})],pr.prototype,"gridColumn",void 0);b([D],pr.prototype,"rowData",void 0);b([D],pr.prototype,"columnDefinition",void 0);function xk(e){const t=e.tagFor(pr);return Y` +`;let pr=class extends ue{constructor(){super(...arguments),this.cellType=Bn.default,this.rowData=null,this.columnDefinition=null,this.isActiveCell=!1,this.customCellView=null,this.updateCellStyle=()=>{this.style.gridColumn=this.gridColumn}}cellTypeChanged(){this.$fastController.isConnected&&this.updateCellView()}gridColumnChanged(){this.$fastController.isConnected&&this.updateCellStyle()}columnDefinitionChanged(t,n){this.$fastController.isConnected&&this.updateCellView()}connectedCallback(){var t;super.connectedCallback(),this.addEventListener(Cp,this.handleFocusin),this.addEventListener(Ei,this.handleFocusout),this.addEventListener(Ri,this.handleKeydown),this.style.gridColumn=`${((t=this.columnDefinition)===null||t===void 0?void 0:t.gridColumn)===void 0?0:this.columnDefinition.gridColumn}`,this.updateCellView(),this.updateCellStyle()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(Cp,this.handleFocusin),this.removeEventListener(Ei,this.handleFocusout),this.removeEventListener(Ri,this.handleKeydown),this.disconnectCellView()}handleFocusin(t){if(!this.isActiveCell){switch(this.isActiveCell=!0,this.cellType){case Bn.columnHeader:if(this.columnDefinition!==null&&this.columnDefinition.headerCellInternalFocusQueue!==!0&&typeof this.columnDefinition.headerCellFocusTargetCallback=="function"){const n=this.columnDefinition.headerCellFocusTargetCallback(this);n!==null&&n.focus()}break;default:if(this.columnDefinition!==null&&this.columnDefinition.cellInternalFocusQueue!==!0&&typeof this.columnDefinition.cellFocusTargetCallback=="function"){const n=this.columnDefinition.cellFocusTargetCallback(this);n!==null&&n.focus()}break}this.$emit("cell-focused",this)}}handleFocusout(t){this!==document.activeElement&&!this.contains(document.activeElement)&&(this.isActiveCell=!1)}handleKeydown(t){if(!(t.defaultPrevented||this.columnDefinition===null||this.cellType===Bn.default&&this.columnDefinition.cellInternalFocusQueue!==!0||this.cellType===Bn.columnHeader&&this.columnDefinition.headerCellInternalFocusQueue!==!0))switch(t.key){case as:case ok:if(this.contains(document.activeElement)&&document.activeElement!==this)return;switch(this.cellType){case Bn.columnHeader:if(this.columnDefinition.headerCellFocusTargetCallback!==void 0){const n=this.columnDefinition.headerCellFocusTargetCallback(this);n!==null&&n.focus(),t.preventDefault()}break;default:if(this.columnDefinition.cellFocusTargetCallback!==void 0){const n=this.columnDefinition.cellFocusTargetCallback(this);n!==null&&n.focus(),t.preventDefault()}break}break;case fa:this.contains(document.activeElement)&&document.activeElement!==this&&(this.focus(),t.preventDefault());break}}updateCellView(){if(this.disconnectCellView(),this.columnDefinition!==null)switch(this.cellType){case Bn.columnHeader:this.columnDefinition.headerCellTemplate!==void 0?this.customCellView=this.columnDefinition.headerCellTemplate.render(this,this):this.customCellView=bk.render(this,this);break;case void 0:case Bn.rowHeader:case Bn.default:this.columnDefinition.cellTemplate!==void 0?this.customCellView=this.columnDefinition.cellTemplate.render(this,this):this.customCellView=yk.render(this,this);break}}disconnectCellView(){this.customCellView!==null&&(this.customCellView.dispose(),this.customCellView=null)}};b([$({attribute:"cell-type"})],pr.prototype,"cellType",void 0);b([$({attribute:"grid-column"})],pr.prototype,"gridColumn",void 0);b([D],pr.prototype,"rowData",void 0);b([D],pr.prototype,"columnDefinition",void 0);function xk(e){const t=e.tagFor(pr);return Y` <${t} cell-type="${n=>n.isRowHeader?"rowheader":void 0}" grid-column="${(n,r)=>r.index+1}" @@ -264,7 +264,7 @@ PERFORMANCE OF THIS SOFTWARE. -`;class $k extends ue{}class Tk extends xy($k){constructor(){super(...arguments),this.proxy=document.createElement("input")}}let ha=class extends Tk{constructor(){super(),this.initialValue="on",this.indeterminate=!1,this.keypressHandler=t=>{if(!this.readOnly)switch(t.key){case as:this.indeterminate&&(this.indeterminate=!1),this.checked=!this.checked;break}},this.clickHandler=t=>{!this.disabled&&!this.readOnly&&(this.indeterminate&&(this.indeterminate=!1),this.checked=!this.checked)},this.proxy.setAttribute("type","checkbox")}readOnlyChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.readOnly=this.readOnly)}};b([$({attribute:"readonly",mode:"boolean"})],ha.prototype,"readOnly",void 0);b([D],ha.prototype,"defaultSlottedNodes",void 0);b([D],ha.prototype,"indeterminate",void 0);function wy(e){return nk(e)&&(e.getAttribute("role")==="option"||e instanceof HTMLOptionElement)}class Mn extends ue{constructor(t,n,r,i){super(),this.defaultSelected=!1,this.dirtySelected=!1,this.selected=this.defaultSelected,this.dirtyValue=!1,t&&(this.textContent=t),n&&(this.initialValue=n),r&&(this.defaultSelected=r),i&&(this.selected=i),this.proxy=new Option(`${this.textContent}`,this.initialValue,this.defaultSelected,this.selected),this.proxy.disabled=this.disabled}checkedChanged(t,n){if(typeof n=="boolean"){this.ariaChecked=n?"true":"false";return}this.ariaChecked=null}contentChanged(t,n){this.proxy instanceof HTMLOptionElement&&(this.proxy.textContent=this.textContent),this.$emit("contentchange",null,{bubbles:!0})}defaultSelectedChanged(){this.dirtySelected||(this.selected=this.defaultSelected,this.proxy instanceof HTMLOptionElement&&(this.proxy.selected=this.defaultSelected))}disabledChanged(t,n){this.ariaDisabled=this.disabled?"true":"false",this.proxy instanceof HTMLOptionElement&&(this.proxy.disabled=this.disabled)}selectedAttributeChanged(){this.defaultSelected=this.selectedAttribute,this.proxy instanceof HTMLOptionElement&&(this.proxy.defaultSelected=this.defaultSelected)}selectedChanged(){this.ariaSelected=this.selected?"true":"false",this.dirtySelected||(this.dirtySelected=!0),this.proxy instanceof HTMLOptionElement&&(this.proxy.selected=this.selected)}initialValueChanged(t,n){this.dirtyValue||(this.value=this.initialValue,this.dirtyValue=!1)}get label(){var t;return(t=this.value)!==null&&t!==void 0?t:this.text}get text(){var t,n;return(n=(t=this.textContent)===null||t===void 0?void 0:t.replace(/\s+/g," ").trim())!==null&&n!==void 0?n:""}set value(t){const n=`${t??""}`;this._value=n,this.dirtyValue=!0,this.proxy instanceof HTMLOptionElement&&(this.proxy.value=n),V.notify(this,"value")}get value(){var t;return V.track(this,"value"),(t=this._value)!==null&&t!==void 0?t:this.text}get form(){return this.proxy?this.proxy.form:null}}b([D],Mn.prototype,"checked",void 0);b([D],Mn.prototype,"content",void 0);b([D],Mn.prototype,"defaultSelected",void 0);b([$({mode:"boolean"})],Mn.prototype,"disabled",void 0);b([$({attribute:"selected",mode:"boolean"})],Mn.prototype,"selectedAttribute",void 0);b([D],Mn.prototype,"selected",void 0);b([$({attribute:"value",mode:"fromView"})],Mn.prototype,"initialValue",void 0);class zi{}b([D],zi.prototype,"ariaChecked",void 0);b([D],zi.prototype,"ariaPosInSet",void 0);b([D],zi.prototype,"ariaSelected",void 0);b([D],zi.prototype,"ariaSetSize",void 0);wt(zi,de);wt(Mn,Mi,zi);class lt extends ue{constructor(){super(...arguments),this._options=[],this.selectedIndex=-1,this.selectedOptions=[],this.shouldSkipFocus=!1,this.typeaheadBuffer="",this.typeaheadExpired=!0,this.typeaheadTimeout=-1}get firstSelectedOption(){var t;return(t=this.selectedOptions[0])!==null&&t!==void 0?t:null}get hasSelectableOptions(){return this.options.length>0&&!this.options.every(t=>t.disabled)}get length(){var t,n;return(n=(t=this.options)===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0}get options(){return V.track(this,"options"),this._options}set options(t){this._options=t,V.notify(this,"options")}get typeAheadExpired(){return this.typeaheadExpired}set typeAheadExpired(t){this.typeaheadExpired=t}clickHandler(t){const n=t.target.closest("option,[role=option]");if(n&&!n.disabled)return this.selectedIndex=this.options.indexOf(n),!0}focusAndScrollOptionIntoView(t=this.firstSelectedOption){this.contains(document.activeElement)&&t!==null&&(t.focus(),requestAnimationFrame(()=>{t.scrollIntoView({block:"nearest"})}))}focusinHandler(t){!this.shouldSkipFocus&&t.target===t.currentTarget&&(this.setSelectedOptions(),this.focusAndScrollOptionIntoView()),this.shouldSkipFocus=!1}getTypeaheadMatches(){const t=this.typeaheadBuffer.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&"),n=new RegExp(`^${t}`,"gi");return this.options.filter(r=>r.text.trim().match(n))}getSelectableIndex(t=this.selectedIndex,n){const r=t>n?-1:t!s&&!l.disabled&&a!s&&!l.disabled&&a>i?l:s,o);break}}return this.options.indexOf(o)}handleChange(t,n){switch(n){case"selected":{lt.slottedOptionFilter(t)&&(this.selectedIndex=this.options.indexOf(t)),this.setSelectedOptions();break}}}handleTypeAhead(t){this.typeaheadTimeout&&window.clearTimeout(this.typeaheadTimeout),this.typeaheadTimeout=window.setTimeout(()=>this.typeaheadExpired=!0,lt.TYPE_AHEAD_TIMEOUT_MS),!(t.length>1)&&(this.typeaheadBuffer=`${this.typeaheadExpired?"":this.typeaheadBuffer}${t}`)}keydownHandler(t){if(this.disabled)return!0;this.shouldSkipFocus=!1;const n=t.key;switch(n){case Fi:{t.shiftKey||(t.preventDefault(),this.selectFirstOption());break}case Nr:{t.shiftKey||(t.preventDefault(),this.selectNextOption());break}case Fr:{t.shiftKey||(t.preventDefault(),this.selectPreviousOption());break}case Bi:{t.preventDefault(),this.selectLastOption();break}case ff:return this.focusAndScrollOptionIntoView(),!0;case ls:case da:return!0;case as:if(this.typeaheadExpired)return!0;default:return n.length===1&&this.handleTypeAhead(`${n}`),!0}}mousedownHandler(t){return this.shouldSkipFocus=!this.contains(document.activeElement),!0}multipleChanged(t,n){this.ariaMultiSelectable=n?"true":null}selectedIndexChanged(t,n){var r;if(!this.hasSelectableOptions){this.selectedIndex=-1;return}if(!((r=this.options[this.selectedIndex])===null||r===void 0)&&r.disabled&&typeof t=="number"){const i=this.getSelectableIndex(t,n),o=i>-1?i:t;this.selectedIndex=o,n===o&&this.selectedIndexChanged(n,o);return}this.setSelectedOptions()}selectedOptionsChanged(t,n){var r;const i=n.filter(lt.slottedOptionFilter);(r=this.options)===null||r===void 0||r.forEach(o=>{const s=V.getNotifier(o);s.unsubscribe(this,"selected"),o.selected=i.includes(o),s.subscribe(this,"selected")})}selectFirstOption(){var t,n;this.disabled||(this.selectedIndex=(n=(t=this.options)===null||t===void 0?void 0:t.findIndex(r=>!r.disabled))!==null&&n!==void 0?n:-1)}selectLastOption(){this.disabled||(this.selectedIndex=ek(this.options,t=>!t.disabled))}selectNextOption(){!this.disabled&&this.selectedIndex0&&(this.selectedIndex=this.selectedIndex-1)}setDefaultSelectedOption(){var t,n;this.selectedIndex=(n=(t=this.options)===null||t===void 0?void 0:t.findIndex(r=>r.defaultSelected))!==null&&n!==void 0?n:-1}setSelectedOptions(){var t,n,r;!((t=this.options)===null||t===void 0)&&t.length&&(this.selectedOptions=[this.options[this.selectedIndex]],this.ariaActiveDescendant=(r=(n=this.firstSelectedOption)===null||n===void 0?void 0:n.id)!==null&&r!==void 0?r:"",this.focusAndScrollOptionIntoView())}slottedOptionsChanged(t,n){this.options=n.reduce((i,o)=>(wy(o)&&i.push(o),i),[]);const r=`${this.options.length}`;this.options.forEach((i,o)=>{i.id||(i.id=Hl("option-")),i.ariaPosInSet=`${o+1}`,i.ariaSetSize=r}),this.$fastController.isConnected&&(this.setSelectedOptions(),this.setDefaultSelectedOption())}typeaheadBufferChanged(t,n){if(this.$fastController.isConnected){const r=this.getTypeaheadMatches();if(r.length){const i=this.options.indexOf(r[0]);i>-1&&(this.selectedIndex=i)}this.typeaheadExpired=!1}}}lt.slottedOptionFilter=e=>wy(e)&&!e.hidden;lt.TYPE_AHEAD_TIMEOUT_MS=1e3;b([$({mode:"boolean"})],lt.prototype,"disabled",void 0);b([D],lt.prototype,"selectedIndex",void 0);b([D],lt.prototype,"selectedOptions",void 0);b([D],lt.prototype,"slottedOptions",void 0);b([D],lt.prototype,"typeaheadBuffer",void 0);class Br{}b([D],Br.prototype,"ariaActiveDescendant",void 0);b([D],Br.prototype,"ariaDisabled",void 0);b([D],Br.prototype,"ariaExpanded",void 0);b([D],Br.prototype,"ariaMultiSelectable",void 0);wt(Br,de);wt(lt,Br);const Lc={above:"above",below:"below"};function Qu(e){const t=e.parentElement;if(t)return t;{const n=e.getRootNode();if(n.host instanceof HTMLElement)return n.host}return null}function Ek(e,t){let n=t;for(;n!==null;){if(n===e)return!0;n=Qu(n)}return!1}const En=document.createElement("div");function Rk(e){return e instanceof ua}class pf{setProperty(t,n){H.queueUpdate(()=>this.target.setProperty(t,n))}removeProperty(t){H.queueUpdate(()=>this.target.removeProperty(t))}}class Ok extends pf{constructor(t){super();const n=new CSSStyleSheet;n[ey]=!0,this.target=n.cssRules[n.insertRule(":host{}")].style,t.$fastController.addStyles(yt.create([n]))}}class Pk extends pf{constructor(){super();const t=new CSSStyleSheet;this.target=t.cssRules[t.insertRule(":root{}")].style,document.adoptedStyleSheets=[...document.adoptedStyleSheets,t]}}class Ik extends pf{constructor(){super(),this.style=document.createElement("style"),document.head.appendChild(this.style);const{sheet:t}=this.style;if(t){const n=t.insertRule(":root{}",t.cssRules.length);this.target=t.cssRules[n].style}}}class ky{constructor(t){this.store=new Map,this.target=null;const n=t.$fastController;this.style=document.createElement("style"),n.addStyles(this.style),V.getNotifier(n).subscribe(this,"isConnected"),this.handleChange(n,"isConnected")}targetChanged(){if(this.target!==null)for(const[t,n]of this.store.entries())this.target.setProperty(t,n)}setProperty(t,n){this.store.set(t,n),H.queueUpdate(()=>{this.target!==null&&this.target.setProperty(t,n)})}removeProperty(t){this.store.delete(t),H.queueUpdate(()=>{this.target!==null&&this.target.removeProperty(t)})}handleChange(t,n){const{sheet:r}=this.style;if(r){const i=r.insertRule(":host{}",r.cssRules.length);this.target=r.cssRules[i].style}else this.target=null}}b([D],ky.prototype,"target",void 0);class _k{constructor(t){this.target=t.style}setProperty(t,n){H.queueUpdate(()=>this.target.setProperty(t,n))}removeProperty(t){H.queueUpdate(()=>this.target.removeProperty(t))}}class Le{setProperty(t,n){Le.properties[t]=n;for(const r of Le.roots.values())oi.getOrCreate(Le.normalizeRoot(r)).setProperty(t,n)}removeProperty(t){delete Le.properties[t];for(const n of Le.roots.values())oi.getOrCreate(Le.normalizeRoot(n)).removeProperty(t)}static registerRoot(t){const{roots:n}=Le;if(!n.has(t)){n.add(t);const r=oi.getOrCreate(this.normalizeRoot(t));for(const i in Le.properties)r.setProperty(i,Le.properties[i])}}static unregisterRoot(t){const{roots:n}=Le;if(n.has(t)){n.delete(t);const r=oi.getOrCreate(Le.normalizeRoot(t));for(const i in Le.properties)r.removeProperty(i)}}static normalizeRoot(t){return t===En?document:t}}Le.roots=new Set;Le.properties={};const Nc=new WeakMap,Ak=H.supportsAdoptedStyleSheets?Ok:ky,oi=Object.freeze({getOrCreate(e){if(Nc.has(e))return Nc.get(e);let t;return e===En?t=new Le:e instanceof Document?t=H.supportsAdoptedStyleSheets?new Pk:new Ik:Rk(e)?t=new Ak(e):t=new _k(e),Nc.set(e,t),t}});class ot extends sy{constructor(t){super(),this.subscribers=new WeakMap,this._appliedTo=new Set,this.name=t.name,t.cssCustomPropertyName!==null&&(this.cssCustomProperty=`--${t.cssCustomPropertyName}`,this.cssVar=`var(${this.cssCustomProperty})`),this.id=ot.uniqueId(),ot.tokensById.set(this.id,this)}get appliedTo(){return[...this._appliedTo]}static from(t){return new ot({name:typeof t=="string"?t:t.name,cssCustomPropertyName:typeof t=="string"?t:t.cssCustomPropertyName===void 0?t.name:t.cssCustomPropertyName})}static isCSSDesignToken(t){return typeof t.cssCustomProperty=="string"}static isDerivedDesignTokenValue(t){return typeof t=="function"}static getTokenById(t){return ot.tokensById.get(t)}getOrCreateSubscriberSet(t=this){return this.subscribers.get(t)||this.subscribers.set(t,new Set)&&this.subscribers.get(t)}createCSS(){return this.cssVar||""}getValueFor(t){const n=ke.getOrCreate(t).get(this);if(n!==void 0)return n;throw new Error(`Value could not be retrieved for token named "${this.name}". Ensure the value is set for ${t} or an ancestor of ${t}.`)}setValueFor(t,n){return this._appliedTo.add(t),n instanceof ot&&(n=this.alias(n)),ke.getOrCreate(t).set(this,n),this}deleteValueFor(t){return this._appliedTo.delete(t),ke.existsFor(t)&&ke.getOrCreate(t).delete(this),this}withDefault(t){return this.setValueFor(En,t),this}subscribe(t,n){const r=this.getOrCreateSubscriberSet(n);n&&!ke.existsFor(n)&&ke.getOrCreate(n),r.has(t)||r.add(t)}unsubscribe(t,n){const r=this.subscribers.get(n||this);r&&r.has(t)&&r.delete(t)}notify(t){const n=Object.freeze({token:this,target:t});this.subscribers.has(this)&&this.subscribers.get(this).forEach(r=>r.handleChange(n)),this.subscribers.has(t)&&this.subscribers.get(t).forEach(r=>r.handleChange(n))}alias(t){return n=>t.getValueFor(n)}}ot.uniqueId=(()=>{let e=0;return()=>(e++,e.toString(16))})();ot.tokensById=new Map;class Dk{startReflection(t,n){t.subscribe(this,n),this.handleChange({token:t,target:n})}stopReflection(t,n){t.unsubscribe(this,n),this.remove(t,n)}handleChange(t){const{token:n,target:r}=t;this.add(n,r)}add(t,n){oi.getOrCreate(n).setProperty(t.cssCustomProperty,this.resolveCSSValue(ke.getOrCreate(n).get(t)))}remove(t,n){oi.getOrCreate(n).removeProperty(t.cssCustomProperty)}resolveCSSValue(t){return t&&typeof t.createCSS=="function"?t.createCSS():t}}class Mk{constructor(t,n,r){this.source=t,this.token=n,this.node=r,this.dependencies=new Set,this.observer=V.binding(t,this,!1),this.observer.handleChange=this.observer.call,this.handleChange()}disconnect(){this.observer.disconnect()}handleChange(){this.node.store.set(this.token,this.observer.observe(this.node.target,So))}}class Lk{constructor(){this.values=new Map}set(t,n){this.values.get(t)!==n&&(this.values.set(t,n),V.getNotifier(this).notify(t.id))}get(t){return V.track(this,t.id),this.values.get(t)}delete(t){this.values.delete(t)}all(){return this.values.entries()}}const ro=new WeakMap,io=new WeakMap;class ke{constructor(t){this.target=t,this.store=new Lk,this.children=[],this.assignedValues=new Map,this.reflecting=new Set,this.bindingObservers=new Map,this.tokenValueChangeHandler={handleChange:(n,r)=>{const i=ot.getTokenById(r);i&&(i.notify(this.target),this.updateCSSTokenReflection(n,i))}},ro.set(t,this),V.getNotifier(this.store).subscribe(this.tokenValueChangeHandler),t instanceof ua?t.$fastController.addBehaviors([this]):t.isConnected&&this.bind()}static getOrCreate(t){return ro.get(t)||new ke(t)}static existsFor(t){return ro.has(t)}static findParent(t){if(En!==t.target){let n=Qu(t.target);for(;n!==null;){if(ro.has(n))return ro.get(n);n=Qu(n)}return ke.getOrCreate(En)}return null}static findClosestAssignedNode(t,n){let r=n;do{if(r.has(t))return r;r=r.parent?r.parent:r.target!==En?ke.getOrCreate(En):null}while(r!==null);return null}get parent(){return io.get(this)||null}updateCSSTokenReflection(t,n){if(ot.isCSSDesignToken(n)){const r=this.parent,i=this.isReflecting(n);if(r){const o=r.get(n),s=t.get(n);o!==s&&!i?this.reflectToCSS(n):o===s&&i&&this.stopReflectToCSS(n)}else i||this.reflectToCSS(n)}}has(t){return this.assignedValues.has(t)}get(t){const n=this.store.get(t);if(n!==void 0)return n;const r=this.getRaw(t);if(r!==void 0)return this.hydrate(t,r),this.get(t)}getRaw(t){var n;return this.assignedValues.has(t)?this.assignedValues.get(t):(n=ke.findClosestAssignedNode(t,this))===null||n===void 0?void 0:n.getRaw(t)}set(t,n){ot.isDerivedDesignTokenValue(this.assignedValues.get(t))&&this.tearDownBindingObserver(t),this.assignedValues.set(t,n),ot.isDerivedDesignTokenValue(n)?this.setupBindingObserver(t,n):this.store.set(t,n)}delete(t){this.assignedValues.delete(t),this.tearDownBindingObserver(t);const n=this.getRaw(t);n?this.hydrate(t,n):this.store.delete(t)}bind(){const t=ke.findParent(this);t&&t.appendChild(this);for(const n of this.assignedValues.keys())n.notify(this.target)}unbind(){this.parent&&io.get(this).removeChild(this)}appendChild(t){t.parent&&io.get(t).removeChild(t);const n=this.children.filter(r=>t.contains(r));io.set(t,this),this.children.push(t),n.forEach(r=>t.appendChild(r)),V.getNotifier(this.store).subscribe(t);for(const[r,i]of this.store.all())t.hydrate(r,this.bindingObservers.has(r)?this.getRaw(r):i)}removeChild(t){const n=this.children.indexOf(t);return n!==-1&&this.children.splice(n,1),V.getNotifier(this.store).unsubscribe(t),t.parent===this?io.delete(t):!1}contains(t){return Ek(this.target,t.target)}reflectToCSS(t){this.isReflecting(t)||(this.reflecting.add(t),ke.cssCustomPropertyReflector.startReflection(t,this.target))}stopReflectToCSS(t){this.isReflecting(t)&&(this.reflecting.delete(t),ke.cssCustomPropertyReflector.stopReflection(t,this.target))}isReflecting(t){return this.reflecting.has(t)}handleChange(t,n){const r=ot.getTokenById(n);r&&(this.hydrate(r,this.getRaw(r)),this.updateCSSTokenReflection(this.store,r))}hydrate(t,n){if(!this.has(t)){const r=this.bindingObservers.get(t);ot.isDerivedDesignTokenValue(n)?r?r.source!==n&&(this.tearDownBindingObserver(t),this.setupBindingObserver(t,n)):this.setupBindingObserver(t,n):(r&&this.tearDownBindingObserver(t),this.store.set(t,n))}}setupBindingObserver(t,n){const r=new Mk(n,t,this);return this.bindingObservers.set(t,r),r}tearDownBindingObserver(t){return this.bindingObservers.has(t)?(this.bindingObservers.get(t).disconnect(),this.bindingObservers.delete(t),!0):!1}}ke.cssCustomPropertyReflector=new Dk;b([D],ke.prototype,"children",void 0);function Nk(e){return ot.from(e)}const Cy=Object.freeze({create:Nk,notifyConnection(e){return!e.isConnected||!ke.existsFor(e)?!1:(ke.getOrCreate(e).bind(),!0)},notifyDisconnection(e){return e.isConnected||!ke.existsFor(e)?!1:(ke.getOrCreate(e).unbind(),!0)},registerRoot(e=En){Le.registerRoot(e)},unregisterRoot(e=En){Le.unregisterRoot(e)}}),Fc=Object.freeze({definitionCallbackOnly:null,ignoreDuplicate:Symbol()}),Bc=new Map,al=new Map;let hi=null;const oo=he.createInterface(e=>e.cachedCallback(t=>(hi===null&&(hi=new $y(null,t)),hi))),Sy=Object.freeze({tagFor(e){return al.get(e)},responsibleFor(e){const t=e.$$designSystem$$;return t||he.findResponsibleContainer(e).get(oo)},getOrCreate(e){if(!e)return hi===null&&(hi=he.getOrCreateDOMContainer().get(oo)),hi;const t=e.$$designSystem$$;if(t)return t;const n=he.getOrCreateDOMContainer(e);if(n.has(oo,!1))return n.get(oo);{const r=new $y(e,n);return n.register(qo.instance(oo,r)),r}}});function Fk(e,t,n){return typeof e=="string"?{name:e,type:t,callback:n}:e}class $y{constructor(t,n){this.owner=t,this.container=n,this.designTokensInitialized=!1,this.prefix="fast",this.shadowRootMode=void 0,this.disambiguate=()=>Fc.definitionCallbackOnly,t!==null&&(t.$$designSystem$$=this)}withPrefix(t){return this.prefix=t,this}withShadowRootMode(t){return this.shadowRootMode=t,this}withElementDisambiguation(t){return this.disambiguate=t,this}withDesignTokenRoot(t){return this.designTokenRoot=t,this}register(...t){const n=this.container,r=[],i=this.disambiguate,o=this.shadowRootMode,s={elementPrefix:this.prefix,tryDefineElement(l,a,c){const u=Fk(l,a,c),{name:d,callback:f,baseClass:y}=u;let{type:v}=u,g=d,T=Bc.get(g),p=!0;for(;T;){const h=i(g,v,T);switch(h){case Fc.ignoreDuplicate:return;case Fc.definitionCallbackOnly:p=!1,T=void 0;break;default:g=h,T=Bc.get(g);break}}p&&((al.has(v)||v===ue)&&(v=class extends v{}),Bc.set(g,v),al.set(v,g),y&&al.set(y,g)),r.push(new Bk(n,g,v,o,f,p))}};this.designTokensInitialized||(this.designTokensInitialized=!0,this.designTokenRoot!==null&&Cy.registerRoot(this.designTokenRoot)),n.registerWithContext(s,...t);for(const l of r)l.callback(l),l.willDefine&&l.definition!==null&&l.definition.define();return this}}class Bk{constructor(t,n,r,i,o,s){this.container=t,this.name=n,this.type=r,this.shadowRootMode=i,this.callback=o,this.willDefine=s,this.definition=null}definePresentation(t){vy.define(this.name,t,this.container)}defineElement(t){this.definition=new ss(this.type,Object.assign(Object.assign({},t),{name:this.name}))}tagFor(t){return Sy.tagFor(t)}}const zk=(e,t)=>Y` +`;class $k extends ue{}class Tk extends xy($k){constructor(){super(...arguments),this.proxy=document.createElement("input")}}let pa=class extends Tk{constructor(){super(),this.initialValue="on",this.indeterminate=!1,this.keypressHandler=t=>{if(!this.readOnly)switch(t.key){case cs:this.indeterminate&&(this.indeterminate=!1),this.checked=!this.checked;break}},this.clickHandler=t=>{!this.disabled&&!this.readOnly&&(this.indeterminate&&(this.indeterminate=!1),this.checked=!this.checked)},this.proxy.setAttribute("type","checkbox")}readOnlyChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.readOnly=this.readOnly)}};b([$({attribute:"readonly",mode:"boolean"})],pa.prototype,"readOnly",void 0);b([D],pa.prototype,"defaultSlottedNodes",void 0);b([D],pa.prototype,"indeterminate",void 0);function wy(e){return nk(e)&&(e.getAttribute("role")==="option"||e instanceof HTMLOptionElement)}class Mn extends ue{constructor(t,n,r,i){super(),this.defaultSelected=!1,this.dirtySelected=!1,this.selected=this.defaultSelected,this.dirtyValue=!1,t&&(this.textContent=t),n&&(this.initialValue=n),r&&(this.defaultSelected=r),i&&(this.selected=i),this.proxy=new Option(`${this.textContent}`,this.initialValue,this.defaultSelected,this.selected),this.proxy.disabled=this.disabled}checkedChanged(t,n){if(typeof n=="boolean"){this.ariaChecked=n?"true":"false";return}this.ariaChecked=null}contentChanged(t,n){this.proxy instanceof HTMLOptionElement&&(this.proxy.textContent=this.textContent),this.$emit("contentchange",null,{bubbles:!0})}defaultSelectedChanged(){this.dirtySelected||(this.selected=this.defaultSelected,this.proxy instanceof HTMLOptionElement&&(this.proxy.selected=this.defaultSelected))}disabledChanged(t,n){this.ariaDisabled=this.disabled?"true":"false",this.proxy instanceof HTMLOptionElement&&(this.proxy.disabled=this.disabled)}selectedAttributeChanged(){this.defaultSelected=this.selectedAttribute,this.proxy instanceof HTMLOptionElement&&(this.proxy.defaultSelected=this.defaultSelected)}selectedChanged(){this.ariaSelected=this.selected?"true":"false",this.dirtySelected||(this.dirtySelected=!0),this.proxy instanceof HTMLOptionElement&&(this.proxy.selected=this.selected)}initialValueChanged(t,n){this.dirtyValue||(this.value=this.initialValue,this.dirtyValue=!1)}get label(){var t;return(t=this.value)!==null&&t!==void 0?t:this.text}get text(){var t,n;return(n=(t=this.textContent)===null||t===void 0?void 0:t.replace(/\s+/g," ").trim())!==null&&n!==void 0?n:""}set value(t){const n=`${t??""}`;this._value=n,this.dirtyValue=!0,this.proxy instanceof HTMLOptionElement&&(this.proxy.value=n),V.notify(this,"value")}get value(){var t;return V.track(this,"value"),(t=this._value)!==null&&t!==void 0?t:this.text}get form(){return this.proxy?this.proxy.form:null}}b([D],Mn.prototype,"checked",void 0);b([D],Mn.prototype,"content",void 0);b([D],Mn.prototype,"defaultSelected",void 0);b([$({mode:"boolean"})],Mn.prototype,"disabled",void 0);b([$({attribute:"selected",mode:"boolean"})],Mn.prototype,"selectedAttribute",void 0);b([D],Mn.prototype,"selected",void 0);b([$({attribute:"value",mode:"fromView"})],Mn.prototype,"initialValue",void 0);class ji{}b([D],ji.prototype,"ariaChecked",void 0);b([D],ji.prototype,"ariaPosInSet",void 0);b([D],ji.prototype,"ariaSelected",void 0);b([D],ji.prototype,"ariaSetSize",void 0);wt(ji,de);wt(Mn,Li,ji);class lt extends ue{constructor(){super(...arguments),this._options=[],this.selectedIndex=-1,this.selectedOptions=[],this.shouldSkipFocus=!1,this.typeaheadBuffer="",this.typeaheadExpired=!0,this.typeaheadTimeout=-1}get firstSelectedOption(){var t;return(t=this.selectedOptions[0])!==null&&t!==void 0?t:null}get hasSelectableOptions(){return this.options.length>0&&!this.options.every(t=>t.disabled)}get length(){var t,n;return(n=(t=this.options)===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0}get options(){return V.track(this,"options"),this._options}set options(t){this._options=t,V.notify(this,"options")}get typeAheadExpired(){return this.typeaheadExpired}set typeAheadExpired(t){this.typeaheadExpired=t}clickHandler(t){const n=t.target.closest("option,[role=option]");if(n&&!n.disabled)return this.selectedIndex=this.options.indexOf(n),!0}focusAndScrollOptionIntoView(t=this.firstSelectedOption){this.contains(document.activeElement)&&t!==null&&(t.focus(),requestAnimationFrame(()=>{t.scrollIntoView({block:"nearest"})}))}focusinHandler(t){!this.shouldSkipFocus&&t.target===t.currentTarget&&(this.setSelectedOptions(),this.focusAndScrollOptionIntoView()),this.shouldSkipFocus=!1}getTypeaheadMatches(){const t=this.typeaheadBuffer.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&"),n=new RegExp(`^${t}`,"gi");return this.options.filter(r=>r.text.trim().match(n))}getSelectableIndex(t=this.selectedIndex,n){const r=t>n?-1:t!s&&!l.disabled&&a!s&&!l.disabled&&a>i?l:s,o);break}}return this.options.indexOf(o)}handleChange(t,n){switch(n){case"selected":{lt.slottedOptionFilter(t)&&(this.selectedIndex=this.options.indexOf(t)),this.setSelectedOptions();break}}}handleTypeAhead(t){this.typeaheadTimeout&&window.clearTimeout(this.typeaheadTimeout),this.typeaheadTimeout=window.setTimeout(()=>this.typeaheadExpired=!0,lt.TYPE_AHEAD_TIMEOUT_MS),!(t.length>1)&&(this.typeaheadBuffer=`${this.typeaheadExpired?"":this.typeaheadBuffer}${t}`)}keydownHandler(t){if(this.disabled)return!0;this.shouldSkipFocus=!1;const n=t.key;switch(n){case Bi:{t.shiftKey||(t.preventDefault(),this.selectFirstOption());break}case Nr:{t.shiftKey||(t.preventDefault(),this.selectNextOption());break}case Fr:{t.shiftKey||(t.preventDefault(),this.selectPreviousOption());break}case zi:{t.preventDefault(),this.selectLastOption();break}case ff:return this.focusAndScrollOptionIntoView(),!0;case as:case fa:return!0;case cs:if(this.typeaheadExpired)return!0;default:return n.length===1&&this.handleTypeAhead(`${n}`),!0}}mousedownHandler(t){return this.shouldSkipFocus=!this.contains(document.activeElement),!0}multipleChanged(t,n){this.ariaMultiSelectable=n?"true":null}selectedIndexChanged(t,n){var r;if(!this.hasSelectableOptions){this.selectedIndex=-1;return}if(!((r=this.options[this.selectedIndex])===null||r===void 0)&&r.disabled&&typeof t=="number"){const i=this.getSelectableIndex(t,n),o=i>-1?i:t;this.selectedIndex=o,n===o&&this.selectedIndexChanged(n,o);return}this.setSelectedOptions()}selectedOptionsChanged(t,n){var r;const i=n.filter(lt.slottedOptionFilter);(r=this.options)===null||r===void 0||r.forEach(o=>{const s=V.getNotifier(o);s.unsubscribe(this,"selected"),o.selected=i.includes(o),s.subscribe(this,"selected")})}selectFirstOption(){var t,n;this.disabled||(this.selectedIndex=(n=(t=this.options)===null||t===void 0?void 0:t.findIndex(r=>!r.disabled))!==null&&n!==void 0?n:-1)}selectLastOption(){this.disabled||(this.selectedIndex=ek(this.options,t=>!t.disabled))}selectNextOption(){!this.disabled&&this.selectedIndex0&&(this.selectedIndex=this.selectedIndex-1)}setDefaultSelectedOption(){var t,n;this.selectedIndex=(n=(t=this.options)===null||t===void 0?void 0:t.findIndex(r=>r.defaultSelected))!==null&&n!==void 0?n:-1}setSelectedOptions(){var t,n,r;!((t=this.options)===null||t===void 0)&&t.length&&(this.selectedOptions=[this.options[this.selectedIndex]],this.ariaActiveDescendant=(r=(n=this.firstSelectedOption)===null||n===void 0?void 0:n.id)!==null&&r!==void 0?r:"",this.focusAndScrollOptionIntoView())}slottedOptionsChanged(t,n){this.options=n.reduce((i,o)=>(wy(o)&&i.push(o),i),[]);const r=`${this.options.length}`;this.options.forEach((i,o)=>{i.id||(i.id=Hl("option-")),i.ariaPosInSet=`${o+1}`,i.ariaSetSize=r}),this.$fastController.isConnected&&(this.setSelectedOptions(),this.setDefaultSelectedOption())}typeaheadBufferChanged(t,n){if(this.$fastController.isConnected){const r=this.getTypeaheadMatches();if(r.length){const i=this.options.indexOf(r[0]);i>-1&&(this.selectedIndex=i)}this.typeaheadExpired=!1}}}lt.slottedOptionFilter=e=>wy(e)&&!e.hidden;lt.TYPE_AHEAD_TIMEOUT_MS=1e3;b([$({mode:"boolean"})],lt.prototype,"disabled",void 0);b([D],lt.prototype,"selectedIndex",void 0);b([D],lt.prototype,"selectedOptions",void 0);b([D],lt.prototype,"slottedOptions",void 0);b([D],lt.prototype,"typeaheadBuffer",void 0);class Br{}b([D],Br.prototype,"ariaActiveDescendant",void 0);b([D],Br.prototype,"ariaDisabled",void 0);b([D],Br.prototype,"ariaExpanded",void 0);b([D],Br.prototype,"ariaMultiSelectable",void 0);wt(Br,de);wt(lt,Br);const Nc={above:"above",below:"below"};function Xu(e){const t=e.parentElement;if(t)return t;{const n=e.getRootNode();if(n.host instanceof HTMLElement)return n.host}return null}function Ek(e,t){let n=t;for(;n!==null;){if(n===e)return!0;n=Xu(n)}return!1}const En=document.createElement("div");function Rk(e){return e instanceof da}class pf{setProperty(t,n){H.queueUpdate(()=>this.target.setProperty(t,n))}removeProperty(t){H.queueUpdate(()=>this.target.removeProperty(t))}}class Ok extends pf{constructor(t){super();const n=new CSSStyleSheet;n[ey]=!0,this.target=n.cssRules[n.insertRule(":host{}")].style,t.$fastController.addStyles(yt.create([n]))}}class Ik extends pf{constructor(){super();const t=new CSSStyleSheet;this.target=t.cssRules[t.insertRule(":root{}")].style,document.adoptedStyleSheets=[...document.adoptedStyleSheets,t]}}class Pk extends pf{constructor(){super(),this.style=document.createElement("style"),document.head.appendChild(this.style);const{sheet:t}=this.style;if(t){const n=t.insertRule(":root{}",t.cssRules.length);this.target=t.cssRules[n].style}}}class ky{constructor(t){this.store=new Map,this.target=null;const n=t.$fastController;this.style=document.createElement("style"),n.addStyles(this.style),V.getNotifier(n).subscribe(this,"isConnected"),this.handleChange(n,"isConnected")}targetChanged(){if(this.target!==null)for(const[t,n]of this.store.entries())this.target.setProperty(t,n)}setProperty(t,n){this.store.set(t,n),H.queueUpdate(()=>{this.target!==null&&this.target.setProperty(t,n)})}removeProperty(t){this.store.delete(t),H.queueUpdate(()=>{this.target!==null&&this.target.removeProperty(t)})}handleChange(t,n){const{sheet:r}=this.style;if(r){const i=r.insertRule(":host{}",r.cssRules.length);this.target=r.cssRules[i].style}else this.target=null}}b([D],ky.prototype,"target",void 0);class _k{constructor(t){this.target=t.style}setProperty(t,n){H.queueUpdate(()=>this.target.setProperty(t,n))}removeProperty(t){H.queueUpdate(()=>this.target.removeProperty(t))}}class Le{setProperty(t,n){Le.properties[t]=n;for(const r of Le.roots.values())si.getOrCreate(Le.normalizeRoot(r)).setProperty(t,n)}removeProperty(t){delete Le.properties[t];for(const n of Le.roots.values())si.getOrCreate(Le.normalizeRoot(n)).removeProperty(t)}static registerRoot(t){const{roots:n}=Le;if(!n.has(t)){n.add(t);const r=si.getOrCreate(this.normalizeRoot(t));for(const i in Le.properties)r.setProperty(i,Le.properties[i])}}static unregisterRoot(t){const{roots:n}=Le;if(n.has(t)){n.delete(t);const r=si.getOrCreate(Le.normalizeRoot(t));for(const i in Le.properties)r.removeProperty(i)}}static normalizeRoot(t){return t===En?document:t}}Le.roots=new Set;Le.properties={};const Fc=new WeakMap,Ak=H.supportsAdoptedStyleSheets?Ok:ky,si=Object.freeze({getOrCreate(e){if(Fc.has(e))return Fc.get(e);let t;return e===En?t=new Le:e instanceof Document?t=H.supportsAdoptedStyleSheets?new Ik:new Pk:Rk(e)?t=new Ak(e):t=new _k(e),Fc.set(e,t),t}});class ot extends sy{constructor(t){super(),this.subscribers=new WeakMap,this._appliedTo=new Set,this.name=t.name,t.cssCustomPropertyName!==null&&(this.cssCustomProperty=`--${t.cssCustomPropertyName}`,this.cssVar=`var(${this.cssCustomProperty})`),this.id=ot.uniqueId(),ot.tokensById.set(this.id,this)}get appliedTo(){return[...this._appliedTo]}static from(t){return new ot({name:typeof t=="string"?t:t.name,cssCustomPropertyName:typeof t=="string"?t:t.cssCustomPropertyName===void 0?t.name:t.cssCustomPropertyName})}static isCSSDesignToken(t){return typeof t.cssCustomProperty=="string"}static isDerivedDesignTokenValue(t){return typeof t=="function"}static getTokenById(t){return ot.tokensById.get(t)}getOrCreateSubscriberSet(t=this){return this.subscribers.get(t)||this.subscribers.set(t,new Set)&&this.subscribers.get(t)}createCSS(){return this.cssVar||""}getValueFor(t){const n=ke.getOrCreate(t).get(this);if(n!==void 0)return n;throw new Error(`Value could not be retrieved for token named "${this.name}". Ensure the value is set for ${t} or an ancestor of ${t}.`)}setValueFor(t,n){return this._appliedTo.add(t),n instanceof ot&&(n=this.alias(n)),ke.getOrCreate(t).set(this,n),this}deleteValueFor(t){return this._appliedTo.delete(t),ke.existsFor(t)&&ke.getOrCreate(t).delete(this),this}withDefault(t){return this.setValueFor(En,t),this}subscribe(t,n){const r=this.getOrCreateSubscriberSet(n);n&&!ke.existsFor(n)&&ke.getOrCreate(n),r.has(t)||r.add(t)}unsubscribe(t,n){const r=this.subscribers.get(n||this);r&&r.has(t)&&r.delete(t)}notify(t){const n=Object.freeze({token:this,target:t});this.subscribers.has(this)&&this.subscribers.get(this).forEach(r=>r.handleChange(n)),this.subscribers.has(t)&&this.subscribers.get(t).forEach(r=>r.handleChange(n))}alias(t){return n=>t.getValueFor(n)}}ot.uniqueId=(()=>{let e=0;return()=>(e++,e.toString(16))})();ot.tokensById=new Map;class Dk{startReflection(t,n){t.subscribe(this,n),this.handleChange({token:t,target:n})}stopReflection(t,n){t.unsubscribe(this,n),this.remove(t,n)}handleChange(t){const{token:n,target:r}=t;this.add(n,r)}add(t,n){si.getOrCreate(n).setProperty(t.cssCustomProperty,this.resolveCSSValue(ke.getOrCreate(n).get(t)))}remove(t,n){si.getOrCreate(n).removeProperty(t.cssCustomProperty)}resolveCSSValue(t){return t&&typeof t.createCSS=="function"?t.createCSS():t}}class Mk{constructor(t,n,r){this.source=t,this.token=n,this.node=r,this.dependencies=new Set,this.observer=V.binding(t,this,!1),this.observer.handleChange=this.observer.call,this.handleChange()}disconnect(){this.observer.disconnect()}handleChange(){this.node.store.set(this.token,this.observer.observe(this.node.target,$o))}}class Lk{constructor(){this.values=new Map}set(t,n){this.values.get(t)!==n&&(this.values.set(t,n),V.getNotifier(this).notify(t.id))}get(t){return V.track(this,t.id),this.values.get(t)}delete(t){this.values.delete(t)}all(){return this.values.entries()}}const io=new WeakMap,oo=new WeakMap;class ke{constructor(t){this.target=t,this.store=new Lk,this.children=[],this.assignedValues=new Map,this.reflecting=new Set,this.bindingObservers=new Map,this.tokenValueChangeHandler={handleChange:(n,r)=>{const i=ot.getTokenById(r);i&&(i.notify(this.target),this.updateCSSTokenReflection(n,i))}},io.set(t,this),V.getNotifier(this.store).subscribe(this.tokenValueChangeHandler),t instanceof da?t.$fastController.addBehaviors([this]):t.isConnected&&this.bind()}static getOrCreate(t){return io.get(t)||new ke(t)}static existsFor(t){return io.has(t)}static findParent(t){if(En!==t.target){let n=Xu(t.target);for(;n!==null;){if(io.has(n))return io.get(n);n=Xu(n)}return ke.getOrCreate(En)}return null}static findClosestAssignedNode(t,n){let r=n;do{if(r.has(t))return r;r=r.parent?r.parent:r.target!==En?ke.getOrCreate(En):null}while(r!==null);return null}get parent(){return oo.get(this)||null}updateCSSTokenReflection(t,n){if(ot.isCSSDesignToken(n)){const r=this.parent,i=this.isReflecting(n);if(r){const o=r.get(n),s=t.get(n);o!==s&&!i?this.reflectToCSS(n):o===s&&i&&this.stopReflectToCSS(n)}else i||this.reflectToCSS(n)}}has(t){return this.assignedValues.has(t)}get(t){const n=this.store.get(t);if(n!==void 0)return n;const r=this.getRaw(t);if(r!==void 0)return this.hydrate(t,r),this.get(t)}getRaw(t){var n;return this.assignedValues.has(t)?this.assignedValues.get(t):(n=ke.findClosestAssignedNode(t,this))===null||n===void 0?void 0:n.getRaw(t)}set(t,n){ot.isDerivedDesignTokenValue(this.assignedValues.get(t))&&this.tearDownBindingObserver(t),this.assignedValues.set(t,n),ot.isDerivedDesignTokenValue(n)?this.setupBindingObserver(t,n):this.store.set(t,n)}delete(t){this.assignedValues.delete(t),this.tearDownBindingObserver(t);const n=this.getRaw(t);n?this.hydrate(t,n):this.store.delete(t)}bind(){const t=ke.findParent(this);t&&t.appendChild(this);for(const n of this.assignedValues.keys())n.notify(this.target)}unbind(){this.parent&&oo.get(this).removeChild(this)}appendChild(t){t.parent&&oo.get(t).removeChild(t);const n=this.children.filter(r=>t.contains(r));oo.set(t,this),this.children.push(t),n.forEach(r=>t.appendChild(r)),V.getNotifier(this.store).subscribe(t);for(const[r,i]of this.store.all())t.hydrate(r,this.bindingObservers.has(r)?this.getRaw(r):i)}removeChild(t){const n=this.children.indexOf(t);return n!==-1&&this.children.splice(n,1),V.getNotifier(this.store).unsubscribe(t),t.parent===this?oo.delete(t):!1}contains(t){return Ek(this.target,t.target)}reflectToCSS(t){this.isReflecting(t)||(this.reflecting.add(t),ke.cssCustomPropertyReflector.startReflection(t,this.target))}stopReflectToCSS(t){this.isReflecting(t)&&(this.reflecting.delete(t),ke.cssCustomPropertyReflector.stopReflection(t,this.target))}isReflecting(t){return this.reflecting.has(t)}handleChange(t,n){const r=ot.getTokenById(n);r&&(this.hydrate(r,this.getRaw(r)),this.updateCSSTokenReflection(this.store,r))}hydrate(t,n){if(!this.has(t)){const r=this.bindingObservers.get(t);ot.isDerivedDesignTokenValue(n)?r?r.source!==n&&(this.tearDownBindingObserver(t),this.setupBindingObserver(t,n)):this.setupBindingObserver(t,n):(r&&this.tearDownBindingObserver(t),this.store.set(t,n))}}setupBindingObserver(t,n){const r=new Mk(n,t,this);return this.bindingObservers.set(t,r),r}tearDownBindingObserver(t){return this.bindingObservers.has(t)?(this.bindingObservers.get(t).disconnect(),this.bindingObservers.delete(t),!0):!1}}ke.cssCustomPropertyReflector=new Dk;b([D],ke.prototype,"children",void 0);function Nk(e){return ot.from(e)}const Cy=Object.freeze({create:Nk,notifyConnection(e){return!e.isConnected||!ke.existsFor(e)?!1:(ke.getOrCreate(e).bind(),!0)},notifyDisconnection(e){return e.isConnected||!ke.existsFor(e)?!1:(ke.getOrCreate(e).unbind(),!0)},registerRoot(e=En){Le.registerRoot(e)},unregisterRoot(e=En){Le.unregisterRoot(e)}}),Bc=Object.freeze({definitionCallbackOnly:null,ignoreDuplicate:Symbol()}),zc=new Map,al=new Map;let pi=null;const so=he.createInterface(e=>e.cachedCallback(t=>(pi===null&&(pi=new $y(null,t)),pi))),Sy=Object.freeze({tagFor(e){return al.get(e)},responsibleFor(e){const t=e.$$designSystem$$;return t||he.findResponsibleContainer(e).get(so)},getOrCreate(e){if(!e)return pi===null&&(pi=he.getOrCreateDOMContainer().get(so)),pi;const t=e.$$designSystem$$;if(t)return t;const n=he.getOrCreateDOMContainer(e);if(n.has(so,!1))return n.get(so);{const r=new $y(e,n);return n.register(Qo.instance(so,r)),r}}});function Fk(e,t,n){return typeof e=="string"?{name:e,type:t,callback:n}:e}class $y{constructor(t,n){this.owner=t,this.container=n,this.designTokensInitialized=!1,this.prefix="fast",this.shadowRootMode=void 0,this.disambiguate=()=>Bc.definitionCallbackOnly,t!==null&&(t.$$designSystem$$=this)}withPrefix(t){return this.prefix=t,this}withShadowRootMode(t){return this.shadowRootMode=t,this}withElementDisambiguation(t){return this.disambiguate=t,this}withDesignTokenRoot(t){return this.designTokenRoot=t,this}register(...t){const n=this.container,r=[],i=this.disambiguate,o=this.shadowRootMode,s={elementPrefix:this.prefix,tryDefineElement(l,a,c){const u=Fk(l,a,c),{name:d,callback:f,baseClass:y}=u;let{type:v}=u,g=d,E=zc.get(g),p=!0;for(;E;){const h=i(g,v,E);switch(h){case Bc.ignoreDuplicate:return;case Bc.definitionCallbackOnly:p=!1,E=void 0;break;default:g=h,E=zc.get(g);break}}p&&((al.has(v)||v===ue)&&(v=class extends v{}),zc.set(g,v),al.set(v,g),y&&al.set(y,g)),r.push(new Bk(n,g,v,o,f,p))}};this.designTokensInitialized||(this.designTokensInitialized=!0,this.designTokenRoot!==null&&Cy.registerRoot(this.designTokenRoot)),n.registerWithContext(s,...t);for(const l of r)l.callback(l),l.willDefine&&l.definition!==null&&l.definition.define();return this}}class Bk{constructor(t,n,r,i,o,s){this.container=t,this.name=n,this.type=r,this.shadowRootMode=i,this.callback=o,this.willDefine=s,this.definition=null}definePresentation(t){vy.define(this.name,t,this.container)}defineElement(t){this.definition=new ls(this.type,Object.assign(Object.assign({},t),{name:this.name}))}tagFor(t){return Sy.tagFor(t)}}const zk=(e,t)=>Y` `,jk={separator:"separator",presentation:"presentation"};let mf=class extends ue{constructor(){super(...arguments),this.role=jk.separator,this.orientation=df.horizontal}};b([$],mf.prototype,"role",void 0);b([$],mf.prototype,"orientation",void 0);const Vk=(e,t)=>Y` -`;class pa extends lt{constructor(){super(...arguments),this.activeIndex=-1,this.rangeStartIndex=-1}get activeOption(){return this.options[this.activeIndex]}get checkedOptions(){var t;return(t=this.options)===null||t===void 0?void 0:t.filter(n=>n.checked)}get firstSelectedOptionIndex(){return this.options.indexOf(this.firstSelectedOption)}activeIndexChanged(t,n){var r,i;this.ariaActiveDescendant=(i=(r=this.options[n])===null||r===void 0?void 0:r.id)!==null&&i!==void 0?i:"",this.focusAndScrollOptionIntoView()}checkActiveIndex(){if(!this.multiple)return;const t=this.activeOption;t&&(t.checked=!0)}checkFirstOption(t=!1){t?(this.rangeStartIndex===-1&&(this.rangeStartIndex=this.activeIndex+1),this.options.forEach((n,r)=>{n.checked=zs(r,this.rangeStartIndex)})):this.uncheckAllOptions(),this.activeIndex=0,this.checkActiveIndex()}checkLastOption(t=!1){t?(this.rangeStartIndex===-1&&(this.rangeStartIndex=this.activeIndex),this.options.forEach((n,r)=>{n.checked=zs(r,this.rangeStartIndex,this.options.length)})):this.uncheckAllOptions(),this.activeIndex=this.options.length-1,this.checkActiveIndex()}connectedCallback(){super.connectedCallback(),this.addEventListener("focusout",this.focusoutHandler)}disconnectedCallback(){this.removeEventListener("focusout",this.focusoutHandler),super.disconnectedCallback()}checkNextOption(t=!1){t?(this.rangeStartIndex===-1&&(this.rangeStartIndex=this.activeIndex),this.options.forEach((n,r)=>{n.checked=zs(r,this.rangeStartIndex,this.activeIndex+1)})):this.uncheckAllOptions(),this.activeIndex+=this.activeIndex{n.checked=zs(r,this.activeIndex,this.rangeStartIndex)})):this.uncheckAllOptions(),this.activeIndex-=this.activeIndex>0?1:0,this.checkActiveIndex()}clickHandler(t){var n;if(!this.multiple)return super.clickHandler(t);const r=(n=t.target)===null||n===void 0?void 0:n.closest("[role=option]");if(!(!r||r.disabled))return this.uncheckAllOptions(),this.activeIndex=this.options.indexOf(r),this.checkActiveIndex(),this.toggleSelectedForAllCheckedOptions(),!0}focusAndScrollOptionIntoView(){super.focusAndScrollOptionIntoView(this.activeOption)}focusinHandler(t){if(!this.multiple)return super.focusinHandler(t);!this.shouldSkipFocus&&t.target===t.currentTarget&&(this.uncheckAllOptions(),this.activeIndex===-1&&(this.activeIndex=this.firstSelectedOptionIndex!==-1?this.firstSelectedOptionIndex:0),this.checkActiveIndex(),this.setSelectedOptions(),this.focusAndScrollOptionIntoView()),this.shouldSkipFocus=!1}focusoutHandler(t){this.multiple&&this.uncheckAllOptions()}keydownHandler(t){if(!this.multiple)return super.keydownHandler(t);if(this.disabled)return!0;const{key:n,shiftKey:r}=t;switch(this.shouldSkipFocus=!1,n){case Fi:{this.checkFirstOption(r);return}case Nr:{this.checkNextOption(r);return}case Fr:{this.checkPreviousOption(r);return}case Bi:{this.checkLastOption(r);return}case ff:return this.focusAndScrollOptionIntoView(),!0;case da:return this.uncheckAllOptions(),this.checkActiveIndex(),!0;case as:if(t.preventDefault(),this.typeAheadExpired){this.toggleSelectedForAllCheckedOptions();return}default:return n.length===1&&this.handleTypeAhead(`${n}`),!0}}mousedownHandler(t){if(t.offsetX>=0&&t.offsetX<=this.scrollWidth)return super.mousedownHandler(t)}multipleChanged(t,n){var r;this.ariaMultiSelectable=n?"true":null,(r=this.options)===null||r===void 0||r.forEach(i=>{i.checked=n?!1:void 0}),this.setSelectedOptions()}setSelectedOptions(){if(!this.multiple){super.setSelectedOptions();return}this.$fastController.isConnected&&this.options&&(this.selectedOptions=this.options.filter(t=>t.selected),this.focusAndScrollOptionIntoView())}sizeChanged(t,n){var r;const i=Math.max(0,parseInt((r=n==null?void 0:n.toFixed())!==null&&r!==void 0?r:"",10));i!==n&&H.queueUpdate(()=>{this.size=i})}toggleSelectedForAllCheckedOptions(){const t=this.checkedOptions.filter(r=>!r.disabled),n=!t.every(r=>r.selected);t.forEach(r=>r.selected=n),this.selectedIndex=this.options.indexOf(t[t.length-1]),this.setSelectedOptions()}typeaheadBufferChanged(t,n){if(!this.multiple){super.typeaheadBufferChanged(t,n);return}if(this.$fastController.isConnected){const r=this.getTypeaheadMatches(),i=this.options.indexOf(r[0]);i>-1&&(this.activeIndex=i,this.uncheckAllOptions(),this.checkActiveIndex()),this.typeAheadExpired=!1}}uncheckAllOptions(t=!1){this.options.forEach(n=>n.checked=this.multiple?!1:void 0),t||(this.rangeStartIndex=-1)}}b([D],pa.prototype,"activeIndex",void 0);b([$({mode:"boolean"})],pa.prototype,"multiple",void 0);b([$({converter:ln})],pa.prototype,"size",void 0);class Hk extends ue{}class Uk extends us(Hk){constructor(){super(...arguments),this.proxy=document.createElement("input")}}const Wk={email:"email",password:"password",tel:"tel",text:"text",url:"url"};let It=class extends Uk{constructor(){super(...arguments),this.type=Wk.text}readOnlyChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.readOnly=this.readOnly,this.validate())}autofocusChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.autofocus=this.autofocus,this.validate())}placeholderChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.placeholder=this.placeholder)}typeChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.type=this.type,this.validate())}listChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.setAttribute("list",this.list),this.validate())}maxlengthChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.maxLength=this.maxlength,this.validate())}minlengthChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.minLength=this.minlength,this.validate())}patternChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.pattern=this.pattern,this.validate())}sizeChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.size=this.size)}spellcheckChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.spellcheck=this.spellcheck)}connectedCallback(){super.connectedCallback(),this.proxy.setAttribute("type",this.type),this.validate(),this.autofocus&&H.queueUpdate(()=>{this.focus()})}select(){this.control.select(),this.$emit("select")}handleTextInput(){this.value=this.control.value}handleChange(){this.$emit("change")}validate(){super.validate(this.control)}};b([$({attribute:"readonly",mode:"boolean"})],It.prototype,"readOnly",void 0);b([$({mode:"boolean"})],It.prototype,"autofocus",void 0);b([$],It.prototype,"placeholder",void 0);b([$],It.prototype,"type",void 0);b([$],It.prototype,"list",void 0);b([$({converter:ln})],It.prototype,"maxlength",void 0);b([$({converter:ln})],It.prototype,"minlength",void 0);b([$],It.prototype,"pattern",void 0);b([$({converter:ln})],It.prototype,"size",void 0);b([$({mode:"boolean"})],It.prototype,"spellcheck",void 0);b([D],It.prototype,"defaultSlottedNodes",void 0);class gf{}wt(gf,de);wt(It,Mi,gf);const Op=44,Gk=(e,t)=>Y` +`;class ma extends lt{constructor(){super(...arguments),this.activeIndex=-1,this.rangeStartIndex=-1}get activeOption(){return this.options[this.activeIndex]}get checkedOptions(){var t;return(t=this.options)===null||t===void 0?void 0:t.filter(n=>n.checked)}get firstSelectedOptionIndex(){return this.options.indexOf(this.firstSelectedOption)}activeIndexChanged(t,n){var r,i;this.ariaActiveDescendant=(i=(r=this.options[n])===null||r===void 0?void 0:r.id)!==null&&i!==void 0?i:"",this.focusAndScrollOptionIntoView()}checkActiveIndex(){if(!this.multiple)return;const t=this.activeOption;t&&(t.checked=!0)}checkFirstOption(t=!1){t?(this.rangeStartIndex===-1&&(this.rangeStartIndex=this.activeIndex+1),this.options.forEach((n,r)=>{n.checked=js(r,this.rangeStartIndex)})):this.uncheckAllOptions(),this.activeIndex=0,this.checkActiveIndex()}checkLastOption(t=!1){t?(this.rangeStartIndex===-1&&(this.rangeStartIndex=this.activeIndex),this.options.forEach((n,r)=>{n.checked=js(r,this.rangeStartIndex,this.options.length)})):this.uncheckAllOptions(),this.activeIndex=this.options.length-1,this.checkActiveIndex()}connectedCallback(){super.connectedCallback(),this.addEventListener("focusout",this.focusoutHandler)}disconnectedCallback(){this.removeEventListener("focusout",this.focusoutHandler),super.disconnectedCallback()}checkNextOption(t=!1){t?(this.rangeStartIndex===-1&&(this.rangeStartIndex=this.activeIndex),this.options.forEach((n,r)=>{n.checked=js(r,this.rangeStartIndex,this.activeIndex+1)})):this.uncheckAllOptions(),this.activeIndex+=this.activeIndex{n.checked=js(r,this.activeIndex,this.rangeStartIndex)})):this.uncheckAllOptions(),this.activeIndex-=this.activeIndex>0?1:0,this.checkActiveIndex()}clickHandler(t){var n;if(!this.multiple)return super.clickHandler(t);const r=(n=t.target)===null||n===void 0?void 0:n.closest("[role=option]");if(!(!r||r.disabled))return this.uncheckAllOptions(),this.activeIndex=this.options.indexOf(r),this.checkActiveIndex(),this.toggleSelectedForAllCheckedOptions(),!0}focusAndScrollOptionIntoView(){super.focusAndScrollOptionIntoView(this.activeOption)}focusinHandler(t){if(!this.multiple)return super.focusinHandler(t);!this.shouldSkipFocus&&t.target===t.currentTarget&&(this.uncheckAllOptions(),this.activeIndex===-1&&(this.activeIndex=this.firstSelectedOptionIndex!==-1?this.firstSelectedOptionIndex:0),this.checkActiveIndex(),this.setSelectedOptions(),this.focusAndScrollOptionIntoView()),this.shouldSkipFocus=!1}focusoutHandler(t){this.multiple&&this.uncheckAllOptions()}keydownHandler(t){if(!this.multiple)return super.keydownHandler(t);if(this.disabled)return!0;const{key:n,shiftKey:r}=t;switch(this.shouldSkipFocus=!1,n){case Bi:{this.checkFirstOption(r);return}case Nr:{this.checkNextOption(r);return}case Fr:{this.checkPreviousOption(r);return}case zi:{this.checkLastOption(r);return}case ff:return this.focusAndScrollOptionIntoView(),!0;case fa:return this.uncheckAllOptions(),this.checkActiveIndex(),!0;case cs:if(t.preventDefault(),this.typeAheadExpired){this.toggleSelectedForAllCheckedOptions();return}default:return n.length===1&&this.handleTypeAhead(`${n}`),!0}}mousedownHandler(t){if(t.offsetX>=0&&t.offsetX<=this.scrollWidth)return super.mousedownHandler(t)}multipleChanged(t,n){var r;this.ariaMultiSelectable=n?"true":null,(r=this.options)===null||r===void 0||r.forEach(i=>{i.checked=n?!1:void 0}),this.setSelectedOptions()}setSelectedOptions(){if(!this.multiple){super.setSelectedOptions();return}this.$fastController.isConnected&&this.options&&(this.selectedOptions=this.options.filter(t=>t.selected),this.focusAndScrollOptionIntoView())}sizeChanged(t,n){var r;const i=Math.max(0,parseInt((r=n==null?void 0:n.toFixed())!==null&&r!==void 0?r:"",10));i!==n&&H.queueUpdate(()=>{this.size=i})}toggleSelectedForAllCheckedOptions(){const t=this.checkedOptions.filter(r=>!r.disabled),n=!t.every(r=>r.selected);t.forEach(r=>r.selected=n),this.selectedIndex=this.options.indexOf(t[t.length-1]),this.setSelectedOptions()}typeaheadBufferChanged(t,n){if(!this.multiple){super.typeaheadBufferChanged(t,n);return}if(this.$fastController.isConnected){const r=this.getTypeaheadMatches(),i=this.options.indexOf(r[0]);i>-1&&(this.activeIndex=i,this.uncheckAllOptions(),this.checkActiveIndex()),this.typeAheadExpired=!1}}uncheckAllOptions(t=!1){this.options.forEach(n=>n.checked=this.multiple?!1:void 0),t||(this.rangeStartIndex=-1)}}b([D],ma.prototype,"activeIndex",void 0);b([$({mode:"boolean"})],ma.prototype,"multiple",void 0);b([$({converter:ln})],ma.prototype,"size",void 0);class Hk extends ue{}class Uk extends ds(Hk){constructor(){super(...arguments),this.proxy=document.createElement("input")}}const Wk={email:"email",password:"password",tel:"tel",text:"text",url:"url"};let Pt=class extends Uk{constructor(){super(...arguments),this.type=Wk.text}readOnlyChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.readOnly=this.readOnly,this.validate())}autofocusChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.autofocus=this.autofocus,this.validate())}placeholderChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.placeholder=this.placeholder)}typeChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.type=this.type,this.validate())}listChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.setAttribute("list",this.list),this.validate())}maxlengthChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.maxLength=this.maxlength,this.validate())}minlengthChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.minLength=this.minlength,this.validate())}patternChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.pattern=this.pattern,this.validate())}sizeChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.size=this.size)}spellcheckChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.spellcheck=this.spellcheck)}connectedCallback(){super.connectedCallback(),this.proxy.setAttribute("type",this.type),this.validate(),this.autofocus&&H.queueUpdate(()=>{this.focus()})}select(){this.control.select(),this.$emit("select")}handleTextInput(){this.value=this.control.value}handleChange(){this.$emit("change")}validate(){super.validate(this.control)}};b([$({attribute:"readonly",mode:"boolean"})],Pt.prototype,"readOnly",void 0);b([$({mode:"boolean"})],Pt.prototype,"autofocus",void 0);b([$],Pt.prototype,"placeholder",void 0);b([$],Pt.prototype,"type",void 0);b([$],Pt.prototype,"list",void 0);b([$({converter:ln})],Pt.prototype,"maxlength",void 0);b([$({converter:ln})],Pt.prototype,"minlength",void 0);b([$],Pt.prototype,"pattern",void 0);b([$({converter:ln})],Pt.prototype,"size",void 0);b([$({mode:"boolean"})],Pt.prototype,"spellcheck",void 0);b([D],Pt.prototype,"defaultSlottedNodes",void 0);class gf{}wt(gf,de);wt(Pt,Li,gf);const Op=44,Gk=(e,t)=>Y` -`;class ji extends ue{constructor(){super(...arguments),this.percentComplete=0}valueChanged(){this.$fastController.isConnected&&this.updatePercentComplete()}minChanged(){this.$fastController.isConnected&&this.updatePercentComplete()}maxChanged(){this.$fastController.isConnected&&this.updatePercentComplete()}connectedCallback(){super.connectedCallback(),this.updatePercentComplete()}updatePercentComplete(){const t=typeof this.min=="number"?this.min:0,n=typeof this.max=="number"?this.max:100,r=typeof this.value=="number"?this.value:0,i=n-t;this.percentComplete=i===0?0:Math.fround((r-t)/i*100)}}b([$({converter:ln})],ji.prototype,"value",void 0);b([$({converter:ln})],ji.prototype,"min",void 0);b([$({converter:ln})],ji.prototype,"max",void 0);b([$({mode:"boolean"})],ji.prototype,"paused",void 0);b([D],ji.prototype,"percentComplete",void 0);const qk=(e,t)=>Y` +`;class Vi extends ue{constructor(){super(...arguments),this.percentComplete=0}valueChanged(){this.$fastController.isConnected&&this.updatePercentComplete()}minChanged(){this.$fastController.isConnected&&this.updatePercentComplete()}maxChanged(){this.$fastController.isConnected&&this.updatePercentComplete()}connectedCallback(){super.connectedCallback(),this.updatePercentComplete()}updatePercentComplete(){const t=typeof this.min=="number"?this.min:0,n=typeof this.max=="number"?this.max:100,r=typeof this.value=="number"?this.value:0,i=n-t;this.percentComplete=i===0?0:Math.fround((r-t)/i*100)}}b([$({converter:ln})],Vi.prototype,"value",void 0);b([$({converter:ln})],Vi.prototype,"min",void 0);b([$({converter:ln})],Vi.prototype,"max",void 0);b([$({mode:"boolean"})],Vi.prototype,"paused",void 0);b([D],Vi.prototype,"percentComplete",void 0);const qk=(e,t)=>Y` -`;let mr=class extends ue{constructor(){super(...arguments),this.orientation=df.horizontal,this.radioChangeHandler=t=>{const n=t.target;n.checked&&(this.slottedRadioButtons.forEach(r=>{r!==n&&(r.checked=!1,this.isInsideFoundationToolbar||r.setAttribute("tabindex","-1"))}),this.selectedRadio=n,this.value=n.value,n.setAttribute("tabindex","0"),this.focusedRadio=n),t.stopPropagation()},this.moveToRadioByIndex=(t,n)=>{const r=t[n];this.isInsideToolbar||(r.setAttribute("tabindex","0"),r.readOnly?this.slottedRadioButtons.forEach(i=>{i!==r&&i.setAttribute("tabindex","-1")}):(r.checked=!0,this.selectedRadio=r)),this.focusedRadio=r,r.focus()},this.moveRightOffGroup=()=>{var t;(t=this.nextElementSibling)===null||t===void 0||t.focus()},this.moveLeftOffGroup=()=>{var t;(t=this.previousElementSibling)===null||t===void 0||t.focus()},this.focusOutHandler=t=>{const n=this.slottedRadioButtons,r=t.target,i=r!==null?n.indexOf(r):0,o=this.focusedRadio?n.indexOf(this.focusedRadio):-1;return(o===0&&i===o||o===n.length-1&&o===i)&&(this.selectedRadio?(this.focusedRadio=this.selectedRadio,this.isInsideFoundationToolbar||(this.selectedRadio.setAttribute("tabindex","0"),n.forEach(s=>{s!==this.selectedRadio&&s.setAttribute("tabindex","-1")}))):(this.focusedRadio=n[0],this.focusedRadio.setAttribute("tabindex","0"),n.forEach(s=>{s!==this.focusedRadio&&s.setAttribute("tabindex","-1")}))),!0},this.clickHandler=t=>{const n=t.target;if(n){const r=this.slottedRadioButtons;n.checked||r.indexOf(n)===0?(n.setAttribute("tabindex","0"),this.selectedRadio=n):(n.setAttribute("tabindex","-1"),this.selectedRadio=null),this.focusedRadio=n}t.preventDefault()},this.shouldMoveOffGroupToTheRight=(t,n,r)=>t===n.length&&this.isInsideToolbar&&r===Xo,this.shouldMoveOffGroupToTheLeft=(t,n)=>(this.focusedRadio?t.indexOf(this.focusedRadio)-1:0)<0&&this.isInsideToolbar&&n===Qo,this.checkFocusedRadio=()=>{this.focusedRadio!==null&&!this.focusedRadio.readOnly&&!this.focusedRadio.checked&&(this.focusedRadio.checked=!0,this.focusedRadio.setAttribute("tabindex","0"),this.focusedRadio.focus(),this.selectedRadio=this.focusedRadio)},this.moveRight=t=>{const n=this.slottedRadioButtons;let r=0;if(r=this.focusedRadio?n.indexOf(this.focusedRadio)+1:1,this.shouldMoveOffGroupToTheRight(r,n,t.key)){this.moveRightOffGroup();return}else r===n.length&&(r=0);for(;r1;)if(n[r].disabled){if(this.focusedRadio&&r===n.indexOf(this.focusedRadio))break;if(r+1>=n.length){if(this.isInsideToolbar)break;r=0}else r+=1}else{this.moveToRadioByIndex(n,r);break}},this.moveLeft=t=>{const n=this.slottedRadioButtons;let r=0;if(r=this.focusedRadio?n.indexOf(this.focusedRadio)-1:0,r=r<0?n.length-1:r,this.shouldMoveOffGroupToTheLeft(n,t.key)){this.moveLeftOffGroup();return}for(;r>=0&&n.length>1;)if(n[r].disabled){if(this.focusedRadio&&r===n.indexOf(this.focusedRadio))break;r-1<0?r=n.length-1:r-=1}else{this.moveToRadioByIndex(n,r);break}},this.keydownHandler=t=>{const n=t.key;if(n in ak&&this.isInsideFoundationToolbar)return!0;switch(n){case ls:{this.checkFocusedRadio();break}case Xo:case Nr:{this.direction===Ri.ltr?this.moveRight(t):this.moveLeft(t);break}case Qo:case Fr:{this.direction===Ri.ltr?this.moveLeft(t):this.moveRight(t);break}default:return!0}}}readOnlyChanged(){this.slottedRadioButtons!==void 0&&this.slottedRadioButtons.forEach(t=>{this.readOnly?t.readOnly=!0:t.readOnly=!1})}disabledChanged(){this.slottedRadioButtons!==void 0&&this.slottedRadioButtons.forEach(t=>{this.disabled?t.disabled=!0:t.disabled=!1})}nameChanged(){this.slottedRadioButtons&&this.slottedRadioButtons.forEach(t=>{t.setAttribute("name",this.name)})}valueChanged(){this.slottedRadioButtons&&this.slottedRadioButtons.forEach(t=>{t.value===this.value&&(t.checked=!0,this.selectedRadio=t)}),this.$emit("change")}slottedRadioButtonsChanged(t,n){this.slottedRadioButtons&&this.slottedRadioButtons.length>0&&this.setupRadioButtons()}get parentToolbar(){return this.closest('[role="toolbar"]')}get isInsideToolbar(){var t;return(t=this.parentToolbar)!==null&&t!==void 0?t:!1}get isInsideFoundationToolbar(){var t;return!!(!((t=this.parentToolbar)===null||t===void 0)&&t.$fastController)}connectedCallback(){super.connectedCallback(),this.direction=fk(this),this.setupRadioButtons()}disconnectedCallback(){this.slottedRadioButtons.forEach(t=>{t.removeEventListener("change",this.radioChangeHandler)})}setupRadioButtons(){const t=this.slottedRadioButtons.filter(i=>i.hasAttribute("checked")),n=t?t.length:0;if(n>1){const i=t[n-1];i.checked=!0}let r=!1;if(this.slottedRadioButtons.forEach(i=>{this.name!==void 0&&i.setAttribute("name",this.name),this.disabled&&(i.disabled=!0),this.readOnly&&(i.readOnly=!0),this.value&&this.value===i.value?(this.selectedRadio=i,this.focusedRadio=i,i.checked=!0,i.setAttribute("tabindex","0"),r=!0):(this.isInsideFoundationToolbar||i.setAttribute("tabindex","-1"),i.checked=!1),i.addEventListener("change",this.radioChangeHandler)}),this.value===void 0&&this.slottedRadioButtons.length>0){const i=this.slottedRadioButtons.filter(s=>s.hasAttribute("checked")),o=i!==null?i.length:0;if(o>0&&!r){const s=i[o-1];s.checked=!0,this.focusedRadio=s,s.setAttribute("tabindex","0")}else this.slottedRadioButtons[0].setAttribute("tabindex","0"),this.focusedRadio=this.slottedRadioButtons[0]}}};b([$({attribute:"readonly",mode:"boolean"})],mr.prototype,"readOnly",void 0);b([$({attribute:"disabled",mode:"boolean"})],mr.prototype,"disabled",void 0);b([$],mr.prototype,"name",void 0);b([$],mr.prototype,"value",void 0);b([$],mr.prototype,"orientation",void 0);b([D],mr.prototype,"childItems",void 0);b([D],mr.prototype,"slottedRadioButtons",void 0);const Qk=(e,t)=>Y` +`;let mr=class extends ue{constructor(){super(...arguments),this.orientation=df.horizontal,this.radioChangeHandler=t=>{const n=t.target;n.checked&&(this.slottedRadioButtons.forEach(r=>{r!==n&&(r.checked=!1,this.isInsideFoundationToolbar||r.setAttribute("tabindex","-1"))}),this.selectedRadio=n,this.value=n.value,n.setAttribute("tabindex","0"),this.focusedRadio=n),t.stopPropagation()},this.moveToRadioByIndex=(t,n)=>{const r=t[n];this.isInsideToolbar||(r.setAttribute("tabindex","0"),r.readOnly?this.slottedRadioButtons.forEach(i=>{i!==r&&i.setAttribute("tabindex","-1")}):(r.checked=!0,this.selectedRadio=r)),this.focusedRadio=r,r.focus()},this.moveRightOffGroup=()=>{var t;(t=this.nextElementSibling)===null||t===void 0||t.focus()},this.moveLeftOffGroup=()=>{var t;(t=this.previousElementSibling)===null||t===void 0||t.focus()},this.focusOutHandler=t=>{const n=this.slottedRadioButtons,r=t.target,i=r!==null?n.indexOf(r):0,o=this.focusedRadio?n.indexOf(this.focusedRadio):-1;return(o===0&&i===o||o===n.length-1&&o===i)&&(this.selectedRadio?(this.focusedRadio=this.selectedRadio,this.isInsideFoundationToolbar||(this.selectedRadio.setAttribute("tabindex","0"),n.forEach(s=>{s!==this.selectedRadio&&s.setAttribute("tabindex","-1")}))):(this.focusedRadio=n[0],this.focusedRadio.setAttribute("tabindex","0"),n.forEach(s=>{s!==this.focusedRadio&&s.setAttribute("tabindex","-1")}))),!0},this.clickHandler=t=>{const n=t.target;if(n){const r=this.slottedRadioButtons;n.checked||r.indexOf(n)===0?(n.setAttribute("tabindex","0"),this.selectedRadio=n):(n.setAttribute("tabindex","-1"),this.selectedRadio=null),this.focusedRadio=n}t.preventDefault()},this.shouldMoveOffGroupToTheRight=(t,n,r)=>t===n.length&&this.isInsideToolbar&&r===Yo,this.shouldMoveOffGroupToTheLeft=(t,n)=>(this.focusedRadio?t.indexOf(this.focusedRadio)-1:0)<0&&this.isInsideToolbar&&n===Xo,this.checkFocusedRadio=()=>{this.focusedRadio!==null&&!this.focusedRadio.readOnly&&!this.focusedRadio.checked&&(this.focusedRadio.checked=!0,this.focusedRadio.setAttribute("tabindex","0"),this.focusedRadio.focus(),this.selectedRadio=this.focusedRadio)},this.moveRight=t=>{const n=this.slottedRadioButtons;let r=0;if(r=this.focusedRadio?n.indexOf(this.focusedRadio)+1:1,this.shouldMoveOffGroupToTheRight(r,n,t.key)){this.moveRightOffGroup();return}else r===n.length&&(r=0);for(;r1;)if(n[r].disabled){if(this.focusedRadio&&r===n.indexOf(this.focusedRadio))break;if(r+1>=n.length){if(this.isInsideToolbar)break;r=0}else r+=1}else{this.moveToRadioByIndex(n,r);break}},this.moveLeft=t=>{const n=this.slottedRadioButtons;let r=0;if(r=this.focusedRadio?n.indexOf(this.focusedRadio)-1:0,r=r<0?n.length-1:r,this.shouldMoveOffGroupToTheLeft(n,t.key)){this.moveLeftOffGroup();return}for(;r>=0&&n.length>1;)if(n[r].disabled){if(this.focusedRadio&&r===n.indexOf(this.focusedRadio))break;r-1<0?r=n.length-1:r-=1}else{this.moveToRadioByIndex(n,r);break}},this.keydownHandler=t=>{const n=t.key;if(n in ak&&this.isInsideFoundationToolbar)return!0;switch(n){case as:{this.checkFocusedRadio();break}case Yo:case Nr:{this.direction===Oi.ltr?this.moveRight(t):this.moveLeft(t);break}case Xo:case Fr:{this.direction===Oi.ltr?this.moveLeft(t):this.moveRight(t);break}default:return!0}}}readOnlyChanged(){this.slottedRadioButtons!==void 0&&this.slottedRadioButtons.forEach(t=>{this.readOnly?t.readOnly=!0:t.readOnly=!1})}disabledChanged(){this.slottedRadioButtons!==void 0&&this.slottedRadioButtons.forEach(t=>{this.disabled?t.disabled=!0:t.disabled=!1})}nameChanged(){this.slottedRadioButtons&&this.slottedRadioButtons.forEach(t=>{t.setAttribute("name",this.name)})}valueChanged(){this.slottedRadioButtons&&this.slottedRadioButtons.forEach(t=>{t.value===this.value&&(t.checked=!0,this.selectedRadio=t)}),this.$emit("change")}slottedRadioButtonsChanged(t,n){this.slottedRadioButtons&&this.slottedRadioButtons.length>0&&this.setupRadioButtons()}get parentToolbar(){return this.closest('[role="toolbar"]')}get isInsideToolbar(){var t;return(t=this.parentToolbar)!==null&&t!==void 0?t:!1}get isInsideFoundationToolbar(){var t;return!!(!((t=this.parentToolbar)===null||t===void 0)&&t.$fastController)}connectedCallback(){super.connectedCallback(),this.direction=fk(this),this.setupRadioButtons()}disconnectedCallback(){this.slottedRadioButtons.forEach(t=>{t.removeEventListener("change",this.radioChangeHandler)})}setupRadioButtons(){const t=this.slottedRadioButtons.filter(i=>i.hasAttribute("checked")),n=t?t.length:0;if(n>1){const i=t[n-1];i.checked=!0}let r=!1;if(this.slottedRadioButtons.forEach(i=>{this.name!==void 0&&i.setAttribute("name",this.name),this.disabled&&(i.disabled=!0),this.readOnly&&(i.readOnly=!0),this.value&&this.value===i.value?(this.selectedRadio=i,this.focusedRadio=i,i.checked=!0,i.setAttribute("tabindex","0"),r=!0):(this.isInsideFoundationToolbar||i.setAttribute("tabindex","-1"),i.checked=!1),i.addEventListener("change",this.radioChangeHandler)}),this.value===void 0&&this.slottedRadioButtons.length>0){const i=this.slottedRadioButtons.filter(s=>s.hasAttribute("checked")),o=i!==null?i.length:0;if(o>0&&!r){const s=i[o-1];s.checked=!0,this.focusedRadio=s,s.setAttribute("tabindex","0")}else this.slottedRadioButtons[0].setAttribute("tabindex","0"),this.focusedRadio=this.slottedRadioButtons[0]}}};b([$({attribute:"readonly",mode:"boolean"})],mr.prototype,"readOnly",void 0);b([$({attribute:"disabled",mode:"boolean"})],mr.prototype,"disabled",void 0);b([$],mr.prototype,"name",void 0);b([$],mr.prototype,"value",void 0);b([$],mr.prototype,"orientation",void 0);b([D],mr.prototype,"childItems",void 0);b([D],mr.prototype,"slottedRadioButtons",void 0);const Qk=(e,t)=>Y` -`;class Xk extends ue{}class Yk extends xy(Xk){constructor(){super(...arguments),this.proxy=document.createElement("input")}}let ma=class extends Yk{constructor(){super(),this.initialValue="on",this.keypressHandler=t=>{switch(t.key){case as:!this.checked&&!this.readOnly&&(this.checked=!0);return}return!0},this.proxy.setAttribute("type","radio")}readOnlyChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.readOnly=this.readOnly)}defaultCheckedChanged(){var t;this.$fastController.isConnected&&!this.dirtyChecked&&(this.isInsideRadioGroup()||(this.checked=(t=this.defaultChecked)!==null&&t!==void 0?t:!1,this.dirtyChecked=!1))}connectedCallback(){var t,n;super.connectedCallback(),this.validate(),((t=this.parentElement)===null||t===void 0?void 0:t.getAttribute("role"))!=="radiogroup"&&this.getAttribute("tabindex")===null&&(this.disabled||this.setAttribute("tabindex","0")),this.checkedAttribute&&(this.dirtyChecked||this.isInsideRadioGroup()||(this.checked=(n=this.defaultChecked)!==null&&n!==void 0?n:!1,this.dirtyChecked=!1))}isInsideRadioGroup(){return this.closest("[role=radiogroup]")!==null}clickHandler(t){!this.disabled&&!this.readOnly&&!this.checked&&(this.checked=!0)}};b([$({attribute:"readonly",mode:"boolean"})],ma.prototype,"readOnly",void 0);b([D],ma.prototype,"name",void 0);b([D],ma.prototype,"defaultSlottedNodes",void 0);function Jk(e,t,n){return e.nodeType!==Node.TEXT_NODE?!0:typeof e.nodeValue=="string"&&!!e.nodeValue.trim().length}class Zk extends pa{}class Kk extends us(Zk){constructor(){super(...arguments),this.proxy=document.createElement("select")}}class gr extends Kk{constructor(){super(...arguments),this.open=!1,this.forcedPosition=!1,this.listboxId=Hl("listbox-"),this.maxHeight=0}openChanged(t,n){if(this.collapsible){if(this.open){this.ariaControls=this.listboxId,this.ariaExpanded="true",this.setPositioning(),this.focusAndScrollOptionIntoView(),this.indexWhenOpened=this.selectedIndex,H.queueUpdate(()=>this.focus());return}this.ariaControls="",this.ariaExpanded="false"}}get collapsible(){return!(this.multiple||typeof this.size=="number")}get value(){return V.track(this,"value"),this._value}set value(t){var n,r,i,o,s,l,a;const c=`${this._value}`;if(!((n=this._options)===null||n===void 0)&&n.length){const u=this._options.findIndex(y=>y.value===t),d=(i=(r=this._options[this.selectedIndex])===null||r===void 0?void 0:r.value)!==null&&i!==void 0?i:null,f=(s=(o=this._options[u])===null||o===void 0?void 0:o.value)!==null&&s!==void 0?s:null;(u===-1||d!==f)&&(t="",this.selectedIndex=u),t=(a=(l=this.firstSelectedOption)===null||l===void 0?void 0:l.value)!==null&&a!==void 0?a:t}c!==t&&(this._value=t,super.valueChanged(c,t),V.notify(this,"value"),this.updateDisplayValue())}updateValue(t){var n,r;this.$fastController.isConnected&&(this.value=(r=(n=this.firstSelectedOption)===null||n===void 0?void 0:n.value)!==null&&r!==void 0?r:""),t&&(this.$emit("input"),this.$emit("change",this,{bubbles:!0,composed:void 0}))}selectedIndexChanged(t,n){super.selectedIndexChanged(t,n),this.updateValue()}positionChanged(t,n){this.positionAttribute=n,this.setPositioning()}setPositioning(){const t=this.getBoundingClientRect(),r=window.innerHeight-t.bottom;this.position=this.forcedPosition?this.positionAttribute:t.top>r?Lc.above:Lc.below,this.positionAttribute=this.forcedPosition?this.positionAttribute:this.position,this.maxHeight=this.position===Lc.above?~~t.top:~~r}get displayValue(){var t,n;return V.track(this,"displayValue"),(n=(t=this.firstSelectedOption)===null||t===void 0?void 0:t.text)!==null&&n!==void 0?n:""}disabledChanged(t,n){super.disabledChanged&&super.disabledChanged(t,n),this.ariaDisabled=this.disabled?"true":"false"}formResetCallback(){this.setProxyOptions(),super.setDefaultSelectedOption(),this.selectedIndex===-1&&(this.selectedIndex=0)}clickHandler(t){if(!this.disabled){if(this.open){const n=t.target.closest("option,[role=option]");if(n&&n.disabled)return}return super.clickHandler(t),this.open=this.collapsible&&!this.open,!this.open&&this.indexWhenOpened!==this.selectedIndex&&this.updateValue(!0),!0}}focusoutHandler(t){var n;if(super.focusoutHandler(t),!this.open)return!0;const r=t.relatedTarget;if(this.isSameNode(r)){this.focus();return}!((n=this.options)===null||n===void 0)&&n.includes(r)||(this.open=!1,this.indexWhenOpened!==this.selectedIndex&&this.updateValue(!0))}handleChange(t,n){super.handleChange(t,n),n==="value"&&this.updateValue()}slottedOptionsChanged(t,n){this.options.forEach(r=>{V.getNotifier(r).unsubscribe(this,"value")}),super.slottedOptionsChanged(t,n),this.options.forEach(r=>{V.getNotifier(r).subscribe(this,"value")}),this.setProxyOptions(),this.updateValue()}mousedownHandler(t){var n;return t.offsetX>=0&&t.offsetX<=((n=this.listbox)===null||n===void 0?void 0:n.scrollWidth)?super.mousedownHandler(t):this.collapsible}multipleChanged(t,n){super.multipleChanged(t,n),this.proxy&&(this.proxy.multiple=n)}selectedOptionsChanged(t,n){var r;super.selectedOptionsChanged(t,n),(r=this.options)===null||r===void 0||r.forEach((i,o)=>{var s;const l=(s=this.proxy)===null||s===void 0?void 0:s.options.item(o);l&&(l.selected=i.selected)})}setDefaultSelectedOption(){var t;const n=(t=this.options)!==null&&t!==void 0?t:Array.from(this.children).filter(lt.slottedOptionFilter),r=n==null?void 0:n.findIndex(i=>i.hasAttribute("selected")||i.selected||i.value===this.value);if(r!==-1){this.selectedIndex=r;return}this.selectedIndex=0}setProxyOptions(){this.proxy instanceof HTMLSelectElement&&this.options&&(this.proxy.options.length=0,this.options.forEach(t=>{const n=t.proxy||(t instanceof HTMLOptionElement?t.cloneNode():null);n&&this.proxy.options.add(n)}))}keydownHandler(t){super.keydownHandler(t);const n=t.key||t.key.charCodeAt(0);switch(n){case as:{t.preventDefault(),this.collapsible&&this.typeAheadExpired&&(this.open=!this.open);break}case Fi:case Bi:{t.preventDefault();break}case ls:{t.preventDefault(),this.open=!this.open;break}case da:{this.collapsible&&this.open&&(t.preventDefault(),this.open=!1);break}case ff:return this.collapsible&&this.open&&(t.preventDefault(),this.open=!1),!0}return!this.open&&this.indexWhenOpened!==this.selectedIndex&&(this.updateValue(!0),this.indexWhenOpened=this.selectedIndex),!(n===Nr||n===Fr)}connectedCallback(){super.connectedCallback(),this.forcedPosition=!!this.positionAttribute,this.addEventListener("contentchange",this.updateDisplayValue)}disconnectedCallback(){this.removeEventListener("contentchange",this.updateDisplayValue),super.disconnectedCallback()}sizeChanged(t,n){super.sizeChanged(t,n),this.proxy&&(this.proxy.size=n)}updateDisplayValue(){this.collapsible&&V.notify(this,"displayValue")}}b([$({attribute:"open",mode:"boolean"})],gr.prototype,"open",void 0);b([nw],gr.prototype,"collapsible",null);b([D],gr.prototype,"control",void 0);b([$({attribute:"position"})],gr.prototype,"positionAttribute",void 0);b([D],gr.prototype,"position",void 0);b([D],gr.prototype,"maxHeight",void 0);class vf{}b([D],vf.prototype,"ariaControls",void 0);wt(vf,Br);wt(gr,Mi,vf);const eC=(e,t)=>Y` +`;class Xk extends ue{}class Yk extends xy(Xk){constructor(){super(...arguments),this.proxy=document.createElement("input")}}let ga=class extends Yk{constructor(){super(),this.initialValue="on",this.keypressHandler=t=>{switch(t.key){case cs:!this.checked&&!this.readOnly&&(this.checked=!0);return}return!0},this.proxy.setAttribute("type","radio")}readOnlyChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.readOnly=this.readOnly)}defaultCheckedChanged(){var t;this.$fastController.isConnected&&!this.dirtyChecked&&(this.isInsideRadioGroup()||(this.checked=(t=this.defaultChecked)!==null&&t!==void 0?t:!1,this.dirtyChecked=!1))}connectedCallback(){var t,n;super.connectedCallback(),this.validate(),((t=this.parentElement)===null||t===void 0?void 0:t.getAttribute("role"))!=="radiogroup"&&this.getAttribute("tabindex")===null&&(this.disabled||this.setAttribute("tabindex","0")),this.checkedAttribute&&(this.dirtyChecked||this.isInsideRadioGroup()||(this.checked=(n=this.defaultChecked)!==null&&n!==void 0?n:!1,this.dirtyChecked=!1))}isInsideRadioGroup(){return this.closest("[role=radiogroup]")!==null}clickHandler(t){!this.disabled&&!this.readOnly&&!this.checked&&(this.checked=!0)}};b([$({attribute:"readonly",mode:"boolean"})],ga.prototype,"readOnly",void 0);b([D],ga.prototype,"name",void 0);b([D],ga.prototype,"defaultSlottedNodes",void 0);function Jk(e,t,n){return e.nodeType!==Node.TEXT_NODE?!0:typeof e.nodeValue=="string"&&!!e.nodeValue.trim().length}class Zk extends ma{}class Kk extends ds(Zk){constructor(){super(...arguments),this.proxy=document.createElement("select")}}class gr extends Kk{constructor(){super(...arguments),this.open=!1,this.forcedPosition=!1,this.listboxId=Hl("listbox-"),this.maxHeight=0}openChanged(t,n){if(this.collapsible){if(this.open){this.ariaControls=this.listboxId,this.ariaExpanded="true",this.setPositioning(),this.focusAndScrollOptionIntoView(),this.indexWhenOpened=this.selectedIndex,H.queueUpdate(()=>this.focus());return}this.ariaControls="",this.ariaExpanded="false"}}get collapsible(){return!(this.multiple||typeof this.size=="number")}get value(){return V.track(this,"value"),this._value}set value(t){var n,r,i,o,s,l,a;const c=`${this._value}`;if(!((n=this._options)===null||n===void 0)&&n.length){const u=this._options.findIndex(y=>y.value===t),d=(i=(r=this._options[this.selectedIndex])===null||r===void 0?void 0:r.value)!==null&&i!==void 0?i:null,f=(s=(o=this._options[u])===null||o===void 0?void 0:o.value)!==null&&s!==void 0?s:null;(u===-1||d!==f)&&(t="",this.selectedIndex=u),t=(a=(l=this.firstSelectedOption)===null||l===void 0?void 0:l.value)!==null&&a!==void 0?a:t}c!==t&&(this._value=t,super.valueChanged(c,t),V.notify(this,"value"),this.updateDisplayValue())}updateValue(t){var n,r;this.$fastController.isConnected&&(this.value=(r=(n=this.firstSelectedOption)===null||n===void 0?void 0:n.value)!==null&&r!==void 0?r:""),t&&(this.$emit("input"),this.$emit("change",this,{bubbles:!0,composed:void 0}))}selectedIndexChanged(t,n){super.selectedIndexChanged(t,n),this.updateValue()}positionChanged(t,n){this.positionAttribute=n,this.setPositioning()}setPositioning(){const t=this.getBoundingClientRect(),r=window.innerHeight-t.bottom;this.position=this.forcedPosition?this.positionAttribute:t.top>r?Nc.above:Nc.below,this.positionAttribute=this.forcedPosition?this.positionAttribute:this.position,this.maxHeight=this.position===Nc.above?~~t.top:~~r}get displayValue(){var t,n;return V.track(this,"displayValue"),(n=(t=this.firstSelectedOption)===null||t===void 0?void 0:t.text)!==null&&n!==void 0?n:""}disabledChanged(t,n){super.disabledChanged&&super.disabledChanged(t,n),this.ariaDisabled=this.disabled?"true":"false"}formResetCallback(){this.setProxyOptions(),super.setDefaultSelectedOption(),this.selectedIndex===-1&&(this.selectedIndex=0)}clickHandler(t){if(!this.disabled){if(this.open){const n=t.target.closest("option,[role=option]");if(n&&n.disabled)return}return super.clickHandler(t),this.open=this.collapsible&&!this.open,!this.open&&this.indexWhenOpened!==this.selectedIndex&&this.updateValue(!0),!0}}focusoutHandler(t){var n;if(super.focusoutHandler(t),!this.open)return!0;const r=t.relatedTarget;if(this.isSameNode(r)){this.focus();return}!((n=this.options)===null||n===void 0)&&n.includes(r)||(this.open=!1,this.indexWhenOpened!==this.selectedIndex&&this.updateValue(!0))}handleChange(t,n){super.handleChange(t,n),n==="value"&&this.updateValue()}slottedOptionsChanged(t,n){this.options.forEach(r=>{V.getNotifier(r).unsubscribe(this,"value")}),super.slottedOptionsChanged(t,n),this.options.forEach(r=>{V.getNotifier(r).subscribe(this,"value")}),this.setProxyOptions(),this.updateValue()}mousedownHandler(t){var n;return t.offsetX>=0&&t.offsetX<=((n=this.listbox)===null||n===void 0?void 0:n.scrollWidth)?super.mousedownHandler(t):this.collapsible}multipleChanged(t,n){super.multipleChanged(t,n),this.proxy&&(this.proxy.multiple=n)}selectedOptionsChanged(t,n){var r;super.selectedOptionsChanged(t,n),(r=this.options)===null||r===void 0||r.forEach((i,o)=>{var s;const l=(s=this.proxy)===null||s===void 0?void 0:s.options.item(o);l&&(l.selected=i.selected)})}setDefaultSelectedOption(){var t;const n=(t=this.options)!==null&&t!==void 0?t:Array.from(this.children).filter(lt.slottedOptionFilter),r=n==null?void 0:n.findIndex(i=>i.hasAttribute("selected")||i.selected||i.value===this.value);if(r!==-1){this.selectedIndex=r;return}this.selectedIndex=0}setProxyOptions(){this.proxy instanceof HTMLSelectElement&&this.options&&(this.proxy.options.length=0,this.options.forEach(t=>{const n=t.proxy||(t instanceof HTMLOptionElement?t.cloneNode():null);n&&this.proxy.options.add(n)}))}keydownHandler(t){super.keydownHandler(t);const n=t.key||t.key.charCodeAt(0);switch(n){case cs:{t.preventDefault(),this.collapsible&&this.typeAheadExpired&&(this.open=!this.open);break}case Bi:case zi:{t.preventDefault();break}case as:{t.preventDefault(),this.open=!this.open;break}case fa:{this.collapsible&&this.open&&(t.preventDefault(),this.open=!1);break}case ff:return this.collapsible&&this.open&&(t.preventDefault(),this.open=!1),!0}return!this.open&&this.indexWhenOpened!==this.selectedIndex&&(this.updateValue(!0),this.indexWhenOpened=this.selectedIndex),!(n===Nr||n===Fr)}connectedCallback(){super.connectedCallback(),this.forcedPosition=!!this.positionAttribute,this.addEventListener("contentchange",this.updateDisplayValue)}disconnectedCallback(){this.removeEventListener("contentchange",this.updateDisplayValue),super.disconnectedCallback()}sizeChanged(t,n){super.sizeChanged(t,n),this.proxy&&(this.proxy.size=n)}updateDisplayValue(){this.collapsible&&V.notify(this,"displayValue")}}b([$({attribute:"open",mode:"boolean"})],gr.prototype,"open",void 0);b([nw],gr.prototype,"collapsible",null);b([D],gr.prototype,"control",void 0);b([$({attribute:"position"})],gr.prototype,"positionAttribute",void 0);b([D],gr.prototype,"position",void 0);b([D],gr.prototype,"maxHeight",void 0);class vf{}b([D],vf.prototype,"ariaControls",void 0);wt(vf,Br);wt(gr,Li,vf);const eC=(e,t)=>Y`