@capgo/cli 7.84.8 → 7.84.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -95,7 +95,7 @@ ${W}
95
95
  `}}}}).prompt();var b0=l(()=>{rK();rK();J0=h$(_K(),1),h7=h$(kK(),1);sK=ds(),is=L$("◆","*"),WR=L$("■","x"),BR=L$("▲","x"),Dq=L$("◇","o"),ps=L$("┌","T"),H$=L$("│","|"),T4=L$("└","—"),QS0=L$("┐","T"),GS0=L$("┘","—"),eK=L$("●",">"),eQ=L$("○"," "),WS0=L$("◻","[•]"),BS0=L$("◼","[+]"),HS0=L$("◻","[ ]"),rs=L$("▪","•"),US0=L$("─","-"),FS0=L$("╮","+"),KS0=L$("├","+"),qS0=L$("╯","+"),VS0=L$("╰","+"),zS0=L$("╭","+"),as=L$("●","•"),os=L$("◆","*"),ts=L$("▲","!"),ss=L$("■","x"),aK=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,aQ=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,oQ=/\t{1,1000}/y,oK=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,tQ=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Ye=/\p{M}+/gu,Je={limit:1/0,ellipsis:""},Qe={limit:1/0,ellipsis:"",ellipsisWidth:0},Yq=`${We}8;;`,JR=new RegExp(`(?:\\${FR}(?<code>\\d+)m|\\${Yq}(?<uri>.*)${Xq})`,"y");F={message:($=[],{symbol:D=J0.default.gray(H$),secondarySymbol:X=J0.default.gray(H$),output:J=process.stdout,spacing:Y=1,withGuide:Q}={})=>{let G=[],W=Q??Q6.withGuide,B=W?X:"",H=W?`${D} `:"",U=W?`${X} `:"";for(let q=0;q<Y;q++)G.push(B);let K=Array.isArray($)?$:$.split(`
96
96
  `);if(K.length>0){let[q,...V]=K;q.length>0?G.push(`${H}${q}`):G.push(W?D:"");for(let z of V)z.length>0?G.push(`${U}${z}`):G.push(W?X:"")}J.write(`${G.join(`
97
97
  `)}
98
- `)},info:($,D)=>{F.message($,{...D,symbol:J0.default.blue(as)})},success:($,D)=>{F.message($,{...D,symbol:J0.default.green(os)})},step:($,D)=>{F.message($,{...D,symbol:J0.default.green(Dq)})},warn:($,D)=>{F.message($,{...D,symbol:J0.default.yellow(ts)})},warning:($,D)=>{F.warn($,D)},error:($,D)=>{F.message($,{...D,symbol:J0.default.red(ss)})}},Ve=J0.default.magenta,wS0={light:L$("─","-"),heavy:L$("━","="),block:L$("█","#")},NS0=`${J0.default.gray(H$)} `});var _1;var S8=l(()=>{_1={name:"@capgo/cli",type:"module",version:"7.84.8",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLI#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/CLI.git"},bugs:{url:"https://github.com/Cap-go/CLI/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsc --noEmit",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:bundle":"bun test/test-bundle.mjs","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:mcp":"node test/test-mcp.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:payload-split":"bun test/test-payload-split.mjs",test:"bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:credentials && bun run test:credentials-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:esm-sdk && bun run test:mcp && bun run test:version-detection && bun run test:platform-paths && bun run test:payload-split"},devDependencies:{"@antfu/eslint-config":"^7.0.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.4","@capacitor/cli":"^8.0.0","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.0.0","@modelcontextprotocol/sdk":"^1.25.3","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.79.0","@types/adm-zip":"^0.5.7","@types/node":"^25.0.0","@types/prettyjson":"^0.0.33","@types/tmp":"^0.2.6","@vercel/ncc":"^0.38.4","adm-zip":"^0.5.16","ci-info":"^4.3.1",commander:"^14.0.2",eslint:"^9.38.0","git-format-staged":"4.0.1",husky:"^9.1.7","is-wsl":"^3.1.0",micromatch:"^4.0.8",open:"^11.0.0",prettyjson:"^1.2.5",tmp:"^0.2.5","tus-js-client":"^4.3.1",typescript:"^5.9.3",partysocket:"^1.1.11",ws:"^8.18.3",zod:"^4.3.6"}}});var YG=I((VR)=>{Object.defineProperty(VR,"__esModule",{value:!0});VR.isNXMonorepo=VR.isMonorepo=VR.findPackageRelativePathInMonorepo=VR.findPackagePath=VR.findNXMonorepoRoot=VR.findMonorepoRoot=void 0;var l7=r("node:fs"),S4=r("node:path");function XG($){let D=(0,S4.join)($,"package.json"),X=(0,S4.join)($,"pnpm-workspace.yaml");if((0,l7.existsSync)(X)||(0,l7.existsSync)(D)&&JSON.parse((0,l7.readFileSync)(D,"utf-8")).workspaces)return $;let J=(0,S4.dirname)($);if(J===$)throw Error("Monorepo root not found");return XG(J)}VR.findMonorepoRoot=XG;function Jq($){let D=(0,S4.join)($,"nx.json");if((0,l7.existsSync)(D))return $;let X=(0,S4.dirname)($);if(X===$)throw Error("Monorepo root not found");return Jq(X)}VR.findNXMonorepoRoot=Jq;function Qq($,D,X){let J=(0,S4.join)(D,"node_modules",$);if((0,l7.existsSync)(J))return J;if(D===X)return null;let Y=(0,S4.dirname)(D);return Qq($,Y,X)}VR.findPackagePath=Qq;function we($,D){let X=XG(D),J=Qq($,D,X);if(J)return(0,S4.relative)(D,J);return null}VR.findPackageRelativePathInMonorepo=we;function Ne($){try{return XG($),!0}catch(D){return!1}}VR.isMonorepo=Ne;function Oe($){try{return Jq($),!0}catch(D){return!1}}VR.isNXMonorepo=Oe});import{existsSync as G6}from"fs";var c7=($=".",D="unknown")=>{let X=`${$}/bun.lockb`,J=`${$}/bun.lock`,Y=`${$}/pnpm-lock.yaml`,Q=`${$}/shrinkwrap.yaml`,G=`${$}/yarn.lock`,W=`${$}/package-lock.json`,B=`${$}/npm-shrinkwrap.json`;if(G6(X)||G6(J))return"bun";if(G6(Y)||G6(Q))return"pnpm";if(G6(G))return"yarn";if(G6(W)||G6(B))return"npm";return D},JG=($=c7(),D=!1)=>{switch($){case"bun":return D?"bun install":"install";case"pnpm":return D?"pnpm install":"install";case"yarn":return D?"yarn install":"install";case"npm":return D?"npm install":"install";case"unknown":return D?"unknown unknown":"unknown";default:return D?"npm install":"install"}},wR=($=".",D="npx")=>{let X=`${$}/bun.lockb`,J=`${$}/bun.lock`,Y=`${$}/pnpm-lock.yaml`,Q=`${$}/shrinkwrap.yaml`,G=`${$}/yarn.lock`,W=`${$}/package-lock.json`,B=`${$}/npm-shrinkwrap.json`;if(G6(X)||G6(J))return"bunx";if(G6(Y)||G6(Q))return"pnpm exec";if(G6(G))return"yarn dlx";if(G6(W)||G6(B))return"npx";return D};var NR=()=>{};function QG($,D){if(isNaN($)||isNaN(D))throw Error("Cannot compare against non-numbers");return $===D?0:$<D?-1:1}function ZR($=[],D=[]){if($.length&&!D.length)return-1;if(!$.length&&D.length)return 1;return 0}function Wq($=[],D=[]){let X=Math.max($.length,D.length);for(let J=0;J<X;J++){let Y=$[J],Q=D[J];if(Y===void 0&&Q===void 0)return 0;if(Q===void 0)return 1;if(Y===void 0)return-1;if(typeof Y==="string"&&typeof Q==="number")return 1;if(typeof Y==="number"&&typeof Q==="string")return-1;if(Y<Q)return-1;if(Y>Q)return 1}return 0}function Bq($){return typeof $==="number"&&!Number.isNaN($)&&(!Number.isFinite($)||0<=$&&$<=Number.MAX_SAFE_INTEGER)}function W6($){return $.split(".").filter(Boolean).map((D)=>{if(Ie.test(D)){let X=Number(D);if(Bq(X))return X}return D})}function VD($){return $.split(".").filter(Boolean)}function WG($,D){let X=Number($);if(!Bq(X))throw TypeError(D);return X}function cD($){return Number.isNaN($.major)&&Number.isNaN($.minor)&&Number.isNaN($.patch)&&($.prerelease===void 0||$.prerelease.length===0)&&($.build===void 0||$.build.length===0)}var i9="0|[1-9]\\d*",Ee="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Re,OR,MR,LR="[0-9A-Za-z-]+",AR,jR,ER,RR="(?:<|>)?=?",Te="x|X|\\*",Gq,GG,TR,IR,Hq=256,Ie;var M6=l(()=>{Re=`(?<major>${i9})\\.(?<minor>${i9})\\.(?<patch>${i9})`,OR=`(?:${i9}|${Ee})`,MR=`(?:-(?<prerelease>${OR}(?:\\.${OR})*))`,AR=`(?:\\+(?<buildmetadata>${LR}(?:\\.${LR})*))`,jR=`v?${Re}${MR}?${AR}?`,ER=new RegExp(`^${jR}$`),Gq=`${i9}|${Te}`,GG=`[v=\\s]*(?<major>${Gq})(?:\\.(?<minor>${Gq})(?:\\.(?<patch>${Gq})${MR}?${AR}?)?)?`,TR=new RegExp(`^(?<operator>~>?|\\^|${RR})\\s*${GG}$`),IR=new RegExp(`^(?<operator>${RR})\\s*(${jR})$|^$`);Ie=new RegExp(`^${i9}$`)});function c1($,D){if($===D)return 0;return QG($.major,D.major)||QG($.minor,D.minor)||QG($.patch,D.patch)||ZR($.prerelease,D.prerelease)||Wq($.prerelease,D.prerelease)}var k6=l(()=>{M6()});var SR=l(()=>{M6()});function Uq($){return $.toFixed(0)}function B6($){let D=Uq($.major),X=Uq($.minor),J=Uq($.patch),Y=$.prerelease?.join(".")??"",Q=$.build?.join(".")??"";return[[`${D}.${X}.${J}`,Y].filter((B)=>B).join("-"),Q].filter((B)=>B).join("+")}function Se($,D){if(cD(D))return!0;let X=c1($,D);switch(D.operator){case"=":case void 0:return X===0;case"!=":return X!==0;case">":return X>0;case"<":return X<0;case">=":return X>=0;case"<=":return X<=0}}function BG($,D){for(let X of D)if(!Se($,X))return!1;if(!$.prerelease?.length)return!0;for(let X of D){if(cD(X))continue;if(!X.prerelease?.length)continue;let{major:J,minor:Y,patch:Q}=X;if($.major===J&&$.minor===Y&&$.patch===Q)return!0}return!1}var HG=l(()=>{M6();k6()});function d7($,D){return D.some((X)=>BG($,X))}var n7=l(()=>{HG()});function Pe($=[]){let D=[...$],X=D.length;while(X>=0){let J=D[X];if(typeof J==="number"){D[X]=J+1;break}X-=1}if(X===-1)D.push(0);return D}function i7($=[],D){let X=Pe($);if(!D)return X;let J=W6(D);if(J.every((Y)=>typeof Y==="string")){if(J.every((Y,Q)=>Y===X[Q])&&typeof X[J.length]==="number")return X;J=[...J,0]}return J}function P4($,D,X={}){let J=X.build!==void 0?VD(X.build):$.build??[];switch(D){case"premajor":return{major:$.major+1,minor:0,patch:0,prerelease:i7($.prerelease,X.prerelease),build:J};case"preminor":return{major:$.major,minor:$.minor+1,patch:0,prerelease:i7($.prerelease,X.prerelease),build:J};case"prepatch":return{major:$.major,minor:$.minor,patch:$.patch+1,prerelease:i7($.prerelease,X.prerelease),build:J};case"prerelease":{let Q=($.prerelease??[]).length===0?$.patch+1:$.patch;return{major:$.major,minor:$.minor,patch:Q,prerelease:i7($.prerelease,X.prerelease),build:J}}case"major":return{major:($.prerelease??[]).length===0||$.minor!==0||$.patch!==0?$.major+1:$.major,minor:0,patch:0,prerelease:[],build:J};case"minor":{let Q=($.prerelease??[]).length===0||$.patch!==0?$.minor+1:$.minor;return{major:$.major,minor:Q,patch:0,prerelease:[],build:J}}case"patch":{let Q=($.prerelease??[]).length===0?$.patch+1:$.patch;return{major:$.major,minor:$.minor,patch:Q,prerelease:[],build:J}}case"pre":return{major:$.major,minor:$.minor,patch:$.patch,prerelease:i7($.prerelease,X.prerelease),build:J};default:throw TypeError(`Cannot increment version: invalid argument ${D}`)}}var PR=l(()=>{M6()});var UG,p9;var p7=l(()=>{UG={major:Number.NaN,minor:Number.NaN,patch:Number.NaN,prerelease:[],build:[]},p9={operator:void 0,...UG}});var Fq=l(()=>{p7();M6()});function Kq($,D){return c1($,D)>0}var qq=l(()=>{k6()});var vR=l(()=>{n7();qq()});function A6($,D){return c1($,D)<0}var Vq=l(()=>{k6()});var CR=l(()=>{n7();Vq()});function ve($){let X=$.match(IR)?.groups;if(!X)return null;let{operator:J}=X;return{operator:J||void 0,...UG}}function T$($){return!$||$.toLowerCase()==="x"||$==="*"}function Ce($){if(T$($.major))return;if(T$($.minor))return{operator:">=",major:+$.major,minor:0,patch:0,prerelease:[],build:[]};if(T$($.patch))return{operator:">=",major:+$.major,minor:+$.minor,patch:0,prerelease:[],build:[]};return{operator:">=",major:+$.major,minor:+$.minor,patch:+$.patch,prerelease:$.prerelease?W6($.prerelease):[],build:[]}}function _e($){if(T$($.major))return;if(T$($.minor))return{operator:"<",major:+$.major+1,minor:0,patch:0,prerelease:[],build:[]};if(T$($.patch))return{operator:"<",major:+$.major,minor:+$.minor+1,patch:0,prerelease:[],build:[]};if($.prerelease)return{operator:"<=",major:+$.major,minor:+$.minor,patch:+$.patch,prerelease:W6($.prerelease),build:[]};return{operator:"<=",major:+$.major,minor:+$.minor,patch:+$.patch,prerelease:[],build:[]}}function xe($){let D=$.match(new RegExp(`^${GG}`)),X=D?.groups;if(!X)return null;let J=D[0].length,Y=$.slice(J).match(/^\s+-\s+/);if(!Y)return null;let Q=Y[0].length,W=$.slice(J+Q).match(new RegExp(`^${GG}\\s*$`))?.groups,B=Ce(X),H=_e(W);return[B,H].filter(Boolean)}function ke($){let D=T$($.major),X=T$($.minor),J=T$($.patch),Y=+$.major,Q=+$.minor,G=+$.patch;if(D)return[p9];if(X)return[{operator:">=",major:Y,minor:0,patch:0},{operator:"<",major:Y+1,minor:0,patch:0}];if(J){if(Y===0)return[{operator:">=",major:Y,minor:Q,patch:0},{operator:"<",major:Y,minor:Q+1,patch:0}];return[{operator:">=",major:Y,minor:Q,patch:0},{operator:"<",major:Y+1,minor:0,patch:0}]}let W=W6($.prerelease??"");if(Y===0){if(Q===0)return[{operator:">=",major:Y,minor:Q,patch:G,prerelease:W},{operator:"<",major:Y,minor:Q,patch:G+1}];return[{operator:">=",major:Y,minor:Q,patch:G,prerelease:W},{operator:"<",major:Y,minor:Q+1,patch:0}]}return[{operator:">=",major:Y,minor:Q,patch:G,prerelease:W},{operator:"<",major:Y+1,minor:0,patch:0}]}function be($){let D=T$($.major),X=T$($.minor),J=T$($.patch),Y=+$.major,Q=+$.minor,G=+$.patch;if(D)return[p9];if(X)return[{operator:">=",major:Y,minor:0,patch:0},{operator:"<",major:Y+1,minor:0,patch:0}];if(J)return[{operator:">=",major:Y,minor:Q,patch:0},{operator:"<",major:Y,minor:Q+1,patch:0}];let W=W6($.prerelease??"");return[{operator:">=",major:Y,minor:Q,patch:G,prerelease:W},{operator:"<",major:Y,minor:Q+1,patch:0}]}function ye($){let D=T$($.major),X=T$($.minor),J=T$($.patch),Y=+$.major,Q=+$.minor,G=+$.patch;if(D)return[{operator:"<",major:0,minor:0,patch:0}];if(X){if(J)return[{operator:"<",major:Y,minor:0,patch:0}];return[{operator:"<",major:Y,minor:0,patch:0}]}if(J)return[{operator:"<",major:Y,minor:Q,patch:0}];let W=W6($.prerelease??""),B=VD($.build??"");return[{operator:"<",major:Y,minor:Q,patch:G,prerelease:W,build:B}]}function fe($){let D=T$($.minor),X=T$($.patch),J=+$.major,Y=+$.minor,Q=+$.patch;if(D)return[{operator:"<",major:J+1,minor:0,patch:0}];if(X)return[{operator:"<",major:J,minor:Y+1,patch:0}];let G=W6($.prerelease??""),W=VD($.build??"");return[{operator:"<=",major:J,minor:Y,patch:Q,prerelease:G,build:W}]}function ue($){let D=T$($.major),X=T$($.minor),J=T$($.patch),Y=+$.major,Q=+$.minor,G=+$.patch;if(D)return[{operator:"<",major:0,minor:0,patch:0}];if(X)return[{operator:">=",major:Y+1,minor:0,patch:0}];if(J)return[{operator:">=",major:Y,minor:Q+1,patch:0}];let W=W6($.prerelease??""),B=VD($.build??"");return[{operator:">",major:Y,minor:Q,patch:G,prerelease:W,build:B}]}function ge($){let D=T$($.major),X=T$($.minor),J=T$($.patch),Y=+$.major,Q=+$.minor,G=+$.patch;if(D)return[p9];if(X)return[{operator:">=",major:Y,minor:0,patch:0}];if(J)return[{operator:">=",major:Y,minor:Q,patch:0}];let W=W6($.prerelease??""),B=VD($.build??"");return[{operator:">=",major:Y,minor:Q,patch:G,prerelease:W,build:B}]}function he($){let D=T$($.major),X=T$($.minor),J=T$($.patch),Y=+$.major,Q=+$.minor,G=+$.patch;if(D)return[p9];if(X)return[{operator:">=",major:Y,minor:0,patch:0},{operator:"<",major:Y+1,minor:0,patch:0}];if(J)return[{operator:">=",major:Y,minor:Q,patch:0},{operator:"<",major:Y,minor:Q+1,patch:0}];let W=W6($.prerelease??""),B=VD($.build??"");return[{operator:$.operator==="="?"=":void 0,major:Y,minor:Q,patch:G,prerelease:W,build:B}]}function me($){let D=$.match(TR)?.groups;if(!D)return ve($);switch(D.operator){case"^":return ke(D);case"~":case"~>":return be(D);case"<":return ye(D);case"<=":return fe(D);case">":return ue(D);case">=":return ge(D);default:return he(D)}}function le($){return $.split(/\s+/).flatMap(me)}function FG($){let D=$.replaceAll(/(?<=[<>=~^])(\s+)/g,"").split(/\s*\|\|\s*/).map((X)=>xe(X)||le(X));if(D.some((X)=>X.includes(null)))throw TypeError(`Cannot parse version range: range "${$}" is invalid`);return D}var zq=l(()=>{M6();p7()});function d0($){if(typeof $!=="string")throw TypeError(`Cannot parse version as version must be a string: received ${typeof $}`);if($.length>Hq)throw TypeError(`Cannot parse version as version length is too long: length is ${$.length}, max length is ${Hq}`);$=$.trim();let D=$.match(ER)?.groups;if(!D)throw TypeError(`Cannot parse version: ${$}`);let X=WG(D.major,`Cannot parse version ${$}: invalid major version`),J=WG(D.minor,`Cannot parse version ${$}: invalid minor version`),Y=WG(D.patch,`Cannot parse version ${$}: invalid patch version`),Q=D.prerelease?W6(D.prerelease):[],G=D.buildmetadata?VD(D.buildmetadata):[];return{major:X,minor:J,patch:Y,prerelease:Q,build:G}}var KG=l(()=>{M6();M6()});function _R($,D){let X=$.operator,J=D.operator;if(X===void 0){if(cD($))return!0;return d7($,[[D]])}if(J===void 0){if(cD(D))return!0;return d7(D,[[$]])}let Y=c1($,D);return(X===">="||X===">")&&(J===">="||J===">")||(X==="<="||X==="<")&&(J==="<="||J==="<")||Y===0&&((X===">="||X==="<=")&&(J===">="||J==="<="))||Y===-1&&(X===">="||X===">")&&(J==="<="||J==="<")||Y===1&&(X==="<="||X==="<")&&(J===">="||J===">")}function ce($){return $.every((D)=>{return D.some((X)=>de(X))})}function de($){for(let D=0;D<$.length-1;D++){let X=$[D];for(let J of $.slice(D+1))if(!_R(X,J))return!1}return!0}function xR($,D){return ce([$,D])&&$.some((X)=>{return D.some((J)=>{return X.every((Y)=>{return J.every((Q)=>_R(Y,Q))})})})}var kR=l(()=>{M6();k6();n7()});var bR=l(()=>{zq()});var yR=l(()=>{p7();p7();Fq()});function fR($){try{return d0($),!0}catch{return!1}}var uR=l(()=>{KG()});var gR=l(()=>{KG()});var hR=l(()=>{M6()});var mR=l(()=>{k6()});var lR=l(()=>{k6()});var cR=l(()=>{HG();M6();k6()});function dR($,D){return c1($,D)>=0}var nR=l(()=>{k6()});var iR=l(()=>{HG();M6();k6()});var pR=l(()=>{k6()});var zD=l(()=>{k6();SR();n7();PR();Fq();vR();CR();zq();KG();kR();bR();yR();uR();gR();hR();mR();lR();qq();cR();nR();Vq();iR();pR()});var H6=I((Fv0,zG)=>{var rR,aR,oR,tR,sR,eR,$T,DT,XT,YT,JT,QT,GT,qG,wq,WT,BT,HT,r9,UT,FT,KT,qT,VT,zT,wT,NT,OT,VG,LT,ZT,MT;(function($){var D=typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:{};if(typeof define==="function"&&define.amd)define("tslib",["exports"],function(J){$(X(D,X(J)))});else if(typeof zG==="object"&&typeof Fv0==="object")$(X(D,X(Fv0)));else $(X(D));function X(J,Y){if(J!==D)if(typeof Object.create==="function")Object.defineProperty(J,"__esModule",{value:!0});else J.__esModule=!0;return function(Q,G){return J[Q]=Y?Y(Q,G):G}}})(function($){var D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Q,G){Q.__proto__=G}||function(Q,G){for(var W in G)if(Object.prototype.hasOwnProperty.call(G,W))Q[W]=G[W]};rR=function(Q,G){if(typeof G!=="function"&&G!==null)throw TypeError("Class extends value "+String(G)+" is not a constructor or null");D(Q,G);function W(){this.constructor=Q}Q.prototype=G===null?Object.create(G):(W.prototype=G.prototype,new W)},aR=Object.assign||function(Q){for(var G,W=1,B=arguments.length;W<B;W++){G=arguments[W];for(var H in G)if(Object.prototype.hasOwnProperty.call(G,H))Q[H]=G[H]}return Q},oR=function(Q,G){var W={};for(var B in Q)if(Object.prototype.hasOwnProperty.call(Q,B)&&G.indexOf(B)<0)W[B]=Q[B];if(Q!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var H=0,B=Object.getOwnPropertySymbols(Q);H<B.length;H++)if(G.indexOf(B[H])<0&&Object.prototype.propertyIsEnumerable.call(Q,B[H]))W[B[H]]=Q[B[H]]}return W},tR=function(Q,G,W,B){var H=arguments.length,U=H<3?G:B===null?B=Object.getOwnPropertyDescriptor(G,W):B,K;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")U=Reflect.decorate(Q,G,W,B);else for(var q=Q.length-1;q>=0;q--)if(K=Q[q])U=(H<3?K(U):H>3?K(G,W,U):K(G,W))||U;return H>3&&U&&Object.defineProperty(G,W,U),U},sR=function(Q,G){return function(W,B){G(W,B,Q)}},eR=function(Q,G,W,B,H,U){function K(v){if(v!==void 0&&typeof v!=="function")throw TypeError("Function expected");return v}var q=B.kind,V=q==="getter"?"get":q==="setter"?"set":"value",z=!G&&Q?B.static?Q:Q.prototype:null,w=G||(z?Object.getOwnPropertyDescriptor(z,B.name):{}),N,L=!1;for(var Z=W.length-1;Z>=0;Z--){var O={};for(var R in B)O[R]=R==="access"?{}:B[R];for(var R in B.access)O.access[R]=B.access[R];O.addInitializer=function(v){if(L)throw TypeError("Cannot add initializers after decoration has completed");U.push(K(v||null))};var E=(0,W[Z])(q==="accessor"?{get:w.get,set:w.set}:w[V],O);if(q==="accessor"){if(E===void 0)continue;if(E===null||typeof E!=="object")throw TypeError("Object expected");if(N=K(E.get))w.get=N;if(N=K(E.set))w.set=N;if(N=K(E.init))H.unshift(N)}else if(N=K(E))if(q==="field")H.unshift(N);else w[V]=N}if(z)Object.defineProperty(z,B.name,w);L=!0},$T=function(Q,G,W){var B=arguments.length>2;for(var H=0;H<G.length;H++)W=B?G[H].call(Q,W):G[H].call(Q);return B?W:void 0},DT=function(Q){return typeof Q==="symbol"?Q:"".concat(Q)},XT=function(Q,G,W){if(typeof G==="symbol")G=G.description?"[".concat(G.description,"]"):"";return Object.defineProperty(Q,"name",{configurable:!0,value:W?"".concat(W," ",G):G})},YT=function(Q,G){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(Q,G)},JT=function(Q,G,W,B){function H(U){return U instanceof W?U:new W(function(K){K(U)})}return new(W||(W=Promise))(function(U,K){function q(w){try{z(B.next(w))}catch(N){K(N)}}function V(w){try{z(B.throw(w))}catch(N){K(N)}}function z(w){w.done?U(w.value):H(w.value).then(q,V)}z((B=B.apply(Q,G||[])).next())})},QT=function(Q,G){var W={label:0,sent:function(){if(U[0]&1)throw U[1];return U[1]},trys:[],ops:[]},B,H,U,K=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return K.next=q(0),K.throw=q(1),K.return=q(2),typeof Symbol==="function"&&(K[Symbol.iterator]=function(){return this}),K;function q(z){return function(w){return V([z,w])}}function V(z){if(B)throw TypeError("Generator is already executing.");while(K&&(K=0,z[0]&&(W=0)),W)try{if(B=1,H&&(U=z[0]&2?H.return:z[0]?H.throw||((U=H.return)&&U.call(H),0):H.next)&&!(U=U.call(H,z[1])).done)return U;if(H=0,U)z=[z[0]&2,U.value];switch(z[0]){case 0:case 1:U=z;break;case 4:return W.label++,{value:z[1],done:!1};case 5:W.label++,H=z[1],z=[0];continue;case 7:z=W.ops.pop(),W.trys.pop();continue;default:if((U=W.trys,!(U=U.length>0&&U[U.length-1]))&&(z[0]===6||z[0]===2)){W=0;continue}if(z[0]===3&&(!U||z[1]>U[0]&&z[1]<U[3])){W.label=z[1];break}if(z[0]===6&&W.label<U[1]){W.label=U[1],U=z;break}if(U&&W.label<U[2]){W.label=U[2],W.ops.push(z);break}if(U[2])W.ops.pop();W.trys.pop();continue}z=G.call(Q,W)}catch(w){z=[6,w],H=0}finally{B=U=0}if(z[0]&5)throw z[1];return{value:z[0]?z[1]:void 0,done:!0}}},GT=function(Q,G){for(var W in Q)if(W!=="default"&&!Object.prototype.hasOwnProperty.call(G,W))VG(G,Q,W)},VG=Object.create?function(Q,G,W,B){if(B===void 0)B=W;var H=Object.getOwnPropertyDescriptor(G,W);if(!H||("get"in H?!G.__esModule:H.writable||H.configurable))H={enumerable:!0,get:function(){return G[W]}};Object.defineProperty(Q,B,H)}:function(Q,G,W,B){if(B===void 0)B=W;Q[B]=G[W]},qG=function(Q){var G=typeof Symbol==="function"&&Symbol.iterator,W=G&&Q[G],B=0;if(W)return W.call(Q);if(Q&&typeof Q.length==="number")return{next:function(){if(Q&&B>=Q.length)Q=void 0;return{value:Q&&Q[B++],done:!Q}}};throw TypeError(G?"Object is not iterable.":"Symbol.iterator is not defined.")},wq=function(Q,G){var W=typeof Symbol==="function"&&Q[Symbol.iterator];if(!W)return Q;var B=W.call(Q),H,U=[],K;try{while((G===void 0||G-- >0)&&!(H=B.next()).done)U.push(H.value)}catch(q){K={error:q}}finally{try{if(H&&!H.done&&(W=B.return))W.call(B)}finally{if(K)throw K.error}}return U},WT=function(){for(var Q=[],G=0;G<arguments.length;G++)Q=Q.concat(wq(arguments[G]));return Q},BT=function(){for(var Q=0,G=0,W=arguments.length;G<W;G++)Q+=arguments[G].length;for(var B=Array(Q),H=0,G=0;G<W;G++)for(var U=arguments[G],K=0,q=U.length;K<q;K++,H++)B[H]=U[K];return B},HT=function(Q,G,W){if(W||arguments.length===2){for(var B=0,H=G.length,U;B<H;B++)if(U||!(B in G)){if(!U)U=Array.prototype.slice.call(G,0,B);U[B]=G[B]}}return Q.concat(U||Array.prototype.slice.call(G))},r9=function(Q){return this instanceof r9?(this.v=Q,this):new r9(Q)},UT=function(Q,G,W){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var B=W.apply(Q,G||[]),H,U=[];return H=Object.create((typeof AsyncIterator==="function"?AsyncIterator:Object).prototype),q("next"),q("throw"),q("return",K),H[Symbol.asyncIterator]=function(){return this},H;function K(Z){return function(O){return Promise.resolve(O).then(Z,N)}}function q(Z,O){if(B[Z]){if(H[Z]=function(R){return new Promise(function(E,v){U.push([Z,R,E,v])>1||V(Z,R)})},O)H[Z]=O(H[Z])}}function V(Z,O){try{z(B[Z](O))}catch(R){L(U[0][3],R)}}function z(Z){Z.value instanceof r9?Promise.resolve(Z.value.v).then(w,N):L(U[0][2],Z)}function w(Z){V("next",Z)}function N(Z){V("throw",Z)}function L(Z,O){if(Z(O),U.shift(),U.length)V(U[0][0],U[0][1])}},FT=function(Q){var G,W;return G={},B("next"),B("throw",function(H){throw H}),B("return"),G[Symbol.iterator]=function(){return this},G;function B(H,U){G[H]=Q[H]?function(K){return(W=!W)?{value:r9(Q[H](K)),done:!1}:U?U(K):K}:U}},KT=function(Q){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var G=Q[Symbol.asyncIterator],W;return G?G.call(Q):(Q=typeof qG==="function"?qG(Q):Q[Symbol.iterator](),W={},B("next"),B("throw"),B("return"),W[Symbol.asyncIterator]=function(){return this},W);function B(U){W[U]=Q[U]&&function(K){return new Promise(function(q,V){K=Q[U](K),H(q,V,K.done,K.value)})}}function H(U,K,q,V){Promise.resolve(V).then(function(z){U({value:z,done:q})},K)}},qT=function(Q,G){if(Object.defineProperty)Object.defineProperty(Q,"raw",{value:G});else Q.raw=G;return Q};var X=Object.create?function(Q,G){Object.defineProperty(Q,"default",{enumerable:!0,value:G})}:function(Q,G){Q.default=G},J=function(Q){return J=Object.getOwnPropertyNames||function(G){var W=[];for(var B in G)if(Object.prototype.hasOwnProperty.call(G,B))W[W.length]=B;return W},J(Q)};VT=function(Q){if(Q&&Q.__esModule)return Q;var G={};if(Q!=null){for(var W=J(Q),B=0;B<W.length;B++)if(W[B]!=="default")VG(G,Q,W[B])}return X(G,Q),G},zT=function(Q){return Q&&Q.__esModule?Q:{default:Q}},wT=function(Q,G,W,B){if(W==="a"&&!B)throw TypeError("Private accessor was defined without a getter");if(typeof G==="function"?Q!==G||!B:!G.has(Q))throw TypeError("Cannot read private member from an object whose class did not declare it");return W==="m"?B:W==="a"?B.call(Q):B?B.value:G.get(Q)},NT=function(Q,G,W,B,H){if(B==="m")throw TypeError("Private method is not writable");if(B==="a"&&!H)throw TypeError("Private accessor was defined without a setter");if(typeof G==="function"?Q!==G||!H:!G.has(Q))throw TypeError("Cannot write private member to an object whose class did not declare it");return B==="a"?H.call(Q,W):H?H.value=W:G.set(Q,W),W},OT=function(Q,G){if(G===null||typeof G!=="object"&&typeof G!=="function")throw TypeError("Cannot use 'in' operator on non-object");return typeof Q==="function"?G===Q:Q.has(G)},LT=function(Q,G,W){if(G!==null&&G!==void 0){if(typeof G!=="object"&&typeof G!=="function")throw TypeError("Object expected.");var B,H;if(W){if(!Symbol.asyncDispose)throw TypeError("Symbol.asyncDispose is not defined.");B=G[Symbol.asyncDispose]}if(B===void 0){if(!Symbol.dispose)throw TypeError("Symbol.dispose is not defined.");if(B=G[Symbol.dispose],W)H=B}if(typeof B!=="function")throw TypeError("Object not disposable.");if(H)B=function(){try{H.call(this)}catch(U){return Promise.reject(U)}};Q.stack.push({value:G,dispose:B,async:W})}else if(W)Q.stack.push({async:!0});return G};var Y=typeof SuppressedError==="function"?SuppressedError:function(Q,G,W){var B=Error(W);return B.name="SuppressedError",B.error=Q,B.suppressed=G,B};ZT=function(Q){function G(U){Q.error=Q.hasError?new Y(U,Q.error,"An error was suppressed during disposal."):U,Q.hasError=!0}var W,B=0;function H(){while(W=Q.stack.pop())try{if(!W.async&&B===1)return B=0,Q.stack.push(W),Promise.resolve().then(H);if(W.dispose){var U=W.dispose.call(W.value);if(W.async)return B|=2,Promise.resolve(U).then(H,function(K){return G(K),H()})}else B|=1}catch(K){G(K)}if(B===1)return Q.hasError?Promise.reject(Q.error):Promise.resolve();if(Q.hasError)throw Q.error}return H()},MT=function(Q,G){if(typeof Q==="string"&&/^\.\.?\//.test(Q))return Q.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(W,B,H,U,K){return B?G?".jsx":".js":H&&(!U||!K)?W:H+U+"."+K.toLowerCase()+"js"});return Q},$("__extends",rR),$("__assign",aR),$("__rest",oR),$("__decorate",tR),$("__param",sR),$("__esDecorate",eR),$("__runInitializers",$T),$("__propKey",DT),$("__setFunctionName",XT),$("__metadata",YT),$("__awaiter",JT),$("__generator",QT),$("__exportStar",GT),$("__createBinding",VG),$("__values",qG),$("__read",wq),$("__spread",WT),$("__spreadArrays",BT),$("__spreadArray",HT),$("__await",r9),$("__asyncGenerator",UT),$("__asyncDelegator",FT),$("__asyncValues",KT),$("__makeTemplateObject",qT),$("__importStar",VT),$("__importDefault",zT),$("__classPrivateFieldGet",wT),$("__classPrivateFieldSet",NT),$("__classPrivateFieldIn",OT),$("__addDisposableResource",LT),$("__disposeResources",ZT),$("__rewriteRelativeImportExtension",MT)})});var ET=I((AT)=>{Object.defineProperty(AT,"__esModule",{value:!0});AT.resolveFetch=void 0;var ne=($)=>{if($)return(...D)=>$(...D);return(...D)=>fetch(...D)};AT.resolveFetch=ne});var Nq=I((PT)=>{Object.defineProperty(PT,"__esModule",{value:!0});PT.FunctionRegion=PT.FunctionsHttpError=PT.FunctionsRelayError=PT.FunctionsFetchError=PT.FunctionsError=void 0;class r7 extends Error{constructor($,D="FunctionsError",X){super($);this.name=D,this.context=X}}PT.FunctionsError=r7;class TT extends r7{constructor($){super("Failed to send a request to the Edge Function","FunctionsFetchError",$)}}PT.FunctionsFetchError=TT;class IT extends r7{constructor($){super("Relay Error invoking the Edge Function","FunctionsRelayError",$)}}PT.FunctionsRelayError=IT;class ST extends r7{constructor($){super("Edge Function returned a non-2xx status code","FunctionsHttpError",$)}}PT.FunctionsHttpError=ST;var RT;(function($){$.Any="any",$.ApNortheast1="ap-northeast-1",$.ApNortheast2="ap-northeast-2",$.ApSouth1="ap-south-1",$.ApSoutheast1="ap-southeast-1",$.ApSoutheast2="ap-southeast-2",$.CaCentral1="ca-central-1",$.EuCentral1="eu-central-1",$.EuWest1="eu-west-1",$.EuWest2="eu-west-2",$.EuWest3="eu-west-3",$.SaEast1="sa-east-1",$.UsEast1="us-east-1",$.UsWest1="us-west-1",$.UsWest2="us-west-2"})(RT||(PT.FunctionRegion=RT={}))});var kT=I((_T)=>{Object.defineProperty(_T,"__esModule",{value:!0});_T.FunctionsClient=void 0;var oe=H6(),te=ET(),a9=Nq();class CT{constructor($,{headers:D={},customFetch:X,region:J=a9.FunctionRegion.Any}={}){this.url=$,this.headers=D,this.region=J,this.fetch=(0,te.resolveFetch)(X)}setAuth($){this.headers.Authorization=`Bearer ${$}`}invoke($){return oe.__awaiter(this,arguments,void 0,function*(D,X={}){var J;let Y,Q;try{let{headers:G,method:W,body:B,signal:H,timeout:U}=X,K={},{region:q}=X;if(!q)q=this.region;let V=new URL(`${this.url}/${D}`);if(q&&q!=="any")K["x-region"]=q,V.searchParams.set("forceFunctionRegion",q);let z;if(B&&(G&&!Object.prototype.hasOwnProperty.call(G,"Content-Type")||!G))if(typeof Blob<"u"&&B instanceof Blob||B instanceof ArrayBuffer)K["Content-Type"]="application/octet-stream",z=B;else if(typeof B==="string")K["Content-Type"]="text/plain",z=B;else if(typeof FormData<"u"&&B instanceof FormData)z=B;else K["Content-Type"]="application/json",z=JSON.stringify(B);else if(B&&typeof B!=="string"&&!(typeof Blob<"u"&&B instanceof Blob)&&!(B instanceof ArrayBuffer)&&!(typeof FormData<"u"&&B instanceof FormData))z=JSON.stringify(B);else z=B;let w=H;if(U)if(Q=new AbortController,Y=setTimeout(()=>Q.abort(),U),H)w=Q.signal,H.addEventListener("abort",()=>Q.abort());else w=Q.signal;let N=yield this.fetch(V.toString(),{method:W||"POST",headers:Object.assign(Object.assign(Object.assign({},K),this.headers),G),body:z,signal:w}).catch((R)=>{throw new a9.FunctionsFetchError(R)}),L=N.headers.get("x-relay-error");if(L&&L==="true")throw new a9.FunctionsRelayError(N);if(!N.ok)throw new a9.FunctionsHttpError(N);let Z=((J=N.headers.get("Content-Type"))!==null&&J!==void 0?J:"text/plain").split(";")[0].trim(),O;if(Z==="application/json")O=yield N.json();else if(Z==="application/octet-stream"||Z==="application/pdf")O=yield N.blob();else if(Z==="text/event-stream")O=N;else if(Z==="multipart/form-data")O=yield N.formData();else O=yield N.text();return{data:O,error:null,response:N}}catch(G){return{data:null,error:G,response:G instanceof a9.FunctionsHttpError||G instanceof a9.FunctionsRelayError?G.context:void 0}}finally{if(Y)clearTimeout(Y)}})}}_T.FunctionsClient=CT});var bT=I((v4)=>{Object.defineProperty(v4,"__esModule",{value:!0});v4.FunctionRegion=v4.FunctionsRelayError=v4.FunctionsHttpError=v4.FunctionsFetchError=v4.FunctionsError=v4.FunctionsClient=void 0;var se=kT();Object.defineProperty(v4,"FunctionsClient",{enumerable:!0,get:function(){return se.FunctionsClient}});var a7=Nq();Object.defineProperty(v4,"FunctionsError",{enumerable:!0,get:function(){return a7.FunctionsError}});Object.defineProperty(v4,"FunctionsFetchError",{enumerable:!0,get:function(){return a7.FunctionsFetchError}});Object.defineProperty(v4,"FunctionsHttpError",{enumerable:!0,get:function(){return a7.FunctionsHttpError}});Object.defineProperty(v4,"FunctionsRelayError",{enumerable:!0,get:function(){return a7.FunctionsRelayError}});Object.defineProperty(v4,"FunctionRegion",{enumerable:!0,get:function(){return a7.FunctionRegion}})});function o7($){return o7=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(D){return typeof D}:function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D},o7($)}function Y00($,D){if(o7($)!="object"||!$)return $;var X=$[Symbol.toPrimitive];if(X!==void 0){var J=X.call($,D||"default");if(o7(J)!="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return(D==="string"?String:Number)($)}function J00($){var D=Y00($,"string");return o7(D)=="symbol"?D:D+""}function Q00($,D,X){return(D=J00(D))in $?Object.defineProperty($,D,{value:X,enumerable:!0,configurable:!0,writable:!0}):$[D]=X,$}function fT($,D){var X=Object.keys($);if(Object.getOwnPropertySymbols){var J=Object.getOwnPropertySymbols($);D&&(J=J.filter(function(Y){return Object.getOwnPropertyDescriptor($,Y).enumerable})),X.push.apply(X,J)}return X}function wG($){for(var D=1;D<arguments.length;D++){var X=arguments[D]!=null?arguments[D]:{};D%2?fT(Object(X),!0).forEach(function(J){Q00($,J,X[J])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(X)):fT(Object(X)).forEach(function(J){Object.defineProperty($,J,Object.getOwnPropertyDescriptor(X,J))})}return $}var uT,$00=class{constructor($){var D,X,J;if(this.shouldThrowOnError=!1,this.method=$.method,this.url=$.url,this.headers=new Headers($.headers),this.schema=$.schema,this.body=$.body,this.shouldThrowOnError=(D=$.shouldThrowOnError)!==null&&D!==void 0?D:!1,this.signal=$.signal,this.isMaybeSingle=(X=$.isMaybeSingle)!==null&&X!==void 0?X:!1,this.urlLengthLimit=(J=$.urlLengthLimit)!==null&&J!==void 0?J:8000,$.fetch)this.fetch=$.fetch;else this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader($,D){return this.headers=new Headers(this.headers),this.headers.set($,D),this}then($,D){var X=this;if(this.schema===void 0);else if(["GET","HEAD"].includes(this.method))this.headers.set("Accept-Profile",this.schema);else this.headers.set("Content-Profile",this.schema);if(this.method!=="GET"&&this.method!=="HEAD")this.headers.set("Content-Type","application/json");let J=this.fetch,Y=J(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async(Q)=>{let G=null,W=null,B=null,H=Q.status,U=Q.statusText;if(Q.ok){var K,q;if(X.method!=="HEAD"){var V;let L=await Q.text();if(L==="");else if(X.headers.get("Accept")==="text/csv")W=L;else if(X.headers.get("Accept")&&((V=X.headers.get("Accept"))===null||V===void 0?void 0:V.includes("application/vnd.pgrst.plan+text")))W=L;else W=JSON.parse(L)}let w=(K=X.headers.get("Prefer"))===null||K===void 0?void 0:K.match(/count=(exact|planned|estimated)/),N=(q=Q.headers.get("content-range"))===null||q===void 0?void 0:q.split("/");if(w&&N&&N.length>1)B=parseInt(N[1]);if(X.isMaybeSingle&&X.method==="GET"&&Array.isArray(W))if(W.length>1)G={code:"PGRST116",details:`Results contain ${W.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},W=null,B=null,H=406,U="Not Acceptable";else if(W.length===1)W=W[0];else W=null}else{var z;let w=await Q.text();try{if(G=JSON.parse(w),Array.isArray(G)&&Q.status===404)W=[],G=null,H=200,U="OK"}catch(N){if(Q.status===404&&w==="")H=204,U="No Content";else G={message:w}}if(G&&X.isMaybeSingle&&(G===null||G===void 0||(z=G.details)===null||z===void 0?void 0:z.includes("0 rows")))G=null,H=200,U="OK";if(G&&X.shouldThrowOnError)throw new uT(G)}return{error:G,data:W,count:B,status:H,statusText:U}});if(!this.shouldThrowOnError)Y=Y.catch((Q)=>{var G;let W="",B="",H="",U=Q===null||Q===void 0?void 0:Q.cause;if(U){var K,q,V,z;let L=(K=U===null||U===void 0?void 0:U.message)!==null&&K!==void 0?K:"",Z=(q=U===null||U===void 0?void 0:U.code)!==null&&q!==void 0?q:"";if(W=`${(V=Q===null||Q===void 0?void 0:Q.name)!==null&&V!==void 0?V:"FetchError"}: ${Q===null||Q===void 0?void 0:Q.message}`,W+=`
98
+ `)},info:($,D)=>{F.message($,{...D,symbol:J0.default.blue(as)})},success:($,D)=>{F.message($,{...D,symbol:J0.default.green(os)})},step:($,D)=>{F.message($,{...D,symbol:J0.default.green(Dq)})},warn:($,D)=>{F.message($,{...D,symbol:J0.default.yellow(ts)})},warning:($,D)=>{F.warn($,D)},error:($,D)=>{F.message($,{...D,symbol:J0.default.red(ss)})}},Ve=J0.default.magenta,wS0={light:L$("─","-"),heavy:L$("━","="),block:L$("█","#")},NS0=`${J0.default.gray(H$)} `});var _1;var S8=l(()=>{_1={name:"@capgo/cli",type:"module",version:"7.84.9",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLI#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/CLI.git"},bugs:{url:"https://github.com/Cap-go/CLI/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsc --noEmit",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:bundle":"bun test/test-bundle.mjs","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:mcp":"node test/test-mcp.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:payload-split":"bun test/test-payload-split.mjs",test:"bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:credentials && bun run test:credentials-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:esm-sdk && bun run test:mcp && bun run test:version-detection && bun run test:platform-paths && bun run test:payload-split"},devDependencies:{"@antfu/eslint-config":"^7.0.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.4","@capacitor/cli":"^8.0.0","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.0.0","@modelcontextprotocol/sdk":"^1.25.3","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.79.0","@types/adm-zip":"^0.5.7","@types/node":"^25.0.0","@types/prettyjson":"^0.0.33","@types/tmp":"^0.2.6","@vercel/ncc":"^0.38.4","adm-zip":"^0.5.16","ci-info":"^4.3.1",commander:"^14.0.2",eslint:"^9.38.0","git-format-staged":"4.0.1",husky:"^9.1.7","is-wsl":"^3.1.0",micromatch:"^4.0.8",open:"^11.0.0",prettyjson:"^1.2.5",tmp:"^0.2.5","tus-js-client":"^4.3.1",typescript:"^5.9.3",partysocket:"^1.1.11",ws:"^8.18.3",zod:"^4.3.6"}}});var YG=I((VR)=>{Object.defineProperty(VR,"__esModule",{value:!0});VR.isNXMonorepo=VR.isMonorepo=VR.findPackageRelativePathInMonorepo=VR.findPackagePath=VR.findNXMonorepoRoot=VR.findMonorepoRoot=void 0;var l7=r("node:fs"),S4=r("node:path");function XG($){let D=(0,S4.join)($,"package.json"),X=(0,S4.join)($,"pnpm-workspace.yaml");if((0,l7.existsSync)(X)||(0,l7.existsSync)(D)&&JSON.parse((0,l7.readFileSync)(D,"utf-8")).workspaces)return $;let J=(0,S4.dirname)($);if(J===$)throw Error("Monorepo root not found");return XG(J)}VR.findMonorepoRoot=XG;function Jq($){let D=(0,S4.join)($,"nx.json");if((0,l7.existsSync)(D))return $;let X=(0,S4.dirname)($);if(X===$)throw Error("Monorepo root not found");return Jq(X)}VR.findNXMonorepoRoot=Jq;function Qq($,D,X){let J=(0,S4.join)(D,"node_modules",$);if((0,l7.existsSync)(J))return J;if(D===X)return null;let Y=(0,S4.dirname)(D);return Qq($,Y,X)}VR.findPackagePath=Qq;function we($,D){let X=XG(D),J=Qq($,D,X);if(J)return(0,S4.relative)(D,J);return null}VR.findPackageRelativePathInMonorepo=we;function Ne($){try{return XG($),!0}catch(D){return!1}}VR.isMonorepo=Ne;function Oe($){try{return Jq($),!0}catch(D){return!1}}VR.isNXMonorepo=Oe});import{existsSync as G6}from"fs";var c7=($=".",D="unknown")=>{let X=`${$}/bun.lockb`,J=`${$}/bun.lock`,Y=`${$}/pnpm-lock.yaml`,Q=`${$}/shrinkwrap.yaml`,G=`${$}/yarn.lock`,W=`${$}/package-lock.json`,B=`${$}/npm-shrinkwrap.json`;if(G6(X)||G6(J))return"bun";if(G6(Y)||G6(Q))return"pnpm";if(G6(G))return"yarn";if(G6(W)||G6(B))return"npm";return D},JG=($=c7(),D=!1)=>{switch($){case"bun":return D?"bun install":"install";case"pnpm":return D?"pnpm install":"install";case"yarn":return D?"yarn install":"install";case"npm":return D?"npm install":"install";case"unknown":return D?"unknown unknown":"unknown";default:return D?"npm install":"install"}},wR=($=".",D="npx")=>{let X=`${$}/bun.lockb`,J=`${$}/bun.lock`,Y=`${$}/pnpm-lock.yaml`,Q=`${$}/shrinkwrap.yaml`,G=`${$}/yarn.lock`,W=`${$}/package-lock.json`,B=`${$}/npm-shrinkwrap.json`;if(G6(X)||G6(J))return"bunx";if(G6(Y)||G6(Q))return"pnpm exec";if(G6(G))return"yarn dlx";if(G6(W)||G6(B))return"npx";return D};var NR=()=>{};function QG($,D){if(isNaN($)||isNaN(D))throw Error("Cannot compare against non-numbers");return $===D?0:$<D?-1:1}function ZR($=[],D=[]){if($.length&&!D.length)return-1;if(!$.length&&D.length)return 1;return 0}function Wq($=[],D=[]){let X=Math.max($.length,D.length);for(let J=0;J<X;J++){let Y=$[J],Q=D[J];if(Y===void 0&&Q===void 0)return 0;if(Q===void 0)return 1;if(Y===void 0)return-1;if(typeof Y==="string"&&typeof Q==="number")return 1;if(typeof Y==="number"&&typeof Q==="string")return-1;if(Y<Q)return-1;if(Y>Q)return 1}return 0}function Bq($){return typeof $==="number"&&!Number.isNaN($)&&(!Number.isFinite($)||0<=$&&$<=Number.MAX_SAFE_INTEGER)}function W6($){return $.split(".").filter(Boolean).map((D)=>{if(Ie.test(D)){let X=Number(D);if(Bq(X))return X}return D})}function VD($){return $.split(".").filter(Boolean)}function WG($,D){let X=Number($);if(!Bq(X))throw TypeError(D);return X}function cD($){return Number.isNaN($.major)&&Number.isNaN($.minor)&&Number.isNaN($.patch)&&($.prerelease===void 0||$.prerelease.length===0)&&($.build===void 0||$.build.length===0)}var i9="0|[1-9]\\d*",Ee="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Re,OR,MR,LR="[0-9A-Za-z-]+",AR,jR,ER,RR="(?:<|>)?=?",Te="x|X|\\*",Gq,GG,TR,IR,Hq=256,Ie;var M6=l(()=>{Re=`(?<major>${i9})\\.(?<minor>${i9})\\.(?<patch>${i9})`,OR=`(?:${i9}|${Ee})`,MR=`(?:-(?<prerelease>${OR}(?:\\.${OR})*))`,AR=`(?:\\+(?<buildmetadata>${LR}(?:\\.${LR})*))`,jR=`v?${Re}${MR}?${AR}?`,ER=new RegExp(`^${jR}$`),Gq=`${i9}|${Te}`,GG=`[v=\\s]*(?<major>${Gq})(?:\\.(?<minor>${Gq})(?:\\.(?<patch>${Gq})${MR}?${AR}?)?)?`,TR=new RegExp(`^(?<operator>~>?|\\^|${RR})\\s*${GG}$`),IR=new RegExp(`^(?<operator>${RR})\\s*(${jR})$|^$`);Ie=new RegExp(`^${i9}$`)});function c1($,D){if($===D)return 0;return QG($.major,D.major)||QG($.minor,D.minor)||QG($.patch,D.patch)||ZR($.prerelease,D.prerelease)||Wq($.prerelease,D.prerelease)}var k6=l(()=>{M6()});var SR=l(()=>{M6()});function Uq($){return $.toFixed(0)}function B6($){let D=Uq($.major),X=Uq($.minor),J=Uq($.patch),Y=$.prerelease?.join(".")??"",Q=$.build?.join(".")??"";return[[`${D}.${X}.${J}`,Y].filter((B)=>B).join("-"),Q].filter((B)=>B).join("+")}function Se($,D){if(cD(D))return!0;let X=c1($,D);switch(D.operator){case"=":case void 0:return X===0;case"!=":return X!==0;case">":return X>0;case"<":return X<0;case">=":return X>=0;case"<=":return X<=0}}function BG($,D){for(let X of D)if(!Se($,X))return!1;if(!$.prerelease?.length)return!0;for(let X of D){if(cD(X))continue;if(!X.prerelease?.length)continue;let{major:J,minor:Y,patch:Q}=X;if($.major===J&&$.minor===Y&&$.patch===Q)return!0}return!1}var HG=l(()=>{M6();k6()});function d7($,D){return D.some((X)=>BG($,X))}var n7=l(()=>{HG()});function Pe($=[]){let D=[...$],X=D.length;while(X>=0){let J=D[X];if(typeof J==="number"){D[X]=J+1;break}X-=1}if(X===-1)D.push(0);return D}function i7($=[],D){let X=Pe($);if(!D)return X;let J=W6(D);if(J.every((Y)=>typeof Y==="string")){if(J.every((Y,Q)=>Y===X[Q])&&typeof X[J.length]==="number")return X;J=[...J,0]}return J}function P4($,D,X={}){let J=X.build!==void 0?VD(X.build):$.build??[];switch(D){case"premajor":return{major:$.major+1,minor:0,patch:0,prerelease:i7($.prerelease,X.prerelease),build:J};case"preminor":return{major:$.major,minor:$.minor+1,patch:0,prerelease:i7($.prerelease,X.prerelease),build:J};case"prepatch":return{major:$.major,minor:$.minor,patch:$.patch+1,prerelease:i7($.prerelease,X.prerelease),build:J};case"prerelease":{let Q=($.prerelease??[]).length===0?$.patch+1:$.patch;return{major:$.major,minor:$.minor,patch:Q,prerelease:i7($.prerelease,X.prerelease),build:J}}case"major":return{major:($.prerelease??[]).length===0||$.minor!==0||$.patch!==0?$.major+1:$.major,minor:0,patch:0,prerelease:[],build:J};case"minor":{let Q=($.prerelease??[]).length===0||$.patch!==0?$.minor+1:$.minor;return{major:$.major,minor:Q,patch:0,prerelease:[],build:J}}case"patch":{let Q=($.prerelease??[]).length===0?$.patch+1:$.patch;return{major:$.major,minor:$.minor,patch:Q,prerelease:[],build:J}}case"pre":return{major:$.major,minor:$.minor,patch:$.patch,prerelease:i7($.prerelease,X.prerelease),build:J};default:throw TypeError(`Cannot increment version: invalid argument ${D}`)}}var PR=l(()=>{M6()});var UG,p9;var p7=l(()=>{UG={major:Number.NaN,minor:Number.NaN,patch:Number.NaN,prerelease:[],build:[]},p9={operator:void 0,...UG}});var Fq=l(()=>{p7();M6()});function Kq($,D){return c1($,D)>0}var qq=l(()=>{k6()});var vR=l(()=>{n7();qq()});function A6($,D){return c1($,D)<0}var Vq=l(()=>{k6()});var CR=l(()=>{n7();Vq()});function ve($){let X=$.match(IR)?.groups;if(!X)return null;let{operator:J}=X;return{operator:J||void 0,...UG}}function T$($){return!$||$.toLowerCase()==="x"||$==="*"}function Ce($){if(T$($.major))return;if(T$($.minor))return{operator:">=",major:+$.major,minor:0,patch:0,prerelease:[],build:[]};if(T$($.patch))return{operator:">=",major:+$.major,minor:+$.minor,patch:0,prerelease:[],build:[]};return{operator:">=",major:+$.major,minor:+$.minor,patch:+$.patch,prerelease:$.prerelease?W6($.prerelease):[],build:[]}}function _e($){if(T$($.major))return;if(T$($.minor))return{operator:"<",major:+$.major+1,minor:0,patch:0,prerelease:[],build:[]};if(T$($.patch))return{operator:"<",major:+$.major,minor:+$.minor+1,patch:0,prerelease:[],build:[]};if($.prerelease)return{operator:"<=",major:+$.major,minor:+$.minor,patch:+$.patch,prerelease:W6($.prerelease),build:[]};return{operator:"<=",major:+$.major,minor:+$.minor,patch:+$.patch,prerelease:[],build:[]}}function xe($){let D=$.match(new RegExp(`^${GG}`)),X=D?.groups;if(!X)return null;let J=D[0].length,Y=$.slice(J).match(/^\s+-\s+/);if(!Y)return null;let Q=Y[0].length,W=$.slice(J+Q).match(new RegExp(`^${GG}\\s*$`))?.groups,B=Ce(X),H=_e(W);return[B,H].filter(Boolean)}function ke($){let D=T$($.major),X=T$($.minor),J=T$($.patch),Y=+$.major,Q=+$.minor,G=+$.patch;if(D)return[p9];if(X)return[{operator:">=",major:Y,minor:0,patch:0},{operator:"<",major:Y+1,minor:0,patch:0}];if(J){if(Y===0)return[{operator:">=",major:Y,minor:Q,patch:0},{operator:"<",major:Y,minor:Q+1,patch:0}];return[{operator:">=",major:Y,minor:Q,patch:0},{operator:"<",major:Y+1,minor:0,patch:0}]}let W=W6($.prerelease??"");if(Y===0){if(Q===0)return[{operator:">=",major:Y,minor:Q,patch:G,prerelease:W},{operator:"<",major:Y,minor:Q,patch:G+1}];return[{operator:">=",major:Y,minor:Q,patch:G,prerelease:W},{operator:"<",major:Y,minor:Q+1,patch:0}]}return[{operator:">=",major:Y,minor:Q,patch:G,prerelease:W},{operator:"<",major:Y+1,minor:0,patch:0}]}function be($){let D=T$($.major),X=T$($.minor),J=T$($.patch),Y=+$.major,Q=+$.minor,G=+$.patch;if(D)return[p9];if(X)return[{operator:">=",major:Y,minor:0,patch:0},{operator:"<",major:Y+1,minor:0,patch:0}];if(J)return[{operator:">=",major:Y,minor:Q,patch:0},{operator:"<",major:Y,minor:Q+1,patch:0}];let W=W6($.prerelease??"");return[{operator:">=",major:Y,minor:Q,patch:G,prerelease:W},{operator:"<",major:Y,minor:Q+1,patch:0}]}function ye($){let D=T$($.major),X=T$($.minor),J=T$($.patch),Y=+$.major,Q=+$.minor,G=+$.patch;if(D)return[{operator:"<",major:0,minor:0,patch:0}];if(X){if(J)return[{operator:"<",major:Y,minor:0,patch:0}];return[{operator:"<",major:Y,minor:0,patch:0}]}if(J)return[{operator:"<",major:Y,minor:Q,patch:0}];let W=W6($.prerelease??""),B=VD($.build??"");return[{operator:"<",major:Y,minor:Q,patch:G,prerelease:W,build:B}]}function fe($){let D=T$($.minor),X=T$($.patch),J=+$.major,Y=+$.minor,Q=+$.patch;if(D)return[{operator:"<",major:J+1,minor:0,patch:0}];if(X)return[{operator:"<",major:J,minor:Y+1,patch:0}];let G=W6($.prerelease??""),W=VD($.build??"");return[{operator:"<=",major:J,minor:Y,patch:Q,prerelease:G,build:W}]}function ue($){let D=T$($.major),X=T$($.minor),J=T$($.patch),Y=+$.major,Q=+$.minor,G=+$.patch;if(D)return[{operator:"<",major:0,minor:0,patch:0}];if(X)return[{operator:">=",major:Y+1,minor:0,patch:0}];if(J)return[{operator:">=",major:Y,minor:Q+1,patch:0}];let W=W6($.prerelease??""),B=VD($.build??"");return[{operator:">",major:Y,minor:Q,patch:G,prerelease:W,build:B}]}function ge($){let D=T$($.major),X=T$($.minor),J=T$($.patch),Y=+$.major,Q=+$.minor,G=+$.patch;if(D)return[p9];if(X)return[{operator:">=",major:Y,minor:0,patch:0}];if(J)return[{operator:">=",major:Y,minor:Q,patch:0}];let W=W6($.prerelease??""),B=VD($.build??"");return[{operator:">=",major:Y,minor:Q,patch:G,prerelease:W,build:B}]}function he($){let D=T$($.major),X=T$($.minor),J=T$($.patch),Y=+$.major,Q=+$.minor,G=+$.patch;if(D)return[p9];if(X)return[{operator:">=",major:Y,minor:0,patch:0},{operator:"<",major:Y+1,minor:0,patch:0}];if(J)return[{operator:">=",major:Y,minor:Q,patch:0},{operator:"<",major:Y,minor:Q+1,patch:0}];let W=W6($.prerelease??""),B=VD($.build??"");return[{operator:$.operator==="="?"=":void 0,major:Y,minor:Q,patch:G,prerelease:W,build:B}]}function me($){let D=$.match(TR)?.groups;if(!D)return ve($);switch(D.operator){case"^":return ke(D);case"~":case"~>":return be(D);case"<":return ye(D);case"<=":return fe(D);case">":return ue(D);case">=":return ge(D);default:return he(D)}}function le($){return $.split(/\s+/).flatMap(me)}function FG($){let D=$.replaceAll(/(?<=[<>=~^])(\s+)/g,"").split(/\s*\|\|\s*/).map((X)=>xe(X)||le(X));if(D.some((X)=>X.includes(null)))throw TypeError(`Cannot parse version range: range "${$}" is invalid`);return D}var zq=l(()=>{M6();p7()});function d0($){if(typeof $!=="string")throw TypeError(`Cannot parse version as version must be a string: received ${typeof $}`);if($.length>Hq)throw TypeError(`Cannot parse version as version length is too long: length is ${$.length}, max length is ${Hq}`);$=$.trim();let D=$.match(ER)?.groups;if(!D)throw TypeError(`Cannot parse version: ${$}`);let X=WG(D.major,`Cannot parse version ${$}: invalid major version`),J=WG(D.minor,`Cannot parse version ${$}: invalid minor version`),Y=WG(D.patch,`Cannot parse version ${$}: invalid patch version`),Q=D.prerelease?W6(D.prerelease):[],G=D.buildmetadata?VD(D.buildmetadata):[];return{major:X,minor:J,patch:Y,prerelease:Q,build:G}}var KG=l(()=>{M6();M6()});function _R($,D){let X=$.operator,J=D.operator;if(X===void 0){if(cD($))return!0;return d7($,[[D]])}if(J===void 0){if(cD(D))return!0;return d7(D,[[$]])}let Y=c1($,D);return(X===">="||X===">")&&(J===">="||J===">")||(X==="<="||X==="<")&&(J==="<="||J==="<")||Y===0&&((X===">="||X==="<=")&&(J===">="||J==="<="))||Y===-1&&(X===">="||X===">")&&(J==="<="||J==="<")||Y===1&&(X==="<="||X==="<")&&(J===">="||J===">")}function ce($){return $.every((D)=>{return D.some((X)=>de(X))})}function de($){for(let D=0;D<$.length-1;D++){let X=$[D];for(let J of $.slice(D+1))if(!_R(X,J))return!1}return!0}function xR($,D){return ce([$,D])&&$.some((X)=>{return D.some((J)=>{return X.every((Y)=>{return J.every((Q)=>_R(Y,Q))})})})}var kR=l(()=>{M6();k6();n7()});var bR=l(()=>{zq()});var yR=l(()=>{p7();p7();Fq()});function fR($){try{return d0($),!0}catch{return!1}}var uR=l(()=>{KG()});var gR=l(()=>{KG()});var hR=l(()=>{M6()});var mR=l(()=>{k6()});var lR=l(()=>{k6()});var cR=l(()=>{HG();M6();k6()});function dR($,D){return c1($,D)>=0}var nR=l(()=>{k6()});var iR=l(()=>{HG();M6();k6()});var pR=l(()=>{k6()});var zD=l(()=>{k6();SR();n7();PR();Fq();vR();CR();zq();KG();kR();bR();yR();uR();gR();hR();mR();lR();qq();cR();nR();Vq();iR();pR()});var H6=I((Fv0,zG)=>{var rR,aR,oR,tR,sR,eR,$T,DT,XT,YT,JT,QT,GT,qG,wq,WT,BT,HT,r9,UT,FT,KT,qT,VT,zT,wT,NT,OT,VG,LT,ZT,MT;(function($){var D=typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:{};if(typeof define==="function"&&define.amd)define("tslib",["exports"],function(J){$(X(D,X(J)))});else if(typeof zG==="object"&&typeof Fv0==="object")$(X(D,X(Fv0)));else $(X(D));function X(J,Y){if(J!==D)if(typeof Object.create==="function")Object.defineProperty(J,"__esModule",{value:!0});else J.__esModule=!0;return function(Q,G){return J[Q]=Y?Y(Q,G):G}}})(function($){var D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Q,G){Q.__proto__=G}||function(Q,G){for(var W in G)if(Object.prototype.hasOwnProperty.call(G,W))Q[W]=G[W]};rR=function(Q,G){if(typeof G!=="function"&&G!==null)throw TypeError("Class extends value "+String(G)+" is not a constructor or null");D(Q,G);function W(){this.constructor=Q}Q.prototype=G===null?Object.create(G):(W.prototype=G.prototype,new W)},aR=Object.assign||function(Q){for(var G,W=1,B=arguments.length;W<B;W++){G=arguments[W];for(var H in G)if(Object.prototype.hasOwnProperty.call(G,H))Q[H]=G[H]}return Q},oR=function(Q,G){var W={};for(var B in Q)if(Object.prototype.hasOwnProperty.call(Q,B)&&G.indexOf(B)<0)W[B]=Q[B];if(Q!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var H=0,B=Object.getOwnPropertySymbols(Q);H<B.length;H++)if(G.indexOf(B[H])<0&&Object.prototype.propertyIsEnumerable.call(Q,B[H]))W[B[H]]=Q[B[H]]}return W},tR=function(Q,G,W,B){var H=arguments.length,U=H<3?G:B===null?B=Object.getOwnPropertyDescriptor(G,W):B,K;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")U=Reflect.decorate(Q,G,W,B);else for(var q=Q.length-1;q>=0;q--)if(K=Q[q])U=(H<3?K(U):H>3?K(G,W,U):K(G,W))||U;return H>3&&U&&Object.defineProperty(G,W,U),U},sR=function(Q,G){return function(W,B){G(W,B,Q)}},eR=function(Q,G,W,B,H,U){function K(v){if(v!==void 0&&typeof v!=="function")throw TypeError("Function expected");return v}var q=B.kind,V=q==="getter"?"get":q==="setter"?"set":"value",z=!G&&Q?B.static?Q:Q.prototype:null,w=G||(z?Object.getOwnPropertyDescriptor(z,B.name):{}),N,L=!1;for(var Z=W.length-1;Z>=0;Z--){var O={};for(var R in B)O[R]=R==="access"?{}:B[R];for(var R in B.access)O.access[R]=B.access[R];O.addInitializer=function(v){if(L)throw TypeError("Cannot add initializers after decoration has completed");U.push(K(v||null))};var E=(0,W[Z])(q==="accessor"?{get:w.get,set:w.set}:w[V],O);if(q==="accessor"){if(E===void 0)continue;if(E===null||typeof E!=="object")throw TypeError("Object expected");if(N=K(E.get))w.get=N;if(N=K(E.set))w.set=N;if(N=K(E.init))H.unshift(N)}else if(N=K(E))if(q==="field")H.unshift(N);else w[V]=N}if(z)Object.defineProperty(z,B.name,w);L=!0},$T=function(Q,G,W){var B=arguments.length>2;for(var H=0;H<G.length;H++)W=B?G[H].call(Q,W):G[H].call(Q);return B?W:void 0},DT=function(Q){return typeof Q==="symbol"?Q:"".concat(Q)},XT=function(Q,G,W){if(typeof G==="symbol")G=G.description?"[".concat(G.description,"]"):"";return Object.defineProperty(Q,"name",{configurable:!0,value:W?"".concat(W," ",G):G})},YT=function(Q,G){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(Q,G)},JT=function(Q,G,W,B){function H(U){return U instanceof W?U:new W(function(K){K(U)})}return new(W||(W=Promise))(function(U,K){function q(w){try{z(B.next(w))}catch(N){K(N)}}function V(w){try{z(B.throw(w))}catch(N){K(N)}}function z(w){w.done?U(w.value):H(w.value).then(q,V)}z((B=B.apply(Q,G||[])).next())})},QT=function(Q,G){var W={label:0,sent:function(){if(U[0]&1)throw U[1];return U[1]},trys:[],ops:[]},B,H,U,K=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return K.next=q(0),K.throw=q(1),K.return=q(2),typeof Symbol==="function"&&(K[Symbol.iterator]=function(){return this}),K;function q(z){return function(w){return V([z,w])}}function V(z){if(B)throw TypeError("Generator is already executing.");while(K&&(K=0,z[0]&&(W=0)),W)try{if(B=1,H&&(U=z[0]&2?H.return:z[0]?H.throw||((U=H.return)&&U.call(H),0):H.next)&&!(U=U.call(H,z[1])).done)return U;if(H=0,U)z=[z[0]&2,U.value];switch(z[0]){case 0:case 1:U=z;break;case 4:return W.label++,{value:z[1],done:!1};case 5:W.label++,H=z[1],z=[0];continue;case 7:z=W.ops.pop(),W.trys.pop();continue;default:if((U=W.trys,!(U=U.length>0&&U[U.length-1]))&&(z[0]===6||z[0]===2)){W=0;continue}if(z[0]===3&&(!U||z[1]>U[0]&&z[1]<U[3])){W.label=z[1];break}if(z[0]===6&&W.label<U[1]){W.label=U[1],U=z;break}if(U&&W.label<U[2]){W.label=U[2],W.ops.push(z);break}if(U[2])W.ops.pop();W.trys.pop();continue}z=G.call(Q,W)}catch(w){z=[6,w],H=0}finally{B=U=0}if(z[0]&5)throw z[1];return{value:z[0]?z[1]:void 0,done:!0}}},GT=function(Q,G){for(var W in Q)if(W!=="default"&&!Object.prototype.hasOwnProperty.call(G,W))VG(G,Q,W)},VG=Object.create?function(Q,G,W,B){if(B===void 0)B=W;var H=Object.getOwnPropertyDescriptor(G,W);if(!H||("get"in H?!G.__esModule:H.writable||H.configurable))H={enumerable:!0,get:function(){return G[W]}};Object.defineProperty(Q,B,H)}:function(Q,G,W,B){if(B===void 0)B=W;Q[B]=G[W]},qG=function(Q){var G=typeof Symbol==="function"&&Symbol.iterator,W=G&&Q[G],B=0;if(W)return W.call(Q);if(Q&&typeof Q.length==="number")return{next:function(){if(Q&&B>=Q.length)Q=void 0;return{value:Q&&Q[B++],done:!Q}}};throw TypeError(G?"Object is not iterable.":"Symbol.iterator is not defined.")},wq=function(Q,G){var W=typeof Symbol==="function"&&Q[Symbol.iterator];if(!W)return Q;var B=W.call(Q),H,U=[],K;try{while((G===void 0||G-- >0)&&!(H=B.next()).done)U.push(H.value)}catch(q){K={error:q}}finally{try{if(H&&!H.done&&(W=B.return))W.call(B)}finally{if(K)throw K.error}}return U},WT=function(){for(var Q=[],G=0;G<arguments.length;G++)Q=Q.concat(wq(arguments[G]));return Q},BT=function(){for(var Q=0,G=0,W=arguments.length;G<W;G++)Q+=arguments[G].length;for(var B=Array(Q),H=0,G=0;G<W;G++)for(var U=arguments[G],K=0,q=U.length;K<q;K++,H++)B[H]=U[K];return B},HT=function(Q,G,W){if(W||arguments.length===2){for(var B=0,H=G.length,U;B<H;B++)if(U||!(B in G)){if(!U)U=Array.prototype.slice.call(G,0,B);U[B]=G[B]}}return Q.concat(U||Array.prototype.slice.call(G))},r9=function(Q){return this instanceof r9?(this.v=Q,this):new r9(Q)},UT=function(Q,G,W){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var B=W.apply(Q,G||[]),H,U=[];return H=Object.create((typeof AsyncIterator==="function"?AsyncIterator:Object).prototype),q("next"),q("throw"),q("return",K),H[Symbol.asyncIterator]=function(){return this},H;function K(Z){return function(O){return Promise.resolve(O).then(Z,N)}}function q(Z,O){if(B[Z]){if(H[Z]=function(R){return new Promise(function(E,v){U.push([Z,R,E,v])>1||V(Z,R)})},O)H[Z]=O(H[Z])}}function V(Z,O){try{z(B[Z](O))}catch(R){L(U[0][3],R)}}function z(Z){Z.value instanceof r9?Promise.resolve(Z.value.v).then(w,N):L(U[0][2],Z)}function w(Z){V("next",Z)}function N(Z){V("throw",Z)}function L(Z,O){if(Z(O),U.shift(),U.length)V(U[0][0],U[0][1])}},FT=function(Q){var G,W;return G={},B("next"),B("throw",function(H){throw H}),B("return"),G[Symbol.iterator]=function(){return this},G;function B(H,U){G[H]=Q[H]?function(K){return(W=!W)?{value:r9(Q[H](K)),done:!1}:U?U(K):K}:U}},KT=function(Q){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var G=Q[Symbol.asyncIterator],W;return G?G.call(Q):(Q=typeof qG==="function"?qG(Q):Q[Symbol.iterator](),W={},B("next"),B("throw"),B("return"),W[Symbol.asyncIterator]=function(){return this},W);function B(U){W[U]=Q[U]&&function(K){return new Promise(function(q,V){K=Q[U](K),H(q,V,K.done,K.value)})}}function H(U,K,q,V){Promise.resolve(V).then(function(z){U({value:z,done:q})},K)}},qT=function(Q,G){if(Object.defineProperty)Object.defineProperty(Q,"raw",{value:G});else Q.raw=G;return Q};var X=Object.create?function(Q,G){Object.defineProperty(Q,"default",{enumerable:!0,value:G})}:function(Q,G){Q.default=G},J=function(Q){return J=Object.getOwnPropertyNames||function(G){var W=[];for(var B in G)if(Object.prototype.hasOwnProperty.call(G,B))W[W.length]=B;return W},J(Q)};VT=function(Q){if(Q&&Q.__esModule)return Q;var G={};if(Q!=null){for(var W=J(Q),B=0;B<W.length;B++)if(W[B]!=="default")VG(G,Q,W[B])}return X(G,Q),G},zT=function(Q){return Q&&Q.__esModule?Q:{default:Q}},wT=function(Q,G,W,B){if(W==="a"&&!B)throw TypeError("Private accessor was defined without a getter");if(typeof G==="function"?Q!==G||!B:!G.has(Q))throw TypeError("Cannot read private member from an object whose class did not declare it");return W==="m"?B:W==="a"?B.call(Q):B?B.value:G.get(Q)},NT=function(Q,G,W,B,H){if(B==="m")throw TypeError("Private method is not writable");if(B==="a"&&!H)throw TypeError("Private accessor was defined without a setter");if(typeof G==="function"?Q!==G||!H:!G.has(Q))throw TypeError("Cannot write private member to an object whose class did not declare it");return B==="a"?H.call(Q,W):H?H.value=W:G.set(Q,W),W},OT=function(Q,G){if(G===null||typeof G!=="object"&&typeof G!=="function")throw TypeError("Cannot use 'in' operator on non-object");return typeof Q==="function"?G===Q:Q.has(G)},LT=function(Q,G,W){if(G!==null&&G!==void 0){if(typeof G!=="object"&&typeof G!=="function")throw TypeError("Object expected.");var B,H;if(W){if(!Symbol.asyncDispose)throw TypeError("Symbol.asyncDispose is not defined.");B=G[Symbol.asyncDispose]}if(B===void 0){if(!Symbol.dispose)throw TypeError("Symbol.dispose is not defined.");if(B=G[Symbol.dispose],W)H=B}if(typeof B!=="function")throw TypeError("Object not disposable.");if(H)B=function(){try{H.call(this)}catch(U){return Promise.reject(U)}};Q.stack.push({value:G,dispose:B,async:W})}else if(W)Q.stack.push({async:!0});return G};var Y=typeof SuppressedError==="function"?SuppressedError:function(Q,G,W){var B=Error(W);return B.name="SuppressedError",B.error=Q,B.suppressed=G,B};ZT=function(Q){function G(U){Q.error=Q.hasError?new Y(U,Q.error,"An error was suppressed during disposal."):U,Q.hasError=!0}var W,B=0;function H(){while(W=Q.stack.pop())try{if(!W.async&&B===1)return B=0,Q.stack.push(W),Promise.resolve().then(H);if(W.dispose){var U=W.dispose.call(W.value);if(W.async)return B|=2,Promise.resolve(U).then(H,function(K){return G(K),H()})}else B|=1}catch(K){G(K)}if(B===1)return Q.hasError?Promise.reject(Q.error):Promise.resolve();if(Q.hasError)throw Q.error}return H()},MT=function(Q,G){if(typeof Q==="string"&&/^\.\.?\//.test(Q))return Q.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(W,B,H,U,K){return B?G?".jsx":".js":H&&(!U||!K)?W:H+U+"."+K.toLowerCase()+"js"});return Q},$("__extends",rR),$("__assign",aR),$("__rest",oR),$("__decorate",tR),$("__param",sR),$("__esDecorate",eR),$("__runInitializers",$T),$("__propKey",DT),$("__setFunctionName",XT),$("__metadata",YT),$("__awaiter",JT),$("__generator",QT),$("__exportStar",GT),$("__createBinding",VG),$("__values",qG),$("__read",wq),$("__spread",WT),$("__spreadArrays",BT),$("__spreadArray",HT),$("__await",r9),$("__asyncGenerator",UT),$("__asyncDelegator",FT),$("__asyncValues",KT),$("__makeTemplateObject",qT),$("__importStar",VT),$("__importDefault",zT),$("__classPrivateFieldGet",wT),$("__classPrivateFieldSet",NT),$("__classPrivateFieldIn",OT),$("__addDisposableResource",LT),$("__disposeResources",ZT),$("__rewriteRelativeImportExtension",MT)})});var ET=I((AT)=>{Object.defineProperty(AT,"__esModule",{value:!0});AT.resolveFetch=void 0;var ne=($)=>{if($)return(...D)=>$(...D);return(...D)=>fetch(...D)};AT.resolveFetch=ne});var Nq=I((PT)=>{Object.defineProperty(PT,"__esModule",{value:!0});PT.FunctionRegion=PT.FunctionsHttpError=PT.FunctionsRelayError=PT.FunctionsFetchError=PT.FunctionsError=void 0;class r7 extends Error{constructor($,D="FunctionsError",X){super($);this.name=D,this.context=X}}PT.FunctionsError=r7;class TT extends r7{constructor($){super("Failed to send a request to the Edge Function","FunctionsFetchError",$)}}PT.FunctionsFetchError=TT;class IT extends r7{constructor($){super("Relay Error invoking the Edge Function","FunctionsRelayError",$)}}PT.FunctionsRelayError=IT;class ST extends r7{constructor($){super("Edge Function returned a non-2xx status code","FunctionsHttpError",$)}}PT.FunctionsHttpError=ST;var RT;(function($){$.Any="any",$.ApNortheast1="ap-northeast-1",$.ApNortheast2="ap-northeast-2",$.ApSouth1="ap-south-1",$.ApSoutheast1="ap-southeast-1",$.ApSoutheast2="ap-southeast-2",$.CaCentral1="ca-central-1",$.EuCentral1="eu-central-1",$.EuWest1="eu-west-1",$.EuWest2="eu-west-2",$.EuWest3="eu-west-3",$.SaEast1="sa-east-1",$.UsEast1="us-east-1",$.UsWest1="us-west-1",$.UsWest2="us-west-2"})(RT||(PT.FunctionRegion=RT={}))});var kT=I((_T)=>{Object.defineProperty(_T,"__esModule",{value:!0});_T.FunctionsClient=void 0;var oe=H6(),te=ET(),a9=Nq();class CT{constructor($,{headers:D={},customFetch:X,region:J=a9.FunctionRegion.Any}={}){this.url=$,this.headers=D,this.region=J,this.fetch=(0,te.resolveFetch)(X)}setAuth($){this.headers.Authorization=`Bearer ${$}`}invoke($){return oe.__awaiter(this,arguments,void 0,function*(D,X={}){var J;let Y,Q;try{let{headers:G,method:W,body:B,signal:H,timeout:U}=X,K={},{region:q}=X;if(!q)q=this.region;let V=new URL(`${this.url}/${D}`);if(q&&q!=="any")K["x-region"]=q,V.searchParams.set("forceFunctionRegion",q);let z;if(B&&(G&&!Object.prototype.hasOwnProperty.call(G,"Content-Type")||!G))if(typeof Blob<"u"&&B instanceof Blob||B instanceof ArrayBuffer)K["Content-Type"]="application/octet-stream",z=B;else if(typeof B==="string")K["Content-Type"]="text/plain",z=B;else if(typeof FormData<"u"&&B instanceof FormData)z=B;else K["Content-Type"]="application/json",z=JSON.stringify(B);else if(B&&typeof B!=="string"&&!(typeof Blob<"u"&&B instanceof Blob)&&!(B instanceof ArrayBuffer)&&!(typeof FormData<"u"&&B instanceof FormData))z=JSON.stringify(B);else z=B;let w=H;if(U)if(Q=new AbortController,Y=setTimeout(()=>Q.abort(),U),H)w=Q.signal,H.addEventListener("abort",()=>Q.abort());else w=Q.signal;let N=yield this.fetch(V.toString(),{method:W||"POST",headers:Object.assign(Object.assign(Object.assign({},K),this.headers),G),body:z,signal:w}).catch((R)=>{throw new a9.FunctionsFetchError(R)}),L=N.headers.get("x-relay-error");if(L&&L==="true")throw new a9.FunctionsRelayError(N);if(!N.ok)throw new a9.FunctionsHttpError(N);let Z=((J=N.headers.get("Content-Type"))!==null&&J!==void 0?J:"text/plain").split(";")[0].trim(),O;if(Z==="application/json")O=yield N.json();else if(Z==="application/octet-stream"||Z==="application/pdf")O=yield N.blob();else if(Z==="text/event-stream")O=N;else if(Z==="multipart/form-data")O=yield N.formData();else O=yield N.text();return{data:O,error:null,response:N}}catch(G){return{data:null,error:G,response:G instanceof a9.FunctionsHttpError||G instanceof a9.FunctionsRelayError?G.context:void 0}}finally{if(Y)clearTimeout(Y)}})}}_T.FunctionsClient=CT});var bT=I((v4)=>{Object.defineProperty(v4,"__esModule",{value:!0});v4.FunctionRegion=v4.FunctionsRelayError=v4.FunctionsHttpError=v4.FunctionsFetchError=v4.FunctionsError=v4.FunctionsClient=void 0;var se=kT();Object.defineProperty(v4,"FunctionsClient",{enumerable:!0,get:function(){return se.FunctionsClient}});var a7=Nq();Object.defineProperty(v4,"FunctionsError",{enumerable:!0,get:function(){return a7.FunctionsError}});Object.defineProperty(v4,"FunctionsFetchError",{enumerable:!0,get:function(){return a7.FunctionsFetchError}});Object.defineProperty(v4,"FunctionsHttpError",{enumerable:!0,get:function(){return a7.FunctionsHttpError}});Object.defineProperty(v4,"FunctionsRelayError",{enumerable:!0,get:function(){return a7.FunctionsRelayError}});Object.defineProperty(v4,"FunctionRegion",{enumerable:!0,get:function(){return a7.FunctionRegion}})});function o7($){return o7=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(D){return typeof D}:function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D},o7($)}function Y00($,D){if(o7($)!="object"||!$)return $;var X=$[Symbol.toPrimitive];if(X!==void 0){var J=X.call($,D||"default");if(o7(J)!="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return(D==="string"?String:Number)($)}function J00($){var D=Y00($,"string");return o7(D)=="symbol"?D:D+""}function Q00($,D,X){return(D=J00(D))in $?Object.defineProperty($,D,{value:X,enumerable:!0,configurable:!0,writable:!0}):$[D]=X,$}function fT($,D){var X=Object.keys($);if(Object.getOwnPropertySymbols){var J=Object.getOwnPropertySymbols($);D&&(J=J.filter(function(Y){return Object.getOwnPropertyDescriptor($,Y).enumerable})),X.push.apply(X,J)}return X}function wG($){for(var D=1;D<arguments.length;D++){var X=arguments[D]!=null?arguments[D]:{};D%2?fT(Object(X),!0).forEach(function(J){Q00($,J,X[J])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(X)):fT(Object(X)).forEach(function(J){Object.defineProperty($,J,Object.getOwnPropertyDescriptor(X,J))})}return $}var uT,$00=class{constructor($){var D,X,J;if(this.shouldThrowOnError=!1,this.method=$.method,this.url=$.url,this.headers=new Headers($.headers),this.schema=$.schema,this.body=$.body,this.shouldThrowOnError=(D=$.shouldThrowOnError)!==null&&D!==void 0?D:!1,this.signal=$.signal,this.isMaybeSingle=(X=$.isMaybeSingle)!==null&&X!==void 0?X:!1,this.urlLengthLimit=(J=$.urlLengthLimit)!==null&&J!==void 0?J:8000,$.fetch)this.fetch=$.fetch;else this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader($,D){return this.headers=new Headers(this.headers),this.headers.set($,D),this}then($,D){var X=this;if(this.schema===void 0);else if(["GET","HEAD"].includes(this.method))this.headers.set("Accept-Profile",this.schema);else this.headers.set("Content-Profile",this.schema);if(this.method!=="GET"&&this.method!=="HEAD")this.headers.set("Content-Type","application/json");let J=this.fetch,Y=J(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async(Q)=>{let G=null,W=null,B=null,H=Q.status,U=Q.statusText;if(Q.ok){var K,q;if(X.method!=="HEAD"){var V;let L=await Q.text();if(L==="");else if(X.headers.get("Accept")==="text/csv")W=L;else if(X.headers.get("Accept")&&((V=X.headers.get("Accept"))===null||V===void 0?void 0:V.includes("application/vnd.pgrst.plan+text")))W=L;else W=JSON.parse(L)}let w=(K=X.headers.get("Prefer"))===null||K===void 0?void 0:K.match(/count=(exact|planned|estimated)/),N=(q=Q.headers.get("content-range"))===null||q===void 0?void 0:q.split("/");if(w&&N&&N.length>1)B=parseInt(N[1]);if(X.isMaybeSingle&&X.method==="GET"&&Array.isArray(W))if(W.length>1)G={code:"PGRST116",details:`Results contain ${W.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},W=null,B=null,H=406,U="Not Acceptable";else if(W.length===1)W=W[0];else W=null}else{var z;let w=await Q.text();try{if(G=JSON.parse(w),Array.isArray(G)&&Q.status===404)W=[],G=null,H=200,U="OK"}catch(N){if(Q.status===404&&w==="")H=204,U="No Content";else G={message:w}}if(G&&X.isMaybeSingle&&(G===null||G===void 0||(z=G.details)===null||z===void 0?void 0:z.includes("0 rows")))G=null,H=200,U="OK";if(G&&X.shouldThrowOnError)throw new uT(G)}return{error:G,data:W,count:B,status:H,statusText:U}});if(!this.shouldThrowOnError)Y=Y.catch((Q)=>{var G;let W="",B="",H="",U=Q===null||Q===void 0?void 0:Q.cause;if(U){var K,q,V,z;let L=(K=U===null||U===void 0?void 0:U.message)!==null&&K!==void 0?K:"",Z=(q=U===null||U===void 0?void 0:U.code)!==null&&q!==void 0?q:"";if(W=`${(V=Q===null||Q===void 0?void 0:Q.name)!==null&&V!==void 0?V:"FetchError"}: ${Q===null||Q===void 0?void 0:Q.message}`,W+=`
99
99
 
100
100
  Caused by: ${(z=U===null||U===void 0?void 0:U.name)!==null&&z!==void 0?z:"Error"}: ${L}`,Z)W+=` (${Z})`;if(U===null||U===void 0?void 0:U.stack)W+=`
101
101
  ${U.stack}`}else{var w;W=(w=Q===null||Q===void 0?void 0:Q.stack)!==null&&w!==void 0?w:""}let N=this.url.toString().length;if((Q===null||Q===void 0?void 0:Q.name)==="AbortError"||(Q===null||Q===void 0?void 0:Q.code)==="ABORT_ERR"){if(H="",B="Request was aborted (timeout or manual cancellation)",N>this.urlLengthLimit)B+=`. Note: Your request URL is ${N} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`}else if((U===null||U===void 0?void 0:U.name)==="HeadersOverflowError"||(U===null||U===void 0?void 0:U.code)==="UND_ERR_HEADERS_OVERFLOW"){if(H="",B="HTTP headers exceeded server limits (typically 16KB)",N>this.urlLengthLimit)B+=`. Your request URL is ${N} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`}return{error:{message:`${(G=Q===null||Q===void 0?void 0:Q.name)!==null&&G!==void 0?G:"FetchError"}: ${Q===null||Q===void 0?void 0:Q.message}`,details:W,hint:B,code:H},data:null,count:null,status:0,statusText:""}});return Y.then($,D)}returns(){return this}overrideTypes(){return this}},D00,yT,o9,X00=class{constructor($,{headers:D={},schema:X,fetch:J,urlLengthLimit:Y=8000}){this.url=$,this.headers=new Headers(D),this.schema=X,this.fetch=J,this.urlLengthLimit=Y}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select($,D){let{head:X=!1,count:J}=D!==null&&D!==void 0?D:{},Y=X?"HEAD":"GET",Q=!1,G=($!==null&&$!==void 0?$:"*").split("").map((H)=>{if(/\s/.test(H)&&!Q)return"";if(H==='"')Q=!Q;return H}).join(""),{url:W,headers:B}=this.cloneRequestState();if(W.searchParams.set("select",G),J)B.append("Prefer",`count=${J}`);return new o9({method:Y,url:W,headers:B,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}insert($,{count:D,defaultToNull:X=!0}={}){var J;let Y="POST",{url:Q,headers:G}=this.cloneRequestState();if(D)G.append("Prefer",`count=${D}`);if(!X)G.append("Prefer","missing=default");if(Array.isArray($)){let W=$.reduce((B,H)=>B.concat(Object.keys(H)),[]);if(W.length>0){let B=[...new Set(W)].map((H)=>`"${H}"`);Q.searchParams.set("columns",B.join(","))}}return new o9({method:"POST",url:Q,headers:G,schema:this.schema,body:$,fetch:(J=this.fetch)!==null&&J!==void 0?J:fetch,urlLengthLimit:this.urlLengthLimit})}upsert($,{onConflict:D,ignoreDuplicates:X=!1,count:J,defaultToNull:Y=!0}={}){var Q;let G="POST",{url:W,headers:B}=this.cloneRequestState();if(B.append("Prefer",`resolution=${X?"ignore":"merge"}-duplicates`),D!==void 0)W.searchParams.set("on_conflict",D);if(J)B.append("Prefer",`count=${J}`);if(!Y)B.append("Prefer","missing=default");if(Array.isArray($)){let H=$.reduce((U,K)=>U.concat(Object.keys(K)),[]);if(H.length>0){let U=[...new Set(H)].map((K)=>`"${K}"`);W.searchParams.set("columns",U.join(","))}}return new o9({method:"POST",url:W,headers:B,schema:this.schema,body:$,fetch:(Q=this.fetch)!==null&&Q!==void 0?Q:fetch,urlLengthLimit:this.urlLengthLimit})}update($,{count:D}={}){var X;let J="PATCH",{url:Y,headers:Q}=this.cloneRequestState();if(D)Q.append("Prefer",`count=${D}`);return new o9({method:"PATCH",url:Y,headers:Q,schema:this.schema,body:$,fetch:(X=this.fetch)!==null&&X!==void 0?X:fetch,urlLengthLimit:this.urlLengthLimit})}delete({count:$}={}){var D;let X="DELETE",{url:J,headers:Y}=this.cloneRequestState();if($)Y.append("Prefer",`count=${$}`);return new o9({method:"DELETE",url:J,headers:Y,schema:this.schema,fetch:(D=this.fetch)!==null&&D!==void 0?D:fetch,urlLengthLimit:this.urlLengthLimit})}},gT=class ${constructor(D,{headers:X={},schema:J,fetch:Y,timeout:Q,urlLengthLimit:G=8000}={}){this.url=D,this.headers=new Headers(X),this.schemaName=J,this.urlLengthLimit=G;let W=Y!==null&&Y!==void 0?Y:globalThis.fetch;if(Q!==void 0&&Q>0)this.fetch=(B,H)=>{let U=new AbortController,K=setTimeout(()=>U.abort(),Q),q=H===null||H===void 0?void 0:H.signal;if(q){if(q.aborted)return clearTimeout(K),W(B,H);let V=()=>{clearTimeout(K),U.abort()};return q.addEventListener("abort",V,{once:!0}),W(B,wG(wG({},H),{},{signal:U.signal})).finally(()=>{clearTimeout(K),q.removeEventListener("abort",V)})}return W(B,wG(wG({},H),{},{signal:U.signal})).finally(()=>clearTimeout(K))};else this.fetch=W}from(D){if(!D||typeof D!=="string"||D.trim()==="")throw Error("Invalid relation name: relation must be a non-empty string.");return new X00(new URL(`${this.url}/${D}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}schema(D){return new $(this.url,{headers:this.headers,schema:D,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}rpc(D,X={},{head:J=!1,get:Y=!1,count:Q}={}){var G;let W,B=new URL(`${this.url}/rpc/${D}`),H,U=(V)=>V!==null&&typeof V==="object"&&(!Array.isArray(V)||V.some(U)),K=J&&Object.values(X).some(U);if(K)W="POST",H=X;else if(J||Y)W=J?"HEAD":"GET",Object.entries(X).filter(([V,z])=>z!==void 0).map(([V,z])=>[V,Array.isArray(z)?`{${z.join(",")}}`:`${z}`]).forEach(([V,z])=>{B.searchParams.append(V,z)});else W="POST",H=X;let q=new Headers(this.headers);if(K)q.set("Prefer",Q?`count=${Q},return=minimal`:"return=minimal");else if(Q)q.set("Prefer",`count=${Q}`);return new o9({method:W,url:B,headers:q,schema:this.schemaName,body:H,fetch:(G=this.fetch)!==null&&G!==void 0?G:fetch,urlLengthLimit:this.urlLengthLimit})}};var hT=l(()=>{uT=class extends Error{constructor($){super($.message);this.name="PostgrestError",this.details=$.details,this.hint=$.hint,this.code=$.code}},D00=class extends $00{select($){let D=!1,X=($!==null&&$!==void 0?$:"*").split("").map((J)=>{if(/\s/.test(J)&&!D)return"";if(J==='"')D=!D;return J}).join("");return this.url.searchParams.set("select",X),this.headers.append("Prefer","return=representation"),this}order($,{ascending:D=!0,nullsFirst:X,foreignTable:J,referencedTable:Y=J}={}){let Q=Y?`${Y}.order`:"order",G=this.url.searchParams.get(Q);return this.url.searchParams.set(Q,`${G?`${G},`:""}${$}.${D?"asc":"desc"}${X===void 0?"":X?".nullsfirst":".nullslast"}`),this}limit($,{foreignTable:D,referencedTable:X=D}={}){let J=typeof X>"u"?"limit":`${X}.limit`;return this.url.searchParams.set(J,`${$}`),this}range($,D,{foreignTable:X,referencedTable:J=X}={}){let Y=typeof J>"u"?"offset":`${J}.offset`,Q=typeof J>"u"?"limit":`${J}.limit`;return this.url.searchParams.set(Y,`${$}`),this.url.searchParams.set(Q,`${D-$+1}`),this}abortSignal($){return this.signal=$,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){if(this.method==="GET")this.headers.set("Accept","application/json");else this.headers.set("Accept","application/vnd.pgrst.object+json");return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:$=!1,verbose:D=!1,settings:X=!1,buffers:J=!1,wal:Y=!1,format:Q="text"}={}){var G;let W=[$?"analyze":null,D?"verbose":null,X?"settings":null,J?"buffers":null,Y?"wal":null].filter(Boolean).join("|"),B=(G=this.headers.get("Accept"))!==null&&G!==void 0?G:"application/json";if(this.headers.set("Accept",`application/vnd.pgrst.plan+${Q}; for="${B}"; options=${W};`),Q==="json")return this;else return this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected($){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${$}`),this}},yT=new RegExp("[,()]"),o9=class extends D00{eq($,D){return this.url.searchParams.append($,`eq.${D}`),this}neq($,D){return this.url.searchParams.append($,`neq.${D}`),this}gt($,D){return this.url.searchParams.append($,`gt.${D}`),this}gte($,D){return this.url.searchParams.append($,`gte.${D}`),this}lt($,D){return this.url.searchParams.append($,`lt.${D}`),this}lte($,D){return this.url.searchParams.append($,`lte.${D}`),this}like($,D){return this.url.searchParams.append($,`like.${D}`),this}likeAllOf($,D){return this.url.searchParams.append($,`like(all).{${D.join(",")}}`),this}likeAnyOf($,D){return this.url.searchParams.append($,`like(any).{${D.join(",")}}`),this}ilike($,D){return this.url.searchParams.append($,`ilike.${D}`),this}ilikeAllOf($,D){return this.url.searchParams.append($,`ilike(all).{${D.join(",")}}`),this}ilikeAnyOf($,D){return this.url.searchParams.append($,`ilike(any).{${D.join(",")}}`),this}regexMatch($,D){return this.url.searchParams.append($,`match.${D}`),this}regexIMatch($,D){return this.url.searchParams.append($,`imatch.${D}`),this}is($,D){return this.url.searchParams.append($,`is.${D}`),this}isDistinct($,D){return this.url.searchParams.append($,`isdistinct.${D}`),this}in($,D){let X=Array.from(new Set(D)).map((J)=>{if(typeof J==="string"&&yT.test(J))return`"${J}"`;else return`${J}`}).join(",");return this.url.searchParams.append($,`in.(${X})`),this}notIn($,D){let X=Array.from(new Set(D)).map((J)=>{if(typeof J==="string"&&yT.test(J))return`"${J}"`;else return`${J}`}).join(",");return this.url.searchParams.append($,`not.in.(${X})`),this}contains($,D){if(typeof D==="string")this.url.searchParams.append($,`cs.${D}`);else if(Array.isArray(D))this.url.searchParams.append($,`cs.{${D.join(",")}}`);else this.url.searchParams.append($,`cs.${JSON.stringify(D)}`);return this}containedBy($,D){if(typeof D==="string")this.url.searchParams.append($,`cd.${D}`);else if(Array.isArray(D))this.url.searchParams.append($,`cd.{${D.join(",")}}`);else this.url.searchParams.append($,`cd.${JSON.stringify(D)}`);return this}rangeGt($,D){return this.url.searchParams.append($,`sr.${D}`),this}rangeGte($,D){return this.url.searchParams.append($,`nxl.${D}`),this}rangeLt($,D){return this.url.searchParams.append($,`sl.${D}`),this}rangeLte($,D){return this.url.searchParams.append($,`nxr.${D}`),this}rangeAdjacent($,D){return this.url.searchParams.append($,`adj.${D}`),this}overlaps($,D){if(typeof D==="string")this.url.searchParams.append($,`ov.${D}`);else this.url.searchParams.append($,`ov.{${D.join(",")}}`);return this}textSearch($,D,{config:X,type:J}={}){let Y="";if(J==="plain")Y="pl";else if(J==="phrase")Y="ph";else if(J==="websearch")Y="w";let Q=X===void 0?"":`(${X})`;return this.url.searchParams.append($,`${Y}fts${Q}.${D}`),this}match($){return Object.entries($).forEach(([D,X])=>{this.url.searchParams.append(D,`eq.${X}`)}),this}not($,D,X){return this.url.searchParams.append($,`not.${D}.${X}`),this}or($,{foreignTable:D,referencedTable:X=D}={}){let J=X?`${X}.or`:"or";return this.url.searchParams.append(J,`(${$})`),this}filter($,D,X){return this.url.searchParams.append($,`${D}.${X}`),this}}});class Oq{constructor(){}connect(){}disconnect(){}}function G00($,D,X){let J=new URL(D,$);if(X){for(let[Y,Q]of Object.entries(X))if(Q!==void 0)J.searchParams.set(Y,Q)}return J.toString()}async function W00($){if(!$||$.type==="none")return{};if($.type==="bearer")return{Authorization:`Bearer ${$.token}`};if($.type==="header")return{[$.name]:$.value};if($.type==="custom")return await $.getHeaders();return{}}function B00($){let D=$.fetchImpl??globalThis.fetch;return{async request({method:X,path:J,query:Y,body:Q,headers:G}){let W=G00($.baseUrl,J,Y),B=await W00($.auth),H=await D(W,{method:X,headers:{...Q?{"Content-Type":"application/json"}:{},...B,...G},body:Q?JSON.stringify(Q):void 0}),U=await H.text(),K=(H.headers.get("content-type")||"").includes("application/json"),q=K&&U?JSON.parse(U):U;if(!H.ok){let V=K?q:void 0,z=V?.error;throw new t7(z?.message??`Request failed with status ${H.status}`,{status:H.status,icebergType:z?.type,icebergCode:z?.code,details:V})}return{status:H.status,headers:H.headers,data:q}}}}function NG($){return $.join("\x1F")}function t9($){return $.join("\x1F")}var t7,H00=class{constructor($,D=""){this.client=$,this.prefix=D}async listNamespaces($){let D=$?{parent:NG($.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:D})).data.namespaces.map((J)=>({namespace:J}))}async createNamespace($,D){let X={namespace:$.namespace,properties:D?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:X})).data}async dropNamespace($){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${NG($.namespace)}`})}async loadNamespaceMetadata($){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${NG($.namespace)}`})).data.properties}}async namespaceExists($){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${NG($.namespace)}`}),!0}catch(D){if(D instanceof t7&&D.status===404)return!1;throw D}}async createNamespaceIfNotExists($,D){try{return await this.createNamespace($,D)}catch(X){if(X instanceof t7&&X.status===409)return;throw X}}},U00=class{constructor($,D="",X){this.client=$,this.prefix=D,this.accessDelegation=X}async listTables($){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${t9($.namespace)}/tables`})).data.identifiers}async createTable($,D){let X={};if(this.accessDelegation)X["X-Iceberg-Access-Delegation"]=this.accessDelegation;return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${t9($.namespace)}/tables`,body:D,headers:X})).data.metadata}async updateTable($,D){let X=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${t9($.namespace)}/tables/${$.name}`,body:D});return{"metadata-location":X.data["metadata-location"],metadata:X.data.metadata}}async dropTable($,D){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${t9($.namespace)}/tables/${$.name}`,query:{purgeRequested:String(D?.purge??!1)}})}async loadTable($){let D={};if(this.accessDelegation)D["X-Iceberg-Access-Delegation"]=this.accessDelegation;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${t9($.namespace)}/tables/${$.name}`,headers:D})).data.metadata}async tableExists($){let D={};if(this.accessDelegation)D["X-Iceberg-Access-Delegation"]=this.accessDelegation;try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${t9($.namespace)}/tables/${$.name}`,headers:D}),!0}catch(X){if(X instanceof t7&&X.status===404)return!1;throw X}}async createTableIfNotExists($,D){try{return await this.createTable($,D)}catch(X){if(X instanceof t7&&X.status===409)return await this.loadTable({namespace:$.namespace,name:D.name});throw X}}},mT=class{constructor($){let D="v1";if($.catalogName)D+=`/${$.catalogName}`;let X=$.baseUrl.endsWith("/")?$.baseUrl:`${$.baseUrl}/`;this.client=B00({baseUrl:X,auth:$.auth,fetchImpl:$.fetch}),this.accessDelegation=$.accessDelegation?.join(","),this.namespaceOps=new H00(this.client,D),this.tableOps=new U00(this.client,D,this.accessDelegation)}async listNamespaces($){return this.namespaceOps.listNamespaces($)}async createNamespace($,D){return this.namespaceOps.createNamespace($,D)}async dropNamespace($){await this.namespaceOps.dropNamespace($)}async loadNamespaceMetadata($){return this.namespaceOps.loadNamespaceMetadata($)}async listTables($){return this.tableOps.listTables($)}async createTable($,D){return this.tableOps.createTable($,D)}async updateTable($,D){return this.tableOps.updateTable($,D)}async dropTable($,D){await this.tableOps.dropTable($,D)}async loadTable($){return this.tableOps.loadTable($)}async namespaceExists($){return this.namespaceOps.namespaceExists($)}async tableExists($){return this.tableOps.tableExists($)}async createNamespaceIfNotExists($,D){return this.namespaceOps.createNamespaceIfNotExists($,D)}async createTableIfNotExists($,D){return this.tableOps.createTableIfNotExists($,D)}};var lT=l(()=>{t7=class extends Error{constructor($,D){super($);this.name="IcebergError",this.status=D.status,this.icebergType=D.icebergType,this.icebergCode=D.icebergCode,this.details=D.details,this.isCommitStateUnknown=D.icebergType==="CommitStateUnknownException"||[500,502,504].includes(D.status)&&D.icebergType?.includes("CommitState")===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}}});function ZG($){return typeof $==="object"&&$!==null&&"__isStorageError"in $}function e7($){return e7=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(D){return typeof D}:function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D},e7($)}function V00($,D){if(e7($)!="object"||!$)return $;var X=$[Symbol.toPrimitive];if(X!==void 0){var J=X.call($,D||"default");if(e7(J)!="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return(D==="string"?String:Number)($)}function z00($){var D=V00($,"string");return e7(D)=="symbol"?D:D+""}function w00($,D,X){return(D=z00(D))in $?Object.defineProperty($,D,{value:X,enumerable:!0,configurable:!0,writable:!0}):$[D]=X,$}function cT($,D){var X=Object.keys($);if(Object.getOwnPropertySymbols){var J=Object.getOwnPropertySymbols($);D&&(J=J.filter(function(Y){return Object.getOwnPropertyDescriptor($,Y).enumerable})),X.push.apply(X,J)}return X}function S0($){for(var D=1;D<arguments.length;D++){var X=arguments[D]!=null?arguments[D]:{};D%2?cT(Object(X),!0).forEach(function(J){w00($,J,X[J])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(X)):cT(Object(X)).forEach(function(J){Object.defineProperty($,J,Object.getOwnPropertyDescriptor(X,J))})}return $}async function s7($,D,X,J,Y,Q,G){return new Promise((W,B)=>{$(X,O00(D,J,Y,Q)).then((H)=>{if(!H.ok)throw H;if(J===null||J===void 0?void 0:J.noResolveJson)return H;if(G==="vectors"){let U=H.headers.get("content-type");if(H.headers.get("content-length")==="0"||H.status===204)return{};if(!U||!U.includes("application/json"))return{}}return H.json()}).then((H)=>W(H)).catch((H)=>N00(H,B,J,G))})}function pT($="storage"){return{get:async(D,X,J,Y)=>{return s7(D,"GET",X,J,Y,void 0,$)},post:async(D,X,J,Y,Q)=>{return s7(D,"POST",X,Y,Q,J,$)},put:async(D,X,J,Y,Q)=>{return s7(D,"PUT",X,Y,Q,J,$)},head:async(D,X,J,Y)=>{return s7(D,"HEAD",X,S0(S0({},J),{},{noResolveJson:!0}),Y,void 0,$)},remove:async(D,X,J,Y,Q)=>{return s7(D,"DELETE",X,Y,Q,J,$)}}}var LG,OG,iT,F00=($)=>{if($)return(...D)=>$(...D);return(...D)=>fetch(...D)},K00=($)=>{if(typeof $!=="object"||$===null)return!1;let D=Object.getPrototypeOf($);return(D===null||D===Object.prototype||Object.getPrototypeOf(D)===null)&&!(Symbol.toStringTag in $)&&!(Symbol.iterator in $)},Lq=($)=>{if(Array.isArray($))return $.map((X)=>Lq(X));else if(typeof $==="function"||$!==Object($))return $;let D={};return Object.entries($).forEach(([X,J])=>{let Y=X.replace(/([-_][a-z])/gi,(Q)=>Q.toUpperCase().replace(/[-_]/g,""));D[Y]=Lq(J)}),D},q00=($)=>{if(!$||typeof $!=="string")return!1;if($.length===0||$.length>100)return!1;if($.trim()!==$)return!1;if($.includes("/")||$.includes("\\"))return!1;return/^[\w!.\*'() &$@=;:+,?-]+$/.test($)},dT=($)=>{var D;return $.msg||$.message||$.error_description||(typeof $.error==="string"?$.error:(D=$.error)===null||D===void 0?void 0:D.message)||JSON.stringify($)},N00=async($,D,X,J)=>{if($&&typeof $==="object"&&"status"in $&&"ok"in $&&typeof $.status==="number"&&!(X===null||X===void 0?void 0:X.noResolveJson)){let Y=$,Q=Y.status||500;if(typeof Y.json==="function")Y.json().then((G)=>{let W=(G===null||G===void 0?void 0:G.statusCode)||(G===null||G===void 0?void 0:G.code)||Q+"";D(new OG(dT(G),Q,W,J))}).catch(()=>{if(J==="vectors"){let G=Q+"";D(new OG(Y.statusText||`HTTP ${Q} error`,Q,G,J))}else{let G=Q+"";D(new OG(Y.statusText||`HTTP ${Q} error`,Q,G,J))}});else{let G=Q+"";D(new OG(Y.statusText||`HTTP ${Q} error`,Q,G,J))}}else D(new iT(dT($),$,J))},O00=($,D,X,J)=>{let Y={method:$,headers:(D===null||D===void 0?void 0:D.headers)||{}};if($==="GET"||$==="HEAD"||!J)return S0(S0({},Y),X);if(K00(J))Y.headers=S0({"Content-Type":"application/json"},D===null||D===void 0?void 0:D.headers),Y.body=JSON.stringify(J);else Y.body=J;if(D===null||D===void 0?void 0:D.duplex)Y.duplex=D.duplex;return S0(S0({},Y),X)},L00,$X,a6,Zq,Z00,Mq,j6,s9=class{constructor($,D={},X,J="storage"){this.shouldThrowOnError=!1,this.url=$,this.headers=D,this.fetch=F00(X),this.namespace=J}throwOnError(){return this.shouldThrowOnError=!0,this}async handleOperation($){var D=this;try{return{data:await $(),error:null}}catch(X){if(D.shouldThrowOnError)throw X;if(ZG(X))return{data:null,error:X};throw X}}},M00=class{constructor($,D){this.downloadFn=$,this.shouldThrowOnError=D}then($,D){return this.execute().then($,D)}async execute(){var $=this;try{return{data:(await $.downloadFn()).body,error:null}}catch(D){if($.shouldThrowOnError)throw D;if(ZG(D))return{data:null,error:D};throw D}}},rT,A00=class{constructor($,D){this.downloadFn=$,this.shouldThrowOnError=D,this[rT]="BlobDownloadBuilder",this.promise=null}asStream(){return new M00(this.downloadFn,this.shouldThrowOnError)}then($,D){return this.getPromise().then($,D)}catch($){return this.getPromise().catch($)}finally($){return this.getPromise().finally($)}getPromise(){if(!this.promise)this.promise=this.execute();return this.promise}async execute(){var $=this;try{return{data:await(await $.downloadFn()).blob(),error:null}}catch(D){if($.shouldThrowOnError)throw D;if(ZG(D))return{data:null,error:D};throw D}}},j00,nT,E00,R00="2.95.3",DX,T00,I00,S00,P00,v00,C00,_00,x00,aT;var oT=l(()=>{lT();LG=class extends Error{constructor($,D="storage",X,J){super($);this.__isStorageError=!0,this.namespace=D,this.name=D==="vectors"?"StorageVectorsError":"StorageError",this.status=X,this.statusCode=J}};OG=class extends LG{constructor($,D,X,J="storage"){super($,J,D,X);this.name=J==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=D,this.statusCode=X}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},iT=class extends LG{constructor($,D,X="storage"){super($,X);this.name=X==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=D}};L00=pT("storage"),{get:$X,post:a6,put:Zq,head:Z00,remove:Mq}=L00,j6=pT("vectors");rT=Symbol.toStringTag;j00={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},nT={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},E00=class extends s9{constructor($,D={},X,J){super($,D,J,"storage");this.bucketId=X}async uploadOrUpdate($,D,X,J){var Y=this;return Y.handleOperation(async()=>{let Q,G=S0(S0({},nT),J),W=S0(S0({},Y.headers),$==="POST"&&{"x-upsert":String(G.upsert)}),B=G.metadata;if(typeof Blob<"u"&&X instanceof Blob){if(Q=new FormData,Q.append("cacheControl",G.cacheControl),B)Q.append("metadata",Y.encodeMetadata(B));Q.append("",X)}else if(typeof FormData<"u"&&X instanceof FormData){if(Q=X,!Q.has("cacheControl"))Q.append("cacheControl",G.cacheControl);if(B&&!Q.has("metadata"))Q.append("metadata",Y.encodeMetadata(B))}else{if(Q=X,W["cache-control"]=`max-age=${G.cacheControl}`,W["content-type"]=G.contentType,B)W["x-metadata"]=Y.toBase64(Y.encodeMetadata(B));if((typeof ReadableStream<"u"&&Q instanceof ReadableStream||Q&&typeof Q==="object"&&("pipe"in Q)&&typeof Q.pipe==="function")&&!G.duplex)G.duplex="half"}if(J===null||J===void 0?void 0:J.headers)W=S0(S0({},W),J.headers);let H=Y._removeEmptyFolders(D),U=Y._getFinalPath(H),K=await($=="PUT"?Zq:a6)(Y.fetch,`${Y.url}/object/${U}`,Q,S0({headers:W},(G===null||G===void 0?void 0:G.duplex)?{duplex:G.duplex}:{}));return{path:H,id:K.Id,fullPath:K.Key}})}async upload($,D,X){return this.uploadOrUpdate("POST",$,D,X)}async uploadToSignedUrl($,D,X,J){var Y=this;let Q=Y._removeEmptyFolders($),G=Y._getFinalPath(Q),W=new URL(Y.url+`/object/upload/sign/${G}`);return W.searchParams.set("token",D),Y.handleOperation(async()=>{let B,H=S0({upsert:nT.upsert},J),U=S0(S0({},Y.headers),{"x-upsert":String(H.upsert)});if(typeof Blob<"u"&&X instanceof Blob)B=new FormData,B.append("cacheControl",H.cacheControl),B.append("",X);else if(typeof FormData<"u"&&X instanceof FormData)B=X,B.append("cacheControl",H.cacheControl);else B=X,U["cache-control"]=`max-age=${H.cacheControl}`,U["content-type"]=H.contentType;return{path:Q,fullPath:(await Zq(Y.fetch,W.toString(),B,{headers:U})).Key}})}async createSignedUploadUrl($,D){var X=this;return X.handleOperation(async()=>{let J=X._getFinalPath($),Y=S0({},X.headers);if(D===null||D===void 0?void 0:D.upsert)Y["x-upsert"]="true";let Q=await a6(X.fetch,`${X.url}/object/upload/sign/${J}`,{},{headers:Y}),G=new URL(X.url+Q.url),W=G.searchParams.get("token");if(!W)throw new LG("No token returned by API");return{signedUrl:G.toString(),path:$,token:W}})}async update($,D,X){return this.uploadOrUpdate("PUT",$,D,X)}async move($,D,X){var J=this;return J.handleOperation(async()=>{return await a6(J.fetch,`${J.url}/object/move`,{bucketId:J.bucketId,sourceKey:$,destinationKey:D,destinationBucket:X===null||X===void 0?void 0:X.destinationBucket},{headers:J.headers})})}async copy($,D,X){var J=this;return J.handleOperation(async()=>{return{path:(await a6(J.fetch,`${J.url}/object/copy`,{bucketId:J.bucketId,sourceKey:$,destinationKey:D,destinationBucket:X===null||X===void 0?void 0:X.destinationBucket},{headers:J.headers})).Key}})}async createSignedUrl($,D,X){var J=this;return J.handleOperation(async()=>{let Y=J._getFinalPath($),Q=await a6(J.fetch,`${J.url}/object/sign/${Y}`,S0({expiresIn:D},(X===null||X===void 0?void 0:X.transform)?{transform:X.transform}:{}),{headers:J.headers}),G=(X===null||X===void 0?void 0:X.download)?`&download=${X.download===!0?"":X.download}`:"";return{signedUrl:encodeURI(`${J.url}${Q.signedURL}${G}`)}})}async createSignedUrls($,D,X){var J=this;return J.handleOperation(async()=>{let Y=await a6(J.fetch,`${J.url}/object/sign/${J.bucketId}`,{expiresIn:D,paths:$},{headers:J.headers}),Q=(X===null||X===void 0?void 0:X.download)?`&download=${X.download===!0?"":X.download}`:"";return Y.map((G)=>S0(S0({},G),{},{signedUrl:G.signedURL?encodeURI(`${J.url}${G.signedURL}${Q}`):null}))})}download($,D,X){let J=typeof(D===null||D===void 0?void 0:D.transform)<"u"?"render/image/authenticated":"object",Y=this.transformOptsToQueryString((D===null||D===void 0?void 0:D.transform)||{}),Q=Y?`?${Y}`:"",G=this._getFinalPath($);return new A00(()=>$X(this.fetch,`${this.url}/${J}/${G}${Q}`,{headers:this.headers,noResolveJson:!0},X),this.shouldThrowOnError)}async info($){var D=this;let X=D._getFinalPath($);return D.handleOperation(async()=>{return Lq(await $X(D.fetch,`${D.url}/object/info/${X}`,{headers:D.headers}))})}async exists($){var D=this;let X=D._getFinalPath($);try{return await Z00(D.fetch,`${D.url}/object/${X}`,{headers:D.headers}),{data:!0,error:null}}catch(J){if(D.shouldThrowOnError)throw J;if(ZG(J)&&J instanceof iT){let Y=J.originalError;if([400,404].includes(Y===null||Y===void 0?void 0:Y.status))return{data:!1,error:J}}throw J}}getPublicUrl($,D){let X=this._getFinalPath($),J=[],Y=(D===null||D===void 0?void 0:D.download)?`download=${D.download===!0?"":D.download}`:"";if(Y!=="")J.push(Y);let Q=typeof(D===null||D===void 0?void 0:D.transform)<"u"?"render/image":"object",G=this.transformOptsToQueryString((D===null||D===void 0?void 0:D.transform)||{});if(G!=="")J.push(G);let W=J.join("&");if(W!=="")W=`?${W}`;return{data:{publicUrl:encodeURI(`${this.url}/${Q}/public/${X}${W}`)}}}async remove($){var D=this;return D.handleOperation(async()=>{return await Mq(D.fetch,`${D.url}/object/${D.bucketId}`,{prefixes:$},{headers:D.headers})})}async list($,D,X){var J=this;return J.handleOperation(async()=>{let Y=S0(S0(S0({},j00),D),{},{prefix:$||""});return await a6(J.fetch,`${J.url}/object/list/${J.bucketId}`,Y,{headers:J.headers},X)})}async listV2($,D){var X=this;return X.handleOperation(async()=>{let J=S0({},$);return await a6(X.fetch,`${X.url}/object/list-v2/${X.bucketId}`,J,{headers:X.headers},D)})}encodeMetadata($){return JSON.stringify($)}toBase64($){if(typeof Buffer<"u")return Buffer.from($).toString("base64");return btoa($)}_getFinalPath($){return`${this.bucketId}/${$.replace(/^\/+/,"")}`}_removeEmptyFolders($){return $.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString($){let D=[];if($.width)D.push(`width=${$.width}`);if($.height)D.push(`height=${$.height}`);if($.resize)D.push(`resize=${$.resize}`);if($.format)D.push(`format=${$.format}`);if($.quality)D.push(`quality=${$.quality}`);return D.join("&")}},DX={"X-Client-Info":`storage-js/${R00}`},T00=class extends s9{constructor($,D={},X,J){let Y=new URL($);if(J===null||J===void 0?void 0:J.useNewHostname){if(/supabase\.(co|in|red)$/.test(Y.hostname)&&!Y.hostname.includes("storage.supabase."))Y.hostname=Y.hostname.replace("supabase.","storage.supabase.")}let Q=Y.href.replace(/\/$/,""),G=S0(S0({},DX),D);super(Q,G,X,"storage")}async listBuckets($){var D=this;return D.handleOperation(async()=>{let X=D.listBucketOptionsToQueryString($);return await $X(D.fetch,`${D.url}/bucket${X}`,{headers:D.headers})})}async getBucket($){var D=this;return D.handleOperation(async()=>{return await $X(D.fetch,`${D.url}/bucket/${$}`,{headers:D.headers})})}async createBucket($,D={public:!1}){var X=this;return X.handleOperation(async()=>{return await a6(X.fetch,`${X.url}/bucket`,{id:$,name:$,type:D.type,public:D.public,file_size_limit:D.fileSizeLimit,allowed_mime_types:D.allowedMimeTypes},{headers:X.headers})})}async updateBucket($,D){var X=this;return X.handleOperation(async()=>{return await Zq(X.fetch,`${X.url}/bucket/${$}`,{id:$,name:$,public:D.public,file_size_limit:D.fileSizeLimit,allowed_mime_types:D.allowedMimeTypes},{headers:X.headers})})}async emptyBucket($){var D=this;return D.handleOperation(async()=>{return await a6(D.fetch,`${D.url}/bucket/${$}/empty`,{},{headers:D.headers})})}async deleteBucket($){var D=this;return D.handleOperation(async()=>{return await Mq(D.fetch,`${D.url}/bucket/${$}`,{},{headers:D.headers})})}listBucketOptionsToQueryString($){let D={};if($){if("limit"in $)D.limit=String($.limit);if("offset"in $)D.offset=String($.offset);if($.search)D.search=$.search;if($.sortColumn)D.sortColumn=$.sortColumn;if($.sortOrder)D.sortOrder=$.sortOrder}return Object.keys(D).length>0?"?"+new URLSearchParams(D).toString():""}},I00=class extends s9{constructor($,D={},X){let J=$.replace(/\/$/,""),Y=S0(S0({},DX),D);super(J,Y,X,"storage")}async createBucket($){var D=this;return D.handleOperation(async()=>{return await a6(D.fetch,`${D.url}/bucket`,{name:$},{headers:D.headers})})}async listBuckets($){var D=this;return D.handleOperation(async()=>{let X=new URLSearchParams;if(($===null||$===void 0?void 0:$.limit)!==void 0)X.set("limit",$.limit.toString());if(($===null||$===void 0?void 0:$.offset)!==void 0)X.set("offset",$.offset.toString());if($===null||$===void 0?void 0:$.sortColumn)X.set("sortColumn",$.sortColumn);if($===null||$===void 0?void 0:$.sortOrder)X.set("sortOrder",$.sortOrder);if($===null||$===void 0?void 0:$.search)X.set("search",$.search);let J=X.toString(),Y=J?`${D.url}/bucket?${J}`:`${D.url}/bucket`;return await $X(D.fetch,Y,{headers:D.headers})})}async deleteBucket($){var D=this;return D.handleOperation(async()=>{return await Mq(D.fetch,`${D.url}/bucket/${$}`,{},{headers:D.headers})})}from($){var D=this;if(!q00($))throw new LG("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");let X=new mT({baseUrl:this.url,catalogName:$,auth:{type:"custom",getHeaders:async()=>D.headers},fetch:this.fetch}),J=this.shouldThrowOnError;return new Proxy(X,{get(Y,Q){let G=Y[Q];if(typeof G!=="function")return G;return async(...W)=>{try{return{data:await G.apply(Y,W),error:null}}catch(B){if(J)throw B;return{data:null,error:B}}}}})}},S00=class extends s9{constructor($,D={},X){let J=$.replace(/\/$/,""),Y=S0(S0({},DX),{},{"Content-Type":"application/json"},D);super(J,Y,X,"vectors")}async createIndex($){var D=this;return D.handleOperation(async()=>{return await j6.post(D.fetch,`${D.url}/CreateIndex`,$,{headers:D.headers})||{}})}async getIndex($,D){var X=this;return X.handleOperation(async()=>{return await j6.post(X.fetch,`${X.url}/GetIndex`,{vectorBucketName:$,indexName:D},{headers:X.headers})})}async listIndexes($){var D=this;return D.handleOperation(async()=>{return await j6.post(D.fetch,`${D.url}/ListIndexes`,$,{headers:D.headers})})}async deleteIndex($,D){var X=this;return X.handleOperation(async()=>{return await j6.post(X.fetch,`${X.url}/DeleteIndex`,{vectorBucketName:$,indexName:D},{headers:X.headers})||{}})}},P00=class extends s9{constructor($,D={},X){let J=$.replace(/\/$/,""),Y=S0(S0({},DX),{},{"Content-Type":"application/json"},D);super(J,Y,X,"vectors")}async putVectors($){var D=this;if($.vectors.length<1||$.vectors.length>500)throw Error("Vector batch size must be between 1 and 500 items");return D.handleOperation(async()=>{return await j6.post(D.fetch,`${D.url}/PutVectors`,$,{headers:D.headers})||{}})}async getVectors($){var D=this;return D.handleOperation(async()=>{return await j6.post(D.fetch,`${D.url}/GetVectors`,$,{headers:D.headers})})}async listVectors($){var D=this;if($.segmentCount!==void 0){if($.segmentCount<1||$.segmentCount>16)throw Error("segmentCount must be between 1 and 16");if($.segmentIndex!==void 0){if($.segmentIndex<0||$.segmentIndex>=$.segmentCount)throw Error(`segmentIndex must be between 0 and ${$.segmentCount-1}`)}}return D.handleOperation(async()=>{return await j6.post(D.fetch,`${D.url}/ListVectors`,$,{headers:D.headers})})}async queryVectors($){var D=this;return D.handleOperation(async()=>{return await j6.post(D.fetch,`${D.url}/QueryVectors`,$,{headers:D.headers})})}async deleteVectors($){var D=this;if($.keys.length<1||$.keys.length>500)throw Error("Keys batch size must be between 1 and 500 items");return D.handleOperation(async()=>{return await j6.post(D.fetch,`${D.url}/DeleteVectors`,$,{headers:D.headers})||{}})}},v00=class extends s9{constructor($,D={},X){let J=$.replace(/\/$/,""),Y=S0(S0({},DX),{},{"Content-Type":"application/json"},D);super(J,Y,X,"vectors")}async createBucket($){var D=this;return D.handleOperation(async()=>{return await j6.post(D.fetch,`${D.url}/CreateVectorBucket`,{vectorBucketName:$},{headers:D.headers})||{}})}async getBucket($){var D=this;return D.handleOperation(async()=>{return await j6.post(D.fetch,`${D.url}/GetVectorBucket`,{vectorBucketName:$},{headers:D.headers})})}async listBuckets($={}){var D=this;return D.handleOperation(async()=>{return await j6.post(D.fetch,`${D.url}/ListVectorBuckets`,$,{headers:D.headers})})}async deleteBucket($){var D=this;return D.handleOperation(async()=>{return await j6.post(D.fetch,`${D.url}/DeleteVectorBucket`,{vectorBucketName:$},{headers:D.headers})||{}})}},C00=class extends v00{constructor($,D={}){super($,D.headers||{},D.fetch)}from($){return new _00(this.url,this.headers,$,this.fetch)}async createBucket($){var D=()=>super.createBucket,X=this;return D().call(X,$)}async getBucket($){var D=()=>super.getBucket,X=this;return D().call(X,$)}async listBuckets($={}){var D=()=>super.listBuckets,X=this;return D().call(X,$)}async deleteBucket($){var D=()=>super.deleteBucket,X=this;return D().call(X,$)}},_00=class extends S00{constructor($,D,X,J){super($,D,J);this.vectorBucketName=X}async createIndex($){var D=()=>super.createIndex,X=this;return D().call(X,S0(S0({},$),{},{vectorBucketName:X.vectorBucketName}))}async listIndexes($={}){var D=()=>super.listIndexes,X=this;return D().call(X,S0(S0({},$),{},{vectorBucketName:X.vectorBucketName}))}async getIndex($){var D=()=>super.getIndex,X=this;return D().call(X,X.vectorBucketName,$)}async deleteIndex($){var D=()=>super.deleteIndex,X=this;return D().call(X,X.vectorBucketName,$)}index($){return new x00(this.url,this.headers,this.vectorBucketName,$,this.fetch)}},x00=class extends P00{constructor($,D,X,J,Y){super($,D,Y);this.vectorBucketName=X,this.indexName=J}async putVectors($){var D=()=>super.putVectors,X=this;return D().call(X,S0(S0({},$),{},{vectorBucketName:X.vectorBucketName,indexName:X.indexName}))}async getVectors($){var D=()=>super.getVectors,X=this;return D().call(X,S0(S0({},$),{},{vectorBucketName:X.vectorBucketName,indexName:X.indexName}))}async listVectors($={}){var D=()=>super.listVectors,X=this;return D().call(X,S0(S0({},$),{},{vectorBucketName:X.vectorBucketName,indexName:X.indexName}))}async queryVectors($){var D=()=>super.queryVectors,X=this;return D().call(X,S0(S0({},$),{},{vectorBucketName:X.vectorBucketName,indexName:X.indexName}))}async deleteVectors($){var D=()=>super.deleteVectors,X=this;return D().call(X,S0(S0({},$),{},{vectorBucketName:X.vectorBucketName,indexName:X.indexName}))}},aT=class extends T00{constructor($,D={},X,J){super($,D,X,J)}from($){return new E00(this.url,this.headers,$,this.fetch)}get vectors(){return new C00(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new I00(this.url+"/iceberg",this.headers,this.fetch)}}});class tT{constructor($){return this.options=$,new Proxy(this,b00)}}var k00=()=>Promise.resolve({data:{session:null,user:null},error:null}),b00,Aq;var jq=l(()=>{b00={get:($,D)=>{if(D==="constructor")return $.constructor;if(D==="then"||D==="catch"||D==="finally")return;if(typeof D==="symbol")return;if(D==="getSession")return()=>Promise.resolve({data:{session:null,user:null},error:null});if(D==="onAuthStateChange")return()=>({data:{subscription:{unsubscribe:()=>{}}},error:null});return k00}};Aq=class Aq extends tT{}});function YX($){return YX=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(D){return typeof D}:function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D},YX($)}function l00($,D){if(YX($)!="object"||!$)return $;var X=$[Symbol.toPrimitive];if(X!==void 0){var J=X.call($,D||"default");if(YX(J)!="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return(D==="string"?String:Number)($)}function c00($){var D=l00($,"string");return YX(D)=="symbol"?D:D+""}function d00($,D,X){return(D=c00(D))in $?Object.defineProperty($,D,{value:X,enumerable:!0,configurable:!0,writable:!0}):$[D]=X,$}function sT($,D){var X=Object.keys($);if(Object.getOwnPropertySymbols){var J=Object.getOwnPropertySymbols($);D&&(J=J.filter(function(Y){return Object.getOwnPropertyDescriptor($,Y).enumerable})),X.push.apply(X,J)}return X}function n$($){for(var D=1;D<arguments.length;D++){var X=arguments[D]!=null?arguments[D]:{};D%2?sT(Object(X),!0).forEach(function(J){d00($,J,X[J])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(X)):sT(Object(X)).forEach(function(J){Object.defineProperty($,J,Object.getOwnPropertyDescriptor(X,J))})}return $}function r00($){return $.endsWith("/")?$:$+"/"}function a00($,D){var X,J;let{db:Y,auth:Q,realtime:G,global:W}=$,{db:B,auth:H,realtime:U,global:K}=D,q={db:n$(n$({},B),Y),auth:n$(n$({},H),Q),realtime:n$(n$({},U),G),storage:{},global:n$(n$(n$({},K),W),{},{headers:n$(n$({},(X=K===null||K===void 0?void 0:K.headers)!==null&&X!==void 0?X:{}),(J=W===null||W===void 0?void 0:W.headers)!==null&&J!==void 0?J:{})}),accessToken:async()=>""};if($.accessToken)q.accessToken=$.accessToken;else delete q.accessToken;return q}function o00($){let D=$===null||$===void 0?void 0:$.trim();if(!D)throw Error("supabaseUrl is required.");if(!D.match(/^https?:\/\//i))throw Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(r00(D))}catch(X){throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}function e00(){if(typeof window<"u")return!1;let $=globalThis.process;if(!$)return!1;let D=$.version;if(D===void 0||D===null)return!1;let X=D.match(/^v(\d+)\./);if(!X)return!1;return parseInt(X[1],10)<=18}var o6,y00="2.95.3",XX="",f00,u00,g00,h00,m00,n00=($)=>{if($)return(...D)=>$(...D);return(...D)=>fetch(...D)},i00=()=>{return Headers},p00=($,D,X)=>{let J=n00(X),Y=i00();return async(Q,G)=>{var W;let B=(W=await D())!==null&&W!==void 0?W:$,H=new Y(G===null||G===void 0?void 0:G.headers);if(!H.has("apikey"))H.set("apikey",$);if(!H.has("Authorization"))H.set("Authorization",`Bearer ${B}`);return J(Q,n$(n$({},G),{},{headers:H}))}},t00,s00=class{constructor($,D,X){var J,Y;this.supabaseUrl=$,this.supabaseKey=D;let Q=o00($);if(!D)throw Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",Q),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",Q),this.storageUrl=new URL("storage/v1",Q),this.functionsUrl=new URL("functions/v1",Q);let G=`sb-${Q.hostname.split(".")[0]}-auth-token`,W={db:g00,realtime:m00,auth:n$(n$({},h00),{},{storageKey:G}),global:u00},B=a00(X!==null&&X!==void 0?X:{},W);if(this.storageKey=(J=B.auth.storageKey)!==null&&J!==void 0?J:"",this.headers=(Y=B.global.headers)!==null&&Y!==void 0?Y:{},!B.accessToken){var H;this.auth=this._initSupabaseAuthClient((H=B.auth)!==null&&H!==void 0?H:{},this.headers,B.global.fetch)}else this.accessToken=B.accessToken,this.auth=new Proxy({},{get:(U,K)=>{throw Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(K)} is not possible`)}});if(this.fetch=p00(D,this._getAccessToken.bind(this),B.global.fetch),this.realtime=this._initRealtimeClient(n$({headers:this.headers,accessToken:this._getAccessToken.bind(this)},B.realtime)),this.accessToken)Promise.resolve(this.accessToken()).then((U)=>this.realtime.setAuth(U)).catch((U)=>console.warn("Failed to set initial Realtime auth token:",U));if(this.rest=new gT(new URL("rest/v1",Q).href,{headers:this.headers,schema:B.db.schema,fetch:this.fetch,timeout:B.db.timeout,urlLengthLimit:B.db.urlLengthLimit}),this.storage=new aT(this.storageUrl.href,this.headers,this.fetch,X===null||X===void 0?void 0:X.storage),!B.accessToken)this._listenForAuthEvents()}get functions(){return new o6.FunctionsClient(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from($){return this.rest.from($)}schema($){return this.rest.schema($)}rpc($,D={},X={head:!1,get:!1,count:void 0}){return this.rest.rpc($,D,X)}channel($,D={config:{}}){return this.realtime.channel($,D)}getChannels(){return this.realtime.getChannels()}removeChannel($){return this.realtime.removeChannel($)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var $=this,D,X;if($.accessToken)return await $.accessToken();let{data:J}=await $.auth.getSession();return(D=(X=J.session)===null||X===void 0?void 0:X.access_token)!==null&&D!==void 0?D:$.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:$,persistSession:D,detectSessionInUrl:X,storage:J,userStorage:Y,storageKey:Q,flowType:G,lock:W,debug:B,throwOnError:H},U,K){let q={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new t00({url:this.authUrl.href,headers:n$(n$({},q),U),storageKey:Q,autoRefreshToken:$,persistSession:D,detectSessionInUrl:X,storage:J,userStorage:Y,flowType:G,lock:W,debug:B,throwOnError:H,fetch:K,hasCustomAuthorizationHeader:Object.keys(this.headers).some((V)=>V.toLowerCase()==="authorization")})}_initRealtimeClient($){return new Oq(this.realtimeUrl.href,n$(n$({},$),{},{params:n$(n$({},{apikey:this.supabaseKey}),$===null||$===void 0?void 0:$.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange(($,D)=>{this._handleTokenChanged($,"CLIENT",D===null||D===void 0?void 0:D.access_token)})}_handleTokenChanged($,D,X){if(($==="TOKEN_REFRESHED"||$==="SIGNED_IN")&&this.changedAccessToken!==X)this.changedAccessToken=X,this.realtime.setAuth(X);else if($==="SIGNED_OUT"){if(this.realtime.setAuth(),D=="STORAGE")this.auth.signOut();this.changedAccessToken=void 0}}},eT=($,D,X)=>{return new s00($,D,X)};var $I=l(()=>{hT();oT();jq();o6=h$(bT(),1);jq();if(typeof Deno<"u")XX="deno";else if(typeof document<"u")XX="web";else if(typeof navigator<"u"&&navigator.product==="ReactNative")XX="react-native";else XX="node";f00={"X-Client-Info":`supabase-js-${XX}/${y00}`},u00={headers:f00},g00={schema:"public"},h00={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},m00={};t00=class extends Aq{constructor($){super($)}};if(e00())console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217")});var Eq=I((WC0,DI)=>{DI.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}});var MG=I((YI)=>{var XI={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",DESCRIPTOR_NOT_EXIST:"No descriptor present",DESCRIPTOR_UNKNOWN:"Unknown descriptor format",DESCRIPTOR_FAULTY:"Descriptor data is malformed",NO_DATA:"Nothing to decompress",BAD_CRC:"CRC32 checksum failed {0}",FILE_IN_THE_WAY:"There is a file in the way: {0}",UNKNOWN_METHOD:"Invalid/unsupported compression method",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",DISK_ENTRY_TOO_LARGE:"Number of disk entries is too large",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:'File not found: "{0}"',NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found",INVALID_PASS_PARAM:"Incompatible password parameter",WRONG_PASSWORD:"Wrong Password",COMMENT_TOO_LONG:"Comment is too long",EXTRA_FIELD_PARSE_ERROR:"Extra field parsing error"};function $$0($){return function(...D){if(D.length)$=$.replace(/\{(\d)\}/g,(X,J)=>D[J]||"");return Error("ADM-ZIP: "+$)}}for(let $ of Object.keys(XI))YI[$]=$$0(XI[$])});var BI=I((HC0,WI)=>{var D$0=r("fs"),B1=r("path"),JI=Eq(),X$0=MG(),Y$0=typeof process==="object"&&process.platform==="win32",QI=($)=>typeof $==="object"&&$!==null,GI=new Uint32Array(256).map(($,D)=>{for(let X=0;X<8;X++)if((D&1)!==0)D=3988292384^D>>>1;else D>>>=1;return D>>>0});function i$($){if(this.sep=B1.sep,this.fs=D$0,QI($)){if(QI($.fs)&&typeof $.fs.statSync==="function")this.fs=$.fs}}WI.exports=i$;i$.prototype.makeDir=function($){let D=this;function X(J){let Y=J.split(D.sep)[0];J.split(D.sep).forEach(function(Q){if(!Q||Q.substr(-1,1)===":")return;Y+=D.sep+Q;var G;try{G=D.fs.statSync(Y)}catch(W){D.fs.mkdirSync(Y)}if(G&&G.isFile())throw X$0.FILE_IN_THE_WAY(`"${Y}"`)})}X($)};i$.prototype.writeFileTo=function($,D,X,J){let Y=this;if(Y.fs.existsSync($)){if(!X)return!1;var Q=Y.fs.statSync($);if(Q.isDirectory())return!1}var G=B1.dirname($);if(!Y.fs.existsSync(G))Y.makeDir(G);var W;try{W=Y.fs.openSync($,"w",438)}catch(B){Y.fs.chmodSync($,438),W=Y.fs.openSync($,"w",438)}if(W)try{Y.fs.writeSync(W,D,0,D.length,0)}finally{Y.fs.closeSync(W)}return Y.fs.chmodSync($,J||438),!0};i$.prototype.writeFileToAsync=function($,D,X,J,Y){if(typeof J==="function")Y=J,J=void 0;let Q=this;Q.fs.exists($,function(G){if(G&&!X)return Y(!1);Q.fs.stat($,function(W,B){if(G&&B.isDirectory())return Y(!1);var H=B1.dirname($);Q.fs.exists(H,function(U){if(!U)Q.makeDir(H);Q.fs.open($,"w",438,function(K,q){if(K)Q.fs.chmod($,438,function(){Q.fs.open($,"w",438,function(V,z){Q.fs.write(z,D,0,D.length,0,function(){Q.fs.close(z,function(){Q.fs.chmod($,J||438,function(){Y(!0)})})})})});else if(q)Q.fs.write(q,D,0,D.length,0,function(){Q.fs.close(q,function(){Q.fs.chmod($,J||438,function(){Y(!0)})})});else Q.fs.chmod($,J||438,function(){Y(!0)})})})})})};i$.prototype.findFiles=function($){let D=this;function X(J,Y,Q){if(typeof Y==="boolean")Q=Y,Y=void 0;let G=[];return D.fs.readdirSync(J).forEach(function(W){let B=B1.join(J,W),H=D.fs.statSync(B);if(!Y||Y.test(B))G.push(B1.normalize(B)+(H.isDirectory()?D.sep:""));if(H.isDirectory()&&Q)G=G.concat(X(B,Y,Q))}),G}return X($,void 0,!0)};i$.prototype.findFilesAsync=function($,D){let X=this,J=[];X.fs.readdir($,function(Y,Q){if(Y)return D(Y);let G=Q.length;if(!G)return D(null,J);Q.forEach(function(W){W=B1.join($,W),X.fs.stat(W,function(B,H){if(B)return D(B);if(H){if(J.push(B1.normalize(W)+(H.isDirectory()?X.sep:"")),H.isDirectory())X.findFilesAsync(W,function(U,K){if(U)return D(U);if(J=J.concat(K),!--G)D(null,J)});else if(!--G)D(null,J)}})})})};i$.prototype.getAttributes=function(){};i$.prototype.setAttributes=function(){};i$.crc32update=function($,D){return GI[($^D)&255]^$>>>8};i$.crc32=function($){if(typeof $==="string")$=Buffer.from($,"utf8");let D=$.length,X=-1;for(let J=0;J<D;)X=i$.crc32update(X,$[J++]);return~X>>>0};i$.methodToString=function($){switch($){case JI.STORED:return"STORED ("+$+")";case JI.DEFLATED:return"DEFLATED ("+$+")";default:return"UNSUPPORTED ("+$+")"}};i$.canonical=function($){if(!$)return"";let D=B1.posix.normalize("/"+$.split("\\").join("/"));return B1.join(".",D)};i$.zipnamefix=function($){if(!$)return"";let D=B1.posix.normalize("/"+$.split("\\").join("/"));return B1.posix.join(".",D)};i$.findLast=function($,D){if(!Array.isArray($))throw TypeError("arr is not array");let X=$.length>>>0;for(let J=X-1;J>=0;J--)if(D($[J],J,$))return $[J];return};i$.sanitize=function($,D){$=B1.resolve(B1.normalize($));var X=D.split("/");for(var J=0,Y=X.length;J<Y;J++){var Q=B1.normalize(B1.join($,X.slice(J,Y).join(B1.sep)));if(Q.indexOf($)===0)return Q}return B1.normalize(B1.join($,B1.basename(D)))};i$.toBuffer=function(D,X){if(Buffer.isBuffer(D))return D;else if(D instanceof Uint8Array)return Buffer.from(D);else return typeof D==="string"?X(D):Buffer.alloc(0)};i$.readBigUInt64LE=function($,D){var X=Buffer.from($.slice(D,D+8));return X.swap64(),parseInt(`0x${X.toString("hex")}`)};i$.fromDOS2Date=function($){return new Date(($>>25&127)+1980,Math.max(($>>21&15)-1,0),Math.max($>>16&31,1),$>>11&31,$>>5&63,($&31)<<1)};i$.fromDate2DOS=function($){let D=0,X=0;if($.getFullYear()>1979)D=($.getFullYear()-1980&127)<<9|$.getMonth()+1<<5|$.getDate(),X=$.getHours()<<11|$.getMinutes()<<5|$.getSeconds()>>1;return D<<16|X};i$.isWin=Y$0;i$.crcTable=GI});var UI=I((UC0,HI)=>{var J$0=r("path");HI.exports=function($,{fs:D}){var X=$||"",J=Q(),Y=null;function Q(){return{directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0}}if(X&&D.existsSync(X))Y=D.statSync(X),J.directory=Y.isDirectory(),J.mtime=Y.mtime,J.atime=Y.atime,J.executable=(73&Y.mode)!==0,J.readonly=(128&Y.mode)===0,J.hidden=J$0.basename(X)[0]===".";else console.warn("Invalid path: "+X);return{get directory(){return J.directory},get readOnly(){return J.readonly},get hidden(){return J.hidden},get mtime(){return J.mtime},get atime(){return J.atime},get executable(){return J.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:X,isDirectory:J.directory,isReadOnly:J.readonly,isHidden:J.hidden,isExecutable:J.executable,mTime:J.mtime,aTime:J.atime}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}});var KI=I((FC0,FI)=>{FI.exports={efs:!0,encode:($)=>Buffer.from($,"utf8"),decode:($)=>$.toString("utf8")}});var $5=I((KC0,e9)=>{e9.exports=BI();e9.exports.Constants=Eq();e9.exports.Errors=MG();e9.exports.FileAttr=UI();e9.exports.decoder=KI()});var VI=I((qC0,qI)=>{var C4=$5(),V0=C4.Constants;qI.exports=function(){var $=20,D=10,X=0,J=0,Y=0,Q=0,G=0,W=0,B=0,H=0,U=0,K=0,q=0,V=0,z=0;$|=C4.isWin?2560:768,X|=V0.FLG_EFS;let w={extraLen:0},N=(O)=>Math.max(0,O)>>>0,L=(O)=>Math.max(0,O)&65535,Z=(O)=>Math.max(0,O)&255;return Y=C4.fromDate2DOS(new Date),{get made(){return $},set made(O){$=O},get version(){return D},set version(O){D=O},get flags(){return X},set flags(O){X=O},get flags_efs(){return(X&V0.FLG_EFS)>0},set flags_efs(O){if(O)X|=V0.FLG_EFS;else X&=~V0.FLG_EFS},get flags_desc(){return(X&V0.FLG_DESC)>0},set flags_desc(O){if(O)X|=V0.FLG_DESC;else X&=~V0.FLG_DESC},get method(){return J},set method(O){switch(O){case V0.STORED:this.version=10;case V0.DEFLATED:default:this.version=20}J=O},get time(){return C4.fromDOS2Date(this.timeval)},set time(O){this.timeval=C4.fromDate2DOS(O)},get timeval(){return Y},set timeval(O){Y=N(O)},get timeHighByte(){return Z(Y>>>8)},get crc(){return Q},set crc(O){Q=N(O)},get compressedSize(){return G},set compressedSize(O){G=N(O)},get size(){return W},set size(O){W=N(O)},get fileNameLength(){return B},set fileNameLength(O){B=O},get extraLength(){return H},set extraLength(O){H=O},get extraLocalLength(){return w.extraLen},set extraLocalLength(O){w.extraLen=O},get commentLength(){return U},set commentLength(O){U=O},get diskNumStart(){return K},set diskNumStart(O){K=N(O)},get inAttr(){return q},set inAttr(O){q=N(O)},get attr(){return V},set attr(O){V=N(O)},get fileAttr(){return(V||0)>>16&4095},get offset(){return z},set offset(O){z=N(O)},get encrypted(){return(X&V0.FLG_ENC)===V0.FLG_ENC},get centralHeaderSize(){return V0.CENHDR+B+H+U},get realDataOffset(){return z+V0.LOCHDR+w.fnameLen+w.extraLen},get localHeader(){return w},loadLocalHeaderFromBinary:function(O){var R=O.slice(z,z+V0.LOCHDR);if(R.readUInt32LE(0)!==V0.LOCSIG)throw C4.Errors.INVALID_LOC();w.version=R.readUInt16LE(V0.LOCVER),w.flags=R.readUInt16LE(V0.LOCFLG),w.method=R.readUInt16LE(V0.LOCHOW),w.time=R.readUInt32LE(V0.LOCTIM),w.crc=R.readUInt32LE(V0.LOCCRC),w.compressedSize=R.readUInt32LE(V0.LOCSIZ),w.size=R.readUInt32LE(V0.LOCLEN),w.fnameLen=R.readUInt16LE(V0.LOCNAM),w.extraLen=R.readUInt16LE(V0.LOCEXT);let E=z+V0.LOCHDR+w.fnameLen,v=E+w.extraLen;return O.slice(E,v)},loadFromBinary:function(O){if(O.length!==V0.CENHDR||O.readUInt32LE(0)!==V0.CENSIG)throw C4.Errors.INVALID_CEN();$=O.readUInt16LE(V0.CENVEM),D=O.readUInt16LE(V0.CENVER),X=O.readUInt16LE(V0.CENFLG),J=O.readUInt16LE(V0.CENHOW),Y=O.readUInt32LE(V0.CENTIM),Q=O.readUInt32LE(V0.CENCRC),G=O.readUInt32LE(V0.CENSIZ),W=O.readUInt32LE(V0.CENLEN),B=O.readUInt16LE(V0.CENNAM),H=O.readUInt16LE(V0.CENEXT),U=O.readUInt16LE(V0.CENCOM),K=O.readUInt16LE(V0.CENDSK),q=O.readUInt16LE(V0.CENATT),V=O.readUInt32LE(V0.CENATX),z=O.readUInt32LE(V0.CENOFF)},localHeaderToBinary:function(){var O=Buffer.alloc(V0.LOCHDR);return O.writeUInt32LE(V0.LOCSIG,0),O.writeUInt16LE(D,V0.LOCVER),O.writeUInt16LE(X,V0.LOCFLG),O.writeUInt16LE(J,V0.LOCHOW),O.writeUInt32LE(Y,V0.LOCTIM),O.writeUInt32LE(Q,V0.LOCCRC),O.writeUInt32LE(G,V0.LOCSIZ),O.writeUInt32LE(W,V0.LOCLEN),O.writeUInt16LE(B,V0.LOCNAM),O.writeUInt16LE(w.extraLen,V0.LOCEXT),O},centralHeaderToBinary:function(){var O=Buffer.alloc(V0.CENHDR+B+H+U);return O.writeUInt32LE(V0.CENSIG,0),O.writeUInt16LE($,V0.CENVEM),O.writeUInt16LE(D,V0.CENVER),O.writeUInt16LE(X,V0.CENFLG),O.writeUInt16LE(J,V0.CENHOW),O.writeUInt32LE(Y,V0.CENTIM),O.writeUInt32LE(Q,V0.CENCRC),O.writeUInt32LE(G,V0.CENSIZ),O.writeUInt32LE(W,V0.CENLEN),O.writeUInt16LE(B,V0.CENNAM),O.writeUInt16LE(H,V0.CENEXT),O.writeUInt16LE(U,V0.CENCOM),O.writeUInt16LE(K,V0.CENDSK),O.writeUInt16LE(q,V0.CENATT),O.writeUInt32LE(V,V0.CENATX),O.writeUInt32LE(z,V0.CENOFF),O},toJSON:function(){let O=function(R){return R+" bytes"};return{made:$,version:D,flags:X,method:C4.methodToString(J),time:this.time,crc:"0x"+Q.toString(16).toUpperCase(),compressedSize:O(G),size:O(W),fileNameLength:O(B),extraLength:O(H),commentLength:O(U),diskNumStart:K,inAttr:q,attr:V,offset:z,centralHeaderSize:O(V0.CENHDR+B+H+U)}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}});var wI=I((VC0,zI)=>{var D5=$5(),l$=D5.Constants;zI.exports=function(){var $=0,D=0,X=0,J=0,Y=0;return{get diskEntries(){return $},set diskEntries(Q){$=D=Q},get totalEntries(){return D},set totalEntries(Q){D=$=Q},get size(){return X},set size(Q){X=Q},get offset(){return J},set offset(Q){J=Q},get commentLength(){return Y},set commentLength(Q){Y=Q},get mainHeaderSize(){return l$.ENDHDR+Y},loadFromBinary:function(Q){if((Q.length!==l$.ENDHDR||Q.readUInt32LE(0)!==l$.ENDSIG)&&(Q.length<l$.ZIP64HDR||Q.readUInt32LE(0)!==l$.ZIP64SIG))throw D5.Errors.INVALID_END();if(Q.readUInt32LE(0)===l$.ENDSIG)$=Q.readUInt16LE(l$.ENDSUB),D=Q.readUInt16LE(l$.ENDTOT),X=Q.readUInt32LE(l$.ENDSIZ),J=Q.readUInt32LE(l$.ENDOFF),Y=Q.readUInt16LE(l$.ENDCOM);else $=D5.readBigUInt64LE(Q,l$.ZIP64SUB),D=D5.readBigUInt64LE(Q,l$.ZIP64TOT),X=D5.readBigUInt64LE(Q,l$.ZIP64SIZE),J=D5.readBigUInt64LE(Q,l$.ZIP64OFF),Y=0},toBinary:function(){var Q=Buffer.alloc(l$.ENDHDR+Y);return Q.writeUInt32LE(l$.ENDSIG,0),Q.writeUInt32LE(0,4),Q.writeUInt16LE($,l$.ENDSUB),Q.writeUInt16LE(D,l$.ENDTOT),Q.writeUInt32LE(X,l$.ENDSIZ),Q.writeUInt32LE(J,l$.ENDOFF),Q.writeUInt16LE(Y,l$.ENDCOM),Q.fill(" ",l$.ENDHDR),Q},toJSON:function(){let Q=function(G,W){let B=G.toString(16).toUpperCase();while(B.length<W)B="0"+B;return"0x"+B};return{diskEntries:$,totalEntries:D,size:X+" bytes",offset:Q(J,4),commentLength:Y}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}});var Rq=I((Q$0)=>{Q$0.EntryHeader=VI();Q$0.MainHeader=wI()});var OI=I((wC0,NI)=>{NI.exports=function($){var D=r("zlib"),X={chunkSize:(parseInt($.length/1024)+1)*1024};return{deflate:function(){return D.deflateRawSync($,X)},deflateAsync:function(J){var Y=D.createDeflateRaw(X),Q=[],G=0;Y.on("data",function(W){Q.push(W),G+=W.length}),Y.on("end",function(){var W=Buffer.alloc(G),B=0;W.fill(0);for(var H=0;H<Q.length;H++){var U=Q[H];U.copy(W,B),B+=U.length}J&&J(W)}),Y.end($)}}}});var ZI=I((NC0,LI)=>{var B$0=+(process.versions?process.versions.node:"").split(".")[0]||0;LI.exports=function($,D){var X=r("zlib");let J=B$0>=15&&D>0?{maxOutputLength:D}:{};return{inflate:function(){return X.inflateRawSync($,J)},inflateAsync:function(Y){var Q=X.createInflateRaw(J),G=[],W=0;Q.on("data",function(B){G.push(B),W+=B.length}),Q.on("end",function(){var B=Buffer.alloc(W),H=0;B.fill(0);for(var U=0;U<G.length;U++){var K=G[U];K.copy(B,H),H+=K.length}Y&&Y(B)}),Q.end($)}}}});var RI=I((OC0,EI)=>{var{randomFillSync:MI}=r("crypto"),H$0=MG(),U$0=new Uint32Array(256).map(($,D)=>{for(let X=0;X<8;X++)if((D&1)!==0)D=D>>>1^3988292384;else D>>>=1;return D>>>0}),jI=($,D)=>Math.imul($,D)>>>0,AI=($,D)=>{return U$0[($^D)&255]^$>>>8},JX=()=>{if(typeof MI==="function")return MI(Buffer.alloc(12));else return JX.node()};JX.node=()=>{let $=Buffer.alloc(12),D=$.length;for(let X=0;X<D;X++)$[X]=Math.random()*256&255;return $};var AG={genSalt:JX};function jG($){let D=Buffer.isBuffer($)?$:Buffer.from($);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let X=0;X<D.length;X++)this.updateKeys(D[X])}jG.prototype.updateKeys=function($){let D=this.keys;return D[0]=AI(D[0],$),D[1]+=D[0]&255,D[1]=jI(D[1],134775813)+1,D[2]=AI(D[2],D[1]>>>24),$};jG.prototype.next=function(){let $=(this.keys[2]|2)>>>0;return jI($,$^1)>>8&255};function F$0($){let D=new jG($);return function(X){let J=Buffer.alloc(X.length),Y=0;for(let Q of X)J[Y++]=D.updateKeys(Q^D.next());return J}}function K$0($){let D=new jG($);return function(X,J,Y=0){if(!J)J=Buffer.alloc(X.length);for(let Q of X){let G=D.next();J[Y++]=Q^G,D.updateKeys(Q)}return J}}function q$0($,D,X){if(!$||!Buffer.isBuffer($)||$.length<12)return Buffer.alloc(0);let J=F$0(X),Y=J($.slice(0,12)),Q=(D.flags&8)===8?D.timeHighByte:D.crc>>>24;if(Y[11]!==Q)throw H$0.WRONG_PASSWORD();return J($.slice(12))}function V$0($){if(Buffer.isBuffer($)&&$.length>=12)AG.genSalt=function(){return $.slice(0,12)};else if($==="node")AG.genSalt=JX.node;else AG.genSalt=JX}function z$0($,D,X,J=!1){if($==null)$=Buffer.alloc(0);if(!Buffer.isBuffer($))$=Buffer.from($.toString());let Y=K$0(X),Q=AG.genSalt();if(Q[11]=D.crc>>>24&255,J)Q[10]=D.crc>>>16&255;let G=Buffer.alloc($.length+12);return Y(Q,G),Y($,G,12)}EI.exports={decrypt:q$0,encrypt:z$0,_salter:V$0}});var TI=I((w$0)=>{w$0.Deflater=OI();w$0.Inflater=ZI();w$0.ZipCrypto=RI()});var Iq=I((ZC0,II)=>{var K$=$5(),Z$0=Rq(),p$=K$.Constants,Tq=TI();II.exports=function($,D){var X=new Z$0.EntryHeader,J=Buffer.alloc(0),Y=Buffer.alloc(0),Q=!1,G=null,W=Buffer.alloc(0),B=Buffer.alloc(0),H=!0;let U=$,K=typeof U.decoder==="object"?U.decoder:K$.decoder;H=K.hasOwnProperty("efs")?K.efs:!1;function q(){if(!D||!(D instanceof Uint8Array))return Buffer.alloc(0);return B=X.loadLocalHeaderFromBinary(D),D.slice(X.realDataOffset,X.realDataOffset+X.compressedSize)}function V(O){if(!X.flags_desc){if(K$.crc32(O)!==X.localHeader.crc)return!1}else{let R={},E=X.realDataOffset+X.compressedSize;if(D.readUInt32LE(E)==p$.LOCSIG||D.readUInt32LE(E)==p$.CENSIG)throw K$.Errors.DESCRIPTOR_NOT_EXIST();if(D.readUInt32LE(E)==p$.EXTSIG)R.crc=D.readUInt32LE(E+p$.EXTCRC),R.compressedSize=D.readUInt32LE(E+p$.EXTSIZ),R.size=D.readUInt32LE(E+p$.EXTLEN);else if(D.readUInt16LE(E+12)===19280)R.crc=D.readUInt32LE(E+p$.EXTCRC-4),R.compressedSize=D.readUInt32LE(E+p$.EXTSIZ-4),R.size=D.readUInt32LE(E+p$.EXTLEN-4);else throw K$.Errors.DESCRIPTOR_UNKNOWN();if(R.compressedSize!==X.compressedSize||R.size!==X.size||R.crc!==X.crc)throw K$.Errors.DESCRIPTOR_FAULTY();if(K$.crc32(O)!==R.crc)return!1}return!0}function z(O,R,E){if(typeof R>"u"&&typeof O==="string")E=O,O=void 0;if(Q){if(O&&R)R(Buffer.alloc(0),K$.Errors.DIRECTORY_CONTENT_ERROR());return Buffer.alloc(0)}var v=q();if(v.length===0){if(O&&R)R(v);return v}if(X.encrypted){if(typeof E!=="string"&&!Buffer.isBuffer(E))throw K$.Errors.INVALID_PASS_PARAM();v=Tq.ZipCrypto.decrypt(v,X,E)}var S=Buffer.alloc(X.size);switch(X.method){case K$.Constants.STORED:if(v.copy(S),!V(S)){if(O&&R)R(S,K$.Errors.BAD_CRC());throw K$.Errors.BAD_CRC()}else{if(O&&R)R(S);return S}case K$.Constants.DEFLATED:var _=new Tq.Inflater(v,X.size);if(!O){if(_.inflate(S).copy(S,0),!V(S))throw K$.Errors.BAD_CRC(`"${K.decode(J)}"`);return S}else _.inflateAsync(function(x){if(x.copy(x,0),R)if(!V(x))R(x,K$.Errors.BAD_CRC());else R(x)});break;default:if(O&&R)R(Buffer.alloc(0),K$.Errors.UNKNOWN_METHOD());throw K$.Errors.UNKNOWN_METHOD()}}function w(O,R){if((!G||!G.length)&&Buffer.isBuffer(D)){if(O&&R)R(q());return q()}if(G.length&&!Q){var E;switch(X.method){case K$.Constants.STORED:if(X.compressedSize=X.size,E=Buffer.alloc(G.length),G.copy(E),O&&R)R(E);return E;default:case K$.Constants.DEFLATED:var v=new Tq.Deflater(G);if(!O){var S=v.deflate();return X.compressedSize=S.length,S}else v.deflateAsync(function(_){E=Buffer.alloc(_.length),X.compressedSize=_.length,_.copy(E),R&&R(E)});v=null;break}}else if(O&&R)R(Buffer.alloc(0));else return Buffer.alloc(0)}function N(O,R){return(O.readUInt32LE(R+4)<<4)+O.readUInt32LE(R)}function L(O){try{var R=0,E,v,S;while(R+4<O.length)if(E=O.readUInt16LE(R),R+=2,v=O.readUInt16LE(R),R+=2,S=O.slice(R,R+v),R+=v,p$.ID_ZIP64===E)Z(S)}catch(_){throw K$.Errors.EXTRA_FIELD_PARSE_ERROR()}}function Z(O){var R,E,v,S;if(O.length>=p$.EF_ZIP64_SCOMP){if(R=N(O,p$.EF_ZIP64_SUNCOMP),X.size===p$.EF_ZIP64_OR_32)X.size=R}if(O.length>=p$.EF_ZIP64_RHO){if(E=N(O,p$.EF_ZIP64_SCOMP),X.compressedSize===p$.EF_ZIP64_OR_32)X.compressedSize=E}if(O.length>=p$.EF_ZIP64_DSN){if(v=N(O,p$.EF_ZIP64_RHO),X.offset===p$.EF_ZIP64_OR_32)X.offset=v}if(O.length>=p$.EF_ZIP64_DSN+4){if(S=O.readUInt32LE(p$.EF_ZIP64_DSN),X.diskNumStart===p$.EF_ZIP64_OR_16)X.diskNumStart=S}}return{get entryName(){return K.decode(J)},get rawEntryName(){return J},set entryName(O){J=K$.toBuffer(O,K.encode);var R=J[J.length-1];Q=R===47||R===92,X.fileNameLength=J.length},get efs(){if(typeof H==="function")return H(this.entryName);else return H},get extra(){return W},set extra(O){W=O,X.extraLength=O.length,L(O)},get comment(){return K.decode(Y)},set comment(O){if(Y=K$.toBuffer(O,K.encode),X.commentLength=Y.length,Y.length>65535)throw K$.Errors.COMMENT_TOO_LONG()},get name(){var O=K.decode(J);return Q?O.substr(O.length-1).split("/").pop():O.split("/").pop()},get isDirectory(){return Q},getCompressedData:function(){return w(!1,null)},getCompressedDataAsync:function(O){w(!0,O)},setData:function(O){if(G=K$.toBuffer(O,K$.decoder.encode),!Q&&G.length)X.size=G.length,X.method=K$.Constants.DEFLATED,X.crc=K$.crc32(O),X.changed=!0;else X.method=K$.Constants.STORED},getData:function(O){if(X.changed)return G;else return z(!1,null,O)},getDataAsync:function(O,R){if(X.changed)O(G);else z(!0,O,R)},set attr(O){X.attr=O},get attr(){return X.attr},set header(O){X.loadFromBinary(O)},get header(){return X},packCentralHeader:function(){X.flags_efs=this.efs,X.extraLength=W.length;var O=X.centralHeaderToBinary(),R=K$.Constants.CENHDR;return J.copy(O,R),R+=J.length,W.copy(O,R),R+=X.extraLength,Y.copy(O,R),O},packLocalHeader:function(){let O=0;X.flags_efs=this.efs,X.extraLocalLength=B.length;let R=X.localHeaderToBinary(),E=Buffer.alloc(R.length+J.length+X.extraLocalLength);return R.copy(E,O),O+=R.length,J.copy(E,O),O+=J.length,B.copy(E,O),O+=B.length,E},toJSON:function(){let O=function(R){return"<"+(R&&R.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:X.toJSON(),compressedData:O(D),data:O(G)}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}});var vI=I((MC0,PI)=>{var SI=Iq(),M$0=Rq(),w1=$5();PI.exports=function($,D){var X=[],J={},Y=Buffer.alloc(0),Q=new M$0.MainHeader,G=!1,W=null;let B=new Set,H=D,{noSort:U,decoder:K}=H;if($)z(H.readEntries);else G=!0;function q(){let N=new Set;for(let L of Object.keys(J)){let Z=L.split("/");if(Z.pop(),!Z.length)continue;for(let O=0;O<Z.length;O++){let R=Z.slice(0,O+1).join("/")+"/";N.add(R)}}for(let L of N)if(!(L in J)){let Z=new SI(H);Z.entryName=L,Z.attr=16,Z.temporary=!0,X.push(Z),J[Z.entryName]=Z,B.add(Z)}}function V(){if(G=!0,J={},Q.diskEntries>($.length-Q.offset)/w1.Constants.CENHDR)throw w1.Errors.DISK_ENTRY_TOO_LARGE();X=Array(Q.diskEntries);var N=Q.offset;for(var L=0;L<X.length;L++){var Z=N,O=new SI(H,$);if(O.header=$.slice(Z,Z+=w1.Constants.CENHDR),O.entryName=$.slice(Z,Z+=O.header.fileNameLength),O.header.extraLength)O.extra=$.slice(Z,Z+=O.header.extraLength);if(O.header.commentLength)O.comment=$.slice(Z,Z+O.header.commentLength);N+=O.header.centralHeaderSize,X[L]=O,J[O.entryName]=O}B.clear(),q()}function z(N){var L=$.length-w1.Constants.ENDHDR,Z=Math.max(0,L-65535),O=Z,R=$.length,E=-1,v=0;if(typeof H.trailingSpace==="boolean"?H.trailingSpace:!1)Z=0;for(L;L>=O;L--){if($[L]!==80)continue;if($.readUInt32LE(L)===w1.Constants.ENDSIG){E=L,v=L,R=L+w1.Constants.ENDHDR,O=L-w1.Constants.END64HDR;continue}if($.readUInt32LE(L)===w1.Constants.END64SIG){O=Z;continue}if($.readUInt32LE(L)===w1.Constants.ZIP64SIG){E=L,R=L+w1.readBigUInt64LE($,L+w1.Constants.ZIP64SIZE)+w1.Constants.ZIP64LEAD;break}}if(E==-1)throw w1.Errors.INVALID_FORMAT();if(Q.loadFromBinary($.slice(E,R)),Q.commentLength)Y=$.slice(v+w1.Constants.ENDHDR);if(N)V()}function w(){if(X.length>1&&!U)X.sort((N,L)=>N.entryName.toLowerCase().localeCompare(L.entryName.toLowerCase()))}return{get entries(){if(!G)V();return X.filter((N)=>!B.has(N))},get comment(){return K.decode(Y)},set comment(N){Y=w1.toBuffer(N,K.encode),Q.commentLength=Y.length},getEntryCount:function(){if(!G)return Q.diskEntries;return X.length},forEach:function(N){this.entries.forEach(N)},getEntry:function(N){if(!G)V();return J[N]||null},setEntry:function(N){if(!G)V();X.push(N),J[N.entryName]=N,Q.totalEntries=X.length},deleteFile:function(N,L=!0){if(!G)V();let Z=J[N];this.getEntryChildren(Z,L).map((R)=>R.entryName).forEach(this.deleteEntry)},deleteEntry:function(N){if(!G)V();let L=J[N],Z=X.indexOf(L);if(Z>=0)X.splice(Z,1),delete J[N],Q.totalEntries=X.length},getEntryChildren:function(N,L=!0){if(!G)V();if(typeof N==="object")if(N.isDirectory&&L){let Z=[],O=N.entryName;for(let R of X)if(R.entryName.startsWith(O))Z.push(R);return Z}else return[N];return[]},getChildCount:function(N){if(N&&N.isDirectory){let L=this.getEntryChildren(N);return L.includes(N)?L.length-1:L.length}return 0},compressToBuffer:function(){if(!G)V();w();let N=[],L=[],Z=0,O=0;Q.size=0,Q.offset=0;let R=0;for(let S of this.entries){let _=S.getCompressedData();S.header.offset=O;let x=S.packLocalHeader(),h=x.length+_.length;O+=h,N.push(x),N.push(_);let P=S.packCentralHeader();L.push(P),Q.size+=P.length,Z+=h+P.length,R++}Z+=Q.mainHeaderSize,Q.offset=O,Q.totalEntries=R,O=0;let E=Buffer.alloc(Z);for(let S of N)S.copy(E,O),O+=S.length;for(let S of L)S.copy(E,O),O+=S.length;let v=Q.toBinary();if(Y)Y.copy(v,w1.Constants.ENDHDR);return v.copy(E,O),$=E,G=!1,E},toAsyncBuffer:function(N,L,Z,O){try{if(!G)V();w();let R=[],E=[],v=0,S=0,_=0;Q.size=0,Q.offset=0;let x=function(h){if(h.length>0){let P=h.shift(),a=P.entryName+P.extra.toString();if(Z)Z(a);P.getCompressedDataAsync(function(d){if(O)O(a);P.header.offset=S;let i=P.packLocalHeader(),k=i.length+d.length;S+=k,R.push(i),R.push(d);let M=P.packCentralHeader();E.push(M),Q.size+=M.length,v+=k+M.length,_++,x(h)})}else{v+=Q.mainHeaderSize,Q.offset=S,Q.totalEntries=_,S=0;let P=Buffer.alloc(v);R.forEach(function(d){d.copy(P,S),S+=d.length}),E.forEach(function(d){d.copy(P,S),S+=d.length});let a=Q.toBinary();if(Y)Y.copy(a,w1.Constants.ENDHDR);a.copy(P,S),$=P,G=!1,N(P)}};x(Array.from(this.entries))}catch(R){L(R)}}}}});var Sq=I((AC0,_I)=>{var c$=$5(),r$=r("path"),A$0=Iq(),j$0=vI(),P8=(...$)=>c$.findLast($,(D)=>typeof D==="boolean"),CI=(...$)=>c$.findLast($,(D)=>typeof D==="string"),E$0=(...$)=>c$.findLast($,(D)=>typeof D==="function"),R$0={noSort:!1,readEntries:!1,method:c$.Constants.NONE,fs:null};_I.exports=function($,D){let X=null,J=Object.assign(Object.create(null),R$0);if($&&typeof $==="object"){if(!($ instanceof Uint8Array)){if(Object.assign(J,$),$=J.input?J.input:void 0,J.input)delete J.input}if(Buffer.isBuffer($))X=$,J.method=c$.Constants.BUFFER,$=void 0}Object.assign(J,D);let Y=new c$(J);if(typeof J.decoder!=="object"||typeof J.decoder.encode!=="function"||typeof J.decoder.decode!=="function")J.decoder=c$.decoder;if($&&typeof $==="string")if(Y.fs.existsSync($))J.method=c$.Constants.FILE,J.filename=$,X=Y.fs.readFileSync($);else throw c$.Errors.INVALID_FILENAME();let Q=new j$0(X,J),{canonical:G,sanitize:W,zipnamefix:B}=c$;function H(V){if(V&&Q){var z;if(typeof V==="string")z=Q.getEntry(r$.posix.normalize(V));if(typeof V==="object"&&typeof V.entryName<"u"&&typeof V.header<"u")z=Q.getEntry(V.entryName);if(z)return z}return null}function U(V){let{join:z,normalize:w,sep:N}=r$.posix;return z(".",w(N+V.split("\\").join(N)+N))}function K(V){if(V instanceof RegExp)return function(z){return function(w){return z.test(w)}}(V);else if(typeof V!=="function")return()=>!0;return V}let q=(V,z)=>{let w=z.slice(-1);return w=w===Y.sep?Y.sep:"",r$.relative(V,z)+w};return{readFile:function(V,z){var w=H(V);return w&&w.getData(z)||null},childCount:function(V){let z=H(V);if(z)return Q.getChildCount(z)},readFileAsync:function(V,z){var w=H(V);if(w)w.getDataAsync(z);else z(null,"getEntry failed for:"+V)},readAsText:function(V,z){var w=H(V);if(w){var N=w.getData();if(N&&N.length)return N.toString(z||"utf8")}return""},readAsTextAsync:function(V,z,w){var N=H(V);if(N)N.getDataAsync(function(L,Z){if(Z){z(L,Z);return}if(L&&L.length)z(L.toString(w||"utf8"));else z("")});else z("")},deleteFile:function(V,z=!0){var w=H(V);if(w)Q.deleteFile(w.entryName,z)},deleteEntry:function(V){var z=H(V);if(z)Q.deleteEntry(z.entryName)},addZipComment:function(V){Q.comment=V},getZipComment:function(){return Q.comment||""},addZipEntryComment:function(V,z){var w=H(V);if(w)w.comment=z},getZipEntryComment:function(V){var z=H(V);if(z)return z.comment||"";return""},updateFile:function(V,z){var w=H(V);if(w)w.setData(z)},addLocalFile:function(V,z,w,N){if(Y.fs.existsSync(V)){z=z?U(z):"";let L=r$.win32.basename(r$.win32.normalize(V));z+=w?w:L;let Z=Y.fs.statSync(V),O=Z.isFile()?Y.fs.readFileSync(V):Buffer.alloc(0);if(Z.isDirectory())z+=Y.sep;this.addFile(z,O,N,Z)}else throw c$.Errors.FILE_NOT_FOUND(V)},addLocalFileAsync:function(V,z){V=typeof V==="object"?V:{localPath:V};let w=r$.resolve(V.localPath),{comment:N}=V,{zipPath:L,zipName:Z}=V,O=this;Y.fs.stat(w,function(R,E){if(R)return z(R,!1);L=L?U(L):"";let v=r$.win32.basename(r$.win32.normalize(w));if(L+=Z?Z:v,E.isFile())Y.fs.readFile(w,function(S,_){if(S)return z(S,!1);return O.addFile(L,_,N,E),setImmediate(z,void 0,!0)});else if(E.isDirectory())return L+=Y.sep,O.addFile(L,Buffer.alloc(0),N,E),setImmediate(z,void 0,!0)})},addLocalFolder:function(V,z,w){if(w=K(w),z=z?U(z):"",V=r$.normalize(V),Y.fs.existsSync(V)){let N=Y.findFiles(V),L=this;if(N.length)for(let Z of N){let O=r$.join(z,q(V,Z));if(w(O))L.addLocalFile(Z,r$.dirname(O))}}else throw c$.Errors.FILE_NOT_FOUND(V)},addLocalFolderAsync:function(V,z,w,N){N=K(N),w=w?U(w):"",V=r$.normalize(V);var L=this;Y.fs.open(V,"r",function(Z){if(Z&&Z.code==="ENOENT")z(void 0,c$.Errors.FILE_NOT_FOUND(V));else if(Z)z(void 0,Z);else{var O=Y.findFiles(V),R=-1,E=function(){if(R+=1,R<O.length){var v=O[R],S=q(V,v).split("\\").join("/");if(S=S.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),N(S))Y.fs.stat(v,function(_,x){if(_)z(void 0,_);if(x.isFile())Y.fs.readFile(v,function(h,P){if(h)z(void 0,h);else L.addFile(w+S,P,"",x),E()});else L.addFile(w+S+"/",Buffer.alloc(0),"",x),E()});else process.nextTick(()=>{E()})}else z(!0,void 0)};E()}})},addLocalFolderAsync2:function(V,z){let w=this;V=typeof V==="object"?V:{localPath:V},localPath=r$.resolve(U(V.localPath));let{zipPath:N,filter:L,namefix:Z}=V;if(L instanceof RegExp)L=function(E){return function(v){return E.test(v)}}(L);else if(typeof L!=="function")L=function(){return!0};if(N=N?U(N):"",Z=="latin1")Z=(E)=>E.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"");if(typeof Z!=="function")Z=(E)=>E;let O=(E)=>r$.join(N,Z(q(localPath,E))),R=(E)=>r$.win32.basename(r$.win32.normalize(Z(E)));Y.fs.open(localPath,"r",function(E){if(E&&E.code==="ENOENT")z(void 0,c$.Errors.FILE_NOT_FOUND(localPath));else if(E)z(void 0,E);else Y.findFilesAsync(localPath,function(v,S){if(v)return z(v);if(S=S.filter((_)=>L(O(_))),!S.length)z(void 0,!1);setImmediate(S.reverse().reduce(function(_,x){return function(h,P){if(h||P===!1)return setImmediate(_,h,!1);w.addLocalFileAsync({localPath:x,zipPath:r$.dirname(O(x)),zipName:R(x)},_)}},z))})})},addLocalFolderPromise:function(V,z){return new Promise((w,N)=>{this.addLocalFolderAsync2(Object.assign({localPath:V},z),(L,Z)=>{if(L)N(L);if(Z)w(this)})})},addFile:function(V,z,w,N){V=B(V);let L=H(V),Z=L!=null;if(!Z)L=new A$0(J),L.entryName=V;L.comment=w||"";let O=typeof N==="object"&&N instanceof Y.fs.Stats;if(O)L.header.time=N.mtime;var R=L.isDirectory?16:0;let E=L.isDirectory?16384:32768;if(O)E|=4095&N.mode;else if(typeof N==="number")E|=4095&N;else E|=L.isDirectory?493:420;if(R=(R|E<<16)>>>0,L.attr=R,L.setData(z),!Z)Q.setEntry(L);return L},getEntries:function(V){return Q.password=V,Q?Q.entries:[]},getEntry:function(V){return H(V)},getEntryCount:function(){return Q.getEntryCount()},forEach:function(V){return Q.forEach(V)},extractEntryTo:function(V,z,w,N,L,Z){N=P8(!1,N),L=P8(!1,L),w=P8(!0,w),Z=CI(L,Z);var O=H(V);if(!O)throw c$.Errors.NO_ENTRY();var R=G(O.entryName),E=W(z,Z&&!O.isDirectory?Z:w?R:r$.basename(R));if(O.isDirectory){var v=Q.getEntryChildren(O);return v.forEach(function(x){if(x.isDirectory)return;var h=x.getData();if(!h)throw c$.Errors.CANT_EXTRACT_FILE();var P=G(x.entryName),a=W(z,w?P:r$.basename(P));let d=L?x.header.fileAttr:void 0;Y.writeFileTo(a,h,N,d)}),!0}var S=O.getData(Q.password);if(!S)throw c$.Errors.CANT_EXTRACT_FILE();if(Y.fs.existsSync(E)&&!N)throw c$.Errors.CANT_OVERRIDE();let _=L?V.header.fileAttr:void 0;return Y.writeFileTo(E,S,N,_),!0},test:function(V){if(!Q)return!1;for(var z in Q.entries)try{if(z.isDirectory)continue;var w=Q.entries[z].getData(V);if(!w)return!1}catch(N){return!1}return!0},extractAllTo:function(V,z,w,N){if(w=P8(!1,w),N=CI(w,N),z=P8(!1,z),!Q)throw c$.Errors.NO_ZIP();Q.entries.forEach(function(L){var Z=W(V,G(L.entryName));if(L.isDirectory){Y.makeDir(Z);return}var O=L.getData(N);if(!O)throw c$.Errors.CANT_EXTRACT_FILE();let R=w?L.header.fileAttr:void 0;Y.writeFileTo(Z,O,z,R);try{Y.fs.utimesSync(Z,L.header.time,L.header.time)}catch(E){throw c$.Errors.CANT_EXTRACT_FILE()}})},extractAllToAsync:function(V,z,w,N){if(N=E$0(z,w,N),w=P8(!1,w),z=P8(!1,z),!N)return new Promise((E,v)=>{this.extractAllToAsync(V,z,w,function(S){if(S)v(S);else E(this)})});if(!Q){N(c$.Errors.NO_ZIP());return}V=r$.resolve(V);let L=(E)=>W(V,r$.normalize(G(E.entryName))),Z=(E,v)=>Error(E+': "'+v+'"'),O=[],R=[];Q.entries.forEach((E)=>{if(E.isDirectory)O.push(E);else R.push(E)});for(let E of O){let v=L(E),S=w?E.header.fileAttr:void 0;try{if(Y.makeDir(v),S)Y.fs.chmodSync(v,S);Y.fs.utimesSync(v,E.header.time,E.header.time)}catch(_){N(Z("Unable to create folder",v))}}R.reverse().reduce(function(E,v){return function(S){if(S)E(S);else{let _=r$.normalize(G(v.entryName)),x=W(V,_);v.getDataAsync(function(h,P){if(P)E(P);else if(!h)E(c$.Errors.CANT_EXTRACT_FILE());else{let a=w?v.header.fileAttr:void 0;Y.writeFileToAsync(x,h,z,a,function(d){if(!d)E(Z("Unable to write file",x));Y.fs.utimes(x,v.header.time,v.header.time,function(i){if(i)E(Z("Unable to set times",x));else E()})})}})}}},N)()},writeZip:function(V,z){if(arguments.length===1){if(typeof V==="function")z=V,V=""}if(!V&&J.filename)V=J.filename;if(!V)return;var w=Q.compressToBuffer();if(w){var N=Y.writeFileTo(V,w,!0);if(typeof z==="function")z(!N?Error("failed"):null,"")}},writeZipPromise:function(V,z){let{overwrite:w,perm:N}=Object.assign({overwrite:!0},z);return new Promise((L,Z)=>{if(!V&&J.filename)V=J.filename;if(!V)Z("ADM-ZIP: ZIP File Name Missing");this.toBufferPromise().then((O)=>{let R=(E)=>E?L(E):Z("ADM-ZIP: Wasn't able to write zip file");Y.writeFileToAsync(V,O,w,N,R)},Z)})},toBufferPromise:function(){return new Promise((V,z)=>{Q.toAsyncBuffer(V,z)})},toBuffer:function(V,z,w,N){if(typeof V==="function")return Q.toAsyncBuffer(V,z,w,N),null;return Q.compressToBuffer()}}}});var yI=I((jC0,bI)=>{var kI={};bI.exports=kI;var xI={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(xI).forEach(function($){var D=xI[$],X=kI[$]=[];X.open="\x1B["+D[0]+"m",X.close="\x1B["+D[1]+"m"})});var uI=I((EC0,fI)=>{fI.exports=function($,D){D=D||process.argv;var X=D.indexOf("--"),J=/^-{1,2}/.test($)?"":"--",Y=D.indexOf(J+$);return Y!==-1&&(X===-1?!0:Y<X)}});var hI=I((RC0,gI)=>{var T$0=r("os"),t6=uI(),d1=process.env,X5=void 0;if(t6("no-color")||t6("no-colors")||t6("color=false"))X5=!1;else if(t6("color")||t6("colors")||t6("color=true")||t6("color=always"))X5=!0;if("FORCE_COLOR"in d1)X5=d1.FORCE_COLOR.length===0||parseInt(d1.FORCE_COLOR,10)!==0;function I$0($){if($===0)return!1;return{level:$,hasBasic:!0,has256:$>=2,has16m:$>=3}}function S$0($){if(X5===!1)return 0;if(t6("color=16m")||t6("color=full")||t6("color=truecolor"))return 3;if(t6("color=256"))return 2;if($&&!$.isTTY&&X5!==!0)return 0;var D=X5?1:0;if(process.platform==="win32"){var X=T$0.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(X[0])>=10&&Number(X[2])>=10586)return Number(X[2])>=14931?3:2;return 1}if("CI"in d1){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(Y){return Y in d1})||d1.CI_NAME==="codeship")return 1;return D}if("TEAMCITY_VERSION"in d1)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(d1.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in d1){var J=parseInt((d1.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(d1.TERM_PROGRAM){case"iTerm.app":return J>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(d1.TERM))return 2;if(/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(d1.TERM))return 1;if("COLORTERM"in d1)return 1;if(d1.TERM==="dumb")return D;return D}function Pq($){var D=S$0($);return I$0(D)}gI.exports={supportsColor:Pq,stdout:Pq(process.stdout),stderr:Pq(process.stderr)}});var lI=I((TC0,mI)=>{mI.exports=function(D,X){var J="";D=D||"Run the trap, drop the bass",D=D.split("");var Y={a:["@","Ą","Ⱥ","Ʌ","Δ","Λ","Д"],b:["ß","Ɓ","Ƀ","ɮ","β","฿"],c:["©","Ȼ","Ͼ"],d:["Ð","Ɗ","Ԁ","ԁ","Ԃ","ԃ"],e:["Ë","ĕ","Ǝ","ɘ","Σ","ξ","Ҽ","੬"],f:["Ӻ"],g:["ɢ"],h:["Ħ","ƕ","Ң","Һ","Ӈ","Ԋ"],i:["༏"],j:["Ĵ"],k:["ĸ","Ҡ","Ӄ","Ԟ"],l:["Ĺ"],m:["ʍ","Ӎ","ӎ","Ԡ","ԡ","൩"],n:["Ñ","ŋ","Ɲ","Ͷ","Π","Ҋ"],o:["Ø","õ","ø","Ǿ","ʘ","Ѻ","ם","۝","๏"],p:["Ƿ","Ҏ"],q:["্"],r:["®","Ʀ","Ȑ","Ɍ","ʀ","Я"],s:["§","Ϟ","ϟ","Ϩ"],t:["Ł","Ŧ","ͳ"],u:["Ʊ","Ս"],v:["ט"],w:["Ш","Ѡ","Ѽ","൰"],x:["Ҳ","Ӿ","Ӽ","ӽ"],y:["¥","Ұ","Ӌ"],z:["Ƶ","ɀ"]};return D.forEach(function(Q){Q=Q.toLowerCase();var G=Y[Q]||[" "],W=Math.floor(Math.random()*G.length);if(typeof Y[Q]<"u")J+=Y[Q][W];else J+=Q}),J}});var dI=I((IC0,cI)=>{cI.exports=function(D,X){D=D||" he is here ";var J={up:["̍","̎","̄","̅","̿","̑","̆","̐","͒","͗","͑","̇","̈","̊","͂","̓","̈","͊","͋","͌","̃","̂","̌","͐","̀","́","̋","̏","̒","̓","̔","̽","̉","ͣ","ͤ","ͥ","ͦ","ͧ","ͨ","ͩ","ͪ","ͫ","ͬ","ͭ","ͮ","ͯ","̾","͛","͆","̚"],down:["̖","̗","̘","̙","̜","̝","̞","̟","̠","̤","̥","̦","̩","̪","̫","̬","̭","̮","̯","̰","̱","̲","̳","̹","̺","̻","̼","ͅ","͇","͈","͉","͍","͎","͓","͔","͕","͖","͙","͚","̣"],mid:["̕","̛","̀","́","͘","̡","̢","̧","̨","̴","̵","̶","͜","͝","͞","͟","͠","͢","̸","̷","͡"," ҉"]},Y=[].concat(J.up,J.down,J.mid);function Q(B){var H=Math.floor(Math.random()*B);return H}function G(B){var H=!1;return Y.filter(function(U){H=U===B}),H}function W(B,H){var U="",K,q;H=H||{},H.up=typeof H.up<"u"?H.up:!0,H.mid=typeof H.mid<"u"?H.mid:!0,H.down=typeof H.down<"u"?H.down:!0,H.size=typeof H.size<"u"?H.size:"maxi",B=B.split("");for(q in B){if(G(q))continue;switch(U=U+B[q],K={up:0,down:0,mid:0},H.size){case"mini":K.up=Q(8),K.mid=Q(2),K.down=Q(8);break;case"maxi":K.up=Q(16)+3,K.mid=Q(4)+1,K.down=Q(64)+3;break;default:K.up=Q(8)+1,K.mid=Q(6)/2,K.down=Q(8)+1;break}var V=["up","mid","down"];for(var z in V){var w=V[z];for(var N=0;N<=K[w];N++)if(H[w])U=U+J[w][Q(J[w].length)]}}return U}return W(D,X)}});var iI=I((SC0,nI)=>{nI.exports=function($){return function(D,X,J){if(D===" ")return D;switch(X%3){case 0:return $.red(D);case 1:return $.white(D);case 2:return $.blue(D)}}}});var rI=I((PC0,pI)=>{pI.exports=function($){return function(D,X,J){return X%2===0?D:$.inverse(D)}}});var oI=I((vC0,aI)=>{aI.exports=function($){var D=["red","yellow","green","blue","magenta"];return function(X,J,Y){if(X===" ")return X;else return $[D[J++%D.length]](X)}}});var sI=I((CC0,tI)=>{tI.exports=function($){var D=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(X,J,Y){return X===" "?X:$[D[Math.round(Math.random()*(D.length-2))]](X)}}});var YS=I((xC0,XS)=>{var t0={};XS.exports=t0;t0.themes={};var P$0=r("util"),v8=t0.styles=yI(),eI=Object.defineProperties,v$0=new RegExp(/[\r\n]+/g);t0.supportsColor=hI().supportsColor;if(typeof t0.enabled>"u")t0.enabled=t0.supportsColor()!==!1;t0.enable=function(){t0.enabled=!0};t0.disable=function(){t0.enabled=!1};t0.stripColors=t0.strip=function($){return(""+$).replace(/\x1B\[\d+m/g,"")};var _C0=t0.stylize=function(D,X){if(!t0.enabled)return D+"";var J=v8[X];if(!J&&X in t0)return t0[X](D);return J.open+D+J.close},C$0=/[|\\{}()[\]^$+*?.]/g,_$0=function($){if(typeof $!=="string")throw TypeError("Expected a string");return $.replace(C$0,"\\$&")};function $S($){var D=function X(){return k$0.apply(X,arguments)};return D._styles=$,D.__proto__=x$0,D}var DS=function(){var $={};return v8.grey=v8.gray,Object.keys(v8).forEach(function(D){v8[D].closeRe=new RegExp(_$0(v8[D].close),"g"),$[D]={get:function(){return $S(this._styles.concat(D))}}}),$}(),x$0=eI(function(){},DS);function k$0(){var $=Array.prototype.slice.call(arguments),D=$.map(function(G){if(G!=null&&G.constructor===String)return G;else return P$0.inspect(G)}).join(" ");if(!t0.enabled||!D)return D;var X=D.indexOf(`
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capgo/cli",
3
3
  "type": "module",
4
- "version": "7.84.8",
4
+ "version": "7.84.9",
5
5
  "description": "A CLI to upload to capgo servers",
6
6
  "author": "Martin martin@capgo.app",
7
7
  "license": "Apache 2.0",
package/dist/src/sdk.js CHANGED
@@ -127,7 +127,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
127
127
  `)}),$.__defineSetter__("stack",function(X){return[X].concat($.stack).join(`
128
128
 
129
129
  `)}),$}});var Hx=T((RbD,Kx)=>{var c6=i("constants"),HQD=process.cwd,qY=null,VQD=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!qY)qY=HQD.call(process);return qY};try{process.cwd()}catch(D){}if(typeof process.chdir==="function"){if(zY=process.chdir,process.chdir=function(D){qY=null,zY.call(process,D)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,zY)}var zY;Kx.exports=NQD;function NQD(D){if(c6.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))$(D);if(!D.lutimes)X(D);if(D.chown=Q(D.chown),D.fchown=Q(D.fchown),D.lchown=Q(D.lchown),D.chmod=Y(D.chmod),D.fchmod=Y(D.fchmod),D.lchmod=Y(D.lchmod),D.chownSync=F(D.chownSync),D.fchownSync=F(D.fchownSync),D.lchownSync=F(D.lchownSync),D.chmodSync=J(D.chmodSync),D.fchmodSync=J(D.fchmodSync),D.lchmodSync=J(D.lchmodSync),D.stat=Z(D.stat),D.fstat=Z(D.fstat),D.lstat=Z(D.lstat),D.statSync=w(D.statSync),D.fstatSync=w(D.fstatSync),D.lstatSync=w(D.lstatSync),D.chmod&&!D.lchmod)D.lchmod=function(U,O,z){if(z)process.nextTick(z)},D.lchmodSync=function(){};if(D.chown&&!D.lchown)D.lchown=function(U,O,z,q){if(q)process.nextTick(q)},D.lchownSync=function(){};if(VQD==="win32")D.rename=typeof D.rename!=="function"?D.rename:function(U){function O(z,q,B){var W=Date.now(),L=0;U(z,q,function M(I){if(I&&(I.code==="EACCES"||I.code==="EPERM"||I.code==="EBUSY")&&Date.now()-W<60000){if(setTimeout(function(){D.stat(q,function(K,N){if(K&&K.code==="ENOENT")U(z,q,M);else B(I)})},L),L<100)L+=10;return}if(B)B(I)})}if(Object.setPrototypeOf)Object.setPrototypeOf(O,U);return O}(D.rename);D.read=typeof D.read!=="function"?D.read:function(U){function O(z,q,B,W,L,M){var I;if(M&&typeof M==="function"){var K=0;I=function(N,V,R){if(N&&N.code==="EAGAIN"&&K<10)return K++,U.call(D,z,q,B,W,L,I);M.apply(this,arguments)}}return U.call(D,z,q,B,W,L,I)}if(Object.setPrototypeOf)Object.setPrototypeOf(O,U);return O}(D.read),D.readSync=typeof D.readSync!=="function"?D.readSync:function(U){return function(O,z,q,B,W){var L=0;while(!0)try{return U.call(D,O,z,q,B,W)}catch(M){if(M.code==="EAGAIN"&&L<10){L++;continue}throw M}}}(D.readSync);function $(U){U.lchmod=function(O,z,q){U.open(O,c6.O_WRONLY|c6.O_SYMLINK,z,function(B,W){if(B){if(q)q(B);return}U.fchmod(W,z,function(L){U.close(W,function(M){if(q)q(L||M)})})})},U.lchmodSync=function(O,z){var q=U.openSync(O,c6.O_WRONLY|c6.O_SYMLINK,z),B=!0,W;try{W=U.fchmodSync(q,z),B=!1}finally{if(B)try{U.closeSync(q)}catch(L){}else U.closeSync(q)}return W}}function X(U){if(c6.hasOwnProperty("O_SYMLINK")&&U.futimes)U.lutimes=function(O,z,q,B){U.open(O,c6.O_SYMLINK,function(W,L){if(W){if(B)B(W);return}U.futimes(L,z,q,function(M){U.close(L,function(I){if(B)B(M||I)})})})},U.lutimesSync=function(O,z,q){var B=U.openSync(O,c6.O_SYMLINK),W,L=!0;try{W=U.futimesSync(B,z,q),L=!1}finally{if(L)try{U.closeSync(B)}catch(M){}else U.closeSync(B)}return W};else if(U.futimes)U.lutimes=function(O,z,q,B){if(B)process.nextTick(B)},U.lutimesSync=function(){}}function Y(U){if(!U)return U;return function(O,z,q){return U.call(D,O,z,function(B){if(G(B))B=null;if(q)q.apply(this,arguments)})}}function J(U){if(!U)return U;return function(O,z){try{return U.call(D,O,z)}catch(q){if(!G(q))throw q}}}function Q(U){if(!U)return U;return function(O,z,q,B){return U.call(D,O,z,q,function(W){if(G(W))W=null;if(B)B.apply(this,arguments)})}}function F(U){if(!U)return U;return function(O,z,q){try{return U.call(D,O,z,q)}catch(B){if(!G(B))throw B}}}function Z(U){if(!U)return U;return function(O,z,q){if(typeof z==="function")q=z,z=null;function B(W,L){if(L){if(L.uid<0)L.uid+=4294967296;if(L.gid<0)L.gid+=4294967296}if(q)q.apply(this,arguments)}return z?U.call(D,O,z,B):U.call(D,O,B)}}function w(U){if(!U)return U;return function(O,z){var q=z?U.call(D,O,z):U.call(D,O);if(q){if(q.uid<0)q.uid+=4294967296;if(q.gid<0)q.gid+=4294967296}return q}}function G(U){if(!U)return!0;if(U.code==="ENOSYS")return!0;var O=!process.getuid||process.getuid()!==0;if(O){if(U.code==="EINVAL"||U.code==="EPERM")return!0}return!1}}});var Lx=T((jbD,Nx)=>{var Vx=i("stream").Stream;Nx.exports=LQD;function LQD(D){return{ReadStream:$,WriteStream:X};function $(Y,J){if(!(this instanceof $))return new $(Y,J);Vx.call(this);var Q=this;this.path=Y,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,J=J||{};var F=Object.keys(J);for(var Z=0,w=F.length;Z<w;Z++){var G=F[Z];this[G]=J[G]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){Q._read()});return}D.open(this.path,this.flags,this.mode,function(U,O){if(U){Q.emit("error",U),Q.readable=!1;return}Q.fd=O,Q.emit("open",O),Q._read()})}function X(Y,J){if(!(this instanceof X))return new X(Y,J);Vx.call(this),this.path=Y,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,J=J||{};var Q=Object.keys(J);for(var F=0,Z=Q.length;F<Z;F++){var w=Q[F];this[w]=J[w]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=D.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var Ix=T((EbD,Mx)=>{Mx.exports=IQD;var MQD=Object.getPrototypeOf||function(D){return D.__proto__};function IQD(D){if(D===null||typeof D!=="object")return D;if(D instanceof Object)var $={__proto__:MQD(D)};else var $=Object.create(null);return Object.getOwnPropertyNames(D).forEach(function(X){Object.defineProperty($,X,Object.getOwnPropertyDescriptor(D,X))}),$}});var S0=T((TbD,AO)=>{var M0=i("fs"),AQD=Hx(),RQD=Lx(),jQD=Ix(),BY=i("util"),o0,KY;if(typeof Symbol==="function"&&typeof Symbol.for==="function")o0=Symbol.for("graceful-fs.queue"),KY=Symbol.for("graceful-fs.previous");else o0="___graceful-fs.queue",KY="___graceful-fs.previous";function EQD(){}function Rx(D,$){Object.defineProperty(D,o0,{get:function(){return $}})}var D8=EQD;if(BY.debuglog)D8=BY.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))D8=function(){var D=BY.format.apply(BY,arguments);D="GFS4: "+D.split(/\n/).join(`
130
- GFS4: `),console.error(D)};if(!M0[o0]){if(LO=global[o0]||[],Rx(M0,LO),M0.close=function(D){function $(X,Y){return D.call(M0,X,function(J){if(!J)Ax();if(typeof Y==="function")Y.apply(this,arguments)})}return Object.defineProperty($,KY,{value:D}),$}(M0.close),M0.closeSync=function(D){function $(X){D.apply(M0,arguments),Ax()}return Object.defineProperty($,KY,{value:D}),$}(M0.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){D8(M0[o0]),i("assert").equal(M0[o0].length,0)})}var LO;if(!global[o0])Rx(global,M0[o0]);AO.exports=MO(jQD(M0));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!M0.__patched)AO.exports=MO(M0),M0.__patched=!0;function MO(D){AQD(D),D.gracefulify=MO,D.createReadStream=V,D.createWriteStream=R;var $=D.readFile;D.readFile=X;function X(_,v,S){if(typeof v==="function")S=v,v=null;return h(_,v,S);function h(b,l,f,j){return $(b,l,function(P){if(P&&(P.code==="EMFILE"||P.code==="ENFILE"))v9([h,[b,l,f],P,j||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var Y=D.writeFile;D.writeFile=J;function J(_,v,S,h){if(typeof S==="function")h=S,S=null;return b(_,v,S,h);function b(l,f,j,P,u){return Y(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))v9([b,[l,f,j,P],y,u||Date.now(),Date.now()]);else if(typeof P==="function")P.apply(this,arguments)})}}var Q=D.appendFile;if(Q)D.appendFile=F;function F(_,v,S,h){if(typeof S==="function")h=S,S=null;return b(_,v,S,h);function b(l,f,j,P,u){return Q(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))v9([b,[l,f,j,P],y,u||Date.now(),Date.now()]);else if(typeof P==="function")P.apply(this,arguments)})}}var Z=D.copyFile;if(Z)D.copyFile=w;function w(_,v,S,h){if(typeof S==="function")h=S,S=0;return b(_,v,S,h);function b(l,f,j,P,u){return Z(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))v9([b,[l,f,j,P],y,u||Date.now(),Date.now()]);else if(typeof P==="function")P.apply(this,arguments)})}}var G=D.readdir;D.readdir=O;var U=/^v[0-5]\./;function O(_,v,S){if(typeof v==="function")S=v,v=null;var h=U.test(process.version)?function(f,j,P,u){return G(f,b(f,j,P,u))}:function(f,j,P,u){return G(f,j,b(f,j,P,u))};return h(_,v,S);function b(l,f,j,P){return function(u,y){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))v9([h,[l,f,j],u,P||Date.now(),Date.now()]);else{if(y&&y.sort)y.sort();if(typeof j==="function")j.call(this,u,y)}}}}if(process.version.substr(0,4)==="v0.8"){var z=RQD(D);M=z.ReadStream,K=z.WriteStream}var q=D.ReadStream;if(q)M.prototype=Object.create(q.prototype),M.prototype.open=I;var B=D.WriteStream;if(B)K.prototype=Object.create(B.prototype),K.prototype.open=N;Object.defineProperty(D,"ReadStream",{get:function(){return M},set:function(_){M=_},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return K},set:function(_){K=_},enumerable:!0,configurable:!0});var W=M;Object.defineProperty(D,"FileReadStream",{get:function(){return W},set:function(_){W=_},enumerable:!0,configurable:!0});var L=K;Object.defineProperty(D,"FileWriteStream",{get:function(){return L},set:function(_){L=_},enumerable:!0,configurable:!0});function M(_,v){if(this instanceof M)return q.apply(this,arguments),this;else return M.apply(Object.create(M.prototype),arguments)}function I(){var _=this;A(_.path,_.flags,_.mode,function(v,S){if(v){if(_.autoClose)_.destroy();_.emit("error",v)}else _.fd=S,_.emit("open",S),_.read()})}function K(_,v){if(this instanceof K)return B.apply(this,arguments),this;else return K.apply(Object.create(K.prototype),arguments)}function N(){var _=this;A(_.path,_.flags,_.mode,function(v,S){if(v)_.destroy(),_.emit("error",v);else _.fd=S,_.emit("open",S)})}function V(_,v){return new D.ReadStream(_,v)}function R(_,v){return new D.WriteStream(_,v)}var x=D.open;D.open=A;function A(_,v,S,h){if(typeof S==="function")h=S,S=null;return b(_,v,S,h);function b(l,f,j,P,u){return x(l,f,j,function(y,c){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))v9([b,[l,f,j,P],y,u||Date.now(),Date.now()]);else if(typeof P==="function")P.apply(this,arguments)})}}return D}function v9(D){D8("ENQUEUE",D[0].name,D[1]),M0[o0].push(D),IO()}var WY;function Ax(){var D=Date.now();for(var $=0;$<M0[o0].length;++$)if(M0[o0][$].length>2)M0[o0][$][3]=D,M0[o0][$][4]=D;IO()}function IO(){if(clearTimeout(WY),WY=void 0,M0[o0].length===0)return;var D=M0[o0].shift(),$=D[0],X=D[1],Y=D[2],J=D[3],Q=D[4];if(J===void 0)D8("RETRY",$.name,X),$.apply(null,X);else if(Date.now()-J>=60000){D8("TIMEOUT",$.name,X);var F=X.pop();if(typeof F==="function")F.call(null,Y)}else{var Z=Date.now()-Q,w=Math.max(Q-J,1),G=Math.min(w*1.2,100);if(Z>=G)D8("RETRY",$.name,X),$.apply(null,X.concat([J]));else M0[o0].push(D)}if(WY===void 0)WY=setTimeout(IO,0)}});var Ex=T((CbD,jx)=>{function e1(D,$){if(typeof $==="boolean")$={forever:$};if(this._originalTimeouts=JSON.parse(JSON.stringify(D)),this._timeouts=D,this._options=$||{},this._maxRetryTime=$&&$.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever)this._cachedTimeouts=this._timeouts.slice(0)}jx.exports=e1;e1.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};e1.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};e1.prototype.retry=function(D){if(this._timeout)clearTimeout(this._timeout);if(!D)return!1;var $=new Date().getTime();if(D&&$-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(D);var X=this._timeouts.shift();if(X===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),X=this._timeouts.shift();else return!1;var Y=this,J=setTimeout(function(){if(Y._attempts++,Y._operationTimeoutCb){if(Y._timeout=setTimeout(function(){Y._operationTimeoutCb(Y._attempts)},Y._operationTimeout),Y._options.unref)Y._timeout.unref()}Y._fn(Y._attempts)},X);if(this._options.unref)J.unref();return!0};e1.prototype.attempt=function(D,$){if(this._fn=D,$){if($.timeout)this._operationTimeout=$.timeout;if($.cb)this._operationTimeoutCb=$.cb}var X=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){X._operationTimeoutCb()},X._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};e1.prototype.try=function(D){console.log("Using RetryOperation.try() is deprecated"),this.attempt(D)};e1.prototype.start=function(D){console.log("Using RetryOperation.start() is deprecated"),this.attempt(D)};e1.prototype.start=e1.prototype.try;e1.prototype.errors=function(){return this._errors};e1.prototype.attempts=function(){return this._attempts};e1.prototype.mainError=function(){if(this._errors.length===0)return null;var D={},$=null,X=0;for(var Y=0;Y<this._errors.length;Y++){var J=this._errors[Y],Q=J.message,F=(D[Q]||0)+1;if(D[Q]=F,F>=X)$=J,X=F}return $}});var Cx=T((CQD)=>{var TQD=Ex();CQD.operation=function(D){var $=CQD.timeouts(D);return new TQD($,{forever:D&&D.forever,unref:D&&D.unref,maxRetryTime:D&&D.maxRetryTime})};CQD.timeouts=function(D){if(D instanceof Array)return[].concat(D);var $={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var X in D)$[X]=D[X];if($.minTimeout>$.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var Y=[];for(var J=0;J<$.retries;J++)Y.push(this.createTimeout(J,$));if(D&&D.forever&&!Y.length)Y.push(this.createTimeout(J,$));return Y.sort(function(Q,F){return Q-F}),Y};CQD.createTimeout=function(D,$){var X=$.randomize?Math.random()+1:1,Y=Math.round(X*$.minTimeout*Math.pow($.factor,D));return Y=Math.min(Y,$.maxTimeout),Y};CQD.wrap=function(D,$,X){if($ instanceof Array)X=$,$=null;if(!X){X=[];for(var Y in D)if(typeof D[Y]==="function")X.push(Y)}for(var J=0;J<X.length;J++){var Q=X[J],F=D[Q];D[Q]=function(w){var G=CQD.operation($),U=Array.prototype.slice.call(arguments,1),O=U.pop();U.push(function(z){if(G.retry(z))return;if(z)arguments[0]=G.mainError();O.apply(this,arguments)}),G.attempt(function(){w.apply(D,U)})}.bind(D,F),D[Q].options=$}}});var Px=T((xbD,HY)=>{HY.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")HY.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")HY.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var LY=T((SbD,k9)=>{var K0=global.process,$8=function(D){return D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function"};if(!$8(K0))k9.exports=function(){return function(){}};else{if(RO=i("assert"),X8=Px(),jO=/^win/i.test(K0.platform),_9=i("events"),typeof _9!=="function")_9=_9.EventEmitter;if(K0.__signal_exit_emitter__)g0=K0.__signal_exit_emitter__;else g0=K0.__signal_exit_emitter__=new _9,g0.count=0,g0.emitted={};if(!g0.infinite)g0.setMaxListeners(1/0),g0.infinite=!0;k9.exports=function(D,$){if(!$8(global.process))return function(){};if(RO.equal(typeof D,"function","a callback must be provided for exit handler"),J8===!1)VY();var X="exit";if($&&$.alwaysLast)X="afterexit";var Y=function(){if(g0.removeListener(X,D),g0.listeners("exit").length===0&&g0.listeners("afterexit").length===0)O3()};return g0.on(X,D),Y},O3=function(){if(!J8||!$8(global.process))return;J8=!1,X8.forEach(function($){try{K0.removeListener($,q3[$])}catch(X){}}),K0.emit=z3,K0.reallyExit=NY,g0.count-=1},k9.exports.unload=O3,d6=function($,X,Y){if(g0.emitted[$])return;g0.emitted[$]=!0,g0.emit($,X,Y)},q3={},X8.forEach(function(D){q3[D]=function(){if(!$8(global.process))return;var X=K0.listeners(D);if(X.length===g0.count){if(O3(),d6("exit",null,D),d6("afterexit",null,D),jO&&D==="SIGHUP")D="SIGINT";K0.kill(K0.pid,D)}}}),k9.exports.signals=function(){return X8},J8=!1,VY=function(){if(J8||!$8(global.process))return;J8=!0,g0.count+=1,X8=X8.filter(function($){try{return K0.on($,q3[$]),!0}catch(X){return!1}}),K0.emit=TO,K0.reallyExit=EO},k9.exports.load=VY,NY=K0.reallyExit,EO=function($){if(!$8(global.process))return;K0.exitCode=$||0,d6("exit",K0.exitCode,null),d6("afterexit",K0.exitCode,null),NY.call(K0,K0.exitCode)},z3=K0.emit,TO=function($,X){if($==="exit"&&$8(global.process)){if(X!==void 0)K0.exitCode=X;var Y=z3.apply(this,arguments);return d6("exit",K0.exitCode,null),d6("afterexit",K0.exitCode,null),Y}else return z3.apply(this,arguments)}}var RO,X8,jO,_9,g0,O3,d6,q3,J8,VY,NY,EO,z3,TO});var Sx=T((_QD,CO)=>{var xx=Symbol();function uQD(D,$,X){let Y=$[xx];if(Y)return $.stat(D,(Q,F)=>{if(Q)return X(Q);X(null,F.mtime,Y)});let J=new Date(Math.ceil(Date.now()/1000)*1000+5);$.utimes(D,J,J,(Q)=>{if(Q)return X(Q);$.stat(D,(F,Z)=>{if(F)return X(F);let w=Z.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty($,xx,{value:w}),X(null,Z.mtime,w)})})}function vQD(D){let $=Date.now();if(D==="s")$=Math.ceil($/1000)*1000;return new Date($)}_QD.probe=uQD;_QD.getMtime=vQD});var fx=T((dQD,W3)=>{var yQD=i("path"),SO=S0(),bQD=Cx(),hQD=LY(),ux=Sx(),Z6={};function B3(D,$){return $.lockfilePath||`${D}.lock`}function uO(D,$,X){if(!$.realpath)return X(null,yQD.resolve(D));$.fs.realpath(D,X)}function xO(D,$,X){let Y=B3(D,$);$.fs.mkdir(Y,(J)=>{if(!J)return ux.probe(Y,$.fs,(Q,F,Z)=>{if(Q)return $.fs.rmdir(Y,()=>{}),X(Q);X(null,F,Z)});if(J.code!=="EEXIST")return X(J);if($.stale<=0)return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));$.fs.stat(Y,(Q,F)=>{if(Q){if(Q.code==="ENOENT")return xO(D,{...$,stale:0},X);return X(Q)}if(!vx(F,$))return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));_x(D,$,(Z)=>{if(Z)return X(Z);xO(D,{...$,stale:0},X)})})})}function vx(D,$){return D.mtime.getTime()<Date.now()-$.stale}function _x(D,$,X){$.fs.rmdir(B3(D,$),(Y)=>{if(Y&&Y.code!=="ENOENT")return X(Y);X()})}function MY(D,$){let X=Z6[D];if(X.updateTimeout)return;if(X.updateDelay=X.updateDelay||$.update,X.updateTimeout=setTimeout(()=>{X.updateTimeout=null,$.fs.stat(X.lockfilePath,(Y,J)=>{let Q=X.lastUpdate+$.stale<Date.now();if(Y){if(Y.code==="ENOENT"||Q)return PO(D,X,Object.assign(Y,{code:"ECOMPROMISED"}));return X.updateDelay=1000,MY(D,$)}if(X.mtime.getTime()!==J.mtime.getTime())return PO(D,X,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let Z=ux.getMtime(X.mtimePrecision);$.fs.utimes(X.lockfilePath,Z,Z,(w)=>{let G=X.lastUpdate+$.stale<Date.now();if(X.released)return;if(w){if(w.code==="ENOENT"||G)return PO(D,X,Object.assign(w,{code:"ECOMPROMISED"}));return X.updateDelay=1000,MY(D,$)}X.mtime=Z,X.lastUpdate=Date.now(),X.updateDelay=null,MY(D,$)})})},X.updateDelay),X.updateTimeout.unref)X.updateTimeout.unref()}function PO(D,$,X){if($.released=!0,$.updateTimeout)clearTimeout($.updateTimeout);if(Z6[D]===$)delete Z6[D];$.options.onCompromised(X)}function gQD(D,$,X){$={stale:1e4,update:null,realpath:!0,retries:0,fs:SO,onCompromised:(Y)=>{throw Y},...$},$.retries=$.retries||0,$.retries=typeof $.retries==="number"?{retries:$.retries}:$.retries,$.stale=Math.max($.stale||0,2000),$.update=$.update==null?$.stale/2:$.update||0,$.update=Math.max(Math.min($.update,$.stale/2),1000),uO(D,$,(Y,J)=>{if(Y)return X(Y);let Q=bQD.operation($.retries);Q.attempt(()=>{xO(J,$,(F,Z,w)=>{if(Q.retry(F))return;if(F)return X(Q.mainError());let G=Z6[J]={lockfilePath:B3(J,$),mtime:Z,mtimePrecision:w,options:$,lastUpdate:Date.now()};MY(J,$),X(null,(U)=>{if(G.released)return U&&U(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));kx(J,{...$,realpath:!1},U)})})})})}function kx(D,$,X){$={fs:SO,realpath:!0,...$},uO(D,$,(Y,J)=>{if(Y)return X(Y);let Q=Z6[J];if(!Q)return X(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));Q.updateTimeout&&clearTimeout(Q.updateTimeout),Q.released=!0,delete Z6[J],_x(J,$,X)})}function mQD(D,$,X){$={stale:1e4,realpath:!0,fs:SO,...$},$.stale=Math.max($.stale||0,2000),uO(D,$,(Y,J)=>{if(Y)return X(Y);$.fs.stat(B3(J,$),(Q,F)=>{if(Q)return Q.code==="ENOENT"?X(null,!1):X(Q);return X(null,!vx(F,$))})})}function cQD(){return Z6}hQD(()=>{for(let D in Z6){let $=Z6[D].options;try{$.fs.rmdirSync(B3(D,$))}catch(X){}}});dQD.lock=gQD;dQD.unlock=kx;dQD.check=mQD;dQD.getLocks=cQD});var bx=T((ubD,yx)=>{var rQD=S0();function oQD(D){let $=["mkdir","realpath","stat","rmdir","utimes"],X={...D};return $.forEach((Y)=>{X[Y]=(...J)=>{let Q=J.pop(),F;try{F=D[`${Y}Sync`](...J)}catch(Z){return Q(Z)}Q(null,F)}}),X}function aQD(D){return(...$)=>new Promise((X,Y)=>{$.push((J,Q)=>{if(J)Y(J);else X(Q)}),D(...$)})}function tQD(D){return(...$)=>{let X,Y;if($.push((J,Q)=>{X=J,Y=Q}),D(...$),X)throw X;return Y}}function sQD(D){if(D={...D},D.fs=oQD(D.fs||rQD),typeof D.retries==="number"&&D.retries>0||D.retries&&typeof D.retries.retries==="number"&&D.retries.retries>0)throw Object.assign(Error("Cannot use retries with the sync api"),{code:"ESYNC"});return D}yx.exports={toPromise:aQD,toSync:tQD,toSyncOptions:sQD}});var gx=T((vbD,l6)=>{var f9=fx(),{toPromise:IY,toSync:AY,toSyncOptions:vO}=bx();async function hx(D,$){let X=await IY(f9.lock)(D,$);return IY(X)}function eQD(D,$){let X=AY(f9.lock)(D,vO($));return AY(X)}function DFD(D,$){return IY(f9.unlock)(D,$)}function $FD(D,$){return AY(f9.unlock)(D,vO($))}function XFD(D,$){return IY(f9.check)(D,$)}function JFD(D,$){return AY(f9.check)(D,vO($))}l6.exports=hx;l6.exports.lock=hx;l6.exports.unlock=DFD;l6.exports.lockSync=eQD;l6.exports.unlockSync=$FD;l6.exports.check=XFD;l6.exports.checkSync=JFD});var px=T((nx)=>{Object.defineProperty(nx,"__esModule",{value:!0});nx.canStoreURLs=nx.FileUrlStorage=void 0;var mx=i("fs"),YFD=FFD(Wx()),cx=QFD(gx());function lx(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,X=new WeakMap;return(lx=function(Y){return Y?X:$})(D)}function QFD(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var X=lx($);if(X&&X.has(D))return X.get(D);var Y={__proto__:null},J=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Q in D)if(Q!=="default"&&{}.hasOwnProperty.call(D,Q)){var F=J?Object.getOwnPropertyDescriptor(D,Q):null;F&&(F.get||F.set)?Object.defineProperty(Y,Q,F):Y[Q]=D[Q]}return Y.default=D,X&&X.set(D,Y),Y}function FFD(D){return D&&D.__esModule?D:{default:D}}function K3(D){return K3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},K3(D)}function ZFD(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function dx(D,$){for(var X=0;X<$.length;X++){var Y=$[X];if(Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y)Y.writable=!0;Object.defineProperty(D,GFD(Y.key),Y)}}function wFD(D,$,X){if($)dx(D.prototype,$);if(X)dx(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function GFD(D){var $=UFD(D,"string");return K3($)=="symbol"?$:$+""}function UFD(D,$){if(K3(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var Y=X.call(D,$||"default");if(K3(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var _bD=nx.canStoreURLs=!0,kbD=nx.FileUrlStorage=function(){function D($){ZFD(this,D),this.path=$}return wFD(D,[{key:"findAllUploads",value:function(){var X=this;return new Promise(function(Y,J){X._getItems("tus::",function(Q,F){if(Q)J(Q);else Y(F)})})}},{key:"findUploadsByFingerprint",value:function(X){var Y=this;return new Promise(function(J,Q){Y._getItems("tus::".concat(X),function(F,Z){if(F)Q(F);else J(Z)})})}},{key:"removeUpload",value:function(X){var Y=this;return new Promise(function(J,Q){Y._removeItem(X,function(F){if(F)Q(F);else J()})})}},{key:"addUpload",value:function(X,Y){var J=this,Q=Math.round(Math.random()*1000000000000),F="tus::".concat(X,"::").concat(Q);return new Promise(function(Z,w){J._setItem(F,Y,function(G){if(G)w(G);else Z(F)})})}},{key:"_setItem",value:function(X,Y,J){var Q=this;cx.lock(this.path,this._lockfileOptions()).then(function(F){J=Q._releaseAndCb(F,J),Q._getData(function(Z,w){if(Z){J(Z);return}w[X]=Y,Q._writeData(w,function(G){return J(G)})})}).catch(J)}},{key:"_getItems",value:function(X,Y){this._getData(function(J,Q){if(J){Y(J);return}var F=Object.keys(Q).filter(function(Z){return Z.startsWith(X)}).map(function(Z){var w=Q[Z];return w.urlStorageKey=Z,w});Y(null,F)})}},{key:"_removeItem",value:function(X,Y){var J=this;cx.lock(this.path,this._lockfileOptions()).then(function(Q){Y=J._releaseAndCb(Q,Y),J._getData(function(F,Z){if(F){Y(F);return}delete Z[X],J._writeData(Z,function(w){return Y(w)})})}).catch(Y)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(X,Y){return function(J){if(J){X().then(function(){return Y(J)}).catch(function(Q){return Y((0,YFD.default)([J,Q]))});return}X().then(Y).catch(Y)}}},{key:"_writeData",value:function(X,Y){var J={encoding:"utf8",mode:432,flag:"w"};(0,mx.writeFile)(this.path,JSON.stringify(X),J,function(Q){return Y(Q)})}},{key:"_getData",value:function(X){(0,mx.readFile)(this.path,"utf8",function(Y,J){if(Y){if(Y.code==="ENOENT")X(null,{});else X(Y);return}try{J=!J.trim().length?{}:JSON.parse(J)}catch(Q){X(Q);return}X(null,J)})}}])}()});var jY=T((n6)=>{Object.defineProperty(n6,"__esModule",{value:!0});Object.defineProperty(n6,"DefaultHttpStack",{enumerable:!0,get:function(){return tx.default}});Object.defineProperty(n6,"DetailedError",{enumerable:!0,get:function(){return qFD.default}});Object.defineProperty(n6,"FileUrlStorage",{enumerable:!0,get:function(){return sx.FileUrlStorage}});Object.defineProperty(n6,"StreamSource",{enumerable:!0,get:function(){return HFD.default}});n6.Upload=void 0;Object.defineProperty(n6,"canStoreURLs",{enumerable:!0,get:function(){return sx.canStoreURLs}});n6.defaultOptions=void 0;Object.defineProperty(n6,"enableDebugLog",{enumerable:!0,get:function(){return zFD.enableDebugLog}});n6.isSupported=void 0;var qFD=Y8(vU()),zFD=_U(),BFD=Y8(gT()),_O=Y8(NC()),WFD=Y8(hC()),KFD=Y8(lC()),tx=Y8(FP()),HFD=Y8(nU()),sx=px();function Y8(D){return D&&D.__esModule?D:{default:D}}function b9(D){return b9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},b9(D)}function VFD(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function rx(D,$){for(var X=0;X<$.length;X++){var Y=$[X];if(Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y)Y.writable=!0;Object.defineProperty(D,DS(Y.key),Y)}}function NFD(D,$,X){if($)rx(D.prototype,$);if(X)rx(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function LFD(D,$,X){return $=RY($),MFD(D,ex()?Reflect.construct($,X||[],RY(D).constructor):$.apply(D,X))}function MFD(D,$){if($&&(b9($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return IFD(D)}function IFD(D){if(D===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function ex(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch($){}return(ex=function(){return!!D})()}function RY(D){return RY=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(X){return X.__proto__||Object.getPrototypeOf(X)},RY(D)}function AFD(D,$){if(typeof $!=="function"&&$!==null)throw TypeError("Super expression must either be null or a function");if(D.prototype=Object.create($&&$.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),Object.defineProperty(D,"prototype",{writable:!1}),$)kO(D,$)}function kO(D,$){return kO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Y,J){return Y.__proto__=J,Y},kO(D,$)}function ox(D,$){var X=Object.keys(D);if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(D);$&&(Y=Y.filter(function(J){return Object.getOwnPropertyDescriptor(D,J).enumerable})),X.push.apply(X,Y)}return X}function y9(D){for(var $=1;$<arguments.length;$++){var X=arguments[$]!=null?arguments[$]:{};$%2?ox(Object(X),!0).forEach(function(Y){RFD(D,Y,X[Y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(X)):ox(Object(X)).forEach(function(Y){Object.defineProperty(D,Y,Object.getOwnPropertyDescriptor(X,Y))})}return D}function RFD(D,$,X){if($=DS($),$ in D)Object.defineProperty(D,$,{value:X,enumerable:!0,configurable:!0,writable:!0});else D[$]=X;return D}function DS(D){var $=jFD(D,"string");return b9($)=="symbol"?$:$+""}function jFD(D,$){if(b9(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var Y=X.call(D,$||"default");if(b9(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var ax=n6.defaultOptions=y9(y9({},_O.default.defaultOptions),{},{httpStack:new tx.default,fileReader:new WFD.default,urlStorage:new BFD.default,fingerprint:KFD.default}),ybD=n6.Upload=function(D){function $(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return VFD(this,$),Y=y9(y9({},ax),Y),LFD(this,$,[X,Y])}return AFD($,D),NFD($,null,[{key:"terminate",value:function(Y){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return J=y9(y9({},ax),J),_O.default.terminate(Y,J)}}])}(_O.default),bbD=n6.isSupported=!0});var H$;var H3=o(()=>{H$={name:"@capgo/cli",type:"module",version:"7.84.8",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLI#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/CLI.git"},bugs:{url:"https://github.com/Cap-go/CLI/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsc --noEmit",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:bundle":"bun test/test-bundle.mjs","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:mcp":"node test/test-mcp.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:payload-split":"bun test/test-payload-split.mjs",test:"bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:credentials && bun run test:credentials-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:esm-sdk && bun run test:mcp && bun run test:version-detection && bun run test:platform-paths && bun run test:payload-split"},devDependencies:{"@antfu/eslint-config":"^7.0.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.4","@capacitor/cli":"^8.0.0","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.0.0","@modelcontextprotocol/sdk":"^1.25.3","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.79.0","@types/adm-zip":"^0.5.7","@types/node":"^25.0.0","@types/prettyjson":"^0.0.33","@types/tmp":"^0.2.6","@vercel/ncc":"^0.38.4","adm-zip":"^0.5.16","ci-info":"^4.3.1",commander:"^14.0.2",eslint:"^9.38.0","git-format-staged":"4.0.1",husky:"^9.1.7","is-wsl":"^3.1.0",micromatch:"^4.0.8",open:"^11.0.0",prettyjson:"^1.2.5",tmp:"^0.2.5","tus-js-client":"^4.3.1",typescript:"^5.9.3",partysocket:"^1.1.11",ws:"^8.18.3",zod:"^4.3.6"}}});async function EY(D){try{let X=`https://registry.npmjs.org/${encodeURIComponent(D.toLowerCase())}`,Y=await fetch(X,{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"}});if(!Y.ok)return null;return(await Y.json())["dist-tags"]?.latest||null}catch{return null}}async function Z0(){let D=await EY("@capgo/cli")??"",$=D?.split(".")[0];if(D!==H$.version)H.warning(`\uD83D\uDEA8 You are using @capgo/cli@${H$.version} it's not the latest version.
130
+ GFS4: `),console.error(D)};if(!M0[o0]){if(LO=global[o0]||[],Rx(M0,LO),M0.close=function(D){function $(X,Y){return D.call(M0,X,function(J){if(!J)Ax();if(typeof Y==="function")Y.apply(this,arguments)})}return Object.defineProperty($,KY,{value:D}),$}(M0.close),M0.closeSync=function(D){function $(X){D.apply(M0,arguments),Ax()}return Object.defineProperty($,KY,{value:D}),$}(M0.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){D8(M0[o0]),i("assert").equal(M0[o0].length,0)})}var LO;if(!global[o0])Rx(global,M0[o0]);AO.exports=MO(jQD(M0));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!M0.__patched)AO.exports=MO(M0),M0.__patched=!0;function MO(D){AQD(D),D.gracefulify=MO,D.createReadStream=V,D.createWriteStream=R;var $=D.readFile;D.readFile=X;function X(_,v,S){if(typeof v==="function")S=v,v=null;return h(_,v,S);function h(b,l,f,j){return $(b,l,function(P){if(P&&(P.code==="EMFILE"||P.code==="ENFILE"))v9([h,[b,l,f],P,j||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var Y=D.writeFile;D.writeFile=J;function J(_,v,S,h){if(typeof S==="function")h=S,S=null;return b(_,v,S,h);function b(l,f,j,P,u){return Y(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))v9([b,[l,f,j,P],y,u||Date.now(),Date.now()]);else if(typeof P==="function")P.apply(this,arguments)})}}var Q=D.appendFile;if(Q)D.appendFile=F;function F(_,v,S,h){if(typeof S==="function")h=S,S=null;return b(_,v,S,h);function b(l,f,j,P,u){return Q(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))v9([b,[l,f,j,P],y,u||Date.now(),Date.now()]);else if(typeof P==="function")P.apply(this,arguments)})}}var Z=D.copyFile;if(Z)D.copyFile=w;function w(_,v,S,h){if(typeof S==="function")h=S,S=0;return b(_,v,S,h);function b(l,f,j,P,u){return Z(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))v9([b,[l,f,j,P],y,u||Date.now(),Date.now()]);else if(typeof P==="function")P.apply(this,arguments)})}}var G=D.readdir;D.readdir=O;var U=/^v[0-5]\./;function O(_,v,S){if(typeof v==="function")S=v,v=null;var h=U.test(process.version)?function(f,j,P,u){return G(f,b(f,j,P,u))}:function(f,j,P,u){return G(f,j,b(f,j,P,u))};return h(_,v,S);function b(l,f,j,P){return function(u,y){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))v9([h,[l,f,j],u,P||Date.now(),Date.now()]);else{if(y&&y.sort)y.sort();if(typeof j==="function")j.call(this,u,y)}}}}if(process.version.substr(0,4)==="v0.8"){var z=RQD(D);M=z.ReadStream,K=z.WriteStream}var q=D.ReadStream;if(q)M.prototype=Object.create(q.prototype),M.prototype.open=I;var B=D.WriteStream;if(B)K.prototype=Object.create(B.prototype),K.prototype.open=N;Object.defineProperty(D,"ReadStream",{get:function(){return M},set:function(_){M=_},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return K},set:function(_){K=_},enumerable:!0,configurable:!0});var W=M;Object.defineProperty(D,"FileReadStream",{get:function(){return W},set:function(_){W=_},enumerable:!0,configurable:!0});var L=K;Object.defineProperty(D,"FileWriteStream",{get:function(){return L},set:function(_){L=_},enumerable:!0,configurable:!0});function M(_,v){if(this instanceof M)return q.apply(this,arguments),this;else return M.apply(Object.create(M.prototype),arguments)}function I(){var _=this;A(_.path,_.flags,_.mode,function(v,S){if(v){if(_.autoClose)_.destroy();_.emit("error",v)}else _.fd=S,_.emit("open",S),_.read()})}function K(_,v){if(this instanceof K)return B.apply(this,arguments),this;else return K.apply(Object.create(K.prototype),arguments)}function N(){var _=this;A(_.path,_.flags,_.mode,function(v,S){if(v)_.destroy(),_.emit("error",v);else _.fd=S,_.emit("open",S)})}function V(_,v){return new D.ReadStream(_,v)}function R(_,v){return new D.WriteStream(_,v)}var x=D.open;D.open=A;function A(_,v,S,h){if(typeof S==="function")h=S,S=null;return b(_,v,S,h);function b(l,f,j,P,u){return x(l,f,j,function(y,c){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))v9([b,[l,f,j,P],y,u||Date.now(),Date.now()]);else if(typeof P==="function")P.apply(this,arguments)})}}return D}function v9(D){D8("ENQUEUE",D[0].name,D[1]),M0[o0].push(D),IO()}var WY;function Ax(){var D=Date.now();for(var $=0;$<M0[o0].length;++$)if(M0[o0][$].length>2)M0[o0][$][3]=D,M0[o0][$][4]=D;IO()}function IO(){if(clearTimeout(WY),WY=void 0,M0[o0].length===0)return;var D=M0[o0].shift(),$=D[0],X=D[1],Y=D[2],J=D[3],Q=D[4];if(J===void 0)D8("RETRY",$.name,X),$.apply(null,X);else if(Date.now()-J>=60000){D8("TIMEOUT",$.name,X);var F=X.pop();if(typeof F==="function")F.call(null,Y)}else{var Z=Date.now()-Q,w=Math.max(Q-J,1),G=Math.min(w*1.2,100);if(Z>=G)D8("RETRY",$.name,X),$.apply(null,X.concat([J]));else M0[o0].push(D)}if(WY===void 0)WY=setTimeout(IO,0)}});var Ex=T((CbD,jx)=>{function e1(D,$){if(typeof $==="boolean")$={forever:$};if(this._originalTimeouts=JSON.parse(JSON.stringify(D)),this._timeouts=D,this._options=$||{},this._maxRetryTime=$&&$.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever)this._cachedTimeouts=this._timeouts.slice(0)}jx.exports=e1;e1.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};e1.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};e1.prototype.retry=function(D){if(this._timeout)clearTimeout(this._timeout);if(!D)return!1;var $=new Date().getTime();if(D&&$-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(D);var X=this._timeouts.shift();if(X===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),X=this._timeouts.shift();else return!1;var Y=this,J=setTimeout(function(){if(Y._attempts++,Y._operationTimeoutCb){if(Y._timeout=setTimeout(function(){Y._operationTimeoutCb(Y._attempts)},Y._operationTimeout),Y._options.unref)Y._timeout.unref()}Y._fn(Y._attempts)},X);if(this._options.unref)J.unref();return!0};e1.prototype.attempt=function(D,$){if(this._fn=D,$){if($.timeout)this._operationTimeout=$.timeout;if($.cb)this._operationTimeoutCb=$.cb}var X=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){X._operationTimeoutCb()},X._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};e1.prototype.try=function(D){console.log("Using RetryOperation.try() is deprecated"),this.attempt(D)};e1.prototype.start=function(D){console.log("Using RetryOperation.start() is deprecated"),this.attempt(D)};e1.prototype.start=e1.prototype.try;e1.prototype.errors=function(){return this._errors};e1.prototype.attempts=function(){return this._attempts};e1.prototype.mainError=function(){if(this._errors.length===0)return null;var D={},$=null,X=0;for(var Y=0;Y<this._errors.length;Y++){var J=this._errors[Y],Q=J.message,F=(D[Q]||0)+1;if(D[Q]=F,F>=X)$=J,X=F}return $}});var Cx=T((CQD)=>{var TQD=Ex();CQD.operation=function(D){var $=CQD.timeouts(D);return new TQD($,{forever:D&&D.forever,unref:D&&D.unref,maxRetryTime:D&&D.maxRetryTime})};CQD.timeouts=function(D){if(D instanceof Array)return[].concat(D);var $={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var X in D)$[X]=D[X];if($.minTimeout>$.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var Y=[];for(var J=0;J<$.retries;J++)Y.push(this.createTimeout(J,$));if(D&&D.forever&&!Y.length)Y.push(this.createTimeout(J,$));return Y.sort(function(Q,F){return Q-F}),Y};CQD.createTimeout=function(D,$){var X=$.randomize?Math.random()+1:1,Y=Math.round(X*$.minTimeout*Math.pow($.factor,D));return Y=Math.min(Y,$.maxTimeout),Y};CQD.wrap=function(D,$,X){if($ instanceof Array)X=$,$=null;if(!X){X=[];for(var Y in D)if(typeof D[Y]==="function")X.push(Y)}for(var J=0;J<X.length;J++){var Q=X[J],F=D[Q];D[Q]=function(w){var G=CQD.operation($),U=Array.prototype.slice.call(arguments,1),O=U.pop();U.push(function(z){if(G.retry(z))return;if(z)arguments[0]=G.mainError();O.apply(this,arguments)}),G.attempt(function(){w.apply(D,U)})}.bind(D,F),D[Q].options=$}}});var Px=T((xbD,HY)=>{HY.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")HY.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")HY.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var LY=T((SbD,k9)=>{var K0=global.process,$8=function(D){return D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function"};if(!$8(K0))k9.exports=function(){return function(){}};else{if(RO=i("assert"),X8=Px(),jO=/^win/i.test(K0.platform),_9=i("events"),typeof _9!=="function")_9=_9.EventEmitter;if(K0.__signal_exit_emitter__)g0=K0.__signal_exit_emitter__;else g0=K0.__signal_exit_emitter__=new _9,g0.count=0,g0.emitted={};if(!g0.infinite)g0.setMaxListeners(1/0),g0.infinite=!0;k9.exports=function(D,$){if(!$8(global.process))return function(){};if(RO.equal(typeof D,"function","a callback must be provided for exit handler"),J8===!1)VY();var X="exit";if($&&$.alwaysLast)X="afterexit";var Y=function(){if(g0.removeListener(X,D),g0.listeners("exit").length===0&&g0.listeners("afterexit").length===0)O3()};return g0.on(X,D),Y},O3=function(){if(!J8||!$8(global.process))return;J8=!1,X8.forEach(function($){try{K0.removeListener($,q3[$])}catch(X){}}),K0.emit=z3,K0.reallyExit=NY,g0.count-=1},k9.exports.unload=O3,d6=function($,X,Y){if(g0.emitted[$])return;g0.emitted[$]=!0,g0.emit($,X,Y)},q3={},X8.forEach(function(D){q3[D]=function(){if(!$8(global.process))return;var X=K0.listeners(D);if(X.length===g0.count){if(O3(),d6("exit",null,D),d6("afterexit",null,D),jO&&D==="SIGHUP")D="SIGINT";K0.kill(K0.pid,D)}}}),k9.exports.signals=function(){return X8},J8=!1,VY=function(){if(J8||!$8(global.process))return;J8=!0,g0.count+=1,X8=X8.filter(function($){try{return K0.on($,q3[$]),!0}catch(X){return!1}}),K0.emit=TO,K0.reallyExit=EO},k9.exports.load=VY,NY=K0.reallyExit,EO=function($){if(!$8(global.process))return;K0.exitCode=$||0,d6("exit",K0.exitCode,null),d6("afterexit",K0.exitCode,null),NY.call(K0,K0.exitCode)},z3=K0.emit,TO=function($,X){if($==="exit"&&$8(global.process)){if(X!==void 0)K0.exitCode=X;var Y=z3.apply(this,arguments);return d6("exit",K0.exitCode,null),d6("afterexit",K0.exitCode,null),Y}else return z3.apply(this,arguments)}}var RO,X8,jO,_9,g0,O3,d6,q3,J8,VY,NY,EO,z3,TO});var Sx=T((_QD,CO)=>{var xx=Symbol();function uQD(D,$,X){let Y=$[xx];if(Y)return $.stat(D,(Q,F)=>{if(Q)return X(Q);X(null,F.mtime,Y)});let J=new Date(Math.ceil(Date.now()/1000)*1000+5);$.utimes(D,J,J,(Q)=>{if(Q)return X(Q);$.stat(D,(F,Z)=>{if(F)return X(F);let w=Z.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty($,xx,{value:w}),X(null,Z.mtime,w)})})}function vQD(D){let $=Date.now();if(D==="s")$=Math.ceil($/1000)*1000;return new Date($)}_QD.probe=uQD;_QD.getMtime=vQD});var fx=T((dQD,W3)=>{var yQD=i("path"),SO=S0(),bQD=Cx(),hQD=LY(),ux=Sx(),Z6={};function B3(D,$){return $.lockfilePath||`${D}.lock`}function uO(D,$,X){if(!$.realpath)return X(null,yQD.resolve(D));$.fs.realpath(D,X)}function xO(D,$,X){let Y=B3(D,$);$.fs.mkdir(Y,(J)=>{if(!J)return ux.probe(Y,$.fs,(Q,F,Z)=>{if(Q)return $.fs.rmdir(Y,()=>{}),X(Q);X(null,F,Z)});if(J.code!=="EEXIST")return X(J);if($.stale<=0)return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));$.fs.stat(Y,(Q,F)=>{if(Q){if(Q.code==="ENOENT")return xO(D,{...$,stale:0},X);return X(Q)}if(!vx(F,$))return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));_x(D,$,(Z)=>{if(Z)return X(Z);xO(D,{...$,stale:0},X)})})})}function vx(D,$){return D.mtime.getTime()<Date.now()-$.stale}function _x(D,$,X){$.fs.rmdir(B3(D,$),(Y)=>{if(Y&&Y.code!=="ENOENT")return X(Y);X()})}function MY(D,$){let X=Z6[D];if(X.updateTimeout)return;if(X.updateDelay=X.updateDelay||$.update,X.updateTimeout=setTimeout(()=>{X.updateTimeout=null,$.fs.stat(X.lockfilePath,(Y,J)=>{let Q=X.lastUpdate+$.stale<Date.now();if(Y){if(Y.code==="ENOENT"||Q)return PO(D,X,Object.assign(Y,{code:"ECOMPROMISED"}));return X.updateDelay=1000,MY(D,$)}if(X.mtime.getTime()!==J.mtime.getTime())return PO(D,X,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let Z=ux.getMtime(X.mtimePrecision);$.fs.utimes(X.lockfilePath,Z,Z,(w)=>{let G=X.lastUpdate+$.stale<Date.now();if(X.released)return;if(w){if(w.code==="ENOENT"||G)return PO(D,X,Object.assign(w,{code:"ECOMPROMISED"}));return X.updateDelay=1000,MY(D,$)}X.mtime=Z,X.lastUpdate=Date.now(),X.updateDelay=null,MY(D,$)})})},X.updateDelay),X.updateTimeout.unref)X.updateTimeout.unref()}function PO(D,$,X){if($.released=!0,$.updateTimeout)clearTimeout($.updateTimeout);if(Z6[D]===$)delete Z6[D];$.options.onCompromised(X)}function gQD(D,$,X){$={stale:1e4,update:null,realpath:!0,retries:0,fs:SO,onCompromised:(Y)=>{throw Y},...$},$.retries=$.retries||0,$.retries=typeof $.retries==="number"?{retries:$.retries}:$.retries,$.stale=Math.max($.stale||0,2000),$.update=$.update==null?$.stale/2:$.update||0,$.update=Math.max(Math.min($.update,$.stale/2),1000),uO(D,$,(Y,J)=>{if(Y)return X(Y);let Q=bQD.operation($.retries);Q.attempt(()=>{xO(J,$,(F,Z,w)=>{if(Q.retry(F))return;if(F)return X(Q.mainError());let G=Z6[J]={lockfilePath:B3(J,$),mtime:Z,mtimePrecision:w,options:$,lastUpdate:Date.now()};MY(J,$),X(null,(U)=>{if(G.released)return U&&U(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));kx(J,{...$,realpath:!1},U)})})})})}function kx(D,$,X){$={fs:SO,realpath:!0,...$},uO(D,$,(Y,J)=>{if(Y)return X(Y);let Q=Z6[J];if(!Q)return X(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));Q.updateTimeout&&clearTimeout(Q.updateTimeout),Q.released=!0,delete Z6[J],_x(J,$,X)})}function mQD(D,$,X){$={stale:1e4,realpath:!0,fs:SO,...$},$.stale=Math.max($.stale||0,2000),uO(D,$,(Y,J)=>{if(Y)return X(Y);$.fs.stat(B3(J,$),(Q,F)=>{if(Q)return Q.code==="ENOENT"?X(null,!1):X(Q);return X(null,!vx(F,$))})})}function cQD(){return Z6}hQD(()=>{for(let D in Z6){let $=Z6[D].options;try{$.fs.rmdirSync(B3(D,$))}catch(X){}}});dQD.lock=gQD;dQD.unlock=kx;dQD.check=mQD;dQD.getLocks=cQD});var bx=T((ubD,yx)=>{var rQD=S0();function oQD(D){let $=["mkdir","realpath","stat","rmdir","utimes"],X={...D};return $.forEach((Y)=>{X[Y]=(...J)=>{let Q=J.pop(),F;try{F=D[`${Y}Sync`](...J)}catch(Z){return Q(Z)}Q(null,F)}}),X}function aQD(D){return(...$)=>new Promise((X,Y)=>{$.push((J,Q)=>{if(J)Y(J);else X(Q)}),D(...$)})}function tQD(D){return(...$)=>{let X,Y;if($.push((J,Q)=>{X=J,Y=Q}),D(...$),X)throw X;return Y}}function sQD(D){if(D={...D},D.fs=oQD(D.fs||rQD),typeof D.retries==="number"&&D.retries>0||D.retries&&typeof D.retries.retries==="number"&&D.retries.retries>0)throw Object.assign(Error("Cannot use retries with the sync api"),{code:"ESYNC"});return D}yx.exports={toPromise:aQD,toSync:tQD,toSyncOptions:sQD}});var gx=T((vbD,l6)=>{var f9=fx(),{toPromise:IY,toSync:AY,toSyncOptions:vO}=bx();async function hx(D,$){let X=await IY(f9.lock)(D,$);return IY(X)}function eQD(D,$){let X=AY(f9.lock)(D,vO($));return AY(X)}function DFD(D,$){return IY(f9.unlock)(D,$)}function $FD(D,$){return AY(f9.unlock)(D,vO($))}function XFD(D,$){return IY(f9.check)(D,$)}function JFD(D,$){return AY(f9.check)(D,vO($))}l6.exports=hx;l6.exports.lock=hx;l6.exports.unlock=DFD;l6.exports.lockSync=eQD;l6.exports.unlockSync=$FD;l6.exports.check=XFD;l6.exports.checkSync=JFD});var px=T((nx)=>{Object.defineProperty(nx,"__esModule",{value:!0});nx.canStoreURLs=nx.FileUrlStorage=void 0;var mx=i("fs"),YFD=FFD(Wx()),cx=QFD(gx());function lx(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,X=new WeakMap;return(lx=function(Y){return Y?X:$})(D)}function QFD(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var X=lx($);if(X&&X.has(D))return X.get(D);var Y={__proto__:null},J=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Q in D)if(Q!=="default"&&{}.hasOwnProperty.call(D,Q)){var F=J?Object.getOwnPropertyDescriptor(D,Q):null;F&&(F.get||F.set)?Object.defineProperty(Y,Q,F):Y[Q]=D[Q]}return Y.default=D,X&&X.set(D,Y),Y}function FFD(D){return D&&D.__esModule?D:{default:D}}function K3(D){return K3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},K3(D)}function ZFD(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function dx(D,$){for(var X=0;X<$.length;X++){var Y=$[X];if(Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y)Y.writable=!0;Object.defineProperty(D,GFD(Y.key),Y)}}function wFD(D,$,X){if($)dx(D.prototype,$);if(X)dx(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function GFD(D){var $=UFD(D,"string");return K3($)=="symbol"?$:$+""}function UFD(D,$){if(K3(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var Y=X.call(D,$||"default");if(K3(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var _bD=nx.canStoreURLs=!0,kbD=nx.FileUrlStorage=function(){function D($){ZFD(this,D),this.path=$}return wFD(D,[{key:"findAllUploads",value:function(){var X=this;return new Promise(function(Y,J){X._getItems("tus::",function(Q,F){if(Q)J(Q);else Y(F)})})}},{key:"findUploadsByFingerprint",value:function(X){var Y=this;return new Promise(function(J,Q){Y._getItems("tus::".concat(X),function(F,Z){if(F)Q(F);else J(Z)})})}},{key:"removeUpload",value:function(X){var Y=this;return new Promise(function(J,Q){Y._removeItem(X,function(F){if(F)Q(F);else J()})})}},{key:"addUpload",value:function(X,Y){var J=this,Q=Math.round(Math.random()*1000000000000),F="tus::".concat(X,"::").concat(Q);return new Promise(function(Z,w){J._setItem(F,Y,function(G){if(G)w(G);else Z(F)})})}},{key:"_setItem",value:function(X,Y,J){var Q=this;cx.lock(this.path,this._lockfileOptions()).then(function(F){J=Q._releaseAndCb(F,J),Q._getData(function(Z,w){if(Z){J(Z);return}w[X]=Y,Q._writeData(w,function(G){return J(G)})})}).catch(J)}},{key:"_getItems",value:function(X,Y){this._getData(function(J,Q){if(J){Y(J);return}var F=Object.keys(Q).filter(function(Z){return Z.startsWith(X)}).map(function(Z){var w=Q[Z];return w.urlStorageKey=Z,w});Y(null,F)})}},{key:"_removeItem",value:function(X,Y){var J=this;cx.lock(this.path,this._lockfileOptions()).then(function(Q){Y=J._releaseAndCb(Q,Y),J._getData(function(F,Z){if(F){Y(F);return}delete Z[X],J._writeData(Z,function(w){return Y(w)})})}).catch(Y)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(X,Y){return function(J){if(J){X().then(function(){return Y(J)}).catch(function(Q){return Y((0,YFD.default)([J,Q]))});return}X().then(Y).catch(Y)}}},{key:"_writeData",value:function(X,Y){var J={encoding:"utf8",mode:432,flag:"w"};(0,mx.writeFile)(this.path,JSON.stringify(X),J,function(Q){return Y(Q)})}},{key:"_getData",value:function(X){(0,mx.readFile)(this.path,"utf8",function(Y,J){if(Y){if(Y.code==="ENOENT")X(null,{});else X(Y);return}try{J=!J.trim().length?{}:JSON.parse(J)}catch(Q){X(Q);return}X(null,J)})}}])}()});var jY=T((n6)=>{Object.defineProperty(n6,"__esModule",{value:!0});Object.defineProperty(n6,"DefaultHttpStack",{enumerable:!0,get:function(){return tx.default}});Object.defineProperty(n6,"DetailedError",{enumerable:!0,get:function(){return qFD.default}});Object.defineProperty(n6,"FileUrlStorage",{enumerable:!0,get:function(){return sx.FileUrlStorage}});Object.defineProperty(n6,"StreamSource",{enumerable:!0,get:function(){return HFD.default}});n6.Upload=void 0;Object.defineProperty(n6,"canStoreURLs",{enumerable:!0,get:function(){return sx.canStoreURLs}});n6.defaultOptions=void 0;Object.defineProperty(n6,"enableDebugLog",{enumerable:!0,get:function(){return zFD.enableDebugLog}});n6.isSupported=void 0;var qFD=Y8(vU()),zFD=_U(),BFD=Y8(gT()),_O=Y8(NC()),WFD=Y8(hC()),KFD=Y8(lC()),tx=Y8(FP()),HFD=Y8(nU()),sx=px();function Y8(D){return D&&D.__esModule?D:{default:D}}function b9(D){return b9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},b9(D)}function VFD(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function rx(D,$){for(var X=0;X<$.length;X++){var Y=$[X];if(Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y)Y.writable=!0;Object.defineProperty(D,DS(Y.key),Y)}}function NFD(D,$,X){if($)rx(D.prototype,$);if(X)rx(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function LFD(D,$,X){return $=RY($),MFD(D,ex()?Reflect.construct($,X||[],RY(D).constructor):$.apply(D,X))}function MFD(D,$){if($&&(b9($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return IFD(D)}function IFD(D){if(D===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function ex(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch($){}return(ex=function(){return!!D})()}function RY(D){return RY=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(X){return X.__proto__||Object.getPrototypeOf(X)},RY(D)}function AFD(D,$){if(typeof $!=="function"&&$!==null)throw TypeError("Super expression must either be null or a function");if(D.prototype=Object.create($&&$.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),Object.defineProperty(D,"prototype",{writable:!1}),$)kO(D,$)}function kO(D,$){return kO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Y,J){return Y.__proto__=J,Y},kO(D,$)}function ox(D,$){var X=Object.keys(D);if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(D);$&&(Y=Y.filter(function(J){return Object.getOwnPropertyDescriptor(D,J).enumerable})),X.push.apply(X,Y)}return X}function y9(D){for(var $=1;$<arguments.length;$++){var X=arguments[$]!=null?arguments[$]:{};$%2?ox(Object(X),!0).forEach(function(Y){RFD(D,Y,X[Y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(X)):ox(Object(X)).forEach(function(Y){Object.defineProperty(D,Y,Object.getOwnPropertyDescriptor(X,Y))})}return D}function RFD(D,$,X){if($=DS($),$ in D)Object.defineProperty(D,$,{value:X,enumerable:!0,configurable:!0,writable:!0});else D[$]=X;return D}function DS(D){var $=jFD(D,"string");return b9($)=="symbol"?$:$+""}function jFD(D,$){if(b9(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var Y=X.call(D,$||"default");if(b9(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var ax=n6.defaultOptions=y9(y9({},_O.default.defaultOptions),{},{httpStack:new tx.default,fileReader:new WFD.default,urlStorage:new BFD.default,fingerprint:KFD.default}),ybD=n6.Upload=function(D){function $(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return VFD(this,$),Y=y9(y9({},ax),Y),LFD(this,$,[X,Y])}return AFD($,D),NFD($,null,[{key:"terminate",value:function(Y){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return J=y9(y9({},ax),J),_O.default.terminate(Y,J)}}])}(_O.default),bbD=n6.isSupported=!0});var H$;var H3=o(()=>{H$={name:"@capgo/cli",type:"module",version:"7.84.9",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLI#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/CLI.git"},bugs:{url:"https://github.com/Cap-go/CLI/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsc --noEmit",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:bundle":"bun test/test-bundle.mjs","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:mcp":"node test/test-mcp.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:payload-split":"bun test/test-payload-split.mjs",test:"bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:credentials && bun run test:credentials-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:esm-sdk && bun run test:mcp && bun run test:version-detection && bun run test:platform-paths && bun run test:payload-split"},devDependencies:{"@antfu/eslint-config":"^7.0.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.4","@capacitor/cli":"^8.0.0","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.0.0","@modelcontextprotocol/sdk":"^1.25.3","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.79.0","@types/adm-zip":"^0.5.7","@types/node":"^25.0.0","@types/prettyjson":"^0.0.33","@types/tmp":"^0.2.6","@vercel/ncc":"^0.38.4","adm-zip":"^0.5.16","ci-info":"^4.3.1",commander:"^14.0.2",eslint:"^9.38.0","git-format-staged":"4.0.1",husky:"^9.1.7","is-wsl":"^3.1.0",micromatch:"^4.0.8",open:"^11.0.0",prettyjson:"^1.2.5",tmp:"^0.2.5","tus-js-client":"^4.3.1",typescript:"^5.9.3",partysocket:"^1.1.11",ws:"^8.18.3",zod:"^4.3.6"}}});async function EY(D){try{let X=`https://registry.npmjs.org/${encodeURIComponent(D.toLowerCase())}`,Y=await fetch(X,{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"}});if(!Y.ok)return null;return(await Y.json())["dist-tags"]?.latest||null}catch{return null}}async function Z0(){let D=await EY("@capgo/cli")??"",$=D?.split(".")[0];if(D!==H$.version)H.warning(`\uD83D\uDEA8 You are using @capgo/cli@${H$.version} it's not the latest version.
131
131
  Please use @capgo/cli@${D}" or @capgo/cli@${$} to keep up to date with the latest features and bug fixes.`)}var O1=o(()=>{vD();H3()});async function YS(D,$,X,Y,J,Q="✅"){await AD(X,{channel:D,event:Y,icon:Q,user_id:$,...J?{tags:{"app-id":J}}:{},notify:!1})}var QS=o(()=>{vD();D6();O1();kD()});import{Buffer as FS}from"node:buffer";import{createHash as TFD}from"node:crypto";function PFD(D){let $=4294967295;for(let X=0;X<D.length;X++){let Y=D[X];$=CFD[($^Y)&255]^$>>>8}return $=$^4294967295,($>>>0).toString(16).padStart(8,"0")}async function i6(D,$="sha256"){let X=FS.isBuffer(D)?D:FS.from(D);if($==="crc32")return PFD(X);let Y=TFD($);return Y.update(X),Y.digest("hex")}var CFD;var V3=o(()=>{CFD=(()=>{let D=[];for(let $=0;$<256;$++){let X=$;for(let Y=0;Y<8;Y++)X=X&1?3988292384^X>>>1:X>>>1;D[$]=X}return D})()});var wS=T((DhD,ZS)=>{var h9=1000,g9=h9*60,m9=g9*60,Q8=m9*24,xFD=Q8*7,SFD=Q8*365.25;ZS.exports=function(D,$){$=$||{};var X=typeof D;if(X==="string"&&D.length>0)return uFD(D);else if(X==="number"&&isFinite(D))return $.long?_FD(D):vFD(D);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(D))};function uFD(D){if(D=String(D),D.length>100)return;var $=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(D);if(!$)return;var X=parseFloat($[1]),Y=($[2]||"ms").toLowerCase();switch(Y){case"years":case"year":case"yrs":case"yr":case"y":return X*SFD;case"weeks":case"week":case"w":return X*xFD;case"days":case"day":case"d":return X*Q8;case"hours":case"hour":case"hrs":case"hr":case"h":return X*m9;case"minutes":case"minute":case"mins":case"min":case"m":return X*g9;case"seconds":case"second":case"secs":case"sec":case"s":return X*h9;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return X;default:return}}function vFD(D){var $=Math.abs(D);if($>=Q8)return Math.round(D/Q8)+"d";if($>=m9)return Math.round(D/m9)+"h";if($>=g9)return Math.round(D/g9)+"m";if($>=h9)return Math.round(D/h9)+"s";return D+"ms"}function _FD(D){var $=Math.abs(D);if($>=Q8)return TY(D,$,Q8,"day");if($>=m9)return TY(D,$,m9,"hour");if($>=g9)return TY(D,$,g9,"minute");if($>=h9)return TY(D,$,h9,"second");return D+" ms"}function TY(D,$,X,Y){var J=$>=X*1.5;return Math.round(D/X)+" "+Y+(J?"s":"")}});var fO=T(($hD,GS)=>{function kFD(D){X.debug=X,X.default=X,X.coerce=w,X.disable=F,X.enable=J,X.enabled=Z,X.humanize=wS(),X.destroy=G,Object.keys(D).forEach((U)=>{X[U]=D[U]}),X.names=[],X.skips=[],X.formatters={};function $(U){let O=0;for(let z=0;z<U.length;z++)O=(O<<5)-O+U.charCodeAt(z),O|=0;return X.colors[Math.abs(O)%X.colors.length]}X.selectColor=$;function X(U){let O,z=null,q,B;function W(...L){if(!W.enabled)return;let M=W,I=Number(new Date),K=I-(O||I);if(M.diff=K,M.prev=O,M.curr=I,O=I,L[0]=X.coerce(L[0]),typeof L[0]!=="string")L.unshift("%O");let N=0;L[0]=L[0].replace(/%([a-zA-Z%])/g,(R,x)=>{if(R==="%%")return"%";N++;let A=X.formatters[x];if(typeof A==="function"){let _=L[N];R=A.call(M,_),L.splice(N,1),N--}return R}),X.formatArgs.call(M,L),(M.log||X.log).apply(M,L)}if(W.namespace=U,W.useColors=X.useColors(),W.color=X.selectColor(U),W.extend=Y,W.destroy=X.destroy,Object.defineProperty(W,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(z!==null)return z;if(q!==X.namespaces)q=X.namespaces,B=X.enabled(U);return B},set:(L)=>{z=L}}),typeof X.init==="function")X.init(W);return W}function Y(U,O){let z=X(this.namespace+(typeof O>"u"?":":O)+U);return z.log=this.log,z}function J(U){X.save(U),X.namespaces=U,X.names=[],X.skips=[];let O=(typeof U==="string"?U:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let z of O)if(z[0]==="-")X.skips.push(z.slice(1));else X.names.push(z)}function Q(U,O){let z=0,q=0,B=-1,W=0;while(z<U.length)if(q<O.length&&(O[q]===U[z]||O[q]==="*"))if(O[q]==="*")B=q,W=z,q++;else z++,q++;else if(B!==-1)q=B+1,W++,z=W;else return!1;while(q<O.length&&O[q]==="*")q++;return q===O.length}function F(){let U=[...X.names,...X.skips.map((O)=>"-"+O)].join(",");return X.enable(""),U}function Z(U){for(let O of X.skips)if(Q(U,O))return!1;for(let O of X.names)if(Q(U,O))return!0;return!1}function w(U){if(U instanceof Error)return U.stack||U.message;return U}function G(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return X.enable(X.load()),X}GS.exports=kFD});var OS=T((US,CY)=>{US.formatArgs=yFD;US.save=bFD;US.load=hFD;US.useColors=fFD;US.storage=gFD();US.destroy=(()=>{let D=!1;return()=>{if(!D)D=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();US.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function fFD(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let D;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(D=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(D[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function yFD(D){if(D[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+D[0]+(this.useColors?"%c ":" ")+"+"+CY.exports.humanize(this.diff),!this.useColors)return;let $="color: "+this.color;D.splice(1,0,$,"color: inherit");let X=0,Y=0;D[0].replace(/%[a-zA-Z%]/g,(J)=>{if(J==="%%")return;if(X++,J==="%c")Y=X}),D.splice(Y,0,$)}US.log=console.debug||console.log||(()=>{});function bFD(D){try{if(D)US.storage.setItem("debug",D);else US.storage.removeItem("debug")}catch($){}}function hFD(){let D;try{D=US.storage.getItem("debug")||US.storage.getItem("DEBUG")}catch($){}if(!D&&typeof process<"u"&&"env"in process)D=process.env.DEBUG;return D}function gFD(){try{return localStorage}catch(D){}}CY.exports=fO()(US);var{formatters:mFD}=CY.exports;mFD.j=function(D){try{return JSON.stringify(D)}catch($){return"[UnexpectedJSONParseError]: "+$.message}}});var zS=T((JhD,qS)=>{qS.exports=(D,$=process.argv)=>{let X=D.startsWith("-")?"":D.length===1?"-":"--",Y=$.indexOf(X+D),J=$.indexOf("--");return Y!==-1&&(J===-1||Y<J)}});var KS=T((YhD,WS)=>{var oFD=i("os"),BS=i("tty"),D$=zS(),{env:l0}=process,p6;if(D$("no-color")||D$("no-colors")||D$("color=false")||D$("color=never"))p6=0;else if(D$("color")||D$("colors")||D$("color=true")||D$("color=always"))p6=1;if("FORCE_COLOR"in l0)if(l0.FORCE_COLOR==="true")p6=1;else if(l0.FORCE_COLOR==="false")p6=0;else p6=l0.FORCE_COLOR.length===0?1:Math.min(parseInt(l0.FORCE_COLOR,10),3);function yO(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function bO(D,$){if(p6===0)return 0;if(D$("color=16m")||D$("color=full")||D$("color=truecolor"))return 3;if(D$("color=256"))return 2;if(D&&!$&&p6===void 0)return 0;let X=p6||0;if(l0.TERM==="dumb")return X;if(process.platform==="win32"){let Y=oFD.release().split(".");if(Number(Y[0])>=10&&Number(Y[2])>=10586)return Number(Y[2])>=14931?3:2;return 1}if("CI"in l0){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((Y)=>(Y in l0))||l0.CI_NAME==="codeship")return 1;return X}if("TEAMCITY_VERSION"in l0)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(l0.TEAMCITY_VERSION)?1:0;if(l0.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in l0){let Y=parseInt((l0.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(l0.TERM_PROGRAM){case"iTerm.app":return Y>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(l0.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(l0.TERM))return 1;if("COLORTERM"in l0)return 1;return X}function aFD(D){let $=bO(D,D&&D.isTTY);return yO($)}WS.exports={supportsColor:aFD,stdout:yO(bO(!0,BS.isatty(1))),stderr:yO(bO(!0,BS.isatty(2)))}});var LS=T((VS,xY)=>{var tFD=i("tty"),PY=i("util");VS.init=YZD;VS.log=$ZD;VS.formatArgs=eFD;VS.save=XZD;VS.load=JZD;VS.useColors=sFD;VS.destroy=PY.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");VS.colors=[6,2,3,4,5,1];try{let D=KS();if(D&&(D.stderr||D).level>=2)VS.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(D){}VS.inspectOpts=Object.keys(process.env).filter((D)=>{return/^debug_/i.test(D)}).reduce((D,$)=>{let X=$.substring(6).toLowerCase().replace(/_([a-z])/g,(J,Q)=>{return Q.toUpperCase()}),Y=process.env[$];if(/^(yes|on|true|enabled)$/i.test(Y))Y=!0;else if(/^(no|off|false|disabled)$/i.test(Y))Y=!1;else if(Y==="null")Y=null;else Y=Number(Y);return D[X]=Y,D},{});function sFD(){return"colors"in VS.inspectOpts?Boolean(VS.inspectOpts.colors):tFD.isatty(process.stderr.fd)}function eFD(D){let{namespace:$,useColors:X}=this;if(X){let Y=this.color,J="\x1B[3"+(Y<8?Y:"8;5;"+Y),Q=` ${J};1m${$} \x1B[0m`;D[0]=Q+D[0].split(`
132
132
  `).join(`
133
133
  `+Q),D.push(J+"m+"+xY.exports.humanize(this.diff)+"\x1B[0m")}else D[0]=DZD()+$+" "+D[0]}function DZD(){if(VS.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function $ZD(...D){return process.stderr.write(PY.formatWithOptions(VS.inspectOpts,...D)+`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capgo/cli",
3
3
  "type": "module",
4
- "version": "7.84.8",
4
+ "version": "7.84.9",
5
5
  "description": "A CLI to upload to capgo servers",
6
6
  "author": "Martin martin@capgo.app",
7
7
  "license": "Apache 2.0",