petdex 0.3.9 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/petdex.js +95 -95
- package/package.json +2 -2
package/dist/petdex.js
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as pY}from"node:module";var kY=Object.create;var{getPrototypeOf:gY,defineProperty:v8,getOwnPropertyNames:DY}=Object;var hY=Object.prototype.hasOwnProperty;function _Y($){return this[$]}var bY,fY,C1=($,Q,q)=>{var
|
|
2
|
+
import{createRequire as pY}from"node:module";var kY=Object.create;var{getPrototypeOf:gY,defineProperty:v8,getOwnPropertyNames:DY}=Object;var hY=Object.prototype.hasOwnProperty;function _Y($){return this[$]}var bY,fY,C1=($,Q,q)=>{var J=$!=null&&typeof $==="object";if(J){var Y=Q?bY??=new WeakMap:fY??=new WeakMap,X=Y.get($);if(X)return X}q=$!=null?kY(gY($)):{};let V=Q||!$||!$.__esModule?v8(q,"default",{value:$,enumerable:!0}):q;for(let G of DY($))if(!hY.call(V,G))v8(V,G,{get:_Y.bind($,G),enumerable:!0});if(J)Y.set($,V);return V};var T=($,Q)=>()=>(Q||$((Q={exports:{}}).exports,Q),Q.exports);var mY=($)=>$;function cY($,Q){this[$]=mY.bind(null,Q)}var x8=($,Q)=>{for(var q in Q)v8($,q,{get:Q[q],enumerable:!0,configurable:!0,set:cY.bind(Q,q)})};var q0=($,Q)=>()=>($&&(Q=$($=0)),Q);var b=pY(import.meta.url);var E8=T((ZH,Uq)=>{var S8={to($,Q){if(!Q)return`\x1B[${$+1}G`;return`\x1B[${Q+1};${$+1}H`},move($,Q){let q="";if($<0)q+=`\x1B[${-$}D`;else if($>0)q+=`\x1B[${$}C`;if(Q<0)q+=`\x1B[${-Q}A`;else if(Q>0)q+=`\x1B[${Q}B`;return q},up:($=1)=>`\x1B[${$}A`,down:($=1)=>`\x1B[${$}B`,forward:($=1)=>`\x1B[${$}C`,backward:($=1)=>`\x1B[${$}D`,nextLine:($=1)=>"\x1B[E".repeat($),prevLine:($=1)=>"\x1B[F".repeat($),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},uY={up:($=1)=>"\x1B[S".repeat($),down:($=1)=>"\x1B[T".repeat($)},dY={screen:"\x1B[2J",up:($=1)=>"\x1B[1J".repeat($),down:($=1)=>"\x1B[J".repeat($),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines($){let Q="";for(let q=0;q<$;q++)Q+=this.line+(q<$-1?S8.up():"");if($)Q+=S8.left;return Q}};Uq.exports={cursor:S8,scroll:uY,erase:dY,beep:"\x07"}});var o1=T((zH,y8)=>{var j6=process||{},jq=j6.argv||[],U6=j6.env||{},lY=!(!!U6.NO_COLOR||jq.includes("--no-color"))&&(!!U6.FORCE_COLOR||jq.includes("--color")||j6.platform==="win32"||(j6.stdout||{}).isTTY&&U6.TERM!=="dumb"||!!U6.CI),oY=($,Q,q=$)=>(J)=>{let Y=""+J,X=Y.indexOf(Q,$.length);return~X?$+iY(Y,Q,q,X)+Q:$+Y+Q},iY=($,Q,q,J)=>{let Y="",X=0;do Y+=$.substring(X,J)+q,X=J+Q.length,J=$.indexOf(Q,X);while(~J);return Y+$.substring(X)},Zq=($=lY)=>{let Q=$?oY:()=>String;return{isColorSupported:$,reset:Q("\x1B[0m","\x1B[0m"),bold:Q("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:Q("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:Q("\x1B[3m","\x1B[23m"),underline:Q("\x1B[4m","\x1B[24m"),inverse:Q("\x1B[7m","\x1B[27m"),hidden:Q("\x1B[8m","\x1B[28m"),strikethrough:Q("\x1B[9m","\x1B[29m"),black:Q("\x1B[30m","\x1B[39m"),red:Q("\x1B[31m","\x1B[39m"),green:Q("\x1B[32m","\x1B[39m"),yellow:Q("\x1B[33m","\x1B[39m"),blue:Q("\x1B[34m","\x1B[39m"),magenta:Q("\x1B[35m","\x1B[39m"),cyan:Q("\x1B[36m","\x1B[39m"),white:Q("\x1B[37m","\x1B[39m"),gray:Q("\x1B[90m","\x1B[39m"),bgBlack:Q("\x1B[40m","\x1B[49m"),bgRed:Q("\x1B[41m","\x1B[49m"),bgGreen:Q("\x1B[42m","\x1B[49m"),bgYellow:Q("\x1B[43m","\x1B[49m"),bgBlue:Q("\x1B[44m","\x1B[49m"),bgMagenta:Q("\x1B[45m","\x1B[49m"),bgCyan:Q("\x1B[46m","\x1B[49m"),bgWhite:Q("\x1B[47m","\x1B[49m"),blackBright:Q("\x1B[90m","\x1B[39m"),redBright:Q("\x1B[91m","\x1B[39m"),greenBright:Q("\x1B[92m","\x1B[39m"),yellowBright:Q("\x1B[93m","\x1B[39m"),blueBright:Q("\x1B[94m","\x1B[39m"),magentaBright:Q("\x1B[95m","\x1B[39m"),cyanBright:Q("\x1B[96m","\x1B[39m"),whiteBright:Q("\x1B[97m","\x1B[39m"),bgBlackBright:Q("\x1B[100m","\x1B[49m"),bgRedBright:Q("\x1B[101m","\x1B[49m"),bgGreenBright:Q("\x1B[102m","\x1B[49m"),bgYellowBright:Q("\x1B[103m","\x1B[49m"),bgBlueBright:Q("\x1B[104m","\x1B[49m"),bgMagentaBright:Q("\x1B[105m","\x1B[49m"),bgCyanBright:Q("\x1B[106m","\x1B[49m"),bgWhiteBright:Q("\x1B[107m","\x1B[49m")}};y8.exports=Zq();y8.exports.createColors=Zq});import{stdin as Cq,stdout as wq}from"node:process";import*as J0 from"node:readline";import zq from"node:readline";import{Writable as nY}from"node:stream";function rY({onlyFirst:$=!1}={}){let Q=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(Q,$?void 0:"g")}function Tq($){if(typeof $!="string")throw TypeError(`Expected a \`string\`, got \`${typeof $}\``);return $.replace(aY,"")}function Aq($){return $&&$.__esModule&&Object.prototype.hasOwnProperty.call($,"default")?$.default:$}function Z$($,Q={}){if(typeof $!="string"||$.length===0||(Q={ambiguousIsNarrow:!0,...Q},$=Tq($),$.length===0))return 0;$=$.replace($4()," ");let q=Q.ambiguousIsNarrow?1:2,J=0;for(let Y of $){let X=Y.codePointAt(0);if(X<=31||X>=127&&X<=159||X>=768&&X<=879)continue;switch(tY.eastAsianWidth(Y)){case"F":case"W":J+=2;break;case"A":J+=q;break;default:J+=1}}return J}function J4(){let $=new Map;for(let[Q,q]of Object.entries(m)){for(let[J,Y]of Object.entries(q))m[J]={open:`\x1B[${Y[0]}m`,close:`\x1B[${Y[1]}m`},q[J]=m[J],$.set(Y[0],Y[1]);Object.defineProperty(m,Q,{value:q,enumerable:!1})}return Object.defineProperty(m,"codes",{value:$,enumerable:!1}),m.color.close="\x1B[39m",m.bgColor.close="\x1B[49m",m.color.ansi=Hq(),m.color.ansi256=Lq(),m.color.ansi16m=Pq(),m.bgColor.ansi=Hq(k8),m.bgColor.ansi256=Lq(k8),m.bgColor.ansi16m=Pq(k8),Object.defineProperties(m,{rgbToAnsi256:{value:(Q,q,J)=>Q===q&&q===J?Q<8?16:Q>248?231:Math.round((Q-8)/247*24)+232:16+36*Math.round(Q/255*5)+6*Math.round(q/255*5)+Math.round(J/255*5),enumerable:!1},hexToRgb:{value:(Q)=>{let q=/[a-f\d]{6}|[a-f\d]{3}/i.exec(Q.toString(16));if(!q)return[0,0,0];let[J]=q;J.length===3&&(J=[...J].map((X)=>X+X).join(""));let Y=Number.parseInt(J,16);return[Y>>16&255,Y>>8&255,Y&255]},enumerable:!1},hexToAnsi256:{value:(Q)=>m.rgbToAnsi256(...m.hexToRgb(Q)),enumerable:!1},ansi256ToAnsi:{value:(Q)=>{if(Q<8)return 30+Q;if(Q<16)return 90+(Q-8);let q,J,Y;if(Q>=232)q=((Q-232)*10+8)/255,J=q,Y=q;else{Q-=16;let G=Q%36;q=Math.floor(Q/36)/5,J=Math.floor(G/6)/5,Y=G%6/5}let X=Math.max(q,J,Y)*2;if(X===0)return 30;let V=30+(Math.round(Y)<<2|Math.round(J)<<1|Math.round(q));return X===2&&(V+=60),V},enumerable:!1},rgbToAnsi:{value:(Q,q,J)=>m.ansi256ToAnsi(m.rgbToAnsi256(Q,q,J)),enumerable:!1},hexToAnsi:{value:(Q)=>m.ansi256ToAnsi(m.hexToAnsi256(Q)),enumerable:!1}}),m}function Bq($,Q,q){return String($).normalize().replace(/\r\n/g,`
|
|
3
3
|
`).split(`
|
|
4
|
-
`).map((
|
|
4
|
+
`).map((J)=>W4(J,Q,q)).join(`
|
|
5
5
|
`)}function b8($,Q){if(typeof $=="string")return z6.aliases.get($)===Q;for(let q of $)if(q!==void 0&&b8(q,Q))return!0;return!1}function j4($,Q){if($===Q)return;let q=$.split(`
|
|
6
|
-
`),
|
|
7
|
-
`),Y=[];for(let X=0;X<Math.max(q.length,
|
|
6
|
+
`),J=Q.split(`
|
|
7
|
+
`),Y=[];for(let X=0;X<Math.max(q.length,J.length);X++)q[X]!==J[X]&&Y.push(X);return Y}function V0($){return $===D8}function Z6($,Q){let q=$;q.isTTY&&q.setRawMode(Q)}function xq({input:$=Cq,output:Q=wq,overwrite:q=!0,hideCursor:J=!0}={}){let Y=J0.createInterface({input:$,output:Q,prompt:"",tabSize:1});J0.emitKeypressEvents($,Y),$.isTTY&&$.setRawMode(!0);let X=(V,{name:G,sequence:U})=>{let K=String(V);if(b8([K,G,U],"cancel")){J&&Q.write($1.cursor.show),process.exit(0);return}if(!q)return;J0.moveCursor(Q,G==="return"?0:-1,G==="return"?-1:0,()=>{J0.clearLine(Q,1,()=>{$.once("keypress",X)})})};return J&&Q.write($1.cursor.hide),$.once("keypress",X),()=>{$.off("keypress",X),J&&Q.write($1.cursor.show),$.isTTY&&!Z4&&$.setRawMode(!1),Y.terminal=!1,Y.close()}}class L6{constructor($,Q=!0){U1(this,"input"),U1(this,"output"),U1(this,"_abortSignal"),U1(this,"rl"),U1(this,"opts"),U1(this,"_render"),U1(this,"_track",!1),U1(this,"_prevFrame",""),U1(this,"_subscribers",new Map),U1(this,"_cursor",0),U1(this,"state","initial"),U1(this,"error",""),U1(this,"value");let{input:q=Cq,output:J=wq,render:Y,signal:X,...V}=$;this.opts=V,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=Y.bind(this),this._track=Q,this._abortSignal=X,this.input=q,this.output=J}unsubscribe(){this._subscribers.clear()}setSubscriber($,Q){let q=this._subscribers.get($)??[];q.push(Q),this._subscribers.set($,q)}on($,Q){this.setSubscriber($,{cb:Q})}once($,Q){this.setSubscriber($,{cb:Q,once:!0})}emit($,...Q){let q=this._subscribers.get($)??[],J=[];for(let Y of q)Y.cb(...Q),Y.once&&J.push(()=>q.splice(q.indexOf(Y),1));for(let Y of J)Y()}prompt(){return new Promise(($,Q)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),$(D8);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let q=new nY;q._write=(J,Y,X)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),X()},this.input.pipe(q),this.rl=zq.createInterface({input:this.input,output:q,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),zq.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),Z6(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write($1.cursor.show),this.output.off("resize",this.render),Z6(this.input,!1),$(this.value)}),this.once("cancel",()=>{this.output.write($1.cursor.show),this.output.off("resize",this.render),Z6(this.input,!1),$(D8)})})}onKeypress($,Q){if(this.state==="error"&&(this.state="active"),Q?.name&&(!this._track&&z6.aliases.has(Q.name)&&this.emit("cursor",z6.aliases.get(Q.name)),z6.actions.has(Q.name)&&this.emit("cursor",Q.name)),$&&($.toLowerCase()==="y"||$.toLowerCase()==="n")&&this.emit("confirm",$.toLowerCase()==="y"),$==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),$&&this.emit("key",$.toLowerCase()),Q?.name==="return"){if(this.opts.validate){let q=this.opts.validate(this.value);q&&(this.error=q instanceof Error?q.message:q,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}b8([$,Q?.name,Q?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
8
8
|
`),Z6(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let $=Bq(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
9
|
-
`).length-1;this.output.write($1.cursor.move(-999,$*-1))}render(){let $=Bq(this._render(this)??"",process.stdout.columns,{hard:!0});if($!==this._prevFrame){if(this.state==="initial")this.output.write($1.cursor.hide);else{let Q=j4(this._prevFrame,$);if(this.restoreCursor(),Q&&Q?.length===1){let q=Q[0];this.output.write($1.cursor.move(0,q)),this.output.write($1.erase.lines(1));let
|
|
10
|
-
`);this.output.write(
|
|
11
|
-
`).slice(q);this.output.write(
|
|
12
|
-
`)),this._prevFrame=$;return}this.output.write($1.erase.down())}this.output.write($),this.state==="initial"&&(this.state="active"),this._prevFrame=$}}}var $1,aY,Fq,sY,tY,eY=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},$4,k8=10,Hq=($=0)=>(Q)=>`\x1B[${Q+$}m`,Lq=($=0)=>(Q)=>`\x1B[${38+$};5;${Q}m`,Pq=($=0)=>(Q,q,V)=>`\x1B[${38+$};2;${Q};${q};${V}m`,m,Q4,q4,J4,H6,Y4=39,h8="\x07",Rq="[",X4="]",vq="m",_8,Oq=($)=>`${H6.values().next().value}${Rq}${$}${vq}`,Mq=($)=>`${H6.values().next().value}${_8}${$}${h8}`,G4=($)=>$.split(" ").map((Q)=>j$(Q)),g8=($,Q,q)=>{let V=[...Q],Y=!1,X=!1,J=j$(Tq($[$.length-1]));for(let[G,U]of V.entries()){let K=j$(U);if(J+K<=q?$[$.length-1]+=U:($.push(U),J=0),H6.has(U)&&(Y=!0,X=V.slice(G+1).join("").startsWith(_8)),Y){X?U===h8&&(Y=!1,X=!1):U===vq&&(Y=!1);continue}J+=K,J===q&&G<V.length-1&&($.push(""),J=0)}!J&&$[$.length-1].length>0&&$.length>1&&($[$.length-2]+=$.pop())},K4=($)=>{let Q=$.split(" "),q=Q.length;for(;q>0&&!(j$(Q[q-1])>0);)q--;return q===Q.length?$:Q.slice(0,q).join(" ")+Q.slice(q).join("")},W4=($,Q,q={})=>{if(q.trim!==!1&&$.trim()==="")return"";let V="",Y,X,J=G4($),G=[""];for(let[K,W]of $.split(" ").entries()){q.trim!==!1&&(G[G.length-1]=G[G.length-1].trimStart());let Z=j$(G[G.length-1]);if(K!==0&&(Z>=Q&&(q.wordWrap===!1||q.trim===!1)&&(G.push(""),Z=0),(Z>0||q.trim===!1)&&(G[G.length-1]+=" ",Z++)),q.hard&&J[K]>Q){let z=Q-Z,H=1+Math.floor((J[K]-z-1)/Q);Math.floor((J[K]-1)/Q)<H&&G.push(""),g8(G,W,Q);continue}if(Z+J[K]>Q&&Z>0&&J[K]>0){if(q.wordWrap===!1&&Z<Q){g8(G,W,Q);continue}G.push("")}if(Z+J[K]>Q&&q.wordWrap===!1){g8(G,W,Q);continue}G[G.length-1]+=W}q.trim!==!1&&(G=G.map((K)=>K4(K)));let U=[...G.join(`
|
|
13
|
-
`)];for(let[K,W]of U.entries()){if(
|
|
14
|
-
`?(X&&(
|
|
15
|
-
`&&(Y&&
|
|
9
|
+
`).length-1;this.output.write($1.cursor.move(-999,$*-1))}render(){let $=Bq(this._render(this)??"",process.stdout.columns,{hard:!0});if($!==this._prevFrame){if(this.state==="initial")this.output.write($1.cursor.hide);else{let Q=j4(this._prevFrame,$);if(this.restoreCursor(),Q&&Q?.length===1){let q=Q[0];this.output.write($1.cursor.move(0,q)),this.output.write($1.erase.lines(1));let J=$.split(`
|
|
10
|
+
`);this.output.write(J[q]),this._prevFrame=$,this.output.write($1.cursor.move(0,J.length-q-1));return}if(Q&&Q?.length>1){let q=Q[0];this.output.write($1.cursor.move(0,q)),this.output.write($1.erase.down());let J=$.split(`
|
|
11
|
+
`).slice(q);this.output.write(J.join(`
|
|
12
|
+
`)),this._prevFrame=$;return}this.output.write($1.erase.down())}this.output.write($),this.state==="initial"&&(this.state="active"),this._prevFrame=$}}}var $1,aY,Fq,sY,tY,eY=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},$4,k8=10,Hq=($=0)=>(Q)=>`\x1B[${Q+$}m`,Lq=($=0)=>(Q)=>`\x1B[${38+$};5;${Q}m`,Pq=($=0)=>(Q,q,J)=>`\x1B[${38+$};2;${Q};${q};${J}m`,m,Q4,q4,V4,H6,Y4=39,h8="\x07",Rq="[",X4="]",vq="m",_8,Oq=($)=>`${H6.values().next().value}${Rq}${$}${vq}`,Mq=($)=>`${H6.values().next().value}${_8}${$}${h8}`,G4=($)=>$.split(" ").map((Q)=>Z$(Q)),g8=($,Q,q)=>{let J=[...Q],Y=!1,X=!1,V=Z$(Tq($[$.length-1]));for(let[G,U]of J.entries()){let K=Z$(U);if(V+K<=q?$[$.length-1]+=U:($.push(U),V=0),H6.has(U)&&(Y=!0,X=J.slice(G+1).join("").startsWith(_8)),Y){X?U===h8&&(Y=!1,X=!1):U===vq&&(Y=!1);continue}V+=K,V===q&&G<J.length-1&&($.push(""),V=0)}!V&&$[$.length-1].length>0&&$.length>1&&($[$.length-2]+=$.pop())},K4=($)=>{let Q=$.split(" "),q=Q.length;for(;q>0&&!(Z$(Q[q-1])>0);)q--;return q===Q.length?$:Q.slice(0,q).join(" ")+Q.slice(q).join("")},W4=($,Q,q={})=>{if(q.trim!==!1&&$.trim()==="")return"";let J="",Y,X,V=G4($),G=[""];for(let[K,W]of $.split(" ").entries()){q.trim!==!1&&(G[G.length-1]=G[G.length-1].trimStart());let z=Z$(G[G.length-1]);if(K!==0&&(z>=Q&&(q.wordWrap===!1||q.trim===!1)&&(G.push(""),z=0),(z>0||q.trim===!1)&&(G[G.length-1]+=" ",z++)),q.hard&&V[K]>Q){let Z=Q-z,H=1+Math.floor((V[K]-Z-1)/Q);Math.floor((V[K]-1)/Q)<H&&G.push(""),g8(G,W,Q);continue}if(z+V[K]>Q&&z>0&&V[K]>0){if(q.wordWrap===!1&&z<Q){g8(G,W,Q);continue}G.push("")}if(z+V[K]>Q&&q.wordWrap===!1){g8(G,W,Q);continue}G[G.length-1]+=W}q.trim!==!1&&(G=G.map((K)=>K4(K)));let U=[...G.join(`
|
|
13
|
+
`)];for(let[K,W]of U.entries()){if(J+=W,H6.has(W)){let{groups:Z}=new RegExp(`(?:\\${Rq}(?<code>\\d+)m|\\${_8}(?<uri>.*)${h8})`).exec(U.slice(K).join(""))||{groups:{}};if(Z.code!==void 0){let H=Number.parseFloat(Z.code);Y=H===Y4?void 0:H}else Z.uri!==void 0&&(X=Z.uri.length===0?void 0:Z.uri)}let z=V4.codes.get(Number(Y));U[K+1]===`
|
|
14
|
+
`?(X&&(J+=Mq("")),Y&&z&&(J+=Oq(z))):W===`
|
|
15
|
+
`&&(Y&&z&&(J+=Oq(Y)),X&&(J+=Mq(X)))}return J},U4,z6,Z4,D8,z4,H4=($,Q,q)=>(Q in $)?z4($,Q,{enumerable:!0,configurable:!0,writable:!0,value:q}):$[Q]=q,U1=($,Q,q)=>(H4($,typeof Q!="symbol"?Q+"":Q,q),q),f8,L4,P4,O4=($,Q,q)=>(Q in $)?P4($,Q,{enumerable:!0,configurable:!0,writable:!0,value:q}):$[Q]=q,Nq=($,Q,q)=>(O4($,typeof Q!="symbol"?Q+"":Q,q),q),Sq,M4,B4=($,Q,q)=>(Q in $)?M4($,Q,{enumerable:!0,configurable:!0,writable:!0,value:q}):$[Q]=q,Iq=($,Q,q)=>(B4($,typeof Q!="symbol"?Q+"":Q,q),q),m8;var c8=q0(()=>{$1=C1(E8(),1);aY=rY();Fq={exports:{}};(function($){var Q={};$.exports=Q,Q.eastAsianWidth=function(J){var Y=J.charCodeAt(0),X=J.length==2?J.charCodeAt(1):0,V=Y;return 55296<=Y&&Y<=56319&&56320<=X&&X<=57343&&(Y&=1023,X&=1023,V=Y<<10|X,V+=65536),V==12288||65281<=V&&V<=65376||65504<=V&&V<=65510?"F":V==8361||65377<=V&&V<=65470||65474<=V&&V<=65479||65482<=V&&V<=65487||65490<=V&&V<=65495||65498<=V&&V<=65500||65512<=V&&V<=65518?"H":4352<=V&&V<=4447||4515<=V&&V<=4519||4602<=V&&V<=4607||9001<=V&&V<=9002||11904<=V&&V<=11929||11931<=V&&V<=12019||12032<=V&&V<=12245||12272<=V&&V<=12283||12289<=V&&V<=12350||12353<=V&&V<=12438||12441<=V&&V<=12543||12549<=V&&V<=12589||12593<=V&&V<=12686||12688<=V&&V<=12730||12736<=V&&V<=12771||12784<=V&&V<=12830||12832<=V&&V<=12871||12880<=V&&V<=13054||13056<=V&&V<=19903||19968<=V&&V<=42124||42128<=V&&V<=42182||43360<=V&&V<=43388||44032<=V&&V<=55203||55216<=V&&V<=55238||55243<=V&&V<=55291||63744<=V&&V<=64255||65040<=V&&V<=65049||65072<=V&&V<=65106||65108<=V&&V<=65126||65128<=V&&V<=65131||110592<=V&&V<=110593||127488<=V&&V<=127490||127504<=V&&V<=127546||127552<=V&&V<=127560||127568<=V&&V<=127569||131072<=V&&V<=194367||177984<=V&&V<=196605||196608<=V&&V<=262141?"W":32<=V&&V<=126||162<=V&&V<=163||165<=V&&V<=166||V==172||V==175||10214<=V&&V<=10221||10629<=V&&V<=10630?"Na":V==161||V==164||167<=V&&V<=168||V==170||173<=V&&V<=174||176<=V&&V<=180||182<=V&&V<=186||188<=V&&V<=191||V==198||V==208||215<=V&&V<=216||222<=V&&V<=225||V==230||232<=V&&V<=234||236<=V&&V<=237||V==240||242<=V&&V<=243||247<=V&&V<=250||V==252||V==254||V==257||V==273||V==275||V==283||294<=V&&V<=295||V==299||305<=V&&V<=307||V==312||319<=V&&V<=322||V==324||328<=V&&V<=331||V==333||338<=V&&V<=339||358<=V&&V<=359||V==363||V==462||V==464||V==466||V==468||V==470||V==472||V==474||V==476||V==593||V==609||V==708||V==711||713<=V&&V<=715||V==717||V==720||728<=V&&V<=731||V==733||V==735||768<=V&&V<=879||913<=V&&V<=929||931<=V&&V<=937||945<=V&&V<=961||963<=V&&V<=969||V==1025||1040<=V&&V<=1103||V==1105||V==8208||8211<=V&&V<=8214||8216<=V&&V<=8217||8220<=V&&V<=8221||8224<=V&&V<=8226||8228<=V&&V<=8231||V==8240||8242<=V&&V<=8243||V==8245||V==8251||V==8254||V==8308||V==8319||8321<=V&&V<=8324||V==8364||V==8451||V==8453||V==8457||V==8467||V==8470||8481<=V&&V<=8482||V==8486||V==8491||8531<=V&&V<=8532||8539<=V&&V<=8542||8544<=V&&V<=8555||8560<=V&&V<=8569||V==8585||8592<=V&&V<=8601||8632<=V&&V<=8633||V==8658||V==8660||V==8679||V==8704||8706<=V&&V<=8707||8711<=V&&V<=8712||V==8715||V==8719||V==8721||V==8725||V==8730||8733<=V&&V<=8736||V==8739||V==8741||8743<=V&&V<=8748||V==8750||8756<=V&&V<=8759||8764<=V&&V<=8765||V==8776||V==8780||V==8786||8800<=V&&V<=8801||8804<=V&&V<=8807||8810<=V&&V<=8811||8814<=V&&V<=8815||8834<=V&&V<=8835||8838<=V&&V<=8839||V==8853||V==8857||V==8869||V==8895||V==8978||9312<=V&&V<=9449||9451<=V&&V<=9547||9552<=V&&V<=9587||9600<=V&&V<=9615||9618<=V&&V<=9621||9632<=V&&V<=9633||9635<=V&&V<=9641||9650<=V&&V<=9651||9654<=V&&V<=9655||9660<=V&&V<=9661||9664<=V&&V<=9665||9670<=V&&V<=9672||V==9675||9678<=V&&V<=9681||9698<=V&&V<=9701||V==9711||9733<=V&&V<=9734||V==9737||9742<=V&&V<=9743||9748<=V&&V<=9749||V==9756||V==9758||V==9792||V==9794||9824<=V&&V<=9825||9827<=V&&V<=9829||9831<=V&&V<=9834||9836<=V&&V<=9837||V==9839||9886<=V&&V<=9887||9918<=V&&V<=9919||9924<=V&&V<=9933||9935<=V&&V<=9953||V==9955||9960<=V&&V<=9983||V==10045||V==10071||10102<=V&&V<=10111||11093<=V&&V<=11097||12872<=V&&V<=12879||57344<=V&&V<=63743||65024<=V&&V<=65039||V==65533||127232<=V&&V<=127242||127248<=V&&V<=127277||127280<=V&&V<=127337||127344<=V&&V<=127386||917760<=V&&V<=917999||983040<=V&&V<=1048573||1048576<=V&&V<=1114109?"A":"N"},Q.characterLength=function(J){var Y=this.eastAsianWidth(J);return Y=="F"||Y=="W"||Y=="A"?2:1};function q(J){return J.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}Q.length=function(J){for(var Y=q(J),X=0,V=0;V<Y.length;V++)X=X+this.characterLength(Y[V]);return X},Q.slice=function(J,Y,X){textLen=Q.length(J),Y=Y||0,X=X||1,Y<0&&(Y=textLen+Y),X<0&&(X=textLen+X);for(var V="",G=0,U=q(J),K=0;K<U.length;K++){var W=U[K],z=Q.length(W);if(G>=Y-(z==2?1:0))if(G+z<=X)V+=W;else break;G+=z}return V}})(Fq);sY=Fq.exports,tY=Aq(sY),$4=Aq(eY);m={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(m.modifier);Q4=Object.keys(m.color),q4=Object.keys(m.bgColor);[...Q4,...q4];V4=J4(),H6=new Set(["\x1B",""]),_8=`${X4}8;;`;U4=["up","down","left","right","space","enter","cancel"],z6={actions:new Set(U4),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};Z4=globalThis.process.platform.startsWith("win"),D8=Symbol("clack:cancel");z4=Object.defineProperty;f8=class f8 extends L6{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor($){super($,!1),this.value=!!$.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(Q)=>{this.output.write($1.cursor.move(0,-1)),this.value=Q,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};L4=new WeakMap;P4=Object.defineProperty,Sq=class extends L6{constructor($){super($,!1),Nq(this,"options"),Nq(this,"cursor",0),this.options=$.options,this.value=[...$.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:Q})=>Q===$.cursorAt),0),this.on("key",(Q)=>{Q==="a"&&this.toggleAll()}),this.on("cursor",(Q)=>{switch(Q){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let $=this.value.length===this.options.length;this.value=$?[]:this.options.map((Q)=>Q.value)}toggleValue(){let $=this.value.includes(this._value);this.value=$?this.value.filter((Q)=>Q!==this._value):[...this.value,this._value]}},M4=Object.defineProperty;m8=class m8 extends L6{constructor($){super($,!1),Iq(this,"options"),Iq(this,"cursor",0),this.options=$.options,this.cursor=this.options.findIndex(({value:Q})=>Q===$.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(Q)=>{switch(Q){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}}});import{stripVTControlCharacters as p8}from"node:util";import w1 from"node:process";function N4(){return w1.platform!=="win32"?w1.env.TERM!=="linux":!!w1.env.CI||!!w1.env.WT_SESSION||!!w1.env.TERMINUS_SUBLIME||w1.env.ConEmuTask==="{cmd::Cmder}"||w1.env.TERM_PROGRAM==="Terminus-Sublime"||w1.env.TERM_PROGRAM==="vscode"||w1.env.TERM==="xterm-256color"||w1.env.TERM==="alacritty"||w1.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var M,P6,u8,d=($,Q)=>u8?$:Q,I4,kq,gq,O6,C4,k,k0,d8,l8,w4,Eq,T4,RH,yq,A4,F4,R4,v4,x4,S4,E4,i8=($)=>{switch($){case"initial":case"active":return M.default.cyan(I4);case"cancel":return M.default.red(kq);case"error":return M.default.yellow(gq);case"submit":return M.default.green(O6)}},o8=($)=>{let{cursor:Q,options:q,style:J}=$,Y=$.maxItems??Number.POSITIVE_INFINITY,X=Math.max(process.stdout.rows-4,0),V=Math.min(X,Math.max(Y,5)),G=0;Q>=G+V-3?G=Math.max(Math.min(Q-V+3,q.length-V),0):Q<G+2&&(G=Math.max(Q-2,0));let U=V<q.length&&G>0,K=V<q.length&&G+V<q.length;return q.slice(G,G+V).map((W,z,Z)=>{let H=z===0&&U,C=z===Z.length-1&&K;return H||C?M.default.dim("..."):J(W,z+G===Q)})},M6=($)=>{let Q=$.active??"Yes",q=$.inactive??"No";return new f8({active:Q,inactive:q,initialValue:$.initialValue??!0,render(){let J=`${M.default.gray(k)}
|
|
16
16
|
${i8(this.state)} ${$.message}
|
|
17
|
-
`,Y=this.value?Q:q;switch(this.state){case"submit":return`${
|
|
18
|
-
${
|
|
19
|
-
${
|
|
20
|
-
`}}}).prompt()},Dq=($)=>{let Q=(q,
|
|
17
|
+
`,Y=this.value?Q:q;switch(this.state){case"submit":return`${J}${M.default.gray(k)} ${M.default.dim(Y)}`;case"cancel":return`${J}${M.default.gray(k)} ${M.default.strikethrough(M.default.dim(Y))}
|
|
18
|
+
${M.default.gray(k)}`;default:return`${J}${M.default.cyan(k)} ${this.value?`${M.default.green(d8)} ${Q}`:`${M.default.dim(l8)} ${M.default.dim(Q)}`} ${M.default.dim("/")} ${this.value?`${M.default.dim(l8)} ${M.default.dim(q)}`:`${M.default.green(d8)} ${q}`}
|
|
19
|
+
${M.default.cyan(k0)}
|
|
20
|
+
`}}}).prompt()},Dq=($)=>{let Q=(q,J)=>{let Y=q.label??String(q.value);switch(J){case"selected":return`${M.default.dim(Y)}`;case"active":return`${M.default.green(d8)} ${Y} ${q.hint?M.default.dim(`(${q.hint})`):""}`;case"cancelled":return`${M.default.strikethrough(M.default.dim(Y))}`;default:return`${M.default.dim(l8)} ${M.default.dim(Y)}`}};return new m8({options:$.options,initialValue:$.initialValue,render(){let q=`${M.default.gray(k)}
|
|
21
21
|
${i8(this.state)} ${$.message}
|
|
22
|
-
`;switch(this.state){case"submit":return`${q}${
|
|
23
|
-
${
|
|
24
|
-
${
|
|
25
|
-
${
|
|
26
|
-
`}}}).prompt()},hq=($)=>{let Q=(q,
|
|
27
|
-
${
|
|
22
|
+
`;switch(this.state){case"submit":return`${q}${M.default.gray(k)} ${Q(this.options[this.cursor],"selected")}`;case"cancel":return`${q}${M.default.gray(k)} ${Q(this.options[this.cursor],"cancelled")}
|
|
23
|
+
${M.default.gray(k)}`;default:return`${q}${M.default.cyan(k)} ${o8({cursor:this.cursor,options:this.options,maxItems:$.maxItems,style:(J,Y)=>Q(J,Y?"active":"inactive")}).join(`
|
|
24
|
+
${M.default.cyan(k)} `)}
|
|
25
|
+
${M.default.cyan(k0)}
|
|
26
|
+
`}}}).prompt()},hq=($)=>{let Q=(q,J)=>{let Y=q.label??String(q.value);return J==="active"?`${M.default.cyan(w4)} ${Y} ${q.hint?M.default.dim(`(${q.hint})`):""}`:J==="selected"?`${M.default.green(Eq)} ${M.default.dim(Y)} ${q.hint?M.default.dim(`(${q.hint})`):""}`:J==="cancelled"?`${M.default.strikethrough(M.default.dim(Y))}`:J==="active-selected"?`${M.default.green(Eq)} ${Y} ${q.hint?M.default.dim(`(${q.hint})`):""}`:J==="submitted"?`${M.default.dim(Y)}`:`${M.default.dim(T4)} ${M.default.dim(Y)}`};return new Sq({options:$.options,initialValues:$.initialValues,required:$.required??!0,cursorAt:$.cursorAt,validate(q){if(this.required&&q.length===0)return`Please select at least one option.
|
|
27
|
+
${M.default.reset(M.default.dim(`Press ${M.default.gray(M.default.bgWhite(M.default.inverse(" space ")))} to select, ${M.default.gray(M.default.bgWhite(M.default.inverse(" enter ")))} to submit`))}`},render(){let q=`${M.default.gray(k)}
|
|
28
28
|
${i8(this.state)} ${$.message}
|
|
29
|
-
`,
|
|
30
|
-
${
|
|
31
|
-
`).map((X,
|
|
32
|
-
`);return`${q+
|
|
33
|
-
${
|
|
29
|
+
`,J=(Y,X)=>{let V=this.value.includes(Y.value);return X&&V?Q(Y,"active-selected"):V?Q(Y,"selected"):Q(Y,X?"active":"inactive")};switch(this.state){case"submit":return`${q}${M.default.gray(k)} ${this.options.filter(({value:Y})=>this.value.includes(Y)).map((Y)=>Q(Y,"submitted")).join(M.default.dim(", "))||M.default.dim("none")}`;case"cancel":{let Y=this.options.filter(({value:X})=>this.value.includes(X)).map((X)=>Q(X,"cancelled")).join(M.default.dim(", "));return`${q}${M.default.gray(k)} ${Y.trim()?`${Y}
|
|
30
|
+
${M.default.gray(k)}`:""}`}case"error":{let Y=this.error.split(`
|
|
31
|
+
`).map((X,V)=>V===0?`${M.default.yellow(k0)} ${M.default.yellow(X)}`:` ${X}`).join(`
|
|
32
|
+
`);return`${q+M.default.yellow(k)} ${o8({options:this.options,cursor:this.cursor,maxItems:$.maxItems,style:J}).join(`
|
|
33
|
+
${M.default.yellow(k)} `)}
|
|
34
34
|
${Y}
|
|
35
|
-
`}default:return`${q}${
|
|
36
|
-
${
|
|
37
|
-
${
|
|
35
|
+
`}default:return`${q}${M.default.cyan(k)} ${o8({options:this.options,cursor:this.cursor,maxItems:$.maxItems,style:J}).join(`
|
|
36
|
+
${M.default.cyan(k)} `)}
|
|
37
|
+
${M.default.cyan(k0)}
|
|
38
38
|
`}}}).prompt()},T1=($="",Q="")=>{let q=`
|
|
39
39
|
${$}
|
|
40
40
|
`.split(`
|
|
41
|
-
`),
|
|
42
|
-
`);process.stdout.write(`${
|
|
43
|
-
${
|
|
41
|
+
`),J=p8(Q).length,Y=Math.max(q.reduce((V,G)=>{let U=p8(G);return U.length>V?U.length:V},0),J)+2,X=q.map((V)=>`${M.default.gray(k)} ${M.default.dim(V)}${" ".repeat(Y-p8(V).length)}${M.default.gray(k)}`).join(`
|
|
42
|
+
`);process.stdout.write(`${M.default.gray(k)}
|
|
43
|
+
${M.default.green(O6)} ${M.default.reset(Q)} ${M.default.gray(yq.repeat(Math.max(Y-J-1,1))+A4)}
|
|
44
44
|
${X}
|
|
45
|
-
${
|
|
46
|
-
`)},Y1=($="")=>{process.stdout.write(`${
|
|
45
|
+
${M.default.gray(F4+yq.repeat(Y+2)+R4)}
|
|
46
|
+
`)},Y1=($="")=>{process.stdout.write(`${M.default.gray(k0)} ${M.default.red($)}
|
|
47
47
|
|
|
48
|
-
`)},A1=($="")=>{process.stdout.write(`${
|
|
49
|
-
`)},F1=($="")=>{process.stdout.write(`${
|
|
50
|
-
${
|
|
48
|
+
`)},A1=($="")=>{process.stdout.write(`${M.default.gray(C4)} ${$}
|
|
49
|
+
`)},F1=($="")=>{process.stdout.write(`${M.default.gray(k)}
|
|
50
|
+
${M.default.gray(k0)} ${$}
|
|
51
51
|
|
|
52
|
-
`)},u,vH,H1=({indicator:$="dots"}={})=>{let Q=u8?["◒","◐","◓","◑"]:["•","o","O","0"],q=u8?80:120,
|
|
53
|
-
`);let
|
|
54
|
-
`);process.stdout.write(P6.cursor.move(-999,
|
|
55
|
-
`);let
|
|
56
|
-
`):process.stdout.write(`${
|
|
57
|
-
`),
|
|
58
|
-
`);q.push(`${Q} ${
|
|
52
|
+
`)},u,vH,H1=({indicator:$="dots"}={})=>{let Q=u8?["◒","◐","◓","◑"]:["•","o","O","0"],q=u8?80:120,J=process.env.CI==="true",Y,X,V=!1,G="",U,K=performance.now(),W=(L)=>{let P=L>1?"Something went wrong":"Canceled";V&&B(P,L)},z=()=>W(2),Z=()=>W(1),H=()=>{process.on("uncaughtExceptionMonitor",z),process.on("unhandledRejection",z),process.on("SIGINT",Z),process.on("SIGTERM",Z),process.on("exit",W)},C=()=>{process.removeListener("uncaughtExceptionMonitor",z),process.removeListener("unhandledRejection",z),process.removeListener("SIGINT",Z),process.removeListener("SIGTERM",Z),process.removeListener("exit",W)},I=()=>{if(U===void 0)return;J&&process.stdout.write(`
|
|
53
|
+
`);let L=U.split(`
|
|
54
|
+
`);process.stdout.write(P6.cursor.move(-999,L.length-1)),process.stdout.write(P6.erase.down(L.length))},w=(L)=>L.replace(/\.+$/,""),N=(L)=>{let P=(performance.now()-L)/1000,A=Math.floor(P/60),R=Math.floor(P%60);return A>0?`[${A}m ${R}s]`:`[${R}s]`},O=(L="")=>{V=!0,Y=xq(),G=w(L),K=performance.now(),process.stdout.write(`${M.default.gray(k)}
|
|
55
|
+
`);let P=0,A=0;H(),X=setInterval(()=>{if(J&&G===U)return;I(),U=G;let R=M.default.magenta(Q[P]);if(J)process.stdout.write(`${R} ${G}...`);else if($==="timer")process.stdout.write(`${R} ${G} ${N(K)}`);else{let v=".".repeat(Math.floor(A)).slice(0,3);process.stdout.write(`${R} ${G}${v}`)}P=P+1<Q.length?P+1:0,A=A<Q.length?A+0.125:0},q)},B=(L="",P=0)=>{V=!1,clearInterval(X),I();let A=P===0?M.default.green(O6):P===1?M.default.red(kq):M.default.red(gq);G=w(L??G),$==="timer"?process.stdout.write(`${A} ${G} ${N(K)}
|
|
56
|
+
`):process.stdout.write(`${A} ${G}
|
|
57
|
+
`),C(),Y()};return{start:O,stop:B,message:(L="")=>{G=w(L??G)}}};var g0=q0(()=>{c8();c8();M=C1(o1(),1),P6=C1(E8(),1);u8=N4(),I4=d("◆","*"),kq=d("■","x"),gq=d("▲","x"),O6=d("◇","o"),C4=d("┌","T"),k=d("│","|"),k0=d("└","—"),d8=d("●",">"),l8=d("○"," "),w4=d("◻","[•]"),Eq=d("◼","[+]"),T4=d("◻","[ ]"),RH=d("▪","•"),yq=d("─","-"),A4=d("╮","+"),F4=d("├","+"),R4=d("╯","+"),v4=d("●","•"),x4=d("◆","*"),S4=d("▲","!"),E4=d("■","x"),u={message:($="",{symbol:Q=M.default.gray(k)}={})=>{let q=[`${M.default.gray(k)}`];if($){let[J,...Y]=$.split(`
|
|
58
|
+
`);q.push(`${Q} ${J}`,...Y.map((X)=>`${M.default.gray(k)} ${X}`))}process.stdout.write(`${q.join(`
|
|
59
59
|
`)}
|
|
60
|
-
`)},info:($)=>{u.message($,{symbol:B.default.blue(v4)})},success:($)=>{u.message($,{symbol:B.default.green(x4)})},step:($)=>{u.message($,{symbol:B.default.green(O6)})},warn:($)=>{u.message($,{symbol:B.default.yellow(S4)})},warning:($)=>{u.warn($)},error:($)=>{u.message($,{symbol:B.default.red(E4)})}},vH=`${B.default.gray(k)} `});var z$=T((SH,n8)=>{if(typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0)n8.exports={nextTick:y4};else n8.exports=process;function y4($,Q,q,V){if(typeof $!=="function")throw TypeError('"callback" argument must be a function');var Y=arguments.length,X,J;switch(Y){case 0:case 1:return process.nextTick($);case 2:return process.nextTick(function(){$.call(null,Q)});case 3:return process.nextTick(function(){$.call(null,Q,q)});case 4:return process.nextTick(function(){$.call(null,Q,q,V)});default:X=Array(Y-1),J=0;while(J<X.length)X[J++]=arguments[J];return process.nextTick(function(){$.apply(null,X)})}}});var bq=T((EH,_q)=>{var k4={}.toString;_q.exports=Array.isArray||function($){return k4.call($)=="[object Array]"}});var H$=T((r8,mq)=>{var B6=b("buffer"),l1=B6.Buffer;function fq($,Q){for(var q in $)Q[q]=$[q]}if(l1.from&&l1.alloc&&l1.allocUnsafe&&l1.allocUnsafeSlow)mq.exports=B6;else fq(B6,r8),r8.Buffer=k0;function k0($,Q,q){return l1($,Q,q)}fq(l1,k0);k0.from=function($,Q,q){if(typeof $==="number")throw TypeError("Argument must not be a number");return l1($,Q,q)};k0.alloc=function($,Q,q){if(typeof $!=="number")throw TypeError("Argument must be a number");var V=l1($);if(Q!==void 0)if(typeof q==="string")V.fill(Q,q);else V.fill(Q);else V.fill(0);return V};k0.allocUnsafe=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return l1($)};k0.allocUnsafeSlow=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return B6.SlowBuffer($)}});var g0=T((n4)=>{function g4($){if(Array.isArray)return Array.isArray($);return N6($)==="[object Array]"}n4.isArray=g4;function D4($){return typeof $==="boolean"}n4.isBoolean=D4;function h4($){return $===null}n4.isNull=h4;function _4($){return $==null}n4.isNullOrUndefined=_4;function b4($){return typeof $==="number"}n4.isNumber=b4;function f4($){return typeof $==="string"}n4.isString=f4;function m4($){return typeof $==="symbol"}n4.isSymbol=m4;function c4($){return $===void 0}n4.isUndefined=c4;function p4($){return N6($)==="[object RegExp]"}n4.isRegExp=p4;function u4($){return typeof $==="object"&&$!==null}n4.isObject=u4;function d4($){return N6($)==="[object Date]"}n4.isDate=d4;function l4($){return N6($)==="[object Error]"||$ instanceof Error}n4.isError=l4;function o4($){return typeof $==="function"}n4.isFunction=o4;function i4($){return $===null||typeof $==="boolean"||typeof $==="number"||typeof $==="string"||typeof $==="symbol"||typeof $>"u"}n4.isPrimitive=i4;n4.isBuffer=b("buffer").Buffer.isBuffer;function N6($){return Object.prototype.toString.call($)}});var cq=T((kH,a8)=>{if(typeof Object.create==="function")a8.exports=function(Q,q){if(q)Q.super_=q,Q.prototype=Object.create(q.prototype,{constructor:{value:Q,enumerable:!1,writable:!0,configurable:!0}})};else a8.exports=function(Q,q){if(q){Q.super_=q;var V=function(){};V.prototype=q.prototype,Q.prototype=new V,Q.prototype.constructor=Q}}});var D0=T((gH,s8)=>{try{if(I6=b("util"),typeof I6.inherits!=="function")throw"";s8.exports=I6.inherits}catch($){s8.exports=cq()}var I6});var uq=T((DH,t8)=>{function UX($,Q){if(!($ instanceof Q))throw TypeError("Cannot call a class as a function")}var pq=H$().Buffer,L$=b("util");function jX($,Q,q){$.copy(Q,q)}t8.exports=function(){function $(){UX(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(q){var V={data:q,next:null};if(this.length>0)this.tail.next=V;else this.head=V;this.tail=V,++this.length},$.prototype.unshift=function(q){var V={data:q,next:this.head};if(this.length===0)this.tail=V;this.head=V,++this.length},$.prototype.shift=function(){if(this.length===0)return;var q=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,q},$.prototype.clear=function(){this.head=this.tail=null,this.length=0},$.prototype.join=function(q){if(this.length===0)return"";var V=this.head,Y=""+V.data;while(V=V.next)Y+=q+V.data;return Y},$.prototype.concat=function(q){if(this.length===0)return pq.alloc(0);var V=pq.allocUnsafe(q>>>0),Y=this.head,X=0;while(Y)jX(Y.data,V,X),X+=Y.data.length,Y=Y.next;return V},$}();if(L$&&L$.inspect&&L$.inspect.custom)t8.exports.prototype[L$.inspect.custom]=function(){var $=L$.inspect({length:this.length});return this.constructor.name+" "+$}});var e8=T((hH,dq)=>{var C6=z$();function ZX($,Q){var q=this,V=this._readableState&&this._readableState.destroyed,Y=this._writableState&&this._writableState.destroyed;if(V||Y){if(Q)Q($);else if($){if(!this._writableState)C6.nextTick(w6,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,C6.nextTick(w6,this,$)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy($||null,function(X){if(!Q&&X){if(!q._writableState)C6.nextTick(w6,q,X);else if(!q._writableState.errorEmitted)q._writableState.errorEmitted=!0,C6.nextTick(w6,q,X)}else if(Q)Q(X)}),this}function zX(){if(this._readableState)this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1;if(this._writableState)this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1}function w6($,Q){$.emit("error",Q)}dq.exports={destroy:ZX,undestroy:zX}});var oq=T((_H,lq)=>{lq.exports=b("util").deprecate});var Q5=T((bH,$V)=>{var L0=z$();$V.exports=o;function nq($){var Q=this;this.next=null,this.entry=null,this.finish=function(){EX(Q,$)}}var HX=["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:L0.nextTick,h0;o.WritableState=O$;var rq=Object.create(g0());rq.inherits=D0();var LX={deprecate:oq()},aq=b("stream"),A6=H$().Buffer,PX=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function OX($){return A6.from($)}function MX($){return A6.isBuffer($)||$ instanceof PX}var sq=e8();rq.inherits(o,aq);function BX(){}function O$($,Q){h0=h0||P0(),$=$||{};var q=Q instanceof h0;if(this.objectMode=!!$.objectMode,q)this.objectMode=this.objectMode||!!$.writableObjectMode;var{highWaterMark:V,writableHighWaterMark:Y}=$,X=this.objectMode?16:16384;if(V||V===0)this.highWaterMark=V;else if(q&&(Y||Y===0))this.highWaterMark=Y;else this.highWaterMark=X;this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var J=$.decodeStrings===!1;this.decodeStrings=!J,this.defaultEncoding=$.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(G){FX(Q,G)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new nq(this)}O$.prototype.getBuffer=function(){var Q=this.bufferedRequest,q=[];while(Q)q.push(Q),Q=Q.next;return q};(function(){try{Object.defineProperty(O$.prototype,"buffer",{get:LX.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch($){}})();var T6;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function")T6=Function.prototype[Symbol.hasInstance],Object.defineProperty(o,Symbol.hasInstance,{value:function($){if(T6.call(this,$))return!0;if(this!==o)return!1;return $&&$._writableState instanceof O$}});else T6=function($){return $ instanceof this};function o($){if(h0=h0||P0(),!T6.call(o,this)&&!(this instanceof h0))return new o($);if(this._writableState=new O$($,this),this.writable=!0,$){if(typeof $.write==="function")this._write=$.write;if(typeof $.writev==="function")this._writev=$.writev;if(typeof $.destroy==="function")this._destroy=$.destroy;if(typeof $.final==="function")this._final=$.final}aq.call(this)}o.prototype.pipe=function(){this.emit("error",Error("Cannot pipe, not readable"))};function NX($,Q){var q=Error("write after end");$.emit("error",q),L0.nextTick(Q,q)}function IX($,Q,q,V){var Y=!0,X=!1;if(q===null)X=TypeError("May not write null values to stream");else if(typeof q!=="string"&&q!==void 0&&!Q.objectMode)X=TypeError("Invalid non-string/buffer chunk");if(X)$.emit("error",X),L0.nextTick(V,X),Y=!1;return Y}o.prototype.write=function($,Q,q){var V=this._writableState,Y=!1,X=!V.objectMode&&MX($);if(X&&!A6.isBuffer($))$=OX($);if(typeof Q==="function")q=Q,Q=null;if(X)Q="buffer";else if(!Q)Q=V.defaultEncoding;if(typeof q!=="function")q=BX;if(V.ended)NX(this,q);else if(X||IX(this,V,$,q))V.pendingcb++,Y=wX(this,V,X,$,Q,q);return Y};o.prototype.cork=function(){var $=this._writableState;$.corked++};o.prototype.uncork=function(){var $=this._writableState;if($.corked){if($.corked--,!$.writing&&!$.corked&&!$.bufferProcessing&&$.bufferedRequest)tq(this,$)}};o.prototype.setDefaultEncoding=function(Q){if(typeof Q==="string")Q=Q.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Q+"").toLowerCase())>-1))throw TypeError("Unknown encoding: "+Q);return this._writableState.defaultEncoding=Q,this};function CX($,Q,q){if(!$.objectMode&&$.decodeStrings!==!1&&typeof Q==="string")Q=A6.from(Q,q);return Q}Object.defineProperty(o.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function wX($,Q,q,V,Y,X){if(!q){var J=CX(Q,V,Y);if(V!==J)q=!0,Y="buffer",V=J}var G=Q.objectMode?1:V.length;Q.length+=G;var U=Q.length<Q.highWaterMark;if(!U)Q.needDrain=!0;if(Q.writing||Q.corked){var K=Q.lastBufferedRequest;if(Q.lastBufferedRequest={chunk:V,encoding:Y,isBuf:q,callback:X,next:null},K)K.next=Q.lastBufferedRequest;else Q.bufferedRequest=Q.lastBufferedRequest;Q.bufferedRequestCount+=1}else $5($,Q,!1,G,V,Y,X);return U}function $5($,Q,q,V,Y,X,J){if(Q.writelen=V,Q.writecb=J,Q.writing=!0,Q.sync=!0,q)$._writev(Y,Q.onwrite);else $._write(Y,X,Q.onwrite);Q.sync=!1}function TX($,Q,q,V,Y){if(--Q.pendingcb,q)L0.nextTick(Y,V),L0.nextTick(P$,$,Q),$._writableState.errorEmitted=!0,$.emit("error",V);else Y(V),$._writableState.errorEmitted=!0,$.emit("error",V),P$($,Q)}function AX($){$.writing=!1,$.writecb=null,$.length-=$.writelen,$.writelen=0}function FX($,Q){var q=$._writableState,V=q.sync,Y=q.writecb;if(AX(q),Q)TX($,q,V,Q,Y);else{var X=eq(q);if(!X&&!q.corked&&!q.bufferProcessing&&q.bufferedRequest)tq($,q);if(V)HX(iq,$,q,X,Y);else iq($,q,X,Y)}}function iq($,Q,q,V){if(!q)RX($,Q);Q.pendingcb--,V(),P$($,Q)}function RX($,Q){if(Q.length===0&&Q.needDrain)Q.needDrain=!1,$.emit("drain")}function tq($,Q){Q.bufferProcessing=!0;var q=Q.bufferedRequest;if($._writev&&q&&q.next){var V=Q.bufferedRequestCount,Y=Array(V),X=Q.corkedRequestsFree;X.entry=q;var J=0,G=!0;while(q){if(Y[J]=q,!q.isBuf)G=!1;q=q.next,J+=1}if(Y.allBuffers=G,$5($,Q,!0,Q.length,Y,"",X.finish),Q.pendingcb++,Q.lastBufferedRequest=null,X.next)Q.corkedRequestsFree=X.next,X.next=null;else Q.corkedRequestsFree=new nq(Q);Q.bufferedRequestCount=0}else{while(q){var{chunk:U,encoding:K,callback:W}=q,Z=Q.objectMode?1:U.length;if($5($,Q,!1,Z,U,K,W),q=q.next,Q.bufferedRequestCount--,Q.writing)break}if(q===null)Q.lastBufferedRequest=null}Q.bufferedRequest=q,Q.bufferProcessing=!1}o.prototype._write=function($,Q,q){q(Error("_write() is not implemented"))};o.prototype._writev=null;o.prototype.end=function($,Q,q){var V=this._writableState;if(typeof $==="function")q=$,$=null,Q=null;else if(typeof Q==="function")q=Q,Q=null;if($!==null&&$!==void 0)this.write($,Q);if(V.corked)V.corked=1,this.uncork();if(!V.ending)SX(this,V,q)};function eq($){return $.ending&&$.length===0&&$.bufferedRequest===null&&!$.finished&&!$.writing}function vX($,Q){$._final(function(q){if(Q.pendingcb--,q)$.emit("error",q);Q.prefinished=!0,$.emit("prefinish"),P$($,Q)})}function xX($,Q){if(!Q.prefinished&&!Q.finalCalled)if(typeof $._final==="function")Q.pendingcb++,Q.finalCalled=!0,L0.nextTick(vX,$,Q);else Q.prefinished=!0,$.emit("prefinish")}function P$($,Q){var q=eq(Q);if(q){if(xX($,Q),Q.pendingcb===0)Q.finished=!0,$.emit("finish")}return q}function SX($,Q,q){if(Q.ending=!0,P$($,Q),q)if(Q.finished)L0.nextTick(q);else $.once("finish",q);Q.ended=!0,$.writable=!1}function EX($,Q,q){var V=$.entry;$.entry=null;while(V){var Y=V.callback;Q.pendingcb--,Y(q),V=V.next}Q.corkedRequestsFree.next=$}Object.defineProperty(o.prototype,"destroyed",{get:function(){if(this._writableState===void 0)return!1;return this._writableState.destroyed},set:function($){if(!this._writableState)return;this._writableState.destroyed=$}});o.prototype.destroy=sq.destroy;o.prototype._undestroy=sq.undestroy;o.prototype._destroy=function($,Q){this.end(),Q($)}});var P0=T((fH,JV)=>{var QV=z$(),yX=Object.keys||function($){var Q=[];for(var q in $)Q.push(q);return Q};JV.exports=o1;var qV=Object.create(g0());qV.inherits=D0();var VV=V5(),q5=Q5();qV.inherits(o1,VV);{F6=yX(q5.prototype);for(M$=0;M$<F6.length;M$++)if(B$=F6[M$],!o1.prototype[B$])o1.prototype[B$]=q5.prototype[B$]}var F6,B$,M$;function o1($){if(!(this instanceof o1))return new o1($);if(VV.call(this,$),q5.call(this,$),$&&$.readable===!1)this.readable=!1;if($&&$.writable===!1)this.writable=!1;if(this.allowHalfOpen=!0,$&&$.allowHalfOpen===!1)this.allowHalfOpen=!1;this.once("end",kX)}Object.defineProperty(o1.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function kX(){if(this.allowHalfOpen||this._writableState.ended)return;QV.nextTick(gX,this)}function gX($){$.end()}Object.defineProperty(o1.prototype,"destroyed",{get:function(){if(this._readableState===void 0||this._writableState===void 0)return!1;return this._readableState.destroyed&&this._writableState.destroyed},set:function($){if(this._readableState===void 0||this._writableState===void 0)return;this._readableState.destroyed=$,this._writableState.destroyed=$}});o1.prototype._destroy=function($,Q){this.push(null),this.end(),QV.nextTick(Q,$)}});var X5=T((nX)=>{var Y5=H$().Buffer,YV=Y5.isEncoding||function($){switch($=""+$,$&&$.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function DX($){if(!$)return"utf8";var Q;while(!0)switch($){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return $;default:if(Q)return;$=(""+$).toLowerCase(),Q=!0}}function hX($){var Q=DX($);if(typeof Q!=="string"&&(Y5.isEncoding===YV||!YV($)))throw Error("Unknown encoding: "+$);return Q||$}nX.StringDecoder=N$;function N$($){this.encoding=hX($);var Q;switch(this.encoding){case"utf16le":this.text=pX,this.end=uX,Q=4;break;case"utf8":this.fillLast=fX,Q=4;break;case"base64":this.text=dX,this.end=lX,Q=3;break;default:this.write=oX,this.end=iX;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Y5.allocUnsafe(Q)}N$.prototype.write=function($){if($.length===0)return"";var Q,q;if(this.lastNeed){if(Q=this.fillLast($),Q===void 0)return"";q=this.lastNeed,this.lastNeed=0}else q=0;if(q<$.length)return Q?Q+this.text($,q):this.text($,q);return Q||""};N$.prototype.end=cX;N$.prototype.text=mX;N$.prototype.fillLast=function($){if(this.lastNeed<=$.length)return $.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);$.copy(this.lastChar,this.lastTotal-this.lastNeed,0,$.length),this.lastNeed-=$.length};function J5($){if($<=127)return 0;else if($>>5===6)return 2;else if($>>4===14)return 3;else if($>>3===30)return 4;return $>>6===2?-1:-2}function _X($,Q,q){var V=Q.length-1;if(V<q)return 0;var Y=J5(Q[V]);if(Y>=0){if(Y>0)$.lastNeed=Y-1;return Y}if(--V<q||Y===-2)return 0;if(Y=J5(Q[V]),Y>=0){if(Y>0)$.lastNeed=Y-2;return Y}if(--V<q||Y===-2)return 0;if(Y=J5(Q[V]),Y>=0){if(Y>0)if(Y===2)Y=0;else $.lastNeed=Y-3;return Y}return 0}function bX($,Q,q){if((Q[0]&192)!==128)return $.lastNeed=0,"�";if($.lastNeed>1&&Q.length>1){if((Q[1]&192)!==128)return $.lastNeed=1,"�";if($.lastNeed>2&&Q.length>2){if((Q[2]&192)!==128)return $.lastNeed=2,"�"}}}function fX($){var Q=this.lastTotal-this.lastNeed,q=bX(this,$,Q);if(q!==void 0)return q;if(this.lastNeed<=$.length)return $.copy(this.lastChar,Q,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);$.copy(this.lastChar,Q,0,$.length),this.lastNeed-=$.length}function mX($,Q){var q=_X(this,$,Q);if(!this.lastNeed)return $.toString("utf8",Q);this.lastTotal=q;var V=$.length-(q-this.lastNeed);return $.copy(this.lastChar,0,V),$.toString("utf8",Q,V)}function cX($){var Q=$&&$.length?this.write($):"";if(this.lastNeed)return Q+"�";return Q}function pX($,Q){if(($.length-Q)%2===0){var q=$.toString("utf16le",Q);if(q){var V=q.charCodeAt(q.length-1);if(V>=55296&&V<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1],q.slice(0,-1)}return q}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=$[$.length-1],$.toString("utf16le",Q,$.length-1)}function uX($){var Q=$&&$.length?this.write($):"";if(this.lastNeed){var q=this.lastTotal-this.lastNeed;return Q+this.lastChar.toString("utf16le",0,q)}return Q}function dX($,Q){var q=($.length-Q)%3;if(q===0)return $.toString("base64",Q);if(this.lastNeed=3-q,this.lastTotal=3,q===1)this.lastChar[0]=$[$.length-1];else this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1];return $.toString("base64",Q,$.length-q)}function lX($){var Q=$&&$.length?this.write($):"";if(this.lastNeed)return Q+this.lastChar.toString("base64",0,3-this.lastNeed);return Q}function oX($){return $.toString(this.encoding)}function iX($){return $&&$.length?this.write($):""}});var V5=T((pH,OV)=>{var b0=z$();OV.exports=f;var aX=bq(),I$;f.ReadableState=ZV;var cH=b("events").EventEmitter,WV=function($,Q){return $.listeners(Q).length},j5=b("stream"),C$=H$().Buffer,sX=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function tX($){return C$.from($)}function eX($){return C$.isBuffer($)||$ instanceof sX}var UV=Object.create(g0());UV.inherits=D0();var G5=b("util"),y=void 0;if(G5&&G5.debuglog)y=G5.debuglog("stream");else y=function(){};var $3=uq(),jV=e8(),_0;UV.inherits(f,j5);var K5=["error","close","destroy","pause","resume"];function Q3($,Q,q){if(typeof $.prependListener==="function")return $.prependListener(Q,q);if(!$._events||!$._events[Q])$.on(Q,q);else if(aX($._events[Q]))$._events[Q].unshift(q);else $._events[Q]=[q,$._events[Q]]}function ZV($,Q){I$=I$||P0(),$=$||{};var q=Q instanceof I$;if(this.objectMode=!!$.objectMode,q)this.objectMode=this.objectMode||!!$.readableObjectMode;var{highWaterMark:V,readableHighWaterMark:Y}=$,X=this.objectMode?16:16384;if(V||V===0)this.highWaterMark=V;else if(q&&(Y||Y===0))this.highWaterMark=Y;else this.highWaterMark=X;if(this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new $3,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=$.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,$.encoding){if(!_0)_0=X5().StringDecoder;this.decoder=new _0($.encoding),this.encoding=$.encoding}}function f($){if(I$=I$||P0(),!(this instanceof f))return new f($);if(this._readableState=new ZV($,this),this.readable=!0,$){if(typeof $.read==="function")this._read=$.read;if(typeof $.destroy==="function")this._destroy=$.destroy}j5.call(this)}Object.defineProperty(f.prototype,"destroyed",{get:function(){if(this._readableState===void 0)return!1;return this._readableState.destroyed},set:function($){if(!this._readableState)return;this._readableState.destroyed=$}});f.prototype.destroy=jV.destroy;f.prototype._undestroy=jV.undestroy;f.prototype._destroy=function($,Q){this.push(null),Q($)};f.prototype.push=function($,Q){var q=this._readableState,V;if(!q.objectMode){if(typeof $==="string"){if(Q=Q||q.defaultEncoding,Q!==q.encoding)$=C$.from($,Q),Q="";V=!0}}else V=!0;return zV(this,$,Q,!1,V)};f.prototype.unshift=function($){return zV(this,$,null,!0,!1)};function zV($,Q,q,V,Y){var X=$._readableState;if(Q===null)X.reading=!1,Y3($,X);else{var J;if(!Y)J=q3(X,Q);if(J)$.emit("error",J);else if(X.objectMode||Q&&Q.length>0){if(typeof Q!=="string"&&!X.objectMode&&Object.getPrototypeOf(Q)!==C$.prototype)Q=tX(Q);if(V)if(X.endEmitted)$.emit("error",Error("stream.unshift() after end event"));else W5($,X,Q,!0);else if(X.ended)$.emit("error",Error("stream.push() after EOF"));else if(X.reading=!1,X.decoder&&!q)if(Q=X.decoder.write(Q),X.objectMode||Q.length!==0)W5($,X,Q,!1);else HV($,X);else W5($,X,Q,!1)}else if(!V)X.reading=!1}return V3(X)}function W5($,Q,q,V){if(Q.flowing&&Q.length===0&&!Q.sync)$.emit("data",q),$.read(0);else{if(Q.length+=Q.objectMode?1:q.length,V)Q.buffer.unshift(q);else Q.buffer.push(q);if(Q.needReadable)R6($)}HV($,Q)}function q3($,Q){var q;if(!eX(Q)&&typeof Q!=="string"&&Q!==void 0&&!$.objectMode)q=TypeError("Invalid non-string/buffer chunk");return q}function V3($){return!$.ended&&($.needReadable||$.length<$.highWaterMark||$.length===0)}f.prototype.isPaused=function(){return this._readableState.flowing===!1};f.prototype.setEncoding=function($){if(!_0)_0=X5().StringDecoder;return this._readableState.decoder=new _0($),this._readableState.encoding=$,this};var XV=8388608;function J3($){if($>=XV)$=XV;else $--,$|=$>>>1,$|=$>>>2,$|=$>>>4,$|=$>>>8,$|=$>>>16,$++;return $}function GV($,Q){if($<=0||Q.length===0&&Q.ended)return 0;if(Q.objectMode)return 1;if($!==$)if(Q.flowing&&Q.length)return Q.buffer.head.data.length;else return Q.length;if($>Q.highWaterMark)Q.highWaterMark=J3($);if($<=Q.length)return $;if(!Q.ended)return Q.needReadable=!0,0;return Q.length}f.prototype.read=function($){y("read",$),$=parseInt($,10);var Q=this._readableState,q=$;if($!==0)Q.emittedReadable=!1;if($===0&&Q.needReadable&&(Q.length>=Q.highWaterMark||Q.ended)){if(y("read: emitReadable",Q.length,Q.ended),Q.length===0&&Q.ended)U5(this);else R6(this);return null}if($=GV($,Q),$===0&&Q.ended){if(Q.length===0)U5(this);return null}var V=Q.needReadable;if(y("need readable",V),Q.length===0||Q.length-$<Q.highWaterMark)V=!0,y("length less than watermark",V);if(Q.ended||Q.reading)V=!1,y("reading or ended",V);else if(V){if(y("do read"),Q.reading=!0,Q.sync=!0,Q.length===0)Q.needReadable=!0;if(this._read(Q.highWaterMark),Q.sync=!1,!Q.reading)$=GV(q,Q)}var Y;if($>0)Y=LV($,Q);else Y=null;if(Y===null)Q.needReadable=!0,$=0;else Q.length-=$;if(Q.length===0){if(!Q.ended)Q.needReadable=!0;if(q!==$&&Q.ended)U5(this)}if(Y!==null)this.emit("data",Y);return Y};function Y3($,Q){if(Q.ended)return;if(Q.decoder){var q=Q.decoder.end();if(q&&q.length)Q.buffer.push(q),Q.length+=Q.objectMode?1:q.length}Q.ended=!0,R6($)}function R6($){var Q=$._readableState;if(Q.needReadable=!1,!Q.emittedReadable)if(y("emitReadable",Q.flowing),Q.emittedReadable=!0,Q.sync)b0.nextTick(KV,$);else KV($)}function KV($){y("emit readable"),$.emit("readable"),Z5($)}function HV($,Q){if(!Q.readingMore)Q.readingMore=!0,b0.nextTick(X3,$,Q)}function X3($,Q){var q=Q.length;while(!Q.reading&&!Q.flowing&&!Q.ended&&Q.length<Q.highWaterMark)if(y("maybeReadMore read 0"),$.read(0),q===Q.length)break;else q=Q.length;Q.readingMore=!1}f.prototype._read=function($){this.emit("error",Error("_read() is not implemented"))};f.prototype.pipe=function($,Q){var q=this,V=this._readableState;switch(V.pipesCount){case 0:V.pipes=$;break;case 1:V.pipes=[V.pipes,$];break;default:V.pipes.push($);break}V.pipesCount+=1,y("pipe count=%d opts=%j",V.pipesCount,Q);var Y=(!Q||Q.end!==!1)&&$!==process.stdout&&$!==process.stderr,X=Y?G:w;if(V.endEmitted)b0.nextTick(X);else q.once("end",X);$.on("unpipe",J);function J(P,L){if(y("onunpipe"),P===q){if(L&&L.hasUnpiped===!1)L.hasUnpiped=!0,W()}}function G(){y("onend"),$.end()}var U=G3(q);$.on("drain",U);var K=!1;function W(){if(y("cleanup"),$.removeListener("close",I),$.removeListener("finish",N),$.removeListener("drain",U),$.removeListener("error",H),$.removeListener("unpipe",J),q.removeListener("end",G),q.removeListener("end",w),q.removeListener("data",z),K=!0,V.awaitDrain&&(!$._writableState||$._writableState.needDrain))U()}var Z=!1;q.on("data",z);function z(P){y("ondata"),Z=!1;var L=$.write(P);if(L===!1&&!Z){if((V.pipesCount===1&&V.pipes===$||V.pipesCount>1&&PV(V.pipes,$)!==-1)&&!K)y("false write response, pause",V.awaitDrain),V.awaitDrain++,Z=!0;q.pause()}}function H(P){if(y("onerror",P),w(),$.removeListener("error",H),WV($,"error")===0)$.emit("error",P)}Q3($,"error",H);function I(){$.removeListener("finish",N),w()}$.once("close",I);function N(){y("onfinish"),$.removeListener("close",I),w()}$.once("finish",N);function w(){y("unpipe"),q.unpipe($)}if($.emit("pipe",q),!V.flowing)y("pipe resume"),q.resume();return $};function G3($){return function(){var Q=$._readableState;if(y("pipeOnDrain",Q.awaitDrain),Q.awaitDrain)Q.awaitDrain--;if(Q.awaitDrain===0&&WV($,"data"))Q.flowing=!0,Z5($)}}f.prototype.unpipe=function($){var Q=this._readableState,q={hasUnpiped:!1};if(Q.pipesCount===0)return this;if(Q.pipesCount===1){if($&&$!==Q.pipes)return this;if(!$)$=Q.pipes;if(Q.pipes=null,Q.pipesCount=0,Q.flowing=!1,$)$.emit("unpipe",this,q);return this}if(!$){var{pipes:V,pipesCount:Y}=Q;Q.pipes=null,Q.pipesCount=0,Q.flowing=!1;for(var X=0;X<Y;X++)V[X].emit("unpipe",this,{hasUnpiped:!1});return this}var J=PV(Q.pipes,$);if(J===-1)return this;if(Q.pipes.splice(J,1),Q.pipesCount-=1,Q.pipesCount===1)Q.pipes=Q.pipes[0];return $.emit("unpipe",this,q),this};f.prototype.on=function($,Q){var q=j5.prototype.on.call(this,$,Q);if($==="data"){if(this._readableState.flowing!==!1)this.resume()}else if($==="readable"){var V=this._readableState;if(!V.endEmitted&&!V.readableListening){if(V.readableListening=V.needReadable=!0,V.emittedReadable=!1,!V.reading)b0.nextTick(K3,this);else if(V.length)R6(this)}}return q};f.prototype.addListener=f.prototype.on;function K3($){y("readable nexttick read 0"),$.read(0)}f.prototype.resume=function(){var $=this._readableState;if(!$.flowing)y("resume"),$.flowing=!0,W3(this,$);return this};function W3($,Q){if(!Q.resumeScheduled)Q.resumeScheduled=!0,b0.nextTick(U3,$,Q)}function U3($,Q){if(!Q.reading)y("resume read 0"),$.read(0);if(Q.resumeScheduled=!1,Q.awaitDrain=0,$.emit("resume"),Z5($),Q.flowing&&!Q.reading)$.read(0)}f.prototype.pause=function(){if(y("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)y("pause"),this._readableState.flowing=!1,this.emit("pause");return this};function Z5($){var Q=$._readableState;y("flow",Q.flowing);while(Q.flowing&&$.read()!==null);}f.prototype.wrap=function($){var Q=this,q=this._readableState,V=!1;$.on("end",function(){if(y("wrapped end"),q.decoder&&!q.ended){var J=q.decoder.end();if(J&&J.length)Q.push(J)}Q.push(null)}),$.on("data",function(J){if(y("wrapped data"),q.decoder)J=q.decoder.write(J);if(q.objectMode&&(J===null||J===void 0))return;else if(!q.objectMode&&(!J||!J.length))return;var G=Q.push(J);if(!G)V=!0,$.pause()});for(var Y in $)if(this[Y]===void 0&&typeof $[Y]==="function")this[Y]=function(J){return function(){return $[J].apply($,arguments)}}(Y);for(var X=0;X<K5.length;X++)$.on(K5[X],this.emit.bind(this,K5[X]));return this._read=function(J){if(y("wrapped _read",J),V)V=!1,$.resume()},this};Object.defineProperty(f.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});f._fromList=LV;function LV($,Q){if(Q.length===0)return null;var q;if(Q.objectMode)q=Q.buffer.shift();else if(!$||$>=Q.length){if(Q.decoder)q=Q.buffer.join("");else if(Q.buffer.length===1)q=Q.buffer.head.data;else q=Q.buffer.concat(Q.length);Q.buffer.clear()}else q=j3($,Q.buffer,Q.decoder);return q}function j3($,Q,q){var V;if($<Q.head.data.length)V=Q.head.data.slice(0,$),Q.head.data=Q.head.data.slice($);else if($===Q.head.data.length)V=Q.shift();else V=q?Z3($,Q):z3($,Q);return V}function Z3($,Q){var q=Q.head,V=1,Y=q.data;$-=Y.length;while(q=q.next){var X=q.data,J=$>X.length?X.length:$;if(J===X.length)Y+=X;else Y+=X.slice(0,$);if($-=J,$===0){if(J===X.length)if(++V,q.next)Q.head=q.next;else Q.head=Q.tail=null;else Q.head=q,q.data=X.slice(J);break}++V}return Q.length-=V,Y}function z3($,Q){var q=C$.allocUnsafe($),V=Q.head,Y=1;V.data.copy(q),$-=V.data.length;while(V=V.next){var X=V.data,J=$>X.length?X.length:$;if(X.copy(q,q.length-$,0,J),$-=J,$===0){if(J===X.length)if(++Y,V.next)Q.head=V.next;else Q.head=Q.tail=null;else Q.head=V,V.data=X.slice(J);break}++Y}return Q.length-=Y,q}function U5($){var Q=$._readableState;if(Q.length>0)throw Error('"endReadable()" called on non-empty stream');if(!Q.endEmitted)Q.ended=!0,b0.nextTick(H3,Q,$)}function H3($,Q){if(!$.endEmitted&&$.length===0)$.endEmitted=!0,Q.readable=!1,Q.emit("end")}function PV($,Q){for(var q=0,V=$.length;q<V;q++)if($[q]===Q)return q;return-1}});var z5=T((uH,NV)=>{NV.exports=i1;var v6=P0(),BV=Object.create(g0());BV.inherits=D0();BV.inherits(i1,v6);function L3($,Q){var q=this._transformState;q.transforming=!1;var V=q.writecb;if(!V)return this.emit("error",Error("write callback called multiple times"));if(q.writechunk=null,q.writecb=null,Q!=null)this.push(Q);V($);var Y=this._readableState;if(Y.reading=!1,Y.needReadable||Y.length<Y.highWaterMark)this._read(Y.highWaterMark)}function i1($){if(!(this instanceof i1))return new i1($);if(v6.call(this,$),this._transformState={afterTransform:L3.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,$){if(typeof $.transform==="function")this._transform=$.transform;if(typeof $.flush==="function")this._flush=$.flush}this.on("prefinish",P3)}function P3(){var $=this;if(typeof this._flush==="function")this._flush(function(Q,q){MV($,Q,q)});else MV(this,null,null)}i1.prototype.push=function($,Q){return this._transformState.needTransform=!1,v6.prototype.push.call(this,$,Q)};i1.prototype._transform=function($,Q,q){throw Error("_transform() is not implemented")};i1.prototype._write=function($,Q,q){var V=this._transformState;if(V.writecb=q,V.writechunk=$,V.writeencoding=Q,!V.transforming){var Y=this._readableState;if(V.needTransform||Y.needReadable||Y.length<Y.highWaterMark)this._read(Y.highWaterMark)}};i1.prototype._read=function($){var Q=this._transformState;if(Q.writechunk!==null&&Q.writecb&&!Q.transforming)Q.transforming=!0,this._transform(Q.writechunk,Q.writeencoding,Q.afterTransform);else Q.needTransform=!0};i1.prototype._destroy=function($,Q){var q=this;v6.prototype._destroy.call(this,$,function(V){Q(V),q.emit("close")})};function MV($,Q,q){if(Q)return $.emit("error",Q);if(q!=null)$.push(q);if($._writableState.length)throw Error("Calling transform done when ws.length != 0");if($._transformState.transforming)throw Error("Calling transform done when still transforming");return $.push(null)}});var TV=T((dH,wV)=>{wV.exports=w$;var IV=z5(),CV=Object.create(g0());CV.inherits=D0();CV.inherits(w$,IV);function w$($){if(!(this instanceof w$))return new w$($);IV.call(this,$)}w$.prototype._transform=function($,Q,q){q(null,$)}});var H5=T((s,x6)=>{var E1=b("stream");if(process.env.READABLE_STREAM==="disable"&&E1)x6.exports=E1,s=x6.exports=E1.Readable,s.Readable=E1.Readable,s.Writable=E1.Writable,s.Duplex=E1.Duplex,s.Transform=E1.Transform,s.PassThrough=E1.PassThrough,s.Stream=E1;else s=x6.exports=V5(),s.Stream=E1||s,s.Readable=s,s.Writable=Q5(),s.Duplex=P0(),s.Transform=z5(),s.PassThrough=TV()});var n1=T((M3)=>{M3.base64=!0;M3.array=!0;M3.string=!0;M3.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u";M3.nodebuffer=typeof Buffer<"u";M3.uint8array=typeof Uint8Array<"u";if(typeof ArrayBuffer>"u")M3.blob=!1;else{S6=new ArrayBuffer(0);try{M3.blob=new Blob([S6],{type:"application/zip"}).size===0}catch($){try{P5=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,E6=new P5,E6.append(S6),M3.blob=E6.getBlob("application/zip").size===0}catch(Q){M3.blob=!1}}}var S6,P5,E6;try{M3.nodestream=!!H5().Readable}catch($){M3.nodestream=!1}});var O5=T((R3)=>{var A3=p(),F3=n1(),y1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";R3.encode=function($){var Q=[],q,V,Y,X,J,G,U,K=0,W=$.length,Z=W,z=A3.getTypeOf($)!=="string";while(K<$.length){if(Z=W-K,!z)q=$.charCodeAt(K++),V=K<W?$.charCodeAt(K++):0,Y=K<W?$.charCodeAt(K++):0;else q=$[K++],V=K<W?$[K++]:0,Y=K<W?$[K++]:0;X=q>>2,J=(q&3)<<4|V>>4,G=Z>1?(V&15)<<2|Y>>6:64,U=Z>2?Y&63:64,Q.push(y1.charAt(X)+y1.charAt(J)+y1.charAt(G)+y1.charAt(U))}return Q.join("")};R3.decode=function($){var Q,q,V,Y,X,J,G,U=0,K=0,W="data:";if($.substr(0,W.length)===W)throw Error("Invalid base64 input, it looks like a data url.");$=$.replace(/[^A-Za-z0-9+/=]/g,"");var Z=$.length*3/4;if($.charAt($.length-1)===y1.charAt(64))Z--;if($.charAt($.length-2)===y1.charAt(64))Z--;if(Z%1!==0)throw Error("Invalid base64 input, bad content length.");var z;if(F3.uint8array)z=new Uint8Array(Z|0);else z=Array(Z|0);while(U<$.length){if(Y=y1.indexOf($.charAt(U++)),X=y1.indexOf($.charAt(U++)),J=y1.indexOf($.charAt(U++)),G=y1.indexOf($.charAt(U++)),Q=Y<<2|X>>4,q=(X&15)<<4|J>>2,V=(J&3)<<6|G,z[K++]=Q,J!==64)z[K++]=q;if(G!==64)z[K++]=V}return z}});var T$=T((iH,AV)=>{AV.exports={isNode:typeof Buffer<"u",newBufferFrom:function($,Q){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from($,Q);else{if(typeof $==="number")throw Error('The "data" argument must not be a number');return new Buffer($,Q)}},allocBuffer:function($){if(Buffer.alloc)return Buffer.alloc($);else{var Q=new Buffer($);return Q.fill(0),Q}},isBuffer:function($){return Buffer.isBuffer($)},isStream:function($){return $&&typeof $.on==="function"&&typeof $.pause==="function"&&typeof $.resume==="function"}}});var vV=T((rH,RV)=>{var nH=global.MutationObserver||global.WebKitMutationObserver,FV;FV=function(){process.nextTick(g3)};var S3,E3,y3,k3,M5,A$=[];function g3(){M5=!0;var $,Q,q=A$.length;while(q){Q=A$,A$=[],$=-1;while(++$<q)Q[$]();q=A$.length}M5=!1}RV.exports=D3;function D3($){if(A$.push($)===1&&!M5)FV()}});var DV=T((aH,gV)=>{var xV=vV();function m0(){}var Q1={},SV=["REJECTED"],B5=["FULFILLED"],EV=["PENDING"];f0=["UNHANDLED"];var f0;gV.exports=V0;function V0($){if(typeof $!=="function")throw TypeError("resolver must be a function");if(this.state=EV,this.queue=[],this.outcome=void 0,this.handled=f0,$!==m0)yV(this,$)}V0.prototype.finally=function($){if(typeof $!=="function")return this;var Q=this.constructor;return this.then(q,V);function q(Y){function X(){return Y}return Q.resolve($()).then(X)}function V(Y){function X(){throw Y}return Q.resolve($()).then(X)}};V0.prototype.catch=function($){return this.then(null,$)};V0.prototype.then=function($,Q){if(typeof $!=="function"&&this.state===B5||typeof Q!=="function"&&this.state===SV)return this;var q=new this.constructor(m0);if(this.handled===f0)this.handled=null;if(this.state!==EV){var V=this.state===B5?$:Q;N5(q,V,this.outcome)}else this.queue.push(new F$(q,$,Q));return q};function F$($,Q,q){if(this.promise=$,typeof Q==="function")this.onFulfilled=Q,this.callFulfilled=this.otherCallFulfilled;if(typeof q==="function")this.onRejected=q,this.callRejected=this.otherCallRejected}F$.prototype.callFulfilled=function($){Q1.resolve(this.promise,$)};F$.prototype.otherCallFulfilled=function($){N5(this.promise,this.onFulfilled,$)};F$.prototype.callRejected=function($){Q1.reject(this.promise,$)};F$.prototype.otherCallRejected=function($){N5(this.promise,this.onRejected,$)};function N5($,Q,q){xV(function(){var V;try{V=Q(q)}catch(Y){return Q1.reject($,Y)}if(V===$)Q1.reject($,TypeError("Cannot resolve promise with itself"));else Q1.resolve($,V)})}Q1.resolve=function($,Q){var q=kV(h3,Q);if(q.status==="error")return Q1.reject($,q.value);var V=q.value;if(V)yV($,V);else{$.state=B5,$.outcome=Q;var Y=-1,X=$.queue.length;while(++Y<X)$.queue[Y].callFulfilled(Q)}return $};Q1.reject=function($,Q){if($.state=SV,$.outcome=Q,$.handled===f0)xV(function(){if($.handled===f0)process.emit("unhandledRejection",Q,$)});var q=-1,V=$.queue.length;while(++q<V)$.queue[q].callRejected(Q);return $};function h3($){var Q=$&&$.then;if($&&(typeof $==="object"||typeof $==="function")&&typeof Q==="function")return function(){Q.apply($,arguments)}}function yV($,Q){var q=!1;function V(G){if(q)return;q=!0,Q1.reject($,G)}function Y(G){if(q)return;q=!0,Q1.resolve($,G)}function X(){Q(Y,V)}var J=kV(X);if(J.status==="error")V(J.value)}function kV($,Q){var q={};try{q.value=$(Q),q.status="success"}catch(V){q.status="error",q.value=V}return q}V0.resolve=_3;function _3($){if($ instanceof this)return $;return Q1.resolve(new this(m0),$)}V0.reject=b3;function b3($){var Q=new this(m0);return Q1.reject(Q,$)}V0.all=f3;function f3($){var Q=this;if(Object.prototype.toString.call($)!=="[object Array]")return this.reject(TypeError("must be an array"));var q=$.length,V=!1;if(!q)return this.resolve([]);var Y=Array(q),X=0,J=-1,G=new this(m0);while(++J<q)U($[J],J);return G;function U(K,W){Q.resolve(K).then(Z,function(z){if(!V)V=!0,Q1.reject(G,z)});function Z(z){if(Y[W]=z,++X===q&&!V)V=!0,Q1.resolve(G,Y)}}}V0.race=m3;function m3($){var Q=this;if(Object.prototype.toString.call($)!=="[object Array]")return this.reject(TypeError("must be an array"));var q=$.length,V=!1;if(!q)return this.resolve([]);var Y=-1,X=new this(m0);while(++Y<q)J($[Y]);return X;function J(G){Q.resolve(G).then(function(U){if(!V)V=!0,Q1.resolve(X,U)},function(U){if(!V)V=!0,Q1.reject(X,U)})}}});var c0=T((sH,hV)=>{var I5=null;if(typeof Promise<"u")I5=Promise;else I5=DV();hV.exports={Promise:I5}});var bV=T((_V)=>{(function($,Q){if($.setImmediate)return;var q=1,V={},Y=!1,X=$.document,J;function G(L){if(typeof L!=="function")L=Function(""+L);var C=Array(arguments.length-1);for(var O=0;O<C.length;O++)C[O]=arguments[O+1];var M={callback:L,args:C};return V[q]=M,J(q),q++}function U(L){delete V[L]}function K(L){var{callback:C,args:O}=L;switch(O.length){case 0:C();break;case 1:C(O[0]);break;case 2:C(O[0],O[1]);break;case 3:C(O[0],O[1],O[2]);break;default:C.apply(Q,O);break}}function W(L){if(Y)setTimeout(W,0,L);else{var C=V[L];if(C){Y=!0;try{K(C)}finally{U(L),Y=!1}}}}function Z(){J=function(L){process.nextTick(function(){W(L)})}}function z(){if($.postMessage&&!$.importScripts){var L=!0,C=$.onmessage;return $.onmessage=function(){L=!1},$.postMessage("","*"),$.onmessage=C,L}}function H(){var L="setImmediate$"+Math.random()+"$",C=function(O){if(O.source===$&&typeof O.data==="string"&&O.data.indexOf(L)===0)W(+O.data.slice(L.length))};if($.addEventListener)$.addEventListener("message",C,!1);else $.attachEvent("onmessage",C);J=function(O){$.postMessage(L+O,"*")}}function I(){var L=new MessageChannel;L.port1.onmessage=function(C){var O=C.data;W(O)},J=function(C){L.port2.postMessage(C)}}function N(){var L=X.documentElement;J=function(C){var O=X.createElement("script");O.onreadystatechange=function(){W(C),O.onreadystatechange=null,L.removeChild(O),O=null},L.appendChild(O)}}function w(){J=function(L){setTimeout(W,0,L)}}var P=Object.getPrototypeOf&&Object.getPrototypeOf($);if(P=P&&P.setTimeout?P:$,{}.toString.call($.process)==="[object process]")Z();else if(z())H();else if($.MessageChannel)I();else if(X&&"onreadystatechange"in X.createElement("script"))N();else w();P.setImmediate=G,P.clearImmediate=U})(typeof self>"u"?typeof global>"u"?_V:global:self)});var p=T((u3)=>{var J0=n1(),c3=O5(),p0=T$(),C5=c0();bV();function p3($){var Q=null;if(J0.uint8array)Q=new Uint8Array($.length);else Q=Array($.length);return k6($,Q)}u3.newBlob=function($,Q){u3.checkSupport("blob");try{return new Blob([$],{type:Q})}catch(Y){try{var q=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,V=new q;return V.append($),V.getBlob(Q)}catch(X){throw Error("Bug : can't construct the Blob.")}}};function R$($){return $}function k6($,Q){for(var q=0;q<$.length;++q)Q[q]=$.charCodeAt(q)&255;return Q}var y6={stringifyByChunk:function($,Q,q){var V=[],Y=0,X=$.length;if(X<=q)return String.fromCharCode.apply(null,$);while(Y<X){if(Q==="array"||Q==="nodebuffer")V.push(String.fromCharCode.apply(null,$.slice(Y,Math.min(Y+q,X))));else V.push(String.fromCharCode.apply(null,$.subarray(Y,Math.min(Y+q,X))));Y+=q}return V.join("")},stringifyByChar:function($){var Q="";for(var q=0;q<$.length;q++)Q+=String.fromCharCode($[q]);return Q},applyCanBeUsed:{uint8array:function(){try{return J0.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch($){return!1}}(),nodebuffer:function(){try{return J0.nodebuffer&&String.fromCharCode.apply(null,p0.allocBuffer(1)).length===1}catch($){return!1}}()}};function v$($){var Q=65536,q=u3.getTypeOf($),V=!0;if(q==="uint8array")V=y6.applyCanBeUsed.uint8array;else if(q==="nodebuffer")V=y6.applyCanBeUsed.nodebuffer;if(V)while(Q>1)try{return y6.stringifyByChunk($,q,Q)}catch(Y){Q=Math.floor(Q/2)}return y6.stringifyByChar($)}u3.applyFromCharCode=v$;function g6($,Q){for(var q=0;q<$.length;q++)Q[q]=$[q];return Q}var Y0={};Y0.string={string:R$,array:function($){return k6($,Array($.length))},arraybuffer:function($){return Y0.string.uint8array($).buffer},uint8array:function($){return k6($,new Uint8Array($.length))},nodebuffer:function($){return k6($,p0.allocBuffer($.length))}};Y0.array={string:v$,array:R$,arraybuffer:function($){return new Uint8Array($).buffer},uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return p0.newBufferFrom($)}};Y0.arraybuffer={string:function($){return v$(new Uint8Array($))},array:function($){return g6(new Uint8Array($),Array($.byteLength))},arraybuffer:R$,uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return p0.newBufferFrom(new Uint8Array($))}};Y0.uint8array={string:v$,array:function($){return g6($,Array($.length))},arraybuffer:function($){return $.buffer},uint8array:R$,nodebuffer:function($){return p0.newBufferFrom($)}};Y0.nodebuffer={string:v$,array:function($){return g6($,Array($.length))},arraybuffer:function($){return Y0.nodebuffer.uint8array($).buffer},uint8array:function($){return g6($,new Uint8Array($.length))},nodebuffer:R$};u3.transformTo=function($,Q){if(!Q)Q="";if(!$)return Q;u3.checkSupport($);var q=u3.getTypeOf(Q),V=Y0[q][$](Q);return V};u3.resolve=function($){var Q=$.split("/"),q=[];for(var V=0;V<Q.length;V++){var Y=Q[V];if(Y==="."||Y===""&&V!==0&&V!==Q.length-1)continue;else if(Y==="..")q.pop();else q.push(Y)}return q.join("/")};u3.getTypeOf=function($){if(typeof $==="string")return"string";if(Object.prototype.toString.call($)==="[object Array]")return"array";if(J0.nodebuffer&&p0.isBuffer($))return"nodebuffer";if(J0.uint8array&&$ instanceof Uint8Array)return"uint8array";if(J0.arraybuffer&&$ instanceof ArrayBuffer)return"arraybuffer"};u3.checkSupport=function($){var Q=J0[$.toLowerCase()];if(!Q)throw Error($+" is not supported by this platform")};u3.MAX_VALUE_16BITS=65535;u3.MAX_VALUE_32BITS=-1;u3.pretty=function($){var Q="",q,V;for(V=0;V<($||"").length;V++)q=$.charCodeAt(V),Q+="\\x"+(q<16?"0":"")+q.toString(16).toUpperCase();return Q};u3.delay=function($,Q,q){setImmediate(function(){$.apply(q||null,Q||[])})};u3.inherits=function($,Q){var q=function(){};q.prototype=Q.prototype,$.prototype=new q};u3.extend=function(){var $={},Q,q;for(Q=0;Q<arguments.length;Q++)for(q in arguments[Q])if(Object.prototype.hasOwnProperty.call(arguments[Q],q)&&typeof $[q]>"u")$[q]=arguments[Q][q];return $};u3.prepareContent=function($,Q,q,V,Y){var X=C5.Promise.resolve(Q).then(function(J){var G=J0.blob&&(J instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(J))!==-1);if(G&&typeof FileReader<"u")return new C5.Promise(function(U,K){var W=new FileReader;W.onload=function(Z){U(Z.target.result)},W.onerror=function(Z){K(Z.target.error)},W.readAsArrayBuffer(J)});else return J});return X.then(function(J){var G=u3.getTypeOf(J);if(!G)return C5.Promise.reject(Error("Can't read the data of '"+$+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));if(G==="arraybuffer")J=u3.transformTo("uint8array",J);else if(G==="string"){if(Y)J=c3.decode(J);else if(q){if(V!==!0)J=p3(J)}}return J})}});var j1=T(($L,pV)=>{function cV($){this.name=$||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}cV.prototype={push:function($){this.emit("data",$)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch($){this.emit("error",$)}return!0},error:function($){if(this.isFinished)return!1;if(this.isPaused)this.generatedError=$;else{if(this.isFinished=!0,this.emit("error",$),this.previous)this.previous.error($);this.cleanUp()}return!0},on:function($,Q){return this._listeners[$].push(Q),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function($,Q){if(this._listeners[$])for(var q=0;q<this._listeners[$].length;q++)this._listeners[$][q].call(this,Q)},pipe:function($){return $.registerPrevious(this)},registerPrevious:function($){if(this.isLocked)throw Error("The stream '"+this+"' has already been used.");this.streamInfo=$.streamInfo,this.mergeStreamInfo(),this.previous=$;var Q=this;return $.on("data",function(q){Q.processChunk(q)}),$.on("end",function(){Q.end()}),$.on("error",function(q){Q.error(q)}),this},pause:function(){if(this.isPaused||this.isFinished)return!1;if(this.isPaused=!0,this.previous)this.previous.pause();return!0},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var $=!1;if(this.generatedError)this.error(this.generatedError),$=!0;if(this.previous)this.previous.resume();return!$},flush:function(){},processChunk:function($){this.push($)},withStreamInfo:function($,Q){return this.extraStreamInfo[$]=Q,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var $ in this.extraStreamInfo){if(!Object.prototype.hasOwnProperty.call(this.extraStreamInfo,$))continue;this.streamInfo[$]=this.extraStreamInfo[$]}},lock:function(){if(this.isLocked)throw Error("The stream '"+this+"' has already been used.");if(this.isLocked=!0,this.previous)this.previous.lock()},toString:function(){var $="Worker "+this.name;if(this.previous)return this.previous+" -> "+$;else return $}};pV.exports=cV});var d0=T((JG)=>{var u0=p(),O0=n1(),$G=T$(),D6=j1(),x$=Array(256);for(k1=0;k1<256;k1++)x$[k1]=k1>=252?6:k1>=248?5:k1>=240?4:k1>=224?3:k1>=192?2:1;var k1;x$[254]=x$[254]=1;var QG=function($){var Q,q,V,Y,X,J=$.length,G=0;for(Y=0;Y<J;Y++){if(q=$.charCodeAt(Y),(q&64512)===55296&&Y+1<J){if(V=$.charCodeAt(Y+1),(V&64512)===56320)q=65536+(q-55296<<10)+(V-56320),Y++}G+=q<128?1:q<2048?2:q<65536?3:4}if(O0.uint8array)Q=new Uint8Array(G);else Q=Array(G);for(X=0,Y=0;X<G;Y++){if(q=$.charCodeAt(Y),(q&64512)===55296&&Y+1<J){if(V=$.charCodeAt(Y+1),(V&64512)===56320)q=65536+(q-55296<<10)+(V-56320),Y++}if(q<128)Q[X++]=q;else if(q<2048)Q[X++]=192|q>>>6,Q[X++]=128|q&63;else if(q<65536)Q[X++]=224|q>>>12,Q[X++]=128|q>>>6&63,Q[X++]=128|q&63;else Q[X++]=240|q>>>18,Q[X++]=128|q>>>12&63,Q[X++]=128|q>>>6&63,Q[X++]=128|q&63}return Q},qG=function($,Q){var q;if(Q=Q||$.length,Q>$.length)Q=$.length;q=Q-1;while(q>=0&&($[q]&192)===128)q--;if(q<0)return Q;if(q===0)return Q;return q+x$[$[q]]>Q?q:Q},VG=function($){var Q,q,V,Y,X=$.length,J=Array(X*2);for(q=0,Q=0;Q<X;){if(V=$[Q++],V<128){J[q++]=V;continue}if(Y=x$[V],Y>4){J[q++]=65533,Q+=Y-1;continue}V&=Y===2?31:Y===3?15:7;while(Y>1&&Q<X)V=V<<6|$[Q++]&63,Y--;if(Y>1){J[q++]=65533;continue}if(V<65536)J[q++]=V;else V-=65536,J[q++]=55296|V>>10&1023,J[q++]=56320|V&1023}if(J.length!==q)if(J.subarray)J=J.subarray(0,q);else J.length=q;return u0.applyFromCharCode(J)};JG.utf8encode=function(Q){if(O0.nodebuffer)return $G.newBufferFrom(Q,"utf-8");return QG(Q)};JG.utf8decode=function(Q){if(O0.nodebuffer)return u0.transformTo("nodebuffer",Q).toString("utf-8");return Q=u0.transformTo(O0.uint8array?"uint8array":"array",Q),VG(Q)};function h6(){D6.call(this,"utf-8 decode"),this.leftOver=null}u0.inherits(h6,D6);h6.prototype.processChunk=function($){var Q=u0.transformTo(O0.uint8array?"uint8array":"array",$.data);if(this.leftOver&&this.leftOver.length){if(O0.uint8array){var q=Q;Q=new Uint8Array(q.length+this.leftOver.length),Q.set(this.leftOver,0),Q.set(q,this.leftOver.length)}else Q=this.leftOver.concat(Q);this.leftOver=null}var V=qG(Q),Y=Q;if(V!==Q.length)if(O0.uint8array)Y=Q.subarray(0,V),this.leftOver=Q.subarray(V,Q.length);else Y=Q.slice(0,V),this.leftOver=Q.slice(V,Q.length);this.push({data:JG.utf8decode(Y),meta:$.meta})};h6.prototype.flush=function(){if(this.leftOver&&this.leftOver.length)this.push({data:JG.utf8decode(this.leftOver),meta:{}}),this.leftOver=null};JG.Utf8DecodeWorker=h6;function T5(){D6.call(this,"utf-8 encode")}u0.inherits(T5,D6);T5.prototype.processChunk=function($){this.push({data:JG.utf8encode($.data),meta:$.meta})};JG.Utf8EncodeWorker=T5});var iV=T((qL,oV)=>{var dV=j1(),lV=p();function F5($){dV.call(this,"ConvertWorker to "+$),this.destType=$}lV.inherits(F5,dV);F5.prototype.processChunk=function($){this.push({data:lV.transformTo(this.destType,$.data),meta:$.meta})};oV.exports=F5});var aV=T((VL,rV)=>{var nV=H5().Readable,GG=p();GG.inherits(R5,nV);function R5($,Q,q){nV.call(this,Q),this._helper=$;var V=this;$.on("data",function(Y,X){if(!V.push(Y))V._helper.pause();if(q)q(X)}).on("error",function(Y){V.emit("error",Y)}).on("end",function(){V.push(null)})}R5.prototype._read=function(){this._helper.resume()};rV.exports=R5});var v5=T((JL,eV)=>{var M0=p(),KG=iV(),WG=j1(),UG=O5(),jG=n1(),ZG=c0(),sV=null;if(jG.nodestream)try{sV=aV()}catch($){}function zG($,Q,q){switch($){case"blob":return M0.newBlob(M0.transformTo("arraybuffer",Q),q);case"base64":return UG.encode(Q);default:return M0.transformTo($,Q)}}function HG($,Q){var q,V=0,Y=null,X=0;for(q=0;q<Q.length;q++)X+=Q[q].length;switch($){case"string":return Q.join("");case"array":return Array.prototype.concat.apply([],Q);case"uint8array":Y=new Uint8Array(X);for(q=0;q<Q.length;q++)Y.set(Q[q],V),V+=Q[q].length;return Y;case"nodebuffer":return Buffer.concat(Q);default:throw Error("concat : unsupported type '"+$+"'")}}function LG($,Q){return new ZG.Promise(function(q,V){var Y=[],X=$._internalType,J=$._outputType,G=$._mimeType;$.on("data",function(U,K){if(Y.push(U),Q)Q(K)}).on("error",function(U){Y=[],V(U)}).on("end",function(){try{var U=zG(J,HG(X,Y),G);q(U)}catch(K){V(K)}Y=[]}).resume()})}function tV($,Q,q){var V=Q;switch(Q){case"blob":case"arraybuffer":V="uint8array";break;case"base64":V="string";break}try{this._internalType=V,this._outputType=Q,this._mimeType=q,M0.checkSupport(V),this._worker=$.pipe(new KG(V)),$.lock()}catch(Y){this._worker=new WG("error"),this._worker.error(Y)}}tV.prototype={accumulate:function($){return LG(this,$)},on:function($,Q){var q=this;if($==="data")this._worker.on($,function(V){Q.call(q,V.data,V.meta)});else this._worker.on($,function(){M0.delay(Q,arguments,q)});return this},resume:function(){return M0.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function($){if(M0.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw Error(this._outputType+" is not supported by this method");return new sV(this,{objectMode:this._outputType!=="nodebuffer"},$)}};eV.exports=tV});var x5=T((PG)=>{PG.base64=!1;PG.binary=!1;PG.dir=!1;PG.createFolders=!0;PG.date=null;PG.compression=null;PG.compressionOptions=null;PG.comment=null;PG.unixPermissions=null;PG.dosPermissions=null});var S5=T((XL,$9)=>{var _6=p(),b6=j1(),RG=16384;function l0($){b6.call(this,"DataWorker");var Q=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,$.then(function(q){if(Q.dataIsReady=!0,Q.data=q,Q.max=q&&q.length||0,Q.type=_6.getTypeOf(q),!Q.isPaused)Q._tickAndRepeat()},function(q){Q.error(q)})}_6.inherits(l0,b6);l0.prototype.cleanUp=function(){b6.prototype.cleanUp.call(this),this.data=null};l0.prototype.resume=function(){if(!b6.prototype.resume.call(this))return!1;if(!this._tickScheduled&&this.dataIsReady)this._tickScheduled=!0,_6.delay(this._tickAndRepeat,[],this);return!0};l0.prototype._tickAndRepeat=function(){if(this._tickScheduled=!1,this.isPaused||this.isFinished)return;if(this._tick(),!this.isFinished)_6.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0};l0.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var $=RG,Q=null,q=Math.min(this.max,this.index+$);if(this.index>=this.max)return this.end();else{switch(this.type){case"string":Q=this.data.substring(this.index,q);break;case"uint8array":Q=this.data.subarray(this.index,q);break;case"array":case"nodebuffer":Q=this.data.slice(this.index,q);break}return this.index=q,this.push({data:Q,meta:{percent:this.max?this.index/this.max*100:0}})}};$9.exports=l0});var f6=T((GL,q9)=>{var vG=p();function xG(){var $,Q=[];for(var q=0;q<256;q++){$=q;for(var V=0;V<8;V++)$=$&1?3988292384^$>>>1:$>>>1;Q[q]=$}return Q}var Q9=xG();function SG($,Q,q,V){var Y=Q9,X=V+q;$=$^-1;for(var J=V;J<X;J++)$=$>>>8^Y[($^Q[J])&255];return $^-1}function EG($,Q,q,V){var Y=Q9,X=V+q;$=$^-1;for(var J=V;J<X;J++)$=$>>>8^Y[($^Q.charCodeAt(J))&255];return $^-1}q9.exports=function(Q,q){if(typeof Q>"u"||!Q.length)return 0;var V=vG.getTypeOf(Q)!=="string";if(V)return SG(q|0,Q,Q.length,0);else return EG(q|0,Q,Q.length,0)}});var y5=T((KL,J9)=>{var V9=j1(),yG=f6(),kG=p();function E5(){V9.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}kG.inherits(E5,V9);E5.prototype.processChunk=function($){this.streamInfo.crc32=yG($.data,this.streamInfo.crc32||0),this.push($)};J9.exports=E5});var X9=T((WL,Y9)=>{var gG=p(),k5=j1();function g5($){k5.call(this,"DataLengthProbe for "+$),this.propName=$,this.withStreamInfo($,0)}gG.inherits(g5,k5);g5.prototype.processChunk=function($){if($){var Q=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=Q+$.data.length}k5.prototype.processChunk.call(this,$)};Y9.exports=g5});var m6=T((UL,W9)=>{var G9=c0(),K9=S5(),DG=y5(),D5=X9();function h5($,Q,q,V,Y){this.compressedSize=$,this.uncompressedSize=Q,this.crc32=q,this.compression=V,this.compressedContent=Y}h5.prototype={getContentWorker:function(){var $=new K9(G9.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new D5("data_length")),Q=this;return $.on("end",function(){if(this.streamInfo.data_length!==Q.uncompressedSize)throw Error("Bug : uncompressed data size mismatch")}),$},getCompressedWorker:function(){return new K9(G9.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}};h5.createWorkerFrom=function($,Q,q){return $.pipe(new DG).pipe(new D5("uncompressedSize")).pipe(Q.compressWorker(q)).pipe(new D5("compressedSize")).withStreamInfo("compression",Q)};W9.exports=h5});var z9=T((jL,Z9)=>{var hG=v5(),_G=S5(),_5=d0(),b5=m6(),U9=j1(),f5=function($,Q,q){this.name=$,this.dir=q.dir,this.date=q.date,this.comment=q.comment,this.unixPermissions=q.unixPermissions,this.dosPermissions=q.dosPermissions,this._data=Q,this._dataBinary=q.binary,this.options={compression:q.compression,compressionOptions:q.compressionOptions}};f5.prototype={internalStream:function($){var Q=null,q="string";try{if(!$)throw Error("No output type specified.");q=$.toLowerCase();var V=q==="string"||q==="text";if(q==="binarystring"||q==="text")q="string";Q=this._decompressWorker();var Y=!this._dataBinary;if(Y&&!V)Q=Q.pipe(new _5.Utf8EncodeWorker);if(!Y&&V)Q=Q.pipe(new _5.Utf8DecodeWorker)}catch(X){Q=new U9("error"),Q.error(X)}return new hG(Q,q,"")},async:function($,Q){return this.internalStream($).accumulate(Q)},nodeStream:function($,Q){return this.internalStream($||"nodebuffer").toNodejsStream(Q)},_compressWorker:function($,Q){if(this._data instanceof b5&&this._data.compression.magic===$.magic)return this._data.getCompressedWorker();else{var q=this._decompressWorker();if(!this._dataBinary)q=q.pipe(new _5.Utf8EncodeWorker);return b5.createWorkerFrom(q,$,Q)}},_decompressWorker:function(){if(this._data instanceof b5)return this._data.getContentWorker();else if(this._data instanceof U9)return this._data;else return new _G(this._data)}};var j9=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],bG=function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(S$=0;S$<j9.length;S$++)f5.prototype[j9[S$]]=bG;var S$;Z9.exports=f5});var r1=T((m5)=>{var pG=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function uG($,Q){return Object.prototype.hasOwnProperty.call($,Q)}m5.assign=function($){var Q=Array.prototype.slice.call(arguments,1);while(Q.length){var q=Q.shift();if(!q)continue;if(typeof q!=="object")throw TypeError(q+"must be non-object");for(var V in q)if(uG(q,V))$[V]=q[V]}return $};m5.shrinkBuf=function($,Q){if($.length===Q)return $;if($.subarray)return $.subarray(0,Q);return $.length=Q,$};var dG={arraySet:function($,Q,q,V,Y){if(Q.subarray&&$.subarray){$.set(Q.subarray(q,q+V),Y);return}for(var X=0;X<V;X++)$[Y+X]=Q[q+X]},flattenChunks:function($){var Q,q,V,Y,X,J;V=0;for(Q=0,q=$.length;Q<q;Q++)V+=$[Q].length;J=new Uint8Array(V),Y=0;for(Q=0,q=$.length;Q<q;Q++)X=$[Q],J.set(X,Y),Y+=X.length;return J}},lG={arraySet:function($,Q,q,V,Y){for(var X=0;X<V;X++)$[Y+X]=Q[q+X]},flattenChunks:function($){return[].concat.apply([],$)}};m5.setTyped=function($){if($)m5.Buf8=Uint8Array,m5.Buf16=Uint16Array,m5.Buf32=Int32Array,m5.assign(m5,dG);else m5.Buf8=Array,m5.Buf16=Array,m5.Buf32=Array,m5.assign(m5,lG)};m5.setTyped(pG)});var _9=T((HK)=>{var iG=r1(),nG=4,L9=0,P9=1,rG=2;function i0($){var Q=$.length;while(--Q>=0)$[Q]=0}var aG=0,C9=1,sG=2,tG=3,eG=258,n5=29,h$=256,y$=h$+1+n5,o0=30,r5=19,w9=2*y$+1,B0=15,p5=16,$K=7,a5=256,T9=16,A9=17,F9=18,o5=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],c6=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],QK=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],R9=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],qK=512,a1=Array((y$+2)*2);i0(a1);var E$=Array(o0*2);i0(E$);var k$=Array(qK);i0(k$);var g$=Array(eG-tG+1);i0(g$);var s5=Array(n5);i0(s5);var p6=Array(o0);i0(p6);function u5($,Q,q,V,Y){this.static_tree=$,this.extra_bits=Q,this.extra_base=q,this.elems=V,this.max_length=Y,this.has_stree=$&&$.length}var v9,x9,S9;function d5($,Q){this.dyn_tree=$,this.max_code=0,this.stat_desc=Q}function E9($){return $<256?k$[$]:k$[256+($>>>7)]}function D$($,Q){$.pending_buf[$.pending++]=Q&255,$.pending_buf[$.pending++]=Q>>>8&255}function X1($,Q,q){if($.bi_valid>p5-q)$.bi_buf|=Q<<$.bi_valid&65535,D$($,$.bi_buf),$.bi_buf=Q>>p5-$.bi_valid,$.bi_valid+=q-p5;else $.bi_buf|=Q<<$.bi_valid&65535,$.bi_valid+=q}function g1($,Q,q){X1($,q[Q*2],q[Q*2+1])}function y9($,Q){var q=0;do q|=$&1,$>>>=1,q<<=1;while(--Q>0);return q>>>1}function VK($){if($.bi_valid===16)D$($,$.bi_buf),$.bi_buf=0,$.bi_valid=0;else if($.bi_valid>=8)$.pending_buf[$.pending++]=$.bi_buf&255,$.bi_buf>>=8,$.bi_valid-=8}function JK($,Q){var{dyn_tree:q,max_code:V}=Q,Y=Q.stat_desc.static_tree,X=Q.stat_desc.has_stree,J=Q.stat_desc.extra_bits,G=Q.stat_desc.extra_base,U=Q.stat_desc.max_length,K,W,Z,z,H,I,N=0;for(z=0;z<=B0;z++)$.bl_count[z]=0;q[$.heap[$.heap_max]*2+1]=0;for(K=$.heap_max+1;K<w9;K++){if(W=$.heap[K],z=q[q[W*2+1]*2+1]+1,z>U)z=U,N++;if(q[W*2+1]=z,W>V)continue;if($.bl_count[z]++,H=0,W>=G)H=J[W-G];if(I=q[W*2],$.opt_len+=I*(z+H),X)$.static_len+=I*(Y[W*2+1]+H)}if(N===0)return;do{z=U-1;while($.bl_count[z]===0)z--;$.bl_count[z]--,$.bl_count[z+1]+=2,$.bl_count[U]--,N-=2}while(N>0);for(z=U;z!==0;z--){W=$.bl_count[z];while(W!==0){if(Z=$.heap[--K],Z>V)continue;if(q[Z*2+1]!==z)$.opt_len+=(z-q[Z*2+1])*q[Z*2],q[Z*2+1]=z;W--}}}function k9($,Q,q){var V=Array(B0+1),Y=0,X,J;for(X=1;X<=B0;X++)V[X]=Y=Y+q[X-1]<<1;for(J=0;J<=Q;J++){var G=$[J*2+1];if(G===0)continue;$[J*2]=y9(V[G]++,G)}}function YK(){var $,Q,q,V,Y,X=Array(B0+1);q=0;for(V=0;V<n5-1;V++){s5[V]=q;for($=0;$<1<<o5[V];$++)g$[q++]=V}g$[q-1]=V,Y=0;for(V=0;V<16;V++){p6[V]=Y;for($=0;$<1<<c6[V];$++)k$[Y++]=V}Y>>=7;for(;V<o0;V++){p6[V]=Y<<7;for($=0;$<1<<c6[V]-7;$++)k$[256+Y++]=V}for(Q=0;Q<=B0;Q++)X[Q]=0;$=0;while($<=143)a1[$*2+1]=8,$++,X[8]++;while($<=255)a1[$*2+1]=9,$++,X[9]++;while($<=279)a1[$*2+1]=7,$++,X[7]++;while($<=287)a1[$*2+1]=8,$++,X[8]++;k9(a1,y$+1,X);for($=0;$<o0;$++)E$[$*2+1]=5,E$[$*2]=y9($,5);v9=new u5(a1,o5,h$+1,y$,B0),x9=new u5(E$,c6,0,o0,B0),S9=new u5([],QK,0,r5,$K)}function g9($){var Q;for(Q=0;Q<y$;Q++)$.dyn_ltree[Q*2]=0;for(Q=0;Q<o0;Q++)$.dyn_dtree[Q*2]=0;for(Q=0;Q<r5;Q++)$.bl_tree[Q*2]=0;$.dyn_ltree[a5*2]=1,$.opt_len=$.static_len=0,$.last_lit=$.matches=0}function D9($){if($.bi_valid>8)D$($,$.bi_buf);else if($.bi_valid>0)$.pending_buf[$.pending++]=$.bi_buf;$.bi_buf=0,$.bi_valid=0}function XK($,Q,q,V){if(D9($),V)D$($,q),D$($,~q);iG.arraySet($.pending_buf,$.window,Q,q,$.pending),$.pending+=q}function O9($,Q,q,V){var Y=Q*2,X=q*2;return $[Y]<$[X]||$[Y]===$[X]&&V[Q]<=V[q]}function l5($,Q,q){var V=$.heap[q],Y=q<<1;while(Y<=$.heap_len){if(Y<$.heap_len&&O9(Q,$.heap[Y+1],$.heap[Y],$.depth))Y++;if(O9(Q,V,$.heap[Y],$.depth))break;$.heap[q]=$.heap[Y],q=Y,Y<<=1}$.heap[q]=V}function M9($,Q,q){var V,Y,X=0,J,G;if($.last_lit!==0)do if(V=$.pending_buf[$.d_buf+X*2]<<8|$.pending_buf[$.d_buf+X*2+1],Y=$.pending_buf[$.l_buf+X],X++,V===0)g1($,Y,Q);else{if(J=g$[Y],g1($,J+h$+1,Q),G=o5[J],G!==0)Y-=s5[J],X1($,Y,G);if(V--,J=E9(V),g1($,J,q),G=c6[J],G!==0)V-=p6[J],X1($,V,G)}while(X<$.last_lit);g1($,a5,Q)}function i5($,Q){var q=Q.dyn_tree,V=Q.stat_desc.static_tree,Y=Q.stat_desc.has_stree,X=Q.stat_desc.elems,J,G,U=-1,K;$.heap_len=0,$.heap_max=w9;for(J=0;J<X;J++)if(q[J*2]!==0)$.heap[++$.heap_len]=U=J,$.depth[J]=0;else q[J*2+1]=0;while($.heap_len<2)if(K=$.heap[++$.heap_len]=U<2?++U:0,q[K*2]=1,$.depth[K]=0,$.opt_len--,Y)$.static_len-=V[K*2+1];Q.max_code=U;for(J=$.heap_len>>1;J>=1;J--)l5($,q,J);K=X;do J=$.heap[1],$.heap[1]=$.heap[$.heap_len--],l5($,q,1),G=$.heap[1],$.heap[--$.heap_max]=J,$.heap[--$.heap_max]=G,q[K*2]=q[J*2]+q[G*2],$.depth[K]=($.depth[J]>=$.depth[G]?$.depth[J]:$.depth[G])+1,q[J*2+1]=q[G*2+1]=K,$.heap[1]=K++,l5($,q,1);while($.heap_len>=2);$.heap[--$.heap_max]=$.heap[1],JK($,Q),k9(q,U,$.bl_count)}function B9($,Q,q){var V,Y=-1,X,J=Q[1],G=0,U=7,K=4;if(J===0)U=138,K=3;Q[(q+1)*2+1]=65535;for(V=0;V<=q;V++){if(X=J,J=Q[(V+1)*2+1],++G<U&&X===J)continue;else if(G<K)$.bl_tree[X*2]+=G;else if(X!==0){if(X!==Y)$.bl_tree[X*2]++;$.bl_tree[T9*2]++}else if(G<=10)$.bl_tree[A9*2]++;else $.bl_tree[F9*2]++;if(G=0,Y=X,J===0)U=138,K=3;else if(X===J)U=6,K=3;else U=7,K=4}}function N9($,Q,q){var V,Y=-1,X,J=Q[1],G=0,U=7,K=4;if(J===0)U=138,K=3;for(V=0;V<=q;V++){if(X=J,J=Q[(V+1)*2+1],++G<U&&X===J)continue;else if(G<K)do g1($,X,$.bl_tree);while(--G!==0);else if(X!==0){if(X!==Y)g1($,X,$.bl_tree),G--;g1($,T9,$.bl_tree),X1($,G-3,2)}else if(G<=10)g1($,A9,$.bl_tree),X1($,G-3,3);else g1($,F9,$.bl_tree),X1($,G-11,7);if(G=0,Y=X,J===0)U=138,K=3;else if(X===J)U=6,K=3;else U=7,K=4}}function GK($){var Q;B9($,$.dyn_ltree,$.l_desc.max_code),B9($,$.dyn_dtree,$.d_desc.max_code),i5($,$.bl_desc);for(Q=r5-1;Q>=3;Q--)if($.bl_tree[R9[Q]*2+1]!==0)break;return $.opt_len+=3*(Q+1)+5+5+4,Q}function KK($,Q,q,V){var Y;X1($,Q-257,5),X1($,q-1,5),X1($,V-4,4);for(Y=0;Y<V;Y++)X1($,$.bl_tree[R9[Y]*2+1],3);N9($,$.dyn_ltree,Q-1),N9($,$.dyn_dtree,q-1)}function WK($){var Q=4093624447,q;for(q=0;q<=31;q++,Q>>>=1)if(Q&1&&$.dyn_ltree[q*2]!==0)return L9;if($.dyn_ltree[18]!==0||$.dyn_ltree[20]!==0||$.dyn_ltree[26]!==0)return P9;for(q=32;q<h$;q++)if($.dyn_ltree[q*2]!==0)return P9;return L9}var I9=!1;function UK($){if(!I9)YK(),I9=!0;$.l_desc=new d5($.dyn_ltree,v9),$.d_desc=new d5($.dyn_dtree,x9),$.bl_desc=new d5($.bl_tree,S9),$.bi_buf=0,$.bi_valid=0,g9($)}function h9($,Q,q,V){X1($,(aG<<1)+(V?1:0),3),XK($,Q,q,!0)}function jK($){X1($,C9<<1,3),g1($,a5,a1),VK($)}function ZK($,Q,q,V){var Y,X,J=0;if($.level>0){if($.strm.data_type===rG)$.strm.data_type=WK($);if(i5($,$.l_desc),i5($,$.d_desc),J=GK($),Y=$.opt_len+3+7>>>3,X=$.static_len+3+7>>>3,X<=Y)Y=X}else Y=X=q+5;if(q+4<=Y&&Q!==-1)h9($,Q,q,V);else if($.strategy===nG||X===Y)X1($,(C9<<1)+(V?1:0),3),M9($,a1,E$);else X1($,(sG<<1)+(V?1:0),3),KK($,$.l_desc.max_code+1,$.d_desc.max_code+1,J+1),M9($,$.dyn_ltree,$.dyn_dtree);if(g9($),V)D9($)}function zK($,Q,q){if($.pending_buf[$.d_buf+$.last_lit*2]=Q>>>8&255,$.pending_buf[$.d_buf+$.last_lit*2+1]=Q&255,$.pending_buf[$.l_buf+$.last_lit]=q&255,$.last_lit++,Q===0)$.dyn_ltree[q*2]++;else $.matches++,Q--,$.dyn_ltree[(g$[q]+h$+1)*2]++,$.dyn_dtree[E9(Q)*2]++;return $.last_lit===$.lit_bufsize-1}HK._tr_init=UK;HK._tr_stored_block=h9;HK._tr_flush_block=ZK;HK._tr_tally=zK;HK._tr_align=jK});var t5=T((HL,b9)=>{function NK($,Q,q,V){var Y=$&65535|0,X=$>>>16&65535|0,J=0;while(q!==0){J=q>2000?2000:q,q-=J;do Y=Y+Q[V++]|0,X=X+Y|0;while(--J);Y%=65521,X%=65521}return Y|X<<16|0}b9.exports=NK});var e5=T((LL,f9)=>{function IK(){var $,Q=[];for(var q=0;q<256;q++){$=q;for(var V=0;V<8;V++)$=$&1?3988292384^$>>>1:$>>>1;Q[q]=$}return Q}var CK=IK();function wK($,Q,q,V){var Y=CK,X=V+q;$^=-1;for(var J=V;J<X;J++)$=$>>>8^Y[($^Q[J])&255];return $^-1}f9.exports=wK});var u6=T((PL,m9)=>{m9.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var r9=T((qW)=>{var V1=r1(),L1=_9(),d9=t5(),X0=e5(),TK=u6(),w0=0,AK=1,FK=3,j0=4,c9=5,h1=0,p9=1,P1=-2,RK=-3,$Q=-5,vK=-1,xK=1,d6=2,SK=3,EK=4,yK=0,kK=2,n6=8,gK=9,DK=15,hK=8,_K=29,bK=256,qQ=bK+1+_K,fK=30,mK=19,cK=2*qQ+1,pK=15,S=3,W0=258,R1=W0+S+1,uK=32,r6=42,VQ=69,l6=73,o6=91,i6=103,N0=113,b$=666,n=1,f$=2,I0=3,a0=4,dK=3;function U0($,Q){return $.msg=TK[Q],Q}function u9($){return($<<1)-($>4?9:0)}function K0($){var Q=$.length;while(--Q>=0)$[Q]=0}function G0($){var Q=$.state,q=Q.pending;if(q>$.avail_out)q=$.avail_out;if(q===0)return;if(V1.arraySet($.output,Q.pending_buf,Q.pending_out,q,$.next_out),$.next_out+=q,Q.pending_out+=q,$.total_out+=q,$.avail_out-=q,Q.pending-=q,Q.pending===0)Q.pending_out=0}function t($,Q){L1._tr_flush_block($,$.block_start>=0?$.block_start:-1,$.strstart-$.block_start,Q),$.block_start=$.strstart,G0($.strm)}function E($,Q){$.pending_buf[$.pending++]=Q}function _$($,Q){$.pending_buf[$.pending++]=Q>>>8&255,$.pending_buf[$.pending++]=Q&255}function lK($,Q,q,V){var Y=$.avail_in;if(Y>V)Y=V;if(Y===0)return 0;if($.avail_in-=Y,V1.arraySet(Q,$.input,$.next_in,Y,q),$.state.wrap===1)$.adler=d9($.adler,Q,Y,q);else if($.state.wrap===2)$.adler=X0($.adler,Q,Y,q);return $.next_in+=Y,$.total_in+=Y,Y}function l9($,Q){var{max_chain_length:q,strstart:V}=$,Y,X,J=$.prev_length,G=$.nice_match,U=$.strstart>$.w_size-R1?$.strstart-($.w_size-R1):0,K=$.window,W=$.w_mask,Z=$.prev,z=$.strstart+W0,H=K[V+J-1],I=K[V+J];if($.prev_length>=$.good_match)q>>=2;if(G>$.lookahead)G=$.lookahead;do{if(Y=Q,K[Y+J]!==I||K[Y+J-1]!==H||K[Y]!==K[V]||K[++Y]!==K[V+1])continue;V+=2,Y++;do;while(K[++V]===K[++Y]&&K[++V]===K[++Y]&&K[++V]===K[++Y]&&K[++V]===K[++Y]&&K[++V]===K[++Y]&&K[++V]===K[++Y]&&K[++V]===K[++Y]&&K[++V]===K[++Y]&&V<z);if(X=W0-(z-V),V=z-W0,X>J){if($.match_start=Q,J=X,X>=G)break;H=K[V+J-1],I=K[V+J]}}while((Q=Z[Q&W])>U&&--q!==0);if(J<=$.lookahead)return J;return $.lookahead}function C0($){var Q=$.w_size,q,V,Y,X,J;do{if(X=$.window_size-$.lookahead-$.strstart,$.strstart>=Q+(Q-R1)){V1.arraySet($.window,$.window,Q,Q,0),$.match_start-=Q,$.strstart-=Q,$.block_start-=Q,V=$.hash_size,q=V;do Y=$.head[--q],$.head[q]=Y>=Q?Y-Q:0;while(--V);V=Q,q=V;do Y=$.prev[--q],$.prev[q]=Y>=Q?Y-Q:0;while(--V);X+=Q}if($.strm.avail_in===0)break;if(V=lK($.strm,$.window,$.strstart+$.lookahead,X),$.lookahead+=V,$.lookahead+$.insert>=S){J=$.strstart-$.insert,$.ins_h=$.window[J],$.ins_h=($.ins_h<<$.hash_shift^$.window[J+1])&$.hash_mask;while($.insert)if($.ins_h=($.ins_h<<$.hash_shift^$.window[J+S-1])&$.hash_mask,$.prev[J&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=J,J++,$.insert--,$.lookahead+$.insert<S)break}}while($.lookahead<R1&&$.strm.avail_in!==0)}function oK($,Q){var q=65535;if(q>$.pending_buf_size-5)q=$.pending_buf_size-5;for(;;){if($.lookahead<=1){if(C0($),$.lookahead===0&&Q===w0)return n;if($.lookahead===0)break}$.strstart+=$.lookahead,$.lookahead=0;var V=$.block_start+q;if($.strstart===0||$.strstart>=V){if($.lookahead=$.strstart-V,$.strstart=V,t($,!1),$.strm.avail_out===0)return n}if($.strstart-$.block_start>=$.w_size-R1){if(t($,!1),$.strm.avail_out===0)return n}}if($.insert=0,Q===j0){if(t($,!0),$.strm.avail_out===0)return I0;return a0}if($.strstart>$.block_start){if(t($,!1),$.strm.avail_out===0)return n}return n}function QQ($,Q){var q,V;for(;;){if($.lookahead<R1){if(C0($),$.lookahead<R1&&Q===w0)return n;if($.lookahead===0)break}if(q=0,$.lookahead>=S)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+S-1])&$.hash_mask,q=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if(q!==0&&$.strstart-q<=$.w_size-R1)$.match_length=l9($,q);if($.match_length>=S)if(V=L1._tr_tally($,$.strstart-$.match_start,$.match_length-S),$.lookahead-=$.match_length,$.match_length<=$.max_lazy_match&&$.lookahead>=S){$.match_length--;do $.strstart++,$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+S-1])&$.hash_mask,q=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.match_length!==0);$.strstart++}else $.strstart+=$.match_length,$.match_length=0,$.ins_h=$.window[$.strstart],$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+1])&$.hash_mask;else V=L1._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(V){if(t($,!1),$.strm.avail_out===0)return n}}if($.insert=$.strstart<S-1?$.strstart:S-1,Q===j0){if(t($,!0),$.strm.avail_out===0)return I0;return a0}if($.last_lit){if(t($,!1),$.strm.avail_out===0)return n}return f$}function n0($,Q){var q,V,Y;for(;;){if($.lookahead<R1){if(C0($),$.lookahead<R1&&Q===w0)return n;if($.lookahead===0)break}if(q=0,$.lookahead>=S)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+S-1])&$.hash_mask,q=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if($.prev_length=$.match_length,$.prev_match=$.match_start,$.match_length=S-1,q!==0&&$.prev_length<$.max_lazy_match&&$.strstart-q<=$.w_size-R1){if($.match_length=l9($,q),$.match_length<=5&&($.strategy===xK||$.match_length===S&&$.strstart-$.match_start>4096))$.match_length=S-1}if($.prev_length>=S&&$.match_length<=$.prev_length){Y=$.strstart+$.lookahead-S,V=L1._tr_tally($,$.strstart-1-$.prev_match,$.prev_length-S),$.lookahead-=$.prev_length-1,$.prev_length-=2;do if(++$.strstart<=Y)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+S-1])&$.hash_mask,q=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.prev_length!==0);if($.match_available=0,$.match_length=S-1,$.strstart++,V){if(t($,!1),$.strm.avail_out===0)return n}}else if($.match_available){if(V=L1._tr_tally($,0,$.window[$.strstart-1]),V)t($,!1);if($.strstart++,$.lookahead--,$.strm.avail_out===0)return n}else $.match_available=1,$.strstart++,$.lookahead--}if($.match_available)V=L1._tr_tally($,0,$.window[$.strstart-1]),$.match_available=0;if($.insert=$.strstart<S-1?$.strstart:S-1,Q===j0){if(t($,!0),$.strm.avail_out===0)return I0;return a0}if($.last_lit){if(t($,!1),$.strm.avail_out===0)return n}return f$}function iK($,Q){var q,V,Y,X,J=$.window;for(;;){if($.lookahead<=W0){if(C0($),$.lookahead<=W0&&Q===w0)return n;if($.lookahead===0)break}if($.match_length=0,$.lookahead>=S&&$.strstart>0){if(Y=$.strstart-1,V=J[Y],V===J[++Y]&&V===J[++Y]&&V===J[++Y]){X=$.strstart+W0;do;while(V===J[++Y]&&V===J[++Y]&&V===J[++Y]&&V===J[++Y]&&V===J[++Y]&&V===J[++Y]&&V===J[++Y]&&V===J[++Y]&&Y<X);if($.match_length=W0-(X-Y),$.match_length>$.lookahead)$.match_length=$.lookahead}}if($.match_length>=S)q=L1._tr_tally($,1,$.match_length-S),$.lookahead-=$.match_length,$.strstart+=$.match_length,$.match_length=0;else q=L1._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(q){if(t($,!1),$.strm.avail_out===0)return n}}if($.insert=0,Q===j0){if(t($,!0),$.strm.avail_out===0)return I0;return a0}if($.last_lit){if(t($,!1),$.strm.avail_out===0)return n}return f$}function nK($,Q){var q;for(;;){if($.lookahead===0){if(C0($),$.lookahead===0){if(Q===w0)return n;break}}if($.match_length=0,q=L1._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++,q){if(t($,!1),$.strm.avail_out===0)return n}}if($.insert=0,Q===j0){if(t($,!0),$.strm.avail_out===0)return I0;return a0}if($.last_lit){if(t($,!1),$.strm.avail_out===0)return n}return f$}function D1($,Q,q,V,Y){this.good_length=$,this.max_lazy=Q,this.nice_length=q,this.max_chain=V,this.func=Y}var r0;r0=[new D1(0,0,0,0,oK),new D1(4,4,8,4,QQ),new D1(4,5,16,8,QQ),new D1(4,6,32,32,QQ),new D1(4,4,16,16,n0),new D1(8,16,32,32,n0),new D1(8,16,128,128,n0),new D1(8,32,128,256,n0),new D1(32,128,258,1024,n0),new D1(32,258,258,4096,n0)];function rK($){$.window_size=2*$.w_size,K0($.head),$.max_lazy_match=r0[$.level].max_lazy,$.good_match=r0[$.level].good_length,$.nice_match=r0[$.level].nice_length,$.max_chain_length=r0[$.level].max_chain,$.strstart=0,$.block_start=0,$.lookahead=0,$.insert=0,$.match_length=$.prev_length=S-1,$.match_available=0,$.ins_h=0}function aK(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=n6,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new V1.Buf16(cK*2),this.dyn_dtree=new V1.Buf16((2*fK+1)*2),this.bl_tree=new V1.Buf16((2*mK+1)*2),K0(this.dyn_ltree),K0(this.dyn_dtree),K0(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new V1.Buf16(pK+1),this.heap=new V1.Buf16(2*qQ+1),K0(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new V1.Buf16(2*qQ+1),K0(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function o9($){var Q;if(!$||!$.state)return U0($,P1);if($.total_in=$.total_out=0,$.data_type=kK,Q=$.state,Q.pending=0,Q.pending_out=0,Q.wrap<0)Q.wrap=-Q.wrap;return Q.status=Q.wrap?r6:N0,$.adler=Q.wrap===2?0:1,Q.last_flush=w0,L1._tr_init(Q),h1}function i9($){var Q=o9($);if(Q===h1)rK($.state);return Q}function sK($,Q){if(!$||!$.state)return P1;if($.state.wrap!==2)return P1;return $.state.gzhead=Q,h1}function n9($,Q,q,V,Y,X){if(!$)return P1;var J=1;if(Q===vK)Q=6;if(V<0)J=0,V=-V;else if(V>15)J=2,V-=16;if(Y<1||Y>gK||q!==n6||V<8||V>15||Q<0||Q>9||X<0||X>EK)return U0($,P1);if(V===8)V=9;var G=new aK;return $.state=G,G.strm=$,G.wrap=J,G.gzhead=null,G.w_bits=V,G.w_size=1<<G.w_bits,G.w_mask=G.w_size-1,G.hash_bits=Y+7,G.hash_size=1<<G.hash_bits,G.hash_mask=G.hash_size-1,G.hash_shift=~~((G.hash_bits+S-1)/S),G.window=new V1.Buf8(G.w_size*2),G.head=new V1.Buf16(G.hash_size),G.prev=new V1.Buf16(G.w_size),G.lit_bufsize=1<<Y+6,G.pending_buf_size=G.lit_bufsize*4,G.pending_buf=new V1.Buf8(G.pending_buf_size),G.d_buf=1*G.lit_bufsize,G.l_buf=3*G.lit_bufsize,G.level=Q,G.strategy=X,G.method=q,i9($)}function tK($,Q){return n9($,Q,n6,DK,hK,yK)}function eK($,Q){var q,V,Y,X;if(!$||!$.state||Q>c9||Q<0)return $?U0($,P1):P1;if(V=$.state,!$.output||!$.input&&$.avail_in!==0||V.status===b$&&Q!==j0)return U0($,$.avail_out===0?$Q:P1);if(V.strm=$,q=V.last_flush,V.last_flush=Q,V.status===r6)if(V.wrap===2)if($.adler=0,E(V,31),E(V,139),E(V,8),!V.gzhead)E(V,0),E(V,0),E(V,0),E(V,0),E(V,0),E(V,V.level===9?2:V.strategy>=d6||V.level<2?4:0),E(V,dK),V.status=N0;else{if(E(V,(V.gzhead.text?1:0)+(V.gzhead.hcrc?2:0)+(!V.gzhead.extra?0:4)+(!V.gzhead.name?0:8)+(!V.gzhead.comment?0:16)),E(V,V.gzhead.time&255),E(V,V.gzhead.time>>8&255),E(V,V.gzhead.time>>16&255),E(V,V.gzhead.time>>24&255),E(V,V.level===9?2:V.strategy>=d6||V.level<2?4:0),E(V,V.gzhead.os&255),V.gzhead.extra&&V.gzhead.extra.length)E(V,V.gzhead.extra.length&255),E(V,V.gzhead.extra.length>>8&255);if(V.gzhead.hcrc)$.adler=X0($.adler,V.pending_buf,V.pending,0);V.gzindex=0,V.status=VQ}else{var J=n6+(V.w_bits-8<<4)<<8,G=-1;if(V.strategy>=d6||V.level<2)G=0;else if(V.level<6)G=1;else if(V.level===6)G=2;else G=3;if(J|=G<<6,V.strstart!==0)J|=uK;if(J+=31-J%31,V.status=N0,_$(V,J),V.strstart!==0)_$(V,$.adler>>>16),_$(V,$.adler&65535);$.adler=1}if(V.status===VQ)if(V.gzhead.extra){Y=V.pending;while(V.gzindex<(V.gzhead.extra.length&65535)){if(V.pending===V.pending_buf_size){if(V.gzhead.hcrc&&V.pending>Y)$.adler=X0($.adler,V.pending_buf,V.pending-Y,Y);if(G0($),Y=V.pending,V.pending===V.pending_buf_size)break}E(V,V.gzhead.extra[V.gzindex]&255),V.gzindex++}if(V.gzhead.hcrc&&V.pending>Y)$.adler=X0($.adler,V.pending_buf,V.pending-Y,Y);if(V.gzindex===V.gzhead.extra.length)V.gzindex=0,V.status=l6}else V.status=l6;if(V.status===l6)if(V.gzhead.name){Y=V.pending;do{if(V.pending===V.pending_buf_size){if(V.gzhead.hcrc&&V.pending>Y)$.adler=X0($.adler,V.pending_buf,V.pending-Y,Y);if(G0($),Y=V.pending,V.pending===V.pending_buf_size){X=1;break}}if(V.gzindex<V.gzhead.name.length)X=V.gzhead.name.charCodeAt(V.gzindex++)&255;else X=0;E(V,X)}while(X!==0);if(V.gzhead.hcrc&&V.pending>Y)$.adler=X0($.adler,V.pending_buf,V.pending-Y,Y);if(X===0)V.gzindex=0,V.status=o6}else V.status=o6;if(V.status===o6)if(V.gzhead.comment){Y=V.pending;do{if(V.pending===V.pending_buf_size){if(V.gzhead.hcrc&&V.pending>Y)$.adler=X0($.adler,V.pending_buf,V.pending-Y,Y);if(G0($),Y=V.pending,V.pending===V.pending_buf_size){X=1;break}}if(V.gzindex<V.gzhead.comment.length)X=V.gzhead.comment.charCodeAt(V.gzindex++)&255;else X=0;E(V,X)}while(X!==0);if(V.gzhead.hcrc&&V.pending>Y)$.adler=X0($.adler,V.pending_buf,V.pending-Y,Y);if(X===0)V.status=i6}else V.status=i6;if(V.status===i6)if(V.gzhead.hcrc){if(V.pending+2>V.pending_buf_size)G0($);if(V.pending+2<=V.pending_buf_size)E(V,$.adler&255),E(V,$.adler>>8&255),$.adler=0,V.status=N0}else V.status=N0;if(V.pending!==0){if(G0($),$.avail_out===0)return V.last_flush=-1,h1}else if($.avail_in===0&&u9(Q)<=u9(q)&&Q!==j0)return U0($,$Q);if(V.status===b$&&$.avail_in!==0)return U0($,$Q);if($.avail_in!==0||V.lookahead!==0||Q!==w0&&V.status!==b$){var U=V.strategy===d6?nK(V,Q):V.strategy===SK?iK(V,Q):r0[V.level].func(V,Q);if(U===I0||U===a0)V.status=b$;if(U===n||U===I0){if($.avail_out===0)V.last_flush=-1;return h1}if(U===f$){if(Q===AK)L1._tr_align(V);else if(Q!==c9){if(L1._tr_stored_block(V,0,0,!1),Q===FK){if(K0(V.head),V.lookahead===0)V.strstart=0,V.block_start=0,V.insert=0}}if(G0($),$.avail_out===0)return V.last_flush=-1,h1}}if(Q!==j0)return h1;if(V.wrap<=0)return p9;if(V.wrap===2)E(V,$.adler&255),E(V,$.adler>>8&255),E(V,$.adler>>16&255),E(V,$.adler>>24&255),E(V,$.total_in&255),E(V,$.total_in>>8&255),E(V,$.total_in>>16&255),E(V,$.total_in>>24&255);else _$(V,$.adler>>>16),_$(V,$.adler&65535);if(G0($),V.wrap>0)V.wrap=-V.wrap;return V.pending!==0?h1:p9}function $W($){var Q;if(!$||!$.state)return P1;if(Q=$.state.status,Q!==r6&&Q!==VQ&&Q!==l6&&Q!==o6&&Q!==i6&&Q!==N0&&Q!==b$)return U0($,P1);return $.state=null,Q===N0?U0($,RK):h1}function QW($,Q){var q=Q.length,V,Y,X,J,G,U,K,W;if(!$||!$.state)return P1;if(V=$.state,J=V.wrap,J===2||J===1&&V.status!==r6||V.lookahead)return P1;if(J===1)$.adler=d9($.adler,Q,q,0);if(V.wrap=0,q>=V.w_size){if(J===0)K0(V.head),V.strstart=0,V.block_start=0,V.insert=0;W=new V1.Buf8(V.w_size),V1.arraySet(W,Q,q-V.w_size,V.w_size,0),Q=W,q=V.w_size}G=$.avail_in,U=$.next_in,K=$.input,$.avail_in=q,$.next_in=0,$.input=Q,C0(V);while(V.lookahead>=S){Y=V.strstart,X=V.lookahead-(S-1);do V.ins_h=(V.ins_h<<V.hash_shift^V.window[Y+S-1])&V.hash_mask,V.prev[Y&V.w_mask]=V.head[V.ins_h],V.head[V.ins_h]=Y,Y++;while(--X);V.strstart=Y,V.lookahead=S-1,C0(V)}return V.strstart+=V.lookahead,V.block_start=V.strstart,V.insert=V.lookahead,V.lookahead=0,V.match_length=V.prev_length=S-1,V.match_available=0,$.next_in=U,$.input=K,$.avail_in=G,V.wrap=J,h1}qW.deflateInit=tK;qW.deflateInit2=n9;qW.deflateReset=i9;qW.deflateResetKeep=o9;qW.deflateSetHeader=sK;qW.deflate=eK;qW.deflateEnd=$W;qW.deflateSetDictionary=QW;qW.deflateInfo="pako deflate (from Nodeca project)"});var JQ=T((ZW)=>{var a6=r1(),a9=!0,s9=!0;try{String.fromCharCode.apply(null,[0])}catch($){a9=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch($){s9=!1}var m$=new a6.Buf8(256);for(_1=0;_1<256;_1++)m$[_1]=_1>=252?6:_1>=248?5:_1>=240?4:_1>=224?3:_1>=192?2:1;var _1;m$[254]=m$[254]=1;ZW.string2buf=function($){var Q,q,V,Y,X,J=$.length,G=0;for(Y=0;Y<J;Y++){if(q=$.charCodeAt(Y),(q&64512)===55296&&Y+1<J){if(V=$.charCodeAt(Y+1),(V&64512)===56320)q=65536+(q-55296<<10)+(V-56320),Y++}G+=q<128?1:q<2048?2:q<65536?3:4}Q=new a6.Buf8(G);for(X=0,Y=0;X<G;Y++){if(q=$.charCodeAt(Y),(q&64512)===55296&&Y+1<J){if(V=$.charCodeAt(Y+1),(V&64512)===56320)q=65536+(q-55296<<10)+(V-56320),Y++}if(q<128)Q[X++]=q;else if(q<2048)Q[X++]=192|q>>>6,Q[X++]=128|q&63;else if(q<65536)Q[X++]=224|q>>>12,Q[X++]=128|q>>>6&63,Q[X++]=128|q&63;else Q[X++]=240|q>>>18,Q[X++]=128|q>>>12&63,Q[X++]=128|q>>>6&63,Q[X++]=128|q&63}return Q};function t9($,Q){if(Q<65534){if($.subarray&&s9||!$.subarray&&a9)return String.fromCharCode.apply(null,a6.shrinkBuf($,Q))}var q="";for(var V=0;V<Q;V++)q+=String.fromCharCode($[V]);return q}ZW.buf2binstring=function($){return t9($,$.length)};ZW.binstring2buf=function($){var Q=new a6.Buf8($.length);for(var q=0,V=Q.length;q<V;q++)Q[q]=$.charCodeAt(q);return Q};ZW.buf2string=function($,Q){var q,V,Y,X,J=Q||$.length,G=Array(J*2);for(V=0,q=0;q<J;){if(Y=$[q++],Y<128){G[V++]=Y;continue}if(X=m$[Y],X>4){G[V++]=65533,q+=X-1;continue}Y&=X===2?31:X===3?15:7;while(X>1&&q<J)Y=Y<<6|$[q++]&63,X--;if(X>1){G[V++]=65533;continue}if(Y<65536)G[V++]=Y;else Y-=65536,G[V++]=55296|Y>>10&1023,G[V++]=56320|Y&1023}return t9(G,V)};ZW.utf8border=function($,Q){var q;if(Q=Q||$.length,Q>$.length)Q=$.length;q=Q-1;while(q>=0&&($[q]&192)===128)q--;if(q<0)return Q;if(q===0)return Q;return q+m$[$[q]]>Q?q:Q}});var YQ=T((BL,e9)=>{function MW(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}e9.exports=MW});var V2=T((FW)=>{var c$=r9(),p$=r1(),GQ=JQ(),KQ=u6(),BW=YQ(),q2=Object.prototype.toString,NW=0,XQ=4,s0=0,$2=1,Q2=2,IW=-1,CW=0,wW=8;function T0($){if(!(this instanceof T0))return new T0($);this.options=p$.assign({level:IW,method:wW,chunkSize:16384,windowBits:15,memLevel:8,strategy:CW,to:""},$||{});var Q=this.options;if(Q.raw&&Q.windowBits>0)Q.windowBits=-Q.windowBits;else if(Q.gzip&&Q.windowBits>0&&Q.windowBits<16)Q.windowBits+=16;this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new BW,this.strm.avail_out=0;var q=c$.deflateInit2(this.strm,Q.level,Q.method,Q.windowBits,Q.memLevel,Q.strategy);if(q!==s0)throw Error(KQ[q]);if(Q.header)c$.deflateSetHeader(this.strm,Q.header);if(Q.dictionary){var V;if(typeof Q.dictionary==="string")V=GQ.string2buf(Q.dictionary);else if(q2.call(Q.dictionary)==="[object ArrayBuffer]")V=new Uint8Array(Q.dictionary);else V=Q.dictionary;if(q=c$.deflateSetDictionary(this.strm,V),q!==s0)throw Error(KQ[q]);this._dict_set=!0}}T0.prototype.push=function($,Q){var q=this.strm,V=this.options.chunkSize,Y,X;if(this.ended)return!1;if(X=Q===~~Q?Q:Q===!0?XQ:NW,typeof $==="string")q.input=GQ.string2buf($);else if(q2.call($)==="[object ArrayBuffer]")q.input=new Uint8Array($);else q.input=$;q.next_in=0,q.avail_in=q.input.length;do{if(q.avail_out===0)q.output=new p$.Buf8(V),q.next_out=0,q.avail_out=V;if(Y=c$.deflate(q,X),Y!==$2&&Y!==s0)return this.onEnd(Y),this.ended=!0,!1;if(q.avail_out===0||q.avail_in===0&&(X===XQ||X===Q2))if(this.options.to==="string")this.onData(GQ.buf2binstring(p$.shrinkBuf(q.output,q.next_out)));else this.onData(p$.shrinkBuf(q.output,q.next_out))}while((q.avail_in>0||q.avail_out===0)&&Y!==$2);if(X===XQ)return Y=c$.deflateEnd(this.strm),this.onEnd(Y),this.ended=!0,Y===s0;if(X===Q2)return this.onEnd(s0),q.avail_out=0,!0;return!0};T0.prototype.onData=function($){this.chunks.push($)};T0.prototype.onEnd=function($){if($===s0)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=p$.flattenChunks(this.chunks);this.chunks=[],this.err=$,this.msg=this.strm.msg};function WQ($,Q){var q=new T0(Q);if(q.push($,!0),q.err)throw q.msg||KQ[q.err];return q.result}function TW($,Q){return Q=Q||{},Q.raw=!0,WQ($,Q)}function AW($,Q){return Q=Q||{},Q.gzip=!0,WQ($,Q)}FW.Deflate=T0;FW.deflate=WQ;FW.deflateRaw=TW;FW.gzip=AW});var Y2=T((IL,J2)=>{var s6=30,EW=12;J2.exports=function(Q,q){var V,Y,X,J,G,U,K,W,Z,z,H,I,N,w,P,L,C,O,M,F,R,v,x,_,A;V=Q.state,Y=Q.next_in,_=Q.input,X=Y+(Q.avail_in-5),J=Q.next_out,A=Q.output,G=J-(q-Q.avail_out),U=J+(Q.avail_out-257),K=V.dmax,W=V.wsize,Z=V.whave,z=V.wnext,H=V.window,I=V.hold,N=V.bits,w=V.lencode,P=V.distcode,L=(1<<V.lenbits)-1,C=(1<<V.distbits)-1;$:do{if(N<15)I+=_[Y++]<<N,N+=8,I+=_[Y++]<<N,N+=8;O=w[I&L];Q:for(;;){if(M=O>>>24,I>>>=M,N-=M,M=O>>>16&255,M===0)A[J++]=O&65535;else if(M&16){if(F=O&65535,M&=15,M){if(N<M)I+=_[Y++]<<N,N+=8;F+=I&(1<<M)-1,I>>>=M,N-=M}if(N<15)I+=_[Y++]<<N,N+=8,I+=_[Y++]<<N,N+=8;O=P[I&C];q:for(;;){if(M=O>>>24,I>>>=M,N-=M,M=O>>>16&255,M&16){if(R=O&65535,M&=15,N<M){if(I+=_[Y++]<<N,N+=8,N<M)I+=_[Y++]<<N,N+=8}if(R+=I&(1<<M)-1,R>K){Q.msg="invalid distance too far back",V.mode=s6;break $}if(I>>>=M,N-=M,M=J-G,R>M){if(M=R-M,M>Z){if(V.sane){Q.msg="invalid distance too far back",V.mode=s6;break $}}if(v=0,x=H,z===0){if(v+=W-M,M<F){F-=M;do A[J++]=H[v++];while(--M);v=J-R,x=A}}else if(z<M){if(v+=W+z-M,M-=z,M<F){F-=M;do A[J++]=H[v++];while(--M);if(v=0,z<F){M=z,F-=M;do A[J++]=H[v++];while(--M);v=J-R,x=A}}}else if(v+=z-M,M<F){F-=M;do A[J++]=H[v++];while(--M);v=J-R,x=A}while(F>2)A[J++]=x[v++],A[J++]=x[v++],A[J++]=x[v++],F-=3;if(F){if(A[J++]=x[v++],F>1)A[J++]=x[v++]}}else{v=J-R;do A[J++]=A[v++],A[J++]=A[v++],A[J++]=A[v++],F-=3;while(F>2);if(F){if(A[J++]=A[v++],F>1)A[J++]=A[v++]}}}else if((M&64)===0){O=P[(O&65535)+(I&(1<<M)-1)];continue q}else{Q.msg="invalid distance code",V.mode=s6;break $}break}}else if((M&64)===0){O=w[(O&65535)+(I&(1<<M)-1)];continue Q}else if(M&32){V.mode=EW;break $}else{Q.msg="invalid literal/length code",V.mode=s6;break $}break}}while(Y<X&&J<U);F=N>>3,Y-=F,N-=F<<3,I&=(1<<N)-1,Q.next_in=Y,Q.next_out=J,Q.avail_in=Y<X?5+(X-Y):5-(Y-X),Q.avail_out=J<U?257+(U-J):257-(J-U),V.hold=I,V.bits=N;return}});var Z2=T((CL,j2)=>{var X2=r1(),t0=15,G2=852,K2=592,W2=0,UQ=1,U2=2,yW=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],kW=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],gW=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],DW=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];j2.exports=function(Q,q,V,Y,X,J,G,U){var K=U.bits,W=0,Z=0,z=0,H=0,I=0,N=0,w=0,P=0,L=0,C=0,O,M,F,R,v,x=null,_=0,A,W1=new X2.Buf16(t0+1),S0=new X2.Buf16(t0+1),G6=null,Kq=0,Wq,K6,W6;for(W=0;W<=t0;W++)W1[W]=0;for(Z=0;Z<Y;Z++)W1[q[V+Z]]++;I=K;for(H=t0;H>=1;H--)if(W1[H]!==0)break;if(I>H)I=H;if(H===0)return X[J++]=20971520,X[J++]=20971520,U.bits=1,0;for(z=1;z<H;z++)if(W1[z]!==0)break;if(I<z)I=z;P=1;for(W=1;W<=t0;W++)if(P<<=1,P-=W1[W],P<0)return-1;if(P>0&&(Q===W2||H!==1))return-1;S0[1]=0;for(W=1;W<t0;W++)S0[W+1]=S0[W]+W1[W];for(Z=0;Z<Y;Z++)if(q[V+Z]!==0)G[S0[q[V+Z]]++]=Z;if(Q===W2)x=G6=G,A=19;else if(Q===UQ)x=yW,_-=257,G6=kW,Kq-=257,A=256;else x=gW,G6=DW,A=-1;if(C=0,Z=0,W=z,v=J,N=I,w=0,F=-1,L=1<<I,R=L-1,Q===UQ&&L>G2||Q===U2&&L>K2)return 1;for(;;){if(Wq=W-w,G[Z]<A)K6=0,W6=G[Z];else if(G[Z]>A)K6=G6[Kq+G[Z]],W6=x[_+G[Z]];else K6=96,W6=0;O=1<<W-w,M=1<<N,z=M;do M-=O,X[v+(C>>w)+M]=Wq<<24|K6<<16|W6|0;while(M!==0);O=1<<W-1;while(C&O)O>>=1;if(O!==0)C&=O-1,C+=O;else C=0;if(Z++,--W1[W]===0){if(W===H)break;W=q[V+G[Z]]}if(W>I&&(C&R)!==F){if(w===0)w=I;v+=z,N=W-w,P=1<<N;while(N+w<H){if(P-=W1[N+w],P<=0)break;N++,P<<=1}if(L+=1<<N,Q===UQ&&L>G2||Q===U2&&L>K2)return 1;F=C&R,X[F]=I<<24|N<<16|v-J|0}}if(C!==0)X[v+C]=W-w<<24|4194304|0;return U.bits=I,0}});var i2=T(($U)=>{var Z1=r1(),PQ=t5(),b1=e5(),hW=Y2(),u$=Z2(),_W=0,b2=1,f2=2,z2=4,bW=5,t6=6,A0=0,fW=1,mW=2,O1=-2,m2=-3,OQ=-4,cW=-5,H2=8,c2=1,L2=2,P2=3,O2=4,M2=5,B2=6,N2=7,I2=8,C2=9,w2=10,Q8=11,s1=12,jQ=13,T2=14,ZQ=15,A2=16,F2=17,R2=18,v2=19,e6=20,$8=21,x2=22,S2=23,E2=24,y2=25,k2=26,zQ=27,g2=28,D2=29,c=30,MQ=31,pW=32,uW=852,dW=592,lW=15,oW=lW;function h2($){return($>>>24&255)+($>>>8&65280)+(($&65280)<<8)+(($&255)<<24)}function iW(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Z1.Buf16(320),this.work=new Z1.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function p2($){var Q;if(!$||!$.state)return O1;if(Q=$.state,$.total_in=$.total_out=Q.total=0,$.msg="",Q.wrap)$.adler=Q.wrap&1;return Q.mode=c2,Q.last=0,Q.havedict=0,Q.dmax=32768,Q.head=null,Q.hold=0,Q.bits=0,Q.lencode=Q.lendyn=new Z1.Buf32(uW),Q.distcode=Q.distdyn=new Z1.Buf32(dW),Q.sane=1,Q.back=-1,A0}function u2($){var Q;if(!$||!$.state)return O1;return Q=$.state,Q.wsize=0,Q.whave=0,Q.wnext=0,p2($)}function d2($,Q){var q,V;if(!$||!$.state)return O1;if(V=$.state,Q<0)q=0,Q=-Q;else if(q=(Q>>4)+1,Q<48)Q&=15;if(Q&&(Q<8||Q>15))return O1;if(V.window!==null&&V.wbits!==Q)V.window=null;return V.wrap=q,V.wbits=Q,u2($)}function l2($,Q){var q,V;if(!$)return O1;if(V=new iW,$.state=V,V.window=null,q=d2($,Q),q!==A0)$.state=null;return q}function nW($){return l2($,oW)}var _2=!0,HQ,LQ;function rW($){if(_2){var Q;HQ=new Z1.Buf32(512),LQ=new Z1.Buf32(32),Q=0;while(Q<144)$.lens[Q++]=8;while(Q<256)$.lens[Q++]=9;while(Q<280)$.lens[Q++]=7;while(Q<288)$.lens[Q++]=8;u$(b2,$.lens,0,288,HQ,0,$.work,{bits:9}),Q=0;while(Q<32)$.lens[Q++]=5;u$(f2,$.lens,0,32,LQ,0,$.work,{bits:5}),_2=!1}$.lencode=HQ,$.lenbits=9,$.distcode=LQ,$.distbits=5}function o2($,Q,q,V){var Y,X=$.state;if(X.window===null)X.wsize=1<<X.wbits,X.wnext=0,X.whave=0,X.window=new Z1.Buf8(X.wsize);if(V>=X.wsize)Z1.arraySet(X.window,Q,q-X.wsize,X.wsize,0),X.wnext=0,X.whave=X.wsize;else{if(Y=X.wsize-X.wnext,Y>V)Y=V;if(Z1.arraySet(X.window,Q,q-V,Y,X.wnext),V-=Y,V)Z1.arraySet(X.window,Q,q-V,V,0),X.wnext=V,X.whave=X.wsize;else{if(X.wnext+=Y,X.wnext===X.wsize)X.wnext=0;if(X.whave<X.wsize)X.whave+=Y}}return 0}function aW($,Q){var q,V,Y,X,J,G,U,K,W,Z,z,H,I,N,w=0,P,L,C,O,M,F,R,v,x=new Z1.Buf8(4),_,A,W1=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!$||!$.state||!$.output||!$.input&&$.avail_in!==0)return O1;if(q=$.state,q.mode===s1)q.mode=jQ;J=$.next_out,Y=$.output,U=$.avail_out,X=$.next_in,V=$.input,G=$.avail_in,K=q.hold,W=q.bits,Z=G,z=U,v=A0;$:for(;;)switch(q.mode){case c2:if(q.wrap===0){q.mode=jQ;break}while(W<16){if(G===0)break $;G--,K+=V[X++]<<W,W+=8}if(q.wrap&2&&K===35615){q.check=0,x[0]=K&255,x[1]=K>>>8&255,q.check=b1(q.check,x,2,0),K=0,W=0,q.mode=L2;break}if(q.flags=0,q.head)q.head.done=!1;if(!(q.wrap&1)||(((K&255)<<8)+(K>>8))%31){$.msg="incorrect header check",q.mode=c;break}if((K&15)!==H2){$.msg="unknown compression method",q.mode=c;break}if(K>>>=4,W-=4,R=(K&15)+8,q.wbits===0)q.wbits=R;else if(R>q.wbits){$.msg="invalid window size",q.mode=c;break}q.dmax=1<<R,$.adler=q.check=1,q.mode=K&512?w2:s1,K=0,W=0;break;case L2:while(W<16){if(G===0)break $;G--,K+=V[X++]<<W,W+=8}if(q.flags=K,(q.flags&255)!==H2){$.msg="unknown compression method",q.mode=c;break}if(q.flags&57344){$.msg="unknown header flags set",q.mode=c;break}if(q.head)q.head.text=K>>8&1;if(q.flags&512)x[0]=K&255,x[1]=K>>>8&255,q.check=b1(q.check,x,2,0);K=0,W=0,q.mode=P2;case P2:while(W<32){if(G===0)break $;G--,K+=V[X++]<<W,W+=8}if(q.head)q.head.time=K;if(q.flags&512)x[0]=K&255,x[1]=K>>>8&255,x[2]=K>>>16&255,x[3]=K>>>24&255,q.check=b1(q.check,x,4,0);K=0,W=0,q.mode=O2;case O2:while(W<16){if(G===0)break $;G--,K+=V[X++]<<W,W+=8}if(q.head)q.head.xflags=K&255,q.head.os=K>>8;if(q.flags&512)x[0]=K&255,x[1]=K>>>8&255,q.check=b1(q.check,x,2,0);K=0,W=0,q.mode=M2;case M2:if(q.flags&1024){while(W<16){if(G===0)break $;G--,K+=V[X++]<<W,W+=8}if(q.length=K,q.head)q.head.extra_len=K;if(q.flags&512)x[0]=K&255,x[1]=K>>>8&255,q.check=b1(q.check,x,2,0);K=0,W=0}else if(q.head)q.head.extra=null;q.mode=B2;case B2:if(q.flags&1024){if(H=q.length,H>G)H=G;if(H){if(q.head){if(R=q.head.extra_len-q.length,!q.head.extra)q.head.extra=Array(q.head.extra_len);Z1.arraySet(q.head.extra,V,X,H,R)}if(q.flags&512)q.check=b1(q.check,V,H,X);G-=H,X+=H,q.length-=H}if(q.length)break $}q.length=0,q.mode=N2;case N2:if(q.flags&2048){if(G===0)break $;H=0;do if(R=V[X+H++],q.head&&R&&q.length<65536)q.head.name+=String.fromCharCode(R);while(R&&H<G);if(q.flags&512)q.check=b1(q.check,V,H,X);if(G-=H,X+=H,R)break $}else if(q.head)q.head.name=null;q.length=0,q.mode=I2;case I2:if(q.flags&4096){if(G===0)break $;H=0;do if(R=V[X+H++],q.head&&R&&q.length<65536)q.head.comment+=String.fromCharCode(R);while(R&&H<G);if(q.flags&512)q.check=b1(q.check,V,H,X);if(G-=H,X+=H,R)break $}else if(q.head)q.head.comment=null;q.mode=C2;case C2:if(q.flags&512){while(W<16){if(G===0)break $;G--,K+=V[X++]<<W,W+=8}if(K!==(q.check&65535)){$.msg="header crc mismatch",q.mode=c;break}K=0,W=0}if(q.head)q.head.hcrc=q.flags>>9&1,q.head.done=!0;$.adler=q.check=0,q.mode=s1;break;case w2:while(W<32){if(G===0)break $;G--,K+=V[X++]<<W,W+=8}$.adler=q.check=h2(K),K=0,W=0,q.mode=Q8;case Q8:if(q.havedict===0)return $.next_out=J,$.avail_out=U,$.next_in=X,$.avail_in=G,q.hold=K,q.bits=W,mW;$.adler=q.check=1,q.mode=s1;case s1:if(Q===bW||Q===t6)break $;case jQ:if(q.last){K>>>=W&7,W-=W&7,q.mode=zQ;break}while(W<3){if(G===0)break $;G--,K+=V[X++]<<W,W+=8}switch(q.last=K&1,K>>>=1,W-=1,K&3){case 0:q.mode=T2;break;case 1:if(rW(q),q.mode=e6,Q===t6){K>>>=2,W-=2;break $}break;case 2:q.mode=F2;break;case 3:$.msg="invalid block type",q.mode=c}K>>>=2,W-=2;break;case T2:K>>>=W&7,W-=W&7;while(W<32){if(G===0)break $;G--,K+=V[X++]<<W,W+=8}if((K&65535)!==(K>>>16^65535)){$.msg="invalid stored block lengths",q.mode=c;break}if(q.length=K&65535,K=0,W=0,q.mode=ZQ,Q===t6)break $;case ZQ:q.mode=A2;case A2:if(H=q.length,H){if(H>G)H=G;if(H>U)H=U;if(H===0)break $;Z1.arraySet(Y,V,X,H,J),G-=H,X+=H,U-=H,J+=H,q.length-=H;break}q.mode=s1;break;case F2:while(W<14){if(G===0)break $;G--,K+=V[X++]<<W,W+=8}if(q.nlen=(K&31)+257,K>>>=5,W-=5,q.ndist=(K&31)+1,K>>>=5,W-=5,q.ncode=(K&15)+4,K>>>=4,W-=4,q.nlen>286||q.ndist>30){$.msg="too many length or distance symbols",q.mode=c;break}q.have=0,q.mode=R2;case R2:while(q.have<q.ncode){while(W<3){if(G===0)break $;G--,K+=V[X++]<<W,W+=8}q.lens[W1[q.have++]]=K&7,K>>>=3,W-=3}while(q.have<19)q.lens[W1[q.have++]]=0;if(q.lencode=q.lendyn,q.lenbits=7,_={bits:q.lenbits},v=u$(_W,q.lens,0,19,q.lencode,0,q.work,_),q.lenbits=_.bits,v){$.msg="invalid code lengths set",q.mode=c;break}q.have=0,q.mode=v2;case v2:while(q.have<q.nlen+q.ndist){for(;;){if(w=q.lencode[K&(1<<q.lenbits)-1],P=w>>>24,L=w>>>16&255,C=w&65535,P<=W)break;if(G===0)break $;G--,K+=V[X++]<<W,W+=8}if(C<16)K>>>=P,W-=P,q.lens[q.have++]=C;else{if(C===16){A=P+2;while(W<A){if(G===0)break $;G--,K+=V[X++]<<W,W+=8}if(K>>>=P,W-=P,q.have===0){$.msg="invalid bit length repeat",q.mode=c;break}R=q.lens[q.have-1],H=3+(K&3),K>>>=2,W-=2}else if(C===17){A=P+3;while(W<A){if(G===0)break $;G--,K+=V[X++]<<W,W+=8}K>>>=P,W-=P,R=0,H=3+(K&7),K>>>=3,W-=3}else{A=P+7;while(W<A){if(G===0)break $;G--,K+=V[X++]<<W,W+=8}K>>>=P,W-=P,R=0,H=11+(K&127),K>>>=7,W-=7}if(q.have+H>q.nlen+q.ndist){$.msg="invalid bit length repeat",q.mode=c;break}while(H--)q.lens[q.have++]=R}}if(q.mode===c)break;if(q.lens[256]===0){$.msg="invalid code -- missing end-of-block",q.mode=c;break}if(q.lenbits=9,_={bits:q.lenbits},v=u$(b2,q.lens,0,q.nlen,q.lencode,0,q.work,_),q.lenbits=_.bits,v){$.msg="invalid literal/lengths set",q.mode=c;break}if(q.distbits=6,q.distcode=q.distdyn,_={bits:q.distbits},v=u$(f2,q.lens,q.nlen,q.ndist,q.distcode,0,q.work,_),q.distbits=_.bits,v){$.msg="invalid distances set",q.mode=c;break}if(q.mode=e6,Q===t6)break $;case e6:q.mode=$8;case $8:if(G>=6&&U>=258){if($.next_out=J,$.avail_out=U,$.next_in=X,$.avail_in=G,q.hold=K,q.bits=W,hW($,z),J=$.next_out,Y=$.output,U=$.avail_out,X=$.next_in,V=$.input,G=$.avail_in,K=q.hold,W=q.bits,q.mode===s1)q.back=-1;break}q.back=0;for(;;){if(w=q.lencode[K&(1<<q.lenbits)-1],P=w>>>24,L=w>>>16&255,C=w&65535,P<=W)break;if(G===0)break $;G--,K+=V[X++]<<W,W+=8}if(L&&(L&240)===0){O=P,M=L,F=C;for(;;){if(w=q.lencode[F+((K&(1<<O+M)-1)>>O)],P=w>>>24,L=w>>>16&255,C=w&65535,O+P<=W)break;if(G===0)break $;G--,K+=V[X++]<<W,W+=8}K>>>=O,W-=O,q.back+=O}if(K>>>=P,W-=P,q.back+=P,q.length=C,L===0){q.mode=k2;break}if(L&32){q.back=-1,q.mode=s1;break}if(L&64){$.msg="invalid literal/length code",q.mode=c;break}q.extra=L&15,q.mode=x2;case x2:if(q.extra){A=q.extra;while(W<A){if(G===0)break $;G--,K+=V[X++]<<W,W+=8}q.length+=K&(1<<q.extra)-1,K>>>=q.extra,W-=q.extra,q.back+=q.extra}q.was=q.length,q.mode=S2;case S2:for(;;){if(w=q.distcode[K&(1<<q.distbits)-1],P=w>>>24,L=w>>>16&255,C=w&65535,P<=W)break;if(G===0)break $;G--,K+=V[X++]<<W,W+=8}if((L&240)===0){O=P,M=L,F=C;for(;;){if(w=q.distcode[F+((K&(1<<O+M)-1)>>O)],P=w>>>24,L=w>>>16&255,C=w&65535,O+P<=W)break;if(G===0)break $;G--,K+=V[X++]<<W,W+=8}K>>>=O,W-=O,q.back+=O}if(K>>>=P,W-=P,q.back+=P,L&64){$.msg="invalid distance code",q.mode=c;break}q.offset=C,q.extra=L&15,q.mode=E2;case E2:if(q.extra){A=q.extra;while(W<A){if(G===0)break $;G--,K+=V[X++]<<W,W+=8}q.offset+=K&(1<<q.extra)-1,K>>>=q.extra,W-=q.extra,q.back+=q.extra}if(q.offset>q.dmax){$.msg="invalid distance too far back",q.mode=c;break}q.mode=y2;case y2:if(U===0)break $;if(H=z-U,q.offset>H){if(H=q.offset-H,H>q.whave){if(q.sane){$.msg="invalid distance too far back",q.mode=c;break}}if(H>q.wnext)H-=q.wnext,I=q.wsize-H;else I=q.wnext-H;if(H>q.length)H=q.length;N=q.window}else N=Y,I=J-q.offset,H=q.length;if(H>U)H=U;U-=H,q.length-=H;do Y[J++]=N[I++];while(--H);if(q.length===0)q.mode=$8;break;case k2:if(U===0)break $;Y[J++]=q.length,U--,q.mode=$8;break;case zQ:if(q.wrap){while(W<32){if(G===0)break $;G--,K|=V[X++]<<W,W+=8}if(z-=U,$.total_out+=z,q.total+=z,z)$.adler=q.check=q.flags?b1(q.check,Y,z,J-z):PQ(q.check,Y,z,J-z);if(z=U,(q.flags?K:h2(K))!==q.check){$.msg="incorrect data check",q.mode=c;break}K=0,W=0}q.mode=g2;case g2:if(q.wrap&&q.flags){while(W<32){if(G===0)break $;G--,K+=V[X++]<<W,W+=8}if(K!==(q.total&4294967295)){$.msg="incorrect length check",q.mode=c;break}K=0,W=0}q.mode=D2;case D2:v=fW;break $;case c:v=m2;break $;case MQ:return OQ;case pW:default:return O1}if($.next_out=J,$.avail_out=U,$.next_in=X,$.avail_in=G,q.hold=K,q.bits=W,q.wsize||z!==$.avail_out&&q.mode<c&&(q.mode<zQ||Q!==z2)){if(o2($,$.output,$.next_out,z-$.avail_out))return q.mode=MQ,OQ}if(Z-=$.avail_in,z-=$.avail_out,$.total_in+=Z,$.total_out+=z,q.total+=z,q.wrap&&z)$.adler=q.check=q.flags?b1(q.check,Y,z,$.next_out-z):PQ(q.check,Y,z,$.next_out-z);if($.data_type=q.bits+(q.last?64:0)+(q.mode===s1?128:0)+(q.mode===e6||q.mode===ZQ?256:0),(Z===0&&z===0||Q===z2)&&v===A0)v=cW;return v}function sW($){if(!$||!$.state)return O1;var Q=$.state;if(Q.window)Q.window=null;return $.state=null,A0}function tW($,Q){var q;if(!$||!$.state)return O1;if(q=$.state,(q.wrap&2)===0)return O1;return q.head=Q,Q.done=!1,A0}function eW($,Q){var q=Q.length,V,Y,X;if(!$||!$.state)return O1;if(V=$.state,V.wrap!==0&&V.mode!==Q8)return O1;if(V.mode===Q8){if(Y=1,Y=PQ(Y,Q,q,0),Y!==V.check)return m2}if(X=o2($,Q,q,q),X)return V.mode=MQ,OQ;return V.havedict=1,A0}$U.inflateReset=u2;$U.inflateReset2=d2;$U.inflateResetKeep=p2;$U.inflateInit=nW;$U.inflateInit2=l2;$U.inflate=aW;$U.inflateEnd=sW;$U.inflateGetHeader=tW;$U.inflateSetDictionary=eW;$U.inflateInfo="pako inflate (from Nodeca project)"});var BQ=T((TL,n2)=>{n2.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var a2=T((AL,r2)=>{function jU(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}r2.exports=jU});var t2=T((LU)=>{var e0=i2(),d$=r1(),q8=JQ(),l=BQ(),NQ=u6(),ZU=YQ(),zU=a2(),s2=Object.prototype.toString;function F0($){if(!(this instanceof F0))return new F0($);this.options=d$.assign({chunkSize:16384,windowBits:0,to:""},$||{});var Q=this.options;if(Q.raw&&Q.windowBits>=0&&Q.windowBits<16){if(Q.windowBits=-Q.windowBits,Q.windowBits===0)Q.windowBits=-15}if(Q.windowBits>=0&&Q.windowBits<16&&!($&&$.windowBits))Q.windowBits+=32;if(Q.windowBits>15&&Q.windowBits<48){if((Q.windowBits&15)===0)Q.windowBits|=15}this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ZU,this.strm.avail_out=0;var q=e0.inflateInit2(this.strm,Q.windowBits);if(q!==l.Z_OK)throw Error(NQ[q]);if(this.header=new zU,e0.inflateGetHeader(this.strm,this.header),Q.dictionary){if(typeof Q.dictionary==="string")Q.dictionary=q8.string2buf(Q.dictionary);else if(s2.call(Q.dictionary)==="[object ArrayBuffer]")Q.dictionary=new Uint8Array(Q.dictionary);if(Q.raw){if(q=e0.inflateSetDictionary(this.strm,Q.dictionary),q!==l.Z_OK)throw Error(NQ[q])}}}F0.prototype.push=function($,Q){var q=this.strm,V=this.options.chunkSize,Y=this.options.dictionary,X,J,G,U,K,W=!1;if(this.ended)return!1;if(J=Q===~~Q?Q:Q===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof $==="string")q.input=q8.binstring2buf($);else if(s2.call($)==="[object ArrayBuffer]")q.input=new Uint8Array($);else q.input=$;q.next_in=0,q.avail_in=q.input.length;do{if(q.avail_out===0)q.output=new d$.Buf8(V),q.next_out=0,q.avail_out=V;if(X=e0.inflate(q,l.Z_NO_FLUSH),X===l.Z_NEED_DICT&&Y)X=e0.inflateSetDictionary(this.strm,Y);if(X===l.Z_BUF_ERROR&&W===!0)X=l.Z_OK,W=!1;if(X!==l.Z_STREAM_END&&X!==l.Z_OK)return this.onEnd(X),this.ended=!0,!1;if(q.next_out){if(q.avail_out===0||X===l.Z_STREAM_END||q.avail_in===0&&(J===l.Z_FINISH||J===l.Z_SYNC_FLUSH))if(this.options.to==="string"){if(G=q8.utf8border(q.output,q.next_out),U=q.next_out-G,K=q8.buf2string(q.output,G),q.next_out=U,q.avail_out=V-U,U)d$.arraySet(q.output,q.output,G,U,0);this.onData(K)}else this.onData(d$.shrinkBuf(q.output,q.next_out))}if(q.avail_in===0&&q.avail_out===0)W=!0}while((q.avail_in>0||q.avail_out===0)&&X!==l.Z_STREAM_END);if(X===l.Z_STREAM_END)J=l.Z_FINISH;if(J===l.Z_FINISH)return X=e0.inflateEnd(this.strm),this.onEnd(X),this.ended=!0,X===l.Z_OK;if(J===l.Z_SYNC_FLUSH)return this.onEnd(l.Z_OK),q.avail_out=0,!0;return!0};F0.prototype.onData=function($){this.chunks.push($)};F0.prototype.onEnd=function($){if($===l.Z_OK)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=d$.flattenChunks(this.chunks);this.chunks=[],this.err=$,this.msg=this.strm.msg};function IQ($,Q){var q=new F0(Q);if(q.push($,!0),q.err)throw q.msg||NQ[q.err];return q.result}function HU($,Q){return Q=Q||{},Q.raw=!0,IQ($,Q)}LU.Inflate=F0;LU.inflate=IQ;LU.inflateRaw=HU;LU.ungzip=IQ});var Q7=T((RL,$7)=>{var NU=r1().assign,IU=V2(),CU=t2(),wU=BQ(),e2={};NU(e2,IU,CU,wU);$7.exports=e2});var V7=T((RU)=>{var TU=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",AU=Q7(),q7=p(),V8=j1(),FU=TU?"uint8array":"array";RU.magic="\b\x00";function R0($,Q){V8.call(this,"FlateWorker/"+$),this._pako=null,this._pakoAction=$,this._pakoOptions=Q,this.meta={}}q7.inherits(R0,V8);R0.prototype.processChunk=function($){if(this.meta=$.meta,this._pako===null)this._createPako();this._pako.push(q7.transformTo(FU,$.data),!1)};R0.prototype.flush=function(){if(V8.prototype.flush.call(this),this._pako===null)this._createPako();this._pako.push([],!0)};R0.prototype.cleanUp=function(){V8.prototype.cleanUp.call(this),this._pako=null};R0.prototype._createPako=function(){this._pako=new AU[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var $=this;this._pako.onData=function(Q){$.push({data:Q,meta:$.meta})}};RU.compressWorker=function($){return new R0("Deflate",$)};RU.uncompressWorker=function(){return new R0("Inflate",{})}});var CQ=T((EU)=>{var J7=j1();EU.STORE={magic:"\x00\x00",compressWorker:function(){return new J7("STORE compression")},uncompressWorker:function(){return new J7("STORE decompression")}};EU.DEFLATE=V7()});var wQ=T((gU)=>{gU.LOCAL_FILE_HEADER="PK\x03\x04";gU.CENTRAL_FILE_HEADER="PK\x01\x02";gU.CENTRAL_DIRECTORY_END="PK\x05\x06";gU.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07";gU.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06";gU.DATA_DESCRIPTOR="PK\x07\b"});var K7=T((EL,G7)=>{var $$=p(),Q$=j1(),TQ=d0(),Y7=f6(),J8=wQ(),h=function($,Q){var q="",V;for(V=0;V<Q;V++)q+=String.fromCharCode($&255),$=$>>>8;return q},cU=function($,Q){var q=$;if(!$)q=Q?16893:33204;return(q&65535)<<16},pU=function($){return($||0)&63},X7=function($,Q,q,V,Y,X){var{file:J,compression:G}=$,U=X!==TQ.utf8encode,K=$$.transformTo("string",X(J.name)),W=$$.transformTo("string",TQ.utf8encode(J.name)),Z=J.comment,z=$$.transformTo("string",X(Z)),H=$$.transformTo("string",TQ.utf8encode(Z)),I=W.length!==J.name.length,N=H.length!==Z.length,w,P,L="",C="",O="",M=J.dir,F=J.date,R={crc32:0,compressedSize:0,uncompressedSize:0};if(!Q||q)R.crc32=$.crc32,R.compressedSize=$.compressedSize,R.uncompressedSize=$.uncompressedSize;var v=0;if(Q)v|=8;if(!U&&(I||N))v|=2048;var x=0,_=0;if(M)x|=16;if(Y==="UNIX")_=798,x|=cU(J.unixPermissions,M);else _=20,x|=pU(J.dosPermissions,M);if(w=F.getUTCHours(),w=w<<6,w=w|F.getUTCMinutes(),w=w<<5,w=w|F.getUTCSeconds()/2,P=F.getUTCFullYear()-1980,P=P<<4,P=P|F.getUTCMonth()+1,P=P<<5,P=P|F.getUTCDate(),I)C=h(1,1)+h(Y7(K),4)+W,L+="up"+h(C.length,2)+C;if(N)O=h(1,1)+h(Y7(z),4)+H,L+="uc"+h(O.length,2)+O;var A="";A+=`
|
|
61
|
-
\x00`,A+=h(v,2),A+=G.magic,A+=h(w,2),A+=h(P,2),A+=h(R.crc32,4),A+=h(R.compressedSize,4),A+=h(R.uncompressedSize,4),A+=h(K.length,2),A+=h(L.length,2);var W1=J8.LOCAL_FILE_HEADER+A+K+L,S0=J8.CENTRAL_FILE_HEADER+h(_,2)+A+h(z.length,2)+"\x00\x00\x00\x00"+h(x,4)+h(V,4)+K+L+z;return{fileRecord:W1,dirRecord:S0}},uU=function($,Q,q,V,Y){var X="",J=$$.transformTo("string",Y(V));return X=J8.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+h($,2)+h($,2)+h(Q,4)+h(q,4)+h(J.length,2)+J,X},dU=function($){var Q="";return Q=J8.DATA_DESCRIPTOR+h($.crc32,4)+h($.compressedSize,4)+h($.uncompressedSize,4),Q};function v1($,Q,q,V){Q$.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=Q,this.zipPlatform=q,this.encodeFileName=V,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}$$.inherits(v1,Q$);v1.prototype.push=function($){var Q=$.meta.percent||0,q=this.entriesCount,V=this._sources.length;if(this.accumulate)this.contentBuffer.push($);else this.bytesWritten+=$.data.length,Q$.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:q?(Q+100*(q-V-1))/q:100}})};v1.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var Q=this.streamFiles&&!$.file.dir;if(Q){var q=X7($,Q,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:q.fileRecord,meta:{percent:0}})}else this.accumulate=!0};v1.prototype.closedSource=function($){this.accumulate=!1;var Q=this.streamFiles&&!$.file.dir,q=X7($,Q,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(q.dirRecord),Q)this.push({data:dU($),meta:{percent:100}});else{this.push({data:q.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};v1.prototype.flush=function(){var $=this.bytesWritten;for(var Q=0;Q<this.dirRecords.length;Q++)this.push({data:this.dirRecords[Q],meta:{percent:100}});var q=this.bytesWritten-$,V=uU(this.dirRecords.length,q,$,this.zipComment,this.encodeFileName);this.push({data:V,meta:{percent:100}})};v1.prototype.prepareNextSource=function(){if(this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused)this.previous.pause();else this.previous.resume()};v1.prototype.registerPrevious=function($){this._sources.push($);var Q=this;return $.on("data",function(q){Q.processChunk(q)}),$.on("end",function(){if(Q.closedSource(Q.previous.streamInfo),Q._sources.length)Q.prepareNextSource();else Q.end()}),$.on("error",function(q){Q.error(q)}),this};v1.prototype.resume=function(){if(!Q$.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0};v1.prototype.error=function($){var Q=this._sources;if(!Q$.prototype.error.call(this,$))return!1;for(var q=0;q<Q.length;q++)try{Q[q].error($)}catch(V){}return!0};v1.prototype.lock=function(){Q$.prototype.lock.call(this);var $=this._sources;for(var Q=0;Q<$.length;Q++)$[Q].lock()};G7.exports=v1});var W7=T((nU)=>{var lU=CQ(),oU=K7(),iU=function($,Q){var q=$||Q,V=lU[q];if(!V)throw Error(q+" is not a valid compression method !");return V};nU.generateWorker=function($,Q,q){var V=new oU(Q.streamFiles,q,Q.platform,Q.encodeFileName),Y=0;try{$.forEach(function(X,J){Y++;var G=iU(J.options.compression,Q.compression),U=J.options.compressionOptions||Q.compressionOptions||{},K=J.dir,W=J.date;J._compressWorker(G,U).withStreamInfo("file",{name:X,dir:K,date:W,comment:J.comment||"",unixPermissions:J.unixPermissions,dosPermissions:J.dosPermissions}).pipe(V)}),V.entriesCount=Y}catch(X){V.error(X)}return V}});var j7=T((kL,U7)=>{var aU=p(),Y8=j1();function l$($,Q){Y8.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(Q)}aU.inherits(l$,Y8);l$.prototype._bindStream=function($){var Q=this;this._stream=$,$.pause(),$.on("data",function(q){Q.push({data:q,meta:{percent:0}})}).on("error",function(q){if(Q.isPaused)this.generatedError=q;else Q.error(q)}).on("end",function(){if(Q.isPaused)Q._upstreamEnded=!0;else Q.end()})};l$.prototype.pause=function(){if(!Y8.prototype.pause.call(this))return!1;return this._stream.pause(),!0};l$.prototype.resume=function(){if(!Y8.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};U7.exports=l$});var I7=T((gL,N7)=>{var sU=d0(),o$=p(),L7=j1(),tU=v5(),P7=x5(),Z7=m6(),eU=z9(),$j=W7(),z7=T$(),Qj=j7(),O7=function($,Q,q){var V=o$.getTypeOf(Q),Y,X=o$.extend(q||{},P7);if(X.date=X.date||new Date,X.compression!==null)X.compression=X.compression.toUpperCase();if(typeof X.unixPermissions==="string")X.unixPermissions=parseInt(X.unixPermissions,8);if(X.unixPermissions&&X.unixPermissions&16384)X.dir=!0;if(X.dosPermissions&&X.dosPermissions&16)X.dir=!0;if(X.dir)$=M7($);if(X.createFolders&&(Y=qj($)))B7.call(this,Y,!0);var J=V==="string"&&X.binary===!1&&X.base64===!1;if(!q||typeof q.binary>"u")X.binary=!J;var G=Q instanceof Z7&&Q.uncompressedSize===0;if(G||X.dir||!Q||Q.length===0)X.base64=!1,X.binary=!0,Q="",X.compression="STORE",V="string";var U=null;if(Q instanceof Z7||Q instanceof L7)U=Q;else if(z7.isNode&&z7.isStream(Q))U=new Qj($,Q);else U=o$.prepareContent($,Q,X.binary,X.optimizedBinaryString,X.base64);var K=new eU($,U,X);this.files[$]=K},qj=function($){if($.slice(-1)==="/")$=$.substring(0,$.length-1);var Q=$.lastIndexOf("/");return Q>0?$.substring(0,Q):""},M7=function($){if($.slice(-1)!=="/")$+="/";return $},B7=function($,Q){if(Q=typeof Q<"u"?Q:P7.createFolders,$=M7($),!this.files[$])O7.call(this,$,null,{dir:!0,createFolders:Q});return this.files[$]};function H7($){return Object.prototype.toString.call($)==="[object RegExp]"}var Vj={load:function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function($){var Q,q,V;for(Q in this.files)if(V=this.files[Q],q=Q.slice(this.root.length,Q.length),q&&Q.slice(0,this.root.length)===this.root)$(q,V)},filter:function($){var Q=[];return this.forEach(function(q,V){if($(q,V))Q.push(V)}),Q},file:function($,Q,q){if(arguments.length===1)if(H7($)){var V=$;return this.filter(function(X,J){return!J.dir&&V.test(X)})}else{var Y=this.files[this.root+$];if(Y&&!Y.dir)return Y;else return null}else $=this.root+$,O7.call(this,$,Q,q);return this},folder:function($){if(!$)return this;if(H7($))return this.filter(function(Y,X){return X.dir&&$.test(Y)});var Q=this.root+$,q=B7.call(this,Q),V=this.clone();return V.root=q.name,V},remove:function($){$=this.root+$;var Q=this.files[$];if(!Q){if($.slice(-1)!=="/")$+="/";Q=this.files[$]}if(Q&&!Q.dir)delete this.files[$];else{var q=this.filter(function(Y,X){return X.name.slice(0,$.length)===$});for(var V=0;V<q.length;V++)delete this.files[q[V].name]}return this},generate:function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function($){var Q,q={};try{if(q=o$.extend($||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:sU.utf8encode}),q.type=q.type.toLowerCase(),q.compression=q.compression.toUpperCase(),q.type==="binarystring")q.type="string";if(!q.type)throw Error("No output type specified.");if(o$.checkSupport(q.type),q.platform==="darwin"||q.platform==="freebsd"||q.platform==="linux"||q.platform==="sunos")q.platform="UNIX";if(q.platform==="win32")q.platform="DOS";var V=q.comment||this.comment||"";Q=$j.generateWorker(this,q,V)}catch(Y){Q=new L7("error"),Q.error(Y)}return new tU(Q,q.type||"string",q.mimeType)},generateAsync:function($,Q){return this.generateInternalStream($).accumulate(Q)},generateNodeStream:function($,Q){if($=$||{},!$.type)$.type="nodebuffer";return this.generateInternalStream($).toNodejsStream(Q)}};N7.exports=Vj});var AQ=T((DL,w7)=>{var Jj=p();function C7($){this.data=$,this.length=$.length,this.index=0,this.zero=0}C7.prototype={checkOffset:function($){this.checkIndex(this.index+$)},checkIndex:function($){if(this.length<this.zero+$||$<0)throw Error("End of data reached (data length = "+this.length+", asked index = "+$+"). Corrupted zip ?")},setIndex:function($){this.checkIndex($),this.index=$},skip:function($){this.setIndex(this.index+$)},byteAt:function(){},readInt:function($){var Q=0,q;this.checkOffset($);for(q=this.index+$-1;q>=this.index;q--)Q=(Q<<8)+this.byteAt(q);return this.index+=$,Q},readString:function($){return Jj.transformTo("string",this.readData($))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var $=this.readInt(4);return new Date(Date.UTC(($>>25&127)+1980,($>>21&15)-1,$>>16&31,$>>11&31,$>>5&63,($&31)<<1))}};w7.exports=C7});var FQ=T((hL,A7)=>{var T7=AQ(),Yj=p();function q$($){T7.call(this,$);for(var Q=0;Q<this.data.length;Q++)$[Q]=$[Q]&255}Yj.inherits(q$,T7);q$.prototype.byteAt=function($){return this.data[this.zero+$]};q$.prototype.lastIndexOfSignature=function($){var Q=$.charCodeAt(0),q=$.charCodeAt(1),V=$.charCodeAt(2),Y=$.charCodeAt(3);for(var X=this.length-4;X>=0;--X)if(this.data[X]===Q&&this.data[X+1]===q&&this.data[X+2]===V&&this.data[X+3]===Y)return X-this.zero;return-1};q$.prototype.readAndCheckSignature=function($){var Q=$.charCodeAt(0),q=$.charCodeAt(1),V=$.charCodeAt(2),Y=$.charCodeAt(3),X=this.readData(4);return Q===X[0]&&q===X[1]&&V===X[2]&&Y===X[3]};q$.prototype.readData=function($){if(this.checkOffset($),$===0)return[];var Q=this.data.slice(this.zero+this.index,this.zero+this.index+$);return this.index+=$,Q};A7.exports=q$});var v7=T((_L,R7)=>{var F7=AQ(),Xj=p();function V$($){F7.call(this,$)}Xj.inherits(V$,F7);V$.prototype.byteAt=function($){return this.data.charCodeAt(this.zero+$)};V$.prototype.lastIndexOfSignature=function($){return this.data.lastIndexOf($)-this.zero};V$.prototype.readAndCheckSignature=function($){var Q=this.readData(4);return $===Q};V$.prototype.readData=function($){this.checkOffset($);var Q=this.data.slice(this.zero+this.index,this.zero+this.index+$);return this.index+=$,Q};R7.exports=V$});var vQ=T((bL,S7)=>{var x7=FQ(),Gj=p();function RQ($){x7.call(this,$)}Gj.inherits(RQ,x7);RQ.prototype.readData=function($){if(this.checkOffset($),$===0)return new Uint8Array(0);var Q=this.data.subarray(this.zero+this.index,this.zero+this.index+$);return this.index+=$,Q};S7.exports=RQ});var k7=T((fL,y7)=>{var E7=vQ(),Kj=p();function xQ($){E7.call(this,$)}Kj.inherits(xQ,E7);xQ.prototype.readData=function($){this.checkOffset($);var Q=this.data.slice(this.zero+this.index,this.zero+this.index+$);return this.index+=$,Q};y7.exports=xQ});var SQ=T((mL,D7)=>{var X8=p(),g7=n1(),Wj=FQ(),Uj=v7(),jj=k7(),Zj=vQ();D7.exports=function($){var Q=X8.getTypeOf($);if(X8.checkSupport(Q),Q==="string"&&!g7.uint8array)return new Uj($);if(Q==="nodebuffer")return new jj($);if(g7.uint8array)return new Zj(X8.transformTo("uint8array",$));return new Wj(X8.transformTo("array",$))}});var f7=T((cL,b7)=>{var EQ=SQ(),Z0=p(),zj=m6(),h7=f6(),G8=d0(),K8=CQ(),Hj=n1(),Lj=0,Pj=3,Oj=function($){for(var Q in K8){if(!Object.prototype.hasOwnProperty.call(K8,Q))continue;if(K8[Q].magic===$)return K8[Q]}return null};function _7($,Q){this.options=$,this.loadOptions=Q}_7.prototype={isEncrypted:function(){return(this.bitFlag&1)===1},useUTF8:function(){return(this.bitFlag&2048)===2048},readLocalPart:function($){var Q,q;if($.skip(22),this.fileNameLength=$.readInt(2),q=$.readInt(2),this.fileName=$.readData(this.fileNameLength),$.skip(q),this.compressedSize===-1||this.uncompressedSize===-1)throw Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(Q=Oj(this.compressionMethod),Q===null)throw Error("Corrupted zip : compression "+Z0.pretty(this.compressionMethod)+" unknown (inner file : "+Z0.transformTo("string",this.fileName)+")");this.decompressed=new zj(this.compressedSize,this.uncompressedSize,this.crc32,Q,$.readData(this.compressedSize))},readCentralPart:function($){this.versionMadeBy=$.readInt(2),$.skip(2),this.bitFlag=$.readInt(2),this.compressionMethod=$.readString(2),this.date=$.readDate(),this.crc32=$.readInt(4),this.compressedSize=$.readInt(4),this.uncompressedSize=$.readInt(4);var Q=$.readInt(2);if(this.extraFieldsLength=$.readInt(2),this.fileCommentLength=$.readInt(2),this.diskNumberStart=$.readInt(2),this.internalFileAttributes=$.readInt(2),this.externalFileAttributes=$.readInt(4),this.localHeaderOffset=$.readInt(4),this.isEncrypted())throw Error("Encrypted zip are not supported");$.skip(Q),this.readExtraFields($),this.parseZIP64ExtraField($),this.fileComment=$.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var $=this.versionMadeBy>>8;if(this.dir=this.externalFileAttributes&16?!0:!1,$===Lj)this.dosPermissions=this.externalFileAttributes&63;if($===Pj)this.unixPermissions=this.externalFileAttributes>>16&65535;if(!this.dir&&this.fileNameStr.slice(-1)==="/")this.dir=!0},parseZIP64ExtraField:function(){if(!this.extraFields[1])return;var $=EQ(this.extraFields[1].value);if(this.uncompressedSize===Z0.MAX_VALUE_32BITS)this.uncompressedSize=$.readInt(8);if(this.compressedSize===Z0.MAX_VALUE_32BITS)this.compressedSize=$.readInt(8);if(this.localHeaderOffset===Z0.MAX_VALUE_32BITS)this.localHeaderOffset=$.readInt(8);if(this.diskNumberStart===Z0.MAX_VALUE_32BITS)this.diskNumberStart=$.readInt(4)},readExtraFields:function($){var Q=$.index+this.extraFieldsLength,q,V,Y;if(!this.extraFields)this.extraFields={};while($.index+4<Q)q=$.readInt(2),V=$.readInt(2),Y=$.readData(V),this.extraFields[q]={id:q,length:V,value:Y};$.setIndex(Q)},handleUTF8:function(){var $=Hj.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=G8.utf8decode(this.fileName),this.fileCommentStr=G8.utf8decode(this.fileComment);else{var Q=this.findExtraFieldUnicodePath();if(Q!==null)this.fileNameStr=Q;else{var q=Z0.transformTo($,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(q)}var V=this.findExtraFieldUnicodeComment();if(V!==null)this.fileCommentStr=V;else{var Y=Z0.transformTo($,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(Y)}}},findExtraFieldUnicodePath:function(){var $=this.extraFields[28789];if($){var Q=EQ($.value);if(Q.readInt(1)!==1)return null;if(h7(this.fileName)!==Q.readInt(4))return null;return G8.utf8decode(Q.readData($.length-5))}return null},findExtraFieldUnicodeComment:function(){var $=this.extraFields[25461];if($){var Q=EQ($.value);if(Q.readInt(1)!==1)return null;if(h7(this.fileComment)!==Q.readInt(4))return null;return G8.utf8decode(Q.readData($.length-5))}return null}};b7.exports=_7});var p7=T((pL,c7)=>{var Mj=SQ(),t1=p(),x1=wQ(),Bj=f7(),Nj=n1();function m7($){this.files=[],this.loadOptions=$}m7.prototype={checkSignature:function($){if(!this.reader.readAndCheckSignature($)){this.reader.index-=4;var Q=this.reader.readString(4);throw Error("Corrupted zip or bug: unexpected signature ("+t1.pretty(Q)+", expected "+t1.pretty($)+")")}},isSignature:function($,Q){var q=this.reader.index;this.reader.setIndex($);var V=this.reader.readString(4),Y=V===Q;return this.reader.setIndex(q),Y},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var $=this.reader.readData(this.zipCommentLength),Q=Nj.uint8array?"uint8array":"array",q=t1.transformTo(Q,$);this.zipComment=this.loadOptions.decodeFileName(q)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};var $=this.zip64EndOfCentralSize-44,Q=0,q,V,Y;while(Q<$)q=this.reader.readInt(2),V=this.reader.readInt(4),Y=this.reader.readData(V),this.zip64ExtensibleData[q]={id:q,length:V,value:Y}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var $,Q;for($=0;$<this.files.length;$++)Q=this.files[$],this.reader.setIndex(Q.localHeaderOffset),this.checkSignature(x1.LOCAL_FILE_HEADER),Q.readLocalPart(this.reader),Q.handleUTF8(),Q.processAttributes()},readCentralDir:function(){var $;this.reader.setIndex(this.centralDirOffset);while(this.reader.readAndCheckSignature(x1.CENTRAL_FILE_HEADER))$=new Bj({zip64:this.zip64},this.loadOptions),$.readCentralPart(this.reader),this.files.push($);if(this.centralDirRecords!==this.files.length){if(this.centralDirRecords!==0&&this.files.length===0)throw Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)}},readEndOfCentral:function(){var $=this.reader.lastIndexOfSignature(x1.CENTRAL_DIRECTORY_END);if($<0){var Q=!this.isSignature(0,x1.LOCAL_FILE_HEADER);if(Q)throw Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");else throw Error("Corrupted zip: can't find end of central directory")}this.reader.setIndex($);var q=$;if(this.checkSignature(x1.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===t1.MAX_VALUE_16BITS||this.diskWithCentralDirStart===t1.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===t1.MAX_VALUE_16BITS||this.centralDirRecords===t1.MAX_VALUE_16BITS||this.centralDirSize===t1.MAX_VALUE_32BITS||this.centralDirOffset===t1.MAX_VALUE_32BITS){if(this.zip64=!0,$=this.reader.lastIndexOfSignature(x1.ZIP64_CENTRAL_DIRECTORY_LOCATOR),$<0)throw Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex($),this.checkSignature(x1.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,x1.ZIP64_CENTRAL_DIRECTORY_END)){if(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(x1.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0)throw Error("Corrupted zip: can't find the ZIP64 end of central directory")}this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(x1.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var V=this.centralDirOffset+this.centralDirSize;if(this.zip64)V+=20,V+=12+this.zip64EndOfCentralSize;var Y=q-V;if(Y>0)if(this.isSignature(q,x1.CENTRAL_FILE_HEADER));else this.reader.zero=Y;else if(Y<0)throw Error("Corrupted zip: missing "+Math.abs(Y)+" bytes.")},prepareReader:function($){this.reader=Mj($)},load:function($){this.prepareReader($),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};c7.exports=m7});var l7=T((uL,d7)=>{var yQ=p(),W8=c0(),Ij=d0(),Cj=p7(),wj=y5(),u7=T$();function Tj($){return new W8.Promise(function(Q,q){var V=$.decompressed.getContentWorker().pipe(new wj);V.on("error",function(Y){q(Y)}).on("end",function(){if(V.streamInfo.crc32!==$.decompressed.crc32)q(Error("Corrupted zip : CRC32 mismatch"));else Q()}).resume()})}d7.exports=function($,Q){var q=this;if(Q=yQ.extend(Q||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:Ij.utf8decode}),u7.isNode&&u7.isStream($))return W8.Promise.reject(Error("JSZip can't accept a stream when loading a zip file."));return yQ.prepareContent("the loaded zip file",$,!0,Q.optimizedBinaryString,Q.base64).then(function(V){var Y=new Cj(Q);return Y.load(V),Y}).then(function(Y){var X=[W8.Promise.resolve(Y)],J=Y.files;if(Q.checkCRC32)for(var G=0;G<J.length;G++)X.push(Tj(J[G]));return W8.Promise.all(X)}).then(function(Y){var X=Y.shift(),J=X.files;for(var G=0;G<J.length;G++){var U=J[G],K=U.fileNameStr,W=yQ.resolve(U.fileNameStr);if(q.file(W,U.decompressed,{binary:!0,optimizedBinaryString:!0,date:U.date,dir:U.dir,comment:U.fileCommentStr.length?U.fileCommentStr:null,unixPermissions:U.unixPermissions,dosPermissions:U.dosPermissions,createFolders:Q.createFolders}),!U.dir)q.file(W).unsafeOriginalName=K}if(X.zipComment.length)q.comment=X.zipComment;return q})}});var i7=T((dL,o7)=>{function M1(){if(!(this instanceof M1))return new M1;if(arguments.length)throw Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var $=new M1;for(var Q in this)if(typeof this[Q]!=="function")$[Q]=this[Q];return $}}M1.prototype=I7();M1.prototype.loadAsync=l7();M1.support=n1();M1.defaults=x5();M1.version="3.10.1";M1.loadAsync=function($,Q){return new M1().loadAsync($,Q)};M1.external=c0();o7.exports=M1});import{homedir as zZ}from"node:os";import a from"node:path";function HZ($=process.env,Q=G1){if($.OPENCODE_CONFIG_DIR)return $.OPENCODE_CONFIG_DIR;if($.XDG_CONFIG_HOME)return a.join($.XDG_CONFIG_HOME,"opencode");return a.join(Q,".config","opencode")}function z1($,Q,q,V){return`[ -f "$HOME/.petdex/runtime/hooks-disabled" ] && exit 0; ${['if [ -x "$HOME/.petdex/bin/petdex.js" ] || [ -f "$HOME/.petdex/bin/petdex.js" ]; then',` node "$HOME/.petdex/bin/petdex.js" bubble ${Q} ${$} >/dev/null 2>&1 || true;`,"else",` ${LZ($,q,V)};`,"fi"].join(" ")}`}function LZ($,Q,q){let V=q!=null?`{"state":"${Q}","duration":${q},"agent_source":"${$}"}`:`{"state":"${Q}","agent_source":"${$}"}`;return['T="$(cat "$HOME/.petdex/runtime/update-token" 2>/dev/null)"',`[ -n "$T" ] && curl -s -m 0.3 -X POST ${v0}`,'-H "Content-Type: application/json"','-H "X-Petdex-Update-Token: $T"',`--data-raw '${V}'`,">/dev/null 2>&1 || true"].join(" ")}function PZ(){let $=v0.replace(/\/state$/,"/bubble");return String.raw`// petdex hook plugin. Auto-generated by 'petdex hooks install'.
|
|
60
|
+
`)},info:($)=>{u.message($,{symbol:M.default.blue(v4)})},success:($)=>{u.message($,{symbol:M.default.green(x4)})},step:($)=>{u.message($,{symbol:M.default.green(O6)})},warn:($)=>{u.message($,{symbol:M.default.yellow(S4)})},warning:($)=>{u.warn($)},error:($)=>{u.message($,{symbol:M.default.red(E4)})}},vH=`${M.default.gray(k)} `});var H$=T((SH,n8)=>{if(typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0)n8.exports={nextTick:y4};else n8.exports=process;function y4($,Q,q,J){if(typeof $!=="function")throw TypeError('"callback" argument must be a function');var Y=arguments.length,X,V;switch(Y){case 0:case 1:return process.nextTick($);case 2:return process.nextTick(function(){$.call(null,Q)});case 3:return process.nextTick(function(){$.call(null,Q,q)});case 4:return process.nextTick(function(){$.call(null,Q,q,J)});default:X=Array(Y-1),V=0;while(V<X.length)X[V++]=arguments[V];return process.nextTick(function(){$.apply(null,X)})}}});var bq=T((EH,_q)=>{var k4={}.toString;_q.exports=Array.isArray||function($){return k4.call($)=="[object Array]"}});var L$=T((r8,mq)=>{var B6=b("buffer"),i1=B6.Buffer;function fq($,Q){for(var q in $)Q[q]=$[q]}if(i1.from&&i1.alloc&&i1.allocUnsafe&&i1.allocUnsafeSlow)mq.exports=B6;else fq(B6,r8),r8.Buffer=D0;function D0($,Q,q){return i1($,Q,q)}fq(i1,D0);D0.from=function($,Q,q){if(typeof $==="number")throw TypeError("Argument must not be a number");return i1($,Q,q)};D0.alloc=function($,Q,q){if(typeof $!=="number")throw TypeError("Argument must be a number");var J=i1($);if(Q!==void 0)if(typeof q==="string")J.fill(Q,q);else J.fill(Q);else J.fill(0);return J};D0.allocUnsafe=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return i1($)};D0.allocUnsafeSlow=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return B6.SlowBuffer($)}});var h0=T((n4)=>{function g4($){if(Array.isArray)return Array.isArray($);return N6($)==="[object Array]"}n4.isArray=g4;function D4($){return typeof $==="boolean"}n4.isBoolean=D4;function h4($){return $===null}n4.isNull=h4;function _4($){return $==null}n4.isNullOrUndefined=_4;function b4($){return typeof $==="number"}n4.isNumber=b4;function f4($){return typeof $==="string"}n4.isString=f4;function m4($){return typeof $==="symbol"}n4.isSymbol=m4;function c4($){return $===void 0}n4.isUndefined=c4;function p4($){return N6($)==="[object RegExp]"}n4.isRegExp=p4;function u4($){return typeof $==="object"&&$!==null}n4.isObject=u4;function d4($){return N6($)==="[object Date]"}n4.isDate=d4;function l4($){return N6($)==="[object Error]"||$ instanceof Error}n4.isError=l4;function o4($){return typeof $==="function"}n4.isFunction=o4;function i4($){return $===null||typeof $==="boolean"||typeof $==="number"||typeof $==="string"||typeof $==="symbol"||typeof $>"u"}n4.isPrimitive=i4;n4.isBuffer=b("buffer").Buffer.isBuffer;function N6($){return Object.prototype.toString.call($)}});var cq=T((kH,a8)=>{if(typeof Object.create==="function")a8.exports=function(Q,q){if(q)Q.super_=q,Q.prototype=Object.create(q.prototype,{constructor:{value:Q,enumerable:!1,writable:!0,configurable:!0}})};else a8.exports=function(Q,q){if(q){Q.super_=q;var J=function(){};J.prototype=q.prototype,Q.prototype=new J,Q.prototype.constructor=Q}}});var _0=T((gH,s8)=>{try{if(I6=b("util"),typeof I6.inherits!=="function")throw"";s8.exports=I6.inherits}catch($){s8.exports=cq()}var I6});var uq=T((DH,t8)=>{function UX($,Q){if(!($ instanceof Q))throw TypeError("Cannot call a class as a function")}var pq=L$().Buffer,P$=b("util");function jX($,Q,q){$.copy(Q,q)}t8.exports=function(){function $(){UX(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(q){var J={data:q,next:null};if(this.length>0)this.tail.next=J;else this.head=J;this.tail=J,++this.length},$.prototype.unshift=function(q){var J={data:q,next:this.head};if(this.length===0)this.tail=J;this.head=J,++this.length},$.prototype.shift=function(){if(this.length===0)return;var q=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,q},$.prototype.clear=function(){this.head=this.tail=null,this.length=0},$.prototype.join=function(q){if(this.length===0)return"";var J=this.head,Y=""+J.data;while(J=J.next)Y+=q+J.data;return Y},$.prototype.concat=function(q){if(this.length===0)return pq.alloc(0);var J=pq.allocUnsafe(q>>>0),Y=this.head,X=0;while(Y)jX(Y.data,J,X),X+=Y.data.length,Y=Y.next;return J},$}();if(P$&&P$.inspect&&P$.inspect.custom)t8.exports.prototype[P$.inspect.custom]=function(){var $=P$.inspect({length:this.length});return this.constructor.name+" "+$}});var e8=T((hH,dq)=>{var C6=H$();function ZX($,Q){var q=this,J=this._readableState&&this._readableState.destroyed,Y=this._writableState&&this._writableState.destroyed;if(J||Y){if(Q)Q($);else if($){if(!this._writableState)C6.nextTick(w6,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,C6.nextTick(w6,this,$)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy($||null,function(X){if(!Q&&X){if(!q._writableState)C6.nextTick(w6,q,X);else if(!q._writableState.errorEmitted)q._writableState.errorEmitted=!0,C6.nextTick(w6,q,X)}else if(Q)Q(X)}),this}function zX(){if(this._readableState)this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1;if(this._writableState)this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1}function w6($,Q){$.emit("error",Q)}dq.exports={destroy:ZX,undestroy:zX}});var oq=T((_H,lq)=>{lq.exports=b("util").deprecate});var Q5=T((bH,$9)=>{var O0=H$();$9.exports=o;function nq($){var Q=this;this.next=null,this.entry=null,this.finish=function(){EX(Q,$)}}var HX=["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:O0.nextTick,b0;o.WritableState=M$;var rq=Object.create(h0());rq.inherits=_0();var LX={deprecate:oq()},aq=b("stream"),A6=L$().Buffer,PX=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function OX($){return A6.from($)}function MX($){return A6.isBuffer($)||$ instanceof PX}var sq=e8();rq.inherits(o,aq);function BX(){}function M$($,Q){b0=b0||M0(),$=$||{};var q=Q instanceof b0;if(this.objectMode=!!$.objectMode,q)this.objectMode=this.objectMode||!!$.writableObjectMode;var{highWaterMark:J,writableHighWaterMark:Y}=$,X=this.objectMode?16:16384;if(J||J===0)this.highWaterMark=J;else if(q&&(Y||Y===0))this.highWaterMark=Y;else this.highWaterMark=X;this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var V=$.decodeStrings===!1;this.decodeStrings=!V,this.defaultEncoding=$.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(G){FX(Q,G)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new nq(this)}M$.prototype.getBuffer=function(){var Q=this.bufferedRequest,q=[];while(Q)q.push(Q),Q=Q.next;return q};(function(){try{Object.defineProperty(M$.prototype,"buffer",{get:LX.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch($){}})();var T6;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function")T6=Function.prototype[Symbol.hasInstance],Object.defineProperty(o,Symbol.hasInstance,{value:function($){if(T6.call(this,$))return!0;if(this!==o)return!1;return $&&$._writableState instanceof M$}});else T6=function($){return $ instanceof this};function o($){if(b0=b0||M0(),!T6.call(o,this)&&!(this instanceof b0))return new o($);if(this._writableState=new M$($,this),this.writable=!0,$){if(typeof $.write==="function")this._write=$.write;if(typeof $.writev==="function")this._writev=$.writev;if(typeof $.destroy==="function")this._destroy=$.destroy;if(typeof $.final==="function")this._final=$.final}aq.call(this)}o.prototype.pipe=function(){this.emit("error",Error("Cannot pipe, not readable"))};function NX($,Q){var q=Error("write after end");$.emit("error",q),O0.nextTick(Q,q)}function IX($,Q,q,J){var Y=!0,X=!1;if(q===null)X=TypeError("May not write null values to stream");else if(typeof q!=="string"&&q!==void 0&&!Q.objectMode)X=TypeError("Invalid non-string/buffer chunk");if(X)$.emit("error",X),O0.nextTick(J,X),Y=!1;return Y}o.prototype.write=function($,Q,q){var J=this._writableState,Y=!1,X=!J.objectMode&&MX($);if(X&&!A6.isBuffer($))$=OX($);if(typeof Q==="function")q=Q,Q=null;if(X)Q="buffer";else if(!Q)Q=J.defaultEncoding;if(typeof q!=="function")q=BX;if(J.ended)NX(this,q);else if(X||IX(this,J,$,q))J.pendingcb++,Y=wX(this,J,X,$,Q,q);return Y};o.prototype.cork=function(){var $=this._writableState;$.corked++};o.prototype.uncork=function(){var $=this._writableState;if($.corked){if($.corked--,!$.writing&&!$.corked&&!$.bufferProcessing&&$.bufferedRequest)tq(this,$)}};o.prototype.setDefaultEncoding=function(Q){if(typeof Q==="string")Q=Q.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Q+"").toLowerCase())>-1))throw TypeError("Unknown encoding: "+Q);return this._writableState.defaultEncoding=Q,this};function CX($,Q,q){if(!$.objectMode&&$.decodeStrings!==!1&&typeof Q==="string")Q=A6.from(Q,q);return Q}Object.defineProperty(o.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function wX($,Q,q,J,Y,X){if(!q){var V=CX(Q,J,Y);if(J!==V)q=!0,Y="buffer",J=V}var G=Q.objectMode?1:J.length;Q.length+=G;var U=Q.length<Q.highWaterMark;if(!U)Q.needDrain=!0;if(Q.writing||Q.corked){var K=Q.lastBufferedRequest;if(Q.lastBufferedRequest={chunk:J,encoding:Y,isBuf:q,callback:X,next:null},K)K.next=Q.lastBufferedRequest;else Q.bufferedRequest=Q.lastBufferedRequest;Q.bufferedRequestCount+=1}else $5($,Q,!1,G,J,Y,X);return U}function $5($,Q,q,J,Y,X,V){if(Q.writelen=J,Q.writecb=V,Q.writing=!0,Q.sync=!0,q)$._writev(Y,Q.onwrite);else $._write(Y,X,Q.onwrite);Q.sync=!1}function TX($,Q,q,J,Y){if(--Q.pendingcb,q)O0.nextTick(Y,J),O0.nextTick(O$,$,Q),$._writableState.errorEmitted=!0,$.emit("error",J);else Y(J),$._writableState.errorEmitted=!0,$.emit("error",J),O$($,Q)}function AX($){$.writing=!1,$.writecb=null,$.length-=$.writelen,$.writelen=0}function FX($,Q){var q=$._writableState,J=q.sync,Y=q.writecb;if(AX(q),Q)TX($,q,J,Q,Y);else{var X=eq(q);if(!X&&!q.corked&&!q.bufferProcessing&&q.bufferedRequest)tq($,q);if(J)HX(iq,$,q,X,Y);else iq($,q,X,Y)}}function iq($,Q,q,J){if(!q)RX($,Q);Q.pendingcb--,J(),O$($,Q)}function RX($,Q){if(Q.length===0&&Q.needDrain)Q.needDrain=!1,$.emit("drain")}function tq($,Q){Q.bufferProcessing=!0;var q=Q.bufferedRequest;if($._writev&&q&&q.next){var J=Q.bufferedRequestCount,Y=Array(J),X=Q.corkedRequestsFree;X.entry=q;var V=0,G=!0;while(q){if(Y[V]=q,!q.isBuf)G=!1;q=q.next,V+=1}if(Y.allBuffers=G,$5($,Q,!0,Q.length,Y,"",X.finish),Q.pendingcb++,Q.lastBufferedRequest=null,X.next)Q.corkedRequestsFree=X.next,X.next=null;else Q.corkedRequestsFree=new nq(Q);Q.bufferedRequestCount=0}else{while(q){var{chunk:U,encoding:K,callback:W}=q,z=Q.objectMode?1:U.length;if($5($,Q,!1,z,U,K,W),q=q.next,Q.bufferedRequestCount--,Q.writing)break}if(q===null)Q.lastBufferedRequest=null}Q.bufferedRequest=q,Q.bufferProcessing=!1}o.prototype._write=function($,Q,q){q(Error("_write() is not implemented"))};o.prototype._writev=null;o.prototype.end=function($,Q,q){var J=this._writableState;if(typeof $==="function")q=$,$=null,Q=null;else if(typeof Q==="function")q=Q,Q=null;if($!==null&&$!==void 0)this.write($,Q);if(J.corked)J.corked=1,this.uncork();if(!J.ending)SX(this,J,q)};function eq($){return $.ending&&$.length===0&&$.bufferedRequest===null&&!$.finished&&!$.writing}function vX($,Q){$._final(function(q){if(Q.pendingcb--,q)$.emit("error",q);Q.prefinished=!0,$.emit("prefinish"),O$($,Q)})}function xX($,Q){if(!Q.prefinished&&!Q.finalCalled)if(typeof $._final==="function")Q.pendingcb++,Q.finalCalled=!0,O0.nextTick(vX,$,Q);else Q.prefinished=!0,$.emit("prefinish")}function O$($,Q){var q=eq(Q);if(q){if(xX($,Q),Q.pendingcb===0)Q.finished=!0,$.emit("finish")}return q}function SX($,Q,q){if(Q.ending=!0,O$($,Q),q)if(Q.finished)O0.nextTick(q);else $.once("finish",q);Q.ended=!0,$.writable=!1}function EX($,Q,q){var J=$.entry;$.entry=null;while(J){var Y=J.callback;Q.pendingcb--,Y(q),J=J.next}Q.corkedRequestsFree.next=$}Object.defineProperty(o.prototype,"destroyed",{get:function(){if(this._writableState===void 0)return!1;return this._writableState.destroyed},set:function($){if(!this._writableState)return;this._writableState.destroyed=$}});o.prototype.destroy=sq.destroy;o.prototype._undestroy=sq.undestroy;o.prototype._destroy=function($,Q){this.end(),Q($)}});var M0=T((fH,V9)=>{var Q9=H$(),yX=Object.keys||function($){var Q=[];for(var q in $)Q.push(q);return Q};V9.exports=n1;var q9=Object.create(h0());q9.inherits=_0();var J9=J5(),q5=Q5();q9.inherits(n1,J9);{F6=yX(q5.prototype);for(B$=0;B$<F6.length;B$++)if(N$=F6[B$],!n1.prototype[N$])n1.prototype[N$]=q5.prototype[N$]}var F6,N$,B$;function n1($){if(!(this instanceof n1))return new n1($);if(J9.call(this,$),q5.call(this,$),$&&$.readable===!1)this.readable=!1;if($&&$.writable===!1)this.writable=!1;if(this.allowHalfOpen=!0,$&&$.allowHalfOpen===!1)this.allowHalfOpen=!1;this.once("end",kX)}Object.defineProperty(n1.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function kX(){if(this.allowHalfOpen||this._writableState.ended)return;Q9.nextTick(gX,this)}function gX($){$.end()}Object.defineProperty(n1.prototype,"destroyed",{get:function(){if(this._readableState===void 0||this._writableState===void 0)return!1;return this._readableState.destroyed&&this._writableState.destroyed},set:function($){if(this._readableState===void 0||this._writableState===void 0)return;this._readableState.destroyed=$,this._writableState.destroyed=$}});n1.prototype._destroy=function($,Q){this.push(null),this.end(),Q9.nextTick(Q,$)}});var X5=T((nX)=>{var Y5=L$().Buffer,Y9=Y5.isEncoding||function($){switch($=""+$,$&&$.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function DX($){if(!$)return"utf8";var Q;while(!0)switch($){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return $;default:if(Q)return;$=(""+$).toLowerCase(),Q=!0}}function hX($){var Q=DX($);if(typeof Q!=="string"&&(Y5.isEncoding===Y9||!Y9($)))throw Error("Unknown encoding: "+$);return Q||$}nX.StringDecoder=I$;function I$($){this.encoding=hX($);var Q;switch(this.encoding){case"utf16le":this.text=pX,this.end=uX,Q=4;break;case"utf8":this.fillLast=fX,Q=4;break;case"base64":this.text=dX,this.end=lX,Q=3;break;default:this.write=oX,this.end=iX;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Y5.allocUnsafe(Q)}I$.prototype.write=function($){if($.length===0)return"";var Q,q;if(this.lastNeed){if(Q=this.fillLast($),Q===void 0)return"";q=this.lastNeed,this.lastNeed=0}else q=0;if(q<$.length)return Q?Q+this.text($,q):this.text($,q);return Q||""};I$.prototype.end=cX;I$.prototype.text=mX;I$.prototype.fillLast=function($){if(this.lastNeed<=$.length)return $.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);$.copy(this.lastChar,this.lastTotal-this.lastNeed,0,$.length),this.lastNeed-=$.length};function V5($){if($<=127)return 0;else if($>>5===6)return 2;else if($>>4===14)return 3;else if($>>3===30)return 4;return $>>6===2?-1:-2}function _X($,Q,q){var J=Q.length-1;if(J<q)return 0;var Y=V5(Q[J]);if(Y>=0){if(Y>0)$.lastNeed=Y-1;return Y}if(--J<q||Y===-2)return 0;if(Y=V5(Q[J]),Y>=0){if(Y>0)$.lastNeed=Y-2;return Y}if(--J<q||Y===-2)return 0;if(Y=V5(Q[J]),Y>=0){if(Y>0)if(Y===2)Y=0;else $.lastNeed=Y-3;return Y}return 0}function bX($,Q,q){if((Q[0]&192)!==128)return $.lastNeed=0,"�";if($.lastNeed>1&&Q.length>1){if((Q[1]&192)!==128)return $.lastNeed=1,"�";if($.lastNeed>2&&Q.length>2){if((Q[2]&192)!==128)return $.lastNeed=2,"�"}}}function fX($){var Q=this.lastTotal-this.lastNeed,q=bX(this,$,Q);if(q!==void 0)return q;if(this.lastNeed<=$.length)return $.copy(this.lastChar,Q,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);$.copy(this.lastChar,Q,0,$.length),this.lastNeed-=$.length}function mX($,Q){var q=_X(this,$,Q);if(!this.lastNeed)return $.toString("utf8",Q);this.lastTotal=q;var J=$.length-(q-this.lastNeed);return $.copy(this.lastChar,0,J),$.toString("utf8",Q,J)}function cX($){var Q=$&&$.length?this.write($):"";if(this.lastNeed)return Q+"�";return Q}function pX($,Q){if(($.length-Q)%2===0){var q=$.toString("utf16le",Q);if(q){var J=q.charCodeAt(q.length-1);if(J>=55296&&J<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1],q.slice(0,-1)}return q}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=$[$.length-1],$.toString("utf16le",Q,$.length-1)}function uX($){var Q=$&&$.length?this.write($):"";if(this.lastNeed){var q=this.lastTotal-this.lastNeed;return Q+this.lastChar.toString("utf16le",0,q)}return Q}function dX($,Q){var q=($.length-Q)%3;if(q===0)return $.toString("base64",Q);if(this.lastNeed=3-q,this.lastTotal=3,q===1)this.lastChar[0]=$[$.length-1];else this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1];return $.toString("base64",Q,$.length-q)}function lX($){var Q=$&&$.length?this.write($):"";if(this.lastNeed)return Q+this.lastChar.toString("base64",0,3-this.lastNeed);return Q}function oX($){return $.toString(this.encoding)}function iX($){return $&&$.length?this.write($):""}});var J5=T((pH,O9)=>{var m0=H$();O9.exports=f;var aX=bq(),C$;f.ReadableState=Z9;var cH=b("events").EventEmitter,W9=function($,Q){return $.listeners(Q).length},j5=b("stream"),w$=L$().Buffer,sX=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function tX($){return w$.from($)}function eX($){return w$.isBuffer($)||$ instanceof sX}var U9=Object.create(h0());U9.inherits=_0();var G5=b("util"),y=void 0;if(G5&&G5.debuglog)y=G5.debuglog("stream");else y=function(){};var $3=uq(),j9=e8(),f0;U9.inherits(f,j5);var K5=["error","close","destroy","pause","resume"];function Q3($,Q,q){if(typeof $.prependListener==="function")return $.prependListener(Q,q);if(!$._events||!$._events[Q])$.on(Q,q);else if(aX($._events[Q]))$._events[Q].unshift(q);else $._events[Q]=[q,$._events[Q]]}function Z9($,Q){C$=C$||M0(),$=$||{};var q=Q instanceof C$;if(this.objectMode=!!$.objectMode,q)this.objectMode=this.objectMode||!!$.readableObjectMode;var{highWaterMark:J,readableHighWaterMark:Y}=$,X=this.objectMode?16:16384;if(J||J===0)this.highWaterMark=J;else if(q&&(Y||Y===0))this.highWaterMark=Y;else this.highWaterMark=X;if(this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new $3,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=$.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,$.encoding){if(!f0)f0=X5().StringDecoder;this.decoder=new f0($.encoding),this.encoding=$.encoding}}function f($){if(C$=C$||M0(),!(this instanceof f))return new f($);if(this._readableState=new Z9($,this),this.readable=!0,$){if(typeof $.read==="function")this._read=$.read;if(typeof $.destroy==="function")this._destroy=$.destroy}j5.call(this)}Object.defineProperty(f.prototype,"destroyed",{get:function(){if(this._readableState===void 0)return!1;return this._readableState.destroyed},set:function($){if(!this._readableState)return;this._readableState.destroyed=$}});f.prototype.destroy=j9.destroy;f.prototype._undestroy=j9.undestroy;f.prototype._destroy=function($,Q){this.push(null),Q($)};f.prototype.push=function($,Q){var q=this._readableState,J;if(!q.objectMode){if(typeof $==="string"){if(Q=Q||q.defaultEncoding,Q!==q.encoding)$=w$.from($,Q),Q="";J=!0}}else J=!0;return z9(this,$,Q,!1,J)};f.prototype.unshift=function($){return z9(this,$,null,!0,!1)};function z9($,Q,q,J,Y){var X=$._readableState;if(Q===null)X.reading=!1,Y3($,X);else{var V;if(!Y)V=q3(X,Q);if(V)$.emit("error",V);else if(X.objectMode||Q&&Q.length>0){if(typeof Q!=="string"&&!X.objectMode&&Object.getPrototypeOf(Q)!==w$.prototype)Q=tX(Q);if(J)if(X.endEmitted)$.emit("error",Error("stream.unshift() after end event"));else W5($,X,Q,!0);else if(X.ended)$.emit("error",Error("stream.push() after EOF"));else if(X.reading=!1,X.decoder&&!q)if(Q=X.decoder.write(Q),X.objectMode||Q.length!==0)W5($,X,Q,!1);else H9($,X);else W5($,X,Q,!1)}else if(!J)X.reading=!1}return J3(X)}function W5($,Q,q,J){if(Q.flowing&&Q.length===0&&!Q.sync)$.emit("data",q),$.read(0);else{if(Q.length+=Q.objectMode?1:q.length,J)Q.buffer.unshift(q);else Q.buffer.push(q);if(Q.needReadable)R6($)}H9($,Q)}function q3($,Q){var q;if(!eX(Q)&&typeof Q!=="string"&&Q!==void 0&&!$.objectMode)q=TypeError("Invalid non-string/buffer chunk");return q}function J3($){return!$.ended&&($.needReadable||$.length<$.highWaterMark||$.length===0)}f.prototype.isPaused=function(){return this._readableState.flowing===!1};f.prototype.setEncoding=function($){if(!f0)f0=X5().StringDecoder;return this._readableState.decoder=new f0($),this._readableState.encoding=$,this};var X9=8388608;function V3($){if($>=X9)$=X9;else $--,$|=$>>>1,$|=$>>>2,$|=$>>>4,$|=$>>>8,$|=$>>>16,$++;return $}function G9($,Q){if($<=0||Q.length===0&&Q.ended)return 0;if(Q.objectMode)return 1;if($!==$)if(Q.flowing&&Q.length)return Q.buffer.head.data.length;else return Q.length;if($>Q.highWaterMark)Q.highWaterMark=V3($);if($<=Q.length)return $;if(!Q.ended)return Q.needReadable=!0,0;return Q.length}f.prototype.read=function($){y("read",$),$=parseInt($,10);var Q=this._readableState,q=$;if($!==0)Q.emittedReadable=!1;if($===0&&Q.needReadable&&(Q.length>=Q.highWaterMark||Q.ended)){if(y("read: emitReadable",Q.length,Q.ended),Q.length===0&&Q.ended)U5(this);else R6(this);return null}if($=G9($,Q),$===0&&Q.ended){if(Q.length===0)U5(this);return null}var J=Q.needReadable;if(y("need readable",J),Q.length===0||Q.length-$<Q.highWaterMark)J=!0,y("length less than watermark",J);if(Q.ended||Q.reading)J=!1,y("reading or ended",J);else if(J){if(y("do read"),Q.reading=!0,Q.sync=!0,Q.length===0)Q.needReadable=!0;if(this._read(Q.highWaterMark),Q.sync=!1,!Q.reading)$=G9(q,Q)}var Y;if($>0)Y=L9($,Q);else Y=null;if(Y===null)Q.needReadable=!0,$=0;else Q.length-=$;if(Q.length===0){if(!Q.ended)Q.needReadable=!0;if(q!==$&&Q.ended)U5(this)}if(Y!==null)this.emit("data",Y);return Y};function Y3($,Q){if(Q.ended)return;if(Q.decoder){var q=Q.decoder.end();if(q&&q.length)Q.buffer.push(q),Q.length+=Q.objectMode?1:q.length}Q.ended=!0,R6($)}function R6($){var Q=$._readableState;if(Q.needReadable=!1,!Q.emittedReadable)if(y("emitReadable",Q.flowing),Q.emittedReadable=!0,Q.sync)m0.nextTick(K9,$);else K9($)}function K9($){y("emit readable"),$.emit("readable"),Z5($)}function H9($,Q){if(!Q.readingMore)Q.readingMore=!0,m0.nextTick(X3,$,Q)}function X3($,Q){var q=Q.length;while(!Q.reading&&!Q.flowing&&!Q.ended&&Q.length<Q.highWaterMark)if(y("maybeReadMore read 0"),$.read(0),q===Q.length)break;else q=Q.length;Q.readingMore=!1}f.prototype._read=function($){this.emit("error",Error("_read() is not implemented"))};f.prototype.pipe=function($,Q){var q=this,J=this._readableState;switch(J.pipesCount){case 0:J.pipes=$;break;case 1:J.pipes=[J.pipes,$];break;default:J.pipes.push($);break}J.pipesCount+=1,y("pipe count=%d opts=%j",J.pipesCount,Q);var Y=(!Q||Q.end!==!1)&&$!==process.stdout&&$!==process.stderr,X=Y?G:w;if(J.endEmitted)m0.nextTick(X);else q.once("end",X);$.on("unpipe",V);function V(N,O){if(y("onunpipe"),N===q){if(O&&O.hasUnpiped===!1)O.hasUnpiped=!0,W()}}function G(){y("onend"),$.end()}var U=G3(q);$.on("drain",U);var K=!1;function W(){if(y("cleanup"),$.removeListener("close",C),$.removeListener("finish",I),$.removeListener("drain",U),$.removeListener("error",H),$.removeListener("unpipe",V),q.removeListener("end",G),q.removeListener("end",w),q.removeListener("data",Z),K=!0,J.awaitDrain&&(!$._writableState||$._writableState.needDrain))U()}var z=!1;q.on("data",Z);function Z(N){y("ondata"),z=!1;var O=$.write(N);if(O===!1&&!z){if((J.pipesCount===1&&J.pipes===$||J.pipesCount>1&&P9(J.pipes,$)!==-1)&&!K)y("false write response, pause",J.awaitDrain),J.awaitDrain++,z=!0;q.pause()}}function H(N){if(y("onerror",N),w(),$.removeListener("error",H),W9($,"error")===0)$.emit("error",N)}Q3($,"error",H);function C(){$.removeListener("finish",I),w()}$.once("close",C);function I(){y("onfinish"),$.removeListener("close",C),w()}$.once("finish",I);function w(){y("unpipe"),q.unpipe($)}if($.emit("pipe",q),!J.flowing)y("pipe resume"),q.resume();return $};function G3($){return function(){var Q=$._readableState;if(y("pipeOnDrain",Q.awaitDrain),Q.awaitDrain)Q.awaitDrain--;if(Q.awaitDrain===0&&W9($,"data"))Q.flowing=!0,Z5($)}}f.prototype.unpipe=function($){var Q=this._readableState,q={hasUnpiped:!1};if(Q.pipesCount===0)return this;if(Q.pipesCount===1){if($&&$!==Q.pipes)return this;if(!$)$=Q.pipes;if(Q.pipes=null,Q.pipesCount=0,Q.flowing=!1,$)$.emit("unpipe",this,q);return this}if(!$){var{pipes:J,pipesCount:Y}=Q;Q.pipes=null,Q.pipesCount=0,Q.flowing=!1;for(var X=0;X<Y;X++)J[X].emit("unpipe",this,{hasUnpiped:!1});return this}var V=P9(Q.pipes,$);if(V===-1)return this;if(Q.pipes.splice(V,1),Q.pipesCount-=1,Q.pipesCount===1)Q.pipes=Q.pipes[0];return $.emit("unpipe",this,q),this};f.prototype.on=function($,Q){var q=j5.prototype.on.call(this,$,Q);if($==="data"){if(this._readableState.flowing!==!1)this.resume()}else if($==="readable"){var J=this._readableState;if(!J.endEmitted&&!J.readableListening){if(J.readableListening=J.needReadable=!0,J.emittedReadable=!1,!J.reading)m0.nextTick(K3,this);else if(J.length)R6(this)}}return q};f.prototype.addListener=f.prototype.on;function K3($){y("readable nexttick read 0"),$.read(0)}f.prototype.resume=function(){var $=this._readableState;if(!$.flowing)y("resume"),$.flowing=!0,W3(this,$);return this};function W3($,Q){if(!Q.resumeScheduled)Q.resumeScheduled=!0,m0.nextTick(U3,$,Q)}function U3($,Q){if(!Q.reading)y("resume read 0"),$.read(0);if(Q.resumeScheduled=!1,Q.awaitDrain=0,$.emit("resume"),Z5($),Q.flowing&&!Q.reading)$.read(0)}f.prototype.pause=function(){if(y("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)y("pause"),this._readableState.flowing=!1,this.emit("pause");return this};function Z5($){var Q=$._readableState;y("flow",Q.flowing);while(Q.flowing&&$.read()!==null);}f.prototype.wrap=function($){var Q=this,q=this._readableState,J=!1;$.on("end",function(){if(y("wrapped end"),q.decoder&&!q.ended){var V=q.decoder.end();if(V&&V.length)Q.push(V)}Q.push(null)}),$.on("data",function(V){if(y("wrapped data"),q.decoder)V=q.decoder.write(V);if(q.objectMode&&(V===null||V===void 0))return;else if(!q.objectMode&&(!V||!V.length))return;var G=Q.push(V);if(!G)J=!0,$.pause()});for(var Y in $)if(this[Y]===void 0&&typeof $[Y]==="function")this[Y]=function(V){return function(){return $[V].apply($,arguments)}}(Y);for(var X=0;X<K5.length;X++)$.on(K5[X],this.emit.bind(this,K5[X]));return this._read=function(V){if(y("wrapped _read",V),J)J=!1,$.resume()},this};Object.defineProperty(f.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});f._fromList=L9;function L9($,Q){if(Q.length===0)return null;var q;if(Q.objectMode)q=Q.buffer.shift();else if(!$||$>=Q.length){if(Q.decoder)q=Q.buffer.join("");else if(Q.buffer.length===1)q=Q.buffer.head.data;else q=Q.buffer.concat(Q.length);Q.buffer.clear()}else q=j3($,Q.buffer,Q.decoder);return q}function j3($,Q,q){var J;if($<Q.head.data.length)J=Q.head.data.slice(0,$),Q.head.data=Q.head.data.slice($);else if($===Q.head.data.length)J=Q.shift();else J=q?Z3($,Q):z3($,Q);return J}function Z3($,Q){var q=Q.head,J=1,Y=q.data;$-=Y.length;while(q=q.next){var X=q.data,V=$>X.length?X.length:$;if(V===X.length)Y+=X;else Y+=X.slice(0,$);if($-=V,$===0){if(V===X.length)if(++J,q.next)Q.head=q.next;else Q.head=Q.tail=null;else Q.head=q,q.data=X.slice(V);break}++J}return Q.length-=J,Y}function z3($,Q){var q=w$.allocUnsafe($),J=Q.head,Y=1;J.data.copy(q),$-=J.data.length;while(J=J.next){var X=J.data,V=$>X.length?X.length:$;if(X.copy(q,q.length-$,0,V),$-=V,$===0){if(V===X.length)if(++Y,J.next)Q.head=J.next;else Q.head=Q.tail=null;else Q.head=J,J.data=X.slice(V);break}++Y}return Q.length-=Y,q}function U5($){var Q=$._readableState;if(Q.length>0)throw Error('"endReadable()" called on non-empty stream');if(!Q.endEmitted)Q.ended=!0,m0.nextTick(H3,Q,$)}function H3($,Q){if(!$.endEmitted&&$.length===0)$.endEmitted=!0,Q.readable=!1,Q.emit("end")}function P9($,Q){for(var q=0,J=$.length;q<J;q++)if($[q]===Q)return q;return-1}});var z5=T((uH,N9)=>{N9.exports=r1;var v6=M0(),B9=Object.create(h0());B9.inherits=_0();B9.inherits(r1,v6);function L3($,Q){var q=this._transformState;q.transforming=!1;var J=q.writecb;if(!J)return this.emit("error",Error("write callback called multiple times"));if(q.writechunk=null,q.writecb=null,Q!=null)this.push(Q);J($);var Y=this._readableState;if(Y.reading=!1,Y.needReadable||Y.length<Y.highWaterMark)this._read(Y.highWaterMark)}function r1($){if(!(this instanceof r1))return new r1($);if(v6.call(this,$),this._transformState={afterTransform:L3.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,$){if(typeof $.transform==="function")this._transform=$.transform;if(typeof $.flush==="function")this._flush=$.flush}this.on("prefinish",P3)}function P3(){var $=this;if(typeof this._flush==="function")this._flush(function(Q,q){M9($,Q,q)});else M9(this,null,null)}r1.prototype.push=function($,Q){return this._transformState.needTransform=!1,v6.prototype.push.call(this,$,Q)};r1.prototype._transform=function($,Q,q){throw Error("_transform() is not implemented")};r1.prototype._write=function($,Q,q){var J=this._transformState;if(J.writecb=q,J.writechunk=$,J.writeencoding=Q,!J.transforming){var Y=this._readableState;if(J.needTransform||Y.needReadable||Y.length<Y.highWaterMark)this._read(Y.highWaterMark)}};r1.prototype._read=function($){var Q=this._transformState;if(Q.writechunk!==null&&Q.writecb&&!Q.transforming)Q.transforming=!0,this._transform(Q.writechunk,Q.writeencoding,Q.afterTransform);else Q.needTransform=!0};r1.prototype._destroy=function($,Q){var q=this;v6.prototype._destroy.call(this,$,function(J){Q(J),q.emit("close")})};function M9($,Q,q){if(Q)return $.emit("error",Q);if(q!=null)$.push(q);if($._writableState.length)throw Error("Calling transform done when ws.length != 0");if($._transformState.transforming)throw Error("Calling transform done when still transforming");return $.push(null)}});var T9=T((dH,w9)=>{w9.exports=T$;var I9=z5(),C9=Object.create(h0());C9.inherits=_0();C9.inherits(T$,I9);function T$($){if(!(this instanceof T$))return new T$($);I9.call(this,$)}T$.prototype._transform=function($,Q,q){q(null,$)}});var H5=T((s,x6)=>{var y1=b("stream");if(process.env.READABLE_STREAM==="disable"&&y1)x6.exports=y1,s=x6.exports=y1.Readable,s.Readable=y1.Readable,s.Writable=y1.Writable,s.Duplex=y1.Duplex,s.Transform=y1.Transform,s.PassThrough=y1.PassThrough,s.Stream=y1;else s=x6.exports=J5(),s.Stream=y1||s,s.Readable=s,s.Writable=Q5(),s.Duplex=M0(),s.Transform=z5(),s.PassThrough=T9()});var a1=T((M3)=>{M3.base64=!0;M3.array=!0;M3.string=!0;M3.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u";M3.nodebuffer=typeof Buffer<"u";M3.uint8array=typeof Uint8Array<"u";if(typeof ArrayBuffer>"u")M3.blob=!1;else{S6=new ArrayBuffer(0);try{M3.blob=new Blob([S6],{type:"application/zip"}).size===0}catch($){try{P5=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,E6=new P5,E6.append(S6),M3.blob=E6.getBlob("application/zip").size===0}catch(Q){M3.blob=!1}}}var S6,P5,E6;try{M3.nodestream=!!H5().Readable}catch($){M3.nodestream=!1}});var O5=T((R3)=>{var A3=p(),F3=a1(),k1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";R3.encode=function($){var Q=[],q,J,Y,X,V,G,U,K=0,W=$.length,z=W,Z=A3.getTypeOf($)!=="string";while(K<$.length){if(z=W-K,!Z)q=$.charCodeAt(K++),J=K<W?$.charCodeAt(K++):0,Y=K<W?$.charCodeAt(K++):0;else q=$[K++],J=K<W?$[K++]:0,Y=K<W?$[K++]:0;X=q>>2,V=(q&3)<<4|J>>4,G=z>1?(J&15)<<2|Y>>6:64,U=z>2?Y&63:64,Q.push(k1.charAt(X)+k1.charAt(V)+k1.charAt(G)+k1.charAt(U))}return Q.join("")};R3.decode=function($){var Q,q,J,Y,X,V,G,U=0,K=0,W="data:";if($.substr(0,W.length)===W)throw Error("Invalid base64 input, it looks like a data url.");$=$.replace(/[^A-Za-z0-9+/=]/g,"");var z=$.length*3/4;if($.charAt($.length-1)===k1.charAt(64))z--;if($.charAt($.length-2)===k1.charAt(64))z--;if(z%1!==0)throw Error("Invalid base64 input, bad content length.");var Z;if(F3.uint8array)Z=new Uint8Array(z|0);else Z=Array(z|0);while(U<$.length){if(Y=k1.indexOf($.charAt(U++)),X=k1.indexOf($.charAt(U++)),V=k1.indexOf($.charAt(U++)),G=k1.indexOf($.charAt(U++)),Q=Y<<2|X>>4,q=(X&15)<<4|V>>2,J=(V&3)<<6|G,Z[K++]=Q,V!==64)Z[K++]=q;if(G!==64)Z[K++]=J}return Z}});var A$=T((iH,A9)=>{A9.exports={isNode:typeof Buffer<"u",newBufferFrom:function($,Q){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from($,Q);else{if(typeof $==="number")throw Error('The "data" argument must not be a number');return new Buffer($,Q)}},allocBuffer:function($){if(Buffer.alloc)return Buffer.alloc($);else{var Q=new Buffer($);return Q.fill(0),Q}},isBuffer:function($){return Buffer.isBuffer($)},isStream:function($){return $&&typeof $.on==="function"&&typeof $.pause==="function"&&typeof $.resume==="function"}}});var v9=T((rH,R9)=>{var nH=global.MutationObserver||global.WebKitMutationObserver,F9;F9=function(){process.nextTick(g3)};var S3,E3,y3,k3,M5,F$=[];function g3(){M5=!0;var $,Q,q=F$.length;while(q){Q=F$,F$=[],$=-1;while(++$<q)Q[$]();q=F$.length}M5=!1}R9.exports=D3;function D3($){if(F$.push($)===1&&!M5)F9()}});var D9=T((aH,g9)=>{var x9=v9();function p0(){}var Q1={},S9=["REJECTED"],B5=["FULFILLED"],E9=["PENDING"];c0=["UNHANDLED"];var c0;g9.exports=Y0;function Y0($){if(typeof $!=="function")throw TypeError("resolver must be a function");if(this.state=E9,this.queue=[],this.outcome=void 0,this.handled=c0,$!==p0)y9(this,$)}Y0.prototype.finally=function($){if(typeof $!=="function")return this;var Q=this.constructor;return this.then(q,J);function q(Y){function X(){return Y}return Q.resolve($()).then(X)}function J(Y){function X(){throw Y}return Q.resolve($()).then(X)}};Y0.prototype.catch=function($){return this.then(null,$)};Y0.prototype.then=function($,Q){if(typeof $!=="function"&&this.state===B5||typeof Q!=="function"&&this.state===S9)return this;var q=new this.constructor(p0);if(this.handled===c0)this.handled=null;if(this.state!==E9){var J=this.state===B5?$:Q;N5(q,J,this.outcome)}else this.queue.push(new R$(q,$,Q));return q};function R$($,Q,q){if(this.promise=$,typeof Q==="function")this.onFulfilled=Q,this.callFulfilled=this.otherCallFulfilled;if(typeof q==="function")this.onRejected=q,this.callRejected=this.otherCallRejected}R$.prototype.callFulfilled=function($){Q1.resolve(this.promise,$)};R$.prototype.otherCallFulfilled=function($){N5(this.promise,this.onFulfilled,$)};R$.prototype.callRejected=function($){Q1.reject(this.promise,$)};R$.prototype.otherCallRejected=function($){N5(this.promise,this.onRejected,$)};function N5($,Q,q){x9(function(){var J;try{J=Q(q)}catch(Y){return Q1.reject($,Y)}if(J===$)Q1.reject($,TypeError("Cannot resolve promise with itself"));else Q1.resolve($,J)})}Q1.resolve=function($,Q){var q=k9(h3,Q);if(q.status==="error")return Q1.reject($,q.value);var J=q.value;if(J)y9($,J);else{$.state=B5,$.outcome=Q;var Y=-1,X=$.queue.length;while(++Y<X)$.queue[Y].callFulfilled(Q)}return $};Q1.reject=function($,Q){if($.state=S9,$.outcome=Q,$.handled===c0)x9(function(){if($.handled===c0)process.emit("unhandledRejection",Q,$)});var q=-1,J=$.queue.length;while(++q<J)$.queue[q].callRejected(Q);return $};function h3($){var Q=$&&$.then;if($&&(typeof $==="object"||typeof $==="function")&&typeof Q==="function")return function(){Q.apply($,arguments)}}function y9($,Q){var q=!1;function J(G){if(q)return;q=!0,Q1.reject($,G)}function Y(G){if(q)return;q=!0,Q1.resolve($,G)}function X(){Q(Y,J)}var V=k9(X);if(V.status==="error")J(V.value)}function k9($,Q){var q={};try{q.value=$(Q),q.status="success"}catch(J){q.status="error",q.value=J}return q}Y0.resolve=_3;function _3($){if($ instanceof this)return $;return Q1.resolve(new this(p0),$)}Y0.reject=b3;function b3($){var Q=new this(p0);return Q1.reject(Q,$)}Y0.all=f3;function f3($){var Q=this;if(Object.prototype.toString.call($)!=="[object Array]")return this.reject(TypeError("must be an array"));var q=$.length,J=!1;if(!q)return this.resolve([]);var Y=Array(q),X=0,V=-1,G=new this(p0);while(++V<q)U($[V],V);return G;function U(K,W){Q.resolve(K).then(z,function(Z){if(!J)J=!0,Q1.reject(G,Z)});function z(Z){if(Y[W]=Z,++X===q&&!J)J=!0,Q1.resolve(G,Y)}}}Y0.race=m3;function m3($){var Q=this;if(Object.prototype.toString.call($)!=="[object Array]")return this.reject(TypeError("must be an array"));var q=$.length,J=!1;if(!q)return this.resolve([]);var Y=-1,X=new this(p0);while(++Y<q)V($[Y]);return X;function V(G){Q.resolve(G).then(function(U){if(!J)J=!0,Q1.resolve(X,U)},function(U){if(!J)J=!0,Q1.reject(X,U)})}}});var u0=T((sH,h9)=>{var I5=null;if(typeof Promise<"u")I5=Promise;else I5=D9();h9.exports={Promise:I5}});var b9=T((_9)=>{(function($,Q){if($.setImmediate)return;var q=1,J={},Y=!1,X=$.document,V;function G(O){if(typeof O!=="function")O=Function(""+O);var B=Array(arguments.length-1);for(var L=0;L<B.length;L++)B[L]=arguments[L+1];var P={callback:O,args:B};return J[q]=P,V(q),q++}function U(O){delete J[O]}function K(O){var{callback:B,args:L}=O;switch(L.length){case 0:B();break;case 1:B(L[0]);break;case 2:B(L[0],L[1]);break;case 3:B(L[0],L[1],L[2]);break;default:B.apply(Q,L);break}}function W(O){if(Y)setTimeout(W,0,O);else{var B=J[O];if(B){Y=!0;try{K(B)}finally{U(O),Y=!1}}}}function z(){V=function(O){process.nextTick(function(){W(O)})}}function Z(){if($.postMessage&&!$.importScripts){var O=!0,B=$.onmessage;return $.onmessage=function(){O=!1},$.postMessage("","*"),$.onmessage=B,O}}function H(){var O="setImmediate$"+Math.random()+"$",B=function(L){if(L.source===$&&typeof L.data==="string"&&L.data.indexOf(O)===0)W(+L.data.slice(O.length))};if($.addEventListener)$.addEventListener("message",B,!1);else $.attachEvent("onmessage",B);V=function(L){$.postMessage(O+L,"*")}}function C(){var O=new MessageChannel;O.port1.onmessage=function(B){var L=B.data;W(L)},V=function(B){O.port2.postMessage(B)}}function I(){var O=X.documentElement;V=function(B){var L=X.createElement("script");L.onreadystatechange=function(){W(B),L.onreadystatechange=null,O.removeChild(L),L=null},O.appendChild(L)}}function w(){V=function(O){setTimeout(W,0,O)}}var N=Object.getPrototypeOf&&Object.getPrototypeOf($);if(N=N&&N.setTimeout?N:$,{}.toString.call($.process)==="[object process]")z();else if(Z())H();else if($.MessageChannel)C();else if(X&&"onreadystatechange"in X.createElement("script"))I();else w();N.setImmediate=G,N.clearImmediate=U})(typeof self>"u"?typeof global>"u"?_9:global:self)});var p=T((u3)=>{var X0=a1(),c3=O5(),d0=A$(),C5=u0();b9();function p3($){var Q=null;if(X0.uint8array)Q=new Uint8Array($.length);else Q=Array($.length);return k6($,Q)}u3.newBlob=function($,Q){u3.checkSupport("blob");try{return new Blob([$],{type:Q})}catch(Y){try{var q=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,J=new q;return J.append($),J.getBlob(Q)}catch(X){throw Error("Bug : can't construct the Blob.")}}};function v$($){return $}function k6($,Q){for(var q=0;q<$.length;++q)Q[q]=$.charCodeAt(q)&255;return Q}var y6={stringifyByChunk:function($,Q,q){var J=[],Y=0,X=$.length;if(X<=q)return String.fromCharCode.apply(null,$);while(Y<X){if(Q==="array"||Q==="nodebuffer")J.push(String.fromCharCode.apply(null,$.slice(Y,Math.min(Y+q,X))));else J.push(String.fromCharCode.apply(null,$.subarray(Y,Math.min(Y+q,X))));Y+=q}return J.join("")},stringifyByChar:function($){var Q="";for(var q=0;q<$.length;q++)Q+=String.fromCharCode($[q]);return Q},applyCanBeUsed:{uint8array:function(){try{return X0.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch($){return!1}}(),nodebuffer:function(){try{return X0.nodebuffer&&String.fromCharCode.apply(null,d0.allocBuffer(1)).length===1}catch($){return!1}}()}};function x$($){var Q=65536,q=u3.getTypeOf($),J=!0;if(q==="uint8array")J=y6.applyCanBeUsed.uint8array;else if(q==="nodebuffer")J=y6.applyCanBeUsed.nodebuffer;if(J)while(Q>1)try{return y6.stringifyByChunk($,q,Q)}catch(Y){Q=Math.floor(Q/2)}return y6.stringifyByChar($)}u3.applyFromCharCode=x$;function g6($,Q){for(var q=0;q<$.length;q++)Q[q]=$[q];return Q}var G0={};G0.string={string:v$,array:function($){return k6($,Array($.length))},arraybuffer:function($){return G0.string.uint8array($).buffer},uint8array:function($){return k6($,new Uint8Array($.length))},nodebuffer:function($){return k6($,d0.allocBuffer($.length))}};G0.array={string:x$,array:v$,arraybuffer:function($){return new Uint8Array($).buffer},uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return d0.newBufferFrom($)}};G0.arraybuffer={string:function($){return x$(new Uint8Array($))},array:function($){return g6(new Uint8Array($),Array($.byteLength))},arraybuffer:v$,uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return d0.newBufferFrom(new Uint8Array($))}};G0.uint8array={string:x$,array:function($){return g6($,Array($.length))},arraybuffer:function($){return $.buffer},uint8array:v$,nodebuffer:function($){return d0.newBufferFrom($)}};G0.nodebuffer={string:x$,array:function($){return g6($,Array($.length))},arraybuffer:function($){return G0.nodebuffer.uint8array($).buffer},uint8array:function($){return g6($,new Uint8Array($.length))},nodebuffer:v$};u3.transformTo=function($,Q){if(!Q)Q="";if(!$)return Q;u3.checkSupport($);var q=u3.getTypeOf(Q),J=G0[q][$](Q);return J};u3.resolve=function($){var Q=$.split("/"),q=[];for(var J=0;J<Q.length;J++){var Y=Q[J];if(Y==="."||Y===""&&J!==0&&J!==Q.length-1)continue;else if(Y==="..")q.pop();else q.push(Y)}return q.join("/")};u3.getTypeOf=function($){if(typeof $==="string")return"string";if(Object.prototype.toString.call($)==="[object Array]")return"array";if(X0.nodebuffer&&d0.isBuffer($))return"nodebuffer";if(X0.uint8array&&$ instanceof Uint8Array)return"uint8array";if(X0.arraybuffer&&$ instanceof ArrayBuffer)return"arraybuffer"};u3.checkSupport=function($){var Q=X0[$.toLowerCase()];if(!Q)throw Error($+" is not supported by this platform")};u3.MAX_VALUE_16BITS=65535;u3.MAX_VALUE_32BITS=-1;u3.pretty=function($){var Q="",q,J;for(J=0;J<($||"").length;J++)q=$.charCodeAt(J),Q+="\\x"+(q<16?"0":"")+q.toString(16).toUpperCase();return Q};u3.delay=function($,Q,q){setImmediate(function(){$.apply(q||null,Q||[])})};u3.inherits=function($,Q){var q=function(){};q.prototype=Q.prototype,$.prototype=new q};u3.extend=function(){var $={},Q,q;for(Q=0;Q<arguments.length;Q++)for(q in arguments[Q])if(Object.prototype.hasOwnProperty.call(arguments[Q],q)&&typeof $[q]>"u")$[q]=arguments[Q][q];return $};u3.prepareContent=function($,Q,q,J,Y){var X=C5.Promise.resolve(Q).then(function(V){var G=X0.blob&&(V instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(V))!==-1);if(G&&typeof FileReader<"u")return new C5.Promise(function(U,K){var W=new FileReader;W.onload=function(z){U(z.target.result)},W.onerror=function(z){K(z.target.error)},W.readAsArrayBuffer(V)});else return V});return X.then(function(V){var G=u3.getTypeOf(V);if(!G)return C5.Promise.reject(Error("Can't read the data of '"+$+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));if(G==="arraybuffer")V=u3.transformTo("uint8array",V);else if(G==="string"){if(Y)V=c3.decode(V);else if(q){if(J!==!0)V=p3(V)}}return V})}});var j1=T(($L,p9)=>{function c9($){this.name=$||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}c9.prototype={push:function($){this.emit("data",$)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch($){this.emit("error",$)}return!0},error:function($){if(this.isFinished)return!1;if(this.isPaused)this.generatedError=$;else{if(this.isFinished=!0,this.emit("error",$),this.previous)this.previous.error($);this.cleanUp()}return!0},on:function($,Q){return this._listeners[$].push(Q),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function($,Q){if(this._listeners[$])for(var q=0;q<this._listeners[$].length;q++)this._listeners[$][q].call(this,Q)},pipe:function($){return $.registerPrevious(this)},registerPrevious:function($){if(this.isLocked)throw Error("The stream '"+this+"' has already been used.");this.streamInfo=$.streamInfo,this.mergeStreamInfo(),this.previous=$;var Q=this;return $.on("data",function(q){Q.processChunk(q)}),$.on("end",function(){Q.end()}),$.on("error",function(q){Q.error(q)}),this},pause:function(){if(this.isPaused||this.isFinished)return!1;if(this.isPaused=!0,this.previous)this.previous.pause();return!0},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var $=!1;if(this.generatedError)this.error(this.generatedError),$=!0;if(this.previous)this.previous.resume();return!$},flush:function(){},processChunk:function($){this.push($)},withStreamInfo:function($,Q){return this.extraStreamInfo[$]=Q,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var $ in this.extraStreamInfo){if(!Object.prototype.hasOwnProperty.call(this.extraStreamInfo,$))continue;this.streamInfo[$]=this.extraStreamInfo[$]}},lock:function(){if(this.isLocked)throw Error("The stream '"+this+"' has already been used.");if(this.isLocked=!0,this.previous)this.previous.lock()},toString:function(){var $="Worker "+this.name;if(this.previous)return this.previous+" -> "+$;else return $}};p9.exports=c9});var o0=T((VG)=>{var l0=p(),B0=a1(),$G=A$(),D6=j1(),S$=Array(256);for(g1=0;g1<256;g1++)S$[g1]=g1>=252?6:g1>=248?5:g1>=240?4:g1>=224?3:g1>=192?2:1;var g1;S$[254]=S$[254]=1;var QG=function($){var Q,q,J,Y,X,V=$.length,G=0;for(Y=0;Y<V;Y++){if(q=$.charCodeAt(Y),(q&64512)===55296&&Y+1<V){if(J=$.charCodeAt(Y+1),(J&64512)===56320)q=65536+(q-55296<<10)+(J-56320),Y++}G+=q<128?1:q<2048?2:q<65536?3:4}if(B0.uint8array)Q=new Uint8Array(G);else Q=Array(G);for(X=0,Y=0;X<G;Y++){if(q=$.charCodeAt(Y),(q&64512)===55296&&Y+1<V){if(J=$.charCodeAt(Y+1),(J&64512)===56320)q=65536+(q-55296<<10)+(J-56320),Y++}if(q<128)Q[X++]=q;else if(q<2048)Q[X++]=192|q>>>6,Q[X++]=128|q&63;else if(q<65536)Q[X++]=224|q>>>12,Q[X++]=128|q>>>6&63,Q[X++]=128|q&63;else Q[X++]=240|q>>>18,Q[X++]=128|q>>>12&63,Q[X++]=128|q>>>6&63,Q[X++]=128|q&63}return Q},qG=function($,Q){var q;if(Q=Q||$.length,Q>$.length)Q=$.length;q=Q-1;while(q>=0&&($[q]&192)===128)q--;if(q<0)return Q;if(q===0)return Q;return q+S$[$[q]]>Q?q:Q},JG=function($){var Q,q,J,Y,X=$.length,V=Array(X*2);for(q=0,Q=0;Q<X;){if(J=$[Q++],J<128){V[q++]=J;continue}if(Y=S$[J],Y>4){V[q++]=65533,Q+=Y-1;continue}J&=Y===2?31:Y===3?15:7;while(Y>1&&Q<X)J=J<<6|$[Q++]&63,Y--;if(Y>1){V[q++]=65533;continue}if(J<65536)V[q++]=J;else J-=65536,V[q++]=55296|J>>10&1023,V[q++]=56320|J&1023}if(V.length!==q)if(V.subarray)V=V.subarray(0,q);else V.length=q;return l0.applyFromCharCode(V)};VG.utf8encode=function(Q){if(B0.nodebuffer)return $G.newBufferFrom(Q,"utf-8");return QG(Q)};VG.utf8decode=function(Q){if(B0.nodebuffer)return l0.transformTo("nodebuffer",Q).toString("utf-8");return Q=l0.transformTo(B0.uint8array?"uint8array":"array",Q),JG(Q)};function h6(){D6.call(this,"utf-8 decode"),this.leftOver=null}l0.inherits(h6,D6);h6.prototype.processChunk=function($){var Q=l0.transformTo(B0.uint8array?"uint8array":"array",$.data);if(this.leftOver&&this.leftOver.length){if(B0.uint8array){var q=Q;Q=new Uint8Array(q.length+this.leftOver.length),Q.set(this.leftOver,0),Q.set(q,this.leftOver.length)}else Q=this.leftOver.concat(Q);this.leftOver=null}var J=qG(Q),Y=Q;if(J!==Q.length)if(B0.uint8array)Y=Q.subarray(0,J),this.leftOver=Q.subarray(J,Q.length);else Y=Q.slice(0,J),this.leftOver=Q.slice(J,Q.length);this.push({data:VG.utf8decode(Y),meta:$.meta})};h6.prototype.flush=function(){if(this.leftOver&&this.leftOver.length)this.push({data:VG.utf8decode(this.leftOver),meta:{}}),this.leftOver=null};VG.Utf8DecodeWorker=h6;function T5(){D6.call(this,"utf-8 encode")}l0.inherits(T5,D6);T5.prototype.processChunk=function($){this.push({data:VG.utf8encode($.data),meta:$.meta})};VG.Utf8EncodeWorker=T5});var i9=T((qL,o9)=>{var d9=j1(),l9=p();function F5($){d9.call(this,"ConvertWorker to "+$),this.destType=$}l9.inherits(F5,d9);F5.prototype.processChunk=function($){this.push({data:l9.transformTo(this.destType,$.data),meta:$.meta})};o9.exports=F5});var a9=T((JL,r9)=>{var n9=H5().Readable,GG=p();GG.inherits(R5,n9);function R5($,Q,q){n9.call(this,Q),this._helper=$;var J=this;$.on("data",function(Y,X){if(!J.push(Y))J._helper.pause();if(q)q(X)}).on("error",function(Y){J.emit("error",Y)}).on("end",function(){J.push(null)})}R5.prototype._read=function(){this._helper.resume()};r9.exports=R5});var v5=T((VL,e9)=>{var N0=p(),KG=i9(),WG=j1(),UG=O5(),jG=a1(),ZG=u0(),s9=null;if(jG.nodestream)try{s9=a9()}catch($){}function zG($,Q,q){switch($){case"blob":return N0.newBlob(N0.transformTo("arraybuffer",Q),q);case"base64":return UG.encode(Q);default:return N0.transformTo($,Q)}}function HG($,Q){var q,J=0,Y=null,X=0;for(q=0;q<Q.length;q++)X+=Q[q].length;switch($){case"string":return Q.join("");case"array":return Array.prototype.concat.apply([],Q);case"uint8array":Y=new Uint8Array(X);for(q=0;q<Q.length;q++)Y.set(Q[q],J),J+=Q[q].length;return Y;case"nodebuffer":return Buffer.concat(Q);default:throw Error("concat : unsupported type '"+$+"'")}}function LG($,Q){return new ZG.Promise(function(q,J){var Y=[],X=$._internalType,V=$._outputType,G=$._mimeType;$.on("data",function(U,K){if(Y.push(U),Q)Q(K)}).on("error",function(U){Y=[],J(U)}).on("end",function(){try{var U=zG(V,HG(X,Y),G);q(U)}catch(K){J(K)}Y=[]}).resume()})}function t9($,Q,q){var J=Q;switch(Q){case"blob":case"arraybuffer":J="uint8array";break;case"base64":J="string";break}try{this._internalType=J,this._outputType=Q,this._mimeType=q,N0.checkSupport(J),this._worker=$.pipe(new KG(J)),$.lock()}catch(Y){this._worker=new WG("error"),this._worker.error(Y)}}t9.prototype={accumulate:function($){return LG(this,$)},on:function($,Q){var q=this;if($==="data")this._worker.on($,function(J){Q.call(q,J.data,J.meta)});else this._worker.on($,function(){N0.delay(Q,arguments,q)});return this},resume:function(){return N0.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function($){if(N0.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw Error(this._outputType+" is not supported by this method");return new s9(this,{objectMode:this._outputType!=="nodebuffer"},$)}};e9.exports=t9});var x5=T((PG)=>{PG.base64=!1;PG.binary=!1;PG.dir=!1;PG.createFolders=!0;PG.date=null;PG.compression=null;PG.compressionOptions=null;PG.comment=null;PG.unixPermissions=null;PG.dosPermissions=null});var S5=T((XL,$2)=>{var _6=p(),b6=j1(),RG=16384;function i0($){b6.call(this,"DataWorker");var Q=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,$.then(function(q){if(Q.dataIsReady=!0,Q.data=q,Q.max=q&&q.length||0,Q.type=_6.getTypeOf(q),!Q.isPaused)Q._tickAndRepeat()},function(q){Q.error(q)})}_6.inherits(i0,b6);i0.prototype.cleanUp=function(){b6.prototype.cleanUp.call(this),this.data=null};i0.prototype.resume=function(){if(!b6.prototype.resume.call(this))return!1;if(!this._tickScheduled&&this.dataIsReady)this._tickScheduled=!0,_6.delay(this._tickAndRepeat,[],this);return!0};i0.prototype._tickAndRepeat=function(){if(this._tickScheduled=!1,this.isPaused||this.isFinished)return;if(this._tick(),!this.isFinished)_6.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0};i0.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var $=RG,Q=null,q=Math.min(this.max,this.index+$);if(this.index>=this.max)return this.end();else{switch(this.type){case"string":Q=this.data.substring(this.index,q);break;case"uint8array":Q=this.data.subarray(this.index,q);break;case"array":case"nodebuffer":Q=this.data.slice(this.index,q);break}return this.index=q,this.push({data:Q,meta:{percent:this.max?this.index/this.max*100:0}})}};$2.exports=i0});var f6=T((GL,q2)=>{var vG=p();function xG(){var $,Q=[];for(var q=0;q<256;q++){$=q;for(var J=0;J<8;J++)$=$&1?3988292384^$>>>1:$>>>1;Q[q]=$}return Q}var Q2=xG();function SG($,Q,q,J){var Y=Q2,X=J+q;$=$^-1;for(var V=J;V<X;V++)$=$>>>8^Y[($^Q[V])&255];return $^-1}function EG($,Q,q,J){var Y=Q2,X=J+q;$=$^-1;for(var V=J;V<X;V++)$=$>>>8^Y[($^Q.charCodeAt(V))&255];return $^-1}q2.exports=function(Q,q){if(typeof Q>"u"||!Q.length)return 0;var J=vG.getTypeOf(Q)!=="string";if(J)return SG(q|0,Q,Q.length,0);else return EG(q|0,Q,Q.length,0)}});var y5=T((KL,V2)=>{var J2=j1(),yG=f6(),kG=p();function E5(){J2.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}kG.inherits(E5,J2);E5.prototype.processChunk=function($){this.streamInfo.crc32=yG($.data,this.streamInfo.crc32||0),this.push($)};V2.exports=E5});var X2=T((WL,Y2)=>{var gG=p(),k5=j1();function g5($){k5.call(this,"DataLengthProbe for "+$),this.propName=$,this.withStreamInfo($,0)}gG.inherits(g5,k5);g5.prototype.processChunk=function($){if($){var Q=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=Q+$.data.length}k5.prototype.processChunk.call(this,$)};Y2.exports=g5});var m6=T((UL,W2)=>{var G2=u0(),K2=S5(),DG=y5(),D5=X2();function h5($,Q,q,J,Y){this.compressedSize=$,this.uncompressedSize=Q,this.crc32=q,this.compression=J,this.compressedContent=Y}h5.prototype={getContentWorker:function(){var $=new K2(G2.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new D5("data_length")),Q=this;return $.on("end",function(){if(this.streamInfo.data_length!==Q.uncompressedSize)throw Error("Bug : uncompressed data size mismatch")}),$},getCompressedWorker:function(){return new K2(G2.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}};h5.createWorkerFrom=function($,Q,q){return $.pipe(new DG).pipe(new D5("uncompressedSize")).pipe(Q.compressWorker(q)).pipe(new D5("compressedSize")).withStreamInfo("compression",Q)};W2.exports=h5});var z2=T((jL,Z2)=>{var hG=v5(),_G=S5(),_5=o0(),b5=m6(),U2=j1(),f5=function($,Q,q){this.name=$,this.dir=q.dir,this.date=q.date,this.comment=q.comment,this.unixPermissions=q.unixPermissions,this.dosPermissions=q.dosPermissions,this._data=Q,this._dataBinary=q.binary,this.options={compression:q.compression,compressionOptions:q.compressionOptions}};f5.prototype={internalStream:function($){var Q=null,q="string";try{if(!$)throw Error("No output type specified.");q=$.toLowerCase();var J=q==="string"||q==="text";if(q==="binarystring"||q==="text")q="string";Q=this._decompressWorker();var Y=!this._dataBinary;if(Y&&!J)Q=Q.pipe(new _5.Utf8EncodeWorker);if(!Y&&J)Q=Q.pipe(new _5.Utf8DecodeWorker)}catch(X){Q=new U2("error"),Q.error(X)}return new hG(Q,q,"")},async:function($,Q){return this.internalStream($).accumulate(Q)},nodeStream:function($,Q){return this.internalStream($||"nodebuffer").toNodejsStream(Q)},_compressWorker:function($,Q){if(this._data instanceof b5&&this._data.compression.magic===$.magic)return this._data.getCompressedWorker();else{var q=this._decompressWorker();if(!this._dataBinary)q=q.pipe(new _5.Utf8EncodeWorker);return b5.createWorkerFrom(q,$,Q)}},_decompressWorker:function(){if(this._data instanceof b5)return this._data.getContentWorker();else if(this._data instanceof U2)return this._data;else return new _G(this._data)}};var j2=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],bG=function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(E$=0;E$<j2.length;E$++)f5.prototype[j2[E$]]=bG;var E$;Z2.exports=f5});var s1=T((m5)=>{var pG=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function uG($,Q){return Object.prototype.hasOwnProperty.call($,Q)}m5.assign=function($){var Q=Array.prototype.slice.call(arguments,1);while(Q.length){var q=Q.shift();if(!q)continue;if(typeof q!=="object")throw TypeError(q+"must be non-object");for(var J in q)if(uG(q,J))$[J]=q[J]}return $};m5.shrinkBuf=function($,Q){if($.length===Q)return $;if($.subarray)return $.subarray(0,Q);return $.length=Q,$};var dG={arraySet:function($,Q,q,J,Y){if(Q.subarray&&$.subarray){$.set(Q.subarray(q,q+J),Y);return}for(var X=0;X<J;X++)$[Y+X]=Q[q+X]},flattenChunks:function($){var Q,q,J,Y,X,V;J=0;for(Q=0,q=$.length;Q<q;Q++)J+=$[Q].length;V=new Uint8Array(J),Y=0;for(Q=0,q=$.length;Q<q;Q++)X=$[Q],V.set(X,Y),Y+=X.length;return V}},lG={arraySet:function($,Q,q,J,Y){for(var X=0;X<J;X++)$[Y+X]=Q[q+X]},flattenChunks:function($){return[].concat.apply([],$)}};m5.setTyped=function($){if($)m5.Buf8=Uint8Array,m5.Buf16=Uint16Array,m5.Buf32=Int32Array,m5.assign(m5,dG);else m5.Buf8=Array,m5.Buf16=Array,m5.Buf32=Array,m5.assign(m5,lG)};m5.setTyped(pG)});var _2=T((HK)=>{var iG=s1(),nG=4,L2=0,P2=1,rG=2;function r0($){var Q=$.length;while(--Q>=0)$[Q]=0}var aG=0,C2=1,sG=2,tG=3,eG=258,n5=29,_$=256,k$=_$+1+n5,n0=30,r5=19,w2=2*k$+1,I0=15,p5=16,$K=7,a5=256,T2=16,A2=17,F2=18,o5=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],c6=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],QK=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],R2=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],qK=512,t1=Array((k$+2)*2);r0(t1);var y$=Array(n0*2);r0(y$);var g$=Array(qK);r0(g$);var D$=Array(eG-tG+1);r0(D$);var s5=Array(n5);r0(s5);var p6=Array(n0);r0(p6);function u5($,Q,q,J,Y){this.static_tree=$,this.extra_bits=Q,this.extra_base=q,this.elems=J,this.max_length=Y,this.has_stree=$&&$.length}var v2,x2,S2;function d5($,Q){this.dyn_tree=$,this.max_code=0,this.stat_desc=Q}function E2($){return $<256?g$[$]:g$[256+($>>>7)]}function h$($,Q){$.pending_buf[$.pending++]=Q&255,$.pending_buf[$.pending++]=Q>>>8&255}function X1($,Q,q){if($.bi_valid>p5-q)$.bi_buf|=Q<<$.bi_valid&65535,h$($,$.bi_buf),$.bi_buf=Q>>p5-$.bi_valid,$.bi_valid+=q-p5;else $.bi_buf|=Q<<$.bi_valid&65535,$.bi_valid+=q}function D1($,Q,q){X1($,q[Q*2],q[Q*2+1])}function y2($,Q){var q=0;do q|=$&1,$>>>=1,q<<=1;while(--Q>0);return q>>>1}function JK($){if($.bi_valid===16)h$($,$.bi_buf),$.bi_buf=0,$.bi_valid=0;else if($.bi_valid>=8)$.pending_buf[$.pending++]=$.bi_buf&255,$.bi_buf>>=8,$.bi_valid-=8}function VK($,Q){var{dyn_tree:q,max_code:J}=Q,Y=Q.stat_desc.static_tree,X=Q.stat_desc.has_stree,V=Q.stat_desc.extra_bits,G=Q.stat_desc.extra_base,U=Q.stat_desc.max_length,K,W,z,Z,H,C,I=0;for(Z=0;Z<=I0;Z++)$.bl_count[Z]=0;q[$.heap[$.heap_max]*2+1]=0;for(K=$.heap_max+1;K<w2;K++){if(W=$.heap[K],Z=q[q[W*2+1]*2+1]+1,Z>U)Z=U,I++;if(q[W*2+1]=Z,W>J)continue;if($.bl_count[Z]++,H=0,W>=G)H=V[W-G];if(C=q[W*2],$.opt_len+=C*(Z+H),X)$.static_len+=C*(Y[W*2+1]+H)}if(I===0)return;do{Z=U-1;while($.bl_count[Z]===0)Z--;$.bl_count[Z]--,$.bl_count[Z+1]+=2,$.bl_count[U]--,I-=2}while(I>0);for(Z=U;Z!==0;Z--){W=$.bl_count[Z];while(W!==0){if(z=$.heap[--K],z>J)continue;if(q[z*2+1]!==Z)$.opt_len+=(Z-q[z*2+1])*q[z*2],q[z*2+1]=Z;W--}}}function k2($,Q,q){var J=Array(I0+1),Y=0,X,V;for(X=1;X<=I0;X++)J[X]=Y=Y+q[X-1]<<1;for(V=0;V<=Q;V++){var G=$[V*2+1];if(G===0)continue;$[V*2]=y2(J[G]++,G)}}function YK(){var $,Q,q,J,Y,X=Array(I0+1);q=0;for(J=0;J<n5-1;J++){s5[J]=q;for($=0;$<1<<o5[J];$++)D$[q++]=J}D$[q-1]=J,Y=0;for(J=0;J<16;J++){p6[J]=Y;for($=0;$<1<<c6[J];$++)g$[Y++]=J}Y>>=7;for(;J<n0;J++){p6[J]=Y<<7;for($=0;$<1<<c6[J]-7;$++)g$[256+Y++]=J}for(Q=0;Q<=I0;Q++)X[Q]=0;$=0;while($<=143)t1[$*2+1]=8,$++,X[8]++;while($<=255)t1[$*2+1]=9,$++,X[9]++;while($<=279)t1[$*2+1]=7,$++,X[7]++;while($<=287)t1[$*2+1]=8,$++,X[8]++;k2(t1,k$+1,X);for($=0;$<n0;$++)y$[$*2+1]=5,y$[$*2]=y2($,5);v2=new u5(t1,o5,_$+1,k$,I0),x2=new u5(y$,c6,0,n0,I0),S2=new u5([],QK,0,r5,$K)}function g2($){var Q;for(Q=0;Q<k$;Q++)$.dyn_ltree[Q*2]=0;for(Q=0;Q<n0;Q++)$.dyn_dtree[Q*2]=0;for(Q=0;Q<r5;Q++)$.bl_tree[Q*2]=0;$.dyn_ltree[a5*2]=1,$.opt_len=$.static_len=0,$.last_lit=$.matches=0}function D2($){if($.bi_valid>8)h$($,$.bi_buf);else if($.bi_valid>0)$.pending_buf[$.pending++]=$.bi_buf;$.bi_buf=0,$.bi_valid=0}function XK($,Q,q,J){if(D2($),J)h$($,q),h$($,~q);iG.arraySet($.pending_buf,$.window,Q,q,$.pending),$.pending+=q}function O2($,Q,q,J){var Y=Q*2,X=q*2;return $[Y]<$[X]||$[Y]===$[X]&&J[Q]<=J[q]}function l5($,Q,q){var J=$.heap[q],Y=q<<1;while(Y<=$.heap_len){if(Y<$.heap_len&&O2(Q,$.heap[Y+1],$.heap[Y],$.depth))Y++;if(O2(Q,J,$.heap[Y],$.depth))break;$.heap[q]=$.heap[Y],q=Y,Y<<=1}$.heap[q]=J}function M2($,Q,q){var J,Y,X=0,V,G;if($.last_lit!==0)do if(J=$.pending_buf[$.d_buf+X*2]<<8|$.pending_buf[$.d_buf+X*2+1],Y=$.pending_buf[$.l_buf+X],X++,J===0)D1($,Y,Q);else{if(V=D$[Y],D1($,V+_$+1,Q),G=o5[V],G!==0)Y-=s5[V],X1($,Y,G);if(J--,V=E2(J),D1($,V,q),G=c6[V],G!==0)J-=p6[V],X1($,J,G)}while(X<$.last_lit);D1($,a5,Q)}function i5($,Q){var q=Q.dyn_tree,J=Q.stat_desc.static_tree,Y=Q.stat_desc.has_stree,X=Q.stat_desc.elems,V,G,U=-1,K;$.heap_len=0,$.heap_max=w2;for(V=0;V<X;V++)if(q[V*2]!==0)$.heap[++$.heap_len]=U=V,$.depth[V]=0;else q[V*2+1]=0;while($.heap_len<2)if(K=$.heap[++$.heap_len]=U<2?++U:0,q[K*2]=1,$.depth[K]=0,$.opt_len--,Y)$.static_len-=J[K*2+1];Q.max_code=U;for(V=$.heap_len>>1;V>=1;V--)l5($,q,V);K=X;do V=$.heap[1],$.heap[1]=$.heap[$.heap_len--],l5($,q,1),G=$.heap[1],$.heap[--$.heap_max]=V,$.heap[--$.heap_max]=G,q[K*2]=q[V*2]+q[G*2],$.depth[K]=($.depth[V]>=$.depth[G]?$.depth[V]:$.depth[G])+1,q[V*2+1]=q[G*2+1]=K,$.heap[1]=K++,l5($,q,1);while($.heap_len>=2);$.heap[--$.heap_max]=$.heap[1],VK($,Q),k2(q,U,$.bl_count)}function B2($,Q,q){var J,Y=-1,X,V=Q[1],G=0,U=7,K=4;if(V===0)U=138,K=3;Q[(q+1)*2+1]=65535;for(J=0;J<=q;J++){if(X=V,V=Q[(J+1)*2+1],++G<U&&X===V)continue;else if(G<K)$.bl_tree[X*2]+=G;else if(X!==0){if(X!==Y)$.bl_tree[X*2]++;$.bl_tree[T2*2]++}else if(G<=10)$.bl_tree[A2*2]++;else $.bl_tree[F2*2]++;if(G=0,Y=X,V===0)U=138,K=3;else if(X===V)U=6,K=3;else U=7,K=4}}function N2($,Q,q){var J,Y=-1,X,V=Q[1],G=0,U=7,K=4;if(V===0)U=138,K=3;for(J=0;J<=q;J++){if(X=V,V=Q[(J+1)*2+1],++G<U&&X===V)continue;else if(G<K)do D1($,X,$.bl_tree);while(--G!==0);else if(X!==0){if(X!==Y)D1($,X,$.bl_tree),G--;D1($,T2,$.bl_tree),X1($,G-3,2)}else if(G<=10)D1($,A2,$.bl_tree),X1($,G-3,3);else D1($,F2,$.bl_tree),X1($,G-11,7);if(G=0,Y=X,V===0)U=138,K=3;else if(X===V)U=6,K=3;else U=7,K=4}}function GK($){var Q;B2($,$.dyn_ltree,$.l_desc.max_code),B2($,$.dyn_dtree,$.d_desc.max_code),i5($,$.bl_desc);for(Q=r5-1;Q>=3;Q--)if($.bl_tree[R2[Q]*2+1]!==0)break;return $.opt_len+=3*(Q+1)+5+5+4,Q}function KK($,Q,q,J){var Y;X1($,Q-257,5),X1($,q-1,5),X1($,J-4,4);for(Y=0;Y<J;Y++)X1($,$.bl_tree[R2[Y]*2+1],3);N2($,$.dyn_ltree,Q-1),N2($,$.dyn_dtree,q-1)}function WK($){var Q=4093624447,q;for(q=0;q<=31;q++,Q>>>=1)if(Q&1&&$.dyn_ltree[q*2]!==0)return L2;if($.dyn_ltree[18]!==0||$.dyn_ltree[20]!==0||$.dyn_ltree[26]!==0)return P2;for(q=32;q<_$;q++)if($.dyn_ltree[q*2]!==0)return P2;return L2}var I2=!1;function UK($){if(!I2)YK(),I2=!0;$.l_desc=new d5($.dyn_ltree,v2),$.d_desc=new d5($.dyn_dtree,x2),$.bl_desc=new d5($.bl_tree,S2),$.bi_buf=0,$.bi_valid=0,g2($)}function h2($,Q,q,J){X1($,(aG<<1)+(J?1:0),3),XK($,Q,q,!0)}function jK($){X1($,C2<<1,3),D1($,a5,t1),JK($)}function ZK($,Q,q,J){var Y,X,V=0;if($.level>0){if($.strm.data_type===rG)$.strm.data_type=WK($);if(i5($,$.l_desc),i5($,$.d_desc),V=GK($),Y=$.opt_len+3+7>>>3,X=$.static_len+3+7>>>3,X<=Y)Y=X}else Y=X=q+5;if(q+4<=Y&&Q!==-1)h2($,Q,q,J);else if($.strategy===nG||X===Y)X1($,(C2<<1)+(J?1:0),3),M2($,t1,y$);else X1($,(sG<<1)+(J?1:0),3),KK($,$.l_desc.max_code+1,$.d_desc.max_code+1,V+1),M2($,$.dyn_ltree,$.dyn_dtree);if(g2($),J)D2($)}function zK($,Q,q){if($.pending_buf[$.d_buf+$.last_lit*2]=Q>>>8&255,$.pending_buf[$.d_buf+$.last_lit*2+1]=Q&255,$.pending_buf[$.l_buf+$.last_lit]=q&255,$.last_lit++,Q===0)$.dyn_ltree[q*2]++;else $.matches++,Q--,$.dyn_ltree[(D$[q]+_$+1)*2]++,$.dyn_dtree[E2(Q)*2]++;return $.last_lit===$.lit_bufsize-1}HK._tr_init=UK;HK._tr_stored_block=h2;HK._tr_flush_block=ZK;HK._tr_tally=zK;HK._tr_align=jK});var t5=T((HL,b2)=>{function NK($,Q,q,J){var Y=$&65535|0,X=$>>>16&65535|0,V=0;while(q!==0){V=q>2000?2000:q,q-=V;do Y=Y+Q[J++]|0,X=X+Y|0;while(--V);Y%=65521,X%=65521}return Y|X<<16|0}b2.exports=NK});var e5=T((LL,f2)=>{function IK(){var $,Q=[];for(var q=0;q<256;q++){$=q;for(var J=0;J<8;J++)$=$&1?3988292384^$>>>1:$>>>1;Q[q]=$}return Q}var CK=IK();function wK($,Q,q,J){var Y=CK,X=J+q;$^=-1;for(var V=J;V<X;V++)$=$>>>8^Y[($^Q[V])&255];return $^-1}f2.exports=wK});var u6=T((PL,m2)=>{m2.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var r2=T((qW)=>{var J1=s1(),L1=_2(),d2=t5(),K0=e5(),TK=u6(),A0=0,AK=1,FK=3,z0=4,c2=5,_1=0,p2=1,P1=-2,RK=-3,$Q=-5,vK=-1,xK=1,d6=2,SK=3,EK=4,yK=0,kK=2,n6=8,gK=9,DK=15,hK=8,_K=29,bK=256,qQ=bK+1+_K,fK=30,mK=19,cK=2*qQ+1,pK=15,S=3,j0=258,R1=j0+S+1,uK=32,r6=42,JQ=69,l6=73,o6=91,i6=103,C0=113,f$=666,n=1,m$=2,w0=3,t0=4,dK=3;function Z0($,Q){return $.msg=TK[Q],Q}function u2($){return($<<1)-($>4?9:0)}function U0($){var Q=$.length;while(--Q>=0)$[Q]=0}function W0($){var Q=$.state,q=Q.pending;if(q>$.avail_out)q=$.avail_out;if(q===0)return;if(J1.arraySet($.output,Q.pending_buf,Q.pending_out,q,$.next_out),$.next_out+=q,Q.pending_out+=q,$.total_out+=q,$.avail_out-=q,Q.pending-=q,Q.pending===0)Q.pending_out=0}function t($,Q){L1._tr_flush_block($,$.block_start>=0?$.block_start:-1,$.strstart-$.block_start,Q),$.block_start=$.strstart,W0($.strm)}function E($,Q){$.pending_buf[$.pending++]=Q}function b$($,Q){$.pending_buf[$.pending++]=Q>>>8&255,$.pending_buf[$.pending++]=Q&255}function lK($,Q,q,J){var Y=$.avail_in;if(Y>J)Y=J;if(Y===0)return 0;if($.avail_in-=Y,J1.arraySet(Q,$.input,$.next_in,Y,q),$.state.wrap===1)$.adler=d2($.adler,Q,Y,q);else if($.state.wrap===2)$.adler=K0($.adler,Q,Y,q);return $.next_in+=Y,$.total_in+=Y,Y}function l2($,Q){var{max_chain_length:q,strstart:J}=$,Y,X,V=$.prev_length,G=$.nice_match,U=$.strstart>$.w_size-R1?$.strstart-($.w_size-R1):0,K=$.window,W=$.w_mask,z=$.prev,Z=$.strstart+j0,H=K[J+V-1],C=K[J+V];if($.prev_length>=$.good_match)q>>=2;if(G>$.lookahead)G=$.lookahead;do{if(Y=Q,K[Y+V]!==C||K[Y+V-1]!==H||K[Y]!==K[J]||K[++Y]!==K[J+1])continue;J+=2,Y++;do;while(K[++J]===K[++Y]&&K[++J]===K[++Y]&&K[++J]===K[++Y]&&K[++J]===K[++Y]&&K[++J]===K[++Y]&&K[++J]===K[++Y]&&K[++J]===K[++Y]&&K[++J]===K[++Y]&&J<Z);if(X=j0-(Z-J),J=Z-j0,X>V){if($.match_start=Q,V=X,X>=G)break;H=K[J+V-1],C=K[J+V]}}while((Q=z[Q&W])>U&&--q!==0);if(V<=$.lookahead)return V;return $.lookahead}function T0($){var Q=$.w_size,q,J,Y,X,V;do{if(X=$.window_size-$.lookahead-$.strstart,$.strstart>=Q+(Q-R1)){J1.arraySet($.window,$.window,Q,Q,0),$.match_start-=Q,$.strstart-=Q,$.block_start-=Q,J=$.hash_size,q=J;do Y=$.head[--q],$.head[q]=Y>=Q?Y-Q:0;while(--J);J=Q,q=J;do Y=$.prev[--q],$.prev[q]=Y>=Q?Y-Q:0;while(--J);X+=Q}if($.strm.avail_in===0)break;if(J=lK($.strm,$.window,$.strstart+$.lookahead,X),$.lookahead+=J,$.lookahead+$.insert>=S){V=$.strstart-$.insert,$.ins_h=$.window[V],$.ins_h=($.ins_h<<$.hash_shift^$.window[V+1])&$.hash_mask;while($.insert)if($.ins_h=($.ins_h<<$.hash_shift^$.window[V+S-1])&$.hash_mask,$.prev[V&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=V,V++,$.insert--,$.lookahead+$.insert<S)break}}while($.lookahead<R1&&$.strm.avail_in!==0)}function oK($,Q){var q=65535;if(q>$.pending_buf_size-5)q=$.pending_buf_size-5;for(;;){if($.lookahead<=1){if(T0($),$.lookahead===0&&Q===A0)return n;if($.lookahead===0)break}$.strstart+=$.lookahead,$.lookahead=0;var J=$.block_start+q;if($.strstart===0||$.strstart>=J){if($.lookahead=$.strstart-J,$.strstart=J,t($,!1),$.strm.avail_out===0)return n}if($.strstart-$.block_start>=$.w_size-R1){if(t($,!1),$.strm.avail_out===0)return n}}if($.insert=0,Q===z0){if(t($,!0),$.strm.avail_out===0)return w0;return t0}if($.strstart>$.block_start){if(t($,!1),$.strm.avail_out===0)return n}return n}function QQ($,Q){var q,J;for(;;){if($.lookahead<R1){if(T0($),$.lookahead<R1&&Q===A0)return n;if($.lookahead===0)break}if(q=0,$.lookahead>=S)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+S-1])&$.hash_mask,q=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if(q!==0&&$.strstart-q<=$.w_size-R1)$.match_length=l2($,q);if($.match_length>=S)if(J=L1._tr_tally($,$.strstart-$.match_start,$.match_length-S),$.lookahead-=$.match_length,$.match_length<=$.max_lazy_match&&$.lookahead>=S){$.match_length--;do $.strstart++,$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+S-1])&$.hash_mask,q=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.match_length!==0);$.strstart++}else $.strstart+=$.match_length,$.match_length=0,$.ins_h=$.window[$.strstart],$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+1])&$.hash_mask;else J=L1._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(J){if(t($,!1),$.strm.avail_out===0)return n}}if($.insert=$.strstart<S-1?$.strstart:S-1,Q===z0){if(t($,!0),$.strm.avail_out===0)return w0;return t0}if($.last_lit){if(t($,!1),$.strm.avail_out===0)return n}return m$}function a0($,Q){var q,J,Y;for(;;){if($.lookahead<R1){if(T0($),$.lookahead<R1&&Q===A0)return n;if($.lookahead===0)break}if(q=0,$.lookahead>=S)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+S-1])&$.hash_mask,q=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if($.prev_length=$.match_length,$.prev_match=$.match_start,$.match_length=S-1,q!==0&&$.prev_length<$.max_lazy_match&&$.strstart-q<=$.w_size-R1){if($.match_length=l2($,q),$.match_length<=5&&($.strategy===xK||$.match_length===S&&$.strstart-$.match_start>4096))$.match_length=S-1}if($.prev_length>=S&&$.match_length<=$.prev_length){Y=$.strstart+$.lookahead-S,J=L1._tr_tally($,$.strstart-1-$.prev_match,$.prev_length-S),$.lookahead-=$.prev_length-1,$.prev_length-=2;do if(++$.strstart<=Y)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+S-1])&$.hash_mask,q=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.prev_length!==0);if($.match_available=0,$.match_length=S-1,$.strstart++,J){if(t($,!1),$.strm.avail_out===0)return n}}else if($.match_available){if(J=L1._tr_tally($,0,$.window[$.strstart-1]),J)t($,!1);if($.strstart++,$.lookahead--,$.strm.avail_out===0)return n}else $.match_available=1,$.strstart++,$.lookahead--}if($.match_available)J=L1._tr_tally($,0,$.window[$.strstart-1]),$.match_available=0;if($.insert=$.strstart<S-1?$.strstart:S-1,Q===z0){if(t($,!0),$.strm.avail_out===0)return w0;return t0}if($.last_lit){if(t($,!1),$.strm.avail_out===0)return n}return m$}function iK($,Q){var q,J,Y,X,V=$.window;for(;;){if($.lookahead<=j0){if(T0($),$.lookahead<=j0&&Q===A0)return n;if($.lookahead===0)break}if($.match_length=0,$.lookahead>=S&&$.strstart>0){if(Y=$.strstart-1,J=V[Y],J===V[++Y]&&J===V[++Y]&&J===V[++Y]){X=$.strstart+j0;do;while(J===V[++Y]&&J===V[++Y]&&J===V[++Y]&&J===V[++Y]&&J===V[++Y]&&J===V[++Y]&&J===V[++Y]&&J===V[++Y]&&Y<X);if($.match_length=j0-(X-Y),$.match_length>$.lookahead)$.match_length=$.lookahead}}if($.match_length>=S)q=L1._tr_tally($,1,$.match_length-S),$.lookahead-=$.match_length,$.strstart+=$.match_length,$.match_length=0;else q=L1._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(q){if(t($,!1),$.strm.avail_out===0)return n}}if($.insert=0,Q===z0){if(t($,!0),$.strm.avail_out===0)return w0;return t0}if($.last_lit){if(t($,!1),$.strm.avail_out===0)return n}return m$}function nK($,Q){var q;for(;;){if($.lookahead===0){if(T0($),$.lookahead===0){if(Q===A0)return n;break}}if($.match_length=0,q=L1._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++,q){if(t($,!1),$.strm.avail_out===0)return n}}if($.insert=0,Q===z0){if(t($,!0),$.strm.avail_out===0)return w0;return t0}if($.last_lit){if(t($,!1),$.strm.avail_out===0)return n}return m$}function h1($,Q,q,J,Y){this.good_length=$,this.max_lazy=Q,this.nice_length=q,this.max_chain=J,this.func=Y}var s0;s0=[new h1(0,0,0,0,oK),new h1(4,4,8,4,QQ),new h1(4,5,16,8,QQ),new h1(4,6,32,32,QQ),new h1(4,4,16,16,a0),new h1(8,16,32,32,a0),new h1(8,16,128,128,a0),new h1(8,32,128,256,a0),new h1(32,128,258,1024,a0),new h1(32,258,258,4096,a0)];function rK($){$.window_size=2*$.w_size,U0($.head),$.max_lazy_match=s0[$.level].max_lazy,$.good_match=s0[$.level].good_length,$.nice_match=s0[$.level].nice_length,$.max_chain_length=s0[$.level].max_chain,$.strstart=0,$.block_start=0,$.lookahead=0,$.insert=0,$.match_length=$.prev_length=S-1,$.match_available=0,$.ins_h=0}function aK(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=n6,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new J1.Buf16(cK*2),this.dyn_dtree=new J1.Buf16((2*fK+1)*2),this.bl_tree=new J1.Buf16((2*mK+1)*2),U0(this.dyn_ltree),U0(this.dyn_dtree),U0(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new J1.Buf16(pK+1),this.heap=new J1.Buf16(2*qQ+1),U0(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new J1.Buf16(2*qQ+1),U0(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function o2($){var Q;if(!$||!$.state)return Z0($,P1);if($.total_in=$.total_out=0,$.data_type=kK,Q=$.state,Q.pending=0,Q.pending_out=0,Q.wrap<0)Q.wrap=-Q.wrap;return Q.status=Q.wrap?r6:C0,$.adler=Q.wrap===2?0:1,Q.last_flush=A0,L1._tr_init(Q),_1}function i2($){var Q=o2($);if(Q===_1)rK($.state);return Q}function sK($,Q){if(!$||!$.state)return P1;if($.state.wrap!==2)return P1;return $.state.gzhead=Q,_1}function n2($,Q,q,J,Y,X){if(!$)return P1;var V=1;if(Q===vK)Q=6;if(J<0)V=0,J=-J;else if(J>15)V=2,J-=16;if(Y<1||Y>gK||q!==n6||J<8||J>15||Q<0||Q>9||X<0||X>EK)return Z0($,P1);if(J===8)J=9;var G=new aK;return $.state=G,G.strm=$,G.wrap=V,G.gzhead=null,G.w_bits=J,G.w_size=1<<G.w_bits,G.w_mask=G.w_size-1,G.hash_bits=Y+7,G.hash_size=1<<G.hash_bits,G.hash_mask=G.hash_size-1,G.hash_shift=~~((G.hash_bits+S-1)/S),G.window=new J1.Buf8(G.w_size*2),G.head=new J1.Buf16(G.hash_size),G.prev=new J1.Buf16(G.w_size),G.lit_bufsize=1<<Y+6,G.pending_buf_size=G.lit_bufsize*4,G.pending_buf=new J1.Buf8(G.pending_buf_size),G.d_buf=1*G.lit_bufsize,G.l_buf=3*G.lit_bufsize,G.level=Q,G.strategy=X,G.method=q,i2($)}function tK($,Q){return n2($,Q,n6,DK,hK,yK)}function eK($,Q){var q,J,Y,X;if(!$||!$.state||Q>c2||Q<0)return $?Z0($,P1):P1;if(J=$.state,!$.output||!$.input&&$.avail_in!==0||J.status===f$&&Q!==z0)return Z0($,$.avail_out===0?$Q:P1);if(J.strm=$,q=J.last_flush,J.last_flush=Q,J.status===r6)if(J.wrap===2)if($.adler=0,E(J,31),E(J,139),E(J,8),!J.gzhead)E(J,0),E(J,0),E(J,0),E(J,0),E(J,0),E(J,J.level===9?2:J.strategy>=d6||J.level<2?4:0),E(J,dK),J.status=C0;else{if(E(J,(J.gzhead.text?1:0)+(J.gzhead.hcrc?2:0)+(!J.gzhead.extra?0:4)+(!J.gzhead.name?0:8)+(!J.gzhead.comment?0:16)),E(J,J.gzhead.time&255),E(J,J.gzhead.time>>8&255),E(J,J.gzhead.time>>16&255),E(J,J.gzhead.time>>24&255),E(J,J.level===9?2:J.strategy>=d6||J.level<2?4:0),E(J,J.gzhead.os&255),J.gzhead.extra&&J.gzhead.extra.length)E(J,J.gzhead.extra.length&255),E(J,J.gzhead.extra.length>>8&255);if(J.gzhead.hcrc)$.adler=K0($.adler,J.pending_buf,J.pending,0);J.gzindex=0,J.status=JQ}else{var V=n6+(J.w_bits-8<<4)<<8,G=-1;if(J.strategy>=d6||J.level<2)G=0;else if(J.level<6)G=1;else if(J.level===6)G=2;else G=3;if(V|=G<<6,J.strstart!==0)V|=uK;if(V+=31-V%31,J.status=C0,b$(J,V),J.strstart!==0)b$(J,$.adler>>>16),b$(J,$.adler&65535);$.adler=1}if(J.status===JQ)if(J.gzhead.extra){Y=J.pending;while(J.gzindex<(J.gzhead.extra.length&65535)){if(J.pending===J.pending_buf_size){if(J.gzhead.hcrc&&J.pending>Y)$.adler=K0($.adler,J.pending_buf,J.pending-Y,Y);if(W0($),Y=J.pending,J.pending===J.pending_buf_size)break}E(J,J.gzhead.extra[J.gzindex]&255),J.gzindex++}if(J.gzhead.hcrc&&J.pending>Y)$.adler=K0($.adler,J.pending_buf,J.pending-Y,Y);if(J.gzindex===J.gzhead.extra.length)J.gzindex=0,J.status=l6}else J.status=l6;if(J.status===l6)if(J.gzhead.name){Y=J.pending;do{if(J.pending===J.pending_buf_size){if(J.gzhead.hcrc&&J.pending>Y)$.adler=K0($.adler,J.pending_buf,J.pending-Y,Y);if(W0($),Y=J.pending,J.pending===J.pending_buf_size){X=1;break}}if(J.gzindex<J.gzhead.name.length)X=J.gzhead.name.charCodeAt(J.gzindex++)&255;else X=0;E(J,X)}while(X!==0);if(J.gzhead.hcrc&&J.pending>Y)$.adler=K0($.adler,J.pending_buf,J.pending-Y,Y);if(X===0)J.gzindex=0,J.status=o6}else J.status=o6;if(J.status===o6)if(J.gzhead.comment){Y=J.pending;do{if(J.pending===J.pending_buf_size){if(J.gzhead.hcrc&&J.pending>Y)$.adler=K0($.adler,J.pending_buf,J.pending-Y,Y);if(W0($),Y=J.pending,J.pending===J.pending_buf_size){X=1;break}}if(J.gzindex<J.gzhead.comment.length)X=J.gzhead.comment.charCodeAt(J.gzindex++)&255;else X=0;E(J,X)}while(X!==0);if(J.gzhead.hcrc&&J.pending>Y)$.adler=K0($.adler,J.pending_buf,J.pending-Y,Y);if(X===0)J.status=i6}else J.status=i6;if(J.status===i6)if(J.gzhead.hcrc){if(J.pending+2>J.pending_buf_size)W0($);if(J.pending+2<=J.pending_buf_size)E(J,$.adler&255),E(J,$.adler>>8&255),$.adler=0,J.status=C0}else J.status=C0;if(J.pending!==0){if(W0($),$.avail_out===0)return J.last_flush=-1,_1}else if($.avail_in===0&&u2(Q)<=u2(q)&&Q!==z0)return Z0($,$Q);if(J.status===f$&&$.avail_in!==0)return Z0($,$Q);if($.avail_in!==0||J.lookahead!==0||Q!==A0&&J.status!==f$){var U=J.strategy===d6?nK(J,Q):J.strategy===SK?iK(J,Q):s0[J.level].func(J,Q);if(U===w0||U===t0)J.status=f$;if(U===n||U===w0){if($.avail_out===0)J.last_flush=-1;return _1}if(U===m$){if(Q===AK)L1._tr_align(J);else if(Q!==c2){if(L1._tr_stored_block(J,0,0,!1),Q===FK){if(U0(J.head),J.lookahead===0)J.strstart=0,J.block_start=0,J.insert=0}}if(W0($),$.avail_out===0)return J.last_flush=-1,_1}}if(Q!==z0)return _1;if(J.wrap<=0)return p2;if(J.wrap===2)E(J,$.adler&255),E(J,$.adler>>8&255),E(J,$.adler>>16&255),E(J,$.adler>>24&255),E(J,$.total_in&255),E(J,$.total_in>>8&255),E(J,$.total_in>>16&255),E(J,$.total_in>>24&255);else b$(J,$.adler>>>16),b$(J,$.adler&65535);if(W0($),J.wrap>0)J.wrap=-J.wrap;return J.pending!==0?_1:p2}function $W($){var Q;if(!$||!$.state)return P1;if(Q=$.state.status,Q!==r6&&Q!==JQ&&Q!==l6&&Q!==o6&&Q!==i6&&Q!==C0&&Q!==f$)return Z0($,P1);return $.state=null,Q===C0?Z0($,RK):_1}function QW($,Q){var q=Q.length,J,Y,X,V,G,U,K,W;if(!$||!$.state)return P1;if(J=$.state,V=J.wrap,V===2||V===1&&J.status!==r6||J.lookahead)return P1;if(V===1)$.adler=d2($.adler,Q,q,0);if(J.wrap=0,q>=J.w_size){if(V===0)U0(J.head),J.strstart=0,J.block_start=0,J.insert=0;W=new J1.Buf8(J.w_size),J1.arraySet(W,Q,q-J.w_size,J.w_size,0),Q=W,q=J.w_size}G=$.avail_in,U=$.next_in,K=$.input,$.avail_in=q,$.next_in=0,$.input=Q,T0(J);while(J.lookahead>=S){Y=J.strstart,X=J.lookahead-(S-1);do J.ins_h=(J.ins_h<<J.hash_shift^J.window[Y+S-1])&J.hash_mask,J.prev[Y&J.w_mask]=J.head[J.ins_h],J.head[J.ins_h]=Y,Y++;while(--X);J.strstart=Y,J.lookahead=S-1,T0(J)}return J.strstart+=J.lookahead,J.block_start=J.strstart,J.insert=J.lookahead,J.lookahead=0,J.match_length=J.prev_length=S-1,J.match_available=0,$.next_in=U,$.input=K,$.avail_in=G,J.wrap=V,_1}qW.deflateInit=tK;qW.deflateInit2=n2;qW.deflateReset=i2;qW.deflateResetKeep=o2;qW.deflateSetHeader=sK;qW.deflate=eK;qW.deflateEnd=$W;qW.deflateSetDictionary=QW;qW.deflateInfo="pako deflate (from Nodeca project)"});var VQ=T((ZW)=>{var a6=s1(),a2=!0,s2=!0;try{String.fromCharCode.apply(null,[0])}catch($){a2=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch($){s2=!1}var c$=new a6.Buf8(256);for(b1=0;b1<256;b1++)c$[b1]=b1>=252?6:b1>=248?5:b1>=240?4:b1>=224?3:b1>=192?2:1;var b1;c$[254]=c$[254]=1;ZW.string2buf=function($){var Q,q,J,Y,X,V=$.length,G=0;for(Y=0;Y<V;Y++){if(q=$.charCodeAt(Y),(q&64512)===55296&&Y+1<V){if(J=$.charCodeAt(Y+1),(J&64512)===56320)q=65536+(q-55296<<10)+(J-56320),Y++}G+=q<128?1:q<2048?2:q<65536?3:4}Q=new a6.Buf8(G);for(X=0,Y=0;X<G;Y++){if(q=$.charCodeAt(Y),(q&64512)===55296&&Y+1<V){if(J=$.charCodeAt(Y+1),(J&64512)===56320)q=65536+(q-55296<<10)+(J-56320),Y++}if(q<128)Q[X++]=q;else if(q<2048)Q[X++]=192|q>>>6,Q[X++]=128|q&63;else if(q<65536)Q[X++]=224|q>>>12,Q[X++]=128|q>>>6&63,Q[X++]=128|q&63;else Q[X++]=240|q>>>18,Q[X++]=128|q>>>12&63,Q[X++]=128|q>>>6&63,Q[X++]=128|q&63}return Q};function t2($,Q){if(Q<65534){if($.subarray&&s2||!$.subarray&&a2)return String.fromCharCode.apply(null,a6.shrinkBuf($,Q))}var q="";for(var J=0;J<Q;J++)q+=String.fromCharCode($[J]);return q}ZW.buf2binstring=function($){return t2($,$.length)};ZW.binstring2buf=function($){var Q=new a6.Buf8($.length);for(var q=0,J=Q.length;q<J;q++)Q[q]=$.charCodeAt(q);return Q};ZW.buf2string=function($,Q){var q,J,Y,X,V=Q||$.length,G=Array(V*2);for(J=0,q=0;q<V;){if(Y=$[q++],Y<128){G[J++]=Y;continue}if(X=c$[Y],X>4){G[J++]=65533,q+=X-1;continue}Y&=X===2?31:X===3?15:7;while(X>1&&q<V)Y=Y<<6|$[q++]&63,X--;if(X>1){G[J++]=65533;continue}if(Y<65536)G[J++]=Y;else Y-=65536,G[J++]=55296|Y>>10&1023,G[J++]=56320|Y&1023}return t2(G,J)};ZW.utf8border=function($,Q){var q;if(Q=Q||$.length,Q>$.length)Q=$.length;q=Q-1;while(q>=0&&($[q]&192)===128)q--;if(q<0)return Q;if(q===0)return Q;return q+c$[$[q]]>Q?q:Q}});var YQ=T((BL,e2)=>{function MW(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}e2.exports=MW});var J7=T((FW)=>{var p$=r2(),u$=s1(),GQ=VQ(),KQ=u6(),BW=YQ(),q7=Object.prototype.toString,NW=0,XQ=4,e0=0,$7=1,Q7=2,IW=-1,CW=0,wW=8;function F0($){if(!(this instanceof F0))return new F0($);this.options=u$.assign({level:IW,method:wW,chunkSize:16384,windowBits:15,memLevel:8,strategy:CW,to:""},$||{});var Q=this.options;if(Q.raw&&Q.windowBits>0)Q.windowBits=-Q.windowBits;else if(Q.gzip&&Q.windowBits>0&&Q.windowBits<16)Q.windowBits+=16;this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new BW,this.strm.avail_out=0;var q=p$.deflateInit2(this.strm,Q.level,Q.method,Q.windowBits,Q.memLevel,Q.strategy);if(q!==e0)throw Error(KQ[q]);if(Q.header)p$.deflateSetHeader(this.strm,Q.header);if(Q.dictionary){var J;if(typeof Q.dictionary==="string")J=GQ.string2buf(Q.dictionary);else if(q7.call(Q.dictionary)==="[object ArrayBuffer]")J=new Uint8Array(Q.dictionary);else J=Q.dictionary;if(q=p$.deflateSetDictionary(this.strm,J),q!==e0)throw Error(KQ[q]);this._dict_set=!0}}F0.prototype.push=function($,Q){var q=this.strm,J=this.options.chunkSize,Y,X;if(this.ended)return!1;if(X=Q===~~Q?Q:Q===!0?XQ:NW,typeof $==="string")q.input=GQ.string2buf($);else if(q7.call($)==="[object ArrayBuffer]")q.input=new Uint8Array($);else q.input=$;q.next_in=0,q.avail_in=q.input.length;do{if(q.avail_out===0)q.output=new u$.Buf8(J),q.next_out=0,q.avail_out=J;if(Y=p$.deflate(q,X),Y!==$7&&Y!==e0)return this.onEnd(Y),this.ended=!0,!1;if(q.avail_out===0||q.avail_in===0&&(X===XQ||X===Q7))if(this.options.to==="string")this.onData(GQ.buf2binstring(u$.shrinkBuf(q.output,q.next_out)));else this.onData(u$.shrinkBuf(q.output,q.next_out))}while((q.avail_in>0||q.avail_out===0)&&Y!==$7);if(X===XQ)return Y=p$.deflateEnd(this.strm),this.onEnd(Y),this.ended=!0,Y===e0;if(X===Q7)return this.onEnd(e0),q.avail_out=0,!0;return!0};F0.prototype.onData=function($){this.chunks.push($)};F0.prototype.onEnd=function($){if($===e0)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=u$.flattenChunks(this.chunks);this.chunks=[],this.err=$,this.msg=this.strm.msg};function WQ($,Q){var q=new F0(Q);if(q.push($,!0),q.err)throw q.msg||KQ[q.err];return q.result}function TW($,Q){return Q=Q||{},Q.raw=!0,WQ($,Q)}function AW($,Q){return Q=Q||{},Q.gzip=!0,WQ($,Q)}FW.Deflate=F0;FW.deflate=WQ;FW.deflateRaw=TW;FW.gzip=AW});var Y7=T((IL,V7)=>{var s6=30,EW=12;V7.exports=function(Q,q){var J,Y,X,V,G,U,K,W,z,Z,H,C,I,w,N,O,B,L,P,A,R,v,x,_,F;J=Q.state,Y=Q.next_in,_=Q.input,X=Y+(Q.avail_in-5),V=Q.next_out,F=Q.output,G=V-(q-Q.avail_out),U=V+(Q.avail_out-257),K=J.dmax,W=J.wsize,z=J.whave,Z=J.wnext,H=J.window,C=J.hold,I=J.bits,w=J.lencode,N=J.distcode,O=(1<<J.lenbits)-1,B=(1<<J.distbits)-1;$:do{if(I<15)C+=_[Y++]<<I,I+=8,C+=_[Y++]<<I,I+=8;L=w[C&O];Q:for(;;){if(P=L>>>24,C>>>=P,I-=P,P=L>>>16&255,P===0)F[V++]=L&65535;else if(P&16){if(A=L&65535,P&=15,P){if(I<P)C+=_[Y++]<<I,I+=8;A+=C&(1<<P)-1,C>>>=P,I-=P}if(I<15)C+=_[Y++]<<I,I+=8,C+=_[Y++]<<I,I+=8;L=N[C&B];q:for(;;){if(P=L>>>24,C>>>=P,I-=P,P=L>>>16&255,P&16){if(R=L&65535,P&=15,I<P){if(C+=_[Y++]<<I,I+=8,I<P)C+=_[Y++]<<I,I+=8}if(R+=C&(1<<P)-1,R>K){Q.msg="invalid distance too far back",J.mode=s6;break $}if(C>>>=P,I-=P,P=V-G,R>P){if(P=R-P,P>z){if(J.sane){Q.msg="invalid distance too far back",J.mode=s6;break $}}if(v=0,x=H,Z===0){if(v+=W-P,P<A){A-=P;do F[V++]=H[v++];while(--P);v=V-R,x=F}}else if(Z<P){if(v+=W+Z-P,P-=Z,P<A){A-=P;do F[V++]=H[v++];while(--P);if(v=0,Z<A){P=Z,A-=P;do F[V++]=H[v++];while(--P);v=V-R,x=F}}}else if(v+=Z-P,P<A){A-=P;do F[V++]=H[v++];while(--P);v=V-R,x=F}while(A>2)F[V++]=x[v++],F[V++]=x[v++],F[V++]=x[v++],A-=3;if(A){if(F[V++]=x[v++],A>1)F[V++]=x[v++]}}else{v=V-R;do F[V++]=F[v++],F[V++]=F[v++],F[V++]=F[v++],A-=3;while(A>2);if(A){if(F[V++]=F[v++],A>1)F[V++]=F[v++]}}}else if((P&64)===0){L=N[(L&65535)+(C&(1<<P)-1)];continue q}else{Q.msg="invalid distance code",J.mode=s6;break $}break}}else if((P&64)===0){L=w[(L&65535)+(C&(1<<P)-1)];continue Q}else if(P&32){J.mode=EW;break $}else{Q.msg="invalid literal/length code",J.mode=s6;break $}break}}while(Y<X&&V<U);A=I>>3,Y-=A,I-=A<<3,C&=(1<<I)-1,Q.next_in=Y,Q.next_out=V,Q.avail_in=Y<X?5+(X-Y):5-(Y-X),Q.avail_out=V<U?257+(U-V):257-(V-U),J.hold=C,J.bits=I;return}});var Z7=T((CL,j7)=>{var X7=s1(),$$=15,G7=852,K7=592,W7=0,UQ=1,U7=2,yW=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],kW=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],gW=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],DW=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];j7.exports=function(Q,q,J,Y,X,V,G,U){var K=U.bits,W=0,z=0,Z=0,H=0,C=0,I=0,w=0,N=0,O=0,B=0,L,P,A,R,v,x=null,_=0,F,W1=new X7.Buf16($$+1),y0=new X7.Buf16($$+1),G6=null,Kq=0,Wq,K6,W6;for(W=0;W<=$$;W++)W1[W]=0;for(z=0;z<Y;z++)W1[q[J+z]]++;C=K;for(H=$$;H>=1;H--)if(W1[H]!==0)break;if(C>H)C=H;if(H===0)return X[V++]=20971520,X[V++]=20971520,U.bits=1,0;for(Z=1;Z<H;Z++)if(W1[Z]!==0)break;if(C<Z)C=Z;N=1;for(W=1;W<=$$;W++)if(N<<=1,N-=W1[W],N<0)return-1;if(N>0&&(Q===W7||H!==1))return-1;y0[1]=0;for(W=1;W<$$;W++)y0[W+1]=y0[W]+W1[W];for(z=0;z<Y;z++)if(q[J+z]!==0)G[y0[q[J+z]]++]=z;if(Q===W7)x=G6=G,F=19;else if(Q===UQ)x=yW,_-=257,G6=kW,Kq-=257,F=256;else x=gW,G6=DW,F=-1;if(B=0,z=0,W=Z,v=V,I=C,w=0,A=-1,O=1<<C,R=O-1,Q===UQ&&O>G7||Q===U7&&O>K7)return 1;for(;;){if(Wq=W-w,G[z]<F)K6=0,W6=G[z];else if(G[z]>F)K6=G6[Kq+G[z]],W6=x[_+G[z]];else K6=96,W6=0;L=1<<W-w,P=1<<I,Z=P;do P-=L,X[v+(B>>w)+P]=Wq<<24|K6<<16|W6|0;while(P!==0);L=1<<W-1;while(B&L)L>>=1;if(L!==0)B&=L-1,B+=L;else B=0;if(z++,--W1[W]===0){if(W===H)break;W=q[J+G[z]]}if(W>C&&(B&R)!==A){if(w===0)w=C;v+=Z,I=W-w,N=1<<I;while(I+w<H){if(N-=W1[I+w],N<=0)break;I++,N<<=1}if(O+=1<<I,Q===UQ&&O>G7||Q===U7&&O>K7)return 1;A=B&R,X[A]=C<<24|I<<16|v-V|0}}if(B!==0)X[v+B]=W-w<<24|4194304|0;return U.bits=C,0}});var i7=T(($U)=>{var Z1=s1(),PQ=t5(),f1=e5(),hW=Y7(),d$=Z7(),_W=0,b7=1,f7=2,z7=4,bW=5,t6=6,R0=0,fW=1,mW=2,O1=-2,m7=-3,OQ=-4,cW=-5,H7=8,c7=1,L7=2,P7=3,O7=4,M7=5,B7=6,N7=7,I7=8,C7=9,w7=10,Q8=11,e1=12,jQ=13,T7=14,ZQ=15,A7=16,F7=17,R7=18,v7=19,e6=20,$8=21,x7=22,S7=23,E7=24,y7=25,k7=26,zQ=27,g7=28,D7=29,c=30,MQ=31,pW=32,uW=852,dW=592,lW=15,oW=lW;function h7($){return($>>>24&255)+($>>>8&65280)+(($&65280)<<8)+(($&255)<<24)}function iW(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Z1.Buf16(320),this.work=new Z1.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function p7($){var Q;if(!$||!$.state)return O1;if(Q=$.state,$.total_in=$.total_out=Q.total=0,$.msg="",Q.wrap)$.adler=Q.wrap&1;return Q.mode=c7,Q.last=0,Q.havedict=0,Q.dmax=32768,Q.head=null,Q.hold=0,Q.bits=0,Q.lencode=Q.lendyn=new Z1.Buf32(uW),Q.distcode=Q.distdyn=new Z1.Buf32(dW),Q.sane=1,Q.back=-1,R0}function u7($){var Q;if(!$||!$.state)return O1;return Q=$.state,Q.wsize=0,Q.whave=0,Q.wnext=0,p7($)}function d7($,Q){var q,J;if(!$||!$.state)return O1;if(J=$.state,Q<0)q=0,Q=-Q;else if(q=(Q>>4)+1,Q<48)Q&=15;if(Q&&(Q<8||Q>15))return O1;if(J.window!==null&&J.wbits!==Q)J.window=null;return J.wrap=q,J.wbits=Q,u7($)}function l7($,Q){var q,J;if(!$)return O1;if(J=new iW,$.state=J,J.window=null,q=d7($,Q),q!==R0)$.state=null;return q}function nW($){return l7($,oW)}var _7=!0,HQ,LQ;function rW($){if(_7){var Q;HQ=new Z1.Buf32(512),LQ=new Z1.Buf32(32),Q=0;while(Q<144)$.lens[Q++]=8;while(Q<256)$.lens[Q++]=9;while(Q<280)$.lens[Q++]=7;while(Q<288)$.lens[Q++]=8;d$(b7,$.lens,0,288,HQ,0,$.work,{bits:9}),Q=0;while(Q<32)$.lens[Q++]=5;d$(f7,$.lens,0,32,LQ,0,$.work,{bits:5}),_7=!1}$.lencode=HQ,$.lenbits=9,$.distcode=LQ,$.distbits=5}function o7($,Q,q,J){var Y,X=$.state;if(X.window===null)X.wsize=1<<X.wbits,X.wnext=0,X.whave=0,X.window=new Z1.Buf8(X.wsize);if(J>=X.wsize)Z1.arraySet(X.window,Q,q-X.wsize,X.wsize,0),X.wnext=0,X.whave=X.wsize;else{if(Y=X.wsize-X.wnext,Y>J)Y=J;if(Z1.arraySet(X.window,Q,q-J,Y,X.wnext),J-=Y,J)Z1.arraySet(X.window,Q,q-J,J,0),X.wnext=J,X.whave=X.wsize;else{if(X.wnext+=Y,X.wnext===X.wsize)X.wnext=0;if(X.whave<X.wsize)X.whave+=Y}}return 0}function aW($,Q){var q,J,Y,X,V,G,U,K,W,z,Z,H,C,I,w=0,N,O,B,L,P,A,R,v,x=new Z1.Buf8(4),_,F,W1=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!$||!$.state||!$.output||!$.input&&$.avail_in!==0)return O1;if(q=$.state,q.mode===e1)q.mode=jQ;V=$.next_out,Y=$.output,U=$.avail_out,X=$.next_in,J=$.input,G=$.avail_in,K=q.hold,W=q.bits,z=G,Z=U,v=R0;$:for(;;)switch(q.mode){case c7:if(q.wrap===0){q.mode=jQ;break}while(W<16){if(G===0)break $;G--,K+=J[X++]<<W,W+=8}if(q.wrap&2&&K===35615){q.check=0,x[0]=K&255,x[1]=K>>>8&255,q.check=f1(q.check,x,2,0),K=0,W=0,q.mode=L7;break}if(q.flags=0,q.head)q.head.done=!1;if(!(q.wrap&1)||(((K&255)<<8)+(K>>8))%31){$.msg="incorrect header check",q.mode=c;break}if((K&15)!==H7){$.msg="unknown compression method",q.mode=c;break}if(K>>>=4,W-=4,R=(K&15)+8,q.wbits===0)q.wbits=R;else if(R>q.wbits){$.msg="invalid window size",q.mode=c;break}q.dmax=1<<R,$.adler=q.check=1,q.mode=K&512?w7:e1,K=0,W=0;break;case L7:while(W<16){if(G===0)break $;G--,K+=J[X++]<<W,W+=8}if(q.flags=K,(q.flags&255)!==H7){$.msg="unknown compression method",q.mode=c;break}if(q.flags&57344){$.msg="unknown header flags set",q.mode=c;break}if(q.head)q.head.text=K>>8&1;if(q.flags&512)x[0]=K&255,x[1]=K>>>8&255,q.check=f1(q.check,x,2,0);K=0,W=0,q.mode=P7;case P7:while(W<32){if(G===0)break $;G--,K+=J[X++]<<W,W+=8}if(q.head)q.head.time=K;if(q.flags&512)x[0]=K&255,x[1]=K>>>8&255,x[2]=K>>>16&255,x[3]=K>>>24&255,q.check=f1(q.check,x,4,0);K=0,W=0,q.mode=O7;case O7:while(W<16){if(G===0)break $;G--,K+=J[X++]<<W,W+=8}if(q.head)q.head.xflags=K&255,q.head.os=K>>8;if(q.flags&512)x[0]=K&255,x[1]=K>>>8&255,q.check=f1(q.check,x,2,0);K=0,W=0,q.mode=M7;case M7:if(q.flags&1024){while(W<16){if(G===0)break $;G--,K+=J[X++]<<W,W+=8}if(q.length=K,q.head)q.head.extra_len=K;if(q.flags&512)x[0]=K&255,x[1]=K>>>8&255,q.check=f1(q.check,x,2,0);K=0,W=0}else if(q.head)q.head.extra=null;q.mode=B7;case B7:if(q.flags&1024){if(H=q.length,H>G)H=G;if(H){if(q.head){if(R=q.head.extra_len-q.length,!q.head.extra)q.head.extra=Array(q.head.extra_len);Z1.arraySet(q.head.extra,J,X,H,R)}if(q.flags&512)q.check=f1(q.check,J,H,X);G-=H,X+=H,q.length-=H}if(q.length)break $}q.length=0,q.mode=N7;case N7:if(q.flags&2048){if(G===0)break $;H=0;do if(R=J[X+H++],q.head&&R&&q.length<65536)q.head.name+=String.fromCharCode(R);while(R&&H<G);if(q.flags&512)q.check=f1(q.check,J,H,X);if(G-=H,X+=H,R)break $}else if(q.head)q.head.name=null;q.length=0,q.mode=I7;case I7:if(q.flags&4096){if(G===0)break $;H=0;do if(R=J[X+H++],q.head&&R&&q.length<65536)q.head.comment+=String.fromCharCode(R);while(R&&H<G);if(q.flags&512)q.check=f1(q.check,J,H,X);if(G-=H,X+=H,R)break $}else if(q.head)q.head.comment=null;q.mode=C7;case C7:if(q.flags&512){while(W<16){if(G===0)break $;G--,K+=J[X++]<<W,W+=8}if(K!==(q.check&65535)){$.msg="header crc mismatch",q.mode=c;break}K=0,W=0}if(q.head)q.head.hcrc=q.flags>>9&1,q.head.done=!0;$.adler=q.check=0,q.mode=e1;break;case w7:while(W<32){if(G===0)break $;G--,K+=J[X++]<<W,W+=8}$.adler=q.check=h7(K),K=0,W=0,q.mode=Q8;case Q8:if(q.havedict===0)return $.next_out=V,$.avail_out=U,$.next_in=X,$.avail_in=G,q.hold=K,q.bits=W,mW;$.adler=q.check=1,q.mode=e1;case e1:if(Q===bW||Q===t6)break $;case jQ:if(q.last){K>>>=W&7,W-=W&7,q.mode=zQ;break}while(W<3){if(G===0)break $;G--,K+=J[X++]<<W,W+=8}switch(q.last=K&1,K>>>=1,W-=1,K&3){case 0:q.mode=T7;break;case 1:if(rW(q),q.mode=e6,Q===t6){K>>>=2,W-=2;break $}break;case 2:q.mode=F7;break;case 3:$.msg="invalid block type",q.mode=c}K>>>=2,W-=2;break;case T7:K>>>=W&7,W-=W&7;while(W<32){if(G===0)break $;G--,K+=J[X++]<<W,W+=8}if((K&65535)!==(K>>>16^65535)){$.msg="invalid stored block lengths",q.mode=c;break}if(q.length=K&65535,K=0,W=0,q.mode=ZQ,Q===t6)break $;case ZQ:q.mode=A7;case A7:if(H=q.length,H){if(H>G)H=G;if(H>U)H=U;if(H===0)break $;Z1.arraySet(Y,J,X,H,V),G-=H,X+=H,U-=H,V+=H,q.length-=H;break}q.mode=e1;break;case F7:while(W<14){if(G===0)break $;G--,K+=J[X++]<<W,W+=8}if(q.nlen=(K&31)+257,K>>>=5,W-=5,q.ndist=(K&31)+1,K>>>=5,W-=5,q.ncode=(K&15)+4,K>>>=4,W-=4,q.nlen>286||q.ndist>30){$.msg="too many length or distance symbols",q.mode=c;break}q.have=0,q.mode=R7;case R7:while(q.have<q.ncode){while(W<3){if(G===0)break $;G--,K+=J[X++]<<W,W+=8}q.lens[W1[q.have++]]=K&7,K>>>=3,W-=3}while(q.have<19)q.lens[W1[q.have++]]=0;if(q.lencode=q.lendyn,q.lenbits=7,_={bits:q.lenbits},v=d$(_W,q.lens,0,19,q.lencode,0,q.work,_),q.lenbits=_.bits,v){$.msg="invalid code lengths set",q.mode=c;break}q.have=0,q.mode=v7;case v7:while(q.have<q.nlen+q.ndist){for(;;){if(w=q.lencode[K&(1<<q.lenbits)-1],N=w>>>24,O=w>>>16&255,B=w&65535,N<=W)break;if(G===0)break $;G--,K+=J[X++]<<W,W+=8}if(B<16)K>>>=N,W-=N,q.lens[q.have++]=B;else{if(B===16){F=N+2;while(W<F){if(G===0)break $;G--,K+=J[X++]<<W,W+=8}if(K>>>=N,W-=N,q.have===0){$.msg="invalid bit length repeat",q.mode=c;break}R=q.lens[q.have-1],H=3+(K&3),K>>>=2,W-=2}else if(B===17){F=N+3;while(W<F){if(G===0)break $;G--,K+=J[X++]<<W,W+=8}K>>>=N,W-=N,R=0,H=3+(K&7),K>>>=3,W-=3}else{F=N+7;while(W<F){if(G===0)break $;G--,K+=J[X++]<<W,W+=8}K>>>=N,W-=N,R=0,H=11+(K&127),K>>>=7,W-=7}if(q.have+H>q.nlen+q.ndist){$.msg="invalid bit length repeat",q.mode=c;break}while(H--)q.lens[q.have++]=R}}if(q.mode===c)break;if(q.lens[256]===0){$.msg="invalid code -- missing end-of-block",q.mode=c;break}if(q.lenbits=9,_={bits:q.lenbits},v=d$(b7,q.lens,0,q.nlen,q.lencode,0,q.work,_),q.lenbits=_.bits,v){$.msg="invalid literal/lengths set",q.mode=c;break}if(q.distbits=6,q.distcode=q.distdyn,_={bits:q.distbits},v=d$(f7,q.lens,q.nlen,q.ndist,q.distcode,0,q.work,_),q.distbits=_.bits,v){$.msg="invalid distances set",q.mode=c;break}if(q.mode=e6,Q===t6)break $;case e6:q.mode=$8;case $8:if(G>=6&&U>=258){if($.next_out=V,$.avail_out=U,$.next_in=X,$.avail_in=G,q.hold=K,q.bits=W,hW($,Z),V=$.next_out,Y=$.output,U=$.avail_out,X=$.next_in,J=$.input,G=$.avail_in,K=q.hold,W=q.bits,q.mode===e1)q.back=-1;break}q.back=0;for(;;){if(w=q.lencode[K&(1<<q.lenbits)-1],N=w>>>24,O=w>>>16&255,B=w&65535,N<=W)break;if(G===0)break $;G--,K+=J[X++]<<W,W+=8}if(O&&(O&240)===0){L=N,P=O,A=B;for(;;){if(w=q.lencode[A+((K&(1<<L+P)-1)>>L)],N=w>>>24,O=w>>>16&255,B=w&65535,L+N<=W)break;if(G===0)break $;G--,K+=J[X++]<<W,W+=8}K>>>=L,W-=L,q.back+=L}if(K>>>=N,W-=N,q.back+=N,q.length=B,O===0){q.mode=k7;break}if(O&32){q.back=-1,q.mode=e1;break}if(O&64){$.msg="invalid literal/length code",q.mode=c;break}q.extra=O&15,q.mode=x7;case x7:if(q.extra){F=q.extra;while(W<F){if(G===0)break $;G--,K+=J[X++]<<W,W+=8}q.length+=K&(1<<q.extra)-1,K>>>=q.extra,W-=q.extra,q.back+=q.extra}q.was=q.length,q.mode=S7;case S7:for(;;){if(w=q.distcode[K&(1<<q.distbits)-1],N=w>>>24,O=w>>>16&255,B=w&65535,N<=W)break;if(G===0)break $;G--,K+=J[X++]<<W,W+=8}if((O&240)===0){L=N,P=O,A=B;for(;;){if(w=q.distcode[A+((K&(1<<L+P)-1)>>L)],N=w>>>24,O=w>>>16&255,B=w&65535,L+N<=W)break;if(G===0)break $;G--,K+=J[X++]<<W,W+=8}K>>>=L,W-=L,q.back+=L}if(K>>>=N,W-=N,q.back+=N,O&64){$.msg="invalid distance code",q.mode=c;break}q.offset=B,q.extra=O&15,q.mode=E7;case E7:if(q.extra){F=q.extra;while(W<F){if(G===0)break $;G--,K+=J[X++]<<W,W+=8}q.offset+=K&(1<<q.extra)-1,K>>>=q.extra,W-=q.extra,q.back+=q.extra}if(q.offset>q.dmax){$.msg="invalid distance too far back",q.mode=c;break}q.mode=y7;case y7:if(U===0)break $;if(H=Z-U,q.offset>H){if(H=q.offset-H,H>q.whave){if(q.sane){$.msg="invalid distance too far back",q.mode=c;break}}if(H>q.wnext)H-=q.wnext,C=q.wsize-H;else C=q.wnext-H;if(H>q.length)H=q.length;I=q.window}else I=Y,C=V-q.offset,H=q.length;if(H>U)H=U;U-=H,q.length-=H;do Y[V++]=I[C++];while(--H);if(q.length===0)q.mode=$8;break;case k7:if(U===0)break $;Y[V++]=q.length,U--,q.mode=$8;break;case zQ:if(q.wrap){while(W<32){if(G===0)break $;G--,K|=J[X++]<<W,W+=8}if(Z-=U,$.total_out+=Z,q.total+=Z,Z)$.adler=q.check=q.flags?f1(q.check,Y,Z,V-Z):PQ(q.check,Y,Z,V-Z);if(Z=U,(q.flags?K:h7(K))!==q.check){$.msg="incorrect data check",q.mode=c;break}K=0,W=0}q.mode=g7;case g7:if(q.wrap&&q.flags){while(W<32){if(G===0)break $;G--,K+=J[X++]<<W,W+=8}if(K!==(q.total&4294967295)){$.msg="incorrect length check",q.mode=c;break}K=0,W=0}q.mode=D7;case D7:v=fW;break $;case c:v=m7;break $;case MQ:return OQ;case pW:default:return O1}if($.next_out=V,$.avail_out=U,$.next_in=X,$.avail_in=G,q.hold=K,q.bits=W,q.wsize||Z!==$.avail_out&&q.mode<c&&(q.mode<zQ||Q!==z7)){if(o7($,$.output,$.next_out,Z-$.avail_out))return q.mode=MQ,OQ}if(z-=$.avail_in,Z-=$.avail_out,$.total_in+=z,$.total_out+=Z,q.total+=Z,q.wrap&&Z)$.adler=q.check=q.flags?f1(q.check,Y,Z,$.next_out-Z):PQ(q.check,Y,Z,$.next_out-Z);if($.data_type=q.bits+(q.last?64:0)+(q.mode===e1?128:0)+(q.mode===e6||q.mode===ZQ?256:0),(z===0&&Z===0||Q===z7)&&v===R0)v=cW;return v}function sW($){if(!$||!$.state)return O1;var Q=$.state;if(Q.window)Q.window=null;return $.state=null,R0}function tW($,Q){var q;if(!$||!$.state)return O1;if(q=$.state,(q.wrap&2)===0)return O1;return q.head=Q,Q.done=!1,R0}function eW($,Q){var q=Q.length,J,Y,X;if(!$||!$.state)return O1;if(J=$.state,J.wrap!==0&&J.mode!==Q8)return O1;if(J.mode===Q8){if(Y=1,Y=PQ(Y,Q,q,0),Y!==J.check)return m7}if(X=o7($,Q,q,q),X)return J.mode=MQ,OQ;return J.havedict=1,R0}$U.inflateReset=u7;$U.inflateReset2=d7;$U.inflateResetKeep=p7;$U.inflateInit=nW;$U.inflateInit2=l7;$U.inflate=aW;$U.inflateEnd=sW;$U.inflateGetHeader=tW;$U.inflateSetDictionary=eW;$U.inflateInfo="pako inflate (from Nodeca project)"});var BQ=T((TL,n7)=>{n7.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var a7=T((AL,r7)=>{function jU(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}r7.exports=jU});var t7=T((LU)=>{var Q$=i7(),l$=s1(),q8=VQ(),l=BQ(),NQ=u6(),ZU=YQ(),zU=a7(),s7=Object.prototype.toString;function v0($){if(!(this instanceof v0))return new v0($);this.options=l$.assign({chunkSize:16384,windowBits:0,to:""},$||{});var Q=this.options;if(Q.raw&&Q.windowBits>=0&&Q.windowBits<16){if(Q.windowBits=-Q.windowBits,Q.windowBits===0)Q.windowBits=-15}if(Q.windowBits>=0&&Q.windowBits<16&&!($&&$.windowBits))Q.windowBits+=32;if(Q.windowBits>15&&Q.windowBits<48){if((Q.windowBits&15)===0)Q.windowBits|=15}this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ZU,this.strm.avail_out=0;var q=Q$.inflateInit2(this.strm,Q.windowBits);if(q!==l.Z_OK)throw Error(NQ[q]);if(this.header=new zU,Q$.inflateGetHeader(this.strm,this.header),Q.dictionary){if(typeof Q.dictionary==="string")Q.dictionary=q8.string2buf(Q.dictionary);else if(s7.call(Q.dictionary)==="[object ArrayBuffer]")Q.dictionary=new Uint8Array(Q.dictionary);if(Q.raw){if(q=Q$.inflateSetDictionary(this.strm,Q.dictionary),q!==l.Z_OK)throw Error(NQ[q])}}}v0.prototype.push=function($,Q){var q=this.strm,J=this.options.chunkSize,Y=this.options.dictionary,X,V,G,U,K,W=!1;if(this.ended)return!1;if(V=Q===~~Q?Q:Q===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof $==="string")q.input=q8.binstring2buf($);else if(s7.call($)==="[object ArrayBuffer]")q.input=new Uint8Array($);else q.input=$;q.next_in=0,q.avail_in=q.input.length;do{if(q.avail_out===0)q.output=new l$.Buf8(J),q.next_out=0,q.avail_out=J;if(X=Q$.inflate(q,l.Z_NO_FLUSH),X===l.Z_NEED_DICT&&Y)X=Q$.inflateSetDictionary(this.strm,Y);if(X===l.Z_BUF_ERROR&&W===!0)X=l.Z_OK,W=!1;if(X!==l.Z_STREAM_END&&X!==l.Z_OK)return this.onEnd(X),this.ended=!0,!1;if(q.next_out){if(q.avail_out===0||X===l.Z_STREAM_END||q.avail_in===0&&(V===l.Z_FINISH||V===l.Z_SYNC_FLUSH))if(this.options.to==="string"){if(G=q8.utf8border(q.output,q.next_out),U=q.next_out-G,K=q8.buf2string(q.output,G),q.next_out=U,q.avail_out=J-U,U)l$.arraySet(q.output,q.output,G,U,0);this.onData(K)}else this.onData(l$.shrinkBuf(q.output,q.next_out))}if(q.avail_in===0&&q.avail_out===0)W=!0}while((q.avail_in>0||q.avail_out===0)&&X!==l.Z_STREAM_END);if(X===l.Z_STREAM_END)V=l.Z_FINISH;if(V===l.Z_FINISH)return X=Q$.inflateEnd(this.strm),this.onEnd(X),this.ended=!0,X===l.Z_OK;if(V===l.Z_SYNC_FLUSH)return this.onEnd(l.Z_OK),q.avail_out=0,!0;return!0};v0.prototype.onData=function($){this.chunks.push($)};v0.prototype.onEnd=function($){if($===l.Z_OK)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=l$.flattenChunks(this.chunks);this.chunks=[],this.err=$,this.msg=this.strm.msg};function IQ($,Q){var q=new v0(Q);if(q.push($,!0),q.err)throw q.msg||NQ[q.err];return q.result}function HU($,Q){return Q=Q||{},Q.raw=!0,IQ($,Q)}LU.Inflate=v0;LU.inflate=IQ;LU.inflateRaw=HU;LU.ungzip=IQ});var QJ=T((RL,$J)=>{var NU=s1().assign,IU=J7(),CU=t7(),wU=BQ(),e7={};NU(e7,IU,CU,wU);$J.exports=e7});var JJ=T((RU)=>{var TU=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",AU=QJ(),qJ=p(),J8=j1(),FU=TU?"uint8array":"array";RU.magic="\b\x00";function x0($,Q){J8.call(this,"FlateWorker/"+$),this._pako=null,this._pakoAction=$,this._pakoOptions=Q,this.meta={}}qJ.inherits(x0,J8);x0.prototype.processChunk=function($){if(this.meta=$.meta,this._pako===null)this._createPako();this._pako.push(qJ.transformTo(FU,$.data),!1)};x0.prototype.flush=function(){if(J8.prototype.flush.call(this),this._pako===null)this._createPako();this._pako.push([],!0)};x0.prototype.cleanUp=function(){J8.prototype.cleanUp.call(this),this._pako=null};x0.prototype._createPako=function(){this._pako=new AU[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var $=this;this._pako.onData=function(Q){$.push({data:Q,meta:$.meta})}};RU.compressWorker=function($){return new x0("Deflate",$)};RU.uncompressWorker=function(){return new x0("Inflate",{})}});var CQ=T((EU)=>{var VJ=j1();EU.STORE={magic:"\x00\x00",compressWorker:function(){return new VJ("STORE compression")},uncompressWorker:function(){return new VJ("STORE decompression")}};EU.DEFLATE=JJ()});var wQ=T((gU)=>{gU.LOCAL_FILE_HEADER="PK\x03\x04";gU.CENTRAL_FILE_HEADER="PK\x01\x02";gU.CENTRAL_DIRECTORY_END="PK\x05\x06";gU.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07";gU.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06";gU.DATA_DESCRIPTOR="PK\x07\b"});var KJ=T((EL,GJ)=>{var q$=p(),J$=j1(),TQ=o0(),YJ=f6(),V8=wQ(),h=function($,Q){var q="",J;for(J=0;J<Q;J++)q+=String.fromCharCode($&255),$=$>>>8;return q},cU=function($,Q){var q=$;if(!$)q=Q?16893:33204;return(q&65535)<<16},pU=function($){return($||0)&63},XJ=function($,Q,q,J,Y,X){var{file:V,compression:G}=$,U=X!==TQ.utf8encode,K=q$.transformTo("string",X(V.name)),W=q$.transformTo("string",TQ.utf8encode(V.name)),z=V.comment,Z=q$.transformTo("string",X(z)),H=q$.transformTo("string",TQ.utf8encode(z)),C=W.length!==V.name.length,I=H.length!==z.length,w,N,O="",B="",L="",P=V.dir,A=V.date,R={crc32:0,compressedSize:0,uncompressedSize:0};if(!Q||q)R.crc32=$.crc32,R.compressedSize=$.compressedSize,R.uncompressedSize=$.uncompressedSize;var v=0;if(Q)v|=8;if(!U&&(C||I))v|=2048;var x=0,_=0;if(P)x|=16;if(Y==="UNIX")_=798,x|=cU(V.unixPermissions,P);else _=20,x|=pU(V.dosPermissions,P);if(w=A.getUTCHours(),w=w<<6,w=w|A.getUTCMinutes(),w=w<<5,w=w|A.getUTCSeconds()/2,N=A.getUTCFullYear()-1980,N=N<<4,N=N|A.getUTCMonth()+1,N=N<<5,N=N|A.getUTCDate(),C)B=h(1,1)+h(YJ(K),4)+W,O+="up"+h(B.length,2)+B;if(I)L=h(1,1)+h(YJ(Z),4)+H,O+="uc"+h(L.length,2)+L;var F="";F+=`
|
|
61
|
+
\x00`,F+=h(v,2),F+=G.magic,F+=h(w,2),F+=h(N,2),F+=h(R.crc32,4),F+=h(R.compressedSize,4),F+=h(R.uncompressedSize,4),F+=h(K.length,2),F+=h(O.length,2);var W1=V8.LOCAL_FILE_HEADER+F+K+O,y0=V8.CENTRAL_FILE_HEADER+h(_,2)+F+h(Z.length,2)+"\x00\x00\x00\x00"+h(x,4)+h(J,4)+K+O+Z;return{fileRecord:W1,dirRecord:y0}},uU=function($,Q,q,J,Y){var X="",V=q$.transformTo("string",Y(J));return X=V8.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+h($,2)+h($,2)+h(Q,4)+h(q,4)+h(V.length,2)+V,X},dU=function($){var Q="";return Q=V8.DATA_DESCRIPTOR+h($.crc32,4)+h($.compressedSize,4)+h($.uncompressedSize,4),Q};function v1($,Q,q,J){J$.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=Q,this.zipPlatform=q,this.encodeFileName=J,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}q$.inherits(v1,J$);v1.prototype.push=function($){var Q=$.meta.percent||0,q=this.entriesCount,J=this._sources.length;if(this.accumulate)this.contentBuffer.push($);else this.bytesWritten+=$.data.length,J$.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:q?(Q+100*(q-J-1))/q:100}})};v1.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var Q=this.streamFiles&&!$.file.dir;if(Q){var q=XJ($,Q,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:q.fileRecord,meta:{percent:0}})}else this.accumulate=!0};v1.prototype.closedSource=function($){this.accumulate=!1;var Q=this.streamFiles&&!$.file.dir,q=XJ($,Q,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(q.dirRecord),Q)this.push({data:dU($),meta:{percent:100}});else{this.push({data:q.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};v1.prototype.flush=function(){var $=this.bytesWritten;for(var Q=0;Q<this.dirRecords.length;Q++)this.push({data:this.dirRecords[Q],meta:{percent:100}});var q=this.bytesWritten-$,J=uU(this.dirRecords.length,q,$,this.zipComment,this.encodeFileName);this.push({data:J,meta:{percent:100}})};v1.prototype.prepareNextSource=function(){if(this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused)this.previous.pause();else this.previous.resume()};v1.prototype.registerPrevious=function($){this._sources.push($);var Q=this;return $.on("data",function(q){Q.processChunk(q)}),$.on("end",function(){if(Q.closedSource(Q.previous.streamInfo),Q._sources.length)Q.prepareNextSource();else Q.end()}),$.on("error",function(q){Q.error(q)}),this};v1.prototype.resume=function(){if(!J$.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0};v1.prototype.error=function($){var Q=this._sources;if(!J$.prototype.error.call(this,$))return!1;for(var q=0;q<Q.length;q++)try{Q[q].error($)}catch(J){}return!0};v1.prototype.lock=function(){J$.prototype.lock.call(this);var $=this._sources;for(var Q=0;Q<$.length;Q++)$[Q].lock()};GJ.exports=v1});var WJ=T((nU)=>{var lU=CQ(),oU=KJ(),iU=function($,Q){var q=$||Q,J=lU[q];if(!J)throw Error(q+" is not a valid compression method !");return J};nU.generateWorker=function($,Q,q){var J=new oU(Q.streamFiles,q,Q.platform,Q.encodeFileName),Y=0;try{$.forEach(function(X,V){Y++;var G=iU(V.options.compression,Q.compression),U=V.options.compressionOptions||Q.compressionOptions||{},K=V.dir,W=V.date;V._compressWorker(G,U).withStreamInfo("file",{name:X,dir:K,date:W,comment:V.comment||"",unixPermissions:V.unixPermissions,dosPermissions:V.dosPermissions}).pipe(J)}),J.entriesCount=Y}catch(X){J.error(X)}return J}});var jJ=T((kL,UJ)=>{var aU=p(),Y8=j1();function o$($,Q){Y8.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(Q)}aU.inherits(o$,Y8);o$.prototype._bindStream=function($){var Q=this;this._stream=$,$.pause(),$.on("data",function(q){Q.push({data:q,meta:{percent:0}})}).on("error",function(q){if(Q.isPaused)this.generatedError=q;else Q.error(q)}).on("end",function(){if(Q.isPaused)Q._upstreamEnded=!0;else Q.end()})};o$.prototype.pause=function(){if(!Y8.prototype.pause.call(this))return!1;return this._stream.pause(),!0};o$.prototype.resume=function(){if(!Y8.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};UJ.exports=o$});var IJ=T((gL,NJ)=>{var sU=o0(),i$=p(),LJ=j1(),tU=v5(),PJ=x5(),ZJ=m6(),eU=z2(),$j=WJ(),zJ=A$(),Qj=jJ(),OJ=function($,Q,q){var J=i$.getTypeOf(Q),Y,X=i$.extend(q||{},PJ);if(X.date=X.date||new Date,X.compression!==null)X.compression=X.compression.toUpperCase();if(typeof X.unixPermissions==="string")X.unixPermissions=parseInt(X.unixPermissions,8);if(X.unixPermissions&&X.unixPermissions&16384)X.dir=!0;if(X.dosPermissions&&X.dosPermissions&16)X.dir=!0;if(X.dir)$=MJ($);if(X.createFolders&&(Y=qj($)))BJ.call(this,Y,!0);var V=J==="string"&&X.binary===!1&&X.base64===!1;if(!q||typeof q.binary>"u")X.binary=!V;var G=Q instanceof ZJ&&Q.uncompressedSize===0;if(G||X.dir||!Q||Q.length===0)X.base64=!1,X.binary=!0,Q="",X.compression="STORE",J="string";var U=null;if(Q instanceof ZJ||Q instanceof LJ)U=Q;else if(zJ.isNode&&zJ.isStream(Q))U=new Qj($,Q);else U=i$.prepareContent($,Q,X.binary,X.optimizedBinaryString,X.base64);var K=new eU($,U,X);this.files[$]=K},qj=function($){if($.slice(-1)==="/")$=$.substring(0,$.length-1);var Q=$.lastIndexOf("/");return Q>0?$.substring(0,Q):""},MJ=function($){if($.slice(-1)!=="/")$+="/";return $},BJ=function($,Q){if(Q=typeof Q<"u"?Q:PJ.createFolders,$=MJ($),!this.files[$])OJ.call(this,$,null,{dir:!0,createFolders:Q});return this.files[$]};function HJ($){return Object.prototype.toString.call($)==="[object RegExp]"}var Jj={load:function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function($){var Q,q,J;for(Q in this.files)if(J=this.files[Q],q=Q.slice(this.root.length,Q.length),q&&Q.slice(0,this.root.length)===this.root)$(q,J)},filter:function($){var Q=[];return this.forEach(function(q,J){if($(q,J))Q.push(J)}),Q},file:function($,Q,q){if(arguments.length===1)if(HJ($)){var J=$;return this.filter(function(X,V){return!V.dir&&J.test(X)})}else{var Y=this.files[this.root+$];if(Y&&!Y.dir)return Y;else return null}else $=this.root+$,OJ.call(this,$,Q,q);return this},folder:function($){if(!$)return this;if(HJ($))return this.filter(function(Y,X){return X.dir&&$.test(Y)});var Q=this.root+$,q=BJ.call(this,Q),J=this.clone();return J.root=q.name,J},remove:function($){$=this.root+$;var Q=this.files[$];if(!Q){if($.slice(-1)!=="/")$+="/";Q=this.files[$]}if(Q&&!Q.dir)delete this.files[$];else{var q=this.filter(function(Y,X){return X.name.slice(0,$.length)===$});for(var J=0;J<q.length;J++)delete this.files[q[J].name]}return this},generate:function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function($){var Q,q={};try{if(q=i$.extend($||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:sU.utf8encode}),q.type=q.type.toLowerCase(),q.compression=q.compression.toUpperCase(),q.type==="binarystring")q.type="string";if(!q.type)throw Error("No output type specified.");if(i$.checkSupport(q.type),q.platform==="darwin"||q.platform==="freebsd"||q.platform==="linux"||q.platform==="sunos")q.platform="UNIX";if(q.platform==="win32")q.platform="DOS";var J=q.comment||this.comment||"";Q=$j.generateWorker(this,q,J)}catch(Y){Q=new LJ("error"),Q.error(Y)}return new tU(Q,q.type||"string",q.mimeType)},generateAsync:function($,Q){return this.generateInternalStream($).accumulate(Q)},generateNodeStream:function($,Q){if($=$||{},!$.type)$.type="nodebuffer";return this.generateInternalStream($).toNodejsStream(Q)}};NJ.exports=Jj});var AQ=T((DL,wJ)=>{var Vj=p();function CJ($){this.data=$,this.length=$.length,this.index=0,this.zero=0}CJ.prototype={checkOffset:function($){this.checkIndex(this.index+$)},checkIndex:function($){if(this.length<this.zero+$||$<0)throw Error("End of data reached (data length = "+this.length+", asked index = "+$+"). Corrupted zip ?")},setIndex:function($){this.checkIndex($),this.index=$},skip:function($){this.setIndex(this.index+$)},byteAt:function(){},readInt:function($){var Q=0,q;this.checkOffset($);for(q=this.index+$-1;q>=this.index;q--)Q=(Q<<8)+this.byteAt(q);return this.index+=$,Q},readString:function($){return Vj.transformTo("string",this.readData($))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var $=this.readInt(4);return new Date(Date.UTC(($>>25&127)+1980,($>>21&15)-1,$>>16&31,$>>11&31,$>>5&63,($&31)<<1))}};wJ.exports=CJ});var FQ=T((hL,AJ)=>{var TJ=AQ(),Yj=p();function V$($){TJ.call(this,$);for(var Q=0;Q<this.data.length;Q++)$[Q]=$[Q]&255}Yj.inherits(V$,TJ);V$.prototype.byteAt=function($){return this.data[this.zero+$]};V$.prototype.lastIndexOfSignature=function($){var Q=$.charCodeAt(0),q=$.charCodeAt(1),J=$.charCodeAt(2),Y=$.charCodeAt(3);for(var X=this.length-4;X>=0;--X)if(this.data[X]===Q&&this.data[X+1]===q&&this.data[X+2]===J&&this.data[X+3]===Y)return X-this.zero;return-1};V$.prototype.readAndCheckSignature=function($){var Q=$.charCodeAt(0),q=$.charCodeAt(1),J=$.charCodeAt(2),Y=$.charCodeAt(3),X=this.readData(4);return Q===X[0]&&q===X[1]&&J===X[2]&&Y===X[3]};V$.prototype.readData=function($){if(this.checkOffset($),$===0)return[];var Q=this.data.slice(this.zero+this.index,this.zero+this.index+$);return this.index+=$,Q};AJ.exports=V$});var vJ=T((_L,RJ)=>{var FJ=AQ(),Xj=p();function Y$($){FJ.call(this,$)}Xj.inherits(Y$,FJ);Y$.prototype.byteAt=function($){return this.data.charCodeAt(this.zero+$)};Y$.prototype.lastIndexOfSignature=function($){return this.data.lastIndexOf($)-this.zero};Y$.prototype.readAndCheckSignature=function($){var Q=this.readData(4);return $===Q};Y$.prototype.readData=function($){this.checkOffset($);var Q=this.data.slice(this.zero+this.index,this.zero+this.index+$);return this.index+=$,Q};RJ.exports=Y$});var vQ=T((bL,SJ)=>{var xJ=FQ(),Gj=p();function RQ($){xJ.call(this,$)}Gj.inherits(RQ,xJ);RQ.prototype.readData=function($){if(this.checkOffset($),$===0)return new Uint8Array(0);var Q=this.data.subarray(this.zero+this.index,this.zero+this.index+$);return this.index+=$,Q};SJ.exports=RQ});var kJ=T((fL,yJ)=>{var EJ=vQ(),Kj=p();function xQ($){EJ.call(this,$)}Kj.inherits(xQ,EJ);xQ.prototype.readData=function($){this.checkOffset($);var Q=this.data.slice(this.zero+this.index,this.zero+this.index+$);return this.index+=$,Q};yJ.exports=xQ});var SQ=T((mL,DJ)=>{var X8=p(),gJ=a1(),Wj=FQ(),Uj=vJ(),jj=kJ(),Zj=vQ();DJ.exports=function($){var Q=X8.getTypeOf($);if(X8.checkSupport(Q),Q==="string"&&!gJ.uint8array)return new Uj($);if(Q==="nodebuffer")return new jj($);if(gJ.uint8array)return new Zj(X8.transformTo("uint8array",$));return new Wj(X8.transformTo("array",$))}});var fJ=T((cL,bJ)=>{var EQ=SQ(),H0=p(),zj=m6(),hJ=f6(),G8=o0(),K8=CQ(),Hj=a1(),Lj=0,Pj=3,Oj=function($){for(var Q in K8){if(!Object.prototype.hasOwnProperty.call(K8,Q))continue;if(K8[Q].magic===$)return K8[Q]}return null};function _J($,Q){this.options=$,this.loadOptions=Q}_J.prototype={isEncrypted:function(){return(this.bitFlag&1)===1},useUTF8:function(){return(this.bitFlag&2048)===2048},readLocalPart:function($){var Q,q;if($.skip(22),this.fileNameLength=$.readInt(2),q=$.readInt(2),this.fileName=$.readData(this.fileNameLength),$.skip(q),this.compressedSize===-1||this.uncompressedSize===-1)throw Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(Q=Oj(this.compressionMethod),Q===null)throw Error("Corrupted zip : compression "+H0.pretty(this.compressionMethod)+" unknown (inner file : "+H0.transformTo("string",this.fileName)+")");this.decompressed=new zj(this.compressedSize,this.uncompressedSize,this.crc32,Q,$.readData(this.compressedSize))},readCentralPart:function($){this.versionMadeBy=$.readInt(2),$.skip(2),this.bitFlag=$.readInt(2),this.compressionMethod=$.readString(2),this.date=$.readDate(),this.crc32=$.readInt(4),this.compressedSize=$.readInt(4),this.uncompressedSize=$.readInt(4);var Q=$.readInt(2);if(this.extraFieldsLength=$.readInt(2),this.fileCommentLength=$.readInt(2),this.diskNumberStart=$.readInt(2),this.internalFileAttributes=$.readInt(2),this.externalFileAttributes=$.readInt(4),this.localHeaderOffset=$.readInt(4),this.isEncrypted())throw Error("Encrypted zip are not supported");$.skip(Q),this.readExtraFields($),this.parseZIP64ExtraField($),this.fileComment=$.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var $=this.versionMadeBy>>8;if(this.dir=this.externalFileAttributes&16?!0:!1,$===Lj)this.dosPermissions=this.externalFileAttributes&63;if($===Pj)this.unixPermissions=this.externalFileAttributes>>16&65535;if(!this.dir&&this.fileNameStr.slice(-1)==="/")this.dir=!0},parseZIP64ExtraField:function(){if(!this.extraFields[1])return;var $=EQ(this.extraFields[1].value);if(this.uncompressedSize===H0.MAX_VALUE_32BITS)this.uncompressedSize=$.readInt(8);if(this.compressedSize===H0.MAX_VALUE_32BITS)this.compressedSize=$.readInt(8);if(this.localHeaderOffset===H0.MAX_VALUE_32BITS)this.localHeaderOffset=$.readInt(8);if(this.diskNumberStart===H0.MAX_VALUE_32BITS)this.diskNumberStart=$.readInt(4)},readExtraFields:function($){var Q=$.index+this.extraFieldsLength,q,J,Y;if(!this.extraFields)this.extraFields={};while($.index+4<Q)q=$.readInt(2),J=$.readInt(2),Y=$.readData(J),this.extraFields[q]={id:q,length:J,value:Y};$.setIndex(Q)},handleUTF8:function(){var $=Hj.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=G8.utf8decode(this.fileName),this.fileCommentStr=G8.utf8decode(this.fileComment);else{var Q=this.findExtraFieldUnicodePath();if(Q!==null)this.fileNameStr=Q;else{var q=H0.transformTo($,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(q)}var J=this.findExtraFieldUnicodeComment();if(J!==null)this.fileCommentStr=J;else{var Y=H0.transformTo($,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(Y)}}},findExtraFieldUnicodePath:function(){var $=this.extraFields[28789];if($){var Q=EQ($.value);if(Q.readInt(1)!==1)return null;if(hJ(this.fileName)!==Q.readInt(4))return null;return G8.utf8decode(Q.readData($.length-5))}return null},findExtraFieldUnicodeComment:function(){var $=this.extraFields[25461];if($){var Q=EQ($.value);if(Q.readInt(1)!==1)return null;if(hJ(this.fileComment)!==Q.readInt(4))return null;return G8.utf8decode(Q.readData($.length-5))}return null}};bJ.exports=_J});var pJ=T((pL,cJ)=>{var Mj=SQ(),$0=p(),x1=wQ(),Bj=fJ(),Nj=a1();function mJ($){this.files=[],this.loadOptions=$}mJ.prototype={checkSignature:function($){if(!this.reader.readAndCheckSignature($)){this.reader.index-=4;var Q=this.reader.readString(4);throw Error("Corrupted zip or bug: unexpected signature ("+$0.pretty(Q)+", expected "+$0.pretty($)+")")}},isSignature:function($,Q){var q=this.reader.index;this.reader.setIndex($);var J=this.reader.readString(4),Y=J===Q;return this.reader.setIndex(q),Y},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var $=this.reader.readData(this.zipCommentLength),Q=Nj.uint8array?"uint8array":"array",q=$0.transformTo(Q,$);this.zipComment=this.loadOptions.decodeFileName(q)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};var $=this.zip64EndOfCentralSize-44,Q=0,q,J,Y;while(Q<$)q=this.reader.readInt(2),J=this.reader.readInt(4),Y=this.reader.readData(J),this.zip64ExtensibleData[q]={id:q,length:J,value:Y}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var $,Q;for($=0;$<this.files.length;$++)Q=this.files[$],this.reader.setIndex(Q.localHeaderOffset),this.checkSignature(x1.LOCAL_FILE_HEADER),Q.readLocalPart(this.reader),Q.handleUTF8(),Q.processAttributes()},readCentralDir:function(){var $;this.reader.setIndex(this.centralDirOffset);while(this.reader.readAndCheckSignature(x1.CENTRAL_FILE_HEADER))$=new Bj({zip64:this.zip64},this.loadOptions),$.readCentralPart(this.reader),this.files.push($);if(this.centralDirRecords!==this.files.length){if(this.centralDirRecords!==0&&this.files.length===0)throw Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)}},readEndOfCentral:function(){var $=this.reader.lastIndexOfSignature(x1.CENTRAL_DIRECTORY_END);if($<0){var Q=!this.isSignature(0,x1.LOCAL_FILE_HEADER);if(Q)throw Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");else throw Error("Corrupted zip: can't find end of central directory")}this.reader.setIndex($);var q=$;if(this.checkSignature(x1.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===$0.MAX_VALUE_16BITS||this.diskWithCentralDirStart===$0.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===$0.MAX_VALUE_16BITS||this.centralDirRecords===$0.MAX_VALUE_16BITS||this.centralDirSize===$0.MAX_VALUE_32BITS||this.centralDirOffset===$0.MAX_VALUE_32BITS){if(this.zip64=!0,$=this.reader.lastIndexOfSignature(x1.ZIP64_CENTRAL_DIRECTORY_LOCATOR),$<0)throw Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex($),this.checkSignature(x1.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,x1.ZIP64_CENTRAL_DIRECTORY_END)){if(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(x1.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0)throw Error("Corrupted zip: can't find the ZIP64 end of central directory")}this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(x1.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var J=this.centralDirOffset+this.centralDirSize;if(this.zip64)J+=20,J+=12+this.zip64EndOfCentralSize;var Y=q-J;if(Y>0)if(this.isSignature(q,x1.CENTRAL_FILE_HEADER));else this.reader.zero=Y;else if(Y<0)throw Error("Corrupted zip: missing "+Math.abs(Y)+" bytes.")},prepareReader:function($){this.reader=Mj($)},load:function($){this.prepareReader($),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};cJ.exports=mJ});var lJ=T((uL,dJ)=>{var yQ=p(),W8=u0(),Ij=o0(),Cj=pJ(),wj=y5(),uJ=A$();function Tj($){return new W8.Promise(function(Q,q){var J=$.decompressed.getContentWorker().pipe(new wj);J.on("error",function(Y){q(Y)}).on("end",function(){if(J.streamInfo.crc32!==$.decompressed.crc32)q(Error("Corrupted zip : CRC32 mismatch"));else Q()}).resume()})}dJ.exports=function($,Q){var q=this;if(Q=yQ.extend(Q||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:Ij.utf8decode}),uJ.isNode&&uJ.isStream($))return W8.Promise.reject(Error("JSZip can't accept a stream when loading a zip file."));return yQ.prepareContent("the loaded zip file",$,!0,Q.optimizedBinaryString,Q.base64).then(function(J){var Y=new Cj(Q);return Y.load(J),Y}).then(function(Y){var X=[W8.Promise.resolve(Y)],V=Y.files;if(Q.checkCRC32)for(var G=0;G<V.length;G++)X.push(Tj(V[G]));return W8.Promise.all(X)}).then(function(Y){var X=Y.shift(),V=X.files;for(var G=0;G<V.length;G++){var U=V[G],K=U.fileNameStr,W=yQ.resolve(U.fileNameStr);if(q.file(W,U.decompressed,{binary:!0,optimizedBinaryString:!0,date:U.date,dir:U.dir,comment:U.fileCommentStr.length?U.fileCommentStr:null,unixPermissions:U.unixPermissions,dosPermissions:U.dosPermissions,createFolders:Q.createFolders}),!U.dir)q.file(W).unsafeOriginalName=K}if(X.zipComment.length)q.comment=X.zipComment;return q})}});var iJ=T((dL,oJ)=>{function M1(){if(!(this instanceof M1))return new M1;if(arguments.length)throw Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var $=new M1;for(var Q in this)if(typeof this[Q]!=="function")$[Q]=this[Q];return $}}M1.prototype=IJ();M1.prototype.loadAsync=lJ();M1.support=a1();M1.defaults=x5();M1.version="3.10.1";M1.loadAsync=function($,Q){return new M1().loadAsync($,Q)};M1.external=u0();oJ.exports=M1});import{homedir as pj}from"node:os";import a from"node:path";function uj($=process.env,Q=G1){if($.OPENCODE_CONFIG_DIR)return $.OPENCODE_CONFIG_DIR;if($.XDG_CONFIG_HOME)return a.join($.XDG_CONFIG_HOME,"opencode");return a.join(Q,".config","opencode")}function z1($,Q,q,J){return`[ -f "$HOME/.petdex/runtime/hooks-disabled" ] && exit 0; ${['if [ -x "$HOME/.petdex/bin/petdex.js" ] || [ -f "$HOME/.petdex/bin/petdex.js" ]; then',` node "$HOME/.petdex/bin/petdex.js" bubble ${Q} ${$} >/dev/null 2>&1 || true;`,"else",` ${dj($,q,J)};`,"fi"].join(" ")}`}function dj($,Q,q){let J=q!=null?`{"state":"${Q}","duration":${q},"agent_source":"${$}"}`:`{"state":"${Q}","agent_source":"${$}"}`;return['T="$(cat "$HOME/.petdex/runtime/update-token" 2>/dev/null)"',`[ -n "$T" ] && curl -s -m 0.3 -X POST ${S0}`,'-H "Content-Type: application/json"','-H "X-Petdex-Update-Token: $T"',`--data-raw '${J}'`,">/dev/null 2>&1 || true"].join(" ")}function lj(){let $=S0.replace(/\/state$/,"/bubble");return String.raw`// petdex hook plugin. Auto-generated by 'petdex hooks install'.
|
|
62
62
|
// Forwards OpenCode lifecycle events to the petdex desktop mascot via HTTP.
|
|
63
63
|
// Edit STATE_MAP below to customize which state each event triggers.
|
|
64
64
|
|
|
@@ -67,7 +67,7 @@ import { readFile } from "node:fs/promises";
|
|
|
67
67
|
import { homedir } from "node:os";
|
|
68
68
|
import { join } from "node:path";
|
|
69
69
|
|
|
70
|
-
const SIDECAR_URL = ${JSON.stringify(
|
|
70
|
+
const SIDECAR_URL = ${JSON.stringify(S0)};
|
|
71
71
|
const SIDECAR_BUBBLE_URL = ${JSON.stringify($)};
|
|
72
72
|
const RUNTIME_DIR = join(homedir(), ".petdex", "runtime");
|
|
73
73
|
const TOKEN_PATH = join(RUNTIME_DIR, "update-token");
|
|
@@ -222,18 +222,18 @@ const PetdexPlugin = {
|
|
|
222
222
|
|
|
223
223
|
export default PetdexPlugin;
|
|
224
224
|
export { PetdexPlugin };
|
|
225
|
-
`}function
|
|
226
|
-
`),q=/^\s*\[([^[\]]+)\]\s*(?:#.*)?$/,
|
|
227
|
-
`);if(Q.state==="wrong-value"){let Y=q[Q.replaceLine],X=/^(\s*codex_hooks\s*=\s*)([^#\n]+?)(\s*(?:#.*)?)$/,
|
|
225
|
+
`}function L0($){if($.startsWith(G1))return`~${$.slice(G1.length)}`;return $}function oj($){let Q=$.split(`
|
|
226
|
+
`),q=/^\s*\[([^[\]]+)\]\s*(?:#.*)?$/,J=/^\s*codex_hooks\s*=\s*(.+?)\s*(?:#.*)?$/,Y=null,X=null;for(let V=0;V<Q.length;V+=1){let G=Q[V],U=G.match(q);if(U){if(Y=U[1].trim(),Y==="features"&&X===null)X=V;continue}if(Y!=="features")continue;let K=G.match(J);if(!K)continue;if(K[1].trim()==="true")return{state:"enabled"};return{state:"wrong-value",replaceLine:V}}if(X===null)return{state:"no-features-section"};return{state:"no-key",insertAfterLine:X}}function ij($,Q){if(Q.state==="enabled"||Q.state==="missing-file")return $;let q=$.split(`
|
|
227
|
+
`);if(Q.state==="wrong-value"){let Y=q[Q.replaceLine],X=/^(\s*codex_hooks\s*=\s*)([^#\n]+?)(\s*(?:#.*)?)$/,V=Y.match(X);return q[Q.replaceLine]=V?`${V[1]}true${V[3]}`:"codex_hooks = true",q.join(`
|
|
228
228
|
`)}if(Q.state==="no-key")return q.splice(Q.insertAfterLine+1,0,"codex_hooks = true"),q.join(`
|
|
229
|
-
`);let
|
|
229
|
+
`);let J=$.endsWith(`
|
|
230
230
|
`)||$.length===0?"":`
|
|
231
|
-
`;return`${$}${
|
|
231
|
+
`;return`${$}${J}
|
|
232
232
|
[features]
|
|
233
233
|
codex_hooks = true
|
|
234
|
-
`}var
|
|
234
|
+
`}var n$=7777,S0,G1,Z8,Q0;var r$=q0(()=>{S0=`http://127.0.0.1:${n$}/state`,G1=pj(),Z8=uj();Q0=[{id:"claude-code",displayName:"Claude Code",configDir:a.join(G1,".claude"),configFile:a.join(G1,".claude","settings.json"),slashCommandPath:a.join(G1,".claude","commands","petdex.md"),docsUrl:"https://docs.anthropic.com/en/docs/claude-code/hooks",hookEntries:[{event:"UserPromptSubmit",kind:"user.prompt"},{event:"PreToolUse",kind:"tool.before"},{event:"PostToolUse",kind:"tool.after"},{event:"Notification",kind:"session.waiting"},{event:"Stop",kind:"session.end"}],build(){return{hooks:{UserPromptSubmit:[{hooks:[{type:"command",command:z1("claude-code","user-prompt","jumping",800)}]}],PreToolUse:[{hooks:[{type:"command",command:z1("claude-code","pre","running")}]}],PostToolUse:[{hooks:[{type:"command",command:z1("claude-code","post","idle")}]}],Notification:[{hooks:[{type:"command",command:z1("claude-code","notification","waiting")}]}],Stop:[{hooks:[{type:"command",command:z1("claude-code","stop","waving",1500)}]}]}}}},{id:"codex",displayName:"Codex CLI",configDir:a.join(G1,".codex"),configFile:a.join(G1,".codex","hooks.json"),slashCommandPath:a.join(G1,".codex","prompts","petdex.md"),docsUrl:"https://developers.openai.com/codex/hooks",hookEntries:[{event:"UserPromptSubmit",kind:"user.prompt"},{event:"PreToolUse",kind:"tool.before"},{event:"PostToolUse",kind:"tool.after"},{event:"PermissionRequest",kind:"session.waiting"},{event:"Stop",kind:"session.end"}],async postInstallChecks(){let{readFile:$}=await import("node:fs/promises"),Q=a.join(G1,".codex","config.toml"),q=!0,J="";try{J=await $(Q,"utf8")}catch(V){let G=V.code;if(G==="ENOENT")q=!1;else return[{level:"warn",message:`Could not read ${Q} (${G??"io_error"}). Make sure [features] codex_hooks = true is set there before Codex picks up the hooks.`}]}let Y=q?oj(J):{state:"missing-file"};if(Y.state==="enabled")return[];let X={prompt:Y.state==="missing-file"?`Create ${L0(Q)} with [features] codex_hooks = true?`:Y.state==="wrong-value"?`Set codex_hooks = true under [features] in ${L0(Q)}? (a .bak of the current file is created first)`:`Add codex_hooks = true under [features] in ${L0(Q)}? (a .bak of the current file is created first)`,apply:async()=>{let{writeFile:V,mkdir:G}=await import("node:fs/promises");if(await G(a.dirname(Q),{recursive:!0}),!q)try{return await V(Q,`[features]
|
|
235
235
|
codex_hooks = true
|
|
236
|
-
`,"utf8"),{ok:!0,message:`Created ${
|
|
236
|
+
`,"utf8"),{ok:!0,message:`Created ${L0(Q)} with [features] codex_hooks = true`}}catch(z){return{ok:!1,message:`Write failed: ${z.message}`}}let U=new Date().toISOString().replace(/[:.]/g,"-"),K=`${Q}.${U}.bak`;try{await V(K,J)}catch(z){return{ok:!1,message:`Backup failed: ${z.message}`}}let W=ij(J,Y);try{return await V(Q,W,"utf8"),{ok:!0,message:`codex_hooks = true set in ${L0(Q)} (backup: ${a.basename(K)})`}}catch(z){return{ok:!1,message:`Write failed: ${z.message}`}}}};return[{level:"action",message:`Codex needs codex_hooks = true under [features] in ${L0(Q)} before it loads ${L0(a.join(G1,".codex","hooks.json"))}.`,fix:X}]},build(){return{hooks:{UserPromptSubmit:[{hooks:[{type:"command",command:z1("codex","user-prompt","jumping",800)}]}],PreToolUse:[{hooks:[{type:"command",command:z1("codex","pre","running")}]}],PostToolUse:[{hooks:[{type:"command",command:z1("codex","post","idle")}]}],PermissionRequest:[{hooks:[{type:"command",command:z1("codex","notification","waiting")}]}],Stop:[{hooks:[{type:"command",command:z1("codex","stop","waving",1500)}]}]}}}},{id:"gemini",displayName:"Gemini CLI",configDir:a.join(G1,".gemini"),configFile:a.join(G1,".gemini","settings.json"),slashCommandPath:a.join(G1,".gemini","antigravity","global_workflows","petdex.md"),docsUrl:"https://google-gemini.github.io/gemini-cli/docs/hooks",hookEntries:[{event:"BeforeTool",kind:"tool.before"},{event:"AfterTool",kind:"tool.after"},{event:"SessionEnd",kind:"session.end"}],build(){return{hooks:{BeforeTool:[{hooks:[{type:"command",command:z1("gemini","pre","running")}]}],AfterTool:[{hooks:[{type:"command",command:z1("gemini","post","idle")}]}],SessionEnd:[{hooks:[{type:"command",command:z1("gemini","stop","waving",1500)}]}]}}}},{id:"opencode",displayName:"OpenCode",configDir:Z8,configFile:a.join(Z8,"plugins","petdex.js"),slashCommandPath:a.join(Z8,"command","petdex.md"),docsUrl:"https://opencode.ai/docs/plugins",hookEntries:[{event:"tool.execute.before",kind:"tool.before"},{event:"tool.execute.after",kind:"tool.after"},{event:"session.idle",kind:"session.end"},{event:"session.error",kind:"session.error"}],build(){return lj()},async postInstallChecks(){return[{level:"info",message:`OpenCode plugin installed at ${L0(a.join(Z8,"plugins","petdex.js"))}. If hooks still do not load, start OpenCode with the same OPENCODE_CONFIG_DIR/XDG_CONFIG_HOME environment used during install.`}]}}]});import{mkdir as oZ,rm as iZ,writeFile as nZ}from"node:fs/promises";import rZ from"node:path";async function lV($){await oZ(rZ.dirname($.slashCommandPath),{recursive:!0}),await nZ($.slashCommandPath,aZ,"utf8")}async function oV($){try{await iZ($.slashCommandPath,{force:!0})}catch{}}var V6='node "$HOME/.petdex/bin/petdex.js"',aZ;var iQ=q0(()=>{aZ=`---
|
|
237
237
|
description: Wake or sleep the petdex mascot. Toggles the floating pet on/off
|
|
238
238
|
---
|
|
239
239
|
|
|
@@ -252,11 +252,11 @@ Show the command output verbatim to the user. Don't reinterpret, don't explain.
|
|
|
252
252
|
If \`$HOME/.petdex/bin/petdex.js\` doesn't exist, the user hasn't run \`petdex hooks install\` yet. Tell them to run \`npx petdex@latest init\` first, then retry.
|
|
253
253
|
|
|
254
254
|
Arguments: \`$ARGUMENTS\`
|
|
255
|
-
`});var
|
|
256
|
-
`),"Done");for(let{agent:
|
|
257
|
-
${U.message}`),U.fix){let W=await M6({message:U.fix.prompt,initialValue:!0});if(!
|
|
258
|
-
Fix the file (or rename it) and run \`petdex hooks install\` again.`);let
|
|
259
|
-
`,"utf8"),{backupPath:
|
|
255
|
+
`});var nV={};x8(nV,{persistRunningBinary:()=>rQ,PERSIST_PATH:()=>j$,PERSIST_DIR:()=>nQ});import{copyFile as sZ,mkdir as tZ}from"node:fs/promises";import{homedir as eZ}from"node:os";import{join as iV}from"node:path";async function rQ(){let $=process.argv[1];if(!$)return{ok:!1,path:j$,reason:"no argv[1]"};try{await tZ(nQ,{recursive:!0}),await sZ($,j$);let{chmod:Q}=await import("node:fs/promises");try{await Q(j$,493)}catch{}return{ok:!0,path:j$}}catch(Q){return{ok:!1,path:j$,reason:Q.message}}}var nQ,j$;var aQ=q0(()=>{nQ=iV(eZ(),".petdex","bin"),j$=iV(nQ,"petdex.js")});import{mkdir as $z,readFile as aV,stat as Qz,writeFile as sQ}from"node:fs/promises";import qz from"node:path";async function Jz(){return Promise.all(Q0.map(async($)=>({agent:$,installed:await sV($.configDir)})))}async function sV($){try{return await Qz($),!0}catch{return!1}}async function tQ(){A1(i.default.bgMagenta(i.default.white(" petdex hooks install ")));try{let{persistRunningBinary:V}=await Promise.resolve().then(() => (aQ(),nV)),G=await V();if(!G.ok&&G.reason)u.warn(`Could not persist petdex binary (${G.reason}). Bubbles will be disabled.`)}catch(V){u.warn(`Could not persist petdex binary (${V.message}). Bubbles will be disabled.`)}let $=await Jz(),Q=$.some((V)=>V.installed);u.info(Q?"Found these agents on your system:":"No coding agent configs detected. You can still pre-write hooks for any agent. They'll activate when you install it.");for(let{agent:V,installed:G}of $){let U=G?i.default.green("●"):i.default.dim("○"),K=G?i.default.dim("installed"):i.default.dim("not found");console.log(` ${U} ${i.default.bold(V.displayName)} ${K}`)}let q=await hq({message:"Which agents should drive the mascot?",options:$.map(({agent:V,installed:G})=>({value:V.id,label:V.displayName,hint:G?"installed":"not installed yet"})),initialValues:$.filter((V)=>V.installed).map((V)=>V.agent.id),required:!1});if(V0(q)||q.length===0)return Y1("No agents selected. Bye."),{installedAgents:[]};let J=[],Y=[],X=[];for(let V of q){let G=Q0.find((U)=>U.id===V);if(!G)continue;try{let U=await eQ(G);if(X.push(G.id),J.push(` ${i.default.green("✓")} ${i.default.bold(G.displayName)}`),G.postInstallChecks)try{let K=await G.postInstallChecks();if(K.length>0)Y.push({agent:G.displayName,notes:K})}catch{}}catch(U){J.push(` ${i.default.red("✗")} ${i.default.bold(G.displayName)} ${i.default.red(U instanceof Error?U.message:String(U))}`)}}T1(J.join(`
|
|
256
|
+
`),"Done");for(let{agent:V,notes:G}of Y)for(let U of G){let K=U.level==="action"?i.default.bgYellow(i.default.black(" action needed ")):U.level==="warn"?i.default.yellow("!"):i.default.cyan("i");if(u.warn(`${K} ${i.default.bold(V)}
|
|
257
|
+
${U.message}`),U.fix){let W=await M6({message:U.fix.prompt,initialValue:!0});if(!V0(W)&&W){let z=await U.fix.apply();if(z.ok)u.info(`${i.default.green("✓")} ${z.message}`);else u.warn(`${i.default.red("✗")} ${z.message}`)}}}return{installedAgents:X}}async function eQ($){await $z(qz.dirname($.configFile),{recursive:!0});let Q=$.build();if(await lV($),$.id==="opencode"){let V=await rV($.configFile);return await sQ($.configFile,Q,"utf8"),{backupPath:V}}let q=await Vz($.configFile);if(q.kind==="error")throw Error(`Refusing to overwrite ${$.configFile}: ${q.message}.
|
|
258
|
+
Fix the file (or rename it) and run \`petdex hooks install\` again.`);let J=q.kind==="ok"?await rV($.configFile):null,Y=q.kind==="ok"?q.value:{},X=Yz(Y,Q);return await sQ($.configFile,`${JSON.stringify(X,null,2)}
|
|
259
|
+
`,"utf8"),{backupPath:J}}async function Vz($){let Q;try{Q=await aV($,"utf8")}catch(q){let J=q.code;if(J==="ENOENT")return{kind:"missing"};return{kind:"error",message:`read failed (${J??q.name}): ${q.message}`}}try{return{kind:"ok",value:JSON.parse(Q)}}catch(q){return{kind:"error",message:`JSON parse failed: ${q.message}`}}}async function rV($){if(!await sV($))return null;let Q=new Date().toISOString().replace(/[:.]/g,"-"),q=`${$}.${Q}.bak`,J=await aV($);return await sQ(q,J),q}function Yz($,Q){let q={...$},J=Q.hooks??{},X={...q.hooks??{}};for(let[V,G]of Object.entries(J)){let K=(Array.isArray(X[V])?X[V]:[]).filter((W)=>!Xz(W));X[V]=[...K,...G]}return q.hooks=X,q}function Xz($){if(typeof $!=="object"||$==null)return!1;return Gz($).some((q)=>q.includes(`localhost:${n$}/state`)||q.includes(S0))}function Gz($){let Q=[];function q(J){if(typeof J==="string"){Q.push(J);return}if(Array.isArray(J)){for(let Y of J)q(Y);return}if(typeof J==="object"&&J!=null)for(let Y of Object.values(J))q(Y)}return q($),Q}var i;var $q=q0(()=>{g0();r$();iQ();i=C1(o1(),1)});var Qq={};x8(Qq,{runRefresh:()=>Wz});import{existsSync as tV}from"node:fs";function Kz($){return tV($.configFile)||tV($.slashCommandPath)}async function Wz(){let $={refreshed:[],skipped:[],binaryPersisted:!1};try{let Q=await rQ();if($.binaryPersisted=Q.ok,!Q.ok)$.binaryReason=Q.reason}catch(Q){$.binaryReason=Q.message}for(let Q of Q0){if(!Kz(Q)){$.skipped.push({id:Q.id,reason:"not installed"});continue}try{await eQ(Q),$.refreshed.push(Q.id)}catch(q){$.skipped.push({id:Q.id,reason:q.message})}}return $}var qq=q0(()=>{r$();$q();aQ()});function Cz($){let Q=$.toLowerCase();if(Q==="read")return"read";if(Q==="edit"||Q==="multiedit")return"edit";if(Q==="write")return"write";if(Q==="bash"||Q==="shell")return"bash";if(Q==="grep")return"grep";if(Q==="glob")return"glob";if(Q==="webfetch"||Q==="websearch")return"webfetch";if(Q==="task"||Q==="agent")return"task";return"unknown"}function d1($,Q){if($==null||typeof $!=="object")return null;let q=$[Q];return typeof q==="string"?q:null}function UY($){let Q=Math.max($.lastIndexOf("/"),$.lastIndexOf("\\"));return Q>=0?$.slice(Q+1):$}function E1($,Q=40){if($.length<=Q)return $;return`${$.slice(0,Q-1)}…`}function jY($){if($.kind==="session.start")return"Thinking…";if($.kind==="session.end")return"Done.";if($.kind==="session.waiting")return"Waiting for you…";let{toolName:Q,phase:q,toolInput:J}=$,Y=Cz(Q),X=q==="done";switch(Y){case"read":{let V=d1(J,"file_path")??d1(J,"path"),G=V?E1(UY(V)):null;if(G)return X?`Read ${G}`:`Reading ${G}`;return X?"Read file":"Reading file"}case"edit":case"write":{let V=d1(J,"file_path")??d1(J,"path"),G=V?E1(UY(V)):null;if(G)return X?`Edited ${G}`:`Editing ${G}`;return X?"Edited file":"Editing file"}case"bash":{let V=d1(J,"command");if(V){let G=E1(V.split(/\s+/)[0]??V,24);return X?`Ran ${G}`:`Running ${G}`}return X?"Ran command":"Running command"}case"grep":{let V=d1(J,"pattern");if(V)return X?`Searched "${E1(V,28)}"`:`Searching "${E1(V,28)}"`;return X?"Searched files":"Searching files"}case"glob":{let V=d1(J,"pattern");if(V)return X?`Listed ${E1(V,28)}`:`Listing ${E1(V,28)}`;return X?"Listed files":"Listing files"}case"webfetch":{let V=d1(J,"url");if(V)try{let G=new URL(V).hostname;return X?`Fetched ${E1(G,28)}`:`Fetching ${E1(G,28)}`}catch{}return X?"Fetched web":"Searching web"}case"task":{let V=d1(J,"description")??d1(J,"subject");if(V)return X?"Subagent done":`Spawning ${E1(V,28)}`;return X?"Subagent done":"Spawning subagent"}case"unknown":default:{let V=E1(Q,28);return X?`Called ${V}`:`Calling ${V}`}}}var BY={};x8(BY,{stateForEvent:()=>PY,runBubble:()=>yz,eventFromArgs:()=>MY});import{existsSync as wz,readFileSync as Tz}from"node:fs";import{homedir as Az}from"node:os";import{join as Jq}from"node:path";function PY($,Q){let q=$[0];if(q==="pre"){if(Q){let J=Q.toLowerCase();if(J==="read"||J==="grep"||J==="glob")return"review"}return"running"}if(q==="post")return"idle";if(q==="stop"||q==="session-end")return"waving";if(q==="user-prompt"||q==="session-start")return"jumping";if(q==="waiting"||q==="notification")return"waiting";return null}async function Sz(){if(process.stdin.isTTY)return"";return await new Promise(($)=>{let Q="",q=!1;process.stdin.setEncoding("utf8"),process.stdin.on("data",(J)=>{if(q)return;if(Q.length+J.length>ZY){Q+=J.slice(0,ZY-Q.length),q=!0;return}Q+=J}),process.stdin.on("end",()=>$(Q)),process.stdin.on("error",()=>$(Q))})}function OY($){if(!$.trim())return{toolName:null,toolInput:void 0,agentSource:null};try{let Q=JSON.parse($),q=typeof Q.tool_name==="string"?Q.tool_name:null,J=Q.tool_input,Y=typeof Q.agent_source==="string"?Q.agent_source:null;return{toolName:q,toolInput:J,agentSource:Y}}catch{return{toolName:null,toolInput:void 0,agentSource:null}}}function MY($,Q){let q=$[0];if(!q)return null;if(q==="stop"||q==="session-end")return{kind:"session.end"};if(q==="user-prompt"||q==="session-start")return{kind:"session.start"};if(q==="waiting"||q==="notification")return{kind:"session.waiting"};let J=q==="pre"?"running":q==="post"?"done":null;if(!J)return null;let{toolName:Y,toolInput:X}=OY(Q);if(!Y)return{kind:"tool",phase:J,toolName:"tool",toolInput:void 0};return{kind:"tool",phase:J,toolName:Y,toolInput:X}}function Ez(){try{let $=Tz(Fz,"utf8").trim();return $.length>0?$:null}catch{return null}}async function zY($,Q,q){let J=new AbortController,Y=setTimeout(()=>J.abort(),300);try{await fetch($,{method:"POST",headers:{"Content-Type":"application/json","X-Petdex-Update-Token":q},body:JSON.stringify(Q),signal:J.signal})}catch{}finally{clearTimeout(Y)}}async function yz($){if(wz(Rz))return;let Q=$[1]??null,q=await Sz(),J=MY($,q);if(!J)return;let{toolName:Y,agentSource:X}=OY(q),V=X??Q,G=jY(J),U=PY($,Y),K=Ez();if(!K)return;let W=[];if(G)W.push(zY(vz,{text:G,agent_source:V},K));if(U)W.push(zY(xz,{state:U,agent_source:V},K));await Promise.all(W)}var HY,Fz,Rz,LY="http://127.0.0.1:7777",vz,xz,ZY=65536;var NY=q0(()=>{HY=Jq(Az(),".petdex","runtime"),Fz=Jq(HY,"update-token"),Rz=Jq(HY,"hooks-disabled"),vz=`${LY}/bubble`,xz=`${LY}/state`});g0();var Gq=C1(iJ(),1),j=C1(o1(),1);import{existsSync as kz}from"node:fs";import{mkdir as IY,readdir as gz,readFile as Xq,stat as vY,writeFile as w8}from"node:fs/promises";import{homedir as CY}from"node:os";import V1 from"node:path";import{spawn as bj}from"node:child_process";import{createServer as Aj}from"node:http";class g extends Error{code;constructor($,Q){super(Q);this.name="ClerkCliAuthError",this.code=$}}var Fj=`<!doctype html>
|
|
260
260
|
<html>
|
|
261
261
|
<head><meta charset="utf-8"><title>Authentication complete</title></head>
|
|
262
262
|
<body><h1>Authentication complete</h1><p>You can close this tab and return to your terminal.</p></body>
|
|
@@ -264,51 +264,51 @@ ${U.message}`),U.fix){let W=await M6({message:U.fix.prompt,initialValue:!0});if(
|
|
|
264
264
|
<html>
|
|
265
265
|
<head><meta charset="utf-8"><title>Authentication failed</title></head>
|
|
266
266
|
<body><h1>Authentication failed</h1><p>You can close this tab and return to your terminal.</p></body>
|
|
267
|
-
</html>`;function kQ($,Q){return new g($,Q)}function
|
|
268
|
-
`,{mode:384}),await vj(this.filePath,384)}catch(Q){throw
|
|
269
|
-
${$}`);let Q=process.platform,q=Q==="darwin"?"open":Q==="win32"?"cmd":"xdg-open",
|
|
267
|
+
</html>`;function kQ($,Q){return new g($,Q)}function nJ($){let{expectedState:Q,port:q=0,timeoutMs:J=120000,successHtml:Y=Fj,errorHtml:X=Rj}=$,V,G=!1,U=!1,K,W,z=new Promise((C,I)=>{K=C,W=I}),Z=(C)=>{if(U)return;U=!0,C.close()},H=Aj((C,I)=>{if(G){I.writeHead(410,{"Content-Type":"text/plain; charset=utf-8"}),I.end("Authentication callback already handled.");return}if(C.method!=="GET"||!C.url){I.writeHead(404,{"Content-Type":"text/plain; charset=utf-8"}),I.end("Not found");return}let w=new URL(C.url,"http://127.0.0.1");if(w.pathname!=="/callback"){I.writeHead(404,{"Content-Type":"text/plain; charset=utf-8"}),I.end("Clerk CLI auth server is waiting for /callback.");return}let N=w.searchParams.get("code"),O=w.searchParams.get("state"),B=w.searchParams.get("error"),L=w.searchParams.get("error_description")??B,P=(A,R,v)=>{if(G=!0,V)clearTimeout(V);I.writeHead(A,{"Content-Type":"text/html; charset=utf-8"}),I.end(R,()=>{if(v)W(v);else if(N&&O)K({code:N,state:O});Z(H)})};if(B){P(400,X,kQ("token_exchange",`OAuth authorization failed: ${L??"unknown error"}`));return}if(O!==Q){P(400,X,kQ("state_mismatch","OAuth callback state did not match."));return}if(!N){P(400,X,kQ("token_exchange","OAuth callback did not include an authorization code."));return}P(200,Y)});return new Promise((C,I)=>{H.once("error",(w)=>{I(new g("config",`Failed to start local auth callback server: ${w.message}`))}),H.listen(q,"127.0.0.1",()=>{let N=H.address().port,O=`http://127.0.0.1:${N}/callback`;V=setTimeout(()=>{if(G)return;G=!0,W(new g("timeout",`OAuth callback timed out after ${J}ms.`)),Z(H)},J),C({port:N,redirectUri:O,waitForCallback:()=>z,close:()=>{if(V)clearTimeout(V);if(!G)G=!0,W(new g("timeout","OAuth callback server was closed."));Z(H)}})})})}import{chmod as vj,mkdir as xj,readFile as Sj,writeFile as Ej}from"node:fs/promises";import{homedir as yj}from"node:os";import{dirname as kj,join as gj}from"node:path";function rJ($,Q){if(Q instanceof g)return Q;let q=Q instanceof Error?Q.message:String(Q);return new g("storage",`${$}: ${q}`)}function sJ($){return $?.environment??"default"}function Dj($){return gj(yj(),".config","clerk-cli-auth",`${$}.json`)}class tJ{values=new Map;async get($){return this.values.get($)??null}async set($,Q){this.values.set($,Q)}async delete($){this.values.delete($)}}class eJ{filePath;queue=Promise.resolve();constructor($){this.filePath=$}enqueue($){let Q=this.queue.then($,$);return this.queue=Q.catch(()=>{return}),Q}async readAll(){try{let $=await Sj(this.filePath,"utf8");if(!$.trim())return{};let Q=JSON.parse($);if(!Q||typeof Q!=="object"||Array.isArray(Q))return{};let q={};for(let[J,Y]of Object.entries(Q))if(typeof Y==="string")q[J]=Y;return q}catch($){if($.code==="ENOENT")return{};throw rJ(`Failed to read credential file ${this.filePath}`,$)}}async writeAll($){try{await xj(kj(this.filePath),{recursive:!0}),await Ej(this.filePath,`${JSON.stringify($,null,2)}
|
|
268
|
+
`,{mode:384}),await vj(this.filePath,384)}catch(Q){throw rJ(`Failed to write credential file ${this.filePath}`,Q)}}async get($){return this.enqueue(async()=>{return(await this.readAll())[$]??null})}async set($,Q){return this.enqueue(async()=>{let q=await this.readAll();q[$]=Q,await this.writeAll(q)})}async delete($){return this.enqueue(async()=>{let Q=await this.readAll();delete Q[$],await this.writeAll(Q)})}}class $V{service;environment;fallback;keyringPromise=null;constructor($,Q,q){this.service=$;this.environment=Q;this.fallback=q}account($){return`${this.environment}:${$}`}warnFallback($,Q){let q=Q instanceof Error?Q.message:String(Q);if($==="initialization"&&q.includes("Cannot find package"))return;console.warn(`Keychain ${$} failed; falling back to file store. ${q}`)}async loadKeyring(){return this.keyringPromise??=import("@napi-rs/keyring").catch(($)=>{return this.warnFallback("initialization",$),null}),this.keyringPromise}async get($){try{let Q=await this.loadKeyring();if(!Q)return this.fallback.get($);return new Q.Entry(this.service,this.account($)).getPassword()??await this.fallback.get($)}catch(Q){return this.warnFallback("get",Q),this.fallback.get($)}}async set($,Q){try{let q=await this.loadKeyring();if(!q){await this.fallback.set($,Q);return}new q.Entry(this.service,this.account($)).setPassword(Q)}catch(q){this.warnFallback("set",q),await this.fallback.set($,Q)}}async delete($){try{let Q=await this.loadKeyring();if(Q)new Q.Entry(this.service,this.account($)).deletePassword()}catch(Q){this.warnFallback("delete",Q)}await this.fallback.delete($)}}function aJ($){let Q=sJ($);return new eJ($?.filePath??Dj(Q))}function QV($,Q){if($==="memory")return new tJ;if($==="file")return aJ(Q);let q=aJ(Q),J=Q?.keychainService??"clerk-cli-auth",Y=sJ(Q);return new $V(J,Y,q)}import{createHash as hj,randomBytes as qV}from"node:crypto";function gQ($){return $.toString("base64url")}function JV(){return gQ(qV(32))}async function VV($){return gQ(hj("sha256").update($).digest())}function YV(){return gQ(qV(32))}function XV($,Q){return`${$.replace(/\/+$/,"")}${Q}`}async function GV($){if(($.headers.get("content-type")??"").includes("application/json"))return $.json();return $.text()}function KV($,Q){if(typeof $==="string"&&$.trim())return $.trim();if($&&typeof $==="object"){let q=$;for(let J of["error_description","message","error"]){let Y=q[J];if(typeof Y==="string"&&Y.trim())return Y.trim()}}return Q}function _j($){if(typeof $.access_token!=="string"||$.access_token.length===0)throw new g("token_exchange","Token response did not include access_token.");let Q={accessToken:$.access_token};if(typeof $.refresh_token==="string")Q.refreshToken=$.refresh_token;if(typeof $.id_token==="string")Q.idToken=$.id_token;if(typeof $.scope==="string")Q.scope=$.scope;if(typeof $.token_type==="string")Q.tokenType=$.token_type;if(typeof $.expires_in==="number")Q.expiresAt=Date.now()+$.expires_in*1000;return Q}async function WV($,Q){let q;try{q=await fetch(XV($,"/oauth/token"),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:Q.toString()})}catch(Y){throw new g("token_exchange",`Token request failed: ${Y.message}`)}let J;try{J=await GV(q)}catch(Y){throw new g("token_exchange",`Token response could not be parsed: ${Y.message}`)}if(!q.ok)throw new g("token_exchange",KV(J,`Token request failed with HTTP ${q.status}.`));if(!J||typeof J!=="object")throw new g("token_exchange","Token response was not JSON.");return _j(J)}async function UV($){let Q=new URLSearchParams({grant_type:"authorization_code",client_id:$.clientId,code:$.code,code_verifier:$.codeVerifier,redirect_uri:$.redirectUri});return WV($.issuer,Q)}async function jV($){let Q=new URLSearchParams({grant_type:"refresh_token",client_id:$.clientId,refresh_token:$.refreshToken});if($.scopes?.length)Q.set("scope",$.scopes.join(" "));return WV($.issuer,Q)}async function DQ($){let Q;try{Q=await fetch(XV($.issuer,"/oauth/userinfo"),{headers:{Authorization:`Bearer ${$.accessToken}`}})}catch(Y){throw new g("userinfo",`Userinfo request failed: ${Y.message}`)}let q;try{q=await GV(Q)}catch(Y){throw new g("userinfo",`Userinfo response could not be parsed: ${Y.message}`)}if(!Q.ok)throw new g("userinfo",KV(q,`Userinfo request failed with HTTP ${Q.status}.`));if(!q||typeof q!=="object")throw new g("userinfo","Userinfo response was not JSON.");let J=q;if(typeof J.sub!=="string"||J.sub.length===0)throw new g("userinfo","Userinfo response did not include sub.");return J}var fj=["profile","email","openid","offline_access"];function mj($){let Q=$.trim().replace(/\/+$/,"");try{let q=new URL(Q);if(q.protocol!=="http:"&&q.protocol!=="https:")throw Error("issuer must use http or https");return Q}catch(q){throw new g("config",`issuer must be a valid URL: ${q.message}`)}}function U8($,Q){if(Q instanceof g)return Q;let q=Q instanceof Error?Q.message:String(Q);return new g("storage",`Failed to ${$}: ${q}`)}async function cj($){console.log(`Open this URL to sign in:
|
|
269
|
+
${$}`);let Q=process.platform,q=Q==="darwin"?"open":Q==="win32"?"cmd":"xdg-open",J=Q==="win32"?["/c","start","",$]:[$];await new Promise((Y)=>{let X=bj(q,J,{detached:!0,stdio:"ignore"});X.once("error",()=>Y()),X.unref(),Y()})}class j8{config;constructor($){if(!$.clientId)throw new g("config","clientId is required");if(!$.issuer)throw new g("config","issuer is required");let Q=$.environment??"default",q=typeof $.storage==="object"&&$.storage!==null?$.storage:QV($.storage??"keychain",{environment:Q,keychainService:$.keychainService});this.config={clientId:$.clientId,issuer:mj($.issuer),scopes:$.scopes??fj,storage:q,keychainService:$.keychainService??"clerk-cli-auth",environment:Q,callbackPort:$.callbackPort??0,timeoutMs:$.timeoutMs??120000,openBrowser:$.openBrowser}}async login(){let $=JV(),Q=await VV($),q=YV(),J=await nJ({expectedState:q,port:this.config.callbackPort,timeoutMs:this.config.timeoutMs});try{let Y=new URL(`${this.config.issuer}/oauth/authorize`);Y.searchParams.set("response_type","code"),Y.searchParams.set("client_id",this.config.clientId),Y.searchParams.set("redirect_uri",J.redirectUri),Y.searchParams.set("scope",this.config.scopes.join(" ")),Y.searchParams.set("state",q),Y.searchParams.set("code_challenge",Q),Y.searchParams.set("code_challenge_method","S256");try{await(this.config.openBrowser??cj)(Y.toString())}catch(U){throw new g("config",`Failed to open authorization URL: ${U.message}`)}let{code:X}=await J.waitForCallback(),V=await UV({issuer:this.config.issuer,clientId:this.config.clientId,code:X,codeVerifier:$,redirectUri:J.redirectUri});await this.setJson("tokens",V);let G=await DQ({issuer:this.config.issuer,accessToken:V.accessToken});return await this.setJson("user",G),{tokens:V,user:G}}finally{J.close()}}async getAccessToken(){let $=await this.getTokenSet();if(!$)return null;if(($.expiresAt??Number.POSITIVE_INFINITY)>=Date.now()+30000)return $.accessToken;if(!$.refreshToken)return null;let q=await jV({issuer:this.config.issuer,clientId:this.config.clientId,refreshToken:$.refreshToken,scopes:this.config.scopes}),J={...$,...q,refreshToken:q.refreshToken??$.refreshToken};return await this.setJson("tokens",J),J.accessToken}async whoami(){let $=await this.getJson("user");if($)return $;let Q=await this.getAccessToken();if(!Q)return null;let q=await DQ({issuer:this.config.issuer,accessToken:Q});return await this.setJson("user",q),q}async logout(){try{await Promise.all([this.config.storage.delete("tokens"),this.config.storage.delete("user")])}catch($){throw U8("clear stored credentials",$)}}async getTokenSet(){return this.getJson("tokens")}async getJson($){let Q;try{Q=await this.config.storage.get($)}catch(q){throw U8(`read ${$}`,q)}if(!Q)return null;try{return JSON.parse(Q)}catch(q){throw U8(`parse stored ${$}`,q)}}async setJson($,Q){try{await this.config.storage.set($,JSON.stringify(Q))}catch(q){throw U8(`write ${$}`,q)}}}r$();var K1=C1(o1(),1);import{execSync as MZ}from"node:child_process";import{existsSync as p1,readFileSync as P8,statSync as dQ}from"node:fs";import{homedir as BZ}from"node:os";import E0 from"node:path";import{existsSync as nj,mkdirSync as rj,unlinkSync as aj,writeFileSync as sj}from"node:fs";import{homedir as tj}from"node:os";import hQ from"node:path";function ZV(){return process.env.HOME??tj()}function zV(){return hQ.join(ZV(),".petdex","runtime","hooks-disabled")}function a$(){return hQ.join(ZV(),".petdex","runtime","update-token")}function X$(){return nj(zV())?"off":"on"}function G$($){let Q=zV();if($==="off")rj(hQ.dirname(Q),{recursive:!0}),sj(Q,`# Petdex hook killswitch.
|
|
270
|
+
# Hooks are DISABLED while this file exists.
|
|
271
|
+
# Re-enable: petdex hooks on (or /petdex from inside your agent).
|
|
272
|
+
`,{mode:384});else try{aj(Q)}catch{}return $}function HV(){return G$(X$()==="on"?"off":"on")}import{randomBytes as BV}from"node:crypto";import{existsSync as bQ,statSync as ej}from"node:fs";import{chmod as $Z,mkdir as z8,rename as s$,rm as m1,writeFile as H8}from"node:fs/promises";import{homedir as K$,arch as QZ,platform as t$}from"node:os";import q1 from"node:path";g0();var r=C1(o1(),1),qZ="https://api.github.com/repos/crafter-station/petdex/releases",LV=30,JZ=5,PV="desktop-v",NV="petdex-desktop-sidecar.js";function fQ(){let $=t$(),Q=QZ(),q=$==="darwin"?"darwin":$==="linux"?"linux":$==="win32"?"win32":$,J=Q==="arm64"?"arm64":Q==="x64"?"x64":Q;return{osLabel:q,archLabel:J,assetSuffix:`${q}-${J}`}}function c1(){let $=t$()==="win32"?".exe":"";if(t$()==="darwin"){let Q=["/Applications/Petdex.app/Contents/MacOS/petdex-desktop",q1.join(K$(),"Applications","Petdex.app","Contents","MacOS","petdex-desktop")];for(let q of Q)if(bQ(q))return q}return q1.join(K$(),".petdex","bin",`petdex-desktop${$}`)}function L8(){if(t$()==="darwin"){let $=["/Applications/Petdex.app/Contents/Resources/sidecar/server.js",q1.join(K$(),"Applications","Petdex.app","Contents","Resources","sidecar","server.js")];for(let Q of $)if(bQ(Q))return Q}return q1.join(K$(),".petdex","sidecar","server.js")}async function mQ($={}){let Q=$.fetchOverride??fetch,q=$.maxPages??JZ,J=0;for(let Y=1;Y<=q;Y++){let X=`${qZ}?per_page=${LV}&page=${Y}`,V=await Q(X,{headers:{Accept:"application/vnd.github+json"}});if(!V.ok)throw Error(`GitHub API ${V.status}`);let G=await V.json();if(!Array.isArray(G)||G.length===0)break;J+=G.length;let U=G.find((K)=>!K.draft&&!K.prerelease&&typeof K.tag_name==="string"&&K.tag_name.startsWith(PV));if(U)return U;if(G.length<LV)break}throw Error(`No ${PV}* release found in the last ${J} releases (scanned ${q} page(s))`)}function VZ($,Q){let q=`petdex-desktop-${Q}`,J=$.assets.find((Y)=>Y.name.startsWith(q));if(!J){let Y=$.assets.map((X)=>` ${X.name}`).join(`
|
|
270
273
|
`);throw Error(`No binary for ${Q} in ${$.tag_name}.
|
|
271
274
|
Available:
|
|
272
|
-
${Y}`)}return
|
|
273
|
-
`),q=null;for(let
|
|
274
|
-
${W.message}`)}Q.stop(`${r.default.green("✓")} Latest: ${r.default.bold(q.tag_name)}`);let
|
|
275
|
+
${Y}`)}return J}function YZ($){return $.assets.find((Q)=>Q.name===NV)??null}function XZ($,Q){let q=`Petdex-${Q}.dmg`;return $.assets.find((J)=>J.name===q)??null}function IV($){let q=$.indexOf("/Contents/MacOS/");if(q===-1)return null;return $.slice(0,q)}async function _Q($,Q,q){let J=await fetch($);if(!J.ok||!J.body)throw Error(`download ${$} → ${J.status}`);let Y=Buffer.from(await J.arrayBuffer()),X=`${Q}.tmp`;try{if(await H8(X,Y),q!==void 0)await $Z(X,q);if(t$()==="darwin")try{let{spawnSync:V}=await import("node:child_process");V("xattr",["-d","com.apple.quarantine",X],{stdio:"ignore"})}catch{}return{tmpPath:X,destPath:Q}}catch(V){try{await m1(X,{force:!0})}catch{}throw V}}async function GZ($){let Q=[];for(let q of $){let J=null;try{let Y=`${q.destPath}.prev`;try{await s$(q.destPath,Y),J=Y}catch(X){if(X.code!=="ENOENT")throw X}await s$(q.tmpPath,q.destPath),Q.push({dest:q.destPath,backup:J})}catch(Y){if(J)try{await m1(q.destPath,{force:!0}),await s$(J,q.destPath)}catch{}for(let X of Q.reverse())try{if(X.backup)await m1(X.dest,{force:!0}),await s$(X.backup,X.dest);else await m1(X.dest,{force:!0})}catch{}for(let X of $)try{await m1(X.tmpPath,{force:!0})}catch{}throw Y}}for(let q of Q){if(!q.backup)continue;try{await m1(q.backup,{force:!0})}catch{}}}async function cQ($){let Q=fQ(),q=VZ($,Q.assetSuffix),J=YZ($),Y=c1(),X=L8();await z8(q1.dirname(Y),{recursive:!0}),await z8(q1.dirname(X),{recursive:!0});let V=[];try{if(V.push(await _Q(q.browser_download_url,Y,493)),J)V.push(await _Q(J.browser_download_url,X))}catch(G){for(let U of V)try{await m1(U.tmpPath,{force:!0})}catch{}throw G}return{binAsset:q,sidecarAsset:J,staged:V}}async function pQ($){await GZ($.staged)}async function KZ($){let Q=await cQ($);return await pQ(Q),{binAsset:Q.binAsset,sidecarAsset:Q.sidecarAsset}}async function CV($,Q){let q=fQ(),J=XZ($,q.archLabel);if(!J)throw Error(`No DMG asset (Petdex-${q.archLabel}.dmg) in ${$.tag_name}. App-bundle update requires a DMG; falling back is not safe.`);let{join:Y}=await import("node:path"),{tmpdir:X}=await import("node:os"),V=Y(X(),`petdex-${BV(8).toString("hex")}-${J.name}`),G=await _Q(J.browser_download_url,V),{rename:U}=await import("node:fs/promises");await U(G.tmpPath,V);let{spawnSync:K}=await import("node:child_process"),W=K("hdiutil",["attach","-nobrowse","-quiet",V],{encoding:"utf8"});if(W.status!==0)throw Error(`hdiutil attach failed (exit ${W.status}): ${W.stderr||W.stdout||"no output"}`);let z=WZ(W.stdout)??"/Volumes/Petdex";try{let Z=`${z}/Petdex.app`,{existsSync:H}=await import("node:fs");if(!H(Z))throw Error(`mounted DMG at ${z} does not contain Petdex.app — is the release shape unchanged?`);let C=K("ditto",[Z,Q],{encoding:"utf8"});if(C.status!==0)throw Error(`ditto failed (exit ${C.status}): ${C.stderr||C.stdout||"no output"}`);K("xattr",["-dr","com.apple.quarantine",Q],{encoding:"utf8"})}finally{K("hdiutil",["detach","-quiet",z],{encoding:"utf8"});try{await m1(V,{force:!0})}catch{}}return{appBundleRoot:Q,dmgAsset:J}}function WZ($){let Q=$.split(`
|
|
276
|
+
`),q=null;for(let J of Q){let Y=J.indexOf("/Volumes/");if(Y===-1)continue;let X=J.slice(Y).trim();if(!q||X.length>q.length)q=X}return q}var UZ="boba",jZ=process.env.PETDEX_URL??"https://petdex.crafter.run",ZZ=new Set(["pub-94495283df974cfea5e98d6a9e3fa462.r2.dev","yu2vz9gndp.ufs.sh"]);function e$($){try{let Q=new URL($);if(Q.protocol!=="https:")return!1;return ZZ.has(Q.hostname)}catch{return!1}}function wV(){return process.env.HOME??K$()}function TV(){return q1.join(wV(),".petdex","pets")}function AV(){return q1.join(wV(),".codex","pets")}var zZ=16777216;function HZ($){for(let Q of["spritesheet.webp","spritesheet.png"]){let q=q1.join($,Q);try{let J=ej(q);if(J.isFile()&&J.size>0&&J.size<=zZ)return!0}catch{}}return!1}async function LZ(){let{readdir:$}=await import("node:fs/promises");for(let Q of[TV(),AV()]){let q;try{q=await $(Q)}catch{continue}for(let J of q)if(HZ(q1.join(Q,J)))return!0}return!1}async function PZ($={}){let Q=$.fetchOverride??fetch,q=$.petdexUrl??jZ,J;try{let G=await Q(`${q}/api/manifest`,{signal:AbortSignal.timeout(8000)});if(!G.ok)return null;let U=await G.json();J=Array.isArray(U?.pets)?U.pets:[]}catch{return null}if(J.length===0)return null;let Y=[],X=new Set,V=J.find((G)=>G.slug===UZ);if(V)Y.push(V),X.add(V.slug);for(let G of J)if(!X.has(G.slug))Y.push(G),X.add(G.slug);for(let G of Y){let U=await OZ(G,Q);if(U)return U}return null}async function OZ($,Q){if(!e$($.spritesheetUrl)||!e$($.petJsonUrl))return null;let q=$.spritesheetUrl.endsWith(".png")?"png":"webp",J=[q1.join(TV(),$.slug),q1.join(AV(),$.slug)];for(let K of J)if(bQ(K))return null;let Y=async(K)=>{let W=await Q(K,{signal:AbortSignal.timeout(15000)});if(!W.ok)throw Error(`download ${K} → ${W.status}`);return W.arrayBuffer()},X,V;try{[X,V]=await Promise.all([Y($.petJsonUrl),Y($.spritesheetUrl)])}catch{return null}let G=[],U=[];try{for(let K of J){let W=`${K}.partial-${BV(6).toString("hex")}`;await z8(W,{recursive:!0}),G.push(W),await Promise.all([H8(q1.join(W,"pet.json"),Buffer.from(X)),H8(q1.join(W,`spritesheet.${q}`),Buffer.from(V))]),await z8(q1.dirname(K),{recursive:!0}),await s$(W,K),G.pop(),U.push(K)}return $.slug}catch{return await Promise.all([...G.map((K)=>m1(K,{recursive:!0,force:!0})),...U.map((K)=>m1(K,{recursive:!0,force:!0}))]),null}}async function uQ(){A1(r.default.bgMagenta(r.default.white(" petdex install desktop ")));let $=fQ();u.info(`Platform: ${r.default.cyan(`${$.osLabel} ${$.archLabel}`)}`);let Q=H1();Q.start("Looking up the latest release");let q;try{q=await mQ()}catch(W){throw Q.stop(r.default.red("failed")),Error(`Could not reach GitHub. Check your connection.
|
|
277
|
+
${W.message}`)}Q.stop(`${r.default.green("✓")} Latest: ${r.default.bold(q.tag_name)}`);let J=H1();J.start("Downloading desktop binary and sidecar");let Y;try{Y=await KZ(q)}catch(W){throw J.stop(r.default.red("failed")),W}let X=c1(),V=q1.join(K$(),".petdex","version");await H8(V,`${q.tag_name}
|
|
275
278
|
`);let G=Y.sidecarAsset?`
|
|
276
|
-
${r.default.dim("•")} Sidecar at ${r.default.cyan(
|
|
277
|
-
${r.default.yellow("!")} No sidecar in this release. Hooks won't reach the mascot until a release ships ${
|
|
278
|
-
`),"Next"),F1(`${r.default.green("✓")} ${q.tag_name}`),{tag:q.tag_name}}function
|
|
279
|
-
`).
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
`).length-1;N1({status:Q===1?"ok":"warn",label:":7777 listener",detail:Q===1?"1 process bound":`${Q} processes bound`,hint:Q>1?"Multiple sidecars contending for the same port. Stop both and start fresh.":void 0})}console.log("")}y0();var D=C1(d1(),1);import{existsSync as qz,readFileSync as nJ}from"node:fs";import{writeFile as oJ}from"node:fs/promises";import{homedir as rJ}from"node:os";import aJ from"node:path";var B8=7777,Vz="x-petdex-update-token",Jz=aJ.join(rJ(),".petdex","runtime","update-token"),N8=aJ.join(rJ(),".petdex","version");async function Yz($={}){let Q=$.port??B8,q=$.timeoutMs??2000,V=$.tokenPath??Jz,Y;try{Y=nJ(V,"utf8").trim()}catch{return!1}if(!Y)return!1;let X=new AbortController,J=setTimeout(()=>X.abort(),q);try{return(await fetch(`http://127.0.0.1:${Q}/update/handoff`,{method:"POST",headers:{[Vz]:Y},signal:X.signal})).ok}catch{return!1}finally{clearTimeout(J)}}function Xz(){if(!qz(N8))return null;try{return nJ(N8,"utf8").trim()||null}catch{return null}}async function sJ($=[]){let Q=$.includes("--force"),q=$.includes("--silent"),V=(P)=>{if(q)console.log(`[petdex update] ${P}`);else A1(D.default.bgMagenta(D.default.white(` ${P} `)))},Y=(P)=>{if(q)console.log(P);else u.info(P)},X=(P)=>{if(q)console.warn(P);else u.warn(P)},J=(P)=>{if(q)console.log(P);else F1(P)},G=()=>{if(q)return{start:(L)=>console.log(L),stop:(L)=>console.log(L)};let P=H1();return{start:(L)=>P.start(L),stop:(L)=>P.stop(L)}};V("petdex update");let U=Xz();Y(U?`Installed: ${q?U:D.default.cyan(U)}`:"No installed version recorded - treating as fresh install.");let K=G();K.start("Checking GitHub for the latest release");let W;try{W=await fQ()}catch(P){throw K.stop(q?"failed":D.default.red("failed")),Error(`Could not reach GitHub. Check your connection.
|
|
284
|
-
${P.message}`)}if(K.stop(q?`Latest: ${W.tag_name}`:`${D.default.green("✓")} Latest: ${D.default.bold(W.tag_name)}`),!Q&&U&&U===W.tag_name){J(q?"Already up to date.":`${D.default.green("✓")} Already up to date.`);return}let Z=m1(),z=MJ(Z),H=c1().state==="running";if(z){if(H)Y(q?"Stopping running petdex-desktop":`${D.default.dim("•")} Stopping running petdex-desktop`),await X$();let P=G();P.start(`Downloading ${W.tag_name} DMG`);let L;try{L=await BJ(W,z)}catch(O){throw P.stop(q?"failed":D.default.red("failed")),O}P.stop(q?`Replaced ${z} (${M8(L.dmgAsset.size)})`:`${D.default.green("✓")} Replaced ${D.default.bold(z)} (${M8(L.dmgAsset.size)})`),await oJ(N8,`${W.tag_name}
|
|
285
|
-
`),await iJ(Y,X,q);let C=U?`${U} → ${W.tag_name}`:W.tag_name;J(q?`${C} (relaunch Petdex from /Applications to use it)`:`${D.default.green("✓")} ${C}
|
|
286
|
-
${D.default.dim(" Relaunch Petdex from /Applications to use it.")}`);return}let I=G();I.start(`Downloading ${W.tag_name}`);let N;try{N=await mQ(W)}catch(P){throw I.stop(q?"failed":D.default.red("failed")),P}if(I.stop(q?`Downloaded ${W.tag_name} (${M8(N.binAsset.size)})`:`${D.default.green("✓")} Downloaded ${D.default.bold(W.tag_name)} (${M8(N.binAsset.size)})`),H)Y(q?"Stopping running petdex-desktop":`${D.default.dim("•")} Stopping running petdex-desktop`),await X$();if(await cQ(N),await oJ(N8,`${W.tag_name}
|
|
287
|
-
`),H){Y(q?"Asking sidecar to release port":`${D.default.dim("•")} Asking sidecar to release port`);let P=await Yz();if(Y(q?P?"Sidecar acknowledged handoff":"Sidecar handoff unavailable, falling back to port wait":P?`${D.default.dim("•")} Sidecar acknowledged handoff`:`${D.default.dim("•")} Sidecar handoff unavailable, falling back to port wait`),!await L8(B8,{timeoutMs:1e4})){X(q?`Port ${B8} still in use after 10s. Run 'petdex desktop stop && petdex desktop start' to recover.`:`${D.default.yellow("!")} Port ${B8} still in use after 10s. Run \`petdex desktop stop && petdex desktop start\` to recover.`);return}Y(q?"Restarting petdex-desktop":`${D.default.dim("•")} Restarting petdex-desktop`);let C=await Y$();if(C.ok)Y(q?`Restarted (pid ${C.pid})`:`${D.default.green("✓")} Restarted (pid ${C.pid})`);else X(q?`Could not restart: ${C.reason}. Run 'petdex desktop start' manually.`:`${D.default.yellow("!")} Could not restart: ${C.reason}. Run \`petdex desktop start\` manually.`)}await iJ(Y,X,q);let w=U?`${U} → ${W.tag_name}`:W.tag_name;J(q?w:`${D.default.green("✓")} ${w}`)}async function iJ($,Q,q){try{let{runRefresh:V}=await Promise.resolve().then(() => (Qq(),$q)),Y=await V();if(Y.refreshed.length>0)$(q?`Refreshed hooks for: ${Y.refreshed.join(", ")}`:`Refreshed hooks for ${D.default.cyan(Y.refreshed.join(", "))}`)}catch(V){Q(`Hook refresh failed: ${V.message}`)}}function M8($){if($<1024)return`${$} B`;if($<1048576)return`${($/1024).toFixed(1)} KB`;return`${($/1024/1024).toFixed(1)} MB`}eQ();y0();$6();var e=C1(d1(),1);import{existsSync as J6}from"node:fs";import{readFile as eJ,rm as $Y,writeFile as QY}from"node:fs/promises";import Gz from"node:path";oQ();async function qY($={}){A1(e.default.bgMagenta(e.default.white(" petdex hooks uninstall ")));let q=(await Kz()).filter((X)=>X.installed);if(q.length===0)return F1(e.default.dim("No agent configs found. Nothing to uninstall.")),{uninstalledAgents:[]};let V=[],Y=[];for(let{agent:X}of q)try{let J=await Wz(X);if(J.removed){Y.push(X.id);let G=J.backupPath?` ${e.default.dim(`(backup: ${Gz.basename(J.backupPath)})`)}`:"";V.push(` ${e.default.green("✓")} ${e.default.bold(X.displayName)}${G}`)}else V.push(` ${e.default.dim("•")} ${e.default.bold(X.displayName)} ${e.default.dim("(no petdex entries found)")}`);await fJ(X)}catch(J){V.push(` ${e.default.red("✗")} ${e.default.bold(X.displayName)} ${e.default.red(J instanceof Error?J.message:String(J))}`)}if(T1(V.join(`
|
|
288
|
-
`),"Done"),$.removeToken)try{await $Y(Q6(),{force:!0}),u.info(`${e.default.green("✓")} Removed ${Q6()}`)}catch{}else if(J6(Q6()))u.info(e.default.dim(`Token file at ${Q6()} kept. Pass --remove-token to delete it.`));return F1(`${e.default.green("✓")} Done. Run ${e.default.cyan("petdex hooks install")} to wire petdex back in.`),{uninstalledAgents:Y}}async function Kz(){return Promise.all(e1.map(async($)=>({agent:$,installed:J6($.configDir)})))}async function Wz($){if($.id==="opencode"){if(!J6($.configFile))return{removed:!1,backupPath:null};let X=await tJ($.configFile);return await $Y($.configFile,{force:!0}),{removed:!0,backupPath:X}}if(!J6($.configFile))return{removed:!1,backupPath:null};let Q;try{Q=await eJ($.configFile,"utf8")}catch(X){throw Error(`Could not read ${$.configFile}: ${X.message}`)}let q;try{q=JSON.parse(Q)}catch(X){throw Error(`Refusing to overwrite ${$.configFile}: invalid JSON (${X.message}). Hand-edit the file to remove petdex entries.`)}let V=Uz(q);if(!V.changed)return{removed:!1,backupPath:null};let Y=await tJ($.configFile);return await QY($.configFile,`${JSON.stringify(V.value,null,2)}
|
|
289
|
-
`,"utf8"),{removed:!0,backupPath:Y}}function Uz($){let Q={...$},q=Q.hooks;if(!q||typeof q!=="object"||Array.isArray(q))return{value:Q,changed:!1};let V=!1,Y={};for(let[X,J]of Object.entries(q)){if(!Array.isArray(J)){Y[X]=J;continue}let G=J.filter((U)=>!jz(U));if(G.length!==J.length)V=!0;if(G.length>0)Y[X]=G}if(!V)return{value:Q,changed:!1};if(Object.keys(Y).length===0){let{hooks:X,...J}=Q;return{value:J,changed:!0}}return Q.hooks=Y,{value:Q,changed:!0}}function jz($){if(typeof $!=="object"||$==null)return!1;return Zz($).some((q)=>q.includes(`localhost:${e$}/state`)||q.includes(v0))}function Zz($){let Q=[];function q(V){if(typeof V==="string"){Q.push(V);return}if(Array.isArray(V)){for(let Y of V)q(Y);return}if(typeof V==="object"&&V!=null)for(let Y of Object.values(V))q(Y)}return q($),Q}async function tJ($){if(!J6($))return null;let Q=new Date().toISOString().replace(/[:.]/g,"-"),q=`${$}.${Q}.bak`,V=await eJ($);return await QY(q,V),q}import{spawn as zz}from"node:child_process";import{randomUUID as VY}from"node:crypto";import{existsSync as Hz,mkdirSync as Lz,readFileSync as Pz,writeFileSync as Oz}from"node:fs";import{homedir as Mz}from"node:os";import JY from"node:path";function I8(){let $=process.env.HOME??Mz();return JY.join($,".petdex","telemetry.json")}var Bz=process.env.PETDEX_TELEMETRY_URL??"https://petdex.crafter.run/api/telemetry/event",Nz=2000;function C8(){if(!Hz(I8()))return{kind:"missing"};let $;try{$=Pz(I8(),"utf8")}catch(Q){return{kind:"error",reason:`read failed: ${Q.message}`}}try{return{kind:"ok",config:JSON.parse($)}}catch(Q){return{kind:"error",reason:`parse failed: ${Q.message}`}}}function qq($){try{return Lz(JY.dirname(I8()),{recursive:!0}),Oz(I8(),`${JSON.stringify($,null,2)}
|
|
290
|
-
`),!0}catch{return!1}}function YY(){if(process.env.PETDEX_TELEMETRY==="0")return null;let $=C8();if($.kind==="ok")return $.config;if($.kind==="error")return null;let Q={install_id:VY(),enabled:!0,notice_seen:!1,first_seen:new Date().toISOString()};return qq(Q)?Q:null}function XY(){if(process.env.PETDEX_TELEMETRY==="0")return!1;let $=C8();if($.kind==="missing")return!0;if($.kind==="error")return!1;return $.config.enabled}function GY($){let Q=C8(),q;if(Q.kind==="ok")q=Q.config,q.enabled=$;else q={install_id:VY(),enabled:$,notice_seen:!0,first_seen:new Date().toISOString()};return qq(q)}function KY(){let $=C8();return{enabled:XY(),install_id:$.kind==="ok"?$.config.install_id:null}}function WY(){if(process.env.PETDEX_TELEMETRY==="0")return;let $=YY();if(!$)return;if($.notice_seen)return;console.log(["","petdex collects anonymous usage stats (install volume, OS, agents wired up).","No personal data, no file contents. Disable any time:"," petdex telemetry off","Details: https://petdex.crafter.run/legal/telemetry",""].join(`
|
|
291
|
-
`)),$.notice_seen=!0,qq($)}function Y6($,Q={}){if(!XY())return;let q=YY();if(!q)return;let V=JSON.stringify({install_id:q.install_id,event:$,...Q});try{let Y=`
|
|
279
|
+
${r.default.dim("•")} Sidecar at ${r.default.cyan(MV(L8()))} (${OV(Y.sidecarAsset.size)})`:`
|
|
280
|
+
${r.default.yellow("!")} No sidecar in this release. Hooks won't reach the mascot until a release ships ${NV}.`;J.stop(`${r.default.green("✓")} Binary at ${r.default.cyan(MV(X))} (${OV(Y.binAsset.size)})${G}`);let U=null;if(!await LZ()){let W=H1();if(W.start("Installing a starter pet so the desktop has something to show"),U=await PZ(),U)W.stop(`${r.default.green("✓")} Starter pet: ${r.default.bold(U)}`);else W.stop(`${r.default.yellow("!")} Could not download a starter pet. Run \`petdex install <slug>\` before \`petdex desktop start\`.`)}let K=["Run it with:",` ${r.default.cyan("petdex desktop start")}`,"","Or wire it into your coding agents:",` ${r.default.cyan("petdex hooks install")}`];return T1(K.join(`
|
|
281
|
+
`),"Next"),F1(`${r.default.green("✓")} ${q.tag_name}`),{tag:q.tag_name}}function OV($){if($<1024)return`${$} B`;if($<1048576)return`${($/1024).toFixed(1)} KB`;return`${($/1024/1024).toFixed(1)} MB`}function MV($){let Q=process.env.HOME;if(Q&&$.startsWith(Q))return`~${$.slice(Q.length)}`;return $}function $6(){return process.env.HOME??BZ()}function NZ(){return E0.join($6(),".petdex","runtime","update-token")}function IZ(){return E0.join($6(),".petdex","desktop.pid")}function CZ(){let $=c1();if(!p1($))return{status:"fail",label:"Desktop binary",detail:`not found at ${$}`,hint:"Run `petdex install desktop` to download it."};try{if(!(dQ($).mode&73))return{status:"fail",label:"Desktop binary",detail:`${$} exists but is not executable`,hint:`chmod +x ${$}`}}catch{return{status:"fail",label:"Desktop binary",detail:`${$} unreadable`,hint:"Reinstall: `petdex install desktop`"}}return{status:"ok",label:"Desktop binary",detail:$}}function wZ(){let $=L8();if(!p1($))return{status:"fail",label:"Sidecar bundle",detail:`not found at ${$}`,hint:"Reinstall: `petdex install desktop`"};return{status:"ok",label:"Sidecar bundle",detail:$}}async function TZ(){try{let $=await fetch("http://127.0.0.1:7777/health",{signal:AbortSignal.timeout(500)});if(!$.ok)return{status:"warn",label:"Sidecar reachable",detail:`:7777 responded ${$.status}`,hint:"Restart: `petdex desktop stop && petdex desktop start`"};let Q=await $.json().catch(()=>null);if(Q?.ok&&Q?.port===7777)return{status:"ok",label:"Sidecar reachable",detail:":7777 healthy"};return{status:"warn",label:"Sidecar reachable",detail:":7777 responded but body shape was unexpected"}}catch{return{status:"info",label:"Sidecar reachable",detail:"not running (this is fine if you haven't started the desktop)",hint:"Start with `petdex desktop start`"}}}function AZ(){let $=IZ();if(!p1($))return{status:"info",label:"PID file",detail:"not present (desktop not running)"};let Q;try{Q=P8($,"utf8").trim()}catch{return{status:"warn",label:"PID file",detail:`unreadable at ${$}`,hint:`Delete it: rm ${$}`}}if(!Q.startsWith("{"))return{status:"warn",label:"PID file",detail:"legacy bare-pid format detected",hint:"Run `petdex desktop start` to rewrite it in the new format."};try{let q=JSON.parse(Q);if(typeof q.pid!=="number"||typeof q.lstart!=="string")return{status:"warn",label:"PID file",detail:"unexpected JSON shape",hint:`Delete it: rm ${$}`};return{status:"ok",label:"PID file",detail:`pid ${q.pid}, started ${q.lstart}`}}catch{return{status:"warn",label:"PID file",detail:"JSON parse failed",hint:`Delete it: rm ${$}`}}}function FZ(){let $=NZ();if(!p1($))return{status:"info",label:"Update token",detail:"absent (will be created when sidecar starts)"};try{if(P8($,"utf8").trim().length<16)return{status:"warn",label:"Update token",detail:"present but suspiciously short",hint:"Stop the desktop and run `petdex desktop start` to regenerate."};let J=dQ($).mode&511;if(J!==384)return{status:"warn",label:"Update token",detail:`present, mode ${J.toString(8)} (expected 600)`,hint:`chmod 600 ${$}`};return{status:"ok",label:"Update token",detail:"present, mode 600"}}catch(Q){return{status:"warn",label:"Update token",detail:`read failed: ${Q.message}`}}}function RZ(){if(X$()==="off")return{status:"warn",label:"Killswitch",detail:"DISABLED. Agent hooks are short-circuited.",hint:"Re-enable with `petdex hooks on` or `/petdex on` from inside your agent."};return{status:"ok",label:"Killswitch",detail:"hooks enabled"}}function vZ(){let $=[];for(let Q of Q0){let q=p1(Q.configFile),J=p1(Q.slashCommandPath);if(!p1(Q.configDir)){$.push({status:"info",label:Q.displayName,detail:"not installed on this machine"});continue}let Y=!1;if(q)try{let X=P8(Q.configFile,"utf8");Y=X.includes("127.0.0.1:7777/state")||X.includes("/state")}catch{Y=!1}if(!Y){$.push({status:"warn",label:Q.displayName,detail:"petdex hook NOT detected",hint:"Run `petdex hooks install`"});continue}if(!J){$.push({status:"warn",label:Q.displayName,detail:"hook installed, but /petdex slash command missing",hint:"Re-run `petdex hooks install` to add the slash command."});continue}$.push({status:"ok",label:Q.displayName,detail:"hooks + /petdex installed"})}return $}function xZ(){let $=E0.join($6(),".codex","config.toml");if(!p1($))return{status:"info",label:"Codex codex_hooks flag",detail:"config.toml absent (Codex not installed?)"};try{let Q=P8($,"utf8");if(/\[features\][\s\S]*?codex_hooks\s*=\s*true/.test(Q))return{status:"ok",label:"Codex codex_hooks flag",detail:"[features] codex_hooks = true"};return{status:"warn",label:"Codex codex_hooks flag",detail:"missing or set to non-true",hint:"Re-run `petdex hooks install` and accept the auto-fix prompt."}}catch{return{status:"warn",label:"Codex codex_hooks flag",detail:"config.toml unreadable"}}}function SZ(){let $=[E0.join($6(),".petdex","pets"),E0.join($6(),".codex","pets")],Q=0;for(let q of $){if(!p1(q))continue;try{let{readdirSync:J}=b("node:fs"),Y=J(q);for(let X of Y){let V=E0.join(q,X);for(let G of["spritesheet.webp","spritesheet.png"]){let U=E0.join(V,G);if(!p1(U))continue;try{let K=dQ(U);if(K.size>0&&K.size<=16777216){Q+=1;break}}catch{}}}}catch{}}if(Q===0)return{status:"fail",label:"Installed pets",detail:"no usable pets in ~/.petdex/pets or ~/.codex/pets",hint:"Install one with `petdex install <slug>`"};return{status:"ok",label:"Installed pets",detail:`${Q} usable spritesheet(s) on disk`}}function EZ($){switch($){case"ok":return K1.default.green("✓");case"warn":return K1.default.yellow("!");case"fail":return K1.default.red("✗");case"info":return K1.default.dim("○")}}function B1($){let Q=$.detail?` ${K1.default.dim($.detail)}`:"";if(console.log(` ${EZ($.status)} ${K1.default.bold($.label)}${Q}`),$.hint)console.log(` ${K1.default.cyan("→")} ${$.hint}`)}async function FV(){console.log(K1.default.bgMagenta(K1.default.white(" petdex doctor "))),console.log(""),console.log(K1.default.bold("Install")),B1(CZ()),B1(wZ()),B1(SZ()),console.log(""),console.log(K1.default.bold("Runtime")),B1(await TZ()),B1(AZ()),B1(FZ()),B1(RZ()),console.log(""),console.log(K1.default.bold("Agents"));for(let Q of vZ())B1(Q);B1(xZ()),console.log(""),console.log(K1.default.bold("Network"));let $=null;try{$=MZ("lsof -nP -iTCP:7777 -sTCP:LISTEN 2>/dev/null || true",{encoding:"utf8"}).trim()}catch{$=null}if($===null)B1({status:"info",label:":7777 listener",detail:"lsof unavailable"});else if($.length===0)B1({status:"info",label:":7777 listener",detail:"nothing bound (sidecar offline)"});else{let Q=$.split(`
|
|
282
|
+
`).length-1;B1({status:Q===1?"ok":"warn",label:":7777 listener",detail:Q===1?"1 process bound":`${Q} processes bound`,hint:Q>1?"Multiple sidecars contending for the same port. Stop both and start fresh.":void 0})}console.log("")}var N1=C1(o1(),1);import{execFileSync as RV,spawn as vV}from"node:child_process";import{existsSync as xV,readFileSync as yZ,unlinkSync as kZ}from"node:fs";import{mkdir as gZ,writeFile as SV}from"node:fs/promises";import{homedir as EV}from"node:os";import P0 from"node:path";function J6(){let $=process.env.HOME??EV();return P0.join($,".petdex","desktop.pid")}function q6(){let $=process.env.HOME??EV();return P0.join($,".petdex","desktop.log")}function yV(){if(!xV(J6()))return null;let $;try{$=yZ(J6(),"utf8").trim()}catch{return null}if($.startsWith("{")){try{let q=JSON.parse($);if(typeof q.pid==="number"&&Number.isFinite(q.pid)&&q.pid>0&&typeof q.lstart==="string"&&q.lstart.length>0)return{pid:q.pid,lstart:q.lstart}}catch{}return null}let Q=Number($);if(Number.isFinite(Q)&&Q>0)return{pid:Q,lstart:""};return null}function lQ($){try{let q=RV("ps",["-p",String($),"-o","lstart="],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();return q.length>0?q:null}catch{return null}}function kV($){if($.lstart.length===0)return!1;let Q=lQ($.pid);return Q!==null&&Q===$.lstart}function Q6(){try{kZ(J6())}catch{}}function u1(){let $=yV();if($==null)return{state:"stopped"};if(kV($))return{state:"running",pid:$.pid};return{state:"stale",pid:$.pid}}async function W$(){let $=u1();if($.state==="running")return{ok:!0,pid:$.pid,alreadyRunning:!0};if($.state==="stale")Q6();let Q=c1();if(!xV(Q))return{ok:!1,reason:`petdex-desktop binary not found at ${Q}. Run \`petdex install desktop\` first.`};await gZ(P0.dirname(q6()),{recursive:!0});let q=await import("node:fs").then((U)=>U.openSync(q6(),"a")),J=await import("node:fs").then((U)=>U.openSync(q6(),"a")),Y=DZ(Q);if(Y)return hZ(Y);let X=vV(Q,[],{detached:!0,stdio:["ignore",q,J]});if(X.unref(),!X.pid)return{ok:!1,reason:"Failed to spawn petdex-desktop"};let V=lQ(X.pid)??"",G={pid:X.pid,lstart:V};return await SV(J6(),JSON.stringify(G)),{ok:!0,pid:X.pid,alreadyRunning:!1}}function DZ($){let Q=P0.dirname($);if(P0.basename(Q)!=="MacOS")return null;let q=P0.dirname(Q);if(P0.basename(q)!=="Contents")return null;let J=P0.dirname(q);if(!J.endsWith(".app"))return null;return J}async function hZ($){vV("open",["-gj",$],{stdio:"ignore",detached:!0}).unref();let q=Date.now()+3000,J=null;while(Date.now()<q){if(J=_Z(),J)break;await new Promise((V)=>setTimeout(V,100))}if(!J)return{ok:!1,reason:`Launched ${$} but couldn't find the resulting process. Check ${q6()}.`};let Y=lQ(J)??"",X={pid:J,lstart:Y};return await SV(J6(),JSON.stringify(X)),{ok:!0,pid:J,alreadyRunning:!1}}function _Z(){try{let $=RV("pgrep",["-f","petdex-desktop"],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();if(!$)return null;let Q=$.split(`
|
|
283
|
+
`).filter((J)=>J.length>0),q=Number(Q[Q.length-1]);return Number.isFinite(q)&&q>0?q:null}catch{return null}}var gV=7777;async function U$($={}){let Q=$.sidecarPort??gV,q=$.portWaitTimeoutMs??5000,J=u1();if(J.state==="stopped")return{ok:!1,reason:"petdex-desktop is not running"};if(J.state==="stale")return Q6(),{ok:!1,reason:`petdex-desktop is not running (stale pid ${J.pid} cleared)`};let Y=J.pid,X=yV();if(X===null||!kV(X))return Q6(),{ok:!1,reason:`petdex-desktop exited before stop (pid ${Y} no longer alive)`};try{process.kill(Y,"SIGTERM")}catch(G){if(Q6(),G.code==="ESRCH"){let K=await O8(Q,{timeoutMs:q});return{ok:!0,pid:Y,portReleased:K}}return{ok:!1,reason:`Failed to signal pid ${Y}: ${G.message}`}}Q6();let V=await O8(Q,{timeoutMs:q});return{ok:!0,pid:Y,portReleased:V}}async function DV(){let $=await W$();if(!$.ok)console.error(`${N1.default.red("✗")} ${$.reason}`),process.exit(1);if($.alreadyRunning)console.log(`${N1.default.dim("•")} petdex-desktop already running (pid ${$.pid})`);else console.log(`${N1.default.green("✓")} petdex-desktop started (pid ${$.pid})`),console.log(N1.default.dim(` log: ${q6()}`))}async function hV(){let $=await U$();if(!$.ok)console.error(`${N1.default.dim("•")} ${$.reason}`),process.exit($.reason.includes("not running")?0:1);if($.portReleased)console.log(`${N1.default.green("✓")} stopped pid ${$.pid}`);else console.log(`${N1.default.yellow("!")} stopped pid ${$.pid}, but :${gV} still busy`),console.log(N1.default.dim(" if 'petdex desktop start' fails with EADDRINUSE, wait a moment and retry"))}async function O8($,Q={}){let q=Q.timeoutMs??1e4,J=Q.intervalMs??100,Y=Q.host??"127.0.0.1",{createConnection:X}=await import("node:net"),V=Date.now()+q;while(Date.now()<V){if(await new Promise((U)=>{let K=X({host:Y,port:$}),W=(z)=>{K.removeAllListeners(),K.destroy(),U(z)};K.once("connect",()=>W(!1)),K.once("error",(z)=>{W(z.code==="ECONNREFUSED")}),K.setTimeout(J,()=>W(!1))}))return!0;await new Promise((U)=>setTimeout(U,J))}return!1}function _V(){let $=u1();switch($.state){case"running":console.log(`${N1.default.green("●")} running (pid ${$.pid})`);break;case"stopped":console.log(`${N1.default.dim("○")} stopped`);break;case"stale":console.log(`${N1.default.yellow("?")} pid ${$.pid} written but not alive (run \`petdex desktop start\` to restart)`);break}}g0();var D=C1(o1(),1);import{existsSync as Uz,readFileSync as QY}from"node:fs";import{writeFile as eV}from"node:fs/promises";import{homedir as qY}from"node:os";import JY from"node:path";import{spawn as bZ}from"node:child_process";import{randomUUID as bV}from"node:crypto";import{existsSync as fZ,mkdirSync as mZ,readFileSync as cZ,writeFileSync as pZ}from"node:fs";import{homedir as uZ}from"node:os";import fV from"node:path";function M8(){let $=process.env.HOME??uZ();return fV.join($,".petdex","telemetry.json")}var dZ=process.env.PETDEX_TELEMETRY_URL??"https://petdex.crafter.run/api/telemetry/event",lZ=2000;function B8(){if(!fZ(M8()))return{kind:"missing"};let $;try{$=cZ(M8(),"utf8")}catch(Q){return{kind:"error",reason:`read failed: ${Q.message}`}}try{return{kind:"ok",config:JSON.parse($)}}catch(Q){return{kind:"error",reason:`parse failed: ${Q.message}`}}}function oQ($){try{return mZ(fV.dirname(M8()),{recursive:!0}),pZ(M8(),`${JSON.stringify($,null,2)}
|
|
284
|
+
`),!0}catch{return!1}}function mV(){if(process.env.PETDEX_TELEMETRY==="0")return null;let $=B8();if($.kind==="ok")return $.config;if($.kind==="error")return null;let Q={install_id:bV(),enabled:!0,notice_seen:!1,first_seen:new Date().toISOString()};return oQ(Q)?Q:null}function cV(){if(process.env.PETDEX_TELEMETRY==="0")return!1;let $=B8();if($.kind==="missing")return!0;if($.kind==="error")return!1;return $.config.enabled}function pV($){let Q=B8(),q;if(Q.kind==="ok")q=Q.config,q.enabled=$;else q={install_id:bV(),enabled:$,notice_seen:!0,first_seen:new Date().toISOString()};return oQ(q)}function uV(){let $=B8();return{enabled:cV(),install_id:$.kind==="ok"?$.config.install_id:null}}function dV(){if(process.env.PETDEX_TELEMETRY==="0")return;let $=mV();if(!$)return;if($.notice_seen)return;console.log(["","petdex collects anonymous usage stats (install volume, OS, agents wired up).","No personal data, no file contents. Disable any time:"," petdex telemetry off","Details: https://petdex.crafter.run/legal/telemetry",""].join(`
|
|
285
|
+
`)),$.notice_seen=!0,oQ($)}function S1($,Q={}){if(!cV())return;let q=mV();if(!q)return;let J=JSON.stringify({install_id:q.install_id,event:$,...Q});try{let Y=`
|
|
292
286
|
const controller = new AbortController();
|
|
293
|
-
const t = setTimeout(() => controller.abort(), ${
|
|
294
|
-
fetch(${JSON.stringify(
|
|
287
|
+
const t = setTimeout(() => controller.abort(), ${lZ});
|
|
288
|
+
fetch(${JSON.stringify(dZ)}, {
|
|
295
289
|
method: "POST",
|
|
296
290
|
headers: { "content-type": "application/json" },
|
|
297
|
-
body: ${JSON.stringify(
|
|
291
|
+
body: ${JSON.stringify(J)},
|
|
298
292
|
signal: controller.signal,
|
|
299
293
|
}).catch(() => {}).finally(() => clearTimeout(t));
|
|
300
|
-
`;
|
|
301
|
-
`)
|
|
302
|
-
`),
|
|
303
|
-
|
|
294
|
+
`;bZ(process.execPath,["-e",Y],{detached:!0,stdio:"ignore"}).unref()}catch{}}var I8=7777,jz="x-petdex-update-token",Zz=JY.join(qY(),".petdex","runtime","update-token"),C8=JY.join(qY(),".petdex","version");async function zz($={}){let Q=$.port??I8,q=$.timeoutMs??2000,J=$.tokenPath??Zz,Y;try{Y=QY(J,"utf8").trim()}catch{return!1}if(!Y)return!1;let X=new AbortController,V=setTimeout(()=>X.abort(),q);try{return(await fetch(`http://127.0.0.1:${Q}/update/handoff`,{method:"POST",headers:{[jz]:Y},signal:X.signal})).ok}catch{return!1}finally{clearTimeout(V)}}function Hz(){if(!Uz(C8))return null;try{return QY(C8,"utf8").trim()||null}catch{return null}}async function VY($=[],Q){let q=Date.now(),J=$.includes("--force"),Y=$.includes("--silent"),X=(B)=>{if(Y)console.log(`[petdex update] ${B}`);else A1(D.default.bgMagenta(D.default.white(` ${B} `)))},V=(B)=>{if(Y)console.log(B);else u.info(B)},G=(B)=>{if(Y)console.warn(B);else u.warn(B)},U=(B)=>{if(Y)console.log(B);else F1(B)},K=()=>{if(Y)return{start:(L)=>console.log(L),stop:(L)=>console.log(L)};let B=H1();return{start:(L)=>B.start(L),stop:(L)=>B.stop(L)}};X("petdex update");let W=Hz();V(W?`Installed: ${Y?W:D.default.cyan(W)}`:"No installed version recorded - treating as fresh install.");let z=K();z.start("Checking GitHub for the latest release");let Z;try{Z=await mQ()}catch(B){throw z.stop(Y?"failed":D.default.red("failed")),Error(`Could not reach GitHub. Check your connection.
|
|
295
|
+
${B.message}`)}if(z.stop(Y?`Latest: ${Z.tag_name}`:`${D.default.green("✓")} Latest: ${D.default.bold(Z.tag_name)}`),!J&&W&&W===Z.tag_name){U(Y?"Already up to date.":`${D.default.green("✓")} Already up to date.`);return}let H=c1(),C=IV(H),I=u1().state==="running";if(C){if(I)V(Y?"Stopping running petdex-desktop":`${D.default.dim("•")} Stopping running petdex-desktop`),await U$();let B=K();B.start(`Downloading ${Z.tag_name} DMG`);let L;try{L=await CV(Z,C)}catch(A){throw B.stop(Y?"failed":D.default.red("failed")),A}B.stop(Y?`Replaced ${C} (${N8(L.dmgAsset.size)})`:`${D.default.green("✓")} Replaced ${D.default.bold(C)} (${N8(L.dmgAsset.size)})`),await eV(C8,`${Z.tag_name}
|
|
296
|
+
`),S1("cli_update_applied",{cli_version:Q,from_version:W??void 0,to_version:Z.tag_name,duration_ms:Date.now()-q}),await $Y(V,G,Y);let P=W?`${W} -> ${Z.tag_name}`:Z.tag_name;U(Y?`${P} (relaunch Petdex from /Applications to use it)`:`${D.default.green("✓")} ${P}
|
|
297
|
+
${D.default.dim(" Relaunch Petdex from /Applications to use it.")}`);return}let w=K();w.start(`Downloading ${Z.tag_name}`);let N;try{N=await cQ(Z)}catch(B){throw w.stop(Y?"failed":D.default.red("failed")),B}if(w.stop(Y?`Downloaded ${Z.tag_name} (${N8(N.binAsset.size)})`:`${D.default.green("✓")} Downloaded ${D.default.bold(Z.tag_name)} (${N8(N.binAsset.size)})`),I)V(Y?"Stopping running petdex-desktop":`${D.default.dim("•")} Stopping running petdex-desktop`),await U$();if(await pQ(N),await eV(C8,`${Z.tag_name}
|
|
298
|
+
`),I){V(Y?"Asking sidecar to release port":`${D.default.dim("•")} Asking sidecar to release port`);let B=await zz();if(V(Y?B?"Sidecar acknowledged handoff":"Sidecar handoff unavailable, falling back to port wait":B?`${D.default.dim("•")} Sidecar acknowledged handoff`:`${D.default.dim("•")} Sidecar handoff unavailable, falling back to port wait`),!await O8(I8,{timeoutMs:1e4})){G(Y?`Port ${I8} still in use after 10s. Run 'petdex desktop stop && petdex desktop start' to recover.`:`${D.default.yellow("!")} Port ${I8} still in use after 10s. Run \`petdex desktop stop && petdex desktop start\` to recover.`);return}V(Y?"Restarting petdex-desktop":`${D.default.dim("•")} Restarting petdex-desktop`);let P=await W$();if(P.ok)V(Y?`Restarted (pid ${P.pid})`:`${D.default.green("✓")} Restarted (pid ${P.pid})`);else G(Y?`Could not restart: ${P.reason}. Run 'petdex desktop start' manually.`:`${D.default.yellow("!")} Could not restart: ${P.reason}. Run \`petdex desktop start\` manually.`)}S1("cli_update_applied",{cli_version:Q,from_version:W??void 0,to_version:Z.tag_name,duration_ms:Date.now()-q}),await $Y(V,G,Y);let O=W?`${W} -> ${Z.tag_name}`:Z.tag_name;U(Y?O:`${D.default.green("✓")} ${O}`)}async function $Y($,Q,q){try{let{runRefresh:J}=await Promise.resolve().then(() => (qq(),Qq)),Y=await J();if(Y.refreshed.length>0)$(q?`Refreshed hooks for: ${Y.refreshed.join(", ")}`:`Refreshed hooks for ${D.default.cyan(Y.refreshed.join(", "))}`)}catch(J){Q(`Hook refresh failed: ${J.message}`)}}function N8($){if($<1024)return`${$} B`;if($<1048576)return`${($/1024).toFixed(1)} KB`;return`${($/1024/1024).toFixed(1)} MB`}$q();g0();r$();var e=C1(o1(),1);import{existsSync as Y6}from"node:fs";import{readFile as XY,rm as GY,writeFile as KY}from"node:fs/promises";import Lz from"node:path";iQ();async function WY($={}){A1(e.default.bgMagenta(e.default.white(" petdex hooks uninstall ")));let q=(await Pz()).filter((X)=>X.installed);if(q.length===0)return F1(e.default.dim("No agent configs found. Nothing to uninstall.")),{uninstalledAgents:[]};let J=[],Y=[];for(let{agent:X}of q)try{let V=await Oz(X);if(V.removed){Y.push(X.id);let G=V.backupPath?` ${e.default.dim(`(backup: ${Lz.basename(V.backupPath)})`)}`:"";J.push(` ${e.default.green("✓")} ${e.default.bold(X.displayName)}${G}`)}else J.push(` ${e.default.dim("•")} ${e.default.bold(X.displayName)} ${e.default.dim("(no petdex entries found)")}`);await oV(X)}catch(V){J.push(` ${e.default.red("✗")} ${e.default.bold(X.displayName)} ${e.default.red(V instanceof Error?V.message:String(V))}`)}if(T1(J.join(`
|
|
299
|
+
`),"Done"),$.removeToken)try{await GY(a$(),{force:!0}),u.info(`${e.default.green("✓")} Removed ${a$()}`)}catch{}else if(Y6(a$()))u.info(e.default.dim(`Token file at ${a$()} kept. Pass --remove-token to delete it.`));return F1(`${e.default.green("✓")} Done. Run ${e.default.cyan("petdex hooks install")} to wire petdex back in.`),{uninstalledAgents:Y}}async function Pz(){return Promise.all(Q0.map(async($)=>({agent:$,installed:Y6($.configDir)})))}async function Oz($){if($.id==="opencode"){if(!Y6($.configFile))return{removed:!1,backupPath:null};let X=await YY($.configFile);return await GY($.configFile,{force:!0}),{removed:!0,backupPath:X}}if(!Y6($.configFile))return{removed:!1,backupPath:null};let Q;try{Q=await XY($.configFile,"utf8")}catch(X){throw Error(`Could not read ${$.configFile}: ${X.message}`)}let q;try{q=JSON.parse(Q)}catch(X){throw Error(`Refusing to overwrite ${$.configFile}: invalid JSON (${X.message}). Hand-edit the file to remove petdex entries.`)}let J=Mz(q);if(!J.changed)return{removed:!1,backupPath:null};let Y=await YY($.configFile);return await KY($.configFile,`${JSON.stringify(J.value,null,2)}
|
|
300
|
+
`,"utf8"),{removed:!0,backupPath:Y}}function Mz($){let Q={...$},q=Q.hooks;if(!q||typeof q!=="object"||Array.isArray(q))return{value:Q,changed:!1};let J=!1,Y={};for(let[X,V]of Object.entries(q)){if(!Array.isArray(V)){Y[X]=V;continue}let G=V.filter((U)=>!Bz(U));if(G.length!==V.length)J=!0;if(G.length>0)Y[X]=G}if(!J)return{value:Q,changed:!1};if(Object.keys(Y).length===0){let{hooks:X,...V}=Q;return{value:V,changed:!0}}return Q.hooks=Y,{value:Q,changed:!0}}function Bz($){if(typeof $!=="object"||$==null)return!1;return Nz($).some((q)=>q.includes(`localhost:${n$}/state`)||q.includes(S0))}function Nz($){let Q=[];function q(J){if(typeof J==="string"){Q.push(J);return}if(Array.isArray(J)){for(let Y of J)q(Y);return}if(typeof J==="object"&&J!=null)for(let Y of Object.values(J))q(Y)}return q($),Q}async function YY($){if(!Y6($))return null;let Q=new Date().toISOString().replace(/[:.]/g,"-"),q=`${$}.${Q}.bak`,J=await XY($);return await KY(q,J),q}var I1=process.env.PETDEX_URL??"https://petdex.crafter.run",Dz="https://clerk.petdex.crafter.run",hz="LcThwEayl6KAA1Qm",Vq=["profile","email","openid","offline_access"];async function _z(){let $=process.env.CLERK_ISSUER,Q=process.env.CLERK_OAUTH_CLIENT_ID;if($&&Q)return{issuer:$,clientId:Q,scopes:Vq};try{let q=await fetch(`${I1}/api/cli/auth-config`,{signal:AbortSignal.timeout(3000)});if(q.ok){let J=await q.json(),Y=typeof J.issuer==="string"?J.issuer:null,X=typeof J.clientId==="string"?J.clientId:null,V=Array.isArray(J.scopes)?J.scopes.filter((G)=>typeof G==="string"):null;if(Y&&X)return{issuer:$??Y,clientId:Q??X,scopes:V&&V.length>0?V:Vq}}}catch{}return{issuer:$??Dz,clientId:Q??hz,scopes:Vq}}var T8=null;async function R8(){if(T8)return T8;let $=await _z();return T8=new j8({clientId:$.clientId,issuer:$.issuer,scopes:$.scopes,storage:"keychain",keychainService:"petdex-cli"}),T8}var l1="0.4.0";bz().catch(($)=>{Y1(`petdex: ${$.message}`),process.exit(1)});async function bz(){let $=process.argv.slice(2),Q=$[0];if(Q==="bubble"){let{runBubble:J}=await Promise.resolve().then(() => (NY(),BY));await J($.slice(1));return}if(!Q||Q==="--help"||Q==="-h"||Q==="help"){wY();return}if(!new Set(["version","--version","-v","telemetry"]).has(Q))dV();switch(Q){case"login":await fz();break;case"logout":await mz();break;case"whoami":await cz();break;case"submit":await oz($.slice(1));break;case"install":await dz($.slice(1));break;case"list":await lz();break;case"hooks":await JH($.slice(1));break;case"desktop":await KH($.slice(1));break;case"init":await YH();break;case"up":await EY();break;case"down":await yY();break;case"toggle":await GH();break;case"update":await VY($.slice(1),l1);break;case"doctor":await FV();break;case"telemetry":WH($.slice(1));break;case"version":case"--version":case"-v":console.log(l1);break;default:console.error(j.default.red(`Unknown command: ${Q}`)),wY(),process.exit(1)}}function wY(){let $=j.default.cyan,Q=j.default.dim;console.log(["",` ${j.default.bold(j.default.magenta("petdex"))} ${Q(l1)} ${Q("Codex pet gallery CLI")}`,"",` ${$("Usage")}`," petdex <command> [args]","",` ${$("Commands")}`,` ${j.default.bold("init")} First-run setup: wires hooks across your agents AND wakes the mascot ${j.default.green("(start here)")}`,` ${j.default.bold("login")} Sign in with Clerk OAuth`,` ${j.default.bold("logout")} Clear stored credentials`,` ${j.default.bold("whoami")} Show signed-in user`,` ${j.default.bold("submit")} <path> Submit a pet folder, zip, or parent of pets (bulk)`,` ${j.default.bold("install")} <slug...> Install one or more pets into ~/.petdex/pets and ~/.codex/pets`,` ${j.default.bold("install desktop")} Install the petdex-desktop binary (alternative to the .dmg)`,` ${j.default.bold("list")} List approved pets`,` ${j.default.bold("hooks install")} Wire petdex-desktop into your coding agents`,` ${j.default.bold("toggle")} One-shot wake/sleep. Flips the mascot on or off depending on current state`,` ${j.default.bold("up")} Force-wake the mascot. Enables hooks AND launches petdex-desktop`,` ${j.default.bold("down")} Force-sleep the mascot. Disables hooks AND stops petdex-desktop`,` ${j.default.bold("desktop")} <cmd> Manage petdex-desktop (start | stop | status)`,` ${j.default.bold("update")} Pull the latest petdex-desktop release and restart`,` ${j.default.bold("doctor")} Diagnose install/runtime/agents and surface fixes`,` ${j.default.bold("telemetry")} [on|off|status] Manage anonymous usage telemetry`,"",` ${$("Examples")}`,` ${Q("$")} petdex init ${Q("# after dragging Petdex.app from the .dmg → just run this")}`,` ${Q("$")} petdex login`,` ${Q("$")} petdex submit ~/.codex/pets/boba ${Q("# single folder")}`,` ${Q("$")} petdex install boba ${Q("# install a pet by slug")}`,` ${Q("$")} petdex install boba doraemon mochi ${Q("# install several at once")}`,` ${Q("$")} petdex toggle ${Q("# wake or sleep the mascot")}`,` ${Q("$")} petdex doctor ${Q("# diagnose install + agents")}`,` ${Q("$")} petdex update ${Q("# pull the latest release")}`,"",` ${Q("Gallery & docs:")} ${j.default.underline(I1)}`,""].join(`
|
|
301
|
+
`))}async function fz(){A1(j.default.bgMagenta(j.default.white(" petdex login ")));let $=H1();$.start("Opening your browser to sign in with Clerk");try{let Q=await R8(),{user:q}=await Q.login(),J=xY(q.email,q.username,q.sub)??"unknown";$.stop(`${j.default.green("✓ ")}Signed in as ${j.default.cyan(J)}`),F1(`Try ${j.default.cyan("petdex submit ~/.codex/pets")} to share your pets.`)}catch(Q){throw $.stop(j.default.red("× login failed")),Error(ez(Q.message))}}async function mz(){await(await R8()).logout(),console.log(`${j.default.green("✓ ")}Signed out`)}async function cz(){try{let Q=await(await R8()).whoami();if(!Q)throw Error("not signed in");let q=[F8(Q.given_name),F8(Q.family_name)].filter(Boolean).join(" ");T1([`${j.default.dim("user: ")}${Q.sub}`,`${j.default.dim("email: ")}${Q.email??"—"}`,`${j.default.dim("name: ")}${q||"—"}`,`${j.default.dim("username:")}${F8(Q.preferred_username)??"—"}`].join(`
|
|
302
|
+
`),"Signed in")}catch{Y1(`Not signed in. Run ${j.default.cyan("petdex login")}.`),process.exit(1)}}async function pz(){let $=await fetch(`${I1}/api/manifest`);if(!$.ok)throw Error(`manifest fetch ${$.status}`);return(await $.json()).pets}async function uz($){let Q=$.slug;if(!e$($.spritesheetUrl)||!e$($.petJsonUrl))throw Error(`untrusted asset host for ${Q} (admin needs to re-upload)`);let q=V1.join(CY(),".petdex","pets",Q),J=V1.join(CY(),".codex","pets",Q);await Promise.all([IY(q,{recursive:!0}),IY(J,{recursive:!0})]);let Y=$.spritesheetUrl.endsWith(".png")?"png":"webp",X=async(U)=>{let K=await fetch(U);if(!K.ok)throw Error(`download ${U} -> ${K.status} ${K.statusText}`);return K.arrayBuffer()},[V,G]=await Promise.all([X($.petJsonUrl),X($.spritesheetUrl)]);await Promise.all([w8(V1.join(q,"pet.json"),Buffer.from(V)),w8(V1.join(q,`spritesheet.${Y}`),Buffer.from(G)),w8(V1.join(J,"pet.json"),Buffer.from(V)),w8(V1.join(J,`spritesheet.${Y}`),Buffer.from(G))]),fetch(`${I1}/install/${Q}`,{method:"GET"}).catch(()=>{})}async function dz($){let Q=$[0];if(!Q)Y1(`Usage: ${j.default.cyan("petdex install <slug> [slug...]")} or ${j.default.cyan("petdex install desktop")}`),process.exit(1);if(Q==="desktop"){let{tag:W}=await uQ();S1("cli_install_desktop_success",{cli_version:l1,os:process.platform,arch:process.arch,binary_version:W.replace(/^desktop-v/,"")});return}let q=Array.from(new Set($)),J=H1();J.start(q.length===1?`Resolving ${q[0]}`:`Resolving ${q.length} pets`);let Y;try{Y=await pz()}catch(W){throw J.stop(j.default.red("manifest failed")),W}let X=[],V=[];for(let W of q){let z=Y.find((Z)=>Z.slug===W);if(z)X.push(z);else V.push(W)}if(X.length===0)J.stop(j.default.red("none found")),Y1(`No pets matched. Try ${j.default.cyan("petdex list")} to see what's available.`),process.exit(1);let G=[],U=[];for(let W=0;W<X.length;W++){let z=X[W];J.message(X.length===1?`Downloading ${z.slug}`:`Downloading ${z.slug} (${W+1}/${X.length})`);try{await uz(z),G.push(z.displayName)}catch(Z){U.push({slug:z.slug,reason:Z instanceof Error?Z.message:String(Z)})}}if(G.length===X.length)J.stop(G.length===1?`Installed ${j.default.cyan(G[0])}`:`Installed ${j.default.cyan(G.length)} pets`);else if(G.length>0)J.stop(`Installed ${j.default.cyan(G.length)} of ${X.length} (${j.default.red(`${U.length} failed`)})`);else J.stop(j.default.red("all failed"));let K=[];if(G.length>0)K.push("Paths:"),K.push(` ${j.default.dim("~/.petdex/pets/")} (Petdex Desktop)`),K.push(` ${j.default.dim("~/.codex/pets/")} (Codex Desktop)`),K.push(""),K.push("Activate in Petdex Desktop: right-click the mascot."),K.push("Activate in Codex Desktop:"),K.push(` ${j.default.cyan("Settings -> Appearance -> Pets")}`);if(V.length>0){if(K.length>0)K.push("");K.push(j.default.yellow("Skipped (slug not found):"));for(let W of V)K.push(` ${W}`)}if(U.length>0){if(K.length>0)K.push("");K.push(j.default.red("Failed:"));for(let W of U)K.push(` ${W.slug}: ${W.reason}`)}if(K.length>0)T1(K.join(`
|
|
303
|
+
`),"Next steps");if(U.length>0&&G.length===0)process.exit(1)}async function lz(){let $=H1();$.start("Fetching gallery");let Q=await fetch(`${I1}/api/manifest`);if(!Q.ok)throw $.stop(j.default.red("failed")),Error(`failed to fetch manifest: ${Q.status}`);let q=await Q.json();$.stop(`${q.total} pets`);let J=q.pets.map((Y)=>{let X=Y.submittedBy?j.default.dim(` by ${Y.submittedBy}`):"";return` ${j.default.cyan(Y.slug.padEnd(26))} ${Y.displayName}${X}`});console.log(J.join(`
|
|
304
304
|
`)),console.log(`
|
|
305
305
|
${j.default.dim("Install with")} ${j.default.cyan("petdex install <slug>")}
|
|
306
|
-
${j.default.dim("Browse:")} ${j.default.underline(I1)}`)}async function oz($){let q=$.filter((
|
|
307
|
-
`),`${
|
|
308
|
-
`),"Failures");let
|
|
309
|
-
`)),
|
|
306
|
+
${j.default.dim("Browse:")} ${j.default.underline(I1)}`)}async function oz($){let q=$.filter((O)=>!O.startsWith("--"))[0];if(!q)Y1(`Usage: ${j.default.cyan("petdex submit <path> [--force]")}`),process.exit(1);let J=await R8(),Y;try{let O=await J.getAccessToken();if(!O)Y1(`Not signed in. Run ${j.default.cyan("petdex login")}.`),process.exit(1);Y=O}catch{Y1(`Not signed in. Run ${j.default.cyan("petdex login")}.`),process.exit(1)}let X=I1;try{X=QH(await J.whoami())}catch{}let V=V1.resolve(q),G=await vY(V).catch(()=>null);if(!G)Y1(`No such file or directory: ${q}`),process.exit(1);A1(j.default.bgMagenta(j.default.white(" petdex submit ")));let U=H1();U.start(`Scanning ${V}`);let K=await iz(V,G.isDirectory());if(U.stop(K.length>0?`${K.length} pet${K.length===1?"":"s"} found`:j.default.red("no pets found")),K.length===0)Y1("A pet folder must contain pet.json and spritesheet.{webp,png}."),process.exit(1);let z=$.includes("--force")?new Map:await tz(K,Y),Z=K,H=0;if(z.size>0){let O=K.filter((P)=>z.has(X6(P.petIdHint))),B=K.filter((P)=>!z.has(X6(P.petIdHint)));T1(O.map((P)=>{let R=z.get(X6(P.petIdHint))?.status??"unknown";return`${j.default.yellow("•")} ${j.default.bold(P.label)} ${j.default.dim(`(${R})`)}`}).join(`
|
|
307
|
+
`),`${O.length} already submitted by you`);let L=await Dq({message:"How should we handle these duplicates?",options:[{value:"skip",label:"Skip duplicates (recommended)"},{value:"resubmit",label:"Submit all anyway (will create -2 / -3 slugs)"},{value:"cancel",label:"Cancel"}],initialValue:"skip"});if(V0(L)||L==="cancel")Y1("Aborted."),process.exit(1);if(L==="skip"){if(Z=B,H=O.length,Z.length===0){F1(`Nothing new to submit. Track approval at ${j.default.underline(X)}.`);return}}}if(Z.length>1){let O=await M6({message:`Submit ${j.default.bold(String(Z.length))} pet${Z.length===1?"":"s"}?`});if(V0(O)||!O)Y1("Aborted."),process.exit(1)}let C=0,I=0,w=[];for(let O of Z){let B=H1();B.start(`Submitting ${j.default.cyan(O.label)}`);try{let L=await J.getAccessToken();if(!L)throw Error("session expired");Y=L;let P=await rz(O,Y);X=$H(P.profileUrl)??X,B.stop(`${j.default.green("✓")} ${j.default.cyan(O.label)} → ${az(P)}`),C++}catch(L){let P=L.message;B.stop(`${j.default.red("×")} ${j.default.cyan(O.label)} ${j.default.red(P.slice(0,60))}`),w.push({label:O.label,error:P}),I++}}if(w.length>0)T1(w.map((O)=>`${j.default.red("•")} ${j.default.bold(O.label)}: ${O.error}`).join(`
|
|
308
|
+
`),"Failures");let N=H>0?`, ${j.default.yellow(String(H))} skipped`:"";if(F1([`${j.default.green(String(C))} submitted${N}, ${I>0?j.default.red(String(I)):j.default.dim(String(I))} failed.`,`Held submissions stay visible at ${j.default.underline(X)}.`].join(`
|
|
309
|
+
`)),I>0)process.exit(1)}async function iz($,Q){if(!Q){if(!$.endsWith(".zip"))throw Error(`Expected a .zip file or a folder, got: ${$}`);let X=await nz($);return X?[X]:[]}if(await A8(V1.join($,"pet.json"))){let X=await TY($);return X?[X]:[]}let J=await gz($,{withFileTypes:!0}),Y=[];for(let X of J){if(!X.isDirectory())continue;let V=V1.join($,X.name),G=await TY(V);if(G)Y.push(G)}return Y}async function TY($){let Q=V1.join($,"pet.json");if(!await A8(Q))return null;let q=V1.join($,"spritesheet.webp"),J="webp";if(!await A8(q)){let W=V1.join($,"spritesheet.png");if(!await A8(W))return null;q=W,J="png"}let Y=await Xq(Q,"utf8"),X={};try{X=JSON.parse(Y)}catch{throw Error(`pet.json in ${$} is not valid JSON`)}let V=await Xq(q),G=new Gq.default;G.file("pet.json",Y),G.file(`spritesheet.${J}`,V);let U=Buffer.from(await G.generateAsync({type:"uint8array",compression:"DEFLATE"})),K=V1.basename($);return{label:K,source:"folder",petJson:Y,petJsonObj:X,zipBuffer:U,zipFileName:`${K}.zip`,spritesheetBuffer:V,spritesheetExt:J,petIdHint:typeof X.id==="string"?X.id:K}}async function nz($){let Q=await Xq($),q=await Gq.default.loadAsync(Q),J=q.file("pet.json"),Y=q.file("spritesheet.webp"),X=q.file("spritesheet.png"),V=Y??X,G=Y?"webp":"png";if(!J||!V)throw Error(`Zip is missing pet.json or spritesheet.{webp,png}: ${$}`);let U=await J.async("string"),K={};try{K=JSON.parse(U)}catch{throw Error("pet.json in zip is not valid JSON")}let W=Buffer.from(await V.async("uint8array")),z=V1.basename($,".zip");return{label:z,source:"zip",petJson:U,petJsonObj:K,zipBuffer:Q,zipFileName:V1.basename($),spritesheetBuffer:W,spritesheetExt:G,petIdHint:typeof K.id==="string"?K.id:z}}async function rz($,Q){let{width:q,height:J}=qH($.spritesheetBuffer);if(q===0||J===0)throw Error("spritesheet dimensions could not be parsed");let Y=await fetch(`${I1}/api/cli/submit`,{method:"POST",headers:{Authorization:`Bearer ${Q}`,"Content-Type":"application/json"},body:JSON.stringify({slugHint:X6($.petIdHint),petId:$.petIdHint,spritesheetExt:$.spritesheetExt})});if(!Y.ok){let H=await Y.text().catch(()=>"");throw Error(`presign ${Y.status} ${H.slice(0,100)}`)}let X=await Y.json(),V=(H)=>{let C=X.files.find((I)=>I.role===H);if(!C)throw Error(`presign response missing ${H}`);return C},G=V("zip"),U=V("sprite"),K=V("petjson"),W=$.spritesheetExt==="png"?"image/png":"image/webp";await Promise.all([Yq(G.uploadUrl,$.zipBuffer,"application/zip"),Yq(U.uploadUrl,$.spritesheetBuffer,W),Yq(K.uploadUrl,Buffer.from($.petJson,"utf8"),"application/json")]);let z=await fetch(`${I1}/api/cli/submit/register`,{method:"POST",headers:{Authorization:`Bearer ${Q}`,"Content-Type":"application/json"},body:JSON.stringify({zipUrl:G.publicUrl,spritesheetUrl:U.publicUrl,petJsonUrl:K.publicUrl,petId:$.petIdHint,displayName:AY($.petJsonObj.displayName,"Untitled pet"),description:AY($.petJsonObj.description,"A Codex-compatible digital pet."),spritesheetWidth:q,spritesheetHeight:J})});if(!z.ok){let H=await z.text().catch(()=>"");throw Error(`register ${z.status} ${H.slice(0,100)}`)}return await z.json()}function az($){let Q=j.default.dim($.slug),q=sz($.review);if($.review.decision==="approved")return`${Q} ${j.default.green("approved")}`;if($.review.decision==="rejected")return`${Q} ${j.default.red("rejected")}${q?j.default.dim(`: ${q}`):""}`;return`${Q} ${j.default.yellow("held for review")}${q?j.default.dim(`: ${q}`):""}`}function sz($){let Q=$.reasonCode??"";if(Q.startsWith("duplicate_"))return $.summary??"appears to duplicate an existing pet";if(Q.startsWith("policy_"))return"possible policy issue";if(Q.startsWith("asset_"))return"package file or spritesheet issue";if(Q==="review_timeout")return"automated review timed out";if(Q==="review_error"||Q==="review_failed")return"automated review failed";if($.decision==="rejected")return"high-confidence automated review issue";if($.decision==="hold")return"not confident enough to approve automatically";return null}async function Yq($,Q,q){let J=await fetch($,{method:"PUT",headers:{"Content-Type":q},body:Q});if(!J.ok)throw Error(`R2 PUT ${J.status}`)}async function tz($,Q){let q=new Map;if($.length===0)return q;try{let J=await fetch(`${I1}/api/cli/submit/check`,{method:"POST",headers:{Authorization:`Bearer ${Q}`,"Content-Type":"application/json"},body:JSON.stringify({candidates:$.map((X)=>({petId:X.petIdHint,slugHint:X6(X.petIdHint)}))}),signal:AbortSignal.timeout(8000)});if(!J.ok)return q;let Y=await J.json();for(let X of Y.existing??[])if(X&&typeof X.slug==="string")q.set(X.slug,X)}catch{}return q}function ez($){let Q=$.toLowerCase();if(Q.includes("invalid_client")||Q.includes("client does not exist"))return["Clerk OAuth rejected this CLI build (invalid_client).","This usually means your installed CLI is out of date. Try:"," npm cache clean --force && npx -y petdex@latest login","If it still fails: https://github.com/crafter-station/petdex/issues"].join(`
|
|
310
310
|
`);if(Q.includes("invalid_grant")||Q.includes("does not match the redirect"))return["OAuth callback was rejected by Clerk (invalid_grant).","Common cause: you closed the browser before approving, or the local","callback server timed out. Try `petdex login` again."].join(`
|
|
311
311
|
`);if(Q.includes("redirect_uri")&&Q.includes("pre-registered"))return["Clerk OAuth rejected the local callback URL.","The petdex OAuth Application needs http://127.0.0.1 in its allowed","redirect URLs. Please file an issue:"," https://github.com/crafter-station/petdex/issues"].join(`
|
|
312
|
-
`);return $}async function A8($){try{return await vY($),!0}catch{return!1}}function AY($,Q){if(typeof $==="string"&&$.trim())return $.trim();return Q}function F8($){return typeof $==="string"&&$.trim()?$.trim():null}function xY(...$){for(let Q of $){let q=F8(Q);if(q)return q}return null}function SY($){let Q=I1.replace(/\/+$/,""),q=$.startsWith("/")?$:`/${$}`;return`${Q}${q}`}function $H($){if(!$)return null;if($.startsWith("http://")||$.startsWith("https://"))return $;return SY($)}function QH($){let Q=xY($?.preferred_username,$?.username)??(typeof $?.sub==="string"?$.sub.slice(-8).toLowerCase():null);return Q?SY(`/u/${encodeURIComponent(Q.toLowerCase())}`):I1}function X6($){return $.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)}function qH($){if($.length>24&&$[0]===137&&$[1]===80&&$[2]===78&&$[3]===71)return{width:$.readUInt32BE(16),height:$.readUInt32BE(20)};if($.length>30&&$.slice(0,4).toString()==="RIFF"&&$.slice(8,12).toString()==="WEBP"){let Q=$.slice(12,16).toString();if(Q==="VP8X")return{width:(($[24]|$[25]<<8|$[26]<<16)>>>0)+1,height:(($[27]|$[28]<<8|$[29]<<16)>>>0)+1};if(Q==="VP8L"){let q=$[22],
|
|
313
|
-
`))}async function KH($){let Q=$[0];if(!Q||Q==="--help"||Q==="-h"||Q==="help"){RY();return}switch(Q){case"start":await
|
|
314
|
-
`))}function WH($){let Q=$[0];if(Q==="on"||Q==="off"){let q=Q==="on";if(
|
|
312
|
+
`);return $}async function A8($){try{return await vY($),!0}catch{return!1}}function AY($,Q){if(typeof $==="string"&&$.trim())return $.trim();return Q}function F8($){return typeof $==="string"&&$.trim()?$.trim():null}function xY(...$){for(let Q of $){let q=F8(Q);if(q)return q}return null}function SY($){let Q=I1.replace(/\/+$/,""),q=$.startsWith("/")?$:`/${$}`;return`${Q}${q}`}function $H($){if(!$)return null;if($.startsWith("http://")||$.startsWith("https://"))return $;return SY($)}function QH($){let Q=xY($?.preferred_username,$?.username)??(typeof $?.sub==="string"?$.sub.slice(-8).toLowerCase():null);return Q?SY(`/u/${encodeURIComponent(Q.toLowerCase())}`):I1}function X6($){return $.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)}function qH($){if($.length>24&&$[0]===137&&$[1]===80&&$[2]===78&&$[3]===71)return{width:$.readUInt32BE(16),height:$.readUInt32BE(20)};if($.length>30&&$.slice(0,4).toString()==="RIFF"&&$.slice(8,12).toString()==="WEBP"){let Q=$.slice(12,16).toString();if(Q==="VP8X")return{width:(($[24]|$[25]<<8|$[26]<<16)>>>0)+1,height:(($[27]|$[28]<<8|$[29]<<16)>>>0)+1};if(Q==="VP8L"){let q=$[22],J=$[23],Y=$[24];return{width:(($[21]|(q&63)<<8)>>>0)+1,height:((q>>6|J<<2|(Y&15)<<10)>>>0)+1}}if(Q==="VP8 "){for(let q=23;q<Math.min(60,$.length-7);q++)if($[q]===157&&$[q+1]===1&&$[q+2]===42)return{width:($[q+3]|$[q+4]<<8)&16383,height:($[q+5]|$[q+6]<<8)&16383}}}return{width:0,height:0}}async function JH($){let Q=$[0];if(!Q||Q==="--help"||Q==="-h"||Q==="help"){FY();return}switch(Q){case"install":{let{installedAgents:q}=await tQ();if(q.length>0)S1("cli_hooks_install_success",{cli_version:l1,agents:q}),console.log(""),console.log(`${j.default.green("✓")} ${j.default.bold("All set.")} Open your agent and run ${j.default.cyan("/petdex")} to wake the mascot.`);break}case"toggle":case"on":case"off":case"status":{VH(Q);break}case"uninstall":{let q=$.includes("--remove-token");await WY({removeToken:q});break}case"refresh":{let{runRefresh:q}=await Promise.resolve().then(() => (qq(),Qq)),J=await q();if(J.binaryPersisted)console.log(`${j.default.green("✓")} Snapshotted petdex binary at ${j.default.dim("~/.petdex/bin/petdex.js")}`);else if(J.binaryReason)console.log(`${j.default.yellow("!")} Binary snapshot skipped: ${J.binaryReason}`);for(let X of J.refreshed)console.log(`${j.default.green("✓")} Refreshed ${X}`);for(let{id:X,reason:V}of J.skipped){if(V==="not installed")continue;console.log(`${j.default.yellow("!")} Skipped ${X}: ${V}`)}let Y=J.refreshed.length;if(console.log(""),Y===0)console.log(`${j.default.dim("No wired agents found. Run")} ${j.default.cyan("petdex init")} ${j.default.dim("first.")}`);else console.log(`${j.default.green("✓")} ${j.default.bold(`${Y} agent${Y===1?"":"s"} refreshed.`)} Restart your agent to load the new hooks.`);break}default:console.error(j.default.red(`Unknown hooks command: ${Q}`)),FY(),process.exit(1)}}function VH($){let Q;if($==="toggle")Q=HV();else if($==="on")Q=G$("on");else if($==="off")Q=G$("off");else Q=X$();if(Q==="on")console.log(`${j.default.green("●")} Petdex hooks are ${j.default.bold("ENABLED")}`),console.log(j.default.dim(" agent tool calls will animate the mascot when petdex-desktop is running"));else console.log(`${j.default.yellow("○")} Petdex hooks are ${j.default.bold("DISABLED")}`),console.log(j.default.dim(" agent hooks short-circuit before any network call. Re-enable: petdex hooks on"))}async function YH(){S1("cli_init_started",{cli_version:l1,os:process.platform,arch:process.arch});let $=c1();if(!kz($)){console.log(j.default.dim(`${j.default.yellow("!")} No desktop binary found. Installing the bare binary at ${j.default.cyan("~/.petdex/bin/")}...`)),console.log(j.default.dim(` (For the proper macOS app icon, download the DMG from ${j.default.cyan("https://petdex.crafter.run/download")} instead.)`)),console.log("");try{await uQ()}catch(Y){console.error(`${j.default.red("✗")} Could not install desktop: ${Y.message}`),console.error(j.default.dim(` You can still proceed by downloading the DMG: ${j.default.cyan("https://petdex.crafter.run/download")}`))}}else{let Y=$.includes("/Petdex.app/Contents/MacOS/");console.log(`${j.default.green("●")} Desktop already installed at ${j.default.cyan(XH($))}${Y?j.default.dim(" (DMG)"):j.default.dim(" (bare)")}`)}let{installedAgents:q}=await tQ(),J=u1();if(J.state==="running")console.log(`${j.default.green("●")} Desktop already running (pid ${J.pid})`);else{let Y=await W$();if(Y.ok){if(!Y.alreadyRunning)S1("cli_desktop_start_success",{cli_version:l1});console.log(Y.alreadyRunning?`${j.default.dim("•")} Desktop already running (pid ${Y.pid})`:`${j.default.green("✓")} Desktop started (pid ${Y.pid})`)}else console.log(`${j.default.yellow("!")} Could not start desktop: ${Y.reason}`),console.log(j.default.dim(` Open ${j.default.cyan("/Applications/Petdex.app")} once manually, then re-run ${j.default.cyan("petdex up")}.`))}console.log(""),console.log(`${j.default.green("✓")} ${j.default.bold("All set.")} Open your agent and run ${j.default.cyan("/petdex")} to wake the mascot.`),console.log(j.default.dim(` Or from a shell: ${j.default.cyan("petdex up")} (force-wake) · ${j.default.cyan("petdex toggle")} (smart wake/sleep)`))}function XH($){let Q=process.env.HOME;if(Q&&$.startsWith(Q))return`~${$.slice(Q.length)}`;return $}async function EY(){S1("cli_up_invoked",{cli_version:l1}),G$("on"),console.log(`${j.default.green("●")} Hooks ${j.default.bold("ENABLED")}`);let $=u1();if($.state==="running"){console.log(`${j.default.green("●")} Desktop already running (pid ${$.pid})`);return}let Q=await W$();if(Q.ok){if(!Q.alreadyRunning)S1("cli_desktop_start_success",{cli_version:l1});console.log(Q.alreadyRunning?`${j.default.dim("•")} Desktop already running (pid ${Q.pid})`:`${j.default.green("✓")} Desktop started (pid ${Q.pid})`)}else console.log(`${j.default.yellow("!")} ${Q.reason}`),console.log(j.default.dim(` Install the binary first: ${j.default.cyan("petdex install desktop")}`))}async function GH(){let $=X$()==="on",Q=u1().state==="running";if($&&Q)await yY();else await EY()}async function yY(){if(G$("off"),console.log(`${j.default.yellow("○")} Hooks ${j.default.bold("DISABLED")}`),u1().state==="stopped"){console.log(`${j.default.dim("•")} Desktop wasn't running`);return}let Q=await U$();if(Q.ok)console.log(`${j.default.green("✓")} Desktop stopped (pid ${Q.pid})`);else console.log(`${j.default.dim("•")} ${Q.reason}`)}function FY(){let $=j.default.cyan,Q=j.default.dim;console.log(["",` ${j.default.bold(j.default.magenta("petdex hooks"))}`,"",` ${$("Usage")}`," petdex hooks <command>","",` ${$("Commands")}`,` ${j.default.bold("install")} Wire petdex into your coding agents`,` ${j.default.bold("refresh")} Re-write hook configs + slash commands for already-wired agents (non-interactive)`,` ${j.default.bold("uninstall")} Remove petdex from your agent configs (--remove-token also drops the auth token)`,` ${j.default.bold("toggle")} Flip the killswitch. Disable/enable hooks without restarting agents`,` ${j.default.bold("on")} Enable hooks (clears the killswitch)`,` ${j.default.bold("off")} Disable hooks (sets the killswitch, agent tool calls become no-ops)`,` ${j.default.bold("status")} Show whether hooks are currently enabled`,"",` ${$("Examples")}`,` ${Q("$")} petdex hooks install`,` ${Q("$")} petdex hooks toggle`,` ${Q("$")} petdex hooks status`,""].join(`
|
|
313
|
+
`))}async function KH($){let Q=$[0];if(!Q||Q==="--help"||Q==="-h"||Q==="help"){RY();return}switch(Q){case"start":await DV(),S1("cli_desktop_start_success",{cli_version:l1});break;case"stop":await hV();break;case"status":_V();break;default:console.error(j.default.red(`Unknown desktop command: ${Q}`)),RY(),process.exit(1)}}function RY(){let $=j.default.cyan,Q=j.default.dim;console.log(["",` ${j.default.bold(j.default.magenta("petdex desktop"))}`,"",` ${$("Usage")}`," petdex desktop <command>","",` ${$("Commands")}`,` ${j.default.bold("start")} Launch petdex-desktop in the background`,` ${j.default.bold("stop")} Terminate the running petdex-desktop process`,` ${j.default.bold("status")} Show whether petdex-desktop is running`,"",` ${$("Examples")}`,` ${Q("$")} petdex desktop start`,` ${Q("$")} petdex desktop status`,` ${Q("$")} petdex desktop stop`,""].join(`
|
|
314
|
+
`))}function WH($){let Q=$[0];if(Q==="on"||Q==="off"){let q=Q==="on";if(pV(q))console.log(q?"Telemetry enabled":"Telemetry disabled");else console.error(j.default.red(`${j.default.bold("Failed to persist preference.")} ~/.petdex/telemetry.json is not writable. Check filesystem permissions, then run \`petdex telemetry ${Q}\` again.`)),process.exit(1)}else if(Q==="status"||!Q){let q=uV();if(console.log(`Status: ${q.enabled?"enabled":"disabled"}`),q.install_id)console.log(`Install ID: ${q.install_id}`)}else console.error(j.default.red(`Unknown telemetry subcommand: ${Q}`)),console.error("Use: petdex telemetry [on|off|status]"),process.exit(1)}
|